Skip to content

fix(memory): filter assistant process chatter from dreams#111922

Open
ArthurNie wants to merge 1 commit into
openclaw:mainfrom
ArthurNie:fix/dreaming-filter-process-chatter-80664
Open

fix(memory): filter assistant process chatter from dreams#111922
ArthurNie wants to merge 1 commit into
openclaw:mainfrom
ArthurNie:fix/dreaming-filter-process-chatter-80664

Conversation

@ArthurNie

@ArthurNie ArthurNie commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Ordinary assistant scratch/process notes can currently enter memory/.dreams/session-corpus/* and feed Light/REM/Deep candidate surfaces. This creates low-value Dreaming inputs and can promote execution chatter rather than durable session content.

This PR fixes the forward-ingestion path without changing transcript, SDK, or persisted-state schemas. The matcher intentionally covers only the reported terse operational forms; broader semantic classification and historical corpus cleanup remain out of scope.

Summary

  • filter narrowly shaped assistant process chatter before Dreaming session-corpus persistence
  • require an exact Assistant: prefix and fully anchored conservative grammar
  • preserve user lookalikes, durable outcomes, source-line provenance, and ingestion cursor advancement

Evidence

Local verification on commit b1638d97cca5bcf5361f2a7584ad65ad4b4ad38a:

  • ./node_modules/.bin/oxfmt --check extensions/memory-core/src/dreaming-phases.ts extensions/memory-core/src/dreaming-phases.test.ts
  • git diff --check
  • ./node_modules/.bin/oxlint --tsconfig config/tsconfig/oxlint.extensions.json extensions/memory-core/src/dreaming-phases.ts extensions/memory-core/src/dreaming-phases.test.ts
  • ./node_modules/.bin/vitest run extensions/memory-core/src/dreaming-phases.test.ts47/47 passed
  • pnpm tsgo:extensions:test
  • independent revised-diff review: Blocking 0, Important 0, approved

The corpus regression covers rejected chatter, preserved durable assistant outcomes, user and lowercase-prefix lookalikes, original source-line references, and cursor advancement through filtered entries.

Closes #80664

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 20, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 20, 2026
@clawsweeper

clawsweeper Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 20, 2026, 1:54 PM ET / 17:54 UTC.

Summary
The PR filters narrowly matched Assistant: process-chatter lines before Dreaming persists them to the session corpus and adds regression coverage for excluded chatter, preserved durable content, provenance, and cursor advancement.

PR surface: Source +13, Tests +143. Total +156 across 2 files.

Reproducibility: yes. at source level: current main accepts normalized session lines after only the minimum-length check, and the linked report supplies concrete assistant-process examples that reach this ingestion path. I did not run a live Dreaming sweep in this read-only review.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: extensions/memory-core/src/dreaming-phases.test.ts, unknown-data-model-change: extensions/memory-core/src/dreaming-phases.test.ts, vector/embedding metadata: extensions/memory-core/src/dreaming-phases.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted terminal capture or runtime log from a controlled Dreaming sweep showing the excluded chatter and retained durable assistant content.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body reports focused unit tests, lint, type checks, and CI, but does not include inspectable after-fix output from a real Dreaming session-corpus sweep. Add redacted runtime output or a terminal capture; updating the PR body should trigger a fresh review, or a maintainer can request @clawsweeper re-review. 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.

Risk before merge

  • [P1] Before merge, the external PR needs inspectable after-fix runtime evidence showing a generated session-corpus file excludes the reported chatter while retaining a durable assistant line; the PR body currently provides tests and static checks only.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the conservative exact-prefix, fully anchored ingestion filter and add a redacted terminal capture or runtime log from a controlled Dreaming sweep that shows the corpus output and preserved durable content.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The only remaining merge gate is contributor-supplied real behavior proof; there is no mechanical code repair for ClawSweeper to perform.

Security
Cleared: The two-file TypeScript and test diff adds no dependency, credential, permission, package-resolution, workflow, or external-code-execution surface.

Review details

Best possible solution:

Keep the conservative exact-prefix, fully anchored ingestion filter and add a redacted terminal capture or runtime log from a controlled Dreaming sweep that shows the corpus output and preserved durable content.

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

Yes at source level: current main accepts normalized session lines after only the minimum-length check, and the linked report supplies concrete assistant-process examples that reach this ingestion path. I did not run a live Dreaming sweep in this read-only review.

Is this the best way to solve the issue?

Yes. A narrowly anchored filter at session-corpus ingestion is the smallest maintainable fix for the reported forward-contamination path, and the branch deliberately preserves durable assistant statements and non-exact lookalikes.

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove merge-risk: 🚨 session-state: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded memory-candidate hygiene fix with limited blast radius and no evidence of an urgent availability, security, or message-delivery failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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: The PR body reports focused unit tests, lint, type checks, and CI, but does not include inspectable after-fix output from a real Dreaming session-corpus sweep. Add redacted runtime output or a terminal capture; updating the PR body should trigger a fresh review, or a maintainer can request @clawsweeper re-review. 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

PR surface:

Source +13, Tests +143. Total +156 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 0 +13
Tests 1 143 0 +143
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 156 0 +156

What I checked:

  • Current-main gap: Current main normalizes each session-corpus line and excludes only undersized snippets before recording source provenance and appending candidates; it does not yet reject the reported assistant process-chatter forms. (extensions/memory-core/src/dreaming-phases.ts:635, ea148e728db3)
  • Patch placement: The branch adds the predicate immediately after snippet normalization and the minimum-length guard, before line provenance and candidate collection; this is the bounded forward-ingestion boundary identified in the linked report. (extensions/memory-core/src/dreaming-phases.ts:1007, b1638d97cca5)
  • Regression scope: The added test exercises rejected chatter alongside preserved durable assistant outcomes and user/lowercase-prefix lookalikes, and asserts corpus source-line and cursor behavior. (extensions/memory-core/src/dreaming-phases.test.ts:1602, b1638d97cca5)
  • Problem provenance: The linked report provides concrete observed session-corpus examples and identifies the same normalize-and-ingest hook; it remains open while this candidate fix is unmerged.
  • Feature history: Earlier memory-core review history identifies the Dreaming promotion and contamination-guard area as shared work, with vignesh07 introducing the broader Dreaming pipeline and gumadeiras contributing adjacent contamination hardening. (extensions/memory-core/src/dreaming-phases.ts, 4c1022c73b39)

Likely related people:

  • vignesh07: Prior area history attributes the Dreaming promotion pipeline and related memory-core surfaces to this contributor. (role: original feature-history owner; confidence: high; commits: 4c1022c73b39; files: extensions/memory-core/src/dreaming-phases.ts, extensions/memory-core/src/short-term-promotion.ts)
  • gumadeiras: Prior memory-core history connects this contributor to self-ingestion and contamination hardening that shares the Dreaming corpus invariant. (role: adjacent contamination-guard contributor; confidence: high; commits: 0c4e0d703023; files: extensions/memory-core/src/dreaming-phases.ts, extensions/memory-core/src/short-term-promotion.ts)
  • solomonneas: Authored the merged staged-Candidate leak hardening in the neighboring Dreaming promotion path. (role: recent adjacent contributor; confidence: medium; commits: 314903417fcc; files: extensions/memory-core/src/short-term-promotion.ts, extensions/memory-core/src/short-term-promotion.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-20T17:11:55.026Z sha b1638d9 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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.

Memory Dreaming: filter assistant process chatter from session-corpus candidates

2 participants