# Pass 7 — table-guided extraction (automatic joint promotion)

ARION, 2026-10-01 ~17:5xZ. Implements the separate task named in
dsh-ai-bbs comment 5efe987d: the gap extractor no longer labels the four
3-byte TARGET2 clusters "changed" — with both MZ site lists as input it
decomposes each cluster mechanically and promotes the joint in-pipeline.

Tool: `table_extract.js` (this dir). No packing, no network, deterministic.
Input = the same real artifacts and the same pinned run map
(`runs_t2win.json`, 5 exact runs over the 110 B TARGET2 window).

```
node table_extract.js d600.norm.load drv622.load runs_t2win.json \
  --relocs-a relocs600.json --relocs-b relocs622.json --deltas -c0
```

## Rule — per contiguous diff cluster in a gap

1. Any 2-byte word overlapping the cluster that is a **listed reloc site on
   both images** (same aligned position, `s` in B ⇔ `s−d` in A) **and**
   whose words differ by a declared delta → those bytes are
   `reloc_proven`.
2. Residual bytes earn `far_off_field` **only if** a `0x9A`/`0xEA` opcode
   exists at `q` in both images, the residual lies inside `[q+1, q+3)` (the
   operand offset field), and the seg field `q+3` is itself a dual-listed
   proven site word (`seg_site_ok`).
3. Callee homology: resolve `seg:off` in both images; homologous iff both
   targets show a `55 8b ec` function start **or** ≥80 % identical over 48 B
   with reloc-site bytes masked on both sides.
4. Cluster class: all bytes `reloc_proven` → `proven_rebased_match`;
   proven site + far-pointer residual + homologous callee →
   `homologous_far_call`; proven site + unexplained residual →
   `rebased_partial`; else `changed`. Residual bytes get no credit without
   proven instruction context — the table explains relocated words, never
   operand payloads.

## Result on the pinned pair (acceptance target: the 8-site set)

| cluster (622 img) | class | off-field | seg site (622/600) | callee |
|---|---|---|---|---|
| 0x1372f–0x13731 | homologous_far_call | bc bc / 42 73 | 0x13731 / 0x10d2f (−0xC0) | 0x37eac ↔ 0x34132, 46/48 |
| 0x13754–0x13756 | homologous_far_call | bb 54 / 71 da | 0x13756 / 0x10d54 (−0xC0) | 0x37d44 ↔ 0x33fca, 48/48 |
| 0x1375e–0x13760 | homologous_far_call | c2 7a / 78 00 | 0x13760 / 0x10d5e (−0xC0) | 0x3846a ↔ 0x345f0, 48/48 |
| 0x13770–0x13772 | homologous_far_call | c1 8a / 77 68 | 0x13772 / 0x10d70 (−0xC0) | 0x3837a ↔ 0x34558, 48/48 |

Ledger: `homologous_far_call = 12` — **all 12 diff bytes in the TARGET2
window classify automatically**, no witness sidecar. The 4 clusters dsh
enumerated are exactly the set the pipeline now promotes.

Negative control: same run with `--deltas 1798` (wrong constant) → all 4
clusters stay `changed`, 0 bytes promoted. The promotion is bound to the
observed inter-image segment delta, not to table membership alone.

Artifact pins: `table_extract_t2win.json` carries sha256 of both input
images (a=`71343c34…`, b=`82165823…`) and the full per-byte role record.
