iter 22-tidy.4: journal entry

This commit is contained in:
2026-05-10 04:21:18 +02:00
parent 557bf57cdb
commit e37d099edb
+44
View File
@@ -12156,3 +12156,47 @@ Resolution:
shape" in the JOURNAL queue.
Milestone closed: drift items 1 and 3 tidied; item 2 queued.
## 2026-05-10 — Iteration 22-tidy.4: primitive-name-set consolidation
Closing the milestone-22 carried-debt item flagged in the 22b.3
JOURNAL and re-flagged at milestone-22 audit close: the
primitive-name set `{Int, Bool, Str, Unit}` was duplicated across
five sites (`crates/ailang-codegen/src/subst.rs:169`,
`crates/ailang-check/src/linearity.rs:143`,
`crates/ailang-check/src/lib.rs:1279` and `:2261`,
`crates/ailang-check/src/mono.rs:316-327`).
This iteration introduces `crates/ailang-core/src/primitives.rs`
exporting `is_primitive_name(&str) -> bool` plus
`primitive_surface_name(&str) -> Option<&'static str>`. The four
`matches!` consumer sites now route through the predicate; the
mono-pass surface-name helper retains its outer zero-arity gating
and delegates the inner mapping to the same module. A unit test
`predicate_and_surface_name_agree` in `primitives.rs` pins the
lockstep invariant between the two functions (a future regression
where only one is extended fails the test before it can ship).
Tasks (commit subjects):
- 22-tidy.4: ailang-core::primitives — single home for the
primitive-name set
- 22-tidy.4: pin lockstep invariant + tighten module doc
- 22-tidy.4: route 4 matches! sites through is_primitive_name
- 22-tidy.4: mono::primitive_surface_name delegates to ailang-core
Acceptance: 4 `matches!` sites + 1 mono.rs site routed; full
workspace test sweep 346 green (345 + the new lockstep test);
bench gates 0/0/0; grep confirms no remaining duplicate predicate
outside `crates/ailang-core/src/primitives.rs`.
The audit-flagged milestone-22 carried-debt item closes; the
remaining carried items (parse-fn/data/const strict
duplicate-clause detection, Form-B prose printer arms for
ClassDef/InstanceDef, defensive lib.rs gap-related sites) stay
queued.
Observation, not debt: `crates/ailang-codegen/src/drop.rs:379` has
a `matches!(name.as_str(), "Str")` single-element check (not the
4-set) — distinct invariant (heap-string-only semantics), out of
scope for this consolidation.