Repository navigation
fix(actions-lock-gate): read uses: with yq so KYAML is not RED - #1217
Merged
Merged
Conversation
The lockless branch of check-actions-lock-gate.sh found `uses:` with an anchored line grep. A KYAML step value is quoted and ends in a comma (`uses: "a/b@<sha>",`), so it failed the `@<sha>([[:space:]]|$)` test and a quoted `"./local"` missed its exemption: a fully pinned KYAML workflow went RED (jaffascript#72, 2026-10-09). The grep also read a `run:` body line that starts with `uses:` as a step ref. The gate now reads each top-level *.yml/*.yaml with yq (YAML-POLICY Y-1): every string `uses:` value, step and job level, block and flow style alike. The four exemptions and the 40-hex pin test are unchanged. Fail-closed cases: - a file yq cannot parse, or one with no `jobs:` map (an unclosed quote can swallow a file and still parse), is UNEXAMINED: exit 1, never 0 or 3. The old gate returned 3 (ledgerable debt) for an unparseable file. - yq missing, or a yq that cannot read the ref from a known block and KYAML input, is exit 2. mikefarah yq v4 is already required by R5. Tests: 12 new cases. Run against origin/main's gate, 8 of them fail (KYAML pinned x2, KYAML mutant, run: decoy, unparseable, quote-swallow, yq missing, wrong yq); against this gate all 23 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wo32J8Ym7XpPr9EYdBCgVB
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
K9 contract conformancerun https://github.com/hyperpolymath/standards/actions/runs/37928116805 K9 normative contract typecheckK9 contract self-testK9 conformance fixturesK9 corpus conformance (L2) |
|
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.



Summary
scripts/check-actions-lock-gate.sh(theactions-lock-verifygate) now readsuses:refs with yq instead of an anchored line grep, in its lockless branch only. YAML-POLICY Y-1 calls for this.Why. A KYAML step value is quoted and ends in a comma:
uses: "a/b@<sha>",. That value failed the grep's@<sha>([[:space:]]|$)test, and a quoted"./local"missed its exemption. So a fully pinned KYAML workflow went RED, as on jaffascript#72 (2026-10-09). This is the third §2a precondition: the "Produce today" column says a workflow stays in block YAML until this gate reads KYAML. The grep also treated arun:body line starting withuses:as a step ref.What did not change.
gh actions-lock --verify-localverifier../,docker://,actions/github-script,hyperpolymath/standards/*).Behaviour changes, all in the fail-closed direction:
jobs:map (unclosed-quote swallow, all-commented template, non-workflow YAML)uses:text inside arun:body.github/workflows/sub/*.ymlgrep -r)Closes # (none: this implements YAML-POLICY Y-1 for this script)
Type of change
📌 New pins
0d50cbe52d01a00eea404ea07dff31e6e8e789c6uses:change, noactions.lockchange, no lockfile or container digest.How has this been verified?
All of the following were run on head
0d50cbe5, 2026-10-09:bash scripts/tests/check-actions-lock-gate-test.sh→passed=23 failed=0. There are 12 new cases under "no lockfile, KYAML and parser cases":yq -p yaml -o kyamlfrom the block fixture."./local"present).Mutant kill. Running the same suite against
origin/main's gate gives 15 pass, 8 fail:run:heredoc decoy;The other 4 new cases are regression guards that pass on both, not kills: control identity, the flow-style assertion, the job-level reusable call by tag, and the short SHA.
Full self-test suite at this head:
All 80 test file(s) passed. CI's runner yq writes KYAML:kyaml-format-test.shreported 17/17 in run 37913997559 onmain.shellcheckon both files: clean..githooks/docstring-scan.sh --range origin/main..HEAD: 2/2 functions documented, 100%.Blast-radius census of the ledger.
lock-allow.txtentries. 162 resolved by GraphQL.hyperpolymath/avow-protocoldid not resolve (renamed or deleted)..github/workflows/, run through both gates withLOCK_TODAY=2026-10-09.actions.lockpresent (verifier branch, unchanged)Checklist
git log --format=%G?→G.SPDX-License-Identifier: no new files. Both modified scripts keep their existingMPL-2.0header.governance-reusable.ymlL1478-1482 still describes the old grep (follow-up below).Notes for reviewers
The 4 repos that turn red. Each holds workflow files that GitHub itself cannot parse:
cloudguard-serverdogfood-gate.ymlrrecord-veritydogfood-gate.ymlemail-octad-experimentdogfood-gate.yml,workflow-linter.yml, ande2e.yml(all jobs commented out)hyperpolymath-sovereign-registryboj-build.yml,guix-nix-policy.yml,quality.yml,rsr-antipattern.yml,security-policy.ymlGitHub's view of the same files:
nameequal to its file path. That is GitHub's sign that it could not parse the file.failure.hyperpolymath-sovereign-registry's last run hastotal_count: 0jobs.So none of those refs has ever run. The old gate excused these repos at exit 3 only because the grep saw nothing unpinned. The fix belongs in those 4 repos' workflow files, not in the ledger, which may excuse exit 3 only.
Follow-ups, not in this PR:
governance-reusable.ymlL1478-1482: the comment still describes the grep regex and "11/11" tests. Left alone, because §2a puts workflow edits behind their own preconditions.update-actions-lock.shsnapshots and restores workflow bytes around--verify-local(L172-177), but its update pass (L169,gh actions-lockdefault mode) runs before that snapshot, so the update pass's rewrites persist.P0-006 is an owner question: should the estate recipe use
gh actions-lockdefault mode at all? Those rewrites are:./→$/local-path rewrite.Separate script, separate PR.
Merge. Squash. This is held for the owner's decision on the 4-repo flip and is not armed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Wo32J8Ym7XpPr9EYdBCgVB