Repository navigation
Conversation
Quote exact literal wildcard keys while preserving structural selectors and keyed insertion markers. Cover registered CLI find/resolve/set reuse and canonical formatting. Closes openclaw#172161
|
🦞👀 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 changesThis PR adds wildcard-key array-path CLI coverage and four canonical path-formatting cases. Example: Find and update the array at the literal key "*" in config.jsonc.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR retains useful array-node regression coverage beyond main’s existing scalar-key tests, with no actionable findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe optional oc-path plugin registers local file commands; oc:// paths enter its parser and traversal adapters, which return matches or write the selected file value. flowchart LR
A[CLI arguments] --> B[Plugin command registration]
B --> C[Path parser]
C --> D[JSONC traversal]
D --> E[Concrete array path]
E --> F[Resolve or set]
F --> G[File and JSON output]
Technical reviewBest possible solution: Retain the focused array-path and formatting coverage alongside main’s existing implementation. Do we have a high-confidence way to reproduce the issue? The remaining patch adds coverage rather than repairing a current-main failure; the supplied CLI transcript demonstrates the protected behavior at the reviewed head. Is this the best way to solve the issue? The registered-command scenario protects array replacement and neighbor preservation, while the formatting rows extend an existing independent canonical-path contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ec430f5cd126. TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +52. Total +52 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel 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 (3 earlier review cycles)Reviewed October 17, 2026, 4:27 AM ET / 08:27 UTC (Revision 4). |
Merge upstream main to resolve formatter and parser-test conflicts. Keep the canonical implementation and retain the original find-to-resolve-to-set regression coverage for array values and embedded wildcard keys.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge upstream main d79a7b6, preserving the runtime implementation and expanded registered-CLI coverage. Retain the wildcard-array round trip and four parser cases. Validation: 34 oc-path files / 437 tests, targeted typecheck, formatting, whitespace check, and independent source review passed. Local type-aware lint could not start because SDK declaration preparation exited 13; exact-head hosted CI remains required.
Merge upstream a6ee6a1, preserving the current runtime implementation and existing CLI coverage. Move the wildcard-array scenario into its own focused test file to respect the CLI suite line cap. Retain four canonical parser cases and allocate the exact 67 net test lines. Validation: 34 oc-path files / 488 tests, targeted typecheck, type-aware lint, formatting, test-line ratchet, whitespace, and independent review. Full repository and package/release builds were not run.
|
Updated to 11f4d43 by merging a6ee6a1 and preserving upstream behavior. The wildcard-array regression now has a focused test file to satisfy the CLI suite’s line limit, with an exact 67-line growth allocation. Validation passed: 34 oc-path files / 488 tests, targeted typecheck, type-aware lint, formatting, test-line ratchet, whitespace, and independent review. Full-repository tests and full package/release builds were not run. CI for this head is still running. |
Related: #172161
What Problem This Solves
Keeps regression coverage for reusing
path findresults when TypeScript-style path mappings contain wildcard-looking keys and array values.User Impact
No additional runtime change: current main already handles literal-key quoting. The retained tests protect resolving and updating the returned array paths without changing neighboring mappings.
Why This Change Was Made
Merged
d6d7435f59ecto resolve the formatter and parser-test conflicts, preserving main's canonical implementation. The remaining diff is two test files: the in-process CLI-handler find -> array-node resolve ->set --value-jsonscenario for*,**,@app/*, andtypes*, plus four formatter round-trip cases not covered by the existing table.Evidence
cliStartup/ oc-path runtime successfully atf596a8a321ba9e35220b0986705f4221f6ccd99aand captured the actual shipped CLI flow below. All 11 independent CLI invocations exited 0. All four returned wildcard-looking array paths resolved and were updated with--value-json, preserving the other mappings after each write.test:extension oc-path --maxWorkers=1run at this same head passed 33 files, with 348 tests passed and five existing tests skipped (Vitest 5.0.3, 30.41 seconds). The in-process handler scenario took 54 ms and the parser round-trip case 4 ms. Those are the previously recorded unit-test results, separate from this new CLI capture.openclaw/ci-gatereport success; selection-skipped jobs are not claimed as executed.Captured shipped CLI flow at f596a8a (11 independent invocations)
Executed on Windows with Node 24.21.0 and pinned pnpm 12.11.1 through the project's
pnpm --silent openclawentry (scripts/run-node.mjs). The normal launcher prepared its runtime artifacts; the command and parser were not mocked or imported from a test. The fixture and the oc-path-only CLI configuration were isolated from personal state.Argument vectors below start at pnpm's arguments. Captured JSON stdout is pretty-printed, with only local filesystem paths replaced by
<fixture>. Each invocation exited 0.Initial fixture:
{ "paths": { "*": [ "types/*" ], "**": [ "recursive/*" ], "@app/*": [ "src/*" ], "types*": [ "generated/*" ], "neighbor": [ "keep/me" ] } }00-version— arguments:stdout:
Captured launcher stderr:
01-find— arguments:stdout:
{ "pattern": "oc://config.jsonc/paths/*", "count": 5, "matches": [ { "path": "oc://config.jsonc/paths/\"*\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 3 } }, { "path": "oc://config.jsonc/paths/\"**\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 6 } }, { "path": "oc://config.jsonc/paths/\"@app/*\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 9 } }, { "path": "oc://config.jsonc/paths/types*", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 12 } }, { "path": "oc://config.jsonc/paths/neighbor", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 15 } } ] }02-resolve— arguments:stdout:
{ "resolved": true, "ocPath": "oc://config.jsonc/paths/\"*\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 3 } }02-set— arguments:stdout:
{ "ok": true, "dryRun": false, "bytesWritten": 216, "fsPath": "<fixture>\\config.jsonc" }Complete fixture after this write:
{ "paths": { "*": [ "updated/*" ], "**": [ "recursive/*" ], "@app/*": [ "src/*" ], "types*": [ "generated/*" ], "neighbor": [ "keep/me" ] } }03-resolve— arguments:stdout:
{ "resolved": true, "ocPath": "oc://config.jsonc/paths/\"**\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 6 } }03-set— arguments:stdout:
{ "ok": true, "dryRun": false, "bytesWritten": 215, "fsPath": "<fixture>\\config.jsonc" }Complete fixture after this write:
{ "paths": { "*": [ "updated/*" ], "**": [ "updated/**" ], "@app/*": [ "src/*" ], "types*": [ "generated/*" ], "neighbor": [ "keep/me" ] } }04-resolve— arguments:stdout:
{ "resolved": true, "ocPath": "oc://config.jsonc/paths/\"@app/*\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 9 } }04-set— arguments:stdout:
{ "ok": true, "dryRun": false, "bytesWritten": 224, "fsPath": "<fixture>\\config.jsonc" }Complete fixture after this write:
{ "paths": { "*": [ "updated/*" ], "**": [ "updated/**" ], "@app/*": [ "updated/@app/*" ], "types*": [ "generated/*" ], "neighbor": [ "keep/me" ] } }05-resolve— arguments:stdout:
{ "resolved": true, "ocPath": "oc://config.jsonc/paths/types*", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 12 } }05-set— arguments:stdout:
{ "ok": true, "dryRun": false, "bytesWritten": 227, "fsPath": "<fixture>\\config.jsonc" }Complete fixture after this write:
{ "paths": { "*": [ "updated/*" ], "**": [ "updated/**" ], "@app/*": [ "updated/@app/*" ], "types*": [ "updated/types*" ], "neighbor": [ "keep/me" ] } }06-find-after— arguments:stdout:
{ "pattern": "oc://config.jsonc/paths/*", "count": 5, "matches": [ { "path": "oc://config.jsonc/paths/\"*\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 3 } }, { "path": "oc://config.jsonc/paths/\"**\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 6 } }, { "path": "oc://config.jsonc/paths/\"@app/*\"", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 9 } }, { "path": "oc://config.jsonc/paths/types*", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 12 } }, { "path": "oc://config.jsonc/paths/neighbor", "match": { "kind": "node", "descriptor": "jsonc-array", "line": 15 } } ] }The path strings returned by
findwere passed unchanged toresolveandset. Each resolution returnedkind: node/descriptor: jsonc-array. After every write, the complete mapping matched the expected single-key update, including all neighboring mappings; the finalfindreturned the same five paths. Later invocations emitted only the same Windows Bun-to-Node fallback notice shown above.