Repository navigation
chore: sync dev with main - #1683
Merged
Merged
Conversation
Covers the two workflows that merge release-neutral changes to main
without cutting a release, before either exists. 23 assertions, all red.
The contract under test is gate 2, derivation identity: equal .drv paths
mean the published artifacts CANNOT differ, whatever the diff touched.
That 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, where a derivation comparison simply holds.
Gate 2 is asserted to cover devShells as well as the image, because a
direnv/bare consumer never pulls the image: it evaluates devShells.default
from the flake, so an image-only comparison would wave through a change
that alters every such consumer's toolchain.
Measured against main at 2026-09-24, the gates discriminate:
workflows + tests + docs/CONTAINER_SECURITY.md
-> devkitImage d6ikbz96... == main's d6ikbz96... ADMITTED
the same tree plus a CHANGELOG.md entry
-> devkitImage ffbgni7c... != main's d6ikbz96... REFUSED
That second line is why CHANGELOG.md is treated as release content and
gate 1 refuses it: the changelog is mirrored into
assets/workspace/.devcontainer/CHANGELOG.md, which is baked into the
image. It is also why a lane PR must never carry a changelog edit for a
second, independent reason -- a changelog entry reaching main would leave
## Unreleased non-empty, and both prepare-release and prepare-hotfix
refuse to start on that.
The remaining invariants are the ones whose failure modes are silent or
catastrophic rather than merely wrong: 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); the
gates are label-scoped rather than diff-scoped (a release PR legitimately
changes CHANGELOG.md, .vig-os and the scaffold); the guard never writes
(main sets dismiss_stale_reviews_on_push, so a push would discard the
approval the lane depends on); and the opener mints an App token, because
main requires one approving review, GitHub forbids authors approving
their own PRs, and no App holds bypass -- so a human-authored PR to main
is unapprovable by the only human there is.
Refs: #1676
…lease
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. 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. For those a release republishes a functionally identical
artifact and hands every consumer a pin bump that changes nothing they
run.
Two cases motivated it. 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. And main/dev each scan their
own closure against their own .vulnixignore, so a register amendment on
dev leaves main's nightly lane red until the next train -- 32 register
commits in the 90 days to 2026-09-24 against a roughly weekly cadence.
THE CONTRACT IS GATE 2, derivation identity. Equal .drv paths mean the
published artifacts CANNOT differ, whatever the diff touched: a proof
rather than an argument about which files happen to be inputs, and
deliberately not a path allowlist, which would encode a guess about what
is published and 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.
The gates discriminate, measured against main:
this commit's own content (workflows + label + docs + tests)
devShells 464904d9... == main ADMITTED
devkitImage d6ikbz96... == main
devkitImageEnv 262sli4a... == main
the same tree plus a CHANGELOG.md entry
devkitImage ffbgni7c... != main REFUSED
so the lane is proven release-neutral against its own contract by its own
content. The second line is why gate 1 refuses CHANGELOG.md: the
changelog is mirrored into assets/workspace/.devcontainer/CHANGELOG.md
and baked into the image. It is barred for a second, independent reason
too -- reaching main it would leave ## Unreleased non-empty, which
prepare-release and prepare-hotfix both refuse to start on (gate 4). The
changelog entry for this feature therefore lands in its own follow-up
commit, which is what keeps this one cherry-pickable to main.
The opener exists to author the PR as the App, and that is 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 why every release PR into main is
already App-authored. Nothing else is automated: which commits get
carried, when the lane runs and the final merge all stay manual.
The scan-register safety check survives as a CONTENT-TRIGGERED extra
rather than the lane's identity: when the diff touches .vulnixignore the
guard replays main's own nightly gate and requires exit 0, because the
register is not append-only and a deletion correct on dev can strand a
finding on main's older closure.
Docs go to RELEASE_CYCLE.md beside the hotfix lane, its sibling concept,
with CONTAINER_SECURITY.md carrying only a pointer plus the two
register-specific notes -- the procedure has one home.
The label lives in .github/label-taxonomy.local.toml, not the shared
taxonomy: the shared file syncs into assets/workspace/ and would scatter
the label across consumers that have none of this machinery.
23 shape assertions green.
Refs: #1676
Deliberately a SEPARATE commit from the lane itself, not an oversight. A changelog entry is mirrored into assets/workspace/.devcontainer/CHANGELOG.md and baked into the image, so it changes devkitImage's derivation: the lane's own gate 2 measures d6ikbz96 (== main) for the implementation commit and ffbgni7c (!= main) once this entry is added. Folding the two together would therefore make the implementation non-release-neutral and unable to travel by the very lane it adds. It is barred from main for a second, independent reason: an entry under ## Unreleased on main would leave that section non-empty, and both prepare-release and prepare-hotfix refuse to start on that. So the changelog rides dev only, ships with the next real release, and the two commits below it stay cherry-pickable to main. RELEASE_CYCLE.md states this as a runbook rule for every future use of the lane. Refs: #1676
The lane forbids changelog edits (gates 1 and 4), which raised a fair question: a security exception ought to be recorded, so does the lane drop that record? It does not, but only because of an ordering rule the runbook had left implicit. Two things are being conflated: - The substantive record of a risk acceptance is the .vulnixignore block itself -- dated triage, CVSS, provenance, reachability, lever, expiry. The lane puts that on main IMMEDIATELY, sooner than a release would. - The CHANGELOG entry is the release note. It stays on dev and ships with the next train, which is correct Keep-a-Changelog semantics: the changelog describes releases, and a release-neutral change is in none. So the entry is deferred, not skipped -- PROVIDED the change was authored on dev. If someone instead authors it on a main-based branch, which this lane makes newly convenient, there is no dev commit and the entry has nowhere to live: main cannot hold one. The release note is then lost outright rather than deferred. That is a real hazard the lane introduces and the runbook did not name. The convention is worth protecting: 10 of the last 12 .vulnixignore commits carried a changelog entry. Adds the ordering rule to RELEASE_CYCLE.md (in the Execute block and as the leading runbook rule), mirrors it in CONTAINER_SECURITY.md's pointer, and has the guard say it in its verdict comment -- with an extra note when the diff touches .vulnixignore, the case where the convention is strongest. A reminder, not a gate: the guard cannot prove a dev commit exists, and claiming to check what it cannot check would be worse than saying so plainly. The accompanying test asserts on the phrases "changelog entry" and "next release" inside the verdict STEP rather than the job body. Two weaker versions passed vacuously first: bare "changelog" matches the gate table's CHANGELOG.md, and bare "dev" matches devShells. Refs: #1676
The lane as written cannot carry its own changelog entry. CHANGELOG.md is mirrored by a pre-commit hook into assets/workspace/.devcontainer/CHANGELOG.md, which is baked into the image, so a release note alone moves devkitImage's derivation and gate 2 refuses it. Measured on this branch: raw tree d5gf56y0, changelog reverted to main's d6ikbz96 == main. Under the old rule every change carrying a note would need an --admin bypass, which is the thing the lane exists to avoid. The project decision supersedes #590's invariant: main MAY carry changes that have landed but are not yet shipped, and ## Unreleased describes them. sync-main-to-dev.yml triggers on push to main, so the entry reaches dev by itself and the next train freezes it normally. RED first. Six assertions fail against the current workflow: - gate 1 must stop naming either changelog copy (it keeps .vig-os, which carries DEVKIT_VERSION -- changing that IS releasing) - gate 2 must revert both copies to the base's BEFORE the first drvPath eval, and restore the head tree afterwards so the verdict's file list still reports what is really being carried - the Unreleased-emptiness gate must be gone rather than renumbered - the verdict must report changelog drift explicitly, conditioned on the diff, and say the comparison was normalized -- otherwise a release note rides through invisibly and a reviewer cannot tell a workflow-only carry from one that writes main's Unreleased section The gate-1 assertions read the gate-1 STEP, not the job body: gate 2 and the verdict both name the changelog for legitimate reasons, so a body-wide assertion would pass vacuously. Refs: #1676
Gate 2 compared raw trees, so any change carrying a release note was refused: CHANGELOG.md is mirrored into assets/workspace/.devcontainer/CHANGELOG.md and baked into the image. Measured on this branch -- raw devkitImage d5gf56y0 vs main's d6ikbz96 -- the lane could not even carry itself. Gate 2 now reverts both copies to the base's before evaluating the head side, then restores them. Both sides hold identical changelog text, so a surviving difference is genuinely non-changelog. It needs no commit because `nix eval .#...` on a dirty git tree evaluates the WORKING TREE. Verified locally on this branch: normalized, all three derivations equal main's (464904d9 / d6ikbz96 / 262sli4a); un-normalized, devkitImage d5gf56y0 differs. Gate 1 stops refusing the changelog and its mirror. It keeps .vig-os, which carries DEVKIT_VERSION -- writing a version is the one edit no proof can make release-neutral. Gate 4 is DELETED, not renumbered. It asserted main's ## Unreleased was empty, true by construction under #590. That invariant is superseded: main may carry changes that have landed but are not yet shipped, and ## Unreleased is where they are described. sync-main-to-dev.yml fires on push to main, so the entry reaches dev by itself and the next train freezes it normally. (prepare-hotfix still refuses a non-empty section -- phase 1 of this issue, a separate change and not this guard's business.) The verdict reports the drift instead, conditioned on the diff, and shows the entry inline: normalization means a release note now passes the contract silently, and silence would leave a reviewer unable to tell a workflows-only carry from one that rewrites main's Unreleased section. Also fixes a real bug the verdict rewrite exposed. The verdict opened with `git checkout -q -` to undo the vulnix extra's checkout, but that extra exits early when the diff leaves .vulnixignore alone -- the common case -- and `-` then resolved to gate 2's base checkout, making `git diff origin/main...HEAD` empty and the "files carried" list blank. Each step now restores the head tree itself and the verdict does no checkout at all. Refs: #1676
The runbook still described the model the guard enforced yesterday: no changelog on a lane PR, main's ## Unreleased empty at all times, and dev-first authoring as an ordering RULE whose stated justification was "main cannot hold a changelog entry". That justification is now false. - Demotes dev-first authoring to a preference. Cherry-picking from dev still keeps the two refs converged commit-for-commit, but it is no longer the only route that preserves a release note: sync-main-to-dev.yml triggers on push to main, so whichever ref gets the change first, the other follows. - Gate table: gate 1 refuses .vig-os only, gate 2 says the comparison is normalized, gate 4 is struck with the numbering hole left in place so the older discussion still reads. - Adds "The comparison is normalized", which explains why a raw comparison would refuse nearly every change (the changelog is mirrored into the scaffold and baked into the image), and updates the discriminate table with the measured pair: raw d5gf56y0 != main, normalized d6ikbz96 == main. The changelog is the only thing normalized away, and the verdict names the drift. - Adds "main may carry unshipped changes", recording #590's invariant as superseded and the two objections that were checked and dropped. - Corrects a claim inherited from the design: prepare-release never inspects main's ## Unreleased. It runs on dev and requires DEV's section to have content. Only prepare-hotfix reads main's, and that precondition is still enforced as written -- flagged at the hotfix runbook too, since "always true by construction" no longer holds. CONTAINER_SECURITY's register pointer gets the same correction: carry the changelog entry with the register instead of leaving it behind on dev. Refs: #1676
The entry described the lane as refusing changelog edits and asserting main's ## Unreleased was empty. Both were true when it was written and neither is now. Notably this commit is itself the thing it documents: under the old rule it could not have travelled to main by the lane it describes, because the mirror into assets/workspace/.devcontainer/CHANGELOG.md is an image input. With the normalized comparison it can. Refs: #1676
The raw hash quoted for "same tree plus a changelog entry" was measured before the entry itself was rewritten, so it no longer reproduces on this branch. Re-measured at the tip: dlsp5xm6. Says so, too: the raw hash is a function of the changelog text and moves with every edit to it, so the durable claim is the pair -- raw differs from main's, normalized equals it -- not either number. Refs: #1676
Phase 3 widened gate 1 to admit CHANGELOG.md and taught gate 2 to normalize it away before comparing derivations -- but left gate 3 refusing `assets/` wholesale. The changelog is mirrored to assets/workspace/.devcontainer/CHANGELOG.md, so gate 3 would have rejected every changelog-carrying PR regardless, silently undoing the entire phase. Caught while classifying the open PRs for retargeting: #1675 and #1678 both touch exactly one path under assets/, and it is that mirror. Gate 3 now excludes the mirror via a pathspec and says why. The exclusion is narrow and safe: the mirror is regenerated from CHANGELOG.md by the sync-manifest hook, never independently authored, so it carries no information gate 1 has not already admitted -- and gate 2 still compares the real derivations either side of it. This is the first defect found in the widened lane, and it is one only running the gates would have surfaced: every shape test passed, because the tests asserted what each gate said about itself rather than whether the gates agreed with each other. The accompanying test pins the agreement rather than the wording. Refs: #1676
…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.
Syncs
devwithmain(sync-main-to-dev workflow).