compiler-API: resume scaffolding for a fresh session

Add the COMPILER-API stream to CLAUDE.md's session-start router and a
`## ⏯ Resume` block to CHECKPOINT-COMPILER-API.md (next action = sub-step 2.2,
read order, build/verify, and the cross-arch snapshot-regen gotcha).
This commit is contained in:
agra
2026-06-17 13:32:33 +03:00
parent cd5b958d19
commit 0b4c50b187
2 changed files with 25 additions and 3 deletions

View File

@@ -339,21 +339,27 @@ Five active workstreams run in parallel — **IR** (the language compiler),
overhaul, mem.sx + protocol expansion), **LANG** (user-facing language
features — diagnostics renderer, heterogeneous variadic packs), and
**ERR** (error handling: separate-channel `!` errors, `try` / `catch` /
`or` / `onfail`, return traces). They touch mostly disjoint files;
any can be advanced independently.
`or` / `onfail`, return traces), and **COMPILER-API** (the comptime `compiler`
library — `#library "compiler"` + `abi(.zig) extern compiler`; welded compiler
types/functions that supersede the metatype `declare`/`define` `#builtin`s and
the `#compiler` attribute). They touch mostly disjoint files; any can be
advanced independently.
1. Read all five checkpoints to see where each stream is paused:
1. Read all checkpoints to see where each stream is paused:
- `current/CHECKPOINT.md` — IR progress tracker.
- `current/CHECKPOINT-FFI.md` — FFI progress tracker.
- `current/CHECKPOINT-MEM.md` — MEM progress tracker + issues log.
- `current/CHECKPOINT-LANG.md` — LANG progress tracker.
- `current/CHECKPOINT-ERR.md` — ERR progress tracker.
- `current/CHECKPOINT-COMPILER-API.md` — COMPILER-API progress tracker
(has a `## ⏯ Resume` block; currently mid-Phase 2 on branch `reify`).
2. Read the plan that corresponds to the stream the user wants to advance:
- `current/PLAN.md` — IR implementation plan.
- `current/PLAN-FFI.md` — FFI ceremony reduction plan.
- `~/.claude/plans/tidy-doodling-cray.md` — MEM (mem.sx) implementation plan.
- `current/PLAN-LANG.md` — LANG implementation plan.
- `current/PLAN-ERR.md` — ERR implementation plan.
- `design/comptime-compiler-api.md` — COMPILER-API design-of-record + build order.
3. Read `specs.md` if you need to understand language behavior.
4. Pick up from the next incomplete step in the relevant `CHECKPOINT*.md`.
If the user hasn't said which stream to work on, ask before picking.

View File

@@ -6,6 +6,22 @@ Companion to the design-of-record
`declare`/`define`/`type_info` `#builtin`s and the `#compiler` struct attribute
with ONE welded mechanism. Branch: `reify` (off `master`). Update after every step.
## ⏯ Resume (fresh session)
Phase 1 is COMPLETE and committed (`cd5b958`); Phase 2 (full byte-layout weld)
just started. **Do sub-step 2.2 next** — make `src/backend/llvm/types.zig`'s
`.@"struct"` case build a welded struct's LLVM type from `compiler_lib.computeWeldPlan`
(offset-ordered field elements + `[N x i8]` padding) with a build-time
`LLVMOffsetOfElement == plan offset` + `LLVMABISizeOfType == total_size` assertion;
cache the plan per TypeId for the GEP sites. The plan math (sub-step 2.1) is done,
pure, and unit-tested — see `computeWeldPlan` in `src/ir/compiler_lib.zig`. Full
2.22.6 breakdown under **## Next step**. Read order: this file → the design doc →
`src/ir/compiler_lib.zig`. Build/verify: `zig build && zig build test` (green now).
> ⚠ Snapshot gotcha: `zig build test -Dupdate-goldens` on this aarch64 host clobbers
> cross-arch examples' CI-captured `.stdout` (1228/1231/1639/1651/16571660) with
> host-specific empties. After regenerating, revert those (`git checkout` / `rm`)
> before committing — they are NOT part of this stream.
## Last completed step
**Phase 2, sub-step 1 — the weld-plan layout math + `StructInfo` registered.**
The de-risked core of the byte-layout-override ("GEP") engine, pure + unit-tested,