plan: prep.1 type-scoped namespacing — 5-task atomic resolver + 12-fixture migration (refs #31)

The plan covers the first iteration of the kernel-extension-mechanics
milestone: type-scoped `<TypeName>.<member>` resolution in
`ailang-check`, narrowed `BareCrossModuleTypeRef` /
`BadCrossModuleTypeRef` diagnostics in `ailang-core::workspace`,
two new `CheckError` variants, CLI diagnostic-message rewording,
and atomic rewrite of 12 `.ail` example fixtures from `std_X.Y` to
the type-scoped form. Five tasks, each unit-of-review.

Includes a spec correction (same commit because plan recon
surfaced it): the prep.1 Blast Radius previously claimed
`hash_pin.rs` + `prelude_module_hash_pin.rs` refreshes and a
`design_schema_drift.rs` pin addition. Plan-recon walked every
test crate (per the schema-camelcase-fix hash-pin-blast-radius
lesson) and found:
  * neither hash-pin file pins any fixture in prep.1's migration
    set — refresh is empty;
  * type-scoped resolution is a checker-only change (no new JSON
    tags, no AST shape change) — the drift pin belongs to prep.2
    (`Term::New`) and prep.3 (`kernel: true` + `param-in`), not
    prep.1.

Spec section 'Blast radius' and the 'Iteration scope' summary now
reflect the recon-cleared reality.
This commit is contained in:
2026-05-28 14:04:01 +02:00
parent 832375f2ac
commit 46c9aabf00
2 changed files with 632 additions and 28 deletions
+46 -28
View File
@@ -139,36 +139,52 @@ collision disambiguator (no current collisions exist).
**Blast radius.** Per `grep -rE 'std_(maybe|pair|list|either)\.' examples/ crates/`:
- **`.ail` example fixtures** (~14 files): `ct_2_bare_cross_module.ail`,
- **`.ail` example fixtures** (12 with cross-module refs, plus the
three defining modules with no refs): `ct_2_bare_cross_module.ail`,
`ct_3b_bad_qualified_known_module.ail`, `nested_pat.ail`,
`std_either.ail`, `std_either_demo.ail`, `std_either_list.ail`,
`std_either_demo.ail`, `std_either_list.ail`,
`std_either_list_demo.ail`, `std_list.ail`, `std_list_demo.ail`,
`std_list_more_demo.ail`, `std_list_stress.ail`, `std_maybe.ail`,
`std_maybe_demo.ail`, `std_pair.ail`, `std_pair_demo.ail`.
Each rewritten from `std_X.Y` to `Y` (type-scoped) where Y is
type-associated. The defining modules (`std_maybe.ail` etc.)
may keep their internal references unchanged (intra-module refs
are bare today already).
- **Corresponding `.ail.json` fixtures** for round-trip and hash-pin tests.
- **Hash-pin files** (2): `crates/ailang-core/tests/hash_pin.rs` and
`crates/ailang-surface/tests/prelude_module_hash_pin.rs`. Both
refreshed with new hashes. Each refresh carries an Honesty-Rule
provenance comment quoting the prep.1 commit and naming the
surface change.
`std_list_more_demo.ail`, `std_list_stress.ail`,
`std_maybe_demo.ail`, `std_pair_demo.ail`. Each rewritten from
`std_X.Y` to `Y` (type-scoped) where Y is type-associated. The
three defining modules `std_either.ail`, `std_maybe.ail`,
`std_pair.ail` contain no cross-module references and need no
body changes (intra-module refs are bare today already).
`ct_2_bare_cross_module.ail`'s role flips semantically: it stays
RED (the unimported bare type case still fires
`BareCrossModuleTypeRef` under the narrowed rule), but the
diagnostic *message* it asserts is the new one.
- **No corresponding `.ail.json` fixtures.** None of the 15
spec-named `.ail` files have a sibling `.ail.json` round-trip
pin in the tree.
- **Source-side reference** in `crates/ailang-{check,codegen,surface}/src/`
and `crates/ail/tests/e2e.rs` (~7 files): inspect during recon
whether they hardcode `std_maybe`/`std_pair`-style identifiers
in diagnostic strings or test fixtures. Diagnostic strings
update to new vocabulary; test fixtures update to type-scoped.
Production type-resolution logic is the new code.
- **Drift test** `crates/ailang-core/tests/design_schema_drift.rs`
gains a new pin that exercises the type-scoped resolution end-
to-end at the schema level.
and `crates/ail/tests/e2e.rs` (7 files): doc-comments and
test-helper code mentioning `std_X.Y` vocabulary update to
type-scoped vocabulary. Production type-resolution logic is the
new code. The specific sites are enumerated in the prep.1 plan.
- **CLI diagnostic renderer + assertion update**:
`crates/ail/src/main.rs:1249-1278` (the `BareCrossModuleTypeRef`
and `BadCrossModuleTypeRef` translation arms) and
`crates/ail/tests/ct1_check_cli.rs:154` (an assertion on the old
"ail migrate-canonical-types" hint string) move with the
diagnostic-message narrowing.
The 14 `.ail` examples are rewritten atomically with the resolver
change in a single iteration commit. Walking *every* test crate
for hash-pin sites is mandatory (per the
`hash-pin blast-radius audit` lesson from `schema-camelcase-fix`).
**No hash-pin or schema-drift work in prep.1.** The hash-pin audit
across every test crate (per the `hash-pin blast-radius audit`
lesson from `schema-camelcase-fix`) is mandatory and was performed
during prep.1's plan recon. Result: `crates/ailang-core/tests/hash_pin.rs`
pins `sum.ail`, `list.ail`, `ordering_match.ail`,
`test_22b1_dup_a.ail`, `test_22b1_dup_classmod.ail` — none of which
contain `std_X.Y` references; `crates/ailang-surface/tests/prelude_module_hash_pin.rs`
pins `prelude.ail` — also no `std_X.Y` references. **No pin refresh
applies to prep.1.** The `prelude_module_hash_pin.rs` refresh
happens in prep.3 when `kernel: true` lands on the prelude module.
Schema-drift pins in `crates/ailang-core/tests/design_schema_drift.rs`
also do not apply: type-scoped resolution is a checker change with
no new JSON tags, no new enum variants, no AST shape changes. The
drift pins for this milestone land in prep.2 (new `t: "new"` tag,
new `NewArg` JSON) and prep.3 (new `kernel`, `param-in` schema
attrs).
**Integration with existing mechanisms.**
@@ -702,8 +718,10 @@ Milestone closes when:
The plan that follows this spec carves the work into three
iterations:
- **prep.1** — Type-scoped namespacing. Resolver change + 14
example rewrites + 2 hash-pin refreshes.
- **prep.1** — Type-scoped namespacing. Resolver change + 12
example rewrites + diagnostic-message narrowing + ct1_check_cli
assertion update. No hash-pin or drift-test work (audit cleared
during plan recon; pins live in prep.2/3).
- **prep.2** — `Term::New`. AST + surface + checker arg-kind
enforcement.
- **prep.3** — Kernel-tier modules + `param-in`. Schema +