Skip to content

fix(tier1): count from the artifact when the cache eats the summary; content-keyed reach; anti-stall ratchet (#439) - #442

Merged
justrach merged 1 commit into
mainfrom
fix/439-tier1-rot
Aug 6, 2026
Merged

fix(tier1): count from the artifact when the cache eats the summary; content-keyed reach; anti-stall ratchet (#439)#442
justrach merged 1 commit into
mainfrom
fix/439-tier1-rot

Conversation

@justrach

@justrach justrach commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Fixes #439 — all three defects in the tier-1 gate, each with a demonstrated proof (details in the commit; 4 green end-to-end runs, cold 61s / warm 21s).

  1. Cached-run count parse: on this zig a fully-cached zig build test prints no N/N tests passed line, so the tests check red-flagged green builds. New shared resolver (tier1_test_binary.py) finds the right .zig-cache/o artifact and reads All N tests passed. off it directly. Same fallback wired into invariants (its filtered builds cache and go silent identically). Proof: old script FAILs on a hot cache, new one reports 994 both hot and cold.
  2. Baseline + anti-stall: test_count_baseline 656 → 994 (measured), plus test_count_slack: 25 — a count more than slack above the baseline exits 3 and the verdict line carries WARN: the ratchet has stalled while staying green, so the baseline can never silently sit 350 behind again. Floor semantics unchanged (994 baseline / 993 observed still FAILs); nothing auto-raises. Full probe matrix in the commit.
  3. Filtered-build reach misfire: -Dtest-filter drops tests at compile time, so the declared-test byte-strings a binary contains identify which build it is — full (961 names), floor (0), invariants (9). Reachability now selects by content and explicitly logs when it ignores a newer-but-filtered artifact. A/B on an identical cache: old reports "952 tests NOT compiled in" (exactly 961−9 — the mechanism), new correctly finds all 961.

Honest cost: warm tier-1 is ~21s (was ~5s-but-failing) because the fallback genuinely re-executes the suite instead of trusting a run that never happened — still inside the script's stated ~30s budget. The cheaper --listen metadata-query route is noted in AGENTS.md as the escape hatch, deliberately not taken (binding the gate to a wire format is the failure class that broke it here).

No Zig touched; golden harness unaffected. Three agents independently hit these false-FAILs this week — this restores trust in the gate that has caught real regressions before.

…s stalling (#439)

Three ways the gate lied on a build that was green.

A fully cached `zig build test` on zig 0.17 prints "Build Summary: 4/4 steps
succeeded" and no "N/N tests passed" line, because the run step never re-ran.
The sed came back empty and the tests check FAILED - the field workaround was
`rm -rf .zig-cache/h`. Ask the artifact instead: a test binary run with no
arguments prints "All N tests passed." every time, cached or not, and running it
re-proves the suite besides. The same fallback covers the two filtered builds in
the invariants check, which cache and go quiet identically on a second run.

Picking that artifact by mtime is the second bug. `.zig-cache/o` holds one
binary per distinct build and every `-Dtest-filter` build lands there too, so
after the invariants check - or any hand-run filtered build - the newest binary
holds only the tests that filter matched, and reachability reported the other
952 declared tests as "not compiled in". Selection moves to content:
`-Dtest-filter` drops non-matching tests at compile time, names and all, so the
build we want is the one whose declared-name set matches what its filters
select. mtime only breaks ties.

And test_count_baseline was 656 against a suite of 994, a floor low enough to
miss a whole module falling out of the test root. It is now 994, still a floor
nothing raises on its own, but `count` exits 3 - a warning, never a failure -
once the suite runs more than test_count_slack (25) ahead of it, so it cannot
silently sit 350 behind again.

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
@justrach
justrach merged commit a7834c9 into main Aug 6, 2026
6 checks passed
@justrach
justrach deleted the fix/439-tier1-rot branch August 6, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eval-tier1: stale test-count baseline (656 vs 1000+), cached-run count parse failure, and filtered-build reach misfire

1 participant