Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
321488e
feat(ingest): additive schema-v2 write path for test_cases/test_case_…
ashokponkumar Sep 6, 2026
c4303f7
fix(ingest): refuse a test_case_id derived from incomplete input
ashokponkumar Sep 6, 2026
dbbf650
Merge branch 'main' into feat/ingest-v2-tables
ashokponkumar Sep 7, 2026
6fc37cf
refactor(ingest): run_uid -> run_id for the v2 identity
ashokponkumar Sep 8, 2026
680113f
feat(ingest): --schema flag to write v1, v2, or both
ashokponkumar Sep 9, 2026
a79f02e
ci(clickhouse): enable the v2 dual-write in the ingest workflow
ashokponkumar Sep 9, 2026
7b1d1f8
fix(ingest): contain v2 write failures so they cannot cost a v1 row
ashokponkumar Sep 9, 2026
70ac6a1
style(ingest): ruff format
ashokponkumar Sep 9, 2026
b9da64e
refactor(ingest): insert v2 rows through a schema model, not position…
ashokponkumar Sep 9, 2026
ae6a77c
fix(ingest): license headers and per-repo lint on the v2 schema model
ashokponkumar Sep 9, 2026
e4baa6e
style(ingest): sort the v2_schema import into the third-party group
ashokponkumar Sep 9, 2026
05d9338
fix(ingest): anchor the v2_schema sibling import to the script's own …
ashokponkumar Sep 9, 2026
ab81706
style(ingest): satisfy black on the v2 schema tests
ashokponkumar Sep 9, 2026
f37468f
Merge branch 'main' into feat/ingest-v2-tables
ashokponkumar Sep 9, 2026
5262627
fix(ingest): dedup per source file so a sharded run keeps every shard
ashokponkumar Sep 9, 2026
20f4e55
refactor(ingest): one ClickHouse client for both schema generations
ashokponkumar Sep 10, 2026
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
57 changes: 57 additions & 0 deletions .github/scripts/check_v2_schema_drift.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env python3
"""Fail if this repo's copy of v2_schema.py has drifted from the others in MEANING.

The file is copied, not imported: the baked-image ingest runs under
`uv run --no-project`, so there is no sys.path beyond the script's own directory and no
package to install. This check is what keeps the copies honest.

It compares parsed ASTs, not bytes. The repos pin different ruff line lengths (88 here, 100 in
spyre-inference), so byte equality is unachievable while semantic equality is exactly what
matters -- and a formatting-only difference is precisely what made one earlier fix need two
different patches.

Usage: check_v2_schema_drift.py <other copy> [<other copy> ...]
"""

import ast
import sys
from pathlib import Path

HERE = Path(__file__).resolve().parent / "v2_schema.py"


def fingerprint(path: Path) -> str:
"""A signature of the module's MEANING, insensitive to formatting and import order.

Import statements are sorted before dumping: each repo pins its own ruff, and their
isort rules order `typing` against `collections.abc` differently, so the raw AST differs
on files that are otherwise the same code. Comparing raw dumps reported those as drift.
"""
tree = ast.parse(path.read_text(encoding="utf-8"))
imports = [n for n in tree.body if isinstance(n, (ast.Import, ast.ImportFrom))]
rest = [n for n in tree.body if not isinstance(n, (ast.Import, ast.ImportFrom))]
tree.body = sorted(imports, key=ast.dump) + rest
return ast.dump(tree)


def main(argv):
if not HERE.exists():
print(f"ERROR: {HERE} not found", file=sys.stderr)
return 2
mine = fingerprint(HERE)
bad = 0
for other in argv:
p = Path(other)
if not p.exists():
print(f"SKIP {p} (not present)")
continue
if fingerprint(p) == mine:
print(f"OK {p} matches")
else:
print(f"DRIFT {p} differs in meaning from {HERE}", file=sys.stderr)
bad += 1
return 1 if bad else 0


if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
Loading
Loading