From fecbfac5f8e16c876bbd1fc4b5c9de5ba5e0aae8 Mon Sep 17 00:00:00 2001
From: Drew T <50529377+Druthulu@users.noreply.github.com>
Date: Wed, 2 Sep 2026 01:25:56 -0600
Subject: [PATCH] =?UTF-8?q?docs(phase-31):=20=C2=A7412=20=E2=80=94=20?=
=?UTF-8?q?=C2=A7323=20carve=20blocker=202=20was=20a=20regex=20blind=20to?=
=?UTF-8?q?=20=5F=5Fattribute=5F=5F;=205=20of=206=20carve=20overlays=20cle?=
=?UTF-8?q?ared?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/cookbook-index.md | 7 ++++--
docs/matching-cookbook.md | 49 +++++++++++++++++++++++++++++++++++++
phase-ends/CURRENT_PHASE.md | 18 ++++++++++++++
3 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/docs/cookbook-index.md b/docs/cookbook-index.md
index 206e17daa..066e89162 100644
--- a/docs/cookbook-index.md
+++ b/docs/cookbook-index.md
@@ -2,7 +2,7 @@
> **Generated by `tools/cookbook_index.py` — do not hand-edit** (R33). Regenerate after adding a cookbook section.
>
-> `docs/matching-cookbook.md` is ~716 KB / 1079 sections. Grepping it blind is how three P30 wave-1 agents each "discovered" an idiom that was already written down. **Start here, then read the section.** A section appears under every symptom it addresses.
+> `docs/matching-cookbook.md` is ~716 KB / 1080 sections. Grepping it blind is how three P30 wave-1 agents each "discovered" an idiom that was already written down. **Start here, then read the section.** A section appears under every symptom it addresses.
**How to use:** name what you SEE in the diff (a stolen delay slot, an extra `la`, a swapped register pair, a `conflicting types` error), find that symptom below, read those sections first. If nothing fits, THEN grind — and add a section when you win.
@@ -720,7 +720,7 @@
- **§378c** — ★★ — THE FIFTH DECL-BLOCKER VARIANT: THE DRAFT REDECLARES WHAT THE TU ALREADY OWNS (P31 S69) L32722
- **§398** — ★★★ — `family_remap` CARRIES THE **SOURCE** TU's DECL ENVIRONMENT INTO A DESTINATION THAT ALREADY OWNS THOSE NAMES (P31 S69; measured 3 banked of 22) L32835
-### jump tables & switches (57)
+### jump tables & switches (58)
- **§8** — rodata island (compiler jump tables) — the `.data→.rodata→.data` sandwich (Phase 7) L339
- **§8a** — rodata island in a flat OVERLAY — the tail sandwich, per matched jr-function (Phase 26 — PoC PROVEN) L361
@@ -779,6 +779,7 @@
- **§387** — ★★ — **SPLIT-FOLD DISPATCH CLOBBER**: one switch case needs a reload, another must keep the fold (P31 S69; byte-proven main/func_80030F80, 343 ins, escalation 3 → 0) L32361
- **§322b** — ★★★ — THE CARVE CLASS IS COMPLETABLE, AND EVERY WORKTREE `CARVE-REFUSED` WAS AN INSTRUMENT VERDICT (P31 S69, Fable-3 audit; byte-proven end-to-end) L32667
- **§3-A.** — THE ORACLE HAS A HOLE: match_one cannot see a jump table (§405-A) L33098
+- **§412** — ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71) L33424
### optimisation level (-O0/-O2) (22)
@@ -2743,6 +2744,7 @@
- **§3-The** — nine laws this wave produced L33288
- **§410** — ★★★ — COPY THEN ACCUMULATE ON THE COPY: resolving the birthing-boost vs register-allocation dilemma (P31 S71; byte-proven `ov_SC04_015/func_8017EB78`, 98 ins) L33353
- **§411** — ★★★ — THE PACK MUST CARRY THAT FUNCTION'S OWN HISTORY (P31 S71; measured 38/39 vs 124/131) L33386
+- **§412** — ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71) L33424
---
@@ -3834,3 +3836,4 @@ Notes routinely quote that as a section id. This table resolves it. Grep bait: `
| L33288 | §3-The | nine laws this wave produced |
| L33353 | §410 | ★★★ — COPY THEN ACCUMULATE ON THE COPY: resolving the birthing-boost vs register-allocatio |
| L33386 | §411 | ★★★ — THE PACK MUST CARRY THAT FUNCTION'S OWN HISTORY (P31 S71; measured 38/39 vs 124/131) |
+| L33424 | §412 | ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71) |
diff --git a/docs/matching-cookbook.md b/docs/matching-cookbook.md
index ddd27b5f6..4d9d21e60 100644
--- a/docs/matching-cookbook.md
+++ b/docs/matching-cookbook.md
@@ -33420,3 +33420,52 @@ target had already refused at least one earlier wave:
item must be handed it.* An archive of your own verified outcomes is training data for your own
tooling — and a corpus you write but never read is indistinguishable, from the outside, from one you
never wrote.
+
+## §412 ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71)
+
+**The blocker as it presented.** `jr_isolate_all` — the named remedy for the dominant CARVE-REFUSED
+class (§322: *"subseg `_jr_` would host NON-CONTIGUOUS `.rodata` carves"*) — refused two
+overlays outright with a file-scope-decl coverage abort:
+
+```
+0 are function PROTOTYPES … base types: {'Blk4_9B4': 2, 'Blk4': 1}
+e.g. ['extern Blk4_9B4 aD_801CE7A4[] __asm__("D_801CE7A4");', …]
+Fix: carry the naming type (file_scope_types) or add it to src/shared/engine_types.h.
+```
+
+The advice was wrong, and the refusal was honest about the wrong thing: `file_scope_types()` **did**
+return the typedef. What failed was the NAME extraction downstream of it.
+
+**The cause, one regex.** Every type-name scan in the layer builder is
+
+```python
+re.findall(r'\}\s*([A-Za-z_]\w*)\s*;|\b(?:struct|union|enum)\s+([A-Za-z_]\w*)', block)
+```
+
+and the type is written
+
+```c
+typedef struct { u8 b[4]; } __attribute__((packed, aligned(1))) Blk4_9B4;
+```
+
+The attribute sits **between the closing brace and the name**. The first alternative captures
+`__attribute__` and then fails on the following `((`; the second needs a tag after `struct`, and this
+struct is anonymous. So the scan returns NOTHING, `Blk4_9B4` never enters `carried`, every decl naming
+it reads as an unknown type, and the whole overlay is refused. Two overlays, one regex, and an error
+message that pointed at the layer that was working.
+
+**The fix** is to strip attributes before any type-name scan (`_ATTR` / `_strip_attrs` in
+`jr_isolate_all.py`), applied at BOTH extraction sites — the `carried` pre-pass and `_type_names`.
+
+**Measured result.** `ov_SC07_000` and `ov_SC03_029` both isolate, both build **BYTE-IDENTICAL**, and
+`jtbl_carve --probe` moves from `plan-refused` to `tail — standard §8a carve at gate time` on both.
+With the S71 static-placement fix (§411 companion) that is **5 of 6** CARVE-REFUSED overlays cleared:
+`ov_SC03_010`, `ov_SC03_013`, `ov_SC03_092`, `ov_SC07_000`, `ov_SC03_029`. Only `ov_SC06_029` remains,
+and it fails differently — its isolate builds NOT byte-identical, so it is a real resegmentation
+question rather than a scanner gap, and the lane's guard reverted it automatically.
+
+**The law.** *An attribute is grammar, not decoration.* Any scan that locates a declarator by its
+position relative to a brace or a keyword must strip `__attribute__((…))` first — it can legally
+appear between `}` and the name, after the name, and after the parameter list. This is the §134 class
+(a scanner that cannot start where the C grammar actually puts things), and it is now the seventh tool
+in this project to hit it.
diff --git a/phase-ends/CURRENT_PHASE.md b/phase-ends/CURRENT_PHASE.md
index 20558ba11..cbecb3ed9 100644
--- a/phase-ends/CURRENT_PHASE.md
+++ b/phase-ends/CURRENT_PHASE.md
@@ -5406,6 +5406,24 @@ Every one is fuel keyed by BARE NAME or asserted without a freshness check (R48/
reclaim policy. Added `autoMemoryReclaim=gradual` (needs `wsl --shutdown`), reclaimed by hand
(20 GB free → 43.6 GB), and started `.run/memkeeper.sh` as the interim automatic form. SETUP.md updated (R21).
+- 2026-09-02 — **S71 CARVE LANE: 5 of 6 CARVE-REFUSED overlays cleared, two tool defects behind them.**
+ The class's dominant refusal (§322 non-contiguous same-subseg `.rodata`) names `jr_isolate_all` as
+ its remedy, and the isolate then refused 6 of 6 for two unrelated reasons:
+ (a) **file-local `static` definitions** (`bandsetup`, `setup_80188D90` — §82.1 inlined helpers) have
+ no address BY CONSTRUCTION, and the R32 guard was refusing the whole file over them. The isolate now
+ places such a definition with the ONE region that uses it (two users = hard refusal, R43); and
+ `overlay_src_split._proto_from_lines` no longer prefixes `extern` to a decl that already carries a
+ storage class (`extern static inline …` is "multiple storage classes" to cc1).
+ (b) **§323 blocker 2 was one regex** (cookbook **§412**): every type-name scan matched
+ `}\s*(\w+)\s*;`, which reads `__attribute__` as the name and dies on the following `((`, so
+ `typedef struct {…} __attribute__((packed)) Blk4_9B4;` produced NO name, the type never entered
+ `carried`, and every decl naming it read as unknown. The tool's own error message pointed at the
+ layer that was working. Strip attributes first.
+ **Byte-gated, committed, all five BYTE-IDENTICAL:** ov_SC03_010 · ov_SC03_013 · ov_SC03_092 ·
+ ov_SC07_000 · ov_SC03_029 — and `jtbl_carve --probe` moves `plan-refused` → `tail` on every one.
+ `ov_SC06_029` alone builds NOT byte-identical after isolation (auto-reverted by the lane's guard) —
+ a real resegmentation question, not a scanner gap. Cookbook 1080.
+
## 🛑 SESSION CHECKPOINT — S70 FINAL-5 (2026-09-01, TRUE session close). SUPERSEDES EVERY earlier block in this file, including S70 FINAL-4. Phase 31 T5 CONTINUES. Written for a FRESH SESSION that has none of this context.
**STATE:** tree clean at `commit:3582`, no lanes running, nothing in flight. **145 banked this session.**