fix(memory-wiki): preserve pages when source paths are unavailable#111034
Conversation
Preserve imported unsafe-local wiki pages and human annotations while configured source scopes are temporarily unreadable.
|
Land-ready proof for head
Behavior proof covers both sides of the invariant: unavailable configured scopes retain imported pages and human notes, while missing files in readable sibling scopes are still pruned. |
|
Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 7:36 PM ET / 23:36 UTC. Summary PR surface: Source +30, Tests +64. Total +94 across 2 files. Reproducibility: yes. from source inspection: current main converts failed Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge a scoped-unavailability repair after maintainers confirm the retention boundary and the contributor adds a redacted terminal or live-runtime transcript demonstrating both preservation during an outage and pruning after a reachable deletion. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main converts failed Is this the best way to solve the issue? Yes. Retaining only entries belonging to unavailable configured scopes is narrower than globally skipping pruning, because it preserves outage-affected pages while retaining cleanup for files missing from reachable scopes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4362e1a4fe39. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +30, Tests +64. Total +94 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Merged via squash.
|
Preserve imported unsafe-local wiki pages and human annotations while configured source scopes are temporarily unreadable.
Closes #97523
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users importing private files with Memory Wiki's unsafe-local mode could lose imported pages and their human annotations when a configured directory or mount was temporarily unavailable during sync.
Why This Change Was Made
The sync now treats each configured source path as its own authoritative scope. Files missing from a readable directory are still pruned, while entries belonging to an unreadable scope are retained until that scope becomes readable again or is removed from configuration. Capacity accounting uses the union of newly collected and retained keys so overlapping configured paths cannot be double-counted.
User Impact
Temporary mount, permission, or filesystem outages no longer delete Memory Wiki pages or human notes. Genuine deletions inside reachable configured directories continue to be reflected on the next sync.
Evidence
OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs extensions/memory-wiki/src/unsafe-local.test.ts extensions/memory-wiki/src/source-sync-state.test.ts extensions/memory-wiki/src/source-page-shared.test.ts— 3 files passed, 15 tests passed.OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/check-changed.mjs -- extensions/memory-wiki/src/unsafe-local.ts extensions/memory-wiki/src/unsafe-local.test.ts— Testbox exit 0; extension production/test typechecks, formatting, lint, boundary, dependency, database-first, and import-cycle gates passed: https://github.com/openclaw/openclaw/actions/runs/29665173619