Repository navigation
fix(memory-wiki): prevent source ingest content loss during concurrent vault writes - #104209
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 8:40 PM ET / July 18, 2026, 00:40 UTC. Summary PR surface: Source +15, Tests +63. Total +78 across 2 files. Reproducibility: yes. in source: the added test constructs a held same-vault mutation and concurrent ingest with a deterministic queue-boundary observation, although this review did not run it on the current head. 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:
Next step before merge
Security Review detailsBest possible solution: Retain the coordinator-based implementation, add redacted after-fix runtime evidence that concurrently performs source ingest and a competing same-vault mutation, then complete exact-head maintainer review. Do we have a high-confidence way to reproduce the issue? Yes, in source: the added test constructs a held same-vault mutation and concurrent ingest with a deterministic queue-boundary observation, although this review did not run it on the current head. Is this the best way to solve the issue? Yes: reusing the existing reentrant per-vault coordinator is the narrowest maintainable fix because ingest performs the same vault read-modify-write-plus-compile sequence as the already serialized mutators. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b130f96c6f37. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +15, Tests +63. Total +78 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
Review history (2 earlier review cycles)
|
f0c411e to
cc9f13c
Compare
cc9f13c to
1d9a6ec
Compare
1d9a6ec to
da416bf
Compare
|
Maintainer pass complete for head
Ready for prepare and merge. |
|
Merged via squash.
|
…t vault writes (openclaw#104209) * fix(memory-wiki): serialize source ingest with vault mutations * test(memory-wiki): make ingest lock proof deterministic * test(memory-wiki): type queue spy receiver * test(memory-wiki): keep queue spy lint-safe * style(memory-wiki): format ingest lock proof --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #103408
What Problem This Solves
Memory Wiki source ingest read, merged, and rewrote a source page outside the established per-vault mutation transaction. A concurrent locked mutation could therefore write stale page state after ingest, silently discarding content even though ingest reported success.
Why This Change Was Made
ingestMemoryWikiSourcenow uses the same reentrantwithMemoryWikiVaultMutationboundary as apply, compile, and source sync. The lock covers vault initialization, existence/read decisions, page write, log append, and compile. Nested compile re-enters the same-vault lease; unrelated vaults remain parallel.Maintainer follow-up replaced the original 50 ms timing assertion with deterministic queue-boundary proof. The test observes the real
KeyedAsyncQueue.enqueuecall: fixed code reaches the outer ingest queue before filesystem work, while unfixed code first reaches the queue from nested compile after the page write, making the same page-absence assertion fail deterministically.User Impact
Concurrent same-process source ingest and Memory Wiki mutations no longer lose ingested content through stale write-back. Single-caller behavior and public APIs remain unchanged.
Evidence
node scripts/run-vitest.mjs extensions/memory-wiki/src/ingest.test.ts extensions/memory-wiki/src/mutation-coordinator.test.ts extensions/memory-wiki/src/source-sync.test.ts— 3 files, 18 tests passed.node scripts/check-changed.mjs -- extensions/memory-wiki/src/ingest.ts extensions/memory-wiki/src/ingest.test.ts— delegated extension/test typechecks, lint, formatting, boundaries, and guards passed on Testboxtbx_01kxs9d6x4f62xbtgdbfkpsyty: https://github.com/openclaw/openclaw/actions/runs/29622791656.agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output— clean after each maintainer edit; final confidence 0.99.git diff --check— passed.