Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .claude/board/AGENT_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
## 2026-08-25 — ABI minors 6→8 + board hygiene (main thread, no fan-out)

Straight-line main-thread work; no subagents spawned, so no tag-files to
consolidate. Three rungs and a documentation pass.

**Minor 6** — `lgj_reduce_facet_sum_resolved`, gated on lance-graph
#1025 (`ClassView::cascade_shape`). Two operator corrections landed
mid-build and both were right: the resolution belongs cached BESIDE the
mask (not recomputed per call), and the classid→carving table is
PROCESS-GLOBAL, not per dataset — *"the classids are not different from
SoA to SoA."* My first version keyed it per dataset, which would have
been a second source of truth for a global fact.

**Minor 7** (PR #30) — `lgj_row_layout_probe`. My own test expectation
was wrong here, not the code: `maskOfFacetClass(facet 3, …)` constrains
facet 3 ONLY, so 1/32 aligned is the correct measurement.

**Minor 8** (PR #32) — the carving encoding made data. Also fixed the
latent load-gate defect the change made reachable.

**Mistake owned:** ran `git checkout` on `kernels.rs` to undo a
disable-run edit and destroyed the uncommitted work in that file.
Reconstructed, re-verified to the same 134-test count. Disable-runs now
back up to a file first; `git checkout` is never the undo for one.

**Second mistake owned:** PR #32 was stacked on PR #30's branch and #30
merged to main first, so minor 8 never reached main —
`ISS-LGJ-STACK-TAIL-STRANDED-MINOR-8`. Caught by checking `git log
origin/main` on a wake event rather than trusting the "merged"
notification.

**Board hygiene this pass** (operator: *"please also keep documentation
updated, .claude/board similar to lance-graph board"*):
`CROSS_REPO_PRS.md` CREATED (modeled on lance-graph's; this repo had no
ledger of the three upstream PRs it is gated on, despite the
missing-capability STOP rule being one of its own iron rules);
`README.md` CREATED (the file set + what each is for + the hygiene
rules, which previously existed only as one bullet in the root
`CLAUDE.md`); `STATUS_BOARD.md` given the minors 5-8 arc, which had
stopped at 2026-08-18 and carried nothing for the whole sweep;
`ISSUES.md` two entries; `LATEST_STATE.md` / `PR_ARC_INVENTORY.md` /
`EPIPHANIES.md` already carried the minor-8 entries from PR #32.

**Gates re-run on this branch before the PR:** Rust 134 lib tests, fmt +
clippy `-D warnings` clean; Java 304 checks; `OldAbiCompatTest` green
against minors 1-4.

## 2026-08-25 — JDK toolchain provisioning verified + 245/245 full suite re-run

Operator raised "Valhalla panama is mandatory, check technical debt in
Expand Down
112 changes: 112 additions & 0 deletions .claude/board/CROSS_REPO_PRS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Cross-Repo PR Cross-References

> **Append-only log of PRs in OTHER AdaWorldAPI repos** that this repo
> depends on, caused, or is gated by. Modeled on lance-graph's board file
> of the same name.
>
> `PR_ARC_INVENTORY.md` is scoped to lance-graph-java PRs (Added / Locked
> / Deferred, rooted in this repo). Cross-repo PRs need their own trail
> because of the **missing-capability STOP rule** (root `CLAUDE.md`): a
> consumer never grows the membrane, so a capability this repo needs lands
> UPSTREAM FIRST — in `lance-graph-contract` or in `ndarray` — and this
> repo's own PR is then gated on that one merging. Without a ledger, the
> gating relationship is visible only in a commit message, and a session
> six weeks later re-derives it by grep.
>
> ## APPEND-ONLY rule
>
> 1. New entries PREPEND at the top (most recent first).
> 2. Each entry is IMMUTABLE except the **Status** / **Confidence** lines.
> 3. Each entry names WHY it was upstream: which capability was missing,
> and what would have been the hand-rolled local version had the STOP
> rule not been applied.
>
> **READ BY:** any session adding a symbol to `native/lgj-abi`, any
> session that finds a needed primitive absent from `ndarray::simd` or a
> needed accessor absent from `lance_graph_contract`, any session auditing
> whether this repo has quietly re-implemented something upstream owns.

---

## ndarray #283 — `masked_strided_group_sum` (merged 2026-08-25)

**Repo:** `AdaWorldAPI/ndarray`
**Consumed by:** `native/lgj-abi/src/kernels.rs::masked_facet_sum`
**Gated:** lance-graph-java ABI minor 5 (`lgj_reduce_facet_sum`).

**The missing capability.** The mask-native sweep needs a masked reduction
over a STRIDED group layout — a facet's 12-byte register at
`first_offset + row * 512`, read as `groups × group_bytes`. `ndarray::simd`
had `masked_sum_i32` (contiguous, one element per row) and
`eq_u32_strided_to_mask` (strided, but a comparison), and nothing that was
both strided and a reduction.

**Why it went upstream.** The iron rule is *all SIMD from `ndarray::simd`*
(`abi.md` §8). The hand-rolled local version would have been a scalar loop
in `kernels.rs` — which is exactly the "a consumer grows the membrane"
shape the STOP rule forbids, and it would have been invisible to ndarray's
own W1a consumer contract (three backends + a parity test).

**Shape:** `masked_strided_group_sum(bytes, first_offset, stride_bytes,
n_records, groups, group_bytes, mask_words) -> Option<i64>`. Accumulates in
`i128` and range-checks once, so `i64` overflow is a `None` rather than a
wrap — which is what `LGJ_ERR_SUM_OVERFLOW` (−16) reports across the
membrane.

**Status:** merged, consumed, `masked_facet_sum` is now one delegating call.

---

## lance-graph #1025 — `ClassView::cascade_shape` (merged 2026-08-25)

**Repo:** `AdaWorldAPI/lance-graph` (`crates/lance-graph-contract`)
**Consumed by:** `native/lgj-abi/src/class_view_provider.rs`,
`kernels::resolve_population_carving`
**Gated:** lance-graph-java ABI minor 6 (`lgj_reduce_facet_sum_resolved`)
and, transitively, minor 8's `CARVING_ORDER`.

**The missing capability.** `ClassView` carried four registry-resolution
accessors (`edge_codec_flavor` / `rail_carving` / `band_reading` /
`value_schema`) and NO carving resolver — so "which of the three readings
of this class's 12-byte register applies" had no upstream answer at all.
`abi.md` §14 said so explicitly at minor 5, and the sweep took the carving
as a caller-ASSERTED parameter in the meantime.

**Why it went upstream.** A local answer would have been this repo minting
its own class→carving table — a second source of truth for a question the
contract exists to answer, and the parallel-object-model anti-pattern in
miniature. The default is `G3D4` (the GUID canon's `3×4`), so a class that
has not been taught otherwise resolves to the canonical reading rather than
to nothing.

**The finding it produced:** `E-LGJ-THE-RESOLVER-WAS-UPSTREAM-ALL-ALONG-1`
— the local `Carving` enum this repo had minted was already
`CascadeShape::{G6D2, G4D3, G3D4}`, which had carried the full algebra
(`groups`/`levels`/`group_of`/`index`) and the "class-conditioned" statement
all along. `Carving` is now a `pub type` alias, and at minor 8 the wire
ORDER is derived from `CascadeShape::ROTATIONS` rather than written here.

**Status:** merged, consumed. `CascadeShape` is now the single source for
BOTH the set of readings and (by derivation) their wire encoding.

---

## ndarray #280 — the `mask_andnot` family (merged 2026-08-18)

**Repo:** `AdaWorldAPI/ndarray`
**Consumed by:** `native/lgj-abi/src/kernels.rs::simd_mask_andnot{,_assign}`
**Gated:** lance-graph-java ABI minor 4 (`lgj_mask_andnot`), D-LGJ-W8
SUBSTRATE rung.

**The missing capability.** The mask algebra had `and` / `or` (both plain
and `_assign`) and no complement — so `Mask.minus` had no primitive under
it. Commit `3f3504f`; 51/51, vector-path disable-run red-then-green, plus
the `ndarray::simd` re-export and a blackboard W1a-deviation entry.

**Why it went upstream.** Same rule, same reason: an ANDNOT written locally
would have been a fourth mask primitive living outside the surface the
other three come from. Note ANDNOT is NOT commutative, which is why the
export carries a 5-branch aliasing tree (the `dst == b` case needs a
scratch copy) that AND/OR do not.

**Status:** merged, consumed.
45 changes: 45 additions & 0 deletions .claude/board/EPIPHANIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@
> `**Status:**`/`**Confidence:**` line. A correction gets its own new,
> dated entry that references the one it corrects — the storno rule.

## 2026-08-25 — E-LGJ-A-CONSTANT-COPIED-THREE-TIMES-HAS-NO-FALSIFIER-1

**Status:** SHIPPED — ABI minor 8, docs/abi.md §17.
**Confidence:** High on the mechanism; every guard disable-verified.

The §14 carving wire encoding lived in three places: a Rust `match`, a
Java `enum`, and abi.md's own table. Each was correct. Nothing anywhere
would have failed if one had stopped agreeing with the others.

**That is the finding, and it generalises past this constant.** Three
copies of one fact is not a documentation problem to be tidied — it is a
correctness problem with NO falsifier, and its failure mode is silent:
a variant added or reordered upstream re-maps one copy, a sweep then
reads the same 12 bytes under the wrong grouping, and returns a
plausible number. "Keep them in sync" is not a mechanism.

The fix is not a fourth copy that checks the others. It is ONE source
(`CascadeShape::ROTATIONS`, the contract's) and two DERIVATIONS: the ABI
computes the encoding from it by a RULE (group count, descending) rather
than by declaration position, and the manifest serves the result to Java
so Java restates nothing. A reorder upstream cannot re-map the wire; an
addition upstream propagates.

**The two corollaries worth keeping:**

1. **Derive by a rule, not by position.** Had the order been "declaration
order of the enum", the derivation would have been just as automatic
and just as fragile — the drift would simply have moved upstream.
2. **Meaning is declared; encoding is served.** `RAILS_6X2` keeps its
arity as a literal, because the arity IS the constant's identity and a
name that lies about it is worse than a hardcode. Only the encoding —
which carries no meaning — became data.

**And the change surfaced a latent defect one layer down**, which is the
usual reward for touching a boundary: Java's load gate required the FULL
manifest layout, so the first growth of that struct would have made every
older artifact fail to load, in flat contradiction of §2's additive
promise. It had been written that way since minor 1 and was unreachable
until now. Measured: restoring the full-layout gate makes all four
historical libraries fail outright.

Cf. `E-LGJ-THE-RESOLVER-WAS-UPSTREAM-ALL-ALONG-1` — same shape one rung
up (the answer was already in the contract; the local version was the
copy).

## 2026-08-25 — E-LGJ-THE-RESOLVER-WAS-UPSTREAM-ALL-ALONG-1

**Status:** SHIPPED — ABI minor 6 + the contract accessor + the ndarray
Expand Down
60 changes: 60 additions & 0 deletions .claude/board/ISSUES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Issues Log — Open + Resolved (double-entry, append-only)

## ISS-LGJ-STACK-TAIL-STRANDED-MINOR-8 (2026-08-25) — RESOLVED same day

**Found.** PR #32 (ABI minor 8) was opened against
`claude/layout-probe` — PR #30's branch — because #30 (minor 7) was still
open and a same-numbered minor in two PRs would have been a real
collision. Correct at the time. But #30 merged to `main` FIRST, and #32
then merged into a branch that had already been absorbed. Net effect:
`main` sat at `LGJ_ABI_MINOR = 7` while the minor-8 commit, the
`CarvingTable`/`CarvingTableTest` pair, the load-gate prefix fix,
`abi.md` §17 and three board entries lived only on `claude/layout-probe`,
two commits ahead of main.

**Nothing was lost and nothing was broken** — `main` was a strict
ancestor with no divergence — but the work was reviewed, merged, and
still absent from the branch anyone would build.

**Why it is worth an entry rather than a quiet fix.** The failure is
generic to STACKED PRs and has no signal of its own: both PRs report
"merged", both are green, and GitHub says nothing. It surfaced only
because a wake event prompted a `git log origin/main` check rather than
trusting the merge notification. A session that trusted the notification
would have moved on believing minor 8 shipped.

**Rule adopted:** when a PR's base is another PR's branch, the merge of
the CHILD is not the end of the arc — verify the content reached `main`
(`git log origin/main..origin/<base>` must be empty), and if the base
merged first, land the tail explicitly.

**Resolved** by the same PR that carries this entry: `claude/board-hygiene`
→ `main`, carrying the stranded minor-8 commits plus this board work.

---

## ISS-LGJ-FACETSCHEMA-PAIR48 (2026-08-25) — OPEN, upstream-owned

`lance_graph_contract::facet_schema::FacetSchema`'s third reading is
`Pair48` (`2 × 48-bit`, two 6-byte codes — `facet_schema.rs:34`), NOT the
operator-ruled L6 quads (`3 × (u8:u8:u8:u8)`) that
`CascadeShape::G3D4` carries and that `le-contract.md` §3 names. The
contract itself flags the tension at `class_view.rs:1168`.

Both are legal readings of the same 12 bytes and both have real consumers
(`Pair48` serves `helix` `Signed360` and `cam_pq` `[u8; 6]`, which are
genuinely 48-bit), so this is **not** obviously a defect — it may be two
different axes that happen to partition the same register. What is
unresolved is whether `FacetSchema` and `CascadeShape` are meant to be the
same question asked twice, or two questions that must both be answerable
per class.

**Deliberately NOT resolved here.** This repo consumes the contract; it
does not arbitrate it (root `CLAUDE.md`: the contract is THE semantic
law). Flagged during the minor-6 work, carried through minors 7 and 8
untouched, and named in every PR body of the arc rather than left silent.

Closes when upstream rules the relationship — or when a lance-graph-java
consumer actually needs `Pair48` across the membrane, at which point the
question stops being academic.

---

## ISS-LGJ-CLASSID-WIDTH-PIN (2026-08-18) — OPEN, upstream-owned

The lgj wire carries u32 classids (canon 8-hex; `lgj_op_eq_classid`,
Expand Down
35 changes: 35 additions & 0 deletions .claude/board/LATEST_STATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## 2026-08-25 — ABI minor 8: the register groupings are DATA, and the load gate stopped requiring the whole manifest

- **The wire encoding of §14's `carving` is no longer written anywhere by
hand.** The contract owns the set (`CascadeShape::ROTATIONS`),
`kernels::CARVING_ORDER` (a `const`) derives the order by a RULE (group
count, descending — never declaration position), and the manifest serves
it in two new fields: `carving_count: u32` + `carvings: [u16; 8]`
(`(groups << 8) | group_bytes`). No new symbol; the manifest already
exists so Java can discover the ABI's shape rather than declare it.
`LgjAbiManifest` is now 128 bytes.
- **Java keeps its ARITY and loses its ENCODING.** `Carving.groups()` /
`groupBytes()` stay declared — the arity IS the constant's identity —
while `wire()`/`ofWire()` look up the served table. `CarvingTable` holds
the one clearly-named pre-minor-8 compatibility shim, so exactly one
place in the build carries a literal encoding and its name says it is
history.
- **A latent defect fixed on the way:** Java's load gate required the FULL
manifest layout, so the FIRST growth of that struct — this one — would
have made every older artifact fail to load, contradicting §2's additive
promise. The gate now requires only the 104-byte BASE PREFIX
(`Layouts.MANIFEST_BASE_BYTES`); later fields are read only when
`size_of_manifest` covers them AND the minor is high enough.
- **Gates:** Rust 134 lib tests, fmt + clippy `-D warnings` clean; Java
**304** checks (`AllTests`, was 288 — `CarvingTableTest` adds 16);
`OldAbiCompatTest` green against all four historical `.so`s (minors
1-4). Four disable-runs, each red-then-green: swapped packed axes,
reversed sort, a mismatched Java arity (fires BOTH membership
directions), and the restored full-layout gate (minor-4 library fails to
load).
- **Docs:** `docs/abi.md` §17 (new), §2 (load-gate prefix), §14's table
regraded DESCRIPTIVE rather than normative.
- Stacked on PR #30 (minor 7); board entry in `PR_ARC_INVENTORY.md`,
finding in `EPIPHANIES.md`
(`E-LGJ-A-CONSTANT-COPIED-THREE-TIMES-HAS-NO-FALSIFIER-1`).

## 2026-08-18 — PR-W8b (FACADE + GRAPH MIGRATION) — the mask-native correction reaches the Java surface

### Current surface changes (java/ + consumers/graph)
Expand Down
48 changes: 48 additions & 0 deletions .claude/board/PR_ARC_INVENTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,54 @@
> anti-pattern the imported board rules name. Backfilled below in one
> pass rather than left stale; PR #4 onward gets its entry at merge time.

## PR #32 — ABI minor 8: the register groupings served as DATA (draft, opened 2026-08-25)

- **Added:** `LgjAbiManifest.{carving_count, carvings[8]}` (docs/abi.md
§17) — the §14 wire encoding, previously hand-written in THREE places
(a Rust `match`, Java's `Carving` enum, §14's table) with nothing that
would fail if they disagreed. Now one source and two derivations: the
contract owns the SET (`CascadeShape::ROTATIONS`), `kernels::CARVING_ORDER`
(a `const`, group count descending) derives the ENCODING, and the manifest
serves it. Java's `Carving` keeps its declared ARITY (the name IS the
arity) and looks its wire value up in the served table.
New: `CarvingTable` (with the one clearly-named pre-minor-8 shim),
`CarvingTableTest` (16 checks, in `AllTests`), two Rust falsifiers.
- **Locked:** meaning is declared, encoding is served. A variant REORDER
upstream cannot re-map the wire (position is computed from `groups()`,
not declaration order); a variant ADDED upstream appears automatically
and is caught by the both-ways membership test rather than surfacing on
someone's data. `CARVING_ORDER` is `const` and not `LazyLock` because
the manifest that serves it is const-initialised.
- **Also fixed (a real latent defect, not scope creep):** Java's load gate
required the FULL manifest layout, so this — the first growth of the
manifest struct — would have made every older artifact fail to load,
contradicting §2's additive promise. Gate now requires only the 104-byte
BASE PREFIX; later fields are read when `size_of_manifest` covers them
AND the minor is high enough. Measured: all four historical `.so`s
(minors 1-4) still load and gate per-minor correctly.
- **Deferred:** nothing new. `FacetSchema`'s third reading is still
`Pair48` rather than the operator-ruled L6 quads — flagged earlier,
untouched here.
- **Docs:** `docs/abi.md` §17 (new), §2 (load-gate prefix + minor-8
history), §14 table regraded DESCRIPTIVE, manifest struct listing,
header constants.
- **Gates:** Rust 134 lib tests / fmt / clippy `-D warnings` clean; Java
304 checks (`AllTests`, was 288); `OldAbiCompatTest` 4/7/7/7 against
minors 1-4. Stacked on PR #30 (minor 7).
- **Disable-runs, all red-then-green:** swapping the packed axes fails the
Rust serve test; reversing the sort fails the order test and two others;
changing one Java constant's arity fails BOTH membership directions;
restoring the full-layout load gate makes the minor-4 library fail to
load outright.
- **Confidence:** high on the derivation and the falsifiers (each disabled
and observed red). Medium on the 8-slot table width — the bound is
argued from `G·D = 12`'s divisors, not measured against a future
`CascadeShape`.
- **Owned mistake:** mid-session I ran `git checkout` on `kernels.rs` to
undo a disable-run edit and destroyed the uncommitted work in that file.
Reconstructed and re-verified (134 tests, same count). Disable-runs are
now backed up to a file first, never reverted with `git checkout`.

## PR #20 — D-LGJ-W8 A3 freeze (PR-0): ratified correction spec v3 + root CLAUDE.md + board storno (merged 2026-08-18, squash `c479f76`)

- **Added:** `.claude/plans/mask-native-navigation-correction-v1.md`
Expand Down
Loading