Skip to content

feat: contradiction benchmark segment + uteke supersede CLI (#1172 F3) - #1192

Merged
ajianaz merged 1 commit into
developfrom
feat/1172-f3-benchmark
Sep 6, 2026
Merged

feat: contradiction benchmark segment + uteke supersede CLI (#1172 F3)#1192
ajianaz merged 1 commit into
developfrom
feat/1172-f3-benchmark

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

What

Fase 3 of #1172 — closes the epic with an active-store benchmark segment proving conflict resolution end-to-end, plus the missing CLI surface:

  • benchmarks/longmemeval/contradiction_segment.py — 40 topics × (stale fact + winner fact + 3 distractors); queries ask "which {thing} does {topic} use now?" (semantic, no keyword echo). Baseline metrics are measured for ALL strategies on the unresolved store first, then one supersede pass resolves everything, then resolved metrics. Harness + raw metrics committed (results_contradiction_f3/metrics.json); findings published in benchmarks/longmemeval/RESULTS.md.
  • Results (40 topics, fusion default): winner@1 0.850 → 1.000, MRR 0.925 → 1.000, stale@5 1.000 → 0.000. Unresolved conflicts pollute top-5 on every strategy (hybrid's BM25 ranks the stale fact top-1 on 97.5% of topics — "uses X" matches "use now?" lexically); after supersede, stale@1/stale@5 = 0.000 everywhere. The ledger listed all 40 resolutions in-loop (feat: contradiction resolution ledger + undo across CLI/HTTP/MCP (#1172) #1185 surface verified).
  • uteke supersede <old> <new> [--reason] — new CLI command, parity with the MCP tool and HTTP surface (supersession was previously unreachable from the CLI). Prefix-aware, --json, human output points at contradictions undo for restore.
  • Docs: cli-reference (uteke supersede), CHANGELOG, RESULTS.md section.

Why

#1172 F3. F1/F2 built provenance and the resolution ledger; F3 demonstrates the payoff on an active store: ranking alone often picks the winner (85–95% top-1), but only explicit resolution guarantees stale facts leave the retrieval surface entirely — the difference between "usually right" and deterministic freshness for agent memory. The segment also exposed and closed a real surface gap (no CLI supersede).

Testing

  • Segment executed 3× (initial + 2 post-fix runs): final run 40 topics × 3 strategies × 2 stages, all resolution/ledger assertions pass
  • cargo test --workspace — 667 passed, 0 failed; fmt clean; clippy 0 warnings; cora review --staged pass (2 findings from its first pass fixed: broken topic→thing query mapping; per-strategy baseline ordering that would measure a resolved store)
  • CLI uteke supersede exercised live in the segment loop (40 resolutions via the new command)

Fase 3 of #1172 closes the epic with an active-store knowledge-update
segment proving conflict resolution end-to-end:

- contradiction_segment.py: 40 topics x (stale + winner + 3 distractors),
  semantic 'which X does topic use now?' queries; baseline measured for
  ALL strategies on the unresolved store, then one resolution pass, then
  resolved metrics (code-scanning fixes: topic->thing map instead of a
  broken next() query that malformed questions; baseline-ordering so
  later strategies never measure a resolved store)
- Results (RESULTS.md + results_contradiction_f3/metrics.json):
  - fusion (default): winner@1 0.850 -> 1.000, MRR 0.925 -> 1.000,
    stale@5 1.000 -> 0.000 — unresolved conflicts pollute top-5 on every
    strategy; supersede clears them from the retrieval surface
  - hybrid baseline ranks the stale fact top-1 on 97.5% of topics
    (lexical match of 'uses X' with 'use now?'); resolved stale@1 = 0
  - ledger listed all 40 resolutions (F2 surface verified in-loop)
- uteke supersede <old> <new> [--reason]: CLI surface parity for
  supersession (was MCP/HTTP only) — prefix-aware, --json, points to
  contradictions undo for restore
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 29d50d7 into develop Sep 6, 2026
16 checks passed
@ajianaz
ajianaz deleted the feat/1172-f3-benchmark branch September 6, 2026 07:07
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