Repository navigation
fix(oc-path): find rejects quoted filenames containing question marks - #193123
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesAllow path find to search quoted filenames containing literal question marks while preserving file-slot asterisk refusal. Example: Run path find on oc://"report?.jsonc"/items/*/name with two named values.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete bug still present on current main, with sufficient exact-head CLI evidence and no actionable findings; CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe bundled oc-path plugin registers the path CLI, parses oc:// addresses, reads a selected workspace file, and emits matching addresses and values. flowchart LR
A[Path CLI input] --> B[Address parser]
B --> C[File wildcard guard]
C --> D[Bounded file loader]
D --> E[Document matcher]
E --> F[Formatted paths and values]
Technical reviewBest possible solution: Merge the focused guard correction after the existing exact-head CI gates pass. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically rejects parsed literal-question-mark filenames, corroborated by the supplied baseline CLI results; no target code was executed during this review. Is this the best way to solve the issue? The smallest complete fix is to let the existing parser own query separation and remove only the CLI's erroneous question-mark rejection while retaining asterisk refusal. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2bae4959242e. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests -5, Docs +1. Total -3 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 HistoryReview history (1 earlier review cycle)
Reviewed November 4, 2026, 10:10 PM ET / November 5, 2026, 03:10 UTC (Revision 2). |
Exact-head Linux CLI proof: literal
|
| Observed command | Main | Exact candidate |
|---|---|---|
resolve a concrete path in report?.jsonc |
first; exit 0 | first; exit 0 |
find two values in report?.jsonc |
refused, OC_PATH_FILE_WILDCARD_UNSUPPORTED, exit 2 |
first + second, count 2, exit 0 |
find in nested?/batch?.jsonc |
same incorrect refusal, exit 2 | nested-first + nested-second, count 2, exit 0 |
| Resolve each returned quoted path | ordinary-file control works | all returned paths work with identical match data |
?session=literal-proof suffix |
preserved on ordinary returned paths; literal-file resolve works | preserved on every returned path and round-trip |
| Ordinary-file find | two expected values; exit 0 | unchanged |
File-slot *.jsonc wildcard |
refused, exit 2; explicit unsupported-wildcard code, not ENOENT | unchanged |
Representative actual commands (run from the isolated fixture directory):
node /base/openclaw.mjs --profile p193123base path find 'oc://"report?.jsonc"/items/*/name?session=literal-proof' --json
node /base/openclaw.mjs --profile p193123base path resolve 'oc://"report?.jsonc"/items/one/name?session=literal-proof' --json
node /candidate/openclaw.mjs --profile p193123candidate path find 'oc://"report?.jsonc"/items/*/name?session=literal-proof' --json
node /candidate/openclaw.mjs --profile p193123candidate path resolve 'oc://"report?.jsonc"/items/two/name?session=literal-proof' --json
node /candidate/openclaw.mjs --profile p193123candidate path find 'oc://*.jsonc/items/*/name?session=literal-proof' --jsonByte-fidelity control
All three files were SHA-256 hashed before and after every command: 9 baseline calls and 13 candidate calls. Every hash equals its original value on both builds:
report?.jsonc d3fcc31d5e0d745d09c8c165b235885cc8380ad8ba437303cc4db5761e2ef229
nested?/batch?.jsonc 3d238b5a9bf52ccc77daeffb94544d537534b02b1dc541c960011e5816d6c468
ordinary.jsonc 987a9f8ea793287afd7eb2f784011c0c6e0bf9292656183bfd3f5a608cb80937
Existing-suite consolidation and checks
- Removed the standalone 47-line test file and its allocation. No new test/import suite, helper entrypoint, scalar baseline or lint exception.
- The POSIX literal-filename case now runs in the existing CLI find/resolve matrix, with explicit query-suffix, exit-code, match and unchanged-byte assertions. The old no-match case is preserved as a matrix row across all file variants; wildcard refusal stays in its existing case.
- Whole-PR test delta +21/−26 = −5. Compact equivalent outcome assertions keep the existing file within its unchanged 1,000-code-line lint cap.
- The committed
report?.jsoncmatrix case fails on main for the intended reason: observed[exit, count]is[2, undefined], expected[0, 2]. - 76/76 existing-suite tests pass on the candidate. Repository lint passes for the two changed TypeScript files; formatting passes for those files and the documentation.
- Production remains +3/−2, five changed lines: only the post-parse file-slot check and explanatory comments. Parser/query behavior, file resolution, input limits, public SDK and permissions are unchanged;
*is still rejected.
Literal ? filenames are not a Windows claim: this run is Linux, and the unit matrix keeps the existing non-Windows applicability boundary. No model/provider/channel or real credentials are used.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in d189a55. Thanks @zhangguiping-xydt. path find now accepts quoted filenames that contain ?. |
…openclaw#193123) fix(path): allow quoted literal ? filenames in path find `openclaw path find` refused a quoted literal filename containing `?`, even though `path resolve` opens the same file. The parser already separates the query from the filename; the later guard wrongly treated `?` as a wildcard. Now only `*` is refused. Path resolution, other guards, query handling and the SDK are unchanged. Evidence: built Linux CLI on Node 24.22.1. Main refused quoted `?` filenames; with this change find returns both expected values, and every returned path resolves correctly. Ordinary files are unchanged, `*` is still refused, and file hashes are unchanged after every command. Details: openclaw#193123 (comment). Thanks @zhangguiping-xydt. Co-authored-by: Ayaan Zaidi <[email protected]>
Raise the shared scalar by exactly 93 lines, from 6326473 to 6326566, under explicit maintainer approval for this baseline exception. Do not change tests, allocations, or checker policy. Main crossed the ceiling at #193101 (+83 against 32 available). Subsequent net debt: #193100 -2, #187104 +17 beyond its allocation, #128175 +25, #193123 -5, #188344 +8, and #193162 -1. The resulting inherited debt is exactly 93 lines; #192587 adds 73 lines with its own matching grant. At parent 2270152 the canonical LF scanner measured 6479093 test lines against ceiling 6479000. After correction the ceiling equals 6479093 with zero slack. Per-change allocations remain bounded by actual added lines.
Raise the shared scalar by exactly 93 lines, from 6326473 to 6326566, under explicit maintainer approval for this baseline exception. Do not change tests, allocations, or checker policy. Main crossed the ceiling at openclaw#193101 (+83 against 32 available). Subsequent net debt: openclaw#193100 -2, openclaw#187104 +17 beyond its allocation, openclaw#128175 +25, openclaw#193123 -5, openclaw#188344 +8, and openclaw#193162 -1. The resulting inherited debt is exactly 93 lines; openclaw#192587 adds 73 lines with its own matching grant. At parent 21ac250 the canonical LF scanner measured 6479093 test lines against ceiling 6479000. After correction the ceiling equals 6479093 with zero slack. Per-change allocations remain bounded by actual added lines.
What Problem This Solves
openclaw path resolvecan read a quoted literal filename such asreport?.jsonc, butpath findrejects the same parsed filename as a wildcard and exits 2. The parser has already separated the query string; a remaining?inpattern.fileis literal filename data.Change and user impact
Keep the existing post-parse file-slot
*refusal, but stop misclassifying literal?as a wildcard. No parser/query grammar, filesystem resolution, input ceiling, public API, SDK, config or permission change. The CLI guide adds one quoted-filename example.Both zhangguiping-xydt contributor commits are preserved. Production remains +3/−2, five changed lines including explanatory comments.
Regression consolidation
Removed the standalone 47-line regression file and its allocation. The literal-filename case is now part of the existing CLI find/resolve matrix, sharing its already-loaded Commander harness and fixtures. It checks two values, query-suffix preservation, successful resolve round-trips and unchanged source bytes. The no-match case is retained as a matrix row across the file variants, and the existing
*refusal case remains.Whole-PR tests are +21/−26, net −5, with no added test file, import suite, allocation, baseline increase or lint exception. Equivalent related outcome assertions are grouped to keep the existing suite within its unchanged line cap. The literal
?file case retains its non-Windows applicability boundary.Evidence
New exact-head Linux proof: frozen installs and full builds of main f642824 and candidate 1bd6f8f, run through the actual public
openclaw.mjs --profile … path find/path resolveCLI in secretless Linux/arm64 Docker, Node 24.22.1.report?.jsonc: main resolve works, but find refuses withOC_PATH_FILE_WILDCARD_UNSUPPORTED/ exit 2. Candidate find returns first and second, count 2, exit 0.nested?/batch?.jsonc: same baseline refusal; candidate returns both distinct expected values.?session=literal-proofand resolves back to identical match data.*.jsoncwildcard still returns the explicit refusal and exit 2, not an ENOENT failure.The committed existing-suite filename case fails on main for the intended status/count mismatch and passes on the candidate. 76/76 CLI suite tests pass; repository lint passes for both changed TypeScript files, and formatting passes for those files plus the documentation.
Detailed native CLI results, commands, session-scoped round-trips and hashes: #193123 (comment).
This is Linux/POSIX filename evidence, not a Windows claim; literal question marks are not valid Windows filenames. No model, provider, channel or real credentials are needed.
Merge danger
Two-way door: reverting restores the incorrect
path findrefusal without migrations or stored-data changes. Blast radius is read-only searches of quoted literal-question-mark filenames; file-slot*refusal, query parsing, path resolution and file protections retain their existing behavior.