Skip to content

impl(010): binding records, the rustev-rahi evidence sink and the spec 001 3.5 confirmation rule - #147

Merged
bartekus merged 1 commit into
mainfrom
impl/010-integrations-rahi
Oct 22, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/010-integrations-rahi

Conversation

@bartekus

@bartekus bartekus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Spec 010, increment 1: the three section 3.4 binding records and the rustev-rahi evidence sink. Only rustev-rahi is implemented, because only its record passes every row (3.4.8). Nothing here authorizes a release, publication, deployment, live service call, spend or real-user data.

Changes

  • specs/010-integrations/spec.md: the binding records for rustev-aicortex (refuses on item 1: its git-revision dependency fails the workspace supply-chain check of tools/rustev-release), rustev-rahi (passes) and rustev-serve (refuses on item 2, Sigstore row unverified). implementation: in-progress; the Verification block and the implementation record for increment 1. The cargo tree | grep verify loop captures cargo tree output first and fails when cargo tree fails.
  • integrations/rustev-rahi/: RahiEvidenceSink over rahi-store =0.7.1 receipts, the rustev migration set, stage_erasure, and a closed Delivery outcome (accepted, duplicate, conflict, rejected, unavailable, acceptance unknown). Receipts are rahi:<durability>:<external_id>:<digest> and rahi:duplicate:<external_id>:<digest>, so the external record identity (3.6.2) reaches the run record through the EvidenceSink seam. A Changed head without an accepted digest (Rahi reports "") and a recorded collision are a conflict with stored: None, never sha256: or a placeholder string. Tests: every item 5 row against a scripted store, and accepted, duplicate, conflict, erased and refused deliveries against a single-voter Rahi 0.7.1 store on loopback, each opened through the bounded port-retrying open_with.
  • specs/001-boundaries-and-authority/spec.md 3.5 and tools/rustev-boundaries/: amendment R-45. A transitive violation found in the workspace-wide cargo metadata resolution stands only when the crate's own cargo tree -p <crate> -e normal,build --locked resolution (every target, or wasm32-unknown-unknown for the WebAssembly binding) also lists a forbidden package. The check prints how many paths it dismissed, and fails closed: when that graph cannot be read, the violation stands. Declared-edge rules are unchanged. Why: Rahi's graph switches on crypto-common's optional rand_core edge, and the unconfirmed checker reported 7 paths ending rand_core -> getrandom [-> js-sys] for the pure crates and bindings that their own builds do not hold.
  • docs/decisions/00-founding-decisions.md: R-44 and A-45 (binding records), R-45 (the 001 3.5 amendment). docs/backlog.md RUSTEV-015 state. Makefile: 010 joins VERIFIED_SPECS. tools/rustev-release/release-set.json: rustev-rahi is excluded from the release family. Cargo.lock: Rahi 0.7.1's graph added, no existing entry changed.

Owner acts

  1. R-44 / A-45: confirmed. The owner confirmed the three written binding records as this PR states them on 2026-10-21; the decision record, spec 010 and the backlog say so.
  2. R-45: approved. The owner approved the spec 001 3.5 amendment on 2026-10-21; R-45, A-45 and 001's decision history say so.

Not in this PR: any rustev-aicortex code. The owner chose to narrow spec 021's source check to the release closure; that amendment and the adapter follow in a separate PR after this one merges, so the rustev-aicortex record here still refuses on item 1.

Recorded, no code change

  • With AcceptanceUnknown the store's own error (for example Io) does not reach the run record, and the delivery holds its slot for the full delivery timeout. That follows from spec 003 3.9.4's seam, which reports uncertainty only by timing out; the rustev-rahi record item 5 now states the evidence loss.

Review history

Earlier rounds on this branch: round 1 (0 findings), round 2 (0), round 3 (1 finding, fixed: Delivery::Unavailable after a refused transaction is documented, recorded and tested), round 4 (0). The owner-side review (issue comment 6325417338) items 1 to 6 and both notes are addressed above. Round 5 on 467b33a (2 findings, both fixed): R-45 was implemented while recorded as awaiting approval (the owner has since approved it, and the records say so); Delivery::Conflict carried the placeholder another digest where the record says no digest is reported, so stored is now Option<String> and the seam detail names no digest. Round 6 on cc9afd4: no findings. The branch is rebased onto main at 4552b3e (#149, no conflict; derived shards unchanged by make refresh) and squashed to one commit.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR for the rustev-rahi integration crate and associated changes.

Governance review

  • R-44/A-45 acknowledge the unusual approval pattern (verbal pre-approval before binding-record text existed, with written confirmation deferred to review of this PR). The records document this explicitly and within the decision-record framework; no contradiction of the governance authorities.
  • Spec 010 frontmatter change (planned: true removed for integrations/rustev-rahi/) is correct; the directory is being established in this PR.
  • VERIFIED_SPECS addition of 010 and tools/rustev-release/release-set.json exclusion are consistent with the spec and binding record.

integrations/rustev-rahi/ code review

  • deliver_typed flow (classify → build txn → commit → re-classify on rollback) is correct. The Error::Conflict / Error::Validation pattern correctly identifies the rollback cases; everything else is AcceptanceUnknown.
  • std::future::pending().await for AcceptanceUnknown in the EvidenceSink implementation is intentional and documented (the runtime's delivery timeout is the signalling mechanism per spec 003 3.9.4). Not a bug.
  • nothing_accepted() correctly excludes AcceptanceUnknown (delivery may have occurred).
  • SQL uses parameterized queries throughout; no injection surface.
  • MAX_RECORD_BYTES guard executes before any network call. Clock check happens after the first classify (no write occurs), correct.
  • Transaction staging order (receipt first, then INSERT_RECORD) matches the invariant stated in the binding record.
  • stage_erasure stages receipt erasure then record deletion in one TxnBuilder; host commits atomically. Correct.
  • external_id: format!("{}#1", key.key_digest()) for duplicates: Seen::Same implies stored digest equals current content, so digest is the correct accepted digest; #1 matches the binding record's explicit revision convention.
  • Seen::First arm in settled is unreachable in practice (both call sites guard on non-First before calling), but makes the function total. Harmless dead code.

tools/rustev-boundaries/ review

  • own_graph_of / confirmed / tree_names logic is correct. confirmed uses any(forbidden_for_pure) over the own-graph names — conservative rather than path-specific, which is the safe direction for a boundary checker.
  • main.rs: when own_graph returns None (cargo tree failure), the _ arm keeps the violation. Conservative fallback is correct.
  • --target all for ForbiddenTransitive and --target wasm32-unknown-unknown for WasmGraph are appropriate given MSRV 1.96.
  • Unit test covers the positive and negative controls and the three violation categories.

Cargo.toml / release-set

  • Exact pins rahi-store = "=0.7.1" and rahi-types = "=0.7.1" match binding record item 1.
  • publish = false; exclusion in release-set.json is consistent with spec 031 3.4 and the binding record.

No concrete defects found.

{"head": "a026dc74400698b6d80273bb9db5885127d51b94", "verdict": "no-findings", "findings": []}

Subject: 1204bc8...a026dc7, diff digest 3d5fef3225a3f5341c236272eb8dc2e28e6ea50250a02460196703d0a31cd8df, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/010-integrations-rahi branch from a026dc7 to 45499f6 Compare October 21, 2026 18:48
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

I reviewed the diff carefully, checking the new rustev-rahi integration crate, the boundary tool changes, the spec and governance updates, and the Cargo.lock checksums against the binding records.

integrations/rustev-rahi/src/sink.rs — deliver_typed flow is sound: schema and size are checked before any write; the CAS via stage_first with a post-refusal reclassify correctly distinguishes duplicate/conflict/refused; AcceptanceUnknown never resolving in EvidenceSink::deliver matches spec 003 3.9.4. The Seen::First arm in settled is unreachable dead code (both call sites explicitly handle Seen::First before invoking settled) but it is defensive code with no runtime consequence.

integrations/rustev-rahi/src/schema.rs — INSERT_RECORD uses positional SQLite parameters; stage_erasure stages receipt erasure and record deletion in one builder, with validation. migration_set requires rahi.receipts at version 1 as the binding record states.

integrations/rustev-rahi/src/port.rs — Classification::Changed → Seen::Other(Some(hex)), CollisionRedelivered → Seen::Other(None). In settled, sha256:{hex} is prefixed back, consistent with record_digest() returning "sha256:…".

tools/rustev-boundaries/ — confirmed conservatively treats any forbidden package in the crate's own graph as confirming all transitive violations for that crate (not just the specific path). This is the stated design ("also holds a forbidden package"), acknowledged in the test, and produces no false negatives — only potentially keeping violations alongside a distinct real one. own_graph_of correctly uses "all" for the host-target crates and "wasm32-unknown-unknown" for the WASM crate.

Cargo.lock checksums vs binding record — rahi-store 0.7.1 checksum 5ffe41f… and rahi-types 0.7.1 checksum 3ed2f5e… match the binding record exactly. hiqlite-patched 0.15.0-patched.3 checksum 9d3586f… also matches.

release-set.json — rustev-rahi correctly excluded with publish = false and spec 031 justification.

Governance — R-44/A-45 acknowledge the bootstrap order (approval before text; text confirmed in review). Not a code defect.

No concrete defects found.

{"head": "45499f61f32e6ff02443cf0e7ba840410e1bb9f6", "verdict": "no-findings", "findings": []}

Subject: df053f6...45499f6, diff digest 8d7dddaeba44d2495f3b2c1f4b97bafe611b8d348a04f2fa227550204e05f7bd, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/010-integrations-rahi branch from 45499f6 to 8e6ab24 Compare October 21, 2026 19:19
@github-actions

Copy link
Copy Markdown

AI review (findings)

Review

Governance and decision records

R-44 / A-45 record that the binding text was written by the agent after the owner's approval in a coordinating session ("bindings approved so unblock 010"), with confirmation deferred to review of this PR. The documents disclose this accurately. No governance defect in that alone, but it means this review is the first full check of the written record text against what was approved.

Spec 010 binding records

rustev-rahi – passes every row; implementation correctly constrained to exactly rahi-store =0.7.1 and rahi-types =0.7.1 matching the stated checksums. The tools/rustev-release/release-set.json exclusion is consistent with "not in the release family."

rustev-aicortex – item 1 correctly records the workspace supply-chain failure found during adapter construction and marks the row refuse. Crate absent per 3.4.8.

rustev-serve – item 2 refuses (schema documents absent), Sigstore row is unverified. Crate absent per 3.4.8.

Implementation (integrations/rustev-rahi/)

The deliver_typed logic is consistent with the binding record's item-5 failure table. Parameterised SQL throughout; no injection surface. The EvidenceSink::deliver seam returns pending().await for AcceptanceUnknown, covered by the timeout test. Authorization types (Permitted, Grant) are absent.

Concrete defect

Delivery::Unavailable is documented as "The store could not be read before any write; nothing accepted" (sink.rs, the enum variant definition), but the variant is also emitted in deliver_typed when (a) a transaction was submitted and refused with Error::Conflict or Error::Validation (meaning the Raft log attempted a write, even if it was rolled back by Rahi) and then (b) the follow-up classify call also fails. In that code path a write was attempted, so "before any write" is semantically wrong and does not match the binding record's own description of this path. Additionally, no scripted test exercises this specific sequence (first-classify → Ok(First), commit → Err(Conflict/Validation), second-classify → Err), leaving the branch untested.

{"head": "8e6ab24a81aa4cad06017bb52340b2d097db16bf", "verdict": "findings", "findings": [{"path": "integrations/rustev-rahi/src/sink.rs", "line": 193, "summary": "Delivery::Unavailable is documented 'before any write; nothing accepted' but is also returned when a transaction commit was refused (rolled back) and the subsequent reclassification classify call fails, a code path where a write was attempted; this mismatches the documented semantics and is not covered by any test."}]}

Subject: 7d65c1b...8e6ab24, diff digest f17006d995f61d0f1532c4bf59b01d10f349757d91abb4418b976cca56c18852, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception October 21, 2026 19:28 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the impl/010-integrations-rahi branch from 35544f4 to e49ef93 Compare October 21, 2026 19:43
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reading through the diff carefully, examining the new rustev-rahi integration, the boundary tool changes, the spec updates, and the governance records.

integrations/rustev-rahi/src/sink.rs: The delivery flow is sound. All failure modes from binding-record item 5 are handled: Conflict/Validation errors trigger one confirming read before settling as duplicate/conflict/refused; Upstream/Io/etc. become AcceptanceUnknown which yields forever via std::future::pending().await, correctly delegating timeout to the runtime per spec 003 3.9.4. The clock check happens after the first classify read (nothing written yet), which is safe. The Seen::First arm in settled is technically unreachable (both call sites handle First separately) but not harmful.

integrations/rustev-rahi/src/port.rs: Classification::Changed and Classification::CollisionRedelivered both map to Seen::Other, correctly distinguishing conflict from duplicate.

integrations/rustev-rahi/src/schema.rs: SQL is parameterised throughout; the schema column name is valid in SQLite. stage_erasure stages only, consistent with the host-commit model.

tools/rustev-boundaries/src/lib.rs and main.rs: The --target all argument to cargo tree is a valid Cargo value meaning all targets, supported since Cargo ~1.60, which is well below the 1.98.1 toolchain in use. The dismissal logic is conservative: violations can only be dropped, never added. The unit test includes a proper negative control.

specs/010-integrations/spec.md: The binding records are detailed and the pass/refuse/unverified assignments are internally consistent with the code. The rustev-aicortex refusal on item 1 (git-revision dependency failing the workspace supply-chain check) and the rustev-serve refusals (item 2 schema documents absent, Sigstore row unverified) both correctly block those crates from being implemented per 3.4.8.

docs/decisions/00-founding-decisions.md: R-44 explicitly acknowledges that the owner's approval ("bindings approved so unblock 010") preceded the written text, and that the records stand as the agent's account until confirmed in review. A-45 makes the same acknowledgement. This is honestly disclosed; review of this PR constitutes the confirmation. No concealment.

No concrete defects found in code, security, or governance consistency.

{"head": "e49ef939257641022149d64b1ea15cc7e629881e", "verdict": "no-findings", "findings": []}

Subject: 2d6a1f2...e49ef93, diff digest a865a375048647c5827dc5b189e1055ddf3e1183ec618ecd09a7e470a515f6a3, 1 call(s). An AI comment is not an approval.

@bartekus

Copy link
Copy Markdown
Contributor Author

Review of e49ef93 (pure rebase of 35544f4; range-diff shows only derived shards and the Makefile context line)

Not ready to merge. Three items block, three should be fixed in this PR, and the owner still has to confirm the record text.

Blocking

  1. The boundary checker's method changes without amending spec 001. Spec 001 3.5 says tools/rustev-boundaries "reads cargo metadata for the workspace and exits non-zero naming each violation of 3.4.1". This PR adds a second pass that drops transitive violations unless cargo tree -p confirms them. Spec 010 carries that change under an extends ... nature: additive edge, but dropping findings from a boundary control isn't additive: it changes how 001 3.5 is applied.
    On the merits the change is right. On this head, the base main.rs reports exactly 7 paths, all … rustev-contract -> sha2 -> digest -> crypto-common -> rand_core -> getrandom [-> js-sys], for rustev, rustev-contract, rustev-core, both packages, rustev-surface and rustev-wasm. cargo tree -p rustev-contract|rustev-core -e normal,build --target all holds none of getrandom, js-sys, rand_core, tokio or wasm-bindgen. The PR's binary dismisses the same 7. So those paths come from workspace feature unification, and the fix is sound.
    What's missing is the governance route. Spec 001 3.5 needs an authored amendment (the own-resolution confirmation and its fail-closed fallback), and because 001 is approved, that amendment needs the owner's approval. Recording it only in 010's implementation record isn't enough.

  2. The receipt omits the external record identity (3.6.2). 3.6.2 says "A receipt records the external record identity, accepted digest, acceptance time if supplied, and the exact declared durability state", and 3.6.4 says Rustev records the receipt. Through the EvidenceSink seam the receipt is Receipt::text(), which is rahi:<durability>:<digest> or rahi:duplicate:<digest>. So external_id (<key digest>#1) never reaches the runtime or the run record; only deliver_typed callers see it. Put it in the text, for example rahi:<state>:<external_id>:<digest>, and update record item 5 and the tests to match.

  3. The PR body is spec 019's. It opens "Spec 019, increments 1 and 2: dynamic questions…" and lists 019's files and owner decisions. 010's own round notes are appended after that. It needs rewriting for 010 before merge.

Should fix in this PR

  1. specs/010-integrations/spec.md still says implementation: pending, although increment 1 landed and 010 joins VERIFIED_SPECS. It should be in-progress.
  2. Verification: the loop if cargo tree -p "$p" … | grep -E "^(rahi|aicortex)"; then exit 1; fi passes when cargo tree itself fails (for a renamed package or a lockfile error), because the pipeline's status is grep's. Capture the output first: t=$(cargo tree -p "$p" -e normal,build --locked --prefix none) || exit 1; if printf '%s\n' "$t" | grep -qE '^(rahi|aicortex)'; then exit 1; fi.
  3. tests/store.rs: a_store_without_the_rustev_set_refuses_and_accepts_nothing calls Store::open directly. It skips the bounded port-in-use retry that open() exists for, so it has the same TOCTOU flake the helper was written to avoid.

Notes (no change required, but the record should say so)

  • With AcceptanceUnknown, the actual store error (for example Io("disk")) is thrown away, because the seam reports only no answer within N ms. The delivery is also held for the full delivery timeout (in Queue, a worker slot). That is a consequence of spec 003 3.9.4's seam, not a code bug. Item 5 should state the evidence loss, or a follow-up should let the seam carry uncertainty with a detail.
  • Classification::Changed uses head.accepted_digest.unwrap_or_default() upstream. A head without an accepted digest would give Seen::Other(Some("")) and the conflict text sha256:. Map an empty string to None.

Verified

  • Durability::of matches Rahi v0.7.1 wal_sync: effective_nodes() is nodes, or this node alone when it's empty, so nodes.len() > 1 is equivalent.
  • The commit mapping matches rahi-store/src/error.rs at v0.7.1. Conflict and Validation are statement or constraint failures inside the rolled-back SQLite transaction (or check_statements before anything is submitted). Raft, network and storage failures are Upstream or Io, which correctly become acceptance_unknown.
  • Cargo.lock: 300 (name, version) pairs added, none removed or changed.
  • No R-/A- id clash with impl(019): dynamic questions #148 to impl(020): remote protocol refinements #152. Every runtime SinkPolicy carries a delivery timeout (deliver_once), so pending() can't hang the runtime.
  • No AI review has run on 35544f4 or e49ef93 yet. The round-3 finding was on 8e6ab24.

For the owner

R-44 and A-45 make this review the moment the owner confirms the written binding records, and this comment is not that confirmation. Rows worth the owner's own read:

  • rustev-aicortex item 1: choose between waiting for Aicortex publication and scoping spec 021's source check to the release closure.
  • rustev-serve items 4 to 7 and the 042 2.2 rows pass on spec 042's prose, while item 2 refuses for the same reason.

@bartekus bartekus changed the title impl(010): binding records and the rustev-rahi evidence sink impl(010): binding records, the rustev-rahi evidence sink and the spec 001 3.5 confirmation rule Oct 21, 2026
@bartekus
bartekus force-pushed the impl/010-integrations-rahi branch from e49ef93 to 467b33a Compare October 21, 2026 23:26
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the PR for bugs, security problems, and governance inconsistencies.

Boundary tool implements R-45 without owner ratification

R-45 in docs/decisions/00-founding-decisions.md explicitly states: "until the owner approves, this row records the proposal and no approval." The spec 001 change log entry for R-45 similarly notes: "Awaiting the owner's approval (001 is approved)." Spec 001's status is approved, so amending its behavioral rules requires owner ratification before implementation. No approval entry for R-45 exists in the Approvals table. Yet this PR lands both the spec 001 text change (new 3.5 paragraph) and the full implementation of that unapproved rule in tools/rustev-boundaries/src/lib.rs (confirmed, own_graph_of, tree_names) and tools/rustev-boundaries/src/main.rs (the per-crate cargo tree confirmation loop). The implementation record in spec 010 acknowledges this: "under spec 001 3.5 as amended by R-45 (awaiting the owner's approval)," which is the admission that the code is acting on a proposal, not a ratified rule.

Conflict sentinel string is inconsistent with the binding record's description

sink.rs line ~371: when Seen::Other(None) (the CollisionRedelivered case), settled() produces Delivery::Conflict { stored: "another digest".to_string() }. The binding record item 5 states: "A Changed classification whose head holds no accepted digest … gives a conflict with no stored digest, never sha256:." The implementation record in spec 010 repeats: "gives a conflict with no stored digest." The sentinel string "another digest" is neither a digest nor empty; it contradicts the stated contract that no stored digest is reported in this case.

{"head": "467b33a671d4d19b9b79dd4a71efc636121e733e", "verdict": "findings", "findings": [{"path": "tools/rustev-boundaries/src/main.rs", "line": 36, "summary": "The R-45 confirmation logic is implemented here (and in lib.rs) but R-45 explicitly states it awaits owner approval of an amendment to the approved spec 001; no ratification entry exists, violating the governance rule that behavioral changes to approved specs require owner ratification before implementation lands."}, {"path": "integrations/rustev-rahi/src/sink.rs", "line": 371, "summary": "The CollisionRedelivered path sets stored to the sentinel string 'another digest', contradicting the binding record item 5 and spec 010 implementation record, which both state this case yields a conflict with no stored digest."}]}

Subject: 00a4b7c...467b33a, diff digest 0391d6554083d0d9140d3b611812ef4b0c80104e76b36a5d02c542f85ed424bc, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 23:31 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/010-integrations-rahi branch from 467b33a to cc9afd4 Compare October 21, 2026 23:33
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for the rustev-rahi integration crate (spec 010), binding records, boundary check amendment (R-45), and associated governance updates.

integrations/rustev-rahi/ — The sink logic in sink.rs is internally consistent. The deliver_typed flow is correct: schema guard → size guard → classify → clock check → atomic transaction (receipt + record row) → settle on refusal. The Delivery taxonomy matches the binding record item 5 exactly. The AcceptanceUnknown → std::future::pending() is correct by spec 003 3.9.4 and tested with a timeout. The double-prefix concern on the sha256: digest in settled() is not a bug: Receipts::classify returns ContentDigest (64-char hex, no prefix), so reported() returns raw hex, and format!("sha256:{hex}") constructs the correct prefixed string. The integration test in store.rs confirms this with assert_eq!(stored.as_deref(), Some(digest.as_str())) where digest is the full sha256:<hex> string.

port.rs — ReceiptPort::commit maps txn results to () correctly. The Scripted test double's reversal (rev().collect() + pop()) correctly delivers reads in the declared order.

schema.rs — stage_erasure correctly stages both the Rahi receipt erasure and the DELETE_RECORD statement in a single TxnBuilder, verified by the unit test and the integration test.

tools/rustev-boundaries/ — confirmed() and own_graph_of() correctly implement R-45: transitive violations require cargo tree -p confirmation; direct violations (ForbiddenFamily etc.) return None from own_graph_of and bypass confirmation. The _ => true arm in confirmed() makes direct violations always stand. The main.rs fails closed when cargo tree returns non-zero. cargo tree --target all is valid in Cargo ≥ 1.66 (workspace uses 1.98.1). {p} format with --prefix none produces bare package names, correctly parsed by tree_names.

specs/001-boundaries-and-authority/spec.md — The spec text is consistent with the implementation. "A violation of a declared edge needs no confirmation" matches _ => None from own_graph_of and _ => violations.push(v) in main.rs.

specs/010-integrations/spec.md — implementation: pending → in-progress is valid per the contract table. The rustev-rahi establishes clause correctly removes planned: true. The rustev-aicortex and rustev-serve records correctly refuse (item 1 and item 2 respectively), blocking their implementation per 3.4.8.

Governance — R-44's circular framing ("owner confirms in review of this PR") is noted, but enforcement of owner acts is outside review scope per the instructions.

No concrete defects found.

{"head": "cc9afd451b5ffe64e114db67279ee9b3eb267df0", "verdict": "no-findings", "findings": []}

Subject: 00a4b7c...cc9afd4, diff digest 2995b97ac5ed715d7e6beacd5b16e5a3040ce5aa9c1103256f57fea3d9b92bcd, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus enabled auto-merge (squash) October 21, 2026 23:40
@bartekus
bartekus force-pushed the impl/010-integrations-rahi branch from cc9afd4 to 39475e7 Compare October 21, 2026 23:44
@bartekus
bartekus disabled auto-merge October 21, 2026 23:44
@bartekus
bartekus enabled auto-merge (squash) October 21, 2026 23:49
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

I reviewed each changed file for bugs, security problems, and inconsistencies, with particular attention to the new crate (integrations/rustev-rahi/), the boundary-checker amendments, and the spec/decision updates.

sink.rs — deliver_typed: The race-condition path (classify → write → classify-again-after-refused-transaction) is correctly handled. The fail modes (Conflict, Validation as definite rollbacks; all others as AcceptanceUnknown) match the binding record item 5 exactly. The std::future::pending().await in deliver for AcceptanceUnknown is intentional per spec 003 3.9.4 and documented.

schema.rs: Migration set construction, RECEIPT_NAMESPACE/TABLE constants, INSERT_RECORD/DELETE_RECORD SQL, and stage_erasure (receipt erasure staged before record deletion, both in one transaction) are consistent.

port.rs: The reported helper correctly treats an empty head digest as None. ReceiptPort impls for StoreHandle map all five Classification variants to Seen without gaps.

Boundary checker (lib.rs + main.rs): confirmed() checks whether the crate's own graph contains any package forbidden by the relevant rule, not specifically the package in the violation path. The test makes this explicit ("the negative control: the crate's own graph holds the family"). This is conservative (preserves more violations) and cannot produce false negatives. The fail-closed behaviour (cargo tree failure → violation stands) is correctly implemented in main.rs. The --target all argument to cargo tree for ForbiddenTransitive is what spec 001 3.5 specifies.

tests/store.rs: The TOCTOU port-race retry loop is sound. The conflict test (modifying plan_id to produce the same decision_id with a different digest) correctly exercises the conflict path against a real store.

Spec / decision text: R-45 in spec 001 3.5 and the new paragraph in main.rs's doc comment are consistent. Spec 010 implementation: pending → in-progress and the addition of 010 to VERIFIED_SPECS in the Makefile are consistent with rustev-rahi being implemented. The binding records' pass/refuse/unverified outcomes match the implementation record and tools/rustev-release/release-set.json.

No concrete defects found.

{"head": "39475e71c07815c2226ea71c1fcb76d56354d8fd", "verdict": "no-findings", "findings": []}

Subject: 4552b3e...39475e7, diff digest 2995b97ac5ed715d7e6beacd5b16e5a3040ce5aa9c1103256f57fea3d9b92bcd, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus merged commit 0cc3b1e into main Oct 22, 2026
26 checks passed
@bartekus
bartekus deleted the impl/010-integrations-rahi branch October 22, 2026 00:10
bartekus added a commit that referenced this pull request Oct 22, 2026
Spec 029 increment 1: the statistics core of evaluation repeatability
(3.3 to 3.5). Library only; no CLI, no repeat set, no live run, provider
call or spend. `implementation: in-progress`; 029 joins `make verify` at
completion.

- `rustev-eval/src/generator.rs`: `xoshiro256starstar-splitmix64/1` on
  wrapping `u64` arithmetic (3.4.2), stream seeds through the contract's
`tagged_digest` (3.4.3), the rejection-sampled uniform index (3.4.4) and
  run seeds (3.4.6). No dependency added.
- `rustev-eval/src/repeat_config.rs`: `rustev.repeat-config/1`
  (`REPLAY_V1`, canonical identity, unknown fields and duplicate keys
  refused, no binary64), every rule of 3.3.1.
- `rustev-eval/src/repeat_stats.rs`: per-run values, `mean`, `sd`,
`min`,
`max`, `pooled` (3.3.2, 3.3.3); the case-clustered percentile bootstrap
with exact integer ranks, one stream per cohort, `B * C * N` above 10^9
  refused before drawing (3.4); noise bands with their basis (3.5).
  Unknown run values, undefined resamples and unknown band inputs stay
  unknown, never a default.
- `tests/data/bootstrap/`: `generators.c` (the authors' reference C
implementations, CC0) printed `generators.json`; `reference.py` (Python
3
  standard library only, written from the spec text) writes
  `expected.json` from `cases.json` with every binary64 as its bit
  pattern and checks the C vectors; `python3 -I reference.py --check`
  regenerates and compares bytes.
- `tests/bootstrap.rs`: generators, stream and run seeds, index draws,
  ranks, statistics and intervals bit for bit against the reference;
  the size bound; shape refusals. `tests/repeat_config.rs`: every 3.3.1
  rule and bound, identity, bands, and the section 5 rows on a one-run
  `captured` band and a zero `deterministic_replay` band.
- `tools/rustev-release/archive-policy.json`: the three new source files
  join the reviewed archive list (spec 029 gains an additive `extends`
  edge on `tools/rustev-release/`, as spec 026 did).
- Spec 029: frontmatter, increment plan, implementation record and the
  engineering choices made by the implementing agent.

Size: about 1,900 authored lines; `expected.json`, `generators.json`,
`cases.json` and the derived shards are generated.

Local verification (macOS arm64): `make gate` passes with spec-spine
0.31.0; `python3 -I reference.py --check` passes. Cargo build and tests
are left to CI here: the shared target was locked by other lanes'
builds.

Round 1 CI: clippy `collapsible_if` in `repeat_config.rs` (fixed).

Review round 1 (1 finding, not a defect, evidence added): the finding
says
`reference.py`'s `total_key` sorts negative values above positive ones.
Python's `^` with the non-negative mask `0x7FFFFFFFFFFFFFFF` keeps a
negative integer negative, so the key is the IEEE 754 total order:
`sorted([1.0, -1.0, 0.0, -0.0, -2.0, 3.5, float('-inf')],
key=total_key)`
gives `[-inf, -2.0, -1.0, -0.0, 0.0, 1.0, 3.5]` with keys
`-9218868437227405313, ..., -1, 0, ...`. To make this checked rather
than
argued, `cases.json` gains a set with negative values and zeros of both
signs (two quantiles and a mean), so the Rust test now compares that
order
bit for bit, and `total_key` carries a comment saying why it holds. Also
in this round: the bootstrap function refuses a seed, level or resample
count outside 3.3.1 (it is public, so it does not rely on the document's
check), and a contribution with a zero denominator is refused.

Review round 2: no findings. Round 2 CI: clippy
`cloned_ref_to_slice_refs` in `tests/bootstrap.rs` (fixed).
Rebased onto `main` after #147 (no conflict).

Review round 3 (1 finding, fixed): the `MAX_DENOMINATOR` comment claimed
the case count was bounded, but nothing bounds it, so a saturating `u64`
sum could in principle saturate. Integer sums are now `u128` (at most
`u32::MAX` per contribution, 64 runs and fewer than 2^64 drawn cases
stay
below 2^102), with no saturating arithmetic left; the record states it.
Round 3 CI: `code` passed, including the bit-for-bit reference test.
Review round 4: no findings. Rebased onto `main` after #156 (no
conflict).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant