Skip to content

Commit 7e75dc7

Browse files
os-zhuangclaude
andauthored
fix(scripts): the required-context self-test proves WIRING with invocations, not prose (#10877) (#10884)
* fix(scripts): check-required-contexts reads comments as prose, not as wiring (#10818) `uncommentedYaml` dropped a line only when its first non-space character was `#`, so a TRAILING `# --verify-required-set` on a live line — and a trailing shell comment inside a `run:` block scalar — survived the strip and reddened `Lint & Repo Gates` on prose. A workflow stacks two comment grammars and one line filter was wrong about both. Each now goes to the thing that knows it: `yaml.parse` for the YAML layer, and check-shard-attestation's `shellCommands()` lexer — imported, not re-typed — for the shell inside each `run:`. Both limbs are pinned in `--self-test`: four prose shapes that must NOT read as wiring, and six live shapes that must. The trailing-comment pair differs by the `#` alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt * fix(scripts): the required-context self-test proves WIRING with invocations, not prose (#10877) Two presence assertions in `--self-test` decided "is this wired up?" from text a comment, a label or an `echo` could supply. Both error toward a silent GREEN — the gate reporting that a required-context pin runs when it does not. - the `lint` job block carried a second `/^\s*#/` line filter and matched `/run: pnpm check:required-contexts\b/` over a raw text slice. It is now a structural read of `jobs.lint.steps`. The slice was also bounded by `'\n typecheck:'`, which is not the job after `lint:` — measured, it covered five jobs. - the caller sweep's single equality was two assertions in opposite directions sharing one WIDE recognizer. Split: the absence half keeps `wiresLiveRead`, the presence half gets `invokesLiveRead`. The two recognizers are deliberately different widths and are pinned together, including one case where they disagree by design. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent ef5ad87 commit 7e75dc7

1 file changed

Lines changed: 430 additions & 27 deletions

File tree

0 commit comments

Comments
 (0)