Skip to content

fix(ci): SHA-pin manifest-check internals + SHA lock keys — completes #15 for sha_pinning_required - #16

Merged
hyperpolymath merged 1 commit into
mainfrom
sha-internals-fix
Sep 17, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
sha-internals-fix

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Completes #15 (merged at 60e82dc, one commit before this fix existed — its main push run 35278143051 failed at the Manifest Validation Gate for exactly the reason this PR removes).

sha_pinning_required: true on this repo rejects deed/k9 validate-action@main branch refs once the audit workflow is de-onboarded (no lockfile coverage): "The actions … are not allowed" at Prepare all required actions (run 35278067796, step 5 — the job DID spawn, proving the ./+de-onboarded form works structurally).

  • actions/manifest-check/action.yml: both validate-action refs → full SHA pins (f9d999b… / 2155aa2… — the same commits the lockfile recorded for @main; deed/k9 heads unmoved)
  • actions.lock: adds SHA-keyed dependency entries for both (rsr's lockfile carries the same tag/SHA-key coexistence precedent: upload-artifact, codeql-action), switches the onboarded code-hygiene-self-test.yml entry's list to the SHA keys (it exercises the same composite via $/actions/manifest-check), prunes the orphaned @main keys
  • audit workflow stays de-onboarded (gh actions-lock --no-fix: "1 workflow skipped", rc=0)

Witness: this PR's audit run — all 26 gates must go green; self-test must stay green on the SHA keys (it triggers on actions/manifest-check/**).

…g_required)

Witness 1 of the ./+de-onboarded form spawned the job (first 0-job-era
job on non-$/ content) but the Manifest Validation Gate died at
'Prepare all required actions': repo setting sha_pinning_required=true
rejects deed/k9 @main branch refs that have no lockfile coverage
(run 35278067796 step 5). SHA-pin both validate-action refs in-file
(f9d999b/2155aa2 = locked commits = current heads) and record
SHA-keyed dependency entries in actions.lock so the ONBOARDED
code-hygiene-self-test.yml path ($/actions/manifest-check) still
resolves them — rsr's lockfile carries the same tag-key/SHA-key
coexistence precedent (upload-artifact, codeql-action). Orphaned
@main keys pruned; audit entry stays removed (de-onboarded).
gh actions-lock --no-fix: clean ('1 workflow skipped').
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 8 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: 6b9547d0-204a-4df4-9e80-5bec0c17acb7

📥 Commits

Reviewing files that changed from the base of the PR and between 947fa66 and 16d4bab.

⛔ Files ignored due to path filters (1)
  • .github/workflows/actions.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/main-estate-audit.yml
  • actions/manifest-check/action.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.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit ecd0240 into main Sep 17, 2026
7 checks passed
@hyperpolymath
hyperpolymath deleted the sha-internals-fix branch September 17, 2026 21:58
hyperpolymath added a commit that referenced this pull request Sep 17, 2026
…el lock key (the form that works locally AND cross-repo) (#17)

**The final ref form — completes the empirical matrix, written by the
official tool itself.**

| callee ref form | local | cross-repo `workflow_call` |
|---|---|---|
| `$/actions/*` (onboarded) | ✅ green (98f405a, #14) | ❌ 0-job — `$/`
resolves at the running commit = **caller's**
([35277504987](https://github.com/hyperpolymath/rsr-template-repo/actions/runs/35277504987))
|
| `./actions/*` + lock entry | ❌ 0-job — "local path actions not
supported" (#13) | — |
| `./actions/*` de-onboarded (#15/#16) | ✅ green (ecd0240) | ⚠️ jobs
spawn (first ever!) but `./` resolves against the **caller's repo**
([35279718644](https://github.com/hyperpolymath/rsr-template-repo/actions/runs/35279718644):
*"Can't find action.yml under
…/rsr-template-repo/actions/required-files-check"*) |
| **remote-form `hyperpolymath/cicd-suite/actions/*@main` + repo-level
lock key (this PR)** | witness below | **witness below — resolves by API
from cicd-suite regardless of caller context** |

`gh actions-lock` (fix mode) wrote the canonical coverage itself:
repo-level key `hyperpolymath/cicd-suite@main` → locked commit
`ecd0240d` (subpaths covered — the `codeql-action`/`deed-ecosystem`
precedent), **plus transitive `deed@f9d999b`/`k9@2155aa2` SHA keys
recorded under it via `uses:`** ("Transitive dependencies (from
composite actions)"). `--no-fix`: clean; the workflow is re-onboarded
(full lockfile enforcement restored, unlike #15's de-onboarded gap).

The bare `actions/[email protected]` fetches the **calling** repo
cross-repo → the 26 gates audit the caller's estate — the Central Estate
Audit design intent. Trade-off vs the `$/` era (disclosed in-file): gate
*implementations* come from `cicd-suite@main`'s locked commit, not the
running revision; changes under `actions/**` remain covered by the
onboarded `code-hygiene-self-test.yml` (`$/` form).

**Witnesses:** (1) this PR's local audit run — all 26 gates green,
onboarded+enforced; (2) rsr#129 repinned to this head — the cross-repo
gates must run against rsr-template-repo's own content (any red there is
a genuine audit finding about the template, not a mechanism failure).
After merge: #129 repins to the merged head — final.

Co-authored-by: hyperpolymath <[email protected]>
hyperpolymath added a commit that referenced this pull request Sep 22, 2026
…#34)

Closes #33.

## What was broken

`Gate controls` has been dead since `3b4afaf` (#28), dying in `Set up
job` with **1 step and no gate ever executed**. Measured on run
`35786094563` (push, main, `fa71ac2`):

```
##[error]lockfile missing pin for hyperpolymath/deed-ecosystem@f9d999b
Gate controls: failure (1 steps)
```

## Mechanism

`uses: $/actions/manifest-check` is a same-repo ref — inherently pinned
at the running commit, no lockfile entry of its own required. But the
runner **also validates that composite's internals against the lock**,
and it does so against the *calling workflow's* entry in the
`workflows:` map. `manifest-check` reaches `deed-ecosystem` and
`k9-ecosystem` at full SHA, so both must appear under
`code-hygiene-self-test.yml`. Being present in `dependencies:` is **not
sufficient** — the map is keyed per workflow.

## Why it stayed invisible

| commit | effect |
|---|---|
| `ecd0240` (#16) | added both transitive SHA refs |
| #17, #18, #25 | survived; `Gate controls` green throughout |
| `3b4afaf` (#28) | regenerated the lock and **silently dropped both** |

`gh actions-lock`'s extractor reads step-level `uses:` only, so it
cannot derive a ref reached *through* a composite — a regenerate deletes
any added by hand. `--verify` then returns rc=0 on the result. #28's
commit message states it *"pins the SHA-form transitive deps reached via
called reusables"* while its diff removes exactly those, and that rc=0
was its cited proof. `gh actions-lock --no-fix` **still** prints
`Scanning 4 workflows`, rc=0, against the broken file today.

**The tool cannot see the defect it creates.** So the lockfile needs a
gate that is not the tool.

## Three fixes, because the defect had three parts

1. **Restore the two pins** — byte-for-byte the shape that was green at
`d6bc01a`, keeping the two `[]` keys #28 correctly added.

2. **`tests/lock-transitive-closure.sh`** — walks each onboarded
workflow's `$/` composites to a fixpoint and asserts every remote ref
reached is declared for that workflow, and that every declared ref
resolves in `dependencies:`. Reads YAML with `yq`, never `grep` (Rule
Y-1).

3. **`actions.lock` added to both `paths:` filters.** #28 was a
lock-only commit; no filter matched, so this workflow never ran on the
commit that broke it.

The guard runs in **`Composite shell contract`**, not `Gate controls`: a
missing composite-reached pin kills `Gate controls` in `Set up job`, so
a check living there could never report the very defect it tests for.

## Non-vacuity

Asserted, not assumed. The checked population must be non-empty — and
that assertion earned its place on this file's **first run**, catching a
jq-vs-mikefarah dialect bug where `--arg` failed as a lexer error and a
stray `2>/dev/null` turned it into a clean empty pass.

| mutant | expected | actual |
|---|---|---|
| the real broken lock at `fa71ac2` | red, naming both refs | ✅ `PASS=3
FAIL=2` |
| green-era lock at `d6bc01a` | green | ✅ `rc=0` |
| declared ref with no `dependencies:` entry | red | ✅ caught |

Local: `lock-transitive-closure.sh` **PASS=7 FAIL=0**;
`composite-shell-contract.sh` **PASS=7 FAIL=0** with its mutant killed.

## The witness

This PR's own run is the evidence. **`Gate controls` must spawn more
than 1 step** and actually execute the gate controls — 1 step means it
died in prepare again.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01WRvDivYwLSeVCJUrfjic3f

Co-authored-by: Claude Opus 5 <[email protected]>
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