Repository navigation
Commit 4c52ebc
committed
docs(adr): ADR-0178 — derive the placement index instead of maintaining it
Smell-audited: depth 3: new ADR + ADR-0033 amendment. The smell that opened
this cycle was mine, not the code's. I drafted "retire the Pattern A/B plan;
Zig is the finished form for hot paths" on the strength of two claims, and the
mandatory Devil's-advocate fork refuted both against the files:
1. The six `ready_for_migration` rows I read as "scheduled to move count/seq/
first into .clj, which would cost perf" are `pattern: B1` with NO
`target_loc`. ADR-0033 D3 defines B1 as Zig-with-no-.clj — B1's finished
form IS Zig. I attacked a straw man, and my proposed policy was already
ADR-0033 D5 ("fast-path = Tag switch") restated.
2. The plan was not unexecuted. D-062 was discharged 2026-05-27; set.clj /
string.clj / walk.clj carry 12 / 21 / 11 real (def …) bodies. What rotted
was the LEDGER, not the plan — 42 rows still read `transient_zig` for vars
whose .clj had shipped.
I re-verified every one of those against the tree before acting on it, plus the
fork's two extra findings (two `leaf_loc` paths point at nonexistent files; the
`--list-vars` consumer the file cites has never been built). All confirmed. The
fork also blocked the F-003 seizure: retiring an unbuilt-residual placement
policy is not this cycle's to make, so no forward policy is stamped.
So the fix is not deletion and not repair-by-hand — it is derivation:
- `(cljw.internal/__dump-placement)` derives each Var's implementation home
from its root tag (`builtin_fn` → zig, `fn_val`/`multi_fn` → clj, else value/
unbound) plus its flags. Decided by the runtime, so it cannot be wrong.
- `scripts/gen_placement.sh` requires every bundled namespace first —
namespaces are lazy (ADR-0163), so a bare dump under-reports — and renders
data/placement.yaml. 49 hand-written rows became **1,326 generated ones
across 31 namespaces**.
- `scripts/check_placement_status.sh` is now the `placement_drift` gate:
regenerate, diff, fail. Its old body audited the completed migration.
I narrowed the fork's proposal in one place, deliberately. It asked for the
full A/B1/B2/C-thin split via an AST classifier over the .clj bodies; that
classifier must handle `(def x (fn* …))`, multi-arity fn*, macros and computed
defs, and a misclassified generated row is a NEW lie class. The root-tag axis
is reported, not inferred. An index that guesses is worse than one that
reports; the finer split rides on top when a consumer needs it (`zig-leaf`
already separates B1 from a B2 leaf).
Two things the index made visible that no document could have:
- 394 vars are Zig-implemented and **725 are Clojure-implemented**. The audit
that opened this cycle argued from the 124.7K:8.8K LOC ratio that the Clojure
surface was structurally thin. At the var level it is the majority. LOC was
the wrong denominator.
- `clojure.spec.alpha` appears with 123 clj vars + 17 values. It is bundled and
working — and the same audit recorded it as unimplemented, because
docs/works/ladder.md and COVERAGE.md carry no row for it. A working feature
missing from the ledgers misleads exactly like a broken one.
Smoke green (7 passed / 0 failed, corpus 4253/4253).1 parent c601aa7 commit 4c52ebc
11 files changed
Lines changed: 2036 additions & 616 deletions
File tree
- .claude
- .dev
- decisions
- data
- scripts
- src/lang/primitive
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
598 | 601 | | |
599 | 602 | | |
600 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
| 677 | + | |
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| |||
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2054 | 2059 | | |
2055 | 2060 | | |
2056 | 2061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
0 commit comments