research(agent-memory): mincut-gated forgetting — rejected, with evidence (ADR-345) - #961
Conversation
|
CI status: The job log shows 623/624 tests passed; the sole failure is That test ( Re-running the failed jobs once to confirm this is transient, per the drive-to-green flake policy. Generated by Claude Code |
Add graph_forget::MincutGatedForgetting (feature-gated: mincut-forget), a CompactionPolicy that layers a ruvector-mincut boundary signal on top of the existing CoherencePolicy scalar score, to test whether structural "bridge" memories can be protected from eviction. Factor CoherencePolicy's scoring into weighted_importance() for reuse. Add witnessed_compaction::compact_witnessed + EvictionWitnessChain: an always-on eviction path that emits a chained ADR-134 witness record per evicted entry before mutating the store, closing the gap where admission and retrieval are witnessed but deletion is not. Adds one action_kind constant (LEDGER_COMPACT_EVICT = 0xA7). Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TKszxZVDnLu1fCH2BAwFi5
- mincut_gated_forgetting_bench: the fixed, falsifiable acceptance test (baseline CoherencePolicy vs. MincutGatedForgetting Soft/Hard) with real timing, bridge-survival, recall, and witness tamper-detection measurement. - mincut_scaling_probe: RuVectorGraphAnalyzer::partition() latency vs. graph size (50-11400ms across n=50..400). - mincut_determinism_probe: reproduces partition() returning an empty/unusable result in ~50% of repeated calls on an identical graph. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TKszxZVDnLu1fCH2BAwFi5
Records the rejected hypothesis, measured evidence (performance and non-determinism findings against ruvector-mincut's RuVectorGraphAnalyzer), and the decision to keep the module feature-gated and unpromoted while retaining the eviction-witness half as a default-on capability. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TKszxZVDnLu1fCH2BAwFi5
Full methodology, raw benchmark output, scaling/determinism evidence, rejected alternatives, and next-research directions for the 2026-09-05 nightly run (ADR-341). Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TKszxZVDnLu1fCH2BAwFi5
Also fixes the nightly README's ADR link, which pointed at ../../adr/ (docs/research/adr/, a non-existent path) instead of ../../../adr/. The RNG seed 341 in examples/mincut_gated_forgetting_bench.rs is a seed, not an ADR reference, and is left unchanged. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_019xHM4rAH4aaShb4DTr1n6s
d0071c2 to
99c7e98
Compare
Summary
Nightly research run (2026-09-05, ADR-345): tests whether
ruvector-mincut's existingRuVectorGraphAnalyzercan giveruvector-agent-memory's compaction a structural "don't evict the bridge memory" signal that the existing scalarCoherencePolicycannot express.Result: REJECT, with evidence. Two independent, measured failure modes:
RuVectorGraphAnalyzer::partition()scales from ~77ms (n=50 vertices) to ~11.4s (n=400), and cost ~1,800–2,700x the scalar baseline even at a deliberately tiny 84-memory corpus (threshold was 100x).partition()calls on byte-identical input returned an empty/unusable result in 15/30 (50%) of calls.A separate, independent piece shipped as a working capability regardless:
compact_witnessed+EvictionWitnessChain, which closes a real gap —ruvector-agent-memorywitnesses memory admission and (via a sibling crate) retrieval, but had nothing witnessing deletion. This reuses the crate's existing ADR-134 witness-record machinery verbatim (one newaction_kindtag) and passed its own acceptance test cleanly (20/20 tamper-detection trials).What changed
crates/ruvector-agent-memory/src/graph_forget.rs(new, feature-gated behindmincut-forget, off by default):MincutGatedForgettingcompaction policy (Soft/Hardvariants).crates/ruvector-agent-memory/src/witnessed_compaction.rs(new, always on):compact_witnessed+EvictionWitnessChain.crates/ruvector-agent-memory/src/compaction.rs: factoredCoherencePolicy's scoring into reusableweighted_importance().crates/ruvector-agent-memory/src/ops.rs: addedaction_kind::LEDGER_COMPACT_EVICT = 0xA7.crates/ruvector-agent-memory/examples/:mincut_gated_forgetting_bench.rs(the acceptance benchmark),mincut_scaling_probe.rs,mincut_determinism_probe.rs(the two feasibility/characterization probes referenced above — runnable, not one-off output).docs/adr/ADR-345-mincut-gated-forgetting.mddocs/research/nightly/2026-09-05-mincut-gated-forgetting/README.mdandgist.mdNo existing behavior changes:
CoherencePolicy/LruPolicy/LfuPolicyandcompact()are untouched.graph_forgetis opt-in and off by default.(Note: this ADR was originally numbered 341, which collided with an existing ADR merged from another PR (#933) while this one was open. Renumbered to ADR-345 and rebased onto the current
mainin a follow-up commit on this branch.)Benchmark command
Real benchmark results
Full raw output, the scaling table (n=19..400), and the determinism-probe numbers are in the nightly README's "Benchmark Results" and "Failure modes" sections.
Acceptance result
REJECT (for production use as designed).
graph_forgetis retained, feature-gated and unpromoted, as a working reference implementation and as negative evidence so a future attempt doesn't rediscover the same two failure modes from scratch.witnessed_compactionis not gated by this rejection and ships as a usable capability today.Darwin / Flywheel result
Neither tool exists in this repository:
npx ruvector harness doctor --jsonfails (no such CLI), and noharness/darwin/flywheelsubcommand exists anywhere incrates/ruvector-cli.npx metaharness --helpresolves to a generic project-scaffolding tool unrelated to orchestrating research inside this repo. This capability-discovery result is recorded in the nightly README rather than assumed; the role-separation this process calls for (planner/researcher/engineer/critic) was performed serially in one session instead, with the design-probe → hypothesis-lock → run → analyze sequence documented in the README standing in for it.Security review
No new cryptographic primitive.
compact_witnessedreuses the crate's existing keyless-FNV-1a witness chain and its documented tamper-evidence scope unchanged (naive-edit detection, not adversary-resistant — seesrc/ops.rs's module docs). The mincut structural signal is advisory-only: a wrong or empty boundary set degrades to the already-reviewedCoherencePolicybehavior, never to an unsafe state.Main limitations
ruvector-mincut's lower-level APIs (DynamicMinCut,ClusterHierarchy), which might avoid the measured overhead, were not tried — flagged as the primary next-research direction.Production recommendation
Do not use
MincutGatedForgettingin production. Do usecompact_witnessedfor any existing compaction policy that needs an auditable eviction trail — it has no mincut dependency and is enabled by default. Next research: repeat this exact, unmodified benchmark againstruvector-mincut's lower-level API surface once/if its performance and non-determinism are addressed upstream.🤖 Generated with claude-flow
https://claude.ai/code/session_01TKszxZVDnLu1fCH2BAwFi5