Skip to content

fix(ci): post-triage gate repairs — duplicate permissions: block + shebangless planted control - #110

Merged
hyperpolymath merged 2 commits into
mainfrom
ci-dup-permissions-fix
Sep 17, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
ci-dup-permissions-fix

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Two small repairs for red gates on main left in the wake of the 2026-09-17 triage batch (#105/#106). Independent commits; both verified locally against current main.

1. fix(ci): merge the duplicated permissions: block in main-estate-audit.yml — Governance gate

Fixing the conflict markers in push-email-notify.yml (#105) let the Governance gate get past its first step ("Parse every tracked workflow") for the first time since #100 — and the next step immediately went red on a defect that had been hiding behind the parse failure: main-estate-audit.yml carried two identical top-level permissions: contents: read blocks — one from #92, a second (with the reusable-caller rationale comment) inserted below the on: block.

Fix: merge into a single block, rationale comment preserved and hoisted above it. Zero behaviour change (YAML last-key-wins meant the second block was already the effective one). Verified: file parses; duplicate-key scan across all workflows repo-wide now reports none — the "Duplicate YAML keys in workflows" step should go green.

Not fixed here — escalated as an owner call: the Workflow Security Linter's "Check SHA-Pinned Actions" failure is also in this file:

main-estate-audit.yml:22: hyperpolymath/cicd-suite/.github/workflows/main-estate-audit.yml@feat/cicd-workflow-call

The reusable call is branch-pinned. The owner is actively iterating that cicd-suite branch (Estate Rules failed there too before #108 fixed it), so pinning a SHA mid-iteration would freeze work in flight. Recommendation: once cicd-suite stabilises, pin to a SHA and add the actions.lock entry like every other reusable. This is the one gate that stays red after this PR, deliberately.

2. fix(tests): shebang for the bad-deploy planted control — Code Quality gate

www/tests/controls/bad-deploy/tests/run-all.sh (stage 4 of #106) ships the one-word body planted with no shebang. The repo-wide ShellCheck gate runs at error severity and flags SC2148 ("Add a shebang or a 'shell' directive") — so Code Quality went red on main the moment #106 landed. That one is squarely mine.

Fix: add #!/usr/bin/env bash. The control's violation is its path (a tests/ subtree inside a staged deploy tree); check-publication-boundary.sh:129 never reads its contents. Re-verified after the edit: www/tests/run-all.sh → 6 checks, 0 failures, "planted bad stage rejected" still prints.

Post-merge gate status (at 042d654, before this PR)

gate failing step cause disposition
Governance Duplicate YAML keys hidden since #92/#100, exposed by #105's parse fix fixed here (commit 1)
Code Quality ShellCheck SC2148 planted control from #106 fixed here (commit 2)
Workflow Security Linter Check SHA-Pinned Actions branch-pinned reusable → owner's cicd-suite work in flight escalated
Central Estate CI/CD Audit (whole run) same branch-pinned reusable call escalated

No issue to close — documented here for the record, as with the conflict-marker defect in #105.

….yml

Two identical top-level `permissions: contents: read` blocks — one from #92,
a second (with the reusable-caller rationale comment) added below the `on:`
block, last touched by #100. Duplicate YAML keys are rejected by the
Governance gate's 'Duplicate YAML keys in workflows' check; until #105 fixed
the conflict markers in push-email-notify.yml, that gate died at the earlier
'Parse every tracked workflow' step and never reached the duplicate check,
so this defect was invisible.

Zero behaviour change: both blocks granted exactly `contents: read` (YAML
last-key-wins meant the second was already the effective one). The rationale
comment is preserved, hoisted above the single surviving block.

Not touched here, escalated as an owner call: the same file's reusable call
is branch-pinned (@feat/cicd-workflow-call) and trips the Workflow Security
Linter's SHA-pin check. The owner is actively iterating that cicd-suite
branch (Estate Rules runs fail there too); pinning a SHA mid-iteration would
freeze work in flight. Pin + actions.lock entry once cicd-suite stabilises.
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0bd23efa-0604-4b33-bd5b-0a49cf07de97

📥 Commits

Reviewing files that changed from the base of the PR and between 042d654 and 39488c6.

📒 Files selected for processing (1)
  • .github/workflows/main-estate-audit.yml

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath hyperpolymath changed the title fix(ci): merge the duplicated permissions: block in main-estate-audit.yml fix(ci): post-triage gate repairs — duplicate permissions: block + shebangless planted control Sep 17, 2026
@hyperpolymath
hyperpolymath merged commit 9bcad0b into main Sep 17, 2026
47 of 50 checks passed
@hyperpolymath
hyperpolymath deleted the ci-dup-permissions-fix branch September 17, 2026 19:29
@sonarqubecloud

Copy link
Copy Markdown

hyperpolymath added a commit that referenced this pull request Sep 17, 2026
…2148) — the half of #110 that never landed (#111)

Lands the half of #110 that didn't reach `main`.

#110 carried two independent fixes; it was squash-merged at 19:29 UTC
while its remote branch still held only commit 1 (the
duplicate-`permissions:` fix, now on `main` at `9bcad0b`). Commit 2 —
this one — was mid-force-push at the time and hit the auto-deleted
branch.

**Defect:** the stage-4 publication-boundary control
`www/tests/controls/bad-deploy/tests/run-all.sh` (from #106) ships the
one-word body `planted` with no shebang. The repo-wide ShellCheck gate
runs at **error severity** and flags SC2148 on it, so **Code Quality has
been red on `main` since #106 landed**.

**Fix:** add `#!/usr/bin/env bash`. The control's violation is its
**path** (a `tests/` subtree inside a staged deploy tree);
`check-publication-boundary.sh:129` never reads its contents.
Re-verified against current `main`: `www/tests/run-all.sh` → 6 checks, 0
failures, "planted bad stage rejected" still prints.

With this merged, the only remaining red gates are the two deliberately
escalated in #110's body: the branch-pinned reusable call in
`main-estate-audit.yml:22` (`@feat/cicd-workflow-call`) tripping the
Workflow Security Linter's SHA-pin check and failing the Central Estate
CI/CD Audit run itself — owner's call once cicd-suite stabilises.

Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com>
hyperpolymath added a commit that referenced this pull request Sep 17, 2026
…-suite#11 follow-up) (#116)

Second half of the estate-audit startup fix — pairs with
hyperpolymath/cicd-suite#11 (merged 19:58 UTC).

**Why #113 wasn't enough:** the caller pin points at `dbe2b2a`, whose
*content* still carries 26
`hyperpolymath/cicd-suite/actions/*-check@main` refs. With
`sha_pinning_required: true` on both repos, GitHub rejects the whole job
graph at startup — 0 jobs, instant failure — regardless of how correctly
the caller itself is pinned. cicd-suite#11 pinned all 26 refs at the
callee; this PR makes the caller actually reference that fixed content
(`7689b04`, cicd-suite main head).

**Built-in witness:** this workflow has `on: pull_request` — opening
this PR fires the reusable. If the PR check creates a real job (instead
of another 0-job `startup_failure`), the startup era is over; whatever
the 26 checks then report is the audit's genuine signal (some step-level
failures are expected — the suite has 22 in its history while it
stabilises — but that's information replacing mystery).

One line changed; YAML re-parsed; single `permissions:` block preserved
(#110's fix untouched).

Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com>
hyperpolymath added a commit that referenced this pull request Sep 17, 2026
…-up) — transitive graph fully pinned (#124)

Third and final repin — completes the chain that ends the estate-audit
`startup_failure` era (ongoing since **Sep 13**, commit `f28a32e`).

**Why #116 wasn't the end:** the caller pin `7689b04` had the
workflow-level refs pinned (cicd-suite#11), but the startup rejection
was **transitive** — GitHub validates the full action graph at run
creation once refs are remote-style, and `manifest-check`'s composite
internals still carried two `@main` cross-repo refs
(`deed-ecosystem/validate-action`, `k9-ecosystem/validate-action`). With
`sha_pinning_required: true` on both repos, the whole run was rejected
before a single job existed — the 0-job, 0-annotation signature.
cicd-suite#12 (merged 20:38 UTC) pinned those two; this bump makes the
caller reference a **fully pinned graph** (`53fd9e0`).

**Built-in witness:** opening this PR fires the reusable via `on:
pull_request`. If the check creates a real job, the audit's 26 gates
report genuine signal for the first time in five days — whatever they
then say (some step-level failures are plausible; the suite has 22 in
its history while it stabilises) is information replacing mystery.

One line changed; YAML re-parsed; single `permissions:` block intact
(#110); pin comment records the full provenance (3/3).

Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com>
hyperpolymath added a commit that referenced this pull request Sep 17, 2026
…tool-normalized lock order

cicd-suite#14 merged (main 98f405a): the callee is native-lockfile-
compliant ($/actions/* refs, checkout@v7.0.1 lock key, deed/k9@main
internals) and its own main push runs are green (audit 35276576603,
self-test 35276576597). The caller's @53fd9e0 pin points at PRE-fix
content, so every rsr estate-audit run since #124 merged has died
0-job on the callee side.

Switch the caller to @main: cross-repo reusable-workflow calls are not
lockfile-pinnable deps (gh actions-lock scoped run on this file:
'All 1 workflow valid', no entry added) — enforcement lives in the
callee's own onboarded lockfile, and cicd-suite main is gated green
on every push. This ends the manual repin treadmill (#110/#116/#124).

Also includes gh actions-lock's normalization of the deed-validate
lockfile key position (sorted order) from #125.
hyperpolymath added a commit that referenced this pull request Sep 17, 2026
…udit caller onto compliant cicd-suite@main (#126)

Two repairs in one, both witnessed on this PR:

**1. dogfood-gate hotfix (commit 1).** #125 was squash-merged at head
`2484338` — seconds before the follow-up fix (`7b04399`) reached the PR.
Main therefore carries a dangling `needs: [a2ml-validate, …]` (the job
was renamed to `deed-validate`) → invalid job graph → main's
dogfood-gate push run
[`35276602266`](https://github.com/hyperpolymath/rsr-template-repo/actions/runs/35276602266)
died **0-job**. This cherry-picks the fix: `needs: [deed-validate, …]` +
scorecard DEED naming (`DEED_STATUS`, presence check scans `.a2ml`
**and** `.deed`).

**2. estate-audit caller → `@main` (commit 2).** cicd-suite#14 merged
(main `98f405a`): the callee is native-lockfile-compliant and **green on
its own main** (audit run
[35276576603](https://github.com/hyperpolymath/cicd-suite/actions/runs/35276576603)
— all 26 gates; self-test
[35276576597](https://github.com/hyperpolymath/cicd-suite/actions/runs/35276576597)).
The caller's `@53fd9e0` pin targets PRE-fix content → every rsr
estate-audit run since #124 died 0-job callee-side. Cross-repo
reusable-workflow calls are not lockfile-pinnable (`gh actions-lock`
scoped run: *"All 1 workflow valid"*, no entry added — enforcement lives
in the callee's own onboarded lockfile, and cicd-suite main is gated
green on every push), so `@main` is both compliant and **the end of the
manual repin treadmill** (#110 → #116 → #124 → done). Lock diff = the
tool normalizing #125's key position into sorted order.

**Witnesses on this PR:** caller run must finally spawn jobs cross-repo;
dogfood-gate must spawn jobs and go green; governance's *Actions
lockfile verify* must stay green.

---------

Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com>
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.

1 participant