Skip to content

chore: release 1.15.0 - #1644

Merged
vig-os-release-app[bot] merged 58 commits into
mainfrom
release/1.15.0
Sep 17, 2026
Merged

vig-os-release-app[bot] merged 58 commits into
mainfrom
release/1.15.0

Conversation

@vig-os-release-app

@vig-os-release-app vig-os-release-app Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Release 1.15.0 - 2026-09-17

This PR prepares release 1.15.0 for merge to main.

1.15.0 - 2026-09-17

Added

  • DEVKIT_REFS_OPTIONAL_TYPES: exempt a named set of commit types from the
    Refs: requirement
    (#1633)

    • New .vig-os key — a comma-separated (whitespace-tolerant) FULL
      REPLACEMENT list of the commit types whose Refs: line is optional. It
      generalizes DEVKIT_REFS_POLICY, whose "some types exempt" case was
      hardcoded to the literal chore, so a repo that adds a custom type via
      DEVKIT_COMMIT_TYPES can now exempt exactly that type instead of
      exempting every type or none
    • Resolved identically by all three renderers — the scaffolded
      .pre-commit-config.yaml, the flake-generated consumer hook
      (mkProjectShell's new refsOptionalTypes argument, read from the
      manifest by the scaffolded flake.nix), and CI's resolve-toolchain
      refs-optional-types output — so local and CI cannot disagree
    • Entries must be lowercase alphanumerics AND a subset of the resolved
      DEVKIT_COMMIT_TYPES; the scaffold and mkProjectShell refuse loudly,
      and CI warns and clamps to the NARROWEST exemption rather than failing
      the job — an invalid exemption list must never relax the Refs gate. The
      narrower key WINS over DEVKIT_REFS_POLICY (the scaffold prints a
      notice when both are set); DEVKIT_REFS_POLICY=required still means
      "exempt nothing"
    • Backward compatible: an absent or blank key resolves to chore, a
      byte-identical render for devkit and every existing consumer
  • Hotfix release lane: cut release/X.Y.Z from main without going through
    dev
    (#1621)

    • New prepare-hotfix.yml workflow (just prepare-hotfix X.Y.Z): validates
      that the version is the next patch of the latest stable tag on main and
      that no other release/* train is in flight, forks the release branch at
      main's head, seeds an empty ## [X.Y.Z] - TBD section on the branch
      (never main, never dev), re-syncs the workspace mirror through the
      existing prepare-release-extension.yml hook and opens the draft PR to
      main. Rollback deletes the partial branch and nothing else. The fix
      lands via a bugfix/N-* PR into the release branch; candidate, final,
      promote and abandon run unchanged
    • prepare-changelog seed X.Y.Z inserts the empty section under an empty
      Unreleased and refuses anything else; prepare-changelog validate --version X.Y.Z checks the pending section carries content, and
      release.yml now gates on it so a seeded-but-unfilled section cannot
      ship. That gate reaches hotfix trains only once it has shipped through a
      normal train, since release.yml runs from main's copy for a hotfix
    • Accepted cost: the post-promote sync-main-to-dev PR conflicts on
      CHANGELOG.md whenever dev is ahead; the resolution recipe and the
      runbook rules live in docs/RELEASE_CYCLE.md (Hotfix lane). The
      assets/workspace/ port ships in the same release
      (#1625)
  • prepare-release refuses while another release branch is in flight
    (#1627)

    • The validate job of prepare-release.yml (devkit and scaffold copies,
      trunk render included) now fails, listing the offenders, when any other
      release/* branch exists on the remote: the symmetric counterpart of the
      hotfix lane's refusal, so a regular train can no longer be cut over a
      hotfix and later reintroduce the regression or walk :latest backwards.
      Promote or abandon the other train first
  • promote-release refuses to move :latest backwards
    (#1626)

    • Devkit's promote-release.yml validate job now compares the version
      against the highest published final GitHub Release (the version :latest
      follows) and fails before the irreversible publish when it is lower.
      No override: abandon the stale train and re-cut the fix as the next
      patch of the published line
    • The scaffold copy carries the same guard for the opt-in git floating
      tags, active only when DEVKIT_FLOATING_TAGS is set; release tags are
      compared after the tag prefix is stripped, and consumers without
      floating tags keep the freedom to publish a patch for an older line
  • Hotfix release lane in the consumer scaffold
    (#1625)

    • assets/workspace/.github/workflows/prepare-hotfix.yml (Phase 2 of
      #1621): the same lane in the scaffold dialect — every job runs
      on the mode-aware devkit toolchain (resolve-toolchain +
      setup-devkit-toolchain, no uv run), the latest-tag lookup and the
      collision check honour DEVKIT_TAG_PREFIX, and every checkout drops its
      git credential. just prepare-hotfix X.Y.Z now reaches consumers too
    • Gitflow only: copy-excluded under DEVKIT_WORKFLOW=trunk and pruned on a
      gitflow → trunk upgrade exactly like sync-main-to-dev.yml (the two now
      share one TRUNK_EXCLUDED_WORKFLOWS list in init-workspace.sh), with
      the recipe dropped from the trunk justfile.gh; part of the release
      feature group
    • The scaffold release-core.yml now gates on prepare-changelog validate --version (content, not just the ## [X.Y.Z] - TBD heading), so a
      seeded-but-unfilled hotfix section cannot ship downstream
    • zizmor.yml baselines the managed basename for github-app,
      secrets-inherit and unpinned-images only; consumer runbook in
      docs/DOWNSTREAM_RELEASE.md (Hotfix lane)

Fixed

  • Switching trunk back to gitflow restores the dev-branch guard
    (#1642)
    • render_workflow_model applied the gitflow -> trunk retarget one way. For
      every managed file it touches that is harmless — the template overwrite
      restores the gitflow shape on the next upgrade — but .pre-commit-config.yaml
      is preserved, so a consumer switching back kept the trunk edits and lost the
      (?!dev$) clause: no-commit-to-branch silently stopped blocking direct
      commits to dev on a repo whose manifest said gitflow
    • The dev clause now renders from the resolved model in BOTH directions, in a
      new render_branch_guard_model that runs for either model and goes through
      the precommit_render_target resolver. Each direction's anchors stop
      matching once applied, so a re-run is a no-op and a default gitflow scaffold
      stays byte-identical to the template
    • Flake-hooks consumers were never affected: their guard comes from
      mkProjectShell, which reads DEVKIT_WORKFLOW at eval time and was already
      correct in both directions
  • Clearing a scaffold knob now restores the default render
    (#1640)
    • .pre-commit-config.yaml is preserved across upgrades, so it accumulates
      past renders. render_commit_types, render_branch_types and
      render_refs_policy early-returned on an empty manifest key, which meant
      "don't touch it" rather than "restore the default": a consumer who set
      DEVKIT_COMMIT_TYPES, DEVKIT_BRANCH_TYPES, DEVKIT_REFS_OPTIONAL_TYPES
      or DEVKIT_REFS_POLICY and later CLEARED it kept the previous render
      locally while CI, which re-derives from .vig-os on every run, resolved
      the default — the local hook and validate-commit-range then disagreed.
      The scaffold-drift gate could not catch it either: it re-runs the scaffold
      and hits the same early return, so the stale file reproduces identically
    • All three renders are now unconditional and idempotent, writing the
      resolved value every run. An unset knob rewrites exactly what the template
      already ships, so a default scaffold stays byte-identical
    • render_branch_types gained a generic anchor. It was anchored on the
      literal stock alternation, which by construction stops matching once a
      custom set has been rendered, so the stock set could never be restored
    • New precommit_render_target helper refuses a symlinked
      .pre-commit-config.yaml for every in-place render, render_workflow_model
      included. A flake-hooks consumer's config is a /nix/store symlink that
      [[ -f ]] accepts and sed -i would replace with a regular file, shadowing
      the generated config with a frozen copy. Skipping costs that consumer
      nothing: their knobs reach the hook through mkProjectShell, which reads
      the same keys at eval time

Security

  • Except the libxml2 2.15.4 advisory batch in the vulnix register
    (#1636)
    • The 2026-09-16 nightly went red on both refs from a feed event, not a
      closure change: 8 CVEs added against libxml2 2.15.3 and nothing removed,
      on the same pin the previous night's green scan ran on. Only
      CVE-2026-86140 crosses the gate's 7.0 threshold and takes an entry; the
      other seven score 2.9-6.9 and are deliberately left out
    • The defect is a strcat stack overflow in xmlSnprintfElements, reachable
      only while formatting a validity error for a DTD-validated document, and
      scored local-vector by both NVD (8.0) and the NIST analyst (7.8). libxml2
      is a transitive dependency here and nothing validates untrusted XML
      against a DTD
  • Re-date the curl + openssl exception block off the 2026-09-23 cliff
    (#1634)
    • All 16 entries were re-verified against the 2026-09-16 scan and remain
      live findings, so none was deletable. The block moves to 2026-10-21
      because its remediation lever did not arrive on the schedule the original
      note assumed: curl 8.22.0, openssl 3.6.4 and libxml2 2.15.4 all ride the
      same still-open staging-next-26.05 iteration, whose merge cadence
      projects past the 2026-09-21 pin advance
    • Holding the original date would most likely have lapsed the block on
      09-24, and check-expirations runs in ci.yml as well as the nightly
      lanes, so a lapse takes every open PR red. All three blocks now share one
      exit condition and should be deleted together on the advance that ships
      the fixed versions

commit-action-bot Bot and others added 30 commits September 14, 2026 07:48
Cover seed_changelog(): an empty [X.Y.Z] - TBD section under an empty
Unreleased (main's shape), refusal of a non-empty Unreleased, of an
existing version section and of bad input, plus CLI end-to-end.

Refs: #1621
…from main

seed inserts an empty ## [X.Y.Z] - TBD section under an empty
## Unreleased -- the shape of main's changelog (#590) -- so a hotfix
release branch carries the heading the fix PR fills. A non-empty
Unreleased or an existing version section is refused, not folded in.

Refs: #1621
Cover validate_version_section() and the --version mode of the validate
command: a filled [X.Y.Z] - TBD section passes, a seeded-but-empty
section, a missing heading or an already-dated heading fails, and the
Unreleased section is ignored in this mode.

Refs: #1621
…ontent guard

validate --version X.Y.Z checks that the pending ## [X.Y.Z] - TBD
section exists and carries bullets, ignoring Unreleased. release.yml
uses it so a hotfix branch seeded with an empty section cannot ship
before the fix PR fills it.

Refs: #1621
Add tests/test_workflow_prepare_hotfix.py for prepare-hotfix.yml: no
job reads or writes dev, the branch is cut from main, dry-run gates
every mutating job, validate enforces patch-of-latest-main-tag and
refuses a concurrent release/* train, the seed commit lands on the
release branch and its SHA feeds the extension hook, the draft PR
targets main, rollback only deletes the partial branch, release.yml
refuses an empty pending section, and the operator recipe does not
leak into the consumer scaffold. The hotfix lane joins the extension
hook's caller contract in test_workflow_prepare_extension.py.

Refs: #1621
Cut release/X.Y.Z directly from main so an urgent fix ships as a
patch release without carrying whatever dev has accumulated. Validate
enforces MAJOR.MINOR.(PATCH+1) of the latest stable tag on main and
refuses while any other release/* train is in flight; prepare forks
the branch at main's head and seeds an empty [X.Y.Z] - TBD section on
the branch (never main, never dev); the existing
prepare-release-extension.yml hook re-syncs the workspace mirror; the
draft PR targets main; rollback deletes the partial branch and
nothing else. Candidate/final/promote/abandon run unchanged.

Refs: #1621
…lishing

release.yml's validate job only grepped for the ## [X.Y.Z] - TBD
heading. A hotfix branch is seeded with an empty section that the fix
PR must fill, so gate on prepare-changelog validate --version instead.

Refs: #1621
just prepare-hotfix X.Y.Z dispatches prepare-hotfix.yml (default ref
dev, matching prepare-release). justfile.gh is manifest-synced into the
workspace scaffold, so a RemoveBlock transform strips the recipe until
the scaffold port of the lane ships.

Refs: #1621
Add the hotfix lane to RELEASE_CYCLE.md: branch hierarchy and table,
when to use it, the validate preconditions, what prepare-hotfix.yml
does, the fix-PR contract, the sync-main-to-dev CHANGELOG conflict
recipe, the runbook rules, the rehearsal procedure and the consumer
scaffold status; document the seed subcommand and validate --version;
list just prepare-hotfix (recipe tables regenerated).

Refs: #1621
Syncs `dev` with `main` (sync-main-to-dev workflow).
## Description

Adds the gitflow hotfix lane (Phase 1, devkit-only): a new
`prepare-hotfix.yml` workflow cuts `release/X.Y.Z` directly from `main`,
so an urgent fix (typically a security-register incident, cf. #1592 /
#1614) ships as a patch release without carrying whatever `dev` has
accumulated. The fix lands via a `bugfix/N-*` PR into the release
branch; the existing candidate/final/promote/abandon train and
`sync-main-to-dev` run **unchanged**.

Decisions on the issue's open questions, as posted in the
[implementation
plan](#1621 (comment)):
version policy is machine-enforced (patch+1 of the latest stable tag on
`main`); a hotfix is hard-refused while any other `release/*` train is
in flight; `:latest` ordering stays a runbook rule; the post-promote
sync conflict on `CHANGELOG.md` is accepted and documented; the scaffold
port (copy-excluded under trunk) is a follow-up issue.

## Type of Change

- [x] `feat` -- New feature
- [ ] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task (deps, config, etc.)
- [ ] `refactor` -- Code restructuring (no behavior change)
- [ ] `test` -- Adding or updating tests
- [ ] `ci` -- CI/CD pipeline changes
- [ ] `build` -- Build system or dependency changes
- [ ] `revert` -- Reverts a previous commit
- [ ] `style` -- Code style (formatting, whitespace)

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

- `.github/workflows/prepare-hotfix.yml` (new) — validate (semver,
patch-of-latest-main-tag, no other `release/*` branch, no colliding
branch/tag, empty Unreleased on `main`), prepare (re-check `main`
unmoved, cut branch at `main`'s SHA via the Git Data API,
`prepare-changelog seed`, commit to the release branch via
`commit-action`, assert the branch head is the seed commit), extension
(reuses `prepare-release-extension.yml` with the seed commit as
`branch_sha`), open-pr (draft PR to `main`, bare checkout), rollback
(`always()`, deletes the partial branch only). No job reads or writes
`dev`; every checkout sets `persist-credentials: false`.
- `.github/workflows/release.yml` — the validate job's "Verify CHANGELOG
has TBD entry" step now runs `prepare-changelog validate --version`
(content required, not just the heading). Note: for a hotfix
`release.yml` runs from `main`'s copy, so this guard reaches hotfix
trains only after it ships through a normal train.
- `packages/vig-utils/src/vig_utils/prepare_changelog.py` — new `seed
VERSION [FILE]` subcommand (empty `[VERSION] - TBD` under an empty
Unreleased; refuses a non-empty Unreleased or an existing section) and
`validate --version X.Y.Z` (pending section must carry bullets).
- `packages/vig-utils/tests/test_prepare_changelog.py` —
`TestSeedChangelog`, `TestValidateVersionSection`, `--version` cases in
`TestCmdValidate`, subprocess e2e cases.
- `tests/test_workflow_prepare_hotfix.py` (new) — shape pins for the
lane (no dev access, branch cut from main, dry-run gating, validate
policy markers, seed commit target and `branch_sha` hand-off, draft PR
to main, rollback scope, the `release.yml` guard, and the scaffold leak
guard); `tests/test_workflow_prepare_extension.py` — the hotfix lane
joins `CALLER_WORKFLOWS` so the branch → extension → PR DAG and
rollback/cancellation contracts apply to it.
- `justfile.gh` — `just prepare-hotfix X.Y.Z [ref] [flags]` (default ref
`dev`); `scripts/manifest.toml` — `RemoveBlock` transform strips it from
the scaffolded `justfile.gh` until the Phase 2 port; `justfile` —
process comment; `README.md` / `CONTRIBUTING.md` — regenerated recipe
tables.
- `docs/RELEASE_CYCLE.md` — branch hierarchy/table, new "Hotfix lane"
section (preconditions, workflow steps, fix-PR contract, sync-conflict
recipe, runbook rules, rehearsal, scaffold status), `seed` / `validate
--version` docs, recipe list, two troubleshooting entries.
- `CHANGELOG.md` (+ mirror) — Unreleased entry.

## Changelog Entry

### Added

- **Hotfix release lane: cut `release/X.Y.Z` from `main` without going
through
  `dev`** ([#1621](#1621))
- New `prepare-hotfix.yml` workflow (`just prepare-hotfix X.Y.Z`):
validates
that the version is the next patch of the latest stable tag on `main`
and
that no other `release/*` train is in flight, forks the release branch
at
`main`'s head, seeds an empty `## [X.Y.Z] - TBD` section on the branch
(never `main`, never `dev`), re-syncs the workspace mirror through the
existing `prepare-release-extension.yml` hook and opens the draft PR to
`main`. Rollback deletes the partial branch and nothing else. The fix
lands via a `bugfix/N-*` PR into the release branch; candidate, final,
    promote and abandon run unchanged
- `prepare-changelog seed X.Y.Z` inserts the empty section under an
empty
    Unreleased and refuses anything else; `prepare-changelog validate
    --version X.Y.Z` checks the pending section carries content, and
`release.yml` now gates on it so a seeded-but-unfilled section cannot
ship. That gate reaches hotfix trains only once it has shipped through a
normal train, since `release.yml` runs from `main`'s copy for a hotfix
  - Accepted cost: the post-promote `sync-main-to-dev` PR conflicts on
`CHANGELOG.md` whenever `dev` is ahead; the resolution recipe and the
runbook rules live in `docs/RELEASE_CYCLE.md` (Hotfix lane). Devkit-only
for now: the `assets/workspace/` port is a follow-up, and the recipe is
    stripped from the scaffolded `justfile.gh` until it lands

## Testing

- [x] Tests pass locally (`just test`)
- [ ] Manual testing performed (describe below)

### Manual Testing Details

- `prek run --all-files`: green.
- `uv run pytest packages/vig-utils/tests`: 575 passed (run with
`PYTHONPATH` unset — the Nix devshell's store build of `vig-utils`
shadows the editable source for the console script; CI rebuilds it from
source).
- `uv run pytest tests -k "workflow or release or scaffold or abandon or
promote or changelog or transforms or manifest"`: 639 passed; the 8
errors are `tests/test_integration.py` cases that need the local
`devcontainer:dev` image, which is not built on this host.
- Layer 1 dry-run dispatches (`gh workflow run prepare-hotfix.yml --ref
feature/1621-hotfix-release-lane -f dry-run=true`) are pending: a
dispatch-only workflow on a non-default branch is not registered by
GitHub until a PR event evaluates it, so they run once this PR is open.
Expected results while `release/1.14.1` is in flight: `1.15.0` refused
(not a patch), `1.14.2` refused (expected `1.14.1`), `1.14.1` refused
(branch exists). The positive case (`1.14.2` after `1.14.1` promotes)
and the Layer 2 candidate-only rehearsal follow after merge, per the
plan.

## 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 (edit
`docs/templates/`, then run `just docs`)
- [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
- [ ] Any dependent changes have been merged and published

## Additional Notes

- Plan and decisions:
#1621 (comment)
- Follow-up issues to file after merge: Phase 2 scaffold port
(copy-exclude under `DEVKIT_WORKFLOW=trunk`, `release` feature group,
drop the `justfile.gh` transform, zizmor baseline entries), a
`promote-release.yml` guard against moving `:latest` backwards, and a
symmetric refusal in `prepare-release.yml` while a hotfix branch exists.
- The Layer 2 rehearsal (`prepare-hotfix 1.14.2` → trivial fix PR → one
`publish-candidate` → `abandon-release`) waits for `release/1.14.1` to
promote and leaves one `1.14.2-rc1` tag here plus one permanent
published pre-release on `devkit-smoke-test`.

Refs: #1621
c-vigo and others added 23 commits September 14, 2026 16:27
Scheduled refresh of the fast-branch pins: nixpkgs-unstable (uv, gh,
claude-code via the fastMovers overlay) and home-manager master (the
ci-hm-unstable eval guard). Full CI on this PR is the merge gate.

Refs: #817, #1589
Scheduled advance of the pinned stable nixpkgs rev - the primary
CVE-remediation lever (docs/CONTAINER_SECURITY.md). Full CI on this PR,
including the closure rebuild, is the merge gate.

After merge, the first nightly security scan produces the findings delta
against the new closure; reconcile the exception registers against that
delta (delete cleared entries) rather than re-dating them.

Refs: #1565
## Description

Adds a semver guard to `promote-release.yml` so a promote can never move
the floating refs backwards. Devkit moves GHCR `:latest`
unconditionally; with the hotfix lane (#1621, #1623) a patch cut from
`main` and a train cut from `dev` could, if both existed, promote in the
wrong order and walk `:latest` back to an older version. The guard is
the last line of defence behind the single-train refusals (#1627): the
`validate` job compares the version against the highest **published
final** GitHub Release — the version the floating refs follow — and
fails before the irreversible publish when it is lower.

Design notes (plan comment on #1626): no
`org.opencontainers.image.version` label exists (the image is built by
Nix; `flake.nix` sets only title/source/licenses) and reading GHCR
metadata needs a `packages` scope the scaffold token lacks, so the
published-final list is the source of truth. No override input; the
recovery is to abandon the stale train and re-cut the fix as the next
patch of the published line.

Stacked on #1630 (#1627): this branch is based on
`feature/1627-prepare-release-single-train` because both PRs rewrite the
same hotfix runbook paragraph. Once #1630 merges, this branch gets
rebased onto `dev` so the diff shrinks to the commits listed below.

## Type of Change

- [x] `feat` -- New feature
- [ ] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task (deps, config, etc.)
- [ ] `refactor` -- Code restructuring (no behavior change)
- [ ] `test` -- Adding or updating tests
- [ ] `ci` -- CI/CD pipeline changes
- [ ] `build` -- Build system or dependency changes
- [ ] `revert` -- Reverts a previous commit
- [ ] `style` -- Code style (formatting, whitespace)

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

- `.github/workflows/promote-release.yml` — new validate step **Verify
version does not move :latest backwards**, after the draft-release
check: pages `repos/{repo}/releases`, keeps `draft == false &&
prerelease == false` bare-semver tags, takes the highest with `sort -V`,
and fails when `VERSION` sorts below it. Passes when no final release
exists yet. A failed API call fails the step (no fail-open).
- `assets/workspace/.github/workflows/promote-release.yml` — the same
step for the opt-in git floating tags, gated on
`needs.resolve-toolchain.outputs.floating-tags != ''`; release tags are
filtered to the `TAG_PREFIX` line and compared after the prefix is
stripped, so pre-devkit bare tags are ignored. Consumers without
floating tags are unaffected.
- `tests/test_promote_release.py` — shape pins for both copies (data
source, filters, `sort -V`, placement after the draft check; devkit
unconditional, scaffold gated and prefix-aware).
- `tests/test_promote_latest_guard.py` (new) — runs the extracted step
body with `gh` stubbed to answer the release listing: lower refused with
the message and remedy, higher passes, numeric (not lexical) ordering,
empty list / drafts-only passes, drafts and pre-releases ignored, prefix
stripped, tags outside the prefix ignored.
- `docs/RELEASE_CYCLE.md` — release-phases step 6, the hotfix runbook
rule (now points at the guard), and a troubleshooting entry for the
refusal. `docs/DOWNSTREAM_RELEASE.md` (+ mirror) — floating-tags note.
`CHANGELOG.md` (+ mirror).

## Changelog Entry

### Added

- **promote-release refuses to move `:latest` backwards**
  ([#1626](#1626))
- Devkit's `promote-release.yml` `validate` job now compares the version
against the highest published final GitHub Release (the version
`:latest`
    follows) and fails before the irreversible publish when it is lower.
    No override: abandon the stale train and re-cut the fix as the next
    patch of the published line
  - The scaffold copy carries the same guard for the opt-in git floating
tags, active only when `DEVKIT_FLOATING_TAGS` is set; release tags are
    compared after the tag prefix is stripped, and consumers without
    floating tags keep the freedom to publish a patch for an older line

## Testing

- [x] Tests pass locally (`just test`)
- [ ] Manual testing performed (describe below)

### Manual Testing Details

- `uv run pytest tests/test_promote_release.py
tests/test_promote_latest_guard.py tests/test_floating_tag_move.py
tests/test_workflow_prepare_extension.py
tests/test_workflow_prepare_hotfix.py
tests/test_release_tombstone_detection.py tests/test_ci_green_gate.py`:
189 passed. The 16 new cases were RED before the workflow change (commit
baf5bdf).
- `prek run --all-files`: green.
- No live promote was run (the next real promote exercises the happy
path: the highest published release is 1.14.1, every regular train is
higher).

## 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 (edit
`docs/templates/`, then run `just docs`)
- [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
- [ ] Any dependent changes have been merged and published

## Additional Notes

Second of three hotfix-lane follow-ups: #1627 (#1630) → #1626 (this PR)
→ #1625 (scaffold port). Merge #1630 first.

Refs: #1626
… register

The nightly vulnix gate went red on both refs on 2026-09-16. This is a feed
event, not a closure change: the 09-15 run (34954313210) was green on the same
pin the 09-16 run (35080687787) failed on, and the findings delta is 8 added /
0 removed against exactly one package, with no expiry fired.

Only CVE-2026-86140 crosses the gate's 7.0 threshold; the other seven CVEs in
the batch score 2.9-6.9 and are deliberately left out of the register. The
defect is a strcat stack overflow in xmlSnprintfElements (valid.c), reachable
only while formatting a validity error for a DTD-validated document, and both
NVD (8.0) and the NIST analyst (7.8) score it local-vector. Nothing in this
image validates untrusted XML against a DTD.

The fix, libxml2 2.15.4, is in staging-26.05 and staging-next-26.05 but not in
release-26.05 or the pinned nixos-26.05, so advancing the pin today changes
nothing. It rides the same open staging-next-26.05 iteration-7 PR
(NixOS/nixpkgs#563094) as curl 8.22.0 and openssl 3.6.4, so all three blocks
should clear in one advance and be deleted together rather than renewed.

The block takes its own Wednesday (2026-10-28) rather than joining the
curl+openssl slot it shares a lever with: co-dating would put 17 entries on one
date and re-create the single-Wednesday cliff the #1553 stagger broke up.

Refs: #1636, #1637
The T-7 expiry warning fired as the grid intends. The review it forced was a
re-verification, not a date bump: all 16 entries were checked against the
2026-09-16 scan (run 35080687787, both lanes) and every one is still a live
finding, since the closure still ships curl 8.21.0 and openssl 3.6.3. Nothing
in the block is dead weight and nothing is deletable yet.

What changed is the estimate of when the remediation lever lands. The block's
2026-09-14 note bet on the 2026-09-21 weekly advance, which assumed
staging-next-26.05 iteration 7 reaching release-26.05 first. It has not:
nixpkgs#563094 opened 2026-09-14 and is still open, and the iteration cadence
(iteration 5 merged 2026-08-18, iteration 6 merged 2026-09-05) projects the
next merge to roughly 09-23 -- after Monday's advance, with the nixos-26.05
channel trailing release-26.05 by about a day on top of that.

Holding 09-23 would therefore most likely have lapsed the block on 09-24, and
check-expirations runs in ci.yml as well as the two nightly lanes, so a lapse
takes every open PR red rather than just the scan lanes. 10-21 clears the
projected landing by four weeks and two further weekly advances, and keeps the
block on its own Wednesday.

Scheduling adjustment only: no risk assessment was re-opened or changed, and
the exit condition stands -- the block dies on the advance that ships curl
8.22.0 and openssl 3.6.4, the same advance that clears the libxml2 block.

Refs: #1634, #1635
…l block (#1638)

Reconciles the vulnix exception register against the 2026-09-16 scan.
Four
issues, two incidents, one reconciliation pass over one file.

## Incident A -- nightly red (#1636 dev / #1637 main)

A feed event, not a closure change. The 09-15 run (`34954313210`) was
green on
the same pin the 09-16 run (`35080687787`) failed on, and the findings
delta is
**8 added / 0 removed against exactly one package**, no expiry fired:
the
libxml2 `CVE-2026-8613x`/`-8614x` batch reached the NVD feed in that
window.

Only `CVE-2026-86140` crosses the gate's 7.0 threshold and takes an
entry. The
other seven score 2.9-6.9 and are deliberately left out, as the glibc
block
already does for its own sub-threshold pair.

The defect is a `strcat` stack overflow in `xmlSnprintfElements`
(`valid.c`),
reachable only while formatting a validity error for a DTD-validated
document.
NVD scores it 8.0 and the NIST analyst 7.8, both **local-vector**.
libxml2 is
transitive here, and nothing in the image validates untrusted XML
against a DTD.

## Incident B -- expiry warning (#1634 main / #1635 dev)

The 2026-09-23 slot is the curl 8.21.0 + openssl 3.6.3 block.
Re-verified
rather than assumed: **all 16 entries are still live findings** against
the
09-16 scan on both refs, so nothing is dead weight and nothing is
deletable.

Re-dated to 2026-10-21. What changed is the estimate of when the lever
lands,
not the assessment -- see below.

## The finding that ties them together

All three packages ride **one** nixpkgs lever:

| package | pinned | fixed in | `release-26.05` | `staging-next-26.05` |
|---|---|---|---|---|
| curl | 8.21.0 | 8.22.0 | ❌ 8.21.0 | ✅ 8.22.0 |
| openssl | 3.6.3 | 3.6.4 | ❌ 3.6.3 | ✅ 3.6.4 |
| libxml2 | 2.15.3 | 2.15.4 | ❌ 2.15.3 | ✅ 2.15.4 |

A single open PR -- `NixOS/nixpkgs#563094`, staging-next-26.05 iteration
7 --
clears all three. Advancing the pin today changes nothing.

**Why the 09-23 block was re-dated instead of left to die on
remediation:** the
block's own note bet on the 2026-09-21 advance, which assumed iteration
7
landing first. It opened 2026-09-14 and is still open; the iteration
cadence
(iter 5 merged 08-18, iter 6 merged 09-05) projects the next merge to
~09-23,
*after* Monday's advance, with the `nixos-26.05` channel trailing
`release-26.05` by about a day on top. Holding 09-23 would most likely
have
lapsed the block on 09-24 -- and `check-expirations` runs in `ci.yml`,
not just
the nightly lanes, so that takes **every open PR** red (the #1547
failure mode).

The new block takes its own Wednesday (10-28) rather than joining the
slot it
shares a lever with: co-dating would put 17 entries on one date and
re-create
the single-Wednesday cliff the #1553 stagger broke up.

Grid after this PR -- one block per Wednesday, all six verified to land
on a
Wednesday:

```
09-30  lower-reachability             (5)
10-07  fzf                            (2)
10-14  glibc                          (6)
10-21  curl 8.21.0 + openssl 3.6.3   (16)   <- moved
10-28  libxml2 CVE-2026-86140         (1)   <- new
2027-06-23  Class-1 shellcheck        (1)
```

All three blocks now share one exit condition and should be **deleted
together**
on the advance that ships the fixed versions -- not renewed.

## Verification

- `vulnix-gate` replayed against both scan artifacts with the edited
register:
  green on both refs (31 exceptions applied).
- `check-expirations`: 31 exceptions validated.
- Every `Expiration:` date confirmed to fall on a Wednesday.
- `just precommit` (full suite, `--all-files`): green.

## Issue closure

`#1635` and `#1636` (dev) close on the replay evidence. **`#1634` and
`#1637`
(main) stay open**: `update-nixpkgs.yml` targets `dev` only and
`prepare-hotfix.yml` is not on `main` yet, so `main`'s register only
moves via a
release train -- the #1592 precedent.

Refs: #1634, #1635, #1636, #1637
## Description

`DEVKIT_REFS_POLICY` decides which commit types may omit the `Refs:`
line, but its
"some types exempt" case is hardcoded to the literal type name `chore`.
A consumer
that adds a custom type via `DEVKIT_COMMIT_TYPES` cannot exempt that
type without
exempting every type — so the two knobs compose badly: you can add the
type, but
not give it the Refs treatment the type was added for.

This adds `DEVKIT_REFS_OPTIONAL_TYPES`, a comma-separated
(whitespace-tolerant)
FULL REPLACEMENT list of the types that may omit `Refs:`, mirroring the
pattern
`DEVKIT_COMMIT_TYPES` and `DEVKIT_BRANCH_TYPES` already establish. The
enum stays
as sugar; the narrower key wins.

Absent or blank resolves to `chore` — byte-identical to today's default
render for
devkit and every existing consumer.

## Type of Change

- [x] `feat` -- New feature

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

The value feeds **three renderers in lockstep** — a consumer cannot
patch this
locally, because CI re-derives the list from the same key:

| Renderer | File |
|---|---|
| Scaffolded `.pre-commit-config.yaml` | `assets/init-workspace.sh` —
new `RESOLVED_REFS_OPTIONAL_TYPES`, resolved next to
`RESOLVED_COMMIT_TYPES` so the subset guard has the approved list;
`render_refs_policy` renders it |
| Flake-generated consumer hook | `nix/hooks.nix`
(`refsOptionalTypesFor`, `consumer`) → `mkProjectShell`'s new
`refsOptionalTypes` argument in `flake.nix` → the `.vig-os` reader in
`assets/workspace/flake.nix` |
| CI's `validate-commit-range` |
`assets/workspace/.github/actions/resolve-toolchain/action.yml` — the
`refs-optional-types` output |

Plus the manifest surface: the key ships bare in
`assets/workspace/.vig-os`, is
read before the template overwrite and written back on upgrade (else an
upgrade
silently resets a consumer's exempt set and their issue-less commit type
starts
failing `commit-checks`).

**Precedence.** `DEVKIT_REFS_OPTIONAL_TYPES` wins over
`DEVKIT_REFS_POLICY`; the
scaffold prints a notice when both are set.
`DEVKIT_REFS_POLICY=required` remains
the way to exempt nothing at all (an empty `--refs-optional-types` reads
as falsy
to `validate-commit-msg` and reverts to its own `{chore}` default, which
is why
`required` still travels as the `none` sentinel).

**Guards.** Entries must be lowercase alphanumerics AND a subset of the
resolved
`DEVKIT_COMMIT_TYPES` — exempting a type the validator would reject
anyway is a
manifest bug. The scaffold aborts loudly and `mkProjectShell` fails
eval; CI warns
rather than failing the job. `hooksModule.defaultCommitTypes` is now
exported so
the flake's subset assert validates against the same list the argv is
built from,
rather than a fourth copy of the stock 11.

Two bugs found in self-review and fixed in `8779f34b`, each with a
regression test
committed first (`59a8490e`):

- **The render must gate on the keys, not the resolved value.**
`.pre-commit-config.yaml` is preserved across upgrades, never
template-overwritten,
so its current arg is whatever the previous render left. Skipping the
`sed` because
the resolved value happened to equal the `chore` default stranded a
consumer
*narrowing* its exempt set with the previous, wider arg locally while CI
resolved
the narrow one — precisely the local/CI divergence this issue exists to
prevent.
- **Fail-safe for an exemption list means the smallest set, not the
stock mapping.**
CI's fallback on an invalid value fell back to the `DEVKIT_REFS_POLICY`
mapping;
under `DEVKIT_REFS_POLICY=optional` that switched the Refs gate off for
every type
because the narrower key had a typo. It now clamps to `chore` unless the
policy is
already narrower (`none`). This is the one place the `#1431`
commit-types analogy
inverts — there the stock list is a subset of any sane custom one, here
it is not.

`docs/COMMIT_MESSAGE_STANDARD.md` is shipped to consumers and said only
`chore` is
exempt; it now carries the same consumer-knob pointer the commit-types
table has.

## Changelog Entry

```md
### Added

- **`DEVKIT_REFS_OPTIONAL_TYPES`: exempt a named set of commit types from the
  `Refs:` requirement** ([#1633](#1633))
  - New `.vig-os` key — a comma-separated (whitespace-tolerant) FULL
    REPLACEMENT list of the commit types whose `Refs:` line is optional. It
    generalizes `DEVKIT_REFS_POLICY`, whose "some types exempt" case was
    hardcoded to the literal `chore`, so a repo that adds a custom type via
    `DEVKIT_COMMIT_TYPES` can now exempt exactly that type instead of
    exempting every type or none
  - Resolved identically by all three renderers — the scaffolded
    `.pre-commit-config.yaml`, the flake-generated consumer hook
    (`mkProjectShell`'s new `refsOptionalTypes` argument, read from the
    manifest by the scaffolded `flake.nix`), and CI's `resolve-toolchain`
    `refs-optional-types` output — so local and CI cannot disagree
  - Entries must be lowercase alphanumerics AND a subset of the resolved
    `DEVKIT_COMMIT_TYPES`; the scaffold and `mkProjectShell` refuse loudly,
    and CI warns and clamps to the NARROWEST exemption rather than failing
    the job — an invalid exemption list must never relax the Refs gate. The
    narrower key WINS over `DEVKIT_REFS_POLICY` (the scaffold prints a
    notice when both are set); `DEVKIT_REFS_POLICY=required` still means
    "exempt nothing"
  - Backward compatible: an absent or blank key resolves to `chore`, a
    byte-identical render for devkit and every existing consumer
```

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

- `tests/test_flake_hooks.py` — 75 passed. Adds a `refsoptionaltypes`
consumer shell
(custom `commitTypes` + `refsPolicy = "required"` +
`refsOptionalTypes`), which
pins both the rendered arg and the precedence in one assertion, plus
three
eval-time refusals (charset, empty list, non-subset) and the
template-reader
  forwarding probe.
- `tests/test_ci_runner.py` — 69 passed. The `resolve-toolchain`
resolution table,
the precedence over each of the three policy values, and the clamp: an
invalid
list under `optional` must resolve to `chore`, under `required` to
`none`, with a
  `::warning::` asserted through `exec_resolve_toolchain`.
- `tests/bats/init-workspace.bats` — the `#1633` and knob suites:
default unchanged,
named set rendered + written back, the narrowing re-render, the
precedence notice,
  and two new loud-refusal rows (bad charset, non-subset).
- Full `pytest` (1064 passed) and `prek run --all-files` (green, no
reformats).
- Two unrelated failures, red on `dev` too:
`test_image.py::test_manifest_files` and
`test_integration.py::test_github_cli_authentication` — both need a
freshly built
local dev image; the former is stale relative to `dev` itself
(`8e7c4916` changed
  `.pymarkdown`).

## 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 (edit
`docs/templates/`, then run `just docs`)
- [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

Two things deliberately left out of scope:

- **Deprecating `DEVKIT_REFS_POLICY`.** The issue allows either; keeping
it as sugar
costs one `case` arm per renderer and breaks no consumer. It also
remains the only
way to say "exempt nothing", since an empty list means `chore` to the
validator.
- **The pre-existing staleness when a consumer *clears* a render key.**
`render_commit_types` and `render_branch_types` gate on "key absent", so
clearing
the key leaves the previous render in the preserved
`.pre-commit-config.yaml`.
This PR matches that behaviour rather than diverging from it; fixing it
properly
means an unconditional `sed` guarded against the flake-hooks store
symlink, across
  all three renders — a separate issue, not a drive-by here.

Refs: #1633
## Description

`.pre-commit-config.yaml` is preserved across upgrades (#878 — the
consumer owns
its hook excludes), so it accumulates past renders. The three knob
renders
early-returned on an empty manifest key, which means *"don't touch it"*,
not
*"restore the default"*. A consumer who set a knob and later **cleared**
it kept
the previous render locally, while CI — which re-derives from `.vig-os`
on every
run with no memory — resolved the default. The local hook and
`validate-commit-range` then disagreed about the same gate.

The scaffold-drift gate (#1295) could not catch it: it re-runs the
scaffold and
`git diff`s, so it hits the same early return, reproduces the stale file
byte-identically, and sees no drift.

## Type of Change

- [x] `fix` -- Bug fix

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

All in `assets/init-workspace.sh`.

**1. The three renders are unconditional and idempotent.**
`render_commit_types`,
`render_branch_types` and `render_refs_policy` now write the resolved
value on
every run. For an unset knob that rewrites exactly what the template
already
ships, so a default scaffold stays byte-identical and the drift baseline
is
untouched; for a cleared knob it restores the default instead of
stranding the
previous render.

**2. `render_branch_types` gained a generic anchor.** It was anchored on
the
literal stock alternation, which by construction stops matching the
moment a
custom set has been rendered — so making it unconditional alone would
not have
fixed it, because the stock set could never be written back. The anchor
is now
the `(?!^(` prefix plus the `)/[0-9]` suffix, which together pin exactly
this one
alternation: the `(chore)/[a-z0-9]` clause has the wrong suffix, and the
`renovate`/`worktree` clauses have no inner group. Verified to
round-trip
byte-identically: stock → custom → stock reproduces the template line
exactly.
With the stock literal gone, the old ordering constraint (this render
had to run
before anything else that rewrites the line) goes with it.

**3. New `precommit_render_target` helper refuses a symlinked config.**
This is
what makes the rest safe. A flake-hooks consumer's
`.pre-commit-config.yaml` is a
gitignored `/nix/store` symlink (#883/#1167). `[[ -f ]]` is true for it,
and GNU
`sed -i` writes a temp file and renames it over the path — replacing the
symlink
with a regular file, which shadows the generated config with a frozen
copy and
silently drops the consumer's `hooks`/`hooksExcludes` customizations.
Making the
renders unconditional multiplies the chances of hitting that, so every
in-place
render of this file now goes through one resolver that refuses both an
absent and
a symlinked target. `render_workflow_model`'s `.pre-commit-config.yaml`
block was
carrying the same latent hazard and now uses it too.

Skipping costs a flake-hooks consumer nothing: their knobs reach the
hook through
`mkProjectShell`, which reads the same `.vig-os` keys at eval time
(#1434).

## Changelog Entry

```md
### Fixed

- **Clearing a scaffold knob now restores the default render**
  ([#1640](#1640))
  - `.pre-commit-config.yaml` is preserved across upgrades, so it accumulates
    past renders. `render_commit_types`, `render_branch_types` and
    `render_refs_policy` early-returned on an empty manifest key, which meant
    "don't touch it" rather than "restore the default": a consumer who set
    `DEVKIT_COMMIT_TYPES`, `DEVKIT_BRANCH_TYPES`, `DEVKIT_REFS_OPTIONAL_TYPES`
    or `DEVKIT_REFS_POLICY` and later CLEARED it kept the previous render
    locally while CI, which re-derives from `.vig-os` on every run, resolved
    the default — the local hook and `validate-commit-range` then disagreed.
    The scaffold-drift gate could not catch it either: it re-runs the scaffold
    and hits the same early return, so the stale file reproduces identically
  - All three renders are now unconditional and idempotent, writing the
    resolved value every run. An unset knob rewrites exactly what the template
    already ships, so a default scaffold stays byte-identical
  - `render_branch_types` gained a generic anchor. It was anchored on the
    literal stock alternation, which by construction stops matching once a
    custom set has been rendered, so the stock set could never be restored
  - New `precommit_render_target` helper refuses a **symlinked**
    `.pre-commit-config.yaml` for every in-place render, `render_workflow_model`
    included. A flake-hooks consumer's config is a `/nix/store` symlink that
    `[[ -f ]]` accepts and `sed -i` would replace with a regular file, shadowing
    the generated config with a frozen copy. Skipping costs that consumer
    nothing: their knobs reach the hook through `mkProjectShell`, which reads
    the same keys at eval time
```

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

Five new bats cases in `tests/bats/init-workspace.bats`, committed
failing first
(`b4963195` — all five red, the symlink one red *after* a successful
upgrade,
i.e. for the right reason):

- clearing `DEVKIT_COMMIT_TYPES` restores the stock 11 `--types`
- clearing `DEVKIT_BRANCH_TYPES` restores the stock alternation (the
case the
  generic anchor exists for)
- clearing `DEVKIT_REFS_OPTIONAL_TYPES` restores `chore`
- clearing `DEVKIT_REFS_POLICY` restores `chore`
- a symlinked `.pre-commit-config.yaml` survives an upgrade with all
three knobs
  set: still a symlink, target byte-identical by sha256

Full runs, all green:

- `bats tests/bats/init-workspace.bats` — 266 passed, 0 failed. Covers
the
surrounding surface this touches: the #1255 flake-hooks fixtures, the
#1282 /
#1431 / #1432 / #1633 knob suites, and the trunk-render composition
tests.
- `pytest` (minus the two image/integration suites that need a freshly
built
  local dev image) — 1071 passed, 1 skipped.
- `prek run --all-files` — green, no reformats.

## 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 (edit
`docs/templates/`, then run `just docs`)
- [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

`render_workflow_model`'s `gitflow → trunk` transform has the same
one-way shape
— switching a consumer back cannot restore the dropped `(?!dev$)` clause
or the
prose substitutions — and is deliberately **not** fixed here. It is a
set of
anchored prose/marker substitutions across many files rather than a
single value
slot, so it needs its own design rather than this pattern. It does get
the
symlink guard, since that hazard is identical.

Refs: #1640
…ways (#1643)

## Description

`render_workflow_model` applies the `gitflow → trunk` retarget one way —
it
early-returns unless the resolved model is `trunk`. For every
**managed** file it
touches that is harmless: the template overwrite restores the gitflow
shape on the
next upgrade and the render simply does not re-run.
`.pre-commit-config.yaml` is
**preserved**, so the trunk edits stayed in it forever.

A consumer switching back to gitflow therefore lost the dev-branch guard
silently:
`no-commit-to-branch` stopped blocking direct commits to `dev`, on a
repo whose
`.vig-os` says `gitflow`. No error, no notice.

Last instance of the class fixed in #1640.

## Type of Change

- [x] `fix` -- Bug fix

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

I scoped this out of #1641 believing it spanned many files and needed
its own
design. That premise was wrong, and measuring it first is what made the
fix small:
every other target self-heals, so the entire stale surface is two lines
of one file.

| Target | Managed / preserved | After a trunk → gitflow round-trip |
|---|---|---|
| `ci.yml`, `codeql.yml`, `sync-issues.yml`, `prepare-release.yml`,
`promote-release.yml` | managed | restored |
| `.github/renovate-default.json` | managed | restored (`["dev"]`) |
| `.devcontainer/justfile.gh` | managed | restored |
| `.claude/skills/branch-naming/SKILL.md` | managed | restored |
| **`.pre-commit-config.yaml`** | **preserved** | **STALE** |

So the `.pre-commit-config.yaml` edits move out of
`render_workflow_model` into a
new `render_branch_guard_model`, which runs for **both** models and
renders the dev
clause *from* the resolved model instead of only subtracting it under
trunk. It
goes through the `precommit_render_target` resolver added in #1640,
keeping the
symlink and absent-file refusals in one place. Each direction's anchors
stop
matching once applied, so a re-run is a no-op and a default gitflow
scaffold stays
byte-identical to the template.

**One trap worth recording, because it silently produced a no-op fix.**
GNU sed
4.10 treats a *mid-pattern* `$` in a basic regular expression as an end
anchor, not
a literal. So the obvious insert pattern

```sed
s|(?!main$)(?!^(chore)|(?!main$)(?!dev$)(?!^(chore)|
```

matches nothing at all — and fails silently, leaving the file untouched.
The
existing `(?!dev$)` strip only works because its `$)` sits at the very
end of the
pattern. Both metacharacters are escaped in the insert pattern for that
reason;
the replacement side needs no escaping, since sed gives `$`/`^` no
meaning there.
The comment in the source records this so the next person does not
rediscover it.

Flake-hooks consumers were never affected: their guard comes from
`mkProjectShell`,
which reads `DEVKIT_WORKFLOW` at eval time (#1224/#1434) and was already
correct in
both directions. It was only the scaffolded YAML that was one-way.

## Changelog Entry

```md
### Fixed

- **Switching `trunk` back to `gitflow` restores the dev-branch guard**
  ([#1642](#1642))
  - `render_workflow_model` applied the `gitflow -> trunk` retarget one way. For
    every managed file it touches that is harmless — the template overwrite
    restores the gitflow shape on the next upgrade — but `.pre-commit-config.yaml`
    is preserved, so a consumer switching back kept the trunk edits and lost the
    `(?!dev$)` clause: `no-commit-to-branch` silently stopped blocking direct
    commits to `dev` on a repo whose manifest said `gitflow`
  - The dev clause now renders from the resolved model in BOTH directions, in a
    new `render_branch_guard_model` that runs for either model and goes through
    the `precommit_render_target` resolver. Each direction's anchors stop
    matching once applied, so a re-run is a no-op and a default gitflow scaffold
    stays byte-identical to the template
  - Flake-hooks consumers were never affected: their guard comes from
    `mkProjectShell`, which reads `DEVKIT_WORKFLOW` at eval time and was already
    correct in both directions
```

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

Four new bats cases, committed first (`5c33a7ca`) with the two
behavioural ones
red:

- trunk → gitflow restores both the `(?!dev$)` clause and its comment
(red)
- the restored file matches the template **byte for byte**, the way a
managed file
  does — this is the assertion that caught the silent no-op sed (red)
- the gitflow render is idempotent: a second upgrade does not
double-insert
  (green before, pins the new code path)
- the render refuses a symlinked config (green before via #1640's
resolver; pins
  that the refactor keeps it)

Full runs, all green:

- `bats tests/bats/init-workspace.bats` — 270 passed, 0 failed.
Deliberately
includes the #1205 workflow-switch suite, the #1255 flake-hooks
fixtures, the
#1282/#1431/#1432/#1633/#1640 knob suites and the trunk-render
composition tests.
- `pytest` (minus the two suites needing a freshly built local image) —
1070
passed, 1 skipped. `tests/test_flake_checks.py` caught a `typos`
violation in a
  source comment on the first run; reworded rather than allowlisted.
- `prek run --all-files` — green, no reformats.

## 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 (edit
`docs/templates/`, then run `just docs`)
- [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

The contradiction guard still refuses a `--workflow` flag that
contradicts the
persisted `DEVKIT_WORKFLOW`; this changes nothing there. The switch path
this fixes
is the guard's own documented step 3 — set `DEVKIT_WORKFLOW` in
`.vig-os` on a
dedicated branch and re-run the upgrade.

Refs: #1642
Move Unreleased content to [1.15.0] - TBD
and create fresh empty Unreleased section for continued development.
Regenerate the synced workspace mirror so
assets/workspace/.devcontainer/CHANGELOG.md matches the frozen root
CHANGELOG.md on the release branch.
@c-vigo
c-vigo marked this pull request as ready for review September 17, 2026 11:37
@c-vigo
c-vigo self-requested a review as a code owner September 17, 2026 11:37
Set release date to 2026-09-17 and regenerate release docs.

Refs: #1644
@vig-os-release-app
vig-os-release-app Bot merged commit 46d4ee5 into main Sep 17, 2026
18 checks passed
@vig-os-release-app
vig-os-release-app Bot deleted the release/1.15.0 branch September 17, 2026 12:24
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