Repository navigation
fix(oc-path): comments leak into quoted frontmatter values - #182792
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesDecode quoted Markdown frontmatter strings when an inline YAML comment follows the closing quote. Example: Resolve note from single.md containing note: 'don''t' # annotation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current parser bug with a minimal change and no actionable findings; exact-head CI is still finishing. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe optional oc-path plugin loads workspace files for the path CLI, parses frontmatter into string leaves, and returns resolved values or applies targeted file edits. flowchart LR
A[Markdown file] --> B[Path CLI loader]
B --> C[Markdown parser]
C --> D[YAML scalar decoder]
D --> E[Frontmatter string leaf]
E --> F[Resolve output]
Technical reviewBest possible solution: Use the existing YAML decoder for quote-prefixed scalars while preserving malformed-input tolerance and source bytes. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically bypasses decoding for the supplied fixture, matching the contributor's before/after CLI output; this review executed no target code. Is this the best way to solve the issue? This is the smallest complete repair: change admission to the existing decoder and retain the original fallback, with focused parser cases and an extended CLI preservation test. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7b5ce25ee53a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +5. Total +5 across 3 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 HistoryReview history (1 earlier review cycle)
Reviewed October 25, 2026, 9:05 PM ET / October 26, 2026, 01:05 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…w#182792) Decode quoted frontmatter scalars with the existing YAML owner even when an inline comment follows. Keep malformed-value fallback and preserve unrelated file content. Co-authored-by: LinzeShi <[email protected]>
What Problem This Solves
path resolvereturns quote syntax and a trailing YAML comment as part of a quoted Markdown frontmatter value, including after that value is written withpath set.User Impact
Quoted values with inline comments resolve to their decoded text. Reads preserve the file, and later edits retain comments and surrounding content.
Why This Change Was Made
The existing YAML decoder handles values beginning with a quote even when a comment follows the closing delimiter. The existing tolerant malformed-input fallback and plain-value behavior remain. This keeps one parser owner and adds no configuration or schema.
Thanks to @LinzeShi for the fix, regression coverage, and shipped Windows CLI proof. Contributor commits are preserved. Simplification retained the two-line repair: production delta 0, test delta +5.
Evidence
The contributor's shipped Windows CLI proof below uses isolated home/config/state and disposable Markdown files. The parser repair is unchanged. This lane reruns the real registered CLI/file-I/O boundary locally; a separate packaged macOS CLI build was not live-tested to keep additional live work within the targeted proof budget.
Reproduction and captured output
Fixture
single.md:pnpm --silent openclaw path resolve 'oc://single.md/[frontmatter]/note' --file single.md --jsonThe proof runner passes these arguments directly on Windows. Both commands exit 0; the returned value differs:
Before:
{ "resolved": true, "ocPath": "oc://single.md/[frontmatter]/note", "match": { "kind": "leaf", "valueText": "'don''t' # annotation", "leafType": "string", "line": 2 } }After:
{ "resolved": true, "ocPath": "oc://single.md/[frontmatter]/note", "match": { "kind": "leaf", "valueText": "don't", "leafType": "string", "line": 2 } }Focused tests cover YAML escapes, doubled apostrophes, literal hashes, malformed input, and CLI read-after-write followed by an unrelated edit that preserves the comment and body.
Integrated current main (
96938085d6496d442a06524f8f9344a7d885a7f8) with contributor commits intact. The parser and its focused tests remain byte-identical to the reviewed source. Final head31d923baa06a3405e9d9273b75b51156d5bfdc17passes both affected files, 83 tests, in 63.74 seconds including compilation/runner. The initial worktree run lacked an existing QuickJS dependency needed by test subprocess compilation; the supported dependency link fixed that setup without source or dependency changes. Local merge-tree succeeds.check-changedpassed its selected type, lint, formatting, i18n, and ownership guards. Its only failure was the broad unused-export scan in untouched test helpers; the production unused-export scan passed. No exported API is introduced by this change.Exact-head CI 40252009688 passed on
31d923baa06a3405e9d9273b75b51156d5bfdc17; the CI watcher reports GREEN, excluding superseded cancelled checks. ClawSweeper reviewed this exact head with no findings and sufficient terminal proof.