Skip to content

research: mincut-partitioned agent-memory consolidation (nightly 2026-08-17) — hypothesis rejected, two ruvector-mincut defects found - #833

Draft
ruvnet wants to merge 2 commits into
mainfrom
claude/focused-darwin-numa8v
Draft

research: mincut-partitioned agent-memory consolidation (nightly 2026-08-17) — hypothesis rejected, two ruvector-mincut defects found#833
ruvnet wants to merge 2 commits into
mainfrom
claude/focused-darwin-numa8v

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Nightly research run testing whether partitioning the agent-memory similarity graph before applying a retention budget protects minority topics from being evicted in full by ruvector-agent-memory's global top-score CoherencePolicy (nightly 2026-06-14).

  • Hypothesis: REJECTED by direct measurement, at every scale tested (n=4000, n=500, and a bounded floor_min sweep). Worst-cluster recall gain never reached the pre-declared 15pp threshold — best result was 0.00pp at n=4000, 8.00pp at n=500.
  • The mechanism is not worthless: overall recall improved +6.8pp and 4 of 6 clusters individually gained 15–23pp recall each at n=4000. The specific cluster the hypothesis exists to protect stayed merged with the majority cluster by the partitioner, so it received no protection — a bounded sweep of the retention floor confirmed this is a partitioning shortfall, not a retention-budget shortfall (worst-cluster recall was flat across every floor value tested).
  • Along the way, found and documented two independent, reproducible defects in ruvector-mincut: (1) DynamicMinCut::partition() returns vertex splits inconsistent with its own min_cut_value(), nondeterministically; (2) GraphPartitioner/RuVectorGraphAnalyzer drops vertices, fabricates vertex ids for non-contiguous id spaces, and is severely slow (8.4s at n=500, did not finish in 5m42s at n=4000). Both are worked around (not fixed upstream) with a from-scratch, tested weighted Stoer–Wagner implementation (mincut_exact.rs) used as the authoritative partition source; ruvector_mincut's min-cut value is still cross-checked and was never observed wrong, only its partition materialization.

Architecture

  • New crate crates/ruvector-partition-memory (experimental, not wired into any production path).
  • Depends on ruvector-agent-memory (wired into the workspace members list — it predated workspace membership and was otherwise unbuildable) for the baseline CoherencePolicy scorer, reused directly rather than re-implemented.
  • Depends on ruvector-mincut for GraphPartitioner (candidate A) and as a cross-check source for mincut_exact.rs's own Stoer–Wagner (candidate B).
  • witness.rs: SHA-256 hash-chain over partition split decisions, following the precedent set by ruvector-retrieval-receipt (nightly 2026-08-13).

Files changed

  • crates/ruvector-partition-memory/ — new crate: corpus.rs, graph.rs, mincut_exact.rs, partition.rs, retention.rs, metrics.rs, witness.rs, search.rs, main.rs (benchmark binary), examples/calibrate.rs, examples/darwin_sweep.rs.
  • Cargo.toml / Cargo.lock — add ruvector-partition-memory and (previously orphaned) ruvector-agent-memory to workspace members.
  • docs/adr/ADR-305-mincut-partitioned-memory-consolidation.md
  • docs/research/nightly/2026-08-17_mincut-partitioned-memory-consolidation/ — README, gist, and raw evidence/*.txt benchmark output.

Benchmark command

cargo run --release -p ruvector-partition-memory --bin benchmark -- 4000 3 0.35 10 600
cargo run --release -p ruvector-partition-memory --bin benchmark -- 500 3 0.35 10 600
cargo run --release -p ruvector-partition-memory --example darwin_sweep

Real benchmark results (n=4000, accepted run)

variant          overall_recall  worst_cluster_recall  coverage
GlobalTopScore   0.4193          0.1520                 1.000
MincutAdaptive   0.4873          0.1520                 1.000

per_cluster_recall GlobalTopScore = [0.996, 0.152, 0.216, 0.316, 0.396, 0.440]
per_cluster_recall MincutAdaptive = [0.792, 0.380, 0.504, 0.152, 0.556, 0.540]

worst_cluster_gain_pp = -0.00  (threshold: +15.00)
ACCEPTANCE_RESULT: REJECT

Full raw output for this run, the n=500 run, the floor_min Darwin sweep, and the corpus-noise calibration pass are in docs/research/nightly/2026-08-17_mincut-partitioned-memory-consolidation/evidence/.

Acceptance result

REJECT. See ADR-305 for the full rejection criteria, evidence, and a proposed follow-up hypothesis (a per-branch/size-weighted stopping criterion) — not implemented here, since changing the criterion after seeing this run's results would defeat the point of a pre-declared threshold.

Darwin result

Bounded sweep (generations=1, candidates=4) over floor_min ∈ {1,3,8,15}, partition held fixed. Winner floor_min=15 on a composite fitness metric (0.5·worst + 0.3·overall + 0.2·correctness), but worst_cluster_recall itself did not improve — confirming the primary hypothesis's shortfall is structural, not a retention-budget tuning problem. Not promoted to any default; parent retained.

Flywheel result

No ruvector harness flywheel CLI was found in this environment (verified via npx ruvector harness doctor/flywheel --help, no output/executable resolved) — evidence is instead preserved as plain files under evidence/, referenced from the ADR and README, rather than fabricated through a nonexistent interface.

Security review

No new attack surface — standalone research crate over synthetic data, not wired into any request-serving path. witness.rs is a tamper-evidence mechanism for auditing a partition decision after the fact, not an access-control or correctness proof; this is stated explicitly in the ADR's Security section to avoid overclaiming.

Main limitations

  • Single run per configuration (no repeated-trial variance reporting).
  • One synthetic corpus/seed family; not validated against a real agent-memory trace.
  • The two ruvector-mincut defects are documented with minimal repros but not filed upstream from within this run — that needs the owning maintainer's independent verification.
  • No WASM/edge measurement was taken (analysis-only, per the ADR's mandatory-but-optional-implementation guidance).

Production recommendation

Do not promote. Hypothesis rejected by direct measurement. mincut_exact.rs's correct, tested Stoer–Wagner implementation is a reusable asset independent of this ADR's outcome for any future RuVector graph-partitioning work.

Research documents

  • ADR: docs/adr/ADR-305-mincut-partitioned-memory-consolidation.md
  • Nightly research README: docs/research/nightly/2026-08-17_mincut-partitioned-memory-consolidation/README.md
  • Gist: docs/research/nightly/2026-08-17_mincut-partitioned-memory-consolidation/gist.md

Generated by Claude Code

claude and others added 2 commits August 17, 2026 08:16
…oned memory consolidation)

Implements and benchmarks a mincut-partitioned agent-memory retention
policy against the existing global top-score CoherencePolicy baseline
(ruvector-agent-memory, nightly 2026-06-14), reused directly as a
dependency rather than re-implemented.

Includes a from-scratch, tested weighted Stoer-Wagner min cut
(mincut_exact.rs) used as the authoritative partition source, after
ruvector_mincut::DynamicMinCut::partition() was found during development
to return vertex splits inconsistent with its own min_cut_value() and
nondeterministic across runs; ruvector_mincut's value is still queried as
an independent cross-check. fixed_k_partition similarly guards
GraphPartitioner's output against observed vertex loss/fabrication and is
scale-gated after GraphPartitioner measured 8.4s at n=500 and did not
finish in 5m42s at n=4000.

Also wires the previously-orphaned ruvector-agent-memory crate into the
workspace members list so it can be depended on.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01KrAfJLv2U99vvEvQqJ1Zoo
… memory consolidation

Documents the rejected hypothesis (worst-cluster recall gain 0.00pp
against a pre-declared 15pp threshold, at both n=4000 and n=500, and
across a bounded floor_min sweep), the partial positive signal (4/6
clusters individually gained 15-23pp, overall recall +6.8pp), and the two
independently reproducible ruvector-mincut defects discovered along the
way (partition()/min_cut_value() inconsistency + nondeterminism;
GraphPartitioner vertex loss/fabrication + severe latency). Raw benchmark
output preserved under evidence/.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01KrAfJLv2U99vvEvQqJ1Zoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants