Skip to content

Fix memory-wiki bridge self-import loop - #95666

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
TurboTheTurtle:fix-95657-memory-wiki-self-import
Jun 23, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
TurboTheTurtle:fix-95657-memory-wiki-self-import

Conversation

@TurboTheTurtle

@TurboTheTurtle TurboTheTurtle commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #95657.

What Problem This Solves

Bridge mode could re-import memory artifacts whose files were already generated under the configured wiki vault sources/ directory when that vault lived under workspace memory/, producing recursive memory/wiki/sources/... bridge pages.

Why This Change Was Made

The importer now canonicalizes the vault sources/ path and skips matching public artifacts before they are rendered as bridge source pages.

User Impact

Users with bridge vaults inside their memory workspace stop generating recursive bridge copies of generated wiki source artifacts.

Evidence

Added a regression covering a vault at memory/wiki with one normal daily note and one already-generated sources/ artifact; only the daily note is imported from that setup and no recursive memory-wiki-sources bridge file is generated.

Focused bridge test passes locally: node scripts/run-vitest.mjs extensions/memory-wiki/src/bridge.test.ts.

Real bridge-import proof against a temp workspace using the production bridge import path and real memory-host public artifact scanner:

vaultPath=<temp>/workspace/memory/wiki
memoryHostBeforeImport=["memory/2026-06-22.md","memory/wiki/sources/bridge-existing-source.md"]
bridgeImportPagePaths=["sources/bridge-workspace-7fd41200-memory-2026-06-22-073f422a.md","sources/bridge-workspace-7fd41200-memory-wiki-agents-e717f7f0.md","sources/bridge-workspace-7fd41200-memory-wiki-inbox-2b5fb926.md","sources/bridge-workspace-7fd41200-memory-wiki-index-87766ade.md","sources/bridge-workspace-7fd41200-memory-wiki-wiki-320ad4f7.md"]
recursivePages=[]

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-wiki size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 22, 2026
@clawsweeper

clawsweeper Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 22, 2026, 2:48 AM ET / 06:48 UTC.

Summary
The branch passes the configured memory-wiki vault path into bridge artifact collection, skips public artifacts whose canonical path is inside that vault's sources/ directory, and adds a regression test for a vault nested under memory/wiki.

PR surface: Source +17, Tests +62. Total +79 across 2 files.

Reproducibility: yes. from source inspection: current main recursively lists Markdown under workspace/memory and bridge import consumes that artifact list without excluding the configured vault sources directory. I did not execute the repro because this review is read-only.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: extensions/memory-wiki/src/bridge.test.ts, unknown-data-model-change: extensions/memory-wiki/src/bridge.test.ts, vector/embedding metadata: extensions/memory-wiki/src/bridge.test.ts, vector/embedding metadata: extensions/memory-wiki/src/bridge.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #95657
Summary: This PR is one of several open candidate fixes for the canonical memory-wiki bridge self-import loop report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • [P2] Decide whether this bridge-side filter or the scanner-side vault-subtree exclusion should be the canonical fix for the linked bug.

Risk before merge

  • [P1] This branch prevents recursive bridge source pages but leaves current memory scanning able to index memory/wiki/sources, so maintainers should decide whether that residual scanner behavior is acceptable or whether the scanner-side candidate is the canonical fix.
  • [P1] Two other open PRs target the same linked bug; merging this one should be paired with closing or superseding the duplicate candidates and preserving any remaining scanner follow-up.

Maintainer options:

  1. Decide the mitigation before merge
    Land one canonical fix that prevents generated wiki source pages from feeding back into memory and bridge import, decide whether scanner-side exclusion is also required for residual index bloat, then close the duplicate candidate PRs and linked bug.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] Maintainers need to choose the canonical fix among this bridge-side mitigation and the broader scanner-side candidate; there is no narrow automated repair blocker in this branch.

Security
Cleared: The diff only changes memory-wiki TypeScript bridge filtering and a colocated test; it does not touch dependencies, workflows, secrets, downloads, or package execution surfaces.

Review details

Best possible solution:

Land one canonical fix that prevents generated wiki source pages from feeding back into memory and bridge import, decide whether scanner-side exclusion is also required for residual index bloat, then close the duplicate candidate PRs and linked bug.

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

Yes from source inspection: current main recursively lists Markdown under workspace/memory and bridge import consumes that artifact list without excluding the configured vault sources directory. I did not execute the repro because this review is read-only.

Is this the best way to solve the issue?

Unclear as the final best fix: this PR is a clean bridge-side mitigation for recursive page generation, while #95670 addresses scanner-side indexing earlier. Maintainers should choose the canonical direction before merging.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded bundled-plugin bugfix for reported recursive memory-wiki source growth and memory index bloat with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes terminal-style after-fix output from a temp workspace using the production bridge import path and real memory-host public artifact scanner, with recursivePages=[].
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal-style after-fix output from a temp workspace using the production bridge import path and real memory-host public artifact scanner, with recursivePages=[].
Evidence reviewed

PR surface:

Source +17, Tests +62. Total +79 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 18 1 +17
Tests 1 62 0 +62
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 80 1 +79

What I checked:

  • Current main bridge imports all public artifacts: Current main calls listActiveMemoryPublicArtifacts and passes the full result into collectBridgeArtifacts without excluding the configured vault sources/ subtree. (extensions/memory-wiki/src/bridge.ts:227, 04994f1046e6)
  • Current main memory scan recurses under workspace memory: The memory host helper recursively walks workspace/memory and emits every Markdown file as a public artifact, so a vault under memory/wiki/sources can become bridge input. (src/plugin-sdk/memory-host-core.ts:22, 04994f1046e6)
  • PR head filters canonical vault source paths: The PR resolves the vault sources path and each artifact path through resolveArtifactKey, then skips candidates inside or equal to the vault source path before bridge page rendering. (extensions/memory-wiki/src/bridge.ts:71, 9358ecf46cdb)
  • PR head wires the vault path into collection: The bridge sync path now passes params.config.vault.path into artifact collection, keeping the filter at the importer boundary that writes bridge source pages. (extensions/memory-wiki/src/bridge.ts:243, 9358ecf46cdb)
  • PR head adds focused regression coverage: The added test places the vault at workspace/memory/wiki, registers one normal daily note and one generated sources artifact, and asserts only the daily note imports with no memory-wiki-sources recursive page. (extensions/memory-wiki/src/bridge.test.ts:153, 9358ecf46cdb)
  • Latest release still has the unfiltered bridge path: Release v2026.6.9 still passes all public artifacts into bridge collection, matching the linked shipped-version report. (extensions/memory-wiki/src/bridge.ts:227, c645ec4555c0)

Likely related people:

  • Vincent Koc: Git history shows the memory-wiki bridge sync and memory host bridge/event surfaces were introduced and restored through his commits touching the central runtime paths. (role: feature-history owner; confidence: medium; commits: fbbe2a167504, d1c7d9af800d, 5716d83336fd; files: extensions/memory-wiki/src/bridge.ts, src/plugin-sdk/memory-host-core.ts)
  • Peter Steinberger: Git history shows recent refactors of the shared source path and imported source-page helpers used by this bridge import path. (role: adjacent refactor owner; confidence: medium; commits: f5bb8cbb98aa, efd9aaea3f3e; files: extensions/memory-wiki/src/source-path-shared.ts, extensions/memory-wiki/src/source-page-shared.ts, extensions/memory-wiki/src/bridge.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.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 22, 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. labels Jun 22, 2026
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 22, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@TurboTheTurtle
TurboTheTurtle force-pushed the fix-95657-memory-wiki-self-import branch from 0277e3b to 10a44ea Compare June 22, 2026 04:56
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 22, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 22, 2026
@TurboTheTurtle
TurboTheTurtle force-pushed the fix-95657-memory-wiki-self-import branch from 10a44ea to 9358ecf Compare June 22, 2026 05:34
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 22, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jun 22, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 automerge status

No new branch changes from this pass. ClawSweeper left the branch untouched instead of making a noisy edit.

Executor outcome: no planned fix actions.
Worker summary: this PR was already merged and closed in the hydrated preflight state, with maintainer merge proof and passing post-repair checks. Current main at 603b250 contains the bridge-side fix and regression test, so no repair PR or merge action is needed for this automerge job. The remaining open PRs are classified non-mutating because close and merge are blocked for this job.

Worker actions:

  • keep_closed on this PR: skipped - The canonical PR is already merged and closed; no close or merge mutation is valid from this worker.
  • keep_closed on #95657: skipped - Already closed; closed refs must not receive close actions.
  • keep_related on #95663: planned - Same bridge-side fix family as the landed canonical PR, but close is blocked by job policy and must be handled separately if desired.
  • keep_related on #95670: planned - Related follow-up scanner/indexer work remains separate from the this PR automerge cluster and has an unresolved bot review blocker, so it should stay open for its own review path.

Nothing moved downstream from this pass: no branch update, replacement PR, merge, or re-review.

fish notes: reasoning high; reviewed against 0f74629.

Automerge progress:

  • 2026-06-22 13:44:08 UTC review queued 9358ecf46cdb (queued)
  • 2026-06-22 19:04:13 UTC review queued 9358ecf46cdb (queued)
  • 2026-06-22 22:13:41 UTC review queued 9358ecf46cdb (queued)

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Jun 22, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Jun 22, 2026
@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [P2] Maintainers need to choose the canonical fix among this bridge-side mitigation and the broader scanner-side candidate; there is no narrow automated repair blocker in this branch.; Cleared: The diff only changes memory-wiki TypeScript bridge filtering and a colocated test; it does not touch dependencies, workflows, secrets, downloads, or package execution surfaces. (sha=9358ecf46cdb3bcd24b0b864b24daa7e25425c13)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper approve this is the canonical fix

@clawsweeper

clawsweeper Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: approve this is the canonical fix

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: Yes, from the supplied context this PR is the stronger canonical bridge-side fix for #95657, but it still leaves a maintainer policy choice versus the broader scanner-side PR #95670.

Evidence:

  • Fix memory-wiki bridge self-import loop #95666 changes only extensions/memory-wiki/src/bridge.ts and extensions/memory-wiki/src/bridge.test.ts.
  • The implementation canonicalizes vaultRoot/sources and skips artifacts whose resolved path is inside that directory.
  • The regression covers a vault at memory/wiki and verifies the generated sources/ artifact is skipped while the real daily note imports.
  • PR body includes focused test proof plus real bridge-import proof showing recursivePages=[].
  • Prior ClawSweeper review at SHA 9358ecf46cdb3bcd24b0b864b24daa7e25425c13 found no narrow repair blocker, but called out the canonical-fix decision against fix(memory): skip memory-wiki vault subtree in workspace memory scan (#95657) #95670.

Suggested next action: If you want a full correctness review before deciding, use @clawsweeper review; otherwise treat this as the canonical bridge-import mitigation and separately decide whether the scanner behavior from #95670 is needed as follow-up.


Source: #95666 (comment)
Assist reasoning: low.

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper approve

@clawsweeper clawsweeper Bot removed the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Jun 22, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@vincentkoc
vincentkoc force-pushed the fix-95657-memory-wiki-self-import branch from 9358ecf to 0f74629 Compare June 23, 2026 04:10
@vincentkoc
vincentkoc merged commit 33b2321 into openclaw:main Jun 23, 2026
84 of 85 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

Thanks @TurboTheTurtle!

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

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge extensions: memory-wiki P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

[Bug]: memory-wiki bridge mode creates recursive self-import loop — wiki sources indexed by memory indexer and re-imported as bridge artifacts

3 participants