Skip to content

Commit 08b6417

Browse files
committed
review(#507): 5+3 agent fleet — FIX-A repr(transparent) + const _ guards + fmt + asserts
8-agent review fleet (5 specialists + PP-13/15/16 hardeners) against the 4-task unblock-cascade (PR #507): zero REJECT, but two real defects all four green test suites missed. P0 — incomplete cherry-pick (PP-16 root cause). Task 2 cherry-picked 463d71b's mailbox_soa.rs half (+149) but dropped its causal-edge/src/edge.rs half (+6: #[repr(transparent)] on CausalEdge64). The SAFETY comments cited a repr the type didn't carry — sound on today's rustc by newtype-layout coincidence, unsound by the letter, invisible to CI. P1 — fmt --check overclaim (PP-13). The 4-task entry said "clippy/fmt clean" but only clippy had been run; cargo fmt --check failed on PR-added lines. Fixes: - FIX-A: restore #[repr(transparent)] + doc on CausalEdge64 (edge.rs:148-156); add const _ size/align guards at edges_raw/meta_raw cast sites; corrected both SAFETY comments. - FIX-B: cargo fmt across all 5 touched crates; fmt --check exit 0. - FIX-C (PP-15): SurrealMailboxView::from_columns debug_assert_eq! -> assert_eq! (release-build OOB closed); + from_columns_rejects_ragged_projection panic test. - FIX-D: pub fn base_path() on VersionedGraph; deleted format!("{:?}") Debug-scrape (embedded-quote truncation hazard). - FIX-E (PP-13): test_edges_raw_meta_raw_reinterpret_round_trips — the unsafe cast had ZERO coverage; now bit-exact round-trip + pointer-identity asserted. - FIX-F/H (P2 docs): hhtl bijection 0..=16 -> 1..=16; drive_at_latest scope note + versions().last() upstream-pagination caveat tying ascending-sort assumption to the lance =7.0.0 pin. Process lesson -> EPIPHANIES E-CHERRYPICK-SPANS-CRATES-1 (queued). Board hygiene: AGENT_LOG.md prepended in same commit (this commit), per the mandatory rule — no retroactive cleanup. https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
1 parent 8017ca1 commit 08b6417

35 files changed

Lines changed: 2864 additions & 1100 deletions

.claude/board/AGENT_LOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
## 2026-06-16 — PR #507 review pass: 5+3 agent fleet (5 specialists + PP-13/15/16 hardeners) → 1 P0 + 2 P1 + P2 docs fixed
2+
3+
**Main thread (Opus 4.7) spawned an 8-agent review fleet against PR #507** (the 4-task unblock-cascade below): 5 specialists (sentinel-qa, dto-soa-savant, iron-rule-savant, scenario-world, container-architect) + the 3 brutal hardeners (PP-13 brutally-honest-tester, PP-15 baton-handoff-auditor, PP-16 preflight-drift-auditor). Verdicts: dto-soa **LAND**, iron-rule **YIELDS-ALL**, container-architect **EXACT**, sentinel-qa **SOUND+P1**, scenario-world **CORRECT+P1**, PP-15 **CATCH-LATENT**, PP-16 **HOLD(P0)**, PP-13 **HOLD(P1×2)**. Consensus: mergeable after mechanical fixes; **zero REJECT, zero architectural rework** — "high-quality work" (PP-13), tests verified not-theater.
4+
5+
**The fleet earned its keep — two real defects all four green test suites missed:**
6+
7+
- **P0 (PP-16, root cause) — incomplete cherry-pick.** Task 2 cherry-picked `463d71b`'s `mailbox_soa.rs` half (+149) but **dropped its `causal-edge/src/edge.rs` half** (+6: the `#[repr(transparent)]` on `CausalEdge64` that is the layout enabler the `&[CausalEdge64]→&[u64]` reinterpret depends on). The SAFETY comment cited a `repr(transparent)` the type didn't carry — sound on today's rustc by newtype-layout coincidence, unsound by the letter, invisible to CI (borrow-checker ignores `repr`). Confirmed via `git show 463d71b --stat`. **Process lesson → EPIPHANIES E-CHERRYPICK-SPANS-CRATES-1.**
8+
- **P1 (PP-13) — `fmt --check` overclaim.** The prior AGENT_LOG entry below said "clippy/fmt clean" but only clippy had been run; `cargo fmt --check` actually FAILED on PR-added lines (`hhtl.rs`, `scheduler.rs`, `view.rs`). Honest correction.
9+
10+
**Fixes applied (new commit on the same branch — preserves review history):**
11+
- **FIX-A (P0):** restored the dropped enabler — `#[repr(transparent)]` + doc on `CausalEdge64` (`causal-edge/src/edge.rs:148-156`); added `const _` size/align guards at the `edges_raw`/`meta_raw` cast sites (compile-error on any layout regression); corrected both SAFETY comments.
12+
- **FIX-B (P1):** ran `cargo fmt` on all 5 touched crates; `fmt --check` now exits 0.
13+
- **FIX-C (P1, PP-15):** `SurrealMailboxView::from_columns` `debug_assert_eq!``assert_eq!` (the column-length invariant now fails loudly in ALL profiles — closes a release-build OOB where a ragged kv-lance projection → `n_rows() > entity_type().len()``SoaWavePrimer::project` indexes out of bounds). + `from_columns_rejects_ragged_projection` panic test.
14+
- **FIX-D (P1, 4 agents):** `pub fn base_path()` on `VersionedGraph`; deleted the `format!("{:?}")` Debug-scrape in `scheduler.rs` (embedded-quote truncation hazard).
15+
- **FIX-E (PP-13):** `test_edges_raw_meta_raw_reinterpret_round_trips` — the unsafe cast had ZERO coverage; now bit-exact round-trip + pointer-identity asserted.
16+
- **FIX-F/H (P2 docs):** `hhtl` bijection doc `0..=16``1..=16` (prefix(0)=EMPTY is ancestor of nothing); `drive_at_latest` scope note (version-agnostic policies only) + `versions().last()` upstream-pagination caveat tying the ascending-sort assumption to the lance =7.0.0 pin.
17+
18+
**Disk verification this turn:** `git diff` confirms FIX-A landed (`#[repr(transparent)]` on `CausalEdge64` at `edge.rs:156`, `const _:` size/align guards at both cast sites in `mailbox_soa.rs`, `test_edges_raw_meta_raw_reinterpret_round_trips` at `mailbox_soa.rs:716`, `from_columns_rejects_ragged_projection` at `surreal_container/src/view.rs:257`). 34 files modified, +2841/-1100 — all uncommitted, awaits operator decision.
19+
20+
**Discipline note:** this entry prepended BEFORE commit, per board-hygiene rule (board update must land in same commit, not as retroactive cleanup).
21+
22+
---
23+
124
## 2026-06-16 — 4-task unblock-cascade landing: NiblePath::from_guid_prefix + MailboxSoaOwner cherry-pick + LanceVersionScheduler + SurrealMailboxView (D-PG-6 contract slice)
225

326
**Main thread (Opus 4.7) — single agent**, four ordered tasks responding to the user's "1 2 3 and 4" go-ahead on the shortest-unblocking-path list surfaced after #497-#501 + the surrealdb fork bump (`AdaWorldAPI/surrealdb` PR #34/#35/#36/#37 → main at `3aa6ab9` with `lance=7.0.0`/`lancedb=0.30.0`). All four committed together on `claude/odoo-savant-reasoners`, branch fast-forwarded through `cb14704`.

crates/causal-edge/src/edge.rs

Lines changed: 130 additions & 54 deletions
Large diffs are not rendered by default.

crates/causal-edge/src/layout.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
//! OQ-LAYOUT-1: RESOLVED. G-slot dropped (L-3). Mantissa = 4b signed i4 (L-4).
66
77
// ── v1 fields preserved (shifts unchanged from v1) ─────────────────────────
8-
pub const S_SHIFT: u32 = 0;
9-
pub const P_SHIFT: u32 = 8;
10-
pub const O_SHIFT: u32 = 16;
11-
pub const FREQ_SHIFT: u32 = 24;
12-
pub const CONF_SHIFT: u32 = 32;
8+
pub const S_SHIFT: u32 = 0;
9+
pub const P_SHIFT: u32 = 8;
10+
pub const O_SHIFT: u32 = 16;
11+
pub const FREQ_SHIFT: u32 = 24;
12+
pub const CONF_SHIFT: u32 = 32;
1313
pub const CAUSAL_SHIFT: u32 = 40;
14-
pub const DIR_SHIFT: u32 = 43;
14+
pub const DIR_SHIFT: u32 = 43;
1515

1616
// ── v1→v2 EXPANDED field ────────────────────────────────────────────────────
1717
/// Inference mantissa: 4-bit signed (−8..+7).
@@ -23,18 +23,18 @@ pub const DIR_SHIFT: u32 = 43;
2323
/// 7=Extension/Intension-negative (future).
2424
/// Encodes direction × NARS rule in one field.
2525
/// See pr-ce64-mb-2-causaledge64-v2.md §"Signed Mantissa Rationale".
26-
pub const INFER_SHIFT: u32 = 46;
26+
pub const INFER_SHIFT: u32 = 46;
2727

2828
/// 4-bit unsigned mask for pack/unpack of the signed i4 mantissa field.
29-
pub const BITS4_MASK: u64 = 0xF;
29+
pub const BITS4_MASK: u64 = 0xF;
3030

3131
/// Mask covering the mantissa field (bits 46-49) in the u64 word.
32-
pub const INFER_MASK: u64 = BITS4_MASK << INFER_SHIFT;
32+
pub const INFER_MASK: u64 = BITS4_MASK << INFER_SHIFT;
3333

3434
// ── v1 field SHIFTED ────────────────────────────────────────────────────────
3535
/// Plasticity flags: bits 50-52 (shifted by +1 from v1's bits 49-51 due to
3636
/// mantissa expansion from 3b unsigned to 4b signed i4 per L-4).
37-
pub const PLAST_SHIFT: u32 = 50;
37+
pub const PLAST_SHIFT: u32 = 50;
3838

3939
// ── v1 field DEPRECATED ─────────────────────────────────────────────────────
4040
/// Deprecated: temporal field shift from v1. Bits 52-63 reclaimed in v2.
@@ -51,26 +51,26 @@ pub const V1_TEMPORAL_SHIFT: u32 = 52;
5151
// ── v2 NEW fields (reclaimed from dropped temporal 12 bits) ─────────────────
5252
/// W slot: 6-bit witness corpus root handle (bits 53-58), 0..=63.
5353
/// 0 = no corpus anchor. Per cognitive-substrate-convergence-v1.md L-6.
54-
pub const W_SHIFT: u32 = 53;
54+
pub const W_SHIFT: u32 = 53;
5555

5656
/// Truth-band lens: 2-bit TrustTexture ordinal (bits 59-60).
5757
/// 0 = Crystalline. Per cognitive-substrate-convergence-v1.md L-7.
58-
pub const TRUTH_SHIFT: u32 = 59;
58+
pub const TRUTH_SHIFT: u32 = 59;
5959

6060
/// Spare: 3-bit reserved for sprint-12+ (bits 61-63).
6161
/// Candidates: Rubicon-commit marker, Markov-decay quantum, I-NOISE-FLOOR-JIRAK threshold.
62-
pub const SPARE_SHIFT: u32 = 61;
62+
pub const SPARE_SHIFT: u32 = 61;
6363

6464
// ── Common masks ─────────────────────────────────────────────────────────────
65-
pub const BYTE_MASK: u64 = 0xFF;
66-
pub const BITS3_MASK: u64 = 0x7;
67-
pub const BITS6_MASK: u64 = 0x3F;
68-
pub const BITS2_MASK: u64 = 0x3;
65+
pub const BYTE_MASK: u64 = 0xFF;
66+
pub const BITS3_MASK: u64 = 0x7;
67+
pub const BITS6_MASK: u64 = 0x3F;
68+
pub const BITS2_MASK: u64 = 0x3;
6969

70-
pub const PLAST_MASK: u64 = BITS3_MASK << PLAST_SHIFT;
71-
pub const W_MASK: u64 = BITS6_MASK << W_SHIFT;
72-
pub const TRUTH_MASK: u64 = BITS2_MASK << TRUTH_SHIFT;
73-
pub const SPARE_MASK: u64 = BITS3_MASK << SPARE_SHIFT;
70+
pub const PLAST_MASK: u64 = BITS3_MASK << PLAST_SHIFT;
71+
pub const W_MASK: u64 = BITS6_MASK << W_SHIFT;
72+
pub const TRUTH_MASK: u64 = BITS2_MASK << TRUTH_SHIFT;
73+
pub const SPARE_MASK: u64 = BITS3_MASK << SPARE_SHIFT;
7474

7575
// ── Compile-time layout coverage assertion ────────────────────────────────────
7676
/// Const-assert: all 64 bits covered exactly once.
@@ -88,7 +88,7 @@ const _LAYOUT_COVERAGE: () = {
8888
| (BITS3_MASK << PLAST_SHIFT) // bits 50-52 (shifted from v1)
8989
| (BITS6_MASK << W_SHIFT) // bits 53-58 (NEW)
9090
| (BITS2_MASK << TRUTH_SHIFT) // bits 59-60 (NEW)
91-
| (BITS3_MASK << SPARE_SHIFT); // bits 61-63 (NEW)
91+
| (BITS3_MASK << SPARE_SHIFT); // bits 61-63 (NEW)
9292
assert!(
9393
all == u64::MAX,
9494
"CausalEdge64 v2 bit layout must cover all 64 bits exactly once"

0 commit comments

Comments
 (0)