Conversation
Closes the ADR-134 SS9 WitnessSigner gap named in ledger.rs/ops.rs's own tamper-evidence notes and the 2026-09-05 nightly's Next Research item 4: the FNV-1a witness chain is tamper-evident against accidental corruption only, not a log-writing adversary. Adds witness_signing::SignedWitnessSink<S: WitnessSink>, a decorator that Ed25519-signs records either per-record or via an amortized batch-tail strategy, reusing the crate's existing rvf-types Ed25519 primitive (ADR-320) -- no new dependency. verify_signed_chain combines the existing unsigned chain walk with signature checks cross-bound to each signed record's current content, which is what actually detects a diligent, fully self-consistent forgery that the unsigned walk alone cannot. TransactionalLedger gains into_witness_sink() to recover a wrapped sink's signed spans after a run. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Gpkdh8ATrH62owAUHQhRUQ
Compares unsigned baseline vs PerRecord vs BatchTail{16,64,256} over a
20,000-entry (40,000 witness record) synthetic workload, release build,
real wall-clock timing, deterministic signing key. Also constructs a
diligent-forgery scenario (edit one record, recompute the chain forward
consistently) and confirms both signing strategies reject it while the
unsigned chain walk alone does not.
Run: cargo run --release -p ruvector-agent-memory --example witness_signing_bench
Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01Gpkdh8ATrH62owAUHQhRUQ
Full hypothesis, methodology, raw benchmark evidence, acceptance gates, failure modes, explicit scope boundary on the FNV-1a second-preimage question, ecosystem-fit analysis, and next-research items for the 2026-09-16 nightly run (docs/research/nightly/2026-09-16-witness-signer-agent-memory). Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Gpkdh8ATrH62owAUHQhRUQ
Records the accepted decision, evidence summary, alternatives considered, security scope, and rollback plan for witness_signing.rs. Updates the ADR index (highest allocated number, new row). Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Gpkdh8ATrH62owAUHQhRUQ
|
CI status on Generated by Claude Code |
Nightly Research: Closing the ADR-134 §9
WitnessSignerGapHypothesis: Given the TARL ledger's existing FNV-1a witness chain and its own documented ADR-134
WitnessSignergap, when witness records are Ed25519-signed either per-record or via an amortized batch-tail-only strategy (reusingrvf-types's existing Ed25519 primitive, zero new dependency), then batch-tail signing should reduce mean per-operation latency substantially relative to per-record signing, while both strategies retain identical detection of a "diligent" forgery (a fully self-consistent, forward-recomputed chain edit) that the existing unsigned chain-walk alone does not detect — subject to zero false negatives/positives across the full test matrix, with every number from a realcargo run --releaseexecution.This closes a gap named twice in this codebase (
ops.rs's andledger.rs's own tamper-evidence notes) and once more in the 2026-09-05 nightly's Next Research (item 4: "wire an Ed25519WitnessSigner... so eviction receipts are signed, not just hash-chained").Architecture
SignedWitnessSink<S: WitnessSink>wraps any inner sink and Ed25519-signs either every record (PerRecord) or the tail record of everybatch_size-record run (BatchTail), domain-separated by purpose.verify_signed_chaincombines the existing unsigned chain walk with signature checks cross-bound to each signed record's current content — the piece that actually defeats a diligent forgery. Reusesrvf-types::ed25519(already an unconditional dependency of this crate, ADR-320) — zero new Cargo dependencies.Files changed
crates/ruvector-agent-memory/src/witness_signing.rs(new module, 6 unit tests)crates/ruvector-agent-memory/src/ledger.rs(TransactionalLedger::into_witness_sink)crates/ruvector-agent-memory/src/lib.rs(module wiring + re-exports)crates/ruvector-agent-memory/examples/witness_signing_bench.rs(benchmark)docs/research/nightly/2026-09-16-witness-signer-agent-memory/{README,gist}.mddocs/adr/ADR-346-witness-signer-tarl-ledger.md+docs/adr/INDEX.mdBenchmark command
Real benchmark results (one
cargo run --releaseexecution, N=20,000 entries, 40,000 witness records)PerRecordBatchTail{16}BatchTail{64}BatchTail{256}Diligent-forgery rejection (constructed by editing one interior record and consistently recomputing the chain forward — passes the unsigned
verify_chain(), confirming the crate's own documented gap is real): bothPerRecordandBatchTail{64}correctly reject it viaverify_signed_chain.Acceptance result: ACCEPT
BatchTail{64}vsPerRecord)40000/batch_sizecargo test -p ruvector-agent-memory --lib: 34 passed, 0 failed (28 pre-existing + 6 new).cargo clippy -p ruvector-agent-memory --all-targets: clean.cargo fmt --check: clean.Darwin / Flywheel / MetaHarness
No
ruvector harnessorflywheel/darwinCLI is installed in this environment (npx ruvector harness doctor --json→ "could not determine executable to run");npx metaharness --helpresolves to a real, installed external-repo scaffolding tool, not an in-repo orchestrator for this workflow. Per the nightly process's own instruction not to assume tooling exists, this run did not fabricate Darwin generations or Flywheel gate calls — the two-parameter design space (signing strategy × batch size) was swept directly and exhaustively (16/64/256) instead of via evolutionary search. Full disclosure is in the research README's "MetaHarness/Flywheel/Darwin Role" sections.Security review
ed25519-dalekvia the crate's existingrvf-typesdependency.verify_signed_chain's cross-check (signedchain_hashvs. the log's actual current content at that sequence) is the security-load-bearing step; documented as such, with the failure mode of omitting it spelled out.ruvector-retrieval-receipt::signing.Main limitations
ruvector-retrieval-receiptcrate).BatchTail's larger blast radius if the signer crashes mid-batch (reasoned qualitatively).Production recommendation
Promote as an opt-in capability (no default behavior change — every existing
TransactionalLedgercaller is unaffected). RecommendBatchTail(tuned batch size) for throughput-sensitive deployments,PerRecordwhere immediate per-record signature availability matters more than throughput. Composes for free with the existingwitnessed_compactioneviction-witness path (ADR-345) with no additional code.Research document / ADR / gist
docs/research/nightly/2026-09-16-witness-signer-agent-memory/README.mddocs/research/nightly/2026-09-16-witness-signer-agent-memory/gist.mddocs/adr/ADR-346-witness-signer-tarl-ledger.md🤖 Generated with claude-flow
https://claude.ai/code/session_01Gpkdh8ATrH62owAUHQhRUQ
Generated by Claude Code