# iter ctt.1 — Env-overlay shape ratification

**Date:** 2026-05-12
**Started from:** 0a36294e61f08d8de85c084415d694d3736e0c67
**Status:** DONE
**Tasks completed:** 3 of 3

## Summary

Ratifies the two-overlay shape of the check environment (`env.types`
+ `env.ctor_index`) and pins its load-bearing consumer. The split
decision now has a DESIGN.md anchor (§"Env construction") explaining
the owning-index / reverse-index roles, the rationale for not
collapsing into one variant-keyed map, and the intentional asymmetry
with the mono side (narrowed to types-only at ct.3.2, because its
runtime-ctor-lookup consumer story differs from the check side's
in-band `DuplicateCtor` diagnostic). A new behavioural-pin test
(`crates/ailang-check/tests/duplicate_ctor_pin.rs`) asserts
`code == "duplicate-ctor"` plus message-substring coverage for a
two-ADT-same-ctor fixture, going red if the per-module rebuild at
`crates/ailang-check/src/lib.rs:1342-1384` is ever silently removed.
Two P2 roadmap todos struck `[x]` with one-line forward-references to
this iter. No production-code edits. `cargo test --workspace` green.

## Per-task notes

- iter ctt.1.1: New pinning test `crates/ailang-check/tests/duplicate_ctor_pin.rs` — builds a `Workspace` inline with one module declaring `type Cat = Twins` and `type Dog = Twins`, calls `check_workspace`, asserts a `Diagnostic` with `code == "duplicate-ctor"` plus message substring for `Twins` / `Cat` / `Dog`. PASS on first run, as the plan predicted (behaviour pre-exists).
- iter ctt.1.2: Inserted new top-level section `## Env construction` in `docs/DESIGN.md` between `## Convention: qualified cross-module references` (line 1941) and `## Data model` (now line 1988, was 1959 pre-edit). Three paragraphs: split definition, rationale, check-side / mono-side asymmetry. Cross-references the pinning test.
- iter ctt.1.3: Two `[ ]` → `[x]` strikes in `docs/roadmap.md` at lines 79 (overlay shape question) and 183 (per-module overlay narrowing). Each gains a one-line forward-reference suffix on its `context:` line pointing at iter ctt.1 and the closing artefact.

## Concerns

(none)

## Known debt

(none)

## Files touched

- `crates/ailang-check/tests/duplicate_ctor_pin.rs` (new)
- `docs/DESIGN.md` (modified — `## Env construction` section inserted)
- `docs/roadmap.md` (modified — two strikes)

## Stats

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