fix: harden against confirmed review findings - #2
Conversation
The conformance harness (test/conformance.mojo) printed a pass/total scoreboard but always exited 0, so a future normalization regression would ship green under a "100%" badge. Make it a real gate: exit non-zero when total_pass != total, and assert the corpus parses to exactly 20034 rows so a truncated or swapped NormalizationTest.txt cannot silently shrink coverage while still reporting 100%. Data is unchanged; today's run is a genuine 20034/20034. Add test_conformance_corpus_intact to the unit suite as an independent regression guard on the row count. Also fix the pixi mojo pin: ">=1.0.0b3" sorts ABOVE dev nightlies under PEP 440 (1.0.0b3.dev... < 1.0.0b3), so `pixi install` finds no candidates on the max-nightly channel. Widen to ">=1.0.0b3.dev0,<2" so the build solves against nightly (same fix already applied in mojo-redis). Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 Independent Claude review: Ready to mark for review — no blocking correctness/security issue. The three fixes are each correct. Verified
Non-blocking notes
|
|
Code review (opus, static — verify CI): SHIP-WITH-NITS Scope note for reviewers: this touches zero normalization logic — it's a test-gate fix + a pixi-pin fix, and the finding is legitimate. Nit: |
From an automated multi-agent review (personal-context#62); implemented + verified by Claude Code.
All findings were reproduced on current source, fixed, and re-verified by building and running the suite against Mojo nightly
1.0.0b3.dev2026070506.Fix 1 — conformance harness can never fail CI (test-integrity)
test/conformance.mojoprinted a pass/total scoreboard but always exited 0. A future normalization regression would ship green under a "100%" badge. The CI workflow runs this harness as a step, so the step could never fail.Fix: made it a real gate — exit non-zero when
total_pass != total, and assert the corpus parses to exactlyEXPECTED_ROWS = 20034so a truncated/swappedNormalizationTest.txtcannot silently shrink coverage while still reporting 100%. The Unicode data is unchanged; today's run is a genuine 20034/20034 (100% still true).Before/after evidence (injected a synthetic single-row regression into the harness logic):
GATE FAIL: 1 row(s) failed)GATE FAIL: parsed 998 ... expected 20034)Regression test: added
test_conformance_corpus_intacttotest/test_unicodedata.mojo— independently re-counts the vendored corpus and asserts 20034 rows, so a coverage-shrinking data swap also fails the unit suite. No external services.Bundled build prerequisite — pixi mojo pin
mojo = ">=1.0.0b3,<2"sorts above dev nightlies under PEP 440 (1.0.0b3.dev... < 1.0.0b3), sopixi installfinds no candidates on themax-nightlychannel (the channel only ships dev builds). Verified: old pin fails withNo candidates were found for mojo >=1.0.0b3,<2; widened to>=1.0.0b3.dev0,<2solves and installs cleanly. Same fix already applied in mojo-redis.Verification
mojo run -I src test/test_unicodedata.mojo→ 24 passed, 0 failed (was 23 + 1 new regression test).mojo run -I src test/conformance.mojo→ 20034 / 20034, exit 0.pixi install→ solves with fixed pin (failed with old pin).Notes / parallel-agent overlap
README.mdorCHANGELOG.md(a separate agent is editing those in parallel PRs). The README/CHANGELOG both cite "20,034 / 20,034 rows (100%)" — that count remains accurate and is now the gate's asserted invariant.Draft — do not merge; awaiting Conor's review.