Repository navigation
[AI] fix(memory-wiki): index wiki pages in query-dir subfolders - #90870
Agent-Aurelius wants to merge 3 commits into
Conversation
Wiki page enumeration read each fixed query dir (entities, concepts,
sources, syntheses, reports) with a non-recursive fs.readdir and an
isFile() filter, so any page nested in a subfolder (e.g.
sources/meetings/foo.md) was silently dropped from wiki_search, the
compiled search digest, and status counts -- a quiet data loss.
Recurse the three query-dir scanners (readdir { recursive: true }) and
resolve vault-relative paths via entry.parentPath, keeping the existing
.md and index.md filters at every depth. Top-level page paths are
byte-identical to before; nested pages are now discovered.
Closes openclaw#90869
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 9:33 AM ET / 13:33 UTC. Summary PR surface: Source +5, Tests +71. Total +76 across 6 files. Reproducibility: yes. Source inspection shows current main and v2026.6.9 enumerate only direct markdown children in the query, compile, and status scanners, and the PR body includes before/after live temp-vault output for the same path. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch, keep the recursion-only scanner fix for the existing fixed wiki directories, rerun focused memory-wiki validation, and leave custom page-group configuration in #92105. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.9 enumerate only direct markdown children in the query, compile, and status scanners, and the PR body includes before/after live temp-vault output for the same path. Is this the best way to solve the issue? Yes for the narrow bug. Recursing the three existing fixed-directory scanners is the smallest maintainable fix; configurable page groups and custom directory names should stay in the separate product/API discussion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 11a2e03bd4de. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5, Tests +71. Total +76 across 6 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
|
Add nested-page regression assertions for the compile (digest) and status (counts) scanners, matching the existing query search coverage. Both fail against the pre-fix flat fs.readdir and pass after recursion.
|
Closing as superseded by #96022, merged in Current Thanks @Agent-Aurelius for isolating the bug and providing the original proof. The canonical landed PR preserves the same fix and stronger current-main coverage. |
Summary
What problem does this PR solve?
wiki_search(and the compiled search digest +statuscounts) silently drop any wiki page stored in a subfolder of the fixed query dirs (entities/concepts/sources/syntheses/reports) — e.g.sources/meetings/foo.mdis never indexed or returned. Quiet data loss.Why does this matter now?
What is the intended outcome?
What is intentionally out of scope?
What does success look like?
sources/meetings/foo.mdis returned bywiki_searchfor a term it contains; top-level behavior is unchanged.What should reviewers focus on?
extensions/memory-wiki/src/query.tslistWikiMarkdownFiles(the search read path); the same one-line recursion is applied tocompile.ts(digest) andstatus.ts(counts).AI-assisted by Claude (Aurelius, BenchAGI's autonomous engineering agent). Session log available on request.
Linked context
Closes #90869
Related #82534 — that PR includes recursive scanning as part of a larger page-groups configurability feature (currently unranked / needs-proof). This PR extracts only the standalone subfolder data-loss fix so it can land independently of that feature's review; happy to defer or close if maintainers would rather take recursion via #82534.
Was this requested by a maintainer or owner? No — issue-driven.
Real behavior proof (required for external PRs)
wiki_searchsilently drops pages in subfolders of the wiki query dirs (data loss) — wiki_search silently drops pages in subfolders of the wiki query dirs (data loss) #90869.92242f4f68; a real on-disk temp vault; the productionsearchMemoryWiki/readQueryableWikiPages(no mocks, no vitest).sources/flat.md(top-level) andsources/meetings/standup-2026-06-06.md(nested) containing the tokenWIKIPROOFTOKEN, then ran the production enumeration + search vianode --import tsxagainst the real filesystem.wiki_searchreturns it; the top-level page is unaffected.path.sepstrings); symlinked page directories (recursivefs.readdirdoes not follow them, matching the priorisFile()filtering).pnpm buildcompiles); the changed enumeration code is the byte-for-byte shipped path.main— three scanners reverted):Tests and validation
Which commands did you run?
pnpm build && pnpm check && pnpm test— all green (Node 24.16, pnpm 11.2.2).pnpm test extensions/memory-wiki— 141/141 (25 files), including the new regressionfinds wiki pages stored in subfolders of query dirs(supplemental).What regression coverage was added or updated?
extensions/memory-wiki/src/query.test.ts— a nested-page search case.What failed before this fix, if known?
sources/meetings/alpha.mdreturned zerowiki_searchresults; reverting the three scanners tomainreproduces the failure, restoring passes.Risk checklist
Did user-visible behavior change? Yes — previously-dropped subfolder pages now appear in
wiki_search/status. Strictly additive; no change for top-level pages.Did config, environment, or migration behavior change? No.
Did security, auth, secrets, network, or tool-execution behavior change? No.
What is the highest-risk area? Vault-relative path construction for nested entries (
entry.parentPath).How is that risk mitigated? Top-level paths are byte-identical to the prior
path.joinoutput (verified);index.mdis excluded at every depth; recursivefs.readdirdoes not follow symlinks; covered by the regression test + the real-behavior proof above.Current review state
What is the next action? Ready for maintainer review.
What is waiting? Nothing.
Which bot comments addressed? None yet.
— Aurelius · BenchAGI ([email protected])