Repository navigation
fix(oc-path): descend into JSONL line values when ** spans the line slot - #189960
Conversation
…d spans the line slot
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR separates JSONL physical-line addresses from nested keys when packing recursive search results. Example: session.jsonl contains {"id":"x"} on line 1 and {"nest":{"deep":{"event":"y"}}} on line 2.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it fixes a current JSONL search defect with a focused repair and convincing CLI evidence; no actionable findings remain, and CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe optional bundled oc-path plugin parses CLI search patterns, walks file ASTs, packs concrete addresses, and validates them through the existing resolver before returning matches. flowchart TD
A[CLI search pattern] --> B[Parsed path and file AST]
B --> C[Recursive finder]
C --> D[JSONL address packing]
D --> E[Existing resolver validation]
E --> F[Concrete paths and values]
Technical reviewBest possible solution: Land the focused address-packing repair once the existing checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the invalid section-packing path, and supplied paired CLI output demonstrates the same failure on frozen main and success on the exact candidate; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete repair: normalize JSONL output at the existing packing boundary while preserving resolver validation, capacity limits, and other formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ac227c0bdccc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +16, Tests 0, Docs +2. Total +18 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 31, 2026, 10:49 PM ET / November 1, 2026, 02:49 UTC (Revision 3). |
|
Added captured before/after CLI output (nested @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Independent shipped CLI proofExact candidate Existing documented syntax: docs/cli/path.md defines ** as zero-or-more recursive subsegments and JSONL line addresses followed by descent inside line values. No new syntax. Fixture: {"id":"x"}
{"nest":{"deep":{"event":"y"}}}Captured commands and raw CLI stdout (only synthetic paths/data): base1base2candidate1candidate2All candidate returned addresses are independently resolved through the real CLI (including every bare-** result). Every run also checks the non-recursive JSONL address, JSON **, YAML **, and a depth32 size-bounded JSONL case. The controls return the same y; main misses both nested JSONL cases, candidate finds and resolves both. Files remain byte-identical. Regression fixture red on main:2 intended failures/88passes (newly valid physical-line traversal ordering and the single-globstar nested match). Candidate finder plus YAML suites:130passed/2files, including existing expansion-budget and deep-path checks. Targeted lint/format pass. Consolidated into existing test table and removed redundant round-trip coverage; tests+3/-3(net0), production+17/-1, docs+2. The helper returns the original run array when no repair is needed, avoiding no-op copies. Host/container source SHA256 match: find.ts1872076017ad6a15a193f621d9311b7973a61049a3cefeb04b9ee3a04d009402; jsonl/line.ts ff251ab45a34798458acc3e1cbddd327b600d88bddafc581dcf5fe3f03a0f8d0. Contributor commits, including the latest test cleanup5597f11bf23c, are preserved. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 0f4e9ca. Thanks @jerome-queck. Recursive ** paths now find nested JSONL records. |
…lot (openclaw#189960) fix(cli): make recursive `**` paths find nested JSONL records In JSONL files, the documented recursive `**` path segment didn't descend into each record. `**/event` found nothing (count 0, exit 1), and a bare `**` returned only the top-level entries. Recursive paths now walk into each JSONL record as they do for JSON and YAML. There is no new syntax, and the existing depth bound still applies. Evidence: built Linux Node 24.22.1 CLI. On main, nested JSONL `**/event` returned 0 results and bare `**` returned 3 of 7 (twice); with this change it found the nested match and all 7 results (twice), and every returned address resolved through the real CLI. Non-recursive JSONL, JSON and YAML recursion, and a depth-32 bounded case behaved the same on both refs, and files were unchanged. Details: openclaw#189960 (comment). Thanks @jerome-queck. Co-authored-by: scout <scout@local> Co-authored-by: Ayaan Zaidi <[email protected]>
…lot (openclaw#189960) fix(cli): make recursive `**` paths find nested JSONL records In JSONL files, the documented recursive `**` path segment didn't descend into each record. `**/event` found nothing (count 0, exit 1), and a bare `**` returned only the top-level entries. Recursive paths now walk into each JSONL record as they do for JSON and YAML. There is no new syntax, and the existing depth bound still applies. Evidence: built Linux Node 24.22.1 CLI. On main, nested JSONL `**/event` returned 0 results and bare `**` returned 3 of 7 (twice); with this change it found the nested match and all 7 results (twice), and every returned address resolved through the real CLI. Non-recursive JSONL, JSON and YAML recursion, and a depth-32 bounded case behaved the same on both refs, and files were unchanged. Details: openclaw#189960 (comment). Thanks @jerome-queck. Co-authored-by: scout <scout@local> Co-authored-by: Ayaan Zaidi <[email protected]> Release adaptation: Retain existing physical Ldigits line selector, move recursive-consumed value keys into value slots; no new syntax or persistence behavior. Later Markdown union/frontmatter fixes independent. (cherry picked from commit 0f4e9ca) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 87eeb5077e7d4840bd16cc4619e762564065920c) (cherry picked from commit e6c654bda4095d463168b4040614551c8396576b)
Fixes #189957
What Problem This Solves
openclaw path find 'oc://session.jsonl/**/event'misses values nested inside a JSONL record, even though an explicit line selector followed by recursive descent finds them. Bare**also omits nested values.User Impact
Recursive JSONL searches now return the matching nested values with valid, reusable physical-line addresses. Existing non-recursive searches and JSON/YAML recursion are unchanged.
Why This Change Was Made
The existing recursive walker consumes both the line address and JSON keys, but its slot packer groups them into a section such as
L2.nest.deep. JSONL resolution requires the section to contain only the line address, so the final resolver drops the match.Repair that producer: keep the line selector in the section and move consumed keys into the available value slots, preserving existing slot/depth limits and resolver validation. The format-local helper avoids copying on unchanged paths. No new syntax, setting, public API or fallback. Existing docs already define zero-or-more recursive
**and JSONL descent inside each line.@jerome-queck's commits, including the latest regression cleanup, are preserved. Regression coverage is consolidated into an existing table; its helper already round-trips every result. Whole-change delta: production+17/-1, tests+3/-3(net0), docs+2; no allocation increase.
Evidence
Independent canonical runtime builds in secretless Linux Docker/Node24.22.1; real shipped CLI, enabled built plugin and isolated profile/config/state/workspaces. Twice on frozen main, nested
**/eventreturns count0/exit1 and bare**returns only3 roots/line nodes. Twice on candidate, the nested match returns count1/exit0 and bare recursion returns all7 results. Every candidate address resolves through the real CLI. Non-recursive JSONL, JSON/YAML recursive controls and a size-bounded depth32 case pass; files remain unchanged.Committed finder regression:2 intended failures/88passes on main; candidate finder/YAML suites130passed/2files, including expansion-budget and deep-path cases. Targeted lint/format pass. Captured raw CLI output and exact source hashes.
Merge Danger
Two-way door: reverting restores missing recursive JSONL results; no persisted-state migration or write behavior change. Blast radius is JSONL recursive find output and its document-preorder enumeration. Newly valid results can appear earlier than previously discarded traversal routes. Non-recursive selection, physical-line identity, existing capacity checks and JSON/YAML behavior remain intact.