Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Checks that need no database. The query gates and the validators need a live
# TuringDB with the corpus loaded, which CI has no way to provide -- running
# them here would mean either skipping silently or building 85k structures on
# every push. They are listed in the README under Verification and are meant to
# be run against a live instance.
name: checks

on:
push:
pull_request:

jobs:
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- run: uv sync --extra dev

- name: ruff
run: uv run ruff check .

- name: the CLI loads and its query library is well formed
run: |
uv run python - <<'PY'
import crystal
assert crystal.LIBRARY, "empty query library"
for name, (desc, cypher, tally) in crystal.LIBRARY.items():
assert desc and cypher, name
assert cypher.upper().startswith(("MATCH", "CALL")), name
if tally:
for col in tally.split("+"):
assert col in cypher, f"{name}: tally column {col} not projected"
print(f"{len(crystal.LIBRARY)} named queries well formed")
PY

- name: front-end destructure arity
run: |
uv run python - <<'PY'
import importlib.util, pathlib, sys
spec = importlib.util.spec_from_file_location(
"g", "tests/check_frontend_queries.py")
g = importlib.util.module_from_spec(spec); spec.loader.exec_module(g)
d = pathlib.Path("visualizer/src/components/viewer/crystal")
files = sorted(d.glob("*.ts")) + sorted(d.glob("*.tsx"))
bad = g.check_destructure_arity(files)
for b in bad:
print(b)
sys.exit(1 if bad else 0)
PY

- name: the front-end query extractor still finds the shipped queries
run: |
uv run python - <<'PY'
import importlib.util, pathlib, sys
spec = importlib.util.spec_from_file_location(
"g", "tests/check_frontend_queries.py")
g = importlib.util.module_from_spec(spec); spec.loader.exec_module(g)
d = pathlib.Path("visualizer/src/components/viewer/crystal")
files = sorted(d.glob("*.ts")) + sorted(d.glob("*.tsx"))
q = g.extract(files)
missing = [t for t in g.REQUIRED_TOKENS
if not any(t in c for _, c in q)]
print(f"extracted {len(q)} queries")
if missing:
print("NOT COVERED: " + ", ".join(missing))
sys.exit(1 if missing or len(q) < 40 else 0)
PY

frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: visualizer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run build
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ node_modules/
# ---- upstream visualizer bits that do not belong in this fork --------------
visualizer/.github/
visualizer/vercel.json

# ---- internal working notes ------------------------------------------------
# docs/DIALECT.md, docs/QUESTIONS.md and docs/PLAN_V2.md catalogue engine gaps
# and open chemistry judgement calls. Useful internally, wrong signal in a
# shared repo (see 059b8a9). Held on the build box instead.
docs/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 TuringDB

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading