Two unrelated hygiene iters bundled because they shipped together in one autonomous-while-Boss-away batch: - iter rustdoc-sweep: cleared all 23 `cargo doc --workspace --no-deps` warnings (17 in ailang-check + 4 in ailang-core + 2 in ailang-surface). Two warning classes: pub-doc-comment links to pub(crate)/private items (15 hits — replaced with plain backtick-code-spans), and unresolved/ambiguous links (8 hits — fully-qualified, disambiguated to fn-form, or escaped). No behaviour change; tests 562 → 562. - iter drift-test-narrowing: design_schema_drift.rs now scans §"Data model" only via new helper data_model_section(), instead of full DESIGN.md. Closes the audit-form-a-precursor [high] "anchor-elsewhere-passes-silently" failure mode. All 38 anchors verified pre-edit to live in §"Data model" so the tightening doesn't regress to red. New pin data_model_section_is_bounded guards the extractor against silent regression. Tests 562 → 563.
1.8 KiB
iter drift-test-narrowing — design_schema_drift.rs scans §"Data model" only
Date: 2026-05-13 Started from: rustdoc-sweep working-tree state Status: DONE
Summary
crates/ailang-core/tests/design_schema_drift.rs is the
drift-detection layer between AST enum definitions in
crates/ailang-core/src/ast.rs and the canonical schema
documentation in docs/DESIGN.md §"Data model". Each AST variant
must have its JSON-schema anchor (e.g. "t": "lit", "k": "fn")
documented; the tests assert presence of each anchor.
Pre-iter, the assertion was DESIGN_MD.contains(anchor) —
substring search over the whole document. That was loose: an
anchor present only in §"Decision 11" (or any other discussion
section) was treated as documented even though §"Data model" —
the canonical schema reference section — was missing it. The
audit-form-a-precursor [high] drift report flagged this as the
silent-pass failure mode.
This iter narrows the scan. New helper data_model_section()
extracts the slice of DESIGN_MD from the ## Data model header
to the next top-level ## header. The 7 existing anchor tests
now call data_model_section().contains(anchor) instead of
DESIGN_MD.contains(anchor). All 38 anchors verified present in
§"Data model" pre-edit (no regressions). A new test
data_model_section_is_bounded pins the extractor itself
(starts-with ## Data model, does not bleed past \n## Pipeline,
length > 1 KB) so a future refactor cannot silently regress the
extractor to whole-document scanning.
Files touched
crates/ailang-core/tests/design_schema_drift.rs(M)
Verification
cargo test -p ailang-core --test design_schema_drift→ 8 passed (was 7; +1 for the bounded-section pin), 0 failed.cargo test --workspace→ 563 passed (was 562; +1 from the new pin), 0 failed.
Concerns
- (none)
Known debt
- (none)