Skip to content

chore(runner-policy): move historical contracts to a fixture and retire them - #705

Merged
kyle-sexton merged 2 commits into
mainfrom
chore/retire-test-pinned-contracts
Oct 5, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
chore/retire-test-pinned-contracts

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: Phase 8 step 4 of the org GitHub Actions conventions migration (finish retiring superseded runner-policy contracts).

Summary

After #704, 73 older melodic-software/ci-workflows/* contracts stayed in the live policy.json only because tests read them as historical evidence. This moves them to components/runner-policy/fixtures/historical-contracts.json and points those tests at the fixture, so the live policy admits only the nine v0.36.0 (fb56986) contracts consumers can pin.

Fix

  • policy.json: 73 entries removed by text splice; nothing else changes. Live entries plus the fixture equal the previous policy.json key for key and value for value.
  • runner-policy.test.mjs and repin-policy-lockstep.test.mjs: tests that read those entries now read the fixture (or the live policy merged with it); assertions are unchanged, and tests that state "the policy contains X" also assert the renamed successor is live at fb56986. A new test checks the live policy admits none of the historical contracts.
  • READMEs: the runner-policy and claude-lanes notes point at the fixture; managed-files-guard/README.md now names the fb56986 pin the guard actually uses.

Verification

  • npm run test:runner-policy 297 pass (was 296); test:dependabot-policy 47; repin-policy-lockstep 23; lint:runner-policy and lint:dependabot-automerge-lockstep pass; biome and markdownlint clean.
  • A fresh-context verifier checked the diff: no test deleted, no assertion removed or loosened, fixture deep-equals the removed entries.

Related

🤖 Generated with Claude Code

@kyle-sexton
kyle-sexton enabled auto-merge (squash) October 5, 2026 00:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-05T00:04:47.456447Z 3727879 PR opened
ℹ️ 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.

@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 4m 16s —— View job


Code review complete

  • Gather context (PR diff, changed files)
  • Understand request (run /review:code-review lane)
  • Review policy.json splice correctness
  • Review historical-contracts.json fixture
  • Review test changes (runner-policy.test.mjs, repin-policy-lockstep.test.mjs)
  • Review README updates
  • Post findings

Summary

No correctness findings. I verified the core claim mechanically rather than trusting the PR description: using jq, I confirmed that components/runner-policy/policy.json's pre-PR 82 approvedReusableWorkflowContracts keys split exactly into the 9 keys that remain live and the 73 keys now in fixtures/historical-contracts.json, with no value drift in either direction (merging live + fixture and diffing against the pre-PR file produced byte-identical JSON), and that no top-level policy.json field outside that map changed. No duplicate keys in the fixture, and it carries only the one expected top-level key.

The test adaptations in runner-policy.test.mjs and repin-policy-lockstep.test.mjs are mechanical and consistent: every place that used to read a since-retired contract off BASE_POLICY now reads HISTORICAL_CONTRACTS/HISTORICAL_POLICY, and the new assertLiveSuccessors() helper (added at runner-policy.test.mjs#L95-L103) cross-checks that each historical reusable's renamed successor is still live at fb56986 with routing: "runner-input" — I confirmed those 9 live keys and their routing fields independently via jq, so a mismatch here wouldn't silently pass. New test "the live policy admits none of the historical contracts" is a correct, non-redundant guard against the fixture's entries leaking back into the live set.

The managed-files-guard/README.md edit is a genuine bonus fix, not just a rename: the old text claimed the action pin was 7446b51… (v0.34.0), but the actual pins in managed-files-guard.yml/managed-files-guard-fleet.yml are fb56986… (v0.36.0) — I checked both workflow files and the new README text matches what's actually pinned.

One thing I could not verify myself: the author's claimed 297 pass / 47 pass / 23 pass test-suite counts and the "fresh-context verifier" pass — this sandbox's execution policy blocks running node/npm here, so those results are author-claimed and unverified by me, not independently confirmed. Everything I state above is from static inspection of the diff and the JSON files with jq, not from running the suite.

@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 57s —— View job


Security review

  • Gather context (PR diff, changed files)
  • Check skip gate (security-relevant surface?)
  • Review policy.json / fixture split for data integrity
  • Review test file changes for weakened assertions
  • Check instruction-surface deletions (README/policy changes)
  • Post final findings

No security issues found.

This PR is a data/test refactor against components/runner-policy/policy.json, the live allowlist of approved reusable-workflow contracts (routing, allowedInputs, allowedSecrets, allowedCallerPermissions). That file is the security-relevant artifact here, so I verified the following before clearing it:

  • policy.json changes are deletion-only. git diff origin/main...HEAD -- components/runner-policy/policy.json shows 909 removed lines and 0 added/modified lines — confirmed by diffing the removed block's head and tail against fixtures/historical-contracts.json, which matches verbatim. No live contract's allowedInputs/allowedSecrets/allowedCallerPermissions/routing was altered — only superseded ci-workflows SHAs were dropped from the enforced policy, which narrows the admitted set rather than widening it.
  • The fixture is inert at runtime. fixtures/historical-contracts.json is referenced only from runner-policy.test.mjs and repin-policy-lockstep.test.mjs (confirmed via grep across the repo) — no production code path (the audit() enforcement function, the lockstep script) loads it. There's no risk of a stale/vulnerable historical contract being silently re-admitted through the fixture.
  • Test assertions were not weakened, only re-pointed. Every BASE_POLICY.approvedReusableWorkflowContracts[...] read that moved to HISTORICAL_CONTRACTS[...] keeps the same assert.deepEqual/assert.equal shape; the new assertLiveSuccessors() helper and the added test "the live policy admits none of the historical contracts" (runner-policy.test.mjs) are net-new guardrails, not replacements for removed checks — they add a positive assertion that retired entries are actually gone from the enforced policy.
  • Instruction-surface deletions: The README edits (runner-policy/README.md, managed-files-guard/README.md) only reword prose pointing at the new fixture location/pin and don't drop any standing rule or control. docs/conventions/instruction-exception-register/README.md is not present in this checkout, so the protected-class list could not be consulted directly, but by consequence none of these edits remove an enforced check — they relocate test evidence and update a pin reference.

GitHub Actions workflow hardening (triggers, permissions, pin provenance) is zizmor's lane and out of scope here; nothing in this diff touches .github/workflows anyway.

@kyle-sexton
kyle-sexton merged commit 6ae2daa into main Oct 5, 2026
22 checks passed
@kyle-sexton
kyle-sexton deleted the chore/retire-test-pinned-contracts branch October 5, 2026 00:01
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

claude-security-review has reviewed this pull request through 3727879; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

claude-review has reviewed this pull request through 3727879; a later push is reviewed from there.

kyle-sexton added a commit that referenced this pull request Oct 5, 2026
…tup (#706)

No related issue: part of the rendered-views hosted-medium rollout
across provisioning (#705), standards, claude-code-plugins and dotfiles.

## Summary

Adds `pages-publish`, a generic client that uploads a rendered HTML page
to an operator-configured publishing endpoint, and wires it into the
cloud environment setup and the shared permissions floor. Standards
stays org-agnostic: every operator value comes from a setup-written
config file.

## Fix

- `components/cloud-environment/pages-publish`: `pages-publish <file>
--visibility public|private [--id <id>]` and `--delete <id>`. Bearer PUT
to the configured endpoint; tokens resolved through `vault-exec` and
handed to curl on stdin, never argv. Scans the bytes first (credential
shapes refuse, machine paths and hostnames force private), accepts only
builder-stamped pages under the temp dir, retries once on the private
host on `409 private-required`, drops `--id` when visibility changes.
- Config is read only from `<passwd home>/.config/pages-publish/config`
(mode 0600, owned by the user), never from run-time env, so a
repository's settings `env` cannot redirect the token.
- `setup.sh`: installs `pages-publish` beside `vault-exec` (fails loudly
on a foreign binary), writes its config and
`~/.claude/rendered-views.md` from cloud environment variables after the
repo bootstrap step.
- `claude-permissions.json`: `Bash(pages-publish *)`.
- CI registers the new test.

## Verification

- Worker-reported: `bash harness/shell/run-tests.sh
components/cloud-environment/pages-publish.test.sh
components/cloud-environment/setup.test.sh` exit 0; `bash
components/claude-permissions/claude-permissions.test.sh` exit 0;
`distribution/sync-manifest.test.sh` and `sync-manifest.sh validate`
pass. Tests cover a hostile HOME/XDG_CONFIG_HOME config and assert no
token value reaches curl's argv. CI on this PR is the independent run.

## Related

- melodic-software/provisioning#705 (the Worker route this client
calls).
- Follow-up candidate: reconcile the scan's path shapes with
`components/path-detection/machine-path-patterns.sh`.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit that referenced this pull request Oct 7, 2026
#730)

No related issue: retires superseded contracts after the v0.38.2 fleet
repin

## Summary

Every consumer outside claude-code-plugins now pins ci-workflows v0.38.2
(`cf316d1`), so the live runner policy drops the contracts of the three
releases before it. Under the approved policy (standards#704, #705),
`policy.json` holds only the current release's contracts; the historical
entries the tests read already live in
`components/runner-policy/fixtures/historical-contracts.json`.

## Fix

- `components/runner-policy/policy.json`: removed the 9
reusable-workflow keys at each of `fb56986` (v0.36.0), `95732fd`
(v0.38.0) and `2531d56` (v0.38.1). The keys were spliced out as text, so
every other entry is byte-identical (diff is 363 deletions, no
additions).
- `components/runner-policy/runner-policy.test.mjs`:
`LIVE_CI_WORKFLOWS_SHA` now names
`cf316d12b4a14fbdb96a339b7ad00ce935a8cad4`.
- `components/runner-policy/README.md`: records the retirement and drops
the "stays until every consumer repins" clause from the v0.38.0 note.
The v0.38.1/v0.38.2 review notes citing `2531d56` stay as history.
- `components/managed-files-guard/README.md`: the "today" action pin now
names `cf316d1` (v0.38.2), which both guard callers already carry. The
`2531d56` mention in `components/pr-convention-policy/README.md` is
admission evidence and stays.

## Verification

Key counts in `approvedReusableWorkflowContracts`, before → after:
`fb56986` 9 → 0, `95732fd` 9 → 0, `2531d56` 9 → 0, `cf316d1` 9 → 9 (36 →
9 total).

- `npm run test:runner-policy`: 47 pass, 0 fail
- `npm run lint:runner-policy`: Runner policy passed
- `npm run lint:dependabot-automerge-lockstep`: PUBLISHER_ALLOWLIST at
cf316d1 matches policy.json
- `npm run test:dependabot-policy`: 297 pass, 0 fail
- `npx --yes @biomejs/biome check components/runner-policy/policy.json`:
clean
- `npm run lint:md`: 0 issues in 126 files
- `gh search code --owner melodic-software <sha>` for each retired SHA,
with each workflow hit re-read from its default branch: every `2531d56`
workflow hit is a stale index entry (0 live occurrences). Remaining hits
are `.github/standards/**` synced policy copies, this component, and
claude-code-plugins, which still pins `fb56986` on main until
claude-code-plugins#6447 merges.

## Related

- standards#704, standards#705 (live policy holds only the current
release; historical contracts move to the fixture)
- standards#716
- claude-code-plugins#6447 must merge first: claude-code-plugins main
still pins `fb56986`

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

Co-authored-by: Claude Opus 5.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