Repository navigation
fix(memory-wiki): avoid repeated vault work for exact page reads - #129897
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 5, 2026, 12:45 AM ET / 04:45 UTC. ClawSweeper reviewWhat this changesMemory Wiki avoids whole-vault work for warm exact page reads by sharing a rooted reader and reusing validated cache owners. Merge readiness⛔ Blocked before merge - 2 items remain No blocking findings. The repair remains useful on current main, addresses the prior size and hardlink concerns, and has relevant CLI/Gateway proof. Priority: P2 Review scores
Verification
How this fits togetherMemory Wiki turns Markdown vaults into searchable knowledge and compiled snapshots. CLI commands, Gateway requests, and agent tools use its query layer to return visible pages and requested line slices. flowchart TD
A[CLI, Gateway, or agent request] --> B[Activate or reuse vault owner]
B --> C[Check compiled claim lookup]
C --> D[Read eligible exact path]
C --> E[Discover fallback pages]
D --> F[Shared rooted page reader]
E --> F
F --> G[Apply visibility and return line slice]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +68, Tests +267, Docs +8. Total +343 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one rooted page-reading boundary, with compile and lifecycle activation owning snapshot freshness; explicit path validation and missing-candidate handling justify the bounded production growth. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main enumerates the vault before resolving an ordinary exact path, so an unrelated unreadable page can reject it. This read-only review did not execute a failing current-main run. Is this the best way to solve the issue? Yes for the reported exact-read failure: the patch repairs the plugin-owned reader and lifecycle setup while preserving shared lookup and visibility rules. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d5992278b3b8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Reviewed head ba07cb2 while selecting small, high-certainty performance fixes. The exact-path optimization targets a real full-vault scan, but I am holding this PR for two observable compatibility regressions at
I directly inspected the pinned dependency's root defaults and read implementation, and reproduced both differences with synthetic files using the published 0.5.6 package: The existing bounded walker includes both fixtures as files. This is dependency-level reproduction plus source tracing through the tool, CLI, Gateway and corpus-supplement callers; it is not an end-to-end PR run. The isolated PR test attempt stopped before dependency installation/tests because the branch's package-manager pin differs from trusted current main. Best-fix verdict: correct owner, incomplete contract alignment. Preserve a common page-reading contract across exact, claim and fuzzy lookups while retaining rooted file-descriptor validation. A new persistent cache or caller-specific bypass is unnecessary. Add coverage for the two lookup-form equivalence cases above. The latest completed ClawSweeper review's boundary-policy decision and hardlink-coverage request remain relevant. LOC: production +55/-5 (net +50), tests +67/-1 (net +66). Consolidating page-read ownership would also reduce the duplicated reader flow. No storage-schema change is required for this repair. |
Read canonical pages through the shared rooted reader while preserving compiled claim precedence, large pages, hardlinks, visibility and missing-path fallbacks. Skip deleted compiled candidates without suppressing filesystem boundary errors. Reuse reconciled cache owners during ordinary initialization and activate local source sync before checking dashboard readiness. Retain cold and explicit lifecycle source validation, vault replacement fencing and publication checks. Cover reader contracts, stale candidates, lifecycle reuse and rollback with real filesystem and SQLite regressions. Document cold CLI activation costs. Fixes openclaw#116048. Related openclaw#116374; thanks @sloptop-the-terrible for the original reproduction and direct-read direction. Co-authored-by: Brian Snyder <[email protected]>
|
The earlier size/hardlink findings are resolved in f268ee0. The shared reader preserves both contracts, retains compiled-claim precedence, handles deleted compiled candidates, and rejects filesystem boundary races. Real CLI/Gateway proof also exposed and repaired repeated lifecycle validation and unnecessary cold local recompilation; the PR body now documents the remaining cold activation cost and full evidence. All 510 Memory Wiki tests, changed-file checks, full build, independent source review and final autoreview passed. The prior rank-up requests are addressed in the PR body. Requesting a fresh review because this includes lifecycle behavior beyond the earlier review. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer resolution of the two evidence checks in the newly published review for f268ee0:
The fresh report has no code findings, no required product decision and no rank-up requests. Both rendered evidence checks are addressed; the tested head is unchanged. Named follow-up: cold bridge/unsafe-local activation. The existing imported-source writer deliberately skips preparation for unchanged imports ( |
|
Merged via squash.
|
Co-authored-by: BSnizND <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Brian Snyder <[email protected]>
Fixes #116048. Related: #116374.
What Problem This Solves
Exact canonical wiki reads previously enumerated and parsed unrelated pages. Repeated initialization also hashed the entire compiled vault, and a cold local source sync could mistake an inactive cache owner for a missing snapshot and compile again.
This change reads canonical paths through the shared rooted page reader, reuses a reconciled owner during ordinary requests, and activates local source sync before checking index readiness. Cold activation, explicit lifecycle refresh, vault replacement and compile publication retain their existing validation. A fresh CLI process still validates the compiled snapshot; this is not a constant-time cold-start guarantee.
The reader preserves compiled-claim precedence, agent visibility, files larger than 16 MiB and hardlinks. Missing or non-file candidates fall through to existing discovery, including deleted pages nominated by an older compiled snapshot. Permission failures, symlink refusals and file-identity mismatches remain terminal across exact and scanned reads. There is one shared reader rather than a weaker fallback path.
Evidence
pnpm buildpassed.The first real-flow attempt on the original query-only candidate took 86.523 s and triggered compilation; it exposed the prerequisite lifecycle work addressed here. That first-run timing is not a like-for-like benchmark against the warm Gateway timings above.
Review decisions and scope
The prior ClawSweeper rank-up requests are addressed: hardlink support is retained and tested, while rooted filesystem boundary refusals are documented and tested across readers. The pinned fs-safe 0.8.1 source was directly inspected for explicit unlimited-byte and hardlink policies. No SQLite schema, stored format, configuration option, provider or protocol changes are introduced.
Production delta: +77/-9, net +68. The growth provides canonical-path validation and the lifecycle-owner reuse check; missing-candidate handling is consolidated in the existing reader. Tests: +301/-34, net +267; a redundant mocked no-op case is replaced by real SQLite lifecycle coverage. Docs: +9/-1. Release-note context is retained here; no changelog edit is needed before release generation.
Thanks to @BsnizND (Brian Snyder) for this PR and @sloptop-the-terrible for the original reproduction and direct-read direction in #116374. The contributor's original commit remains in this branch's ancestry.