Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

fix(eval): name the required invariants from the script, not an inline one-liner

Rach Pradhanb27ee662d062
diff --git a/scripts/eval-tier1.sh b/scripts/eval-tier1.sh
old mode 100755
new mode 100644
index ca8a1077..251ba29d
--- a/scripts/eval-tier1.sh
+++ b/scripts/eval-tier1.sh
@@ -166,8 +166,8 @@ if wanted invariants; then
else
printf ' filtered run: %s tests, floor %s\n' "$named" "$floor"
if python3 scripts/eval/tier1_invariants.py invariants --observed "$((named - floor))"; then :; else
- printf ' the required set is listed in scripts/eval/tier1-manifest.json:\n'
- python3 -c 'import json,sys; m=json.load(open("scripts/eval/tier1-manifest.json")); [print(f" {e[\"id\"]}: {e[\"test\"]}") for e in m["required_invariants"]]'
+ printf ' the required set (scripts/eval/tier1-manifest.json):\n'
+ python3 scripts/eval/tier1_invariants.py list
record_fail invariants
fi
fi
diff --git a/scripts/eval/tier1_invariants.py b/scripts/eval/tier1_invariants.py
old mode 100755
new mode 100644
index a7f002b0..dbd3174f
--- a/scripts/eval/tier1_invariants.py
+++ b/scripts/eval/tier1_invariants.py
@@ -134,6 +134,7 @@ def main() -> None:
sub = parser.add_subparsers(dest="cmd", required=True)
sub.add_parser("static")
sub.add_parser("filters")
+ sub.add_parser("list")
count = sub.add_parser("count")
count.add_argument("--observed", type=int, required=True)
inv = sub.add_parser("invariants")
@@ -148,6 +149,11 @@ def main() -> None:
print(entry["test"])
return
+ if args.cmd == "list":
+ for entry in manifest["required_invariants"]:
+ print(f" {entry['id']}: {entry['test']}")
+ return
+
if args.cmd == "docs-only":
sys.exit(0 if docs_only(args.paths, manifest) else 1)
@@ -191,10 +197,13 @@ def main() -> None:
print(
f" FAIL {args.observed} of {expected} named invariants ran under"
" -Dtest-filter.\n"
- " A named test exists in the source but did not run, which means the\n"
- " module holding it is no longer pulled into the test root.\n"
- " fix: `scripts/eval-tier1.sh --only invariants` names the set;\n"
- " reference the module from src/main.zig's `test {}` block.",
+ " Either one of them is gone from the source, or it is still there and\n"
+ " its module is no longer pulled into the test root - in which case it\n"
+ " compiles to nothing and the suite still reports green.\n"
+ " fix: `scripts/eval-tier1.sh --only reach` names any invariant that\n"
+ " vanished from the source. If that passes, the test exists but\n"
+ " never runs: reference its module from src/main.zig's `test {}`\n"
+ " block (`_ = @import(\"x.zig\");`).",
file=sys.stderr,
)
sys.exit(1)