Repository navigation
OC Path: restore YAML support - #81436
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. for a feature restoration PR. Current main source shows YAML is absent from OC Path dispatch, while the PR body provides after-fix terminal proof for YAML resolve/set/sentinel behavior. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the YAML restoration after maintainer/dependency approval, keeping the implementation inside the bundled oc-path plugin and leaving dry-run structured diff work to the companion PR. Do we have a high-confidence way to reproduce the issue? Not applicable for a feature restoration PR. Current main source shows YAML is absent from OC Path dispatch, while the PR body provides after-fix terminal proof for YAML resolve/set/sentinel behavior. Is this the best way to solve the issue? Mostly yes: the adapter stays inside the oc-path plugin boundary and uses the upstream YAML Document API with parse-error guards. The remaining decision is maintainer approval for the feature, dependency, and small shared-check cleanup. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9dedc4d95cfb. |
59e4ac4 to
5cb1c71
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Dependency Changes DetectedThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
5bcb324 to
451f207
Compare
|
Reviewed at One blocker matches ClawSweeper's P2: Repro: Fix is ~10 LOC: gate Optional nits (none blocking):
Targeted suites locally on After the malformed-input gate lands, rebase past the Re-review progress:
|
451f207 to
bff6be1
Compare
|
Addressed the malformed YAML blocker from @omarshahine. Changes:
Validation:
Note: the local Windows shell still fails to launch |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up docs update for the YAML support PR:
Validation after rebasing onto current @clawsweeper re-review |
bff6be1 to
6d2634d
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
6883648 to
623a1a4
Compare
* OC Path: restore YAML support * fix(oc-path): guard yaml writes and empty sequences * fix(oc-path): guard yaml insertion keys * fix(oc-path): guard yaml object key * fix(oc-path): classify yaml root insertions * style(oc-path): format yaml branch after rebase * fix(oc-path): reject malformed yaml edits * docs(oc-path): clarify yaml file support * fix(ci): refresh yaml branch after rebase * fix(ci): clean shared blockers for yaml path PR * fix(changelog): keep yaml path note scoped * fix(ci): preserve current shared contracts --------- Co-authored-by: Gio Della-Libera <[email protected]
* OC Path: restore YAML support * fix(oc-path): guard yaml writes and empty sequences * fix(oc-path): guard yaml insertion keys * fix(oc-path): guard yaml object key * fix(oc-path): classify yaml root insertions * style(oc-path): format yaml branch after rebase * fix(oc-path): reject malformed yaml edits * docs(oc-path): clarify yaml file support * fix(ci): refresh yaml branch after rebase * fix(ci): clean shared blockers for yaml path PR * fix(changelog): keep yaml path note scoped * fix(ci): preserve current shared contracts --------- Co-authored-by: Gio Della-Libera <[email protected]
* OC Path: restore YAML support * fix(oc-path): guard yaml writes and empty sequences * fix(oc-path): guard yaml insertion keys * fix(oc-path): guard yaml object key * fix(oc-path): classify yaml root insertions * style(oc-path): format yaml branch after rebase * fix(oc-path): reject malformed yaml edits * docs(oc-path): clarify yaml file support * fix(ci): refresh yaml branch after rebase * fix(ci): clean shared blockers for yaml path PR * fix(changelog): keep yaml path note scoped * fix(ci): preserve current shared contracts --------- Co-authored-by: Gio Della-Libera <[email protected]
* OC Path: restore YAML support * fix(oc-path): guard yaml writes and empty sequences * fix(oc-path): guard yaml insertion keys * fix(oc-path): guard yaml object key * fix(oc-path): classify yaml root insertions * style(oc-path): format yaml branch after rebase * fix(oc-path): reject malformed yaml edits * docs(oc-path): clarify yaml file support * fix(ci): refresh yaml branch after rebase * fix(ci): clean shared blockers for yaml path PR * fix(changelog): keep yaml path note scoped * fix(ci): preserve current shared contracts --------- Co-authored-by: Gio Della-Libera <[email protected]
Summary
Restores YAML support to the bundled
oc-pathextension so the sameoc://addressing model works across markdown, JSONC, JSONL, YAML/YML, and.lobsterworkflow files.This PR:
yamlpackage instead of a hand-rolled parser;openclaw path resolve/find/set/emitand the universal substrate;.yaml,.yml, and.lobsterto the YAML kind;$firstpositional addressing alongside the existing$last; andMotivation
Community feedback around oc-path has specifically asked for uniform addressing across formats, including YAML:
That matches the original oc-path goal: callers should not need separate parser/edit code for every workspace file kind just to read or update one leaf.
Real behavior proof
Behavior addressed: YAML files can be resolved and edited through the real
openclaw pathCLI, empty YAML sequences can be appended to, and YAML writes refuse the redaction sentinel before bytes are emitted.Real environment tested: Local Windows source checkout at
33cf47b79f, using an isolated--profile ocpath-proofand a temporary workspace. The bundledoc-pathplugin was enabled withpnpm openclaw --profile ocpath-proof plugins enable oc-path.Exact steps or command run after this patch:
Evidence after fix:
Targeted regression output:
Observed result after fix: The real CLI resolves YAML leaves, appends to an empty YAML sequence, persists the expected YAML bytes, and rejects sentinel-bearing YAML values and insertion keys. The targeted regression suite passes all 30 YAML tests.
What was not tested: This proof used a local source checkout and isolated profile, not a packaged npm install or remote Gateway.
Tests
pnpm test extensions/oc-path/src/oc-path/tests/yaml/yaml-kind.test.ts -- --reporter=verbosepnpm exec oxfmt --check --threads=1 extensions/oc-path/src/oc-path/yaml/edit.ts extensions/oc-path/src/oc-path/tests/yaml/yaml-kind.test.ts CHANGELOG.md docs/cli/path.md docs/plugins/oc-path.mdgit diff --checkNotes
This PR intentionally does not add structured diff output for dry runs. That is split into a smaller companion PR.
Related
Refs #78051.