Skip to content

fix(qa): prove newer session facts outrank competing durable memory - #119496

Merged
steipete merged 3 commits into
mainfrom
codex/autoqa-memory-ranking-evidence-20260805
Aug 5, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/autoqa-memory-ranking-evidence-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where session-memory ranking QA could report success without executing a memory search, without searching durable memory, or even when the older durable fact outranked the current session fact. The old mock request also leaked the answer into the query and excluded durable notes with a sessions-only corpus.

Why This Change Was Made

Require a successful persisted memory_search and inspect provider-independent Gateway history for an ID-correlated, unfiltered, answer-free search result containing both competing facts. Use a realistically older daily note, the existing canonical six-result default, and compare the relative ranks of the actual conflicting facts while ignoring unrelated current-turn or workspace hits. Remove the old mock-only debug inference; no production memory ranking, indexing, persistence, or configuration changes.

User Impact

The same QA scenario now verifies real session-versus-durable memory ranking in both mock and live provider lanes and cannot pass on a fabricated final answer.

Evidence

  • Authentic parsed-scenario coverage in both provider modes rejects missing/failed/mismatched tool calls, filtered corpus, answer-bearing queries, missing durable competition, and stale-before-current ranking.
  • A real HTTP mock-provider regression proves the actual search request omits the corpus filter and answer while using the product default maxResults: 6.
  • The real Gateway + mock-provider session-memory-ranking scenario passes with an actual recent dated durable note, a newer session fact, and both facts in the same persisted search result.
  • Trusted Blacksmith Testbox aggregate passed 916 tests across 28 files; the final owner-adjacent rerun passed 102 tests across 6 files.
  • The mock-provider production owner is net-negative; remaining changes are QA fixtures and regression coverage. Independent structured review found no accepted actionable findings.
  • Testbox run: https://github.com/openclaw/openclaw/actions/runs/30973152491

Inspectable after-fix Gateway evidence

A real private-QA Gateway, real memory search/indexing, and the actual HTTP mock provider produced:

[qa-suite] gateway ready: http://127.0.0.1:39273
[qa-suite] scenario start (1/1): session-memory-ranking
[qa-suite] scenario pass (1/1): session-memory-ranking
[qa-suite] run complete: passed=1 failed=0 skipped=0 total=1

The persisted successful call searched both configured memory sources, contained the newer session fact and older dated durable fact in the same result, and ranked the newer fact first among conflicting facts. The canonical optional maxResults argument accepts an omitted six-result default or explicit 6; both mock/live regressions reject explicit 3. The focused owner-adjacent proof passed 32 tests. No provider secrets or response credentials are present in this output.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 2:14 AM ET / 06:14 UTC.

ClawSweeper review

What this changes

The PR makes session-memory ranking QA require a persisted, unfiltered memory search whose newer session fact ranks above a conflicting durable-memory fact.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Current main still permits this QA scenario to pass after an answer-bearing, sessions-only mock search. The PR fixes that QA gap at the right boundary and resolves the previous result-window finding, but needs inspectable after-fix Gateway scenario proof before merge.

Priority: P2
Reviewed head: a81449a66342054c0fb6462f91aa1c23cb40bae6

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is well-targeted with strong fixture coverage, but real behavior proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Fixture tests and aggregate Testbox claims are supplemental; the PR body lacks inspectable after-fix Gateway scenario output or a verdict artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Fixture tests and aggregate Testbox claims are supplemental; the PR body lacks inspectable after-fix Gateway scenario output or a verdict artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main gap: Current main's mock-provider branch searches only sessions with an answer-bearing query, while the scenario merely checks that some mock search was planned; this cannot prove durable-memory competition.
PR owner-boundary repair: The PR head correlates persisted tool calls and successful results, rejects corpus filters and answer leakage, and requires both facts in one ordered result.
Optional result-window contract: An omitted tool argument correctly resolves to the memory configuration's six-result default; the PR's final commit addresses the earlier result-window concern.
Findings None None.
Security None None.

How this fits together

QA Lab drives an agent through a gateway scenario against mock or live providers, then evaluates the observable outcome. This change reads persisted gateway history after the run to ensure memory search inputs and ranked results actually support the answer.

flowchart LR
  Fixture[Session and durable fixtures] --> Agent[QA agent run]
  Agent --> Search[Memory search]
  Search --> History[Persisted gateway history]
  History --> Ranking[Rank and source checks]
  Ranking --> Verdict[Scenario pass or failure]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Fixture tests and aggregate Testbox claims are supplemental; the PR body lacks inspectable after-fix Gateway scenario output or a verdict artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - This deliberately tightens QA automation; merge confidence still depends on a real Gateway-plus-mock-provider run showing the persisted search and ranking evidence, rather than fixture-only coverage.
  • Complete next step (P2) - The protected maintainer label and missing real behavior proof require human-only merge handling after the contributor adds inspectable evidence.
Agent review details

Security

None.

PR surface

Source -1, Tests +469, Other +68. Total +536 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 3 -1
Tests 3 470 1 +469
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 95 27 +68
Total 5 567 31 +536

Review metrics

Metric Value Why it matters
Production versus QA-test delta production runtime -1, QA scenario fixture +68, tests +469 The product memory implementation does not grow; the added surface is targeted QA evidence for the ranking invariant.

Stored data model

Persistent data-model change detected: serialized state: extensions/qa-lab/src/providers/mock-openai/server.memory-ranking-proof.test.ts, serialized state: qa/scenarios/memory/session-memory-ranking.yaml, unknown-data-model-change: qa/scenarios/memory/session-memory-ranking.yaml. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Attach real scenario evidence (recommended)
    Add a redacted Gateway-plus-mock-provider session-memory-ranking verdict or transcript that shows the persisted search call, matching result, and passing rank assertion.

Technical review

Best possible solution:

Keep the provider-independent gateway-history assertions and attach a redacted scenario verdict or runtime transcript demonstrating the real post-fix search, competing facts, and ordered result.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main's mock request is answer-bearing and sessions-only while the scenario enables both sources, so it cannot establish the claimed ranking competition.

Is this the best way to solve the issue?

Yes. Recording and checking the correlated gateway tool call and result at the QA-flow boundary is stronger and more provider-independent than the prior mock debug-request inference.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 77f7560b4184.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs the reliability of a bounded memory-ranking QA scenario without demonstrating a current production outage.
  • merge-risk: 🚨 automation: The stricter scenario and gateway-history assertions change CI/QA pass criteria beyond what ordinary static checks establish.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Fixture tests and aggregate Testbox claims are supplemental; the PR body lacks inspectable after-fix Gateway scenario output or a verdict artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Current mock and scenario lines blame to the feature commit that introduced this QA path; the PR also continues that work. (role: original session-ranking QA author and recent area contributor; confidence: high; commits: 4707934b3062, a81449a66342; files: extensions/qa-lab/src/providers/mock-openai/server.ts, qa/scenarios/memory/session-memory-ranking.yaml)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted real Gateway-plus-mock-provider scenario transcript or verdict JSON showing the passing ranking assertion.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-05T05:36:57.367Z sha 03534e0 :: needs real behavior proof before merge. :: [P2] Assert the six-result search contract
  • reviewed 2026-08-05T05:47:10.099Z sha fe29a3a :: needs real behavior proof before merge. :: [P2] Allow the optional default result window

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(qa): prove newer session facts outrank competing durable memory This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit 702eb6e into main Aug 5, 2026
130 of 132 checks passed
@steipete
steipete deleted the codex/autoqa-memory-ranking-evidence-20260805 branch August 5, 2026 06:34
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
…penclaw#119496)

* fix(qa): prove session memory outranks stale durable facts

* fix(qa): require the canonical memory search result window

* fix(qa): honor the optional canonical memory search limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant