Restores the Decision-5 IR-readability affordance for main-free
kernels: ail emit-ir gains --emit=staticlib, symmetric with
ail build, reusing the M1-audited Target::StaticLib path via a new
one-line lower_workspace_staticlib convenience. Zero-export guard
byte-identical to build_staticlib's. DESIGN.md widened (not
narrowed) + a pre-existing M1 synopsis omission corrected. 3 new
E2E tests; no fixture minted, no doc pin (E2E is the coverage).
Plan 03493c9.
3.1 KiB
iter emit-ir-staticlib — ail emit-ir --emit=staticlib (M1 fieldtest spec_gap#2)
Date: 2026-05-18
Started from: 03493c9b31
Status: DONE
Tasks completed: 4 of 4
Summary
Resolves M1 fieldtest [spec_gap]#2 ("no public path emits the
staticlib IR though Decision 5 makes IR readability a first-class
LLM affordance") by adding --emit=staticlib to ail emit-ir,
symmetric with the M1-shipped ail build --emit=staticlib. A
one-line codegen convenience lower_workspace_staticlib(ws)
(mirroring lower_workspace) routes through the M1-audited,
unchanged Target::StaticLib forwarder-emission path; the CLI
arm gains an emit: String clap field (symmetric with
Cmd::Build's) and a zero-export guard byte-identical to
build_staticlib's. DESIGN.md is widened (never narrowed) with
a present-tense affordance sentence in §"Embedding ABI (M1)" and a
synopsis correction that also fixes a pre-existing M1 omission for
ail build --emit=staticlib. No new doc pin (architecture
decision): the new E2E file pins the behaviour; the existing
docs_honesty_pin (5 tests) confirmed non-regressed.
Per-task notes
- iter emit-ir-staticlib.1: codegen — added
pub fn lower_workspace_staticlibinailang-codegen/src/lib.rsbetweenlower_workspaceandlower_workspace_inner; delegates tolower_workspace_inner(ws, Gc, Target::StaticLib).cargo build -p ailang-codegenclean. - iter emit-ir-staticlib.2: CLI — RED-first E2E file
crates/ail/tests/emit_ir_staticlib_cli.rs(3 tests), observed RED "1 passed; 2 failed" exactly as predicted; addedemitclap field toCmd::EmitIr, destructured it in the arm, branched the lowering call with the byte-identical zero-export guard (Steps 3+4 honoured as a single compile unit — no cargo between the E0027 window). GREEN: 3 passed;embed_staticlib_cli2 passed (build-side symmetry, no regression). - iter emit-ir-staticlib.3: DESIGN.md — added the present-tense
--emit=staticlibaffordance sentence after the M1 export snippet; synopsis: bothemit-irandbuildlines gained[--emit=staticlib](thebuildcorrection discharges a pre-existing M1 current-state-honesty gap).docs_honesty_pin5/5 green — no new pin, no regression. - iter emit-ir-staticlib.4: regression gate —
ailsuite 186 passed / 0 failed; workspaceTOTAL_PASSED=626= pre-iter 623- 3 (exactly the new tests, no pre-existing test lost); scope check clean (only the 4 in-scope paths).
Concerns
(none)
Known debt
(none — scoped feature fully closed; no fixture minted, no doc pin added, all by explicit plan decision.)
Blocked detail
(none)
Files touched
crates/ailang-codegen/src/lib.rs—lower_workspace_staticlibconveniencecrates/ail/src/main.rs—Cmd::EmitIremitclap field + arm branch + zero-export guardcrates/ail/tests/emit_ir_staticlib_cli.rs— new, 3 E2E tests (positive forwarder-IR / zero-export guard / default-exe regression)docs/DESIGN.md— §"Embedding ABI (M1)" affordance sentence + CLI synopsis (both lines)
Stats
bench/orchestrator-stats/2026-05-18-iter-emit-ir-staticlib.json