Files
AILang/docs/journals/2026-05-12-iter-ctt.3.md
T

3.9 KiB
Raw Blame History

iter ctt.3 — KindMismatch retire (pure deletion across 3 files)

Date: 2026-05-12 Started from: 0e556f085c Status: DONE Tasks completed: 2 of 2

Summary

WorkspaceLoadError::KindMismatch, its dispatch site in validate_classdefs, its walk_kind_mismatch helper, its Display arm in crates/ail/src/main.rs:workspace_error_to_diagnostic, and the "dead-but-defensive" doc-comment on the canonical-form-rejection test are all retired. Two adjacent textual-consistency edits ride along: the validate_classdefs doc-comment narrows from "Three diagnostics fire from here" to "Two" with a successor sentence naming the new path, and the crates/ailang-check/src/lib.rs:1428 22b.1-era archaeology comment drops the KindMismatch token from its enumeration of class-schema diagnostics and gains a one-line ctt.3 retirement marker. The existing test class_param_in_applied_position_fires_canonical_form_rejection stays green unchanged — it asserts BareCrossModuleTypeRef on the malformed fixture, which is the canonical-form-validator successor the plan named. cargo build --workspace clean, no orphan match arms, no dead-code warnings. cargo test --workspace green (~600 tests across 16 binary-test suites, zero failures).

Per-task notes

  • iter ctt.3.1: atomic deletion pass — 6 Edits across 3 files. workspace.rs ×4 (variant delete; validate_classdefs doc + dispatch-loop delete; walk_kind_mismatch helper delete; "dead-but-defensive" doc delete). main.rs ×1 (W::KindMismatch arm in workspace_error_to_diagnostic). lib.rs ×1 (22b.1 archaeology comment). Build green at Step 7.
  • iter ctt.3.2: workspace-wide test gate — grep substantively clean in crates/ (one residual KindMismatch token at lib.rs:1431 is the ctt.3 retirement marker introduced by Step 6 itself, not a live consumer); canonical-form-rejection test PASS; full cargo test --workspace PASS.

Concerns

  • Plan-internal contradiction surfaced during Task 2 Step 1: the plan's Step 6 new_string deliberately introduces a new KindMismatch token in the ctt.3 retirement marker (// ctt.3: KindMismatch retired — ...), but Task 2 Step 1's verification text says "Expected: zero hits in crates/". The parent spec at docs/specs/2026-05-12-ct-tidy.md:384 is more permissive ("grep KindMismatch returns the three deletion sites only" — accepting the diff itself as the only mention, but silent on a successor archaeology marker). Substantive intent (retire the diagnostic) is met: variant, helper, dispatch, and Display arm are all gone. Treated as compliant with this concern recorded; Boss may choose to either tighten the spec/plan rule for future tidies or accept the retirement-marker pattern (which is already common in the codebase — cf. ctt.1 successor-rationale comments in workspace.rs).
  • Mid-deletion repair on workspace.rs:773 — the dispatch-loop deletion in Step 2 orphaned the mod_name binding that destructured for (mod_name, m) in modules. Plan Step 7's acceptance criterion is "no dead-code warnings" — left as for (mod_name, m) the build would warn unused variable: mod_name. Minimal cleanup applied: rewrote to for m in modules.values(). Same body, same m: &Module type via .values() instead of tuple-destructure. Not in the plan's verbatim edit list but a foreseeable side-effect of the deletion and entirely mechanical.

Known debt

  • None new. The "future tidy may retire" promise in the deleted doc-comment is now this iter; no successor obligation.

Files touched

  • crates/ailang-core/src/workspace.rs (variant delete + doc adjust + dispatch-loop delete + helper delete + test-doc delete + mod_name binding cleanup)
  • crates/ail/src/main.rs (Display arm delete)
  • crates/ailang-check/src/lib.rs (archaeology comment edit)

Stats

bench/orchestrator-stats/2026-05-12-iter-ctt.3.json