Skip to content

fix(yaml-subset): refuse plain values holding ': ' and plain keys holding a space, or . - #10913

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-10128-40837974363-1
Oct 29, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-10128-40837974363-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #10128

Summary

Opened by the work-resolve-issue lane. The run's own summary:

lib/yaml-subset.mjs now refuses, with a line-numbered YamlSubsetError, a plain value holding a colon followed by a space or tab (the awk parser's rule and message) and a plain key holding whitespace, $ or .; quoted keys and values still parse. This moves the mjs grammar toward lib/yaml-subset.awk before setup-apply adopts it. The four plugin copies were regenerated, and each of those plugins gets a patch changelog fragment.

Not verified

  • node --test lib/yaml-subset.test.mjs and lib/config-cascade.test.mjs, and the four plugins' test suites, were not executed here (this lane cannot run node); left to the PR's CI
  • tidy skipped: the change touches the shared path lib/ and exceeds the 10-file and 1-area cutoffs
  • Intentional divergence from the awk grammar: the mjs parser also refuses ': ' inside a plain flow-sequence item ([b, c: d]), which awk reads as text; and for - a b: c it reports the plain-key message where awk reports the plain-value message (same line)
  • Changelog fragments were written by hand because new-changelog-fragment refuses a detached HEAD; the names follow its <branch-slug>-<8 hex> pattern

Fix

  • lib/yaml-subset.mjs: scalar() throws on a plain value matching /:[ \t]/; splitKey() throws on a plain key matching /[\s$.]/; header comment names the narrowing relative to the Python grammar
  • lib/yaml-subset.test.mjs: eight new line-numbered refusal cases (block value, sequence-item value, flow item, spaced/$/dotted keys, dash-line key, key with empty value) plus positive tests for quoted keys/values and a colon with no space
  • lib/config-cascade.test.mjs: the dotted-key fixture quotes its key ('w.s': 42) so it still exercises the cascade's own dotted-key rejection instead of the new parser refusal
  • plugins/user-experience/scripts/lib/yaml-subset.mjs: regenerated shared copy
  • plugins/user-interface/scripts/lib/yaml-subset.mjs: regenerated shared copy
  • plugins/domain-driven-design/scripts/lib/yaml-subset.mjs: regenerated shared copy
  • plugins/corrections/scripts/lib/yaml-subset.mjs: regenerated shared copy
  • .changes/user-experience/work-resolve-issue-issue-10128-7c2d9a41.md: patch fragment
  • .changes/user-interface/work-resolve-issue-issue-10128-7c2d9a41.md: patch fragment
  • .changes/domain-driven-design/work-resolve-issue-issue-10128-7c2d9a41.md: patch fragment
  • .changes/corrections/work-resolve-issue-issue-10128-7c2d9a41.md: patch fragment

Verification

The runner ran each check from the base copy against 6aee387:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • check-changelog-fragments: all 6 fragments valid
  • check-affected: first run failed markdownlint MD038 on the fragments (a code span holding a space); reworded, rerun: 11 passed, 7 skipped, 0 failed
  • sync-shared-copies (generate, then --check): all 535 registered copies match their canonical sources
  • fresh-context review subagent hand-traced every yaml-subset and config-cascade test plus the four plugins' callers, fixtures and shipped defaults.yaml: no bugs; its one wording point (one refused line now invalidates the whole layer file) was folded into the fragments
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40837974363

Left out: the items under Not verified.

Related

#10128

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 6aee387a72b6340082b2676544e580dc99788198: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

critical-findings: 0

What I read: the full diff (11 files) and the PR context. The change makes lib/yaml-subset.mjs stricter. scalar() now throws on a plain value matching /:[ \t]/. splitKey() now throws on a plain key containing whitespace, $ or .. The four plugin copies are regenerated and identical to the shared source, and there are test changes plus four patch changelog fragments.

Trust controls and trusted paths: none of the changed files is on the trusted-paths list or is a trust control. I found no widening of who is trusted, token scope, kill-switch reach or merge holds. .github/workflows/pr-require-checks.yml mentions yaml-subset but is not in the diff.

Parser behaviour:

  • The change only rejects input that was previously accepted. No new construct is parsed, so it adds no injection surface and no prototype-pollution path. The __proto__ own-data-key handling is unchanged.
  • The new error messages quote the key through the existing quote() helper, which cuts file text to 60 characters and escapes it as JSON. Nothing unescaped from file text reaches the message.
  • The new regexes are linear and cannot backtrack catastrophically. /:[ \t]/ and /[\s$.]/ are single-pass tests on already-bounded line text.
  • The stricter parsing makes one invalid line reject the whole layer file. That is an availability and compatibility effect, and the changelog fragments say so. Anyone who can edit a config file in the repository can already change the config, so this gives no attacker anything.

Manifests: the diff touches no plugin.json or marketplace.json.

Spend: none. There are no workflow, model, billing or schedule changes.

Not verified: the PR notes that node was not run in the author's lane. I did not run the tests either. I only read the diff.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 6aee387a72b6340082b2676544e580dc99788198: 0 finding(s), 0 as inline comments.

No findings. I read the whole diff and the head lib/yaml-subset.mjs (head SHA 6aee387). I did not run anything, because I had no shell. The author's test and CI claims are author-claimed and unverified by me.

Closing issue #10128, both done-when items are met and each has a test that would fail if it broke:

  • A plain value holding : (for example pre_confirmed_label: needs: triage) is refused with a line number. scalar() now throws, and the new cases in lib/yaml-subset.test.mjs cover a block value, a sequence-item value and a flow item.
  • A plain key holding a space, $ or . is refused. splitKey() now throws, and the new cases cover a b, $schema, a.b, a dash-line key and a key with an empty value.
  • Quoted keys and values still parse, and a colon with no following space stays in a plain value. The two positive tests check this.

Checked by reading the code:

  • Quoted scalars return in scalar() before the new check, and quoted keys return in splitKey() before it. The new refusals therefore cannot reach quoted text.
  • The check runs only on plain keys, and block() calls splitKey only for non-item lines. A plain sequence scalar without a colon is unaffected.
  • The lib/config-cascade.test.mjs fixture now quotes its key as 'w.s'. The test still exercises the cascade's own dotted-key rejection instead of the new parser refusal.
  • The four plugin copies of yaml-subset.mjs match the canonical edit hunk for hunk.
  • The four changelog fragments are identical patch fragments, and they state the one-bad-line-invalidates-the-file behaviour change.

Manifests: the diff changes no plugin.json or marketplace.json, so the manifest checks do not apply.

Security and cost: no trusted-path file is touched, and there is no security or cost surface. The change is a stricter parser and spends nothing.

Not verified by me: the node test suites, and the claim that shipped defaults.yaml files and other callers hold no plain values with : or keys with spaces, $ or .. The PR says a fresh-context subagent traced these. I did not independently confirm it.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 6aee387a72b6340082b2676544e580dc99788198.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit f371abf Oct 29, 2026
43 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-10128-40837974363-1 branch October 29, 2026 09:32
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 3, survived 4, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 43%; mutation score 43%.

File Killed Survived Timeout No coverage Invalid Not run
lib/yaml-subset.mjs 3 1 0 0 0 0
plugins/corrections/scripts/lib/yaml-subset.mjs 0 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
lib/yaml-subset.mjs:161 other productive input-gap
plugins/corrections/scripts/lib/yaml-subset.mjs:100 SBR unclassified none
plugins/corrections/scripts/lib/yaml-subset.mjs:163 other unclassified none
plugins/corrections/scripts/lib/yaml-subset.mjs:164 other unclassified none

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Converge the awk and mjs YAML grammars before setup-apply uses yaml-subset.mjs - part 1 of 4

0 participants