Repository navigation
Conversation
Covers the two workflows that carry register-only changes to main without cutting a release, before either exists. 21 assertions, all red. The invariants chosen are the ones whose failure modes are silent or catastrophic rather than merely wrong: - The guard must ALWAYS report. A job-level `if` yields a skipped job, and were the guard ever promoted to a required status check, a skipped job on a release PR would leave that PR waiting on a check that never arrives. "Skip" has to mean "ran and passed", so the label scoping belongs on the steps, not the job. - The guard must NEVER write. main carries dismiss_stale_reviews_on_push, so a guard that pushed would discard the very approval the lane exists to enable. - The gates must be LABEL-scoped, not diff-scoped. A release PR legitimately changes CHANGELOG.md, .vig-os and often .vulnixignore via the dev merge, so a guard keyed on the diff would fail every release. - The opener must author the PR as the App. main requires one approving review, GitHub forbids authors approving their own PRs, and no App holds bypass on main -- so a human-authored PR there is unapprovable by the only human there is. Every release PR to main is App-authored for exactly this reason. Gate C is asserted to run the real vulnix-gate rather than inspect the diff, because the register is not append-only: a pin advance on dev clears exceptions that main's older closure still needs, so the lane cannot reason about whether a removal is safe and must read the exit code instead. Refs: #1676
…main main and dev each scan their own closure against their own .vulnixignore, so a register amendment on dev left main's nightly lane red until the next release train. The lag is structural, not occasional: the register moved 32 times in the 90 days to 2026-09-24 (~one per 3 days) against a roughly weekly release cadence, so main's lane was stale more often than current -- and a permanently-red security lane is the one failure mode a gate cannot afford, because it teaches the maintainer to ignore it. Cutting a patch release was the wrong tool. .vulnixignore is not an image input: the image bakes ./docs/MIGRATION.md, ./.vig-os and assets/workspace/, the register is in none of them, and it is not a scaffold asset -- so the artifact would be identical but for the version string, while devkit-upgrade opened a no-op adoption PR in every consumer repo. The gap never blocked releasing either, since release.yml's gate scans the release branch cut from dev. Two workflows. scan-config-sync.yml opens the PR as the release App; scan-config-guard.yml proves it safe. The App authorship is the crux, not ceremony: main requires one approving review, GitHub forbids authors approving their own PRs, and main's only bypass actor is OrganizationAdmin -- no App holds bypass, and promote-release.yml merges with a plain `gh pr merge --merge`. A human-authored PR to main is therefore unapprovable by the only human there is, which is why every release PR into main is already App-authored. Everything else stays manual: which commits are cherry-picked, when the lane runs, the merge. The lane is ADDITIVE-ONLY because the register is not append-only. A pin advance on dev CLEARS exceptions (6 of those 32 commits) and dev's pin advances first, so there is always a window where dev has correctly deleted an exception that main's older, still-vulnerable closure depends on. Mirroring the file would strand that finding. Gate C therefore does not reason about whether a removal is safe -- it runs the real gate against main's real closure and reads the exit code, so a stranding deletion is unmergeable rather than merely discouraged. Gates: A path allowlist, B derivation identity (equal .drv paths prove the artifact cannot differ, which keeps A a cheap fast-fail rather than the whole safety case), C main-goes-green, D expiry hygiene, E register delta as a comment, F release-train interlock, G main's Unreleased still empty. Gate C reuses the newest nightly artifact when it scanned main's current head, falling back to a rebuild. Two shape rules are load-bearing and covered by the tests: the guard job carries no job-level `if` (a skipped job would, if the guard were ever made a required check, leave release PRs waiting forever on a check that never reports), and the gates are label-scoped rather than diff-scoped (a release PR legitimately touches CHANGELOG.md, .vig-os AND .vulnixignore). The guard also never writes, since main sets dismiss_stale_reviews_on_push and a push would discard the approval the lane depends on. The lane's label goes in .github/label-taxonomy.local.toml rather than the shared taxonomy: the shared file syncs into assets/workspace/ and would scatter the label across consumers that have none of this machinery. 21 shape assertions green; full suite 1120 passed, unchanged. Refs: #1676
12 of 13 tasks
Contributor
Author
|
Superseded by #1678. This version baked #1678 generalises it: the contract is now derivation identity ( The scan-register safety check survives there as a content-triggered extra rather than the lane's purpose. |
c-vigo
added a commit
that referenced
this pull request
Sep 24, 2026
…lease (#1678) ## Description Implements the release-neutral lane from #1676: **merge to `main` without cutting a release**, admitted only when a machine proof shows no published artifact changes. `main` can only be written by a release — `prepare-release` and `prepare-hotfix` are the only lanes, and both cut a tag, publish a GHCR image and trigger `devkit-upgrade` adoption PRs across every consumer repo. But plenty of changes belong on `main` while altering **nothing a consumer receives**: devkit's own `.github/workflows/**` (not the scaffolded copy under `assets/workspace/`), `tests/**`, most of `docs/**`, the scan-time registers. Two cases motivated it: 1. A `workflow_dispatch` workflow must exist on the **default branch** to be dispatchable at all — so a new workflow cannot reach `main` without a release or an admin bypass. 2. `main` and `dev` each scan their own closure against their own `.vulnixignore`, so an amendment on `dev` leaves `main`'s nightly lane red until the next train (32 register commits in 90 days vs a weekly cadence). > Supersedes #1677, which solved only case 2 and baked "scan config" into the lane's identity. This generalises it: scan registers are now just one thing the lane carries. ## Type of Change - [x] `feat` -- New feature ### Modifiers - [ ] Breaking change (`!`) ## Changes Made **`release-neutral-open.yml`** — opens the PR **as the release App**. Not ceremony. `main` requires one approving review, GitHub forbids authors approving their own PRs, and `main`'s only bypass actor is `OrganizationAdmin` — no App holds bypass, and `promote-release.yml` merges with a plain `gh pr merge --merge`. So a human-authored PR to `main` is **unapprovable by the only human there is**, which is exactly why every release PR into `main` is already App-authored (#1672, #1648, #1620). Nothing else is automated: which commits get carried, when the lane runs, and the merge all stay manual. **`release-neutral-guard.yml`** — proves release-neutrality. | Gate | Proves | |------|--------| | **1** | No release content (`CHANGELOG.md`, its mirror, `.vig-os`) in the diff | | **2** | `devShells.default`, `devkitImage`, `devkitImageEnv` `.drv` paths **identical** to `main`'s | | **3** | Consumer scaffold under `assets/` byte-identical | | **4** | `main`'s `## Unreleased` still empty | | **5** | No `release/*` train in flight | | **6** | Verdict comment listing the files carried | **Gate 2 is the contract.** Equal derivation paths mean the published artifacts *cannot* differ, whatever the diff touched — a proof, not an argument about which files happen to be inputs. It is deliberately **not** a path allowlist: an allowlist encodes a guess about what is published and would need extending for every new kind of release-neutral change. It compares `devShells.default` as well as the image because a `direnv`/`bare` consumer never pulls the image — it evaluates the dev shell straight from the flake — so an image-only check would wave through a change that alters every such consumer's toolchain. **Content-triggered extra.** When the diff touches `.vulnixignore`, the guard also replays `main`'s own nightly gate and requires exit 0. Not part of the contract — it exists because the register is not append-only: a pin advance on `dev` *clears* exceptions and `dev`'s pin advances first, so there is always a window where `dev` has correctly deleted an exception `main`'s older closure still needs. **Docs** go to `docs/RELEASE_CYCLE.md`, beside the hotfix lane (its sibling concept). `docs/CONTAINER_SECURITY.md` carries only a pointer plus the two register-specific notes — the procedure has one home. **Label** lives in `.github/label-taxonomy.local.toml` (new), not the shared taxonomy: the shared file syncs into `assets/workspace/` and would scatter this label across consumers that have none of this machinery. Verified it does *not* appear under `assets/workspace/` after `sync-manifest`. ## Changelog Entry See `5ca1764c` — deliberately its own commit (explained under Testing). ``` ### Added - **Release-neutral lane: change `main` without cutting a release** ([#1676](#1676)) - `main` could only be written by a release, so a change that alters nothing a consumer receives — devkit's own `.github/workflows/**`, `tests/**`, most of `docs/**`, the scan-time registers — either waited for the next train or inflated the version for a no-op that handed every consumer an adoption PR - `release-neutral-open.yml` opens the PR **as the release App** (`main` requires one approving review and GitHub forbids authors approving their own PRs, so a human-authored PR there is unapprovable), and `release-neutral-guard.yml` proves the change is release-neutral - The contract is **derivation identity**: `devShells.default`, `devkitImage` and `devkitImageEnv` `.drv` paths must equal `main`'s, which proves the published artifacts cannot differ whatever the diff touched. It covers `direnv`/`bare` consumers too, who never pull the image - Also gated: no release content in the diff, the `assets/` scaffold untouched, `main`'s `## Unreleased` still empty, and no release train in flight. A verdict comment lists the files carried - A changelog entry makes a change **non**-release-neutral (it is mirrored into the scaffold and baked into the image), so keep changelog edits in their own commit to leave the rest cherry-pickable - When a lane PR touches `.vulnixignore` the guard additionally replays `main`'s own nightly gate, since a pin advance on `dev` clears exceptions that `main`'s older closure may still need ``` ## Testing - [x] Tests pass locally (`just test`) — 23 new assertions; full suite **1122 passed, 1 skipped** - [x] Manual testing performed (below) ### Manual Testing Details **TDD**, three commits: `b18329f6` (23 assertions, red) → `3669c3b2` (implementation, green) → `5ca1764c` (changelog, separate — see below). **Gate 2 was measured, not assumed.** `nix eval …drvPath` against `main` and against this branch: | Tree | `devShells` | `devkitImage` | `devkitImageEnv` | Verdict | |------|-------------|---------------|------------------|---------| | `main` | `464904d9…` | `d6ikbz96…` | `262sli4a…` | — | | workflows + label + docs + tests | `464904d9…` | `d6ikbz96…` | `262sli4a…` | **admitted** | | the same **plus a `CHANGELOG.md` entry** | `464904d9…` | `ffbgni7c…` | `262sli4a…` | **refused** | Two things follow, and both are load-bearing: 1. **The lane's own implementation is release-neutral by its own contract** — so it can travel by the very lane it adds, once bootstrapped. 2. **A changelog entry makes a change non-neutral.** The changelog is mirrored into `assets/workspace/.devcontainer/CHANGELOG.md` and baked into the image. That is why gate 1 refuses it, why it is barred a second time by gate 4 (an entry on `main` leaves `## Unreleased` non-empty, which `prepare-release` and `prepare-hotfix` refuse to start on), and why the changelog is a **separate commit** here rather than folded into the feature. `RELEASE_CYCLE.md` records this as a runbook rule. `just precommit` green (exit 0) including `actionlint` + `shellcheck` over both workflows. **Not yet exercised end-to-end.** These are shape, lint and eval proofs. The guard has never *run* — `workflow_dispatch` only registers from the default branch, so the first live exercise is the bootstrap. ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly (`RELEASE_CYCLE.md` + pointer; not template-generated) - [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and pasted the entry above) - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Additional Notes **Bootstrap — needs one admin bypass.** The lane cannot deliver itself: `workflow_dispatch` only registers from the default branch. After this merges to `dev`: ```bash git switch -c chore/1676-bootstrap-release-neutral origin/main git cherry-pick b18329f 3669c3b # NOT 5ca1764 (the changelog) git push -u origin HEAD ``` Then open a PR and merge with **`OrganizationAdmin` bypass**, one time only. Both refs then hold identical content so the next release merge is clean, and the lane carries its own future changes from then on. Dropping the changelog commit from that cherry-pick is required, not tidiness — carrying it would leave `main`'s `## Unreleased` non-empty and **break `prepare-release` and `prepare-hotfix`**. **Still unverified, flagged in #1676:** `main` sets `require_extra_approval_for_unattributed_changes: true`. App-authored commits *should* be attributed to the app rather than counting as unattributed, but that is unproven. If it bites, a lane PR would silently demand a second approval that cannot be supplied — worth watching on the first live run. Refs: #1676
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.
Description
Implements the scan-config sync lane designed in #1676: carry register-only changes to
mainwithout cutting a release, gated by machine-checked proofs.mainanddeveach scan their own closure against their own.vulnixignore, so a register amendment ondevleavesmain's nightly lane red until the next release train. The lag is structural — the register moved 32 times in 90 days (~one per 3 days) against a roughly weekly release cadence — and a permanently-red security lane is the one failure mode a gate cannot afford, because it teaches you to ignore it.Cutting a patch release was the wrong tool:
.vulnixignoreis not an image input, so the artifact would be identical but for the version string, whiledevkit-upgradeopened a no-op adoption PR in every consumer repo.Type of Change
feat-- New featureModifiers
!)Changes Made
.github/workflows/scan-config-sync.yml— opens the PR as the release App.This is the crux, not ceremony.
mainrequires one approving review, GitHub forbids authors approving their own PRs, andmain's only bypass actor isOrganizationAdmin— no App holds bypass, andpromote-release.ymlmerges with a plaingh pr merge --merge. So a human-authored PR tomainis unapprovable by the only human there is, which is exactly why every release PR intomainis already App-authored (#1672, #1648, #1620). The lane borrows that one mechanism and nothing else: which commits get cherry-picked, when the lane runs, and the final merge click all stay manual..github/workflows/scan-config-guard.yml— proves the PR is safe..vulnixignore,.trivyignore,.github/dependency-review-allow.txtdevkitImage/devkitImageEnv.drvpaths identical tomain's — the artifact cannot differmain's closure is green under the proposed registerrelease/*in flight — movingmainmid-train dismisses its approvalmain's## Unreleasedstill empty (prepare-release/prepare-hotfixrequire it)Why the lane is additive-only, and why Gate C exists. The register is not append-only: a pin advance on
devclears exceptions (6 of those 32 commits), anddev's pin advances first. So there is always a window wheredevhas correctly deleted an exception thatmain's older, still-vulnerable closure depends on — mirroring the file would strand that finding and turnmainred. Gate C therefore doesn't reason about whether a removal is safe; it runs the real gate againstmain's real closure and reads the exit code, making a stranding deletion unmergeable rather than merely discouraged.Gate B is a proof rather than an argument about which files are image inputs, which is what keeps Gate A a cheap fast-fail instead of carrying the whole safety case.
.github/label-taxonomy.local.toml(new) — the lane's label. It goes in the repo-local extension, not the shared taxonomy: the shared file syncs intoassets/workspace/and would scatter this label across consumers that have none of this machinery. Verified it does not appear underassets/workspace/aftersync-manifest.docs/CONTAINER_SECURITY.md— new "### 6. Scan-config sync lane" defence-layer section.Changelog Entry
Testing
just test) — 21 new assertions; full suite 1120 passed, 1 skipped, unchangedManual Testing Details
TDD, two commits:
afc092ae(21 assertions, all red —PYTEST EXIT: 1) →6f73f652(implementation,21 passed).The tests pin the invariants whose failure modes are silent or catastrophic rather than merely wrong:
if. A job-level condition yields a skipped job; were the guard ever promoted to a required status check, a skipped job on a release PR would leave that PR waiting forever on a check that never reports. "Inactive" must mean ran and passed.CHANGELOG.md,.vig-osand.vulnixignore(via the dev merge), so a diff-keyed guard would fail every release.mainsetsdismiss_stale_reviews_on_push, so a guard that pushed would discard the very approval the lane depends on. Asserted via job-levelcontents: readplus nogit push/git commit/gh pr mergeanywhere in the job.just precommitgreen (exit 0, 53 hooks) — includingactionlint+shellcheckover both new workflows.Not yet exercised end-to-end. These are shape and lint proofs; the runtime behaviour of gates B and C (nix
drvPathcomparison across two revisions, and the nightly-artifact fast path) has not run in CI, becauseworkflow_dispatchonly registers from the default branch. That is the rehearsal in the next step.Checklist
docs/CONTAINER_SECURITY.md; not template-generated)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Bootstrap, and it needs your admin bypass.
workflow_dispatchonly registers from the default branch, so the opener cannot be dispatched until it exists onmain. After this merges todev:6f73f652onto a branch offmain.OrganizationAdminbypass — one time only.That keeps both refs byte-identical so the next release merge is clean. Worth noting the bootstrap PR itself will trip Gate A if the guard is already on
main(it changes workflows and docs, not registers) — but it won't be labelledscan-config-sync, so the guard stays inactive-and-passing, which is precisely the label-scoping behaviour above.Still unverified, flagged in #1676 and worth watching during the rehearsal:
mainsetsrequire_extra_approval_for_unattributed_changes: true. App-authored commits should be attributed to the app rather than counting as unattributed, but that has not been proven. If it bites, a sync PR would silently demand a second approval that cannot be supplied.Refs: #1676