Repository navigation
refactor(setup-apply): read convention files with yaml-subset.mjs instead of awk - #11248
Conversation
…tead of awk lib/setup-apply.mjs now builds its records in process from yaml-subset.mjs, whose new source option keeps each scalar's source text and mapping order the way yaml-subset.awk prints them. The 8 setup entry points stop passing parser:, and scripts/shared-copies.txt copies yaml-subset.mjs into each plugin's lib/ beside setup-apply.mjs. A parity test runs the adapter and yaml-subset.awk over block-style fixtures and asserts the same verdict, the same error line, and the same records. Closes #10131 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
|
claude-security-review reviewed No security issues found in the incremental change (ca1a750). What changed: Why this isn't a finding:
critical-findings: 0 |
…creates it The race hook fired on the awk spawn, which setup-apply no longer makes. Moved to the bash spawn it fired before the target read, so the in-loop path check was no longer exercised. It now swaps on the mkdir of docs/, as the planning suite does; removing that check fails the test again. Refs: #10131 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
claude-review reviewed Incremental review of ca1a750 since 12abe29 found nothing to flag. What changed: In What I checked by reading the code (I ran no tests):
No |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc6cf2dd79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
check-cross-plugin-source-drift.sh failed check-plugins because the eight plugins/*/lib/yaml-subset.mjs copies were unregistered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source mode now rejects text after a quoted value, a root sequence, a sequence nested on one line and a plain key outside [A-Za-z0-9_-], and accepts blanks before a quoted key's colon, as lib/yaml-subset.awk does. Default mode keeps the yaml_subset.py grammar. Ten parity fixtures cover the cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… scalar through splitKey threw on a would-be plain key holding a space, `$` or `.` before source mode could return null, so `- Steps to run:` errored where lib/yaml-subset.awk emits the scalar. The source-mode check now runs first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #10131
Summary
lib/setup-apply.mjsnow reads convention files in process throughlib/yaml-subset.mjsinstead of spawningyaml-subset.awk. This is part 4 of 4 of #8677. Parts 1 to 3 (#10128, #10129, #10130) made the two grammars match and pinned the leaf display this switch must keep.Fix
lib/yaml-subset.mjs: newparse(text, { source: true }). It uses the same grammar, but every scalar comes back as its source text, the wayyaml-subset.awkprints it (1.0,075,True,~and9007199254740993kept as written, quotes removed,\nkept as written). Mappings come back as Maps in document order. A key that cannot sit in a dotted record path (empty, holding.or a tab) is refused, as awk refuses it. Defaultparse()is unchanged for its existing callers.lib/setup-apply.mjs:flatten(text)walks that tree into the same{ path, top, nested, value }records awk produced.validate()andrun()no longer take aparser.scripts/shared-copies.txt: 8 new lines copyyaml-subset.mjsinto thelib/of each plugin that carriessetup-apply.mjs(discipline, discovery, docs-hygiene, education, planning, review, session-flow, verification). The copies come fromscripts/sync-shared-copies.sh. The 4 existingyaml-subset.mjscopies were regenerated too.skills/setup/scripts/setup-apply.mjsentry points no longer passparser:. Their comments now name only the reader.lib/yaml-subset-parity.test.mjs, with a.test.shwrapper. It runsflatten()andyaml-subset.awkover 20 accepted and 26 rejected block-style fixtures. For each fixture it asserts the same verdict, the same error line on a refusal, and identicalpath<TAB>valuerecords when both accept.yaml-subset.mjswording, so 13 assertions acrosslib/setup-apply.test.shand the discipline, planning, review, session-flow and verification suites now expect the new message. For example,duplicate key `a` (first at line 1)becameline 2: duplicate key "a". The session-flow symlink-swap race test hooked theawkspawn, which no longer happens. It now swapsdocs/for a symlink right after the run creates it, as the planning suite does. Deleting the in-loopcheckFileinwriteFilemakes it fail, on this branch and on the base.Verification
bash lib/yaml-subset-parity.test.sh: 46 of 46 pass.node --test lib/yaml-subset.test.mjs: 48 of 48 pass (default mode unchanged).bash lib/setup-apply.test.sh: 537 of 537. The 8 pluginsetup-apply.test.shsuites all pass (review 384, verification 615, the others report all passed).--checkon this repository before and after the change, and the output was byte-identical.scripts/sync-shared-copies.sh --check: all 545 copies match.--check-bump origin/mainpasses, and so doesscripts/check-changelog-fragments.sh --check.scripts/check-affected.sh --testson the committed head: 14 passed, 2 skipped (ruff: no Python changed; tests: left to CI lanes). Then the selected suites ran directly:affected-tests.sh --runpassed all 64 shell suites,node --testover the 59 selected Node suites passed 4557 tests with 0 failures, and the code-metrics yaml-subset Python suites pass.Left out: the babysit-prs Python suites the selector picked (no pytest on this host; the change does not touch their code), left to CI.
Related
Refs: #8677
🤖 Generated with Claude Code