Skip to content

test(memory): verify structured consolidation requests - #138671

Merged
steipete merged 1 commit into
mainfrom
codex/frv-memory-consolidation-proof
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/frv-memory-consolidation-proof

Conversation

@steipete

@steipete steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Related: #137967

What Problem This Solves

Resolves a problem where full release verification times out waiting for an explicit-owner memory consolidation request that already reached the provider. This is maintainer-requested release validation maintenance for the failed Gateway E2E job in Full Release Validation 33895007102.

Why This Change Was Made

The E2E identified consolidation using a system-prompt sentence removed by #137967. It now checks the structured candidate payload received by the mock provider: the expected memory text, source reference, agent provenance, and an empty tool list. This keeps the proof tied to the consolidation contract while retaining the restricted-memory sibling and explicit-owner failure checks. Gateway methods passed as callbacks are bound to their receiver.

Provenance: the raw parent comparison from 84bb01c6bea20635b4f98b70714b6e758e2e4d7d to a72ff7a93fb1bcb025f689fd97872e5b6e17ff60 confirms that #137967 replaced the prose instruction in the consolidation owner; this E2E retained the old sentence.

User Impact

Release operators get accurate evidence that deep consolidation reaches the provider through the explicit workspace owner. Product runtime, configuration, and persistence behavior are unchanged.

Evidence

The unchanged E2E reproduced the original failure at 2329399cf6a9a2ca0c19d6c620b713a2768f9125: one test passed and the explicit-owner test timed out after its existing 30-second observation window. Gateway logs showed that consolidation ran and the candidate was promoted. The final test-only repair passed both real-Gateway scenarios with a local mock provider in 41.85 seconds total (29 seconds in tests), using the same built runtime.

# Original failure, including a successful cold E2E runtime build:
node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts

# Final passing proof against that same runtime:
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts

# Changed-surface validation:
node scripts/check-changed.mjs -- test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts
git diff --check

The final changed-surface gate passed, including root test typecheck, scripts lint, and lint for the changed E2E. Formatting and diff checks passed. The final independent P0–P2 review reported no actionable findings. Production LOC: +0/-0. Tests: +18/-12 (net +6).

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 4, 2026
@steipete
steipete marked this pull request as ready for review September 4, 2026 22:28
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Verified the memory consolidation release-proof repair at c594b0c639ca252fac256e3b147dcd5cfd23c1a1.

The unchanged E2E reproduced the original explicit-owner timeout from Full Release Validation 33895007102, even though the Gateway had invoked consolidation and promoted the candidate. The final test observes the structured candidate/source/provenance request and verifies it has no tools. Both real-Gateway scenarios pass, including the restricted-memory sibling. Production LOC: +0/-0; tests: +18/-12.

Proof commands:

# Before: one expected failure, one pass.
node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts

# After: two passes against the same built runtime.
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts

# Passed on the final patch.
node scripts/check-changed.mjs -- test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts
git diff --check

The final independent P0–P2 review found no actionable issues. The E2E uses an isolated real Gateway and a local mock provider; it does not claim authenticated provider inference.

Exact-head CI 33925630714 passed with 78 successful jobs and 17 intentional skips. Latest ClawSweeper status says review is running; no findings or rank-up moves have been posted yet. Native review artifacts are validated.

@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The prior review lease expired at 23:10 UTC without a completed review. The head remains c594b0c639ca252fac256e3b147dcd5cfd23c1a1; exact-head CI and the documented real-Gateway proof are green.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 7:50 PM ET / 23:50 UTC.

ClawSweeper review

What this changes

Updates the memory-consolidation end-to-end test to verify structured candidate content, source references, provenance and absent tools, and binds Gateway callbacks to their receiver.

Merge readiness

✅ Ready for maintainer review

No blocking findings. This maintainer-requested repair remains necessary: fetched main still uses the obsolete prompt-sentence matcher, while the proposed assertions match the current consolidation payload and preserve the restricted-memory scenario.

Priority: P2
Reviewed head: c594b0c639ca252fac256e3b147dcd5cfd23c1a1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, contract-aligned test repair with documented before/after validation and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair. The captured report nevertheless documents the exact changed E2E passing both isolated real-Gateway scenarios with a local mock provider; it does not claim authenticated provider inference.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair. The captured report nevertheless documents the exact changed E2E passing both isolated real-Gateway scenarios with a local mock provider; it does not claim authenticated provider inference.
Evidence reviewed 12 items Verified introduced scope: The pinned parent-to-head diff changes only the existing E2E assertions and two callback bindings. The verified test merge has the recorded base and exact PR head as its parents, and its result changes only this test.
Repair still absent from fetched main: Fetched main still requires CONSOLIDATION_PROMPT_MARKER in allInputText. Its consolidation owner is byte-identical to the reviewed checkout and no longer emits that sentence.
Production payload contract: buildConsolidationPrompt serializes currentMemory and candidates containing text, sourceRef and provenance. consolidateMemory passes that JSON as the completion message with the explicit agentId. The patch tests these actual fields rather than restoring obsolete prompt wording.
Findings None None.
Security None None.

How this fits together

Memory Core's dreaming process evaluates short-term memories for promotion into long-term memory. This end-to-end test drives an isolated Gateway and checks the consolidation request captured by QA Lab's local mock provider.

flowchart TD
  A[Memory fixture and recall] --> B[Isolated Gateway]
  B --> C[Scheduled dreaming sweep]
  C --> D[Qualified memory candidates]
  D --> E[Structured consolidation request]
  E --> F[Local mock provider]
  F --> G[Content provenance and no-tools assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +6. Total +6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 18 12 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 18 12 +6

Review metrics

Metric Value Why it matters
Production versus test growth Production net 0; tests net +6 The added assertions improve existing boundary coverage without introducing runtime code or a new test-only production seam.

Technical review

Best possible solution:

Keep consolidation verification at the provider boundary, checking candidate content, source provenance and absent tools without changing runtime behavior or extending waits.

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

Yes, from source: fetched main waits for prose absent from the current consolidation owner. The supplied before/after E2E report corroborates the timeout; this read-only review did not execute tests.

Is this the best way to solve the issue?

Yes. Checking the captured structured payload removes the obsolete wording dependency while preserving meaningful provenance and tool-free guarantees; restoring the old production sentence would repair the test in the wrong layer.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 66fa0bd2be4f.

Labels

Label changes:

  • add P2: This fixes a bounded release-validation false failure while leaving product runtime behavior unchanged.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair. The captured report nevertheless documents the exact changed E2E passing both isolated real-Gateway scenarios with a local mock provider; it does not claim authenticated provider inference.

Label justifications:

  • P2: This fixes a bounded release-validation false failure while leaving product runtime behavior unchanged.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-authored test repair. The captured report nevertheless documents the exact changed E2E passing both isolated real-Gateway scenarios with a local mock provider; it does not claim authenticated provider inference.

Evidence

What I checked:

  • Verified introduced scope: The pinned parent-to-head diff changes only the existing E2E assertions and two callback bindings. The verified test merge has the recorded base and exact PR head as its parents, and its result changes only this test. (test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts:426, c594b0c639ca)
  • Repair still absent from fetched main: Fetched main still requires CONSOLIDATION_PROMPT_MARKER in allInputText. Its consolidation owner is byte-identical to the reviewed checkout and no longer emits that sentence. (test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts:431, 66fa0bd2be4f)
  • Production payload contract: buildConsolidationPrompt serializes currentMemory and candidates containing text, sourceRef and provenance. consolidateMemory passes that JSON as the completion message with the explicit agentId. The patch tests these actual fields rather than restoring obsolete prompt wording. (extensions/memory-core/src/dreaming-consolidation.ts:69, c594b0c639ca)
  • Request capture preserves the user payload: The mock provider derives prompt from the last user input and records it alongside the request body. Its cursor-filtered debug endpoint therefore supports inspecting the newly dispatched JSON independently of system-prompt wording. (extensions/qa-lab/src/providers/mock-openai/server.ts:2594, c594b0c639ca)
  • Caller and completion boundary: The promotion owner supplies the selected agent, existing memory and eligible candidates to consolidation. The Gateway completion owner passes the exact message and separate system prompt into isolated completion; no production routing or authorization code changes here. (src/gateway/server-plugin-subagent-runtime.ts:289, c594b0c639ca)
  • Sibling coverage and observation ordering: The restricted-session scenario still verifies exclusion of restricted content, retention of legacy content and absent tools. The explicit-owner scenario retains recall evidence, a post-recall request cursor, successful cron completion and the owner-selection error check. Observation timeouts are unchanged. (test/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts:325, c594b0c639ca)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • xingzhou: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 61c1f4a into main Sep 4, 2026
173 checks passed
@steipete
steipete deleted the codex/frv-memory-consolidation-proof branch September 4, 2026 23:58
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant