Skip to content

Guard governance lock pins and verify authoritative SonarCloud receipts - #66

Merged
hyperpolymath merged 1 commit into
mainfrom
arena/f09ba4e8-cicd-suite
Oct 31, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
arena/f09ba4e8-cicd-suite

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Scope

  • Add a representation-only regression guard for the lock pin format that failed governance setup. Keep full lock and transitive closure verification separate.
  • Add an exact-repository/exact-commit verifier of the official SonarCloud app (ID 12526, slug sonarqubecloud); no duplicate scanner or SONAR_TOKEN.
  • Reject missing/pending/skipped/untrusted results, API errors, and newer queued reanalysis rather than accepting stale successes.
  • Add offline fixtures to the existing hosted controls and a specific governance/policy handoff.

Evidence

  • 23 Sonar API-mock cases pass locally; shell syntax and git diff checks pass.
  • Live read-only verification passed for vocarium commit 748cf83de60de9cc9b968d38c187a7330183b2e2, official check 124289772397.
  • Hosted real-yq lock fixtures (12 cases) and all Sonar receipt fixtures passed in controls run 41194500154 (32s), as did the real detector, receipt, supplement and published-pin regressions. Push controls run 41194489886 also passed.
  • All 17 PR checks pass, including CodeQL, official SonarCloud, Semgrep, GitGuardian, secret scans, composite contract and hygiene/audit jobs. CodeRabbit approved exact head 7dcd0bb. GitHub merge state is CLEAN.

Rollout boundaries

No consumer edits/deployments. No required checks disabled or bypassed. Canonical standards main already corrects the lock record; a blind 454-commit repin is not policy-neutral. Publish and test suite main before any consumer pins. Hosted controls and final external checks verified. Ready for owner merge; no merge performed by this session.

…eipt verifier

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 39352f8f-59f6-4530-bd22-66808bd4aaf7
Commits

Reviewing files that changed from the base of the PR and between 7fadedb and 7dcd0bb.

Files selected for processing: 7
  • .github/workflows/secret-scanner-self-test.yml
  • actions/sonarcloud-result-check/action.yml
  • actions/sonarcloud-result-check/check.sh
  • actions/sonarcloud-result-check/test.sh
  • docs/GOVERNANCE-AND-SONAR-REPAIR.adoc
  • scripts/check-lock-pin-contract.sh
  • tests/lock-pin-contract.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Context from checks skipped due to timeout: 7
  • GitHub Check: CodeRabbit
  • GitHub Check: controls
  • GitHub Check: scan / gitleaks
  • GitHub Check: Gate controls
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (actions)
  • GitHub Check: controls
Additional comments: 5
scripts/check-lock-pin-contract.sh: 1

7-32: LGTM!

tests/lock-pin-contract.sh: 1

8-46: LGTM!

.github/workflows/secret-scanner-self-test.yml: 1

27-33: LGTM!

actions/sonarcloud-result-check/action.yml: 1

1-33: LGTM!

actions/sonarcloud-result-check/check.sh: 1

1-68: LGTM!

Summary

Summary by CodeRabbit

  • New Features
    • Added automated verification of official SonarCloud results for a commit, including clear success or failure outcomes.
    • Added checks that detect common problems in dependency lock data.
  • Tests
    • Expanded automated coverage for SonarCloud result verification and dependency lock checks.
  • Documentation
    • Added guidance on check outcomes, polling limits, permissions, and deployment considerations.

The pull request adds a lock-pin contract checker and a composite action that verifies official SonarCloud results for a commit. It adds tests and workflow checks for both, and documentation covering their behavior and limits.

Changes: Governance Checks

Layer / File(s) Summary
Lock-pin representation check
scripts/check-lock-pin-contract.sh, tests/lock-pin-contract.sh, .github/workflows/secret-scanner-self-test.yml
The checker validates supported lock schemas and dependency records. Contract tests cover valid and invalid representations, and the workflow runs those tests.
SonarCloud result verification
actions/sonarcloud-result-check/action.yml, actions/sonarcloud-result-check/check.sh
The composite action passes its inputs and token to a script. The script polls check runs, selects the highest-ID matching official SonarCloud run, and reports its recognised conclusion.
Verifier regression checks and governance guidance
actions/sonarcloud-result-check/test.sh, .github/workflows/secret-scanner-self-test.yml, docs/GOVERNANCE-AND-SONAR-REPAIR.adoc
Mocked API tests cover accepted and rejected results. The workflow checks script syntax, parses the action YAML and runs the tests. The documentation records the checks’ criteria and limits.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as GitHub Actions workflow
  participant Action as SonarCloud composite action
  participant Checker as check.sh
  participant API as GitHub Checks API
  Workflow->>Action: Run result verification
  Action->>Checker: Pass repository, SHA, wait limit and token
  Checker->>API: Poll paginated check runs
  API-->>Checker: Return check-run data
  Checker-->>Action: Return exit status and result
  Action-->>Workflow: Expose run ID and conclusion
Loading

Possibly related issues

  • Issue 63 requests a general readiness evidence checker. This pull request verifies one required check, the official SonarCloud result, but does not implement the general checker.

Possibly related PRs

  • hyperpolymath/cicd-suite#57: This PR changes a theatre gate pin; this pull request adds a checker for the lock-record ref representation rule addressed by that pin change.
Merge Risk: Minimal · up to 7dcd0

This PR adds a lock-pin format check and a SonarCloud result verifier, with mocked tests and documentation. No concrete defect was established. The PR description says a hosted control run is still required before the yq-dependent lock fixtures can be treated as verified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies both main changes: governance lock-pin protection and authoritative SonarCloud receipt verification.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description directly matches the changeset. It covers the lock-pin regression guard, the SonarCloud result verifier, rejection rules, test evidence, and rollout boundaries.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 4 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 31, 2026 10:52
@sonarqubecloud

Copy link
Copy Markdown

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T10:54:11.178204Z 7dcd0bb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hyperpolymath
hyperpolymath merged commit 4404c3c into main Oct 31, 2026
18 checks passed
@hyperpolymath
hyperpolymath deleted the arena/f09ba4e8-cicd-suite branch October 31, 2026 11:00
hyperpolymath added a commit to metadatastician/standards that referenced this pull request Oct 31, 2026
… pins, floating helper checkouts (#1381)

## What this is

A narrowly scoped repair of the **shared governance startup machinery**
in
`metadatastician/standards`, plus the controls that stop each repaired
class
from being recommitted. It does **not** repin any consumer, does **not**
change any lock record, and does **not** adopt the newer policy set.

Design note with evidence, migration and rollback:
`docs/GOVERNANCE-STARTUP-REPAIR.adoc`.

## The measured failure (not a hypothesis)

`metadatastician/svalinn`, pinned to standards `fad242d3`, run

[40108154356](https://github.com/metadatastician/svalinn/actions/runs/40108154356):
**12 governance jobs, one step each — `Set up job` — all failing**, no
policy
step executed. The annotation:

```
Unable to resolve action `actions/checkout@3d3c42e5…`: invalid lockfile pin.
Run `gh actions-lock` to update the lockfile
```

The record at `fad242d3` had `ref: '<the pin's own SHA>'`. The lock
consulted
for a reusable workflow's dependencies is the **defining** repository's,
so no
caller could fix this from its own repository.

**No duplicate fix here.** `main` already records `ref: v7.0.1` with the
matching `sha1-` commit (#1271's nine, #1290's four), and its lock
passes the
new contract with **0 violations**. Nothing in `actions.lock` changes in
this PR.

Consumer census (contract violations at each consumer's pinned standards
commit, plus the observed run):

| consumer | pin | violations | observed |
|---|---|---|---|
| svalinn | `fad242d3` | 11 | 12/12 jobs dead at `Set up job` |
| odraz | `da2c748a` | 13 | `startup_failure`; later runs `failure`,
zero jobs |
| cadastra | `e3b9929c` | 14 | `failure`, zero jobs |
| lintel | `e16a2317` | 5 | zero jobs |
| burble, marid | `01c9b0c9` | 0 | green, 21 jobs with 6–13 steps
(policy executed) |
| **main** | `1725bebd` | 0 | — |

## What was still unguarded, and what changes

1. **No lock-representation control** (#1290 AC3, which nothing
satisfied).
   Adds `scripts/check-lock-pin-contract.sh`, adopted from
`hyperpolymath/cicd-suite#66` — every rule of that guard kept — and
extended
as that PR's own guidance demands: **closure** (`close-lock.sh --check`)
in
the same gate, **commit↔key provenance conjugation**, tag-keyed records
refused, and the caller-side exemption limited to exactly what #1290
states
(this repository — either slug — plus a record carrying a `uses:` list,
plus
`ref` == the key's own SHA). Uninspectable states exit **2**, never 0.
   Wired into the required `uses ⊆ actions.lock` gate.

2. **A stale literal helper pin.** Three steps in
`governance-reusable.yml`
staged helpers from `317101e03b8f` (2026-09-14) while `main` had moved
**194 files** under `scripts/` — including the orphan-pin ancestry probe
(#782) and the KYAML normalisation that ended 14 phantom duplicate
reports.
Repaired to `ref: ${{ job.workflow_sha }}` (the reusable's own commit;
the
same expression the lock gate has used since #1119), with a 40-hex
assertion
per job because GHES resolves it empty and `ref: ''` silently follows
the
   default branch.

3. **Floating helper checkouts.** `changelog-reusable.yml` followed
`ref: main`;
`readme-derive-reusable.yml` and `fork-governance-reusable.yml`
defaulted
their standards source inputs to `main`. All three now default to this
reusable's commit; the readme-derive fetch became a `git fetch` (a SHA
is not
   a branch) and stopped naming the pre-transfer slug.

4. **A guard for the class.** `scripts/check-standards-helper-pins.sh`
admits
only `job.workflow_sha` (optionally behind a documented `inputs.x ||`)
or a
   40-hex commit at every standards checkout, rejects `github.sha` /
`github.workflow_sha` / branches / tags / bare inputs / a missing `ref`,
and with `--compare` applies the path-scoped freshness predicate. Wired
into
Self Test against the PR base, so a helper edit is not deadlocked on its
own
   unborn merge commit.

## Regression evidence

| command | result |
|---|---|
| `scripts/tests/check-lock-pin-contract-test.sh` | **23/23** —
historical raw-SHA rejected, corrected record accepted, exemption and
its boundary, tag-keyed/missing-provenance/commit-mismatch/dangling-edge
rejected, all uninspected states exit 2, **this repo's own lock passes**
|
| `scripts/tests/check-standards-helper-pins-test.sh` | **18/18** —
branch/tag/HEAD/github.sha/github.workflow_sha/bare-input/missing-ref
rejected; `job.workflow_sha` and `inputs.x \|\| job.workflow_sha`
accepted; freshness path-scoped (stale path red, unchanged path green) |
| `scripts/tests/governance-canary-test.sh` | **11/11** — STARTUP clean
with both measured killers caught as negative controls; POLICY executes
the shipped gates on a digest-pinned canary consumer, passing clean and
failing when a defect is seeded |
| `scripts/tests/governance-canary-test.sh fad242d` | **exit 1** — the
canary refuses to certify the commit that broke svalinn |
| `scripts/check-lock-pin-contract.sh` | 0 violations, 2 documented
exemptions |
| `scripts/close-lock.sh --check .github/workflows/actions.lock` |
closed |
| `scripts/check-standards-helper-pins.sh .github/workflows --compare
HEAD` | 34 sites, 0 failures (was: 3 stale literals, 2 floating, 1
unscanned clone) |

**No regression in the existing suite.** All 35 pre-existing tests that
touch
workflows/locks were run on this branch and on `base` in the same
sandbox: the
result lists are **identical**, differing only by the two new passing
tests.
(The three suites that report failures do so identically at base — a
sandbox
without mikefarah `yq`; they are green on the runner.)

**Locks and closure**: no `uses:` ref changed, so no regeneration was
required
and `.github/workflows/actions.lock` is byte-identical to `main`'s.
Coverage
(`.githooks/validate-actions-lock.sh`: 28 SHA-pinned refs among 30 lock
keys),
the contract guard and `close-lock.sh --check` all run in the canary and
in CI.

## Migration (ordered; not compressible)

1. Merge this PR — the merge commit is the first source carrying the
guards.
2. Publish, then test the exact commit: `bash
scripts/tests/governance-canary-test.sh <merge-sha>`.
   Red ⇒ do not repin.
3. Repin each consumer's `governance.yml` to that **40-hex commit** (a
tag or
   branch re-creates the class).
4. Check the consumer's own lock and allowlist admission afterwards;
neither is
   changed here.
5. Re-measure the canary consumers (svalinn/odraz/cadastra/lintel are
startup-dead; burble/marid are the green controls) and record the run
URL.
   One step per job means still-dead startup, not a policy result.
6. Only then consider `75bd5994` — it is **454 commits** ahead, 300
files, and
adds four required contexts (UUID v7/v8, JS runtimes ×2): a reviewed
policy
   upgrade, not a startup repair.

Consumers passing `canon-ref:` / `standards-ref:` with a branch should
change to
a 40-hex commit or drop the input.

## Rollback

Revert the PR. No lock record and no `uses:` ref changed, so a revert
restores
the previous behaviour exactly — including, deliberately, the stale
literals and
the floating checkouts. Per-site rollback is itemised in the design
note; do not
relax a guard's rules to keep it green.

## Coordination / known limits

* **standards#1290** AC3 implemented (comment to follow); AC4 needs the
consumer
  owners and is migration step 5.
* **cicd-suite PR66** guard and guidance adopted and cited; the closure
and
provenance halves that PR explicitly did not claim are added here. A
passing
fixture is not proof of a working consumer job — hence the canary and
the
  publish-before-repin ordering.
* **Hypatia / gitbot-fleet / cyo**: asks recorded in the design note.
The
lock-sync automation must preserve reviewed tag refs and composite
closure
rather than rewriting refs to raw SHAs, and must not edit a failing
guard.
* Not covered, stated plainly: remote reachability, tag movement,
allowlist
admission, policy validity, and `git clone …standards.git` inside a
`run:`
  body (a review question, not a silent pass).
* **No signing key is available in this environment**, so these commits
are
  unsigned — flagged for the merge/re-sign step rather than hidden.

Fixes the startup half of #1290. Refs #1271, #1281, #946, #1119, #963.#

---------

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Arena Agent <agent@arena.ai>
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