Skip to content

fix(oc-path): find rejects quoted filenames containing question marks - #193123

Merged
obviyus merged 4 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/path-boundary-d
Nov 5, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/path-boundary-d

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw path resolve can read a quoted literal filename such as report?.jsonc, but path find rejects the same parsed filename as a wildcard and exits 2. The parser has already separated the query string; a remaining ? in pattern.file is 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 resolve CLI in secretless Linux/arm64 Docker, Node 24.22.1.

  • report?.jsonc: main resolve works, but find refuses with OC_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.
  • Every returned path retains ?session=literal-proof and resolves back to identical match data.
  • Ordinary-file find/resolve is unchanged. A file-slot *.jsonc wildcard still returns the explicit refusal and exit 2, not an ENOENT failure.
  • All three input files are SHA-256 hashed before/after every command, with identical bytes throughout. The CLI uses normal working-directory resolution, not a file override or parser patch.

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 find refusal 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.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: oc-path size: S labels Nov 5, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Allow 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.

  • Before: Find rejects the filename with OC_PATH_FILE_WILDCARD_UNSUPPORTED and exit 2, although resolve accepts it.
  • After: Find returns both values with exit 0, and each returned path resolves successfully.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused correction with exact-head shipped-entry-point evidence, retained regression boundaries, and no actionable correctness or security findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): obviyus supplied exact-head Linux public-CLI results for literal and nested question-mark filenames, two distinct matches, session-preserving resolve round-trips, ordinary-file controls, continued asterisk refusal, and unchanged input hashes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Find refuses a valid quoted filename that resolve already accepts.
Reason: This restores consistency with existing filename grammar through a narrow plugin-local correction without adding configuration or public APIs.

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
Reviewed head: 1bd6f8f62e97be7246190f2429cdc898edae3004

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • CLI file-slot wildcard rejection changes intended behavior with a stated reason (unknown: The original plugin CLI explicitly rejected file globs to avoid misleading missing-file errors. The later CLI consolidation carried that guard forward; older missing blobs prevented completing introduction searches.)
  • CLI find regression matrix and assertion consolidation keeps the original intent (22a3119: The existing matrix protects quoted array-index resolution across JSONC, YAML, and JSONL; this PR retains those cases and incorporates literal filenames, session suffixes, and zero matches.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9e0064b adds extensions/oc-path/src/cli.ts:282 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9e0064bd7d90; files: extensions/oc-path/src/cli.ts)

PR surface

Source +1, Tests -5, Docs +1. Total -3 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 2 +1
Tests 1 21 26 -5
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 25 28 -3

Preflight source

Source 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

Metric Value Why it matters
Production versus test delta Production +3/−2; tests +21/−26 The correction stays in the existing owner, and regression consolidation reduces test lines without dropping the prior matrix cases.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded POSIX filename bug breaks read-only path searches while concrete resolution continues to work.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-05T02:13:19.735Z sha d58def3 :: needs maintainer review before merge. :: none

Reviewed November 4, 2026, 10:10 PM ET / November 5, 2026, 03:10 UTC (Revision 2).

@obviyus

obviyus commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Exact-head Linux CLI proof: literal ? filenames

Candidate 1bd6f8f, current-main baseline f642824. Both frozen-installed and fully built from repository source in secretless Linux/arm64 Docker, Node 24.22.1, with oc-path enabled and isolated profile/state/config paths. These are actual public openclaw.mjs path find and path resolve processes, not direct matcher calls.

The fixture tree contains report?.jsonc, nested?/batch?.jsonc, and an ordinary filename. Each contains two distinct named values. The CLI uses its actual working-directory/file resolution; no --file override, parser monkeypatch or new syntax is involved.

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' --json

Byte-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?.jsonc matrix 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.

@obviyus

obviyus commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 5, 2026
@obviyus
obviyus merged commit d189a55 into openclaw:main Nov 5, 2026
107 of 108 checks passed
@obviyus

obviyus commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Landed in d189a55. Thanks @zhangguiping-xydt. path find now accepts quoted filenames that contain ?.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 5, 2026
…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]>
RomneyDa added a commit that referenced this pull request Nov 5, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: oc-path P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants