[codex] parse workflow policy structurally#1121
Merged
TheGreenCedar merged 2 commits intoJul 14, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The workflow-policy gate was parsing YAML as indented text. Comments, harmless quoting changes, and formatting could satisfy or break checks without changing the workflow GitHub executes. This replaces that parser while preserving the current policy surface, including the centralized Node worktree setup added on the integration branch.
Base:
1ee918119e004cccf220bfab05085152172b3b34Head:
d3df927a06044afdb2eceb3de195b08fdc17f4d1Closes #1110
Refs #899
What changed
yaml@2.9.0in the root package and lockfile, installed withnpm ci --ignore-scriptsin every workflow that runs the policy gateThe production checker shrinks from 839 lines on the base to 746. Tests live in a separate 124-line file instead of being embedded in formatting-sensitive parsing helpers.
Review
Start with
.github/scripts/check-workflow-policy.mjsand its six mutation tests. The one intentionally scalar-specific parser is the dynamicfromJSON(...)package matrix expression; the surrounding workflow and matrix field are still selected structurally.Risk: S4/R2. This changes a release-policy gate, but not runtime behavior. The main risk is dropping an existing invariant during the parser replacement; the full live workflow set and focused bypass mutations both pass.
Verification
npm ci --ignore-scriptsnode --test .github/scripts/check-workflow-policy.test.mjsnode .github/scripts/check-workflow-policy.mjsnode --test plugins/codestory/tests/plugin-static.test.mjs(73 passed, 1 Windows-only skip)node scripts/codex-worktree-setup.mjs --self-testnode .github/scripts/route-ci-proof.mjs --self-testpython .github/scripts/check-packaged-agent-proof.py --self-testpython .github/scripts/package-codestory-release.py --self-testpython .github/scripts/test-detect-codestory-release.pypython .github/scripts/check-codestory-release.py --version 0.15.0node scripts/lint-retrieval-generalization.mjsnode .github/scripts/check-doc-links.mjsrustfmton the adjusted Rust fixturegit diff --checkNo Cargo lane was run; this change does not alter Rust behavior, and broad Cargo proof belongs on the accepted exact head.