100%

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’s kind, span, context, and suggestions against expected values (mirror the sibling asserting tests at lines 124/152/227/245/262).
  • For each weak-named test: rename to <subject>_<scenario>_<expected> per compiler_repo/scripts/test-naming-lint.py.
  • Verify: cargo test -p ori_lexer lex_error:: + test-naming-lint.py clean.

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_construction to the canonical shape
  • Rename error_equality to the canonical shape
  • Rename invalid_byte_error to the canonical shape
  • Rename detached_doc_warning_structure to the canonical shape

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)