Section 01 — lex_error test contract
Goal
Conform every LexError-factory test in lex_error/tests.rs to the one contract: assert the real produced fields AND use the canonical name.
Implementation Sketch
- For each ghost test (tests.rs:74, :289): assert the constructed
LexError’skind,span,context, andsuggestionsagainst expected values (mirror the sibling asserting tests at lines 124/152/227/245/262). - For each weak-named test: rename to
<subject>_<scenario>_<expected>percompiler_repo/scripts/test-naming-lint.py. - Verify:
cargo test -p ori_lexer lex_error::+test-naming-lint.pyclean.
Spec References
.claude/rules/tests.md§Matrix Clamping (a ghost test with no assertion is a false-green); test-naming convention<subject>_<scenario>_<expected>.
Work Items
- Add real produced-field assertions (kind/span/context/suggestions) to the zero-assertion factory test at lex_error/tests.rs:74
- Add real produced-field assertions to the zero-assertion factory test at lex_error/tests.rs:289
- Rename
error_constructionto the canonicalshape - Rename
error_equalityto the canonicalshape - Rename
invalid_byte_errorto the canonicalshape - Rename
detached_doc_warning_structureto the canonicalshape
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “lex-error-test-contract/s-09ab6bea” }, “generated_at”: “2026-06-21T19:29:16.100696+00:00”, “graph_state”: { “head_sha”: “35b6de08”, “last_code_import_at”: “2026-06-21T19:05:19.635Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:lex-error-test-contract/s-09ab6bea] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/lex-error-test-contract” } } }
(full dossier: test-contract—s-09ab6bea.intel.json)