Skip to content

chore: sync dev with main - #958

Merged
vig-os-release-app[bot] merged 14 commits into
devfrom
chore/sync-main-to-dev-14-1
Jul 9, 2026
Merged

vig-os-release-app[bot] merged 14 commits into
devfrom
chore/sync-main-to-dev-14-1

Conversation

@vig-os-release-app

Copy link
Copy Markdown
Contributor

Syncs dev with main (sync-main-to-dev workflow).

c-vigo and others added 14 commits July 8, 2026 17:58
The 2026-06-24 curl advisory batch added 17 HIGH/CRITICAL CVEs against
curl 8.20.0 to the vulnix feed, blocking the 0.5.0-rc1 publish at the
vulnix gate. curl is 8.20.0 in the pinned rev, latest nixos-26.05, and
nixpkgs-unstable, and upstream has no newer release, so there is no
version bump to advance to. Accept the findings as awaiting-upstream
with a short expiry (2026-07-22); drop the block and advance the pin
once a patched curl lands.

Refs: #941
Unblocks the `0.5.0-rc1` publish, which failed at the vulnix CVE gate on
17 HIGH/CRITICAL curl 8.20.0 findings
([run](https://github.com/vig-os/devcontainer/actions/runs/28954286382)).

## Why an exception (not a bump)
curl is `8.20.0` in the pinned rev, latest `nixos-26.05`, and
`nixpkgs-unstable`; upstream curl has no release newer than 8.20.0.
Since vulnix matches by version, there is no bump to advance to — the
only levers are a register exception or holding the release.

## Change
Adds a time-boxed block to `.vulnixignore` (expiry **2026-07-22**,
`awaiting-upstream` rationale) covering the 17 CVEs, per the IEC 62304
exception-register model already used for
openssl/glibc/zlib/libssh2/podman. Also unblocks the red nightly
`security-scan`.

## Verification
- `check-expirations .vulnixignore` → pass (53 exceptions validated)
- `vulnix-gate` against synthetic curl-8.20.0 findings: old register
blocks all 17 (exit 1), new register passes (exit 0, 53 exceptions
applied)
- Full `prek run --all-files` green

## Follow-up
Drop the block and advance the nixpkgs pin once a patched curl lands
(Renovate nix manager should surface it).

Refs: #941
The #python starter declared pytest/pytest-cov as a
[project.optional-dependencies] extra, but the scaffold's managed sync is
groups-only (uv sync --all-groups; extras opt-in). A project scaffolded
from the template and following its README (just sync && just test) thus
could not find pytest. Move them to [dependency-groups].dev so the default
sync installs them and uv run pytest works.

Refs: #944
## Problem
`templates/python/pyproject.toml` declares dev tooling as an extra
(`[project.optional-dependencies].dev`), but the scaffold's managed
`sync` is groups-only by design (`sync *args="--all-groups"`). So a
project scaffolded from `nix flake init -t ...#python` that follows the
template README ("Then `just sync` and `just test`") can't find pytest —
`just test` fails with `Failed to spawn: pytest`. Not caught by CI (no
test inits the template and runs its test flow).

## Fix
Move `pytest`/`pytest-cov` to `[dependency-groups].dev` (PEP 735).
Aligns the template with the scaffold's 'extras are opt-in' contract;
the documented `just sync && just test` flow now works.

## Verification
Scaffolded a copy of the template: `uv sync --all-groups` installs
pytest==9.1.1 / pytest-cov==7.1.0; `uv run pytest` → 1 passed. Full
`prek run --all-files` green.

## Notes
- Template/config change, no test to break (`test_just_test_recipe`
covers only the language-neutral base) — TDD skipped per repo policy for
template/config.
- Independent of the smoke-test fix (devcontainer-smoke-test#206); the
smoke-test does not use the template.

Refs: #944
#920 added packages: read to the reusable release workflows'
(release-core, release-publish) jobs so they can pull the authenticated
GHCR image, but the reusable-workflow-calling jobs (core, publish) in the
scaffold release.yml were not updated to grant it. A reusable workflow
cannot request a permission its calling job did not grant, so a consumer
release run fails with startup_failure. Grant packages: read on both
callers (release-extension requests none; the extension caller inherits
the workflow-level default). Verified: each caller's grant is now a
superset of its callee's requested scopes.

Refs: #947
## Problem
#920 added `packages: read` to the reusable release workflows' jobs
(`release-core` x3, `release-publish` x2) to pull the authenticated GHCR
image, but the reusable-**calling** jobs (`core`, `publish`) in the
scaffold `release.yml` weren't updated to grant it. A reusable workflow
can't request a permission its calling job didn't grant → a consumer
release run fails with `startup_failure`.

Surfaced by the 0.5.0-rc1 smoke-test's downstream release orchestration
(release run startup_failure). Worked in 0.4.1 (no `packages: read`
anywhere). Never caught upstream (the devcontainer repo's own
release.yml is monolithic; the split lives only in the shipped
scaffold). Refs #943.

## Fix
Grant `packages: read` on the `core` and `publish` calling jobs.
Verified each caller's grant is now a superset of its callee's requested
scopes:
- release-core needs {actions:write, contents:write, pull-requests:read,
packages:read} — core now grants all (actions:write was already
present).
- release-publish needs {contents:write, packages:read} — publish now
grants both.
- release-extension needs {contents:read} — extension caller inherits
the workflow-level {contents:read, packages:read}.

`promote-release.yml` audited: it calls no reusables and already sets
`packages: read` where needed — no change.

Refs: #947
The Nix image bakes assets/workspace as symlinks into the nix store, so
the --preview/--force classifier's find -type f matched zero files and the
OVERWRITTEN/ADDED report was always empty. Add bats coverage that seeds a
symlinked TEMPLATE_DIR and asserts a conflicting file lands under
OVERWRITTEN and a workspace-absent one under ADDED.

Refs: #949
On the Nix image the baked template /root/assets/workspace is a tree of
symlinks into the nix store, so the --preview/--force classifier's
find -type f matched zero files and the OVERWRITTEN/ADDED report was always
empty. The real copy uses rsync -avL (follows symlinks), so only the report
was blind. Add -L so the classifier dereferences symlinks and matches the
copy semantics.

Refs: #949
… (#950)

## Problem
On the Nix image the baked template `/root/assets/workspace` is a tree
of **symlinks into the nix store**. The `--preview`/`--force` upgrade
classifier at `assets/init-workspace.sh:534` walked it with `find
"$TEMPLATE_DIR" -type f …`, which matches **zero** files against a
symlink tree (verified: `find -type f` → 0, `find -L -type f` → 1872).
So the OVERWRITTEN / ADDED / PRESERVED report was always empty ("No
existing files would be overwritten").

## Root cause
The real copy uses `rsync -avL`, which **follows symlinks**, so files
were still overwritten — only the *report* was blind. The `DELETED`
section is computed separately and was unaffected. This is the sole
`find` over `$TEMPLATE_DIR`.

## Fix
Make the classifier follow symlinks to match the copy semantics:

```diff
-    done < <(find "$TEMPLATE_DIR" -type f ! -path "*/.git/*" -print0)
+    done < <(find -L "$TEMPLATE_DIR" -type f ! -path "*/.git/*" -print0)
```

## Tests (TDD, red → green)
Added two bats tests in `tests/bats/init-workspace.bats` that seed a
**symlinked** `TEMPLATE_DIR` (mirroring the baked image) and drive
`--preview --force --no-prompts` against a host workspace:
- a symlinked template file whose path already exists in the workspace
must be listed under **OVERWRITTEN**;
- a symlinked, workspace-absent template file must be listed under
**ADDED**.

Both **failed** on the old code (report said "No existing files would be
overwritten" / "No new files would be added") and **pass** with the fix.
Full `init-workspace.bats` suite: 123 passed, 0 failed. Full `prek run
--all-files` hook suite: green (sync-manifest propagated the CHANGELOG
entry to the scaffold copy).

Refs: #949
Closes #949
The #949 fix switched the preview/report classifier to `find -L` so it
follows the Nix image's store-symlink template. But `find -L` also
descends the baked .venv symlink tree, so the ADDED section over-reported
phantom .venv/.../site-packages/* files the real rsync copy never writes.

Mirror the static excludes the real copy applies (.git, .venv,
docs/issues/, docs/pull-requests/) in the report `find` so ADDED matches
what the upgrade actually does.

Refs: #951
#951) (#952)

## Problem

`--preview`/`--force` upgrade report over-reported ~1763 phantom
`.venv/…/site-packages/*` files in the **ADDED** section that the real
upgrade never writes, making the ADDED list unusable. Report-only bug —
no data risk.

## Root cause

The #949 fix switched the report classifier to `find -L`
(`assets/init-workspace.sh:534`) so it follows the Nix image's
store-symlink template — correct for the OVERWRITTEN section. But `find
-L` now also follows the baked template's `.venv` symlink tree. The
report `find` excluded only `.git`, whereas the real rsync copy excludes
more:

```
rsync -avL --delete --exclude='.git' --exclude='.venv' --exclude='docs/issues/' --exclude='docs/pull-requests/' …
```

So every symlinked `.venv` file leaked into ADDED.

## Fix

Mirror the copy's static excludes in the report `find` (single-site
change, line 534):

```sh
done < <(find -L "$TEMPLATE_DIR" -type f \
    ! -path "*/.git/*" ! -path "*/.venv/*" \
    ! -path "*/docs/issues/*" ! -path "*/docs/pull-requests/*" -print0)
```

`.venv` is the one that leaks today; the two `docs/*` excludes are for
parity so future template changes can't leak either.

## Test evidence (TDD)

New bats test `upgrade preview omits the baked .venv symlink tree from
ADDED (#951)` places a symlinked
`.venv/…/site-packages/phantom-venv-pkg.py` (mirroring the image's baked
venv) plus a normal symlinked template file under `TEMPLATE_DIR`, and
asserts the normal file is still in ADDED while the `.venv` file is not.

- **RED** (before fix): `refute_output --partial "phantom-venv-pkg.py"`
failed — the `.venv` file showed in ADDED.
- **GREEN** (after fix): new test passes; the two existing #949
OVERWRITTEN/ADDED tests still pass; full `init-workspace.bats` suite
124/124 green.

Full `prek run --all-files` hook suite green (sync-manifest mirror of
`CHANGELOG.md` re-staged).

Refs: #951
Closes #951
Set release date to 2026-07-09 and regenerate release docs.

Refs: #938
# [Release
0.5.0](https://github.com/vig-os/devcontainer/releases/tag/0.5.0) -
2026-07-09

This PR prepares release 0.5.0 for merge to main.

## [0.5.0](https://github.com/vig-os/devcontainer/releases/tag/0.5.0) -
2026-07-09

### Added

- **Opt-in Python starter flake template**
([#930](#930))
- `nix flake init -t github:vig-os/devcontainer#python` restores a
Python package layout (`pyproject.toml`, `src/`, `tests/`) onto the now
language-neutral scaffold
([#929](#929)). The
template uses a concrete `example_pkg` name the user renames — `nix
flake init -t` does no placeholder substitution — and ships a minimal
pytest dev group (no `science`/`jupyter` extras).

- **Authenticated GHCR pulls for the shipped container CI**
([#920](#920))
- The `resolve-image` action now runs an **authenticated** manifest
probe: it logs in to `ghcr.io` before the probe when given a token (new
optional `registry-token`/`registry-username` inputs) and no longer
swallows the probe's stderr, so failures are classified into actionable
`::error::` annotations that distinguish an auth/denied failure ("set
the `GHCR_PULL_TOKEN` secret / grant `packages: read`") from a genuinely
missing tag. The anonymous path is kept for public images.
- Every shipped container job (`ci.yml`, `prepare-release.yml`,
`promote-release.yml`, `release.yml`, `release-core.yml`,
`release-publish.yml`, `sync-issues.yml`, `sync-main-to-dev.yml`,
`renovate-changelog-build.yml`) gains an opt-in `credentials:` block
(`username: github.actor`, `password: ${{ secrets.GHCR_PULL_TOKEN ||
github.token }}`) and `packages: read`, so a **private** or rate-limited
image pulls without per-repo edits.
- **Public consumers are unaffected:** with `GHCR_PULL_TOKEN` unset the
expression falls back to the automatic `github.token` (never an empty
password), which performs an authenticated pull of a public image
successfully.
- `docs/container-ci-quirks.md` re-framed from a "public-image
limitation" note into first-class authenticated-pull documentation
(secret contract, `github.token` fallback, `packages: read`
requirement). Split out of the workflow audit
([#854](#854)) and rides
the devkit rename cycle
([#781](#781)).

- **Nix-direct CI lane for direnv-mode consumers**
([#854](#854))
- `direnv` mode now scaffolds a host-native `ci.yml` overlay
(`assets/workspace-direnv/`, applied like the bare overlay and keyed off
the persisted `DEVKIT_MODE`): no `resolve-image`, no in-container jobs —
the runner installs Nix (with the vig-os Cachix substituter, SHA-pinned
`install-nix`/`cachix` actions reused from this repo's own lane) and
drives the same `just sync|precommit|test` contract inside the flake
dev-shell via `nix develop -c`, dropping the container-only
`PREK_HOME`/`UV_PROJECT_ENVIRONMENT` env.
- Documented boundary in `docs/MIGRATION.md` ("direnv-mode CI"): only
`ci.yml` is converted for direnv mode; the other shipped workflows
(`prepare-release`, `promote-release`, `release*`, `sync-issues`,
`renovate-changelog-build`, `sync-main-to-dev`) stay container-based and
devcontainer-mode-only until the full workflow audit rides the devkit
rename ([#781](#781)); the
container-independent ones (`codeql`, `scorecard`,
`renovate-changelog-commit`, `release-extension`) keep working in every
mode.

- **Opt-in capability modules for `mkProjectShell`**
([#884](#884))
- `modules = [ "native" ]` composes curated capability modules (packages
+ env vars + shellHook fragments) onto the project dev-shell; contract
recorded in `docs/rfcs/ADR-capability-modules.md`.
- Zero-module shells are byte-identical to the previous builder and the
published image stays base-only; `extraPackages` remains the per-repo
escape hatch and wins PATH lookup.
- `native` module ships first (`stdenv.cc`, `cmake`, `gnumake`,
`pkg-config`, generic `CC`/`CXX`) — the long-term
[#879](#879) answer;
`geant4`/`rust`/`fortran`/`root` stay ask-gated candidates.
- Per-module flake checks (`checks.<system>.module-<name>`) plus a uv
C-extension sdist smoke test (`tests/test_flake_modules.py`).

- **`.vig-os` project manifest and new `bare` delivery mode**
([#885](#885))
- `.vig-os` now persists the delivery mode and identity (`DEVKIT_MODE`,
`DEVKIT_PROJECT`, `DEVKIT_ORG`, `DEVKIT_REPO`, reserved
`DEVKIT_MODULES`) alongside the version pin — flat `KEY=VALUE` format
unchanged, existing parsers byte-for-byte unaffected. Precedence
flag/env > `.vig-os` > prompt/default, with resolved values written
back, so manifest-bearing repos upgrade with `--force` and no
mode/identity flags while keeping shape and names.
- Legacy (version-only) consumers get their mode inferred conservatively
from the tree shape on upgrade (wider mode on ambiguity, inference
printed and persisted, never reshaping); an explicit `--mode`
contradicting the persisted `DEVKIT_MODE` refuses, pointing at
`--preview` and the preflight-guard flow.
- New `bare` mode ships the standards layer only (justfiles, hooks
config, `.github/` CI, `.vig-os`), prunes
`.devcontainer/`/`flake.nix`/`.envrc` behind the #738/#859 pre-existence
guards, and scaffolds a host-native `ci.yml` (no image resolution, no
container jobs — `setup-uv` on the runner drives the same `just
sync|precommit|test` contract) with `rust-just`/`prek` pinned to the
toolchain versions.
- The template `.vig-os` ships `DEVKIT_MODE` empty and the resolved
mode/identity are persisted immediately after the template copy, so an
upgrade aborted mid-scaffold can never persist a delivery mode the repo
did not choose.

- **Preflight guard and diff preview for scaffold upgrades**
([#886](#886))
- `install.sh --force` upgrades now refuse on
`main`/`dev`/`release/*`/detached HEAD and on a dirty tree, so every
upgrade lands as a reviewable, revertible diff on a dedicated branch; on
a protected branch with a clean tree the installer offers to create and
switch to `chore/devkit-upgrade-<version>`, and non-git directories get
a warn-and-confirm path. A single `--skip-preflight` flag bypasses the
guard; `--smoke-test` runs and fresh installs are exempt.
- New `--preview` mode prints the add/overwrite/preserve/delete file
report (including mode-prune deletions such as the retired
`.devcontainer/justfile.base`) and exits without changing any files —
unlike `--dry-run`, which only prints the container command.

- **Flake-generated pre-commit hooks: one definition,
consumer-extensible**
([#883](#883))
- `nix/hooks.nix` now defines the pre-commit hook set once; it renders
the sandbox-pure `checks.pre-commit` gate, the committed
`.pre-commit-config.yaml` + scaffold copy (drift CI-gated by
`tests/test_flake_hooks.py` against `nix eval .#lib.hooksPortable` — the
hand-synced triangle and the manifest transform chain are retired), and
the consumer surface.
- `mkProjectShell` gains opt-in `hooks` (toggle base hooks, per-hook
`excludes`/overrides, fully custom hooks) and `hooksExcludes` (global
excludes): entering the shell installs the rendered config as a
repo-root symlink without ever touching `core.hooksPath` — the
scaffold's `.githooks` entry point stays in charge; a preserved
hand-edited YAML
([#878](#878)) is never
overwritten, and the zero-hooks dev-shell stays byte-identical.
- Consumer contract and migration steps in `docs/MIGRATION.md`; the
`.vig-os` manifest raw-YAML opt-out flag is tracked in
[#885](#885).

### Changed

- **Release-candidate dispatch gates on CI only**
([#902](#902))
- `release.yml` no longer requires the release PR to be marked
ready-for-review and approved before publishing a candidate — candidate
dispatch now gates on CI status only, so RCs are freely dispatchable
during verification while the PR stays a draft.
- The draft + approval gate now applies only to the **final** release
(the step that burns the immutable `X.Y.Z` tag); `promote-release.yml`'s
merge job still re-enforces approval before merging to `main`, so `main`
and `:latest` remain fully protected.
- Release docs, `justfile`, and `CONTRIBUTE.md` reordered accordingly:
publish candidates to verify first, then mark ready and get approval
before `finalize-release`.

- **Copied scaffold is language-neutral**
([#929](#929))
- The scaffold no longer assumes a Python package: `just
lint/format/test/test-cov` are guarded on `pyproject.toml` and no-op
(exit 0) when it is absent, mirroring the existing `sync` guard, so a
non-Python repo's `just sync|precommit|test` CI contract stays green out
of the box.
- `init-workspace.sh` drops the `src/template_project` → `src/<name>`
rename and test-import rewrite; `pyproject.toml` stays in the preserved
set, so a consumer that brings its own is never clobbered.

### Removed

- **`pre-commit` compat shim removed from the image**
([#897](#897))
- The one-release-cycle `pre-commit → prek` shim shipped in 0.4.x
([#881](#881)) is gone;
`pre-commit` invocations now fail with exit 127.
- Consumers had the 0.4.x cycle to rename invocations; the upgrade-time
scan still warns with `file:line` on preserved surfaces — see
`docs/MIGRATION.md` for the rename checklist (justfile recipes,
repo-owned `.githooks/`, CI configs → `prek`).

- **Python package starter dropped from the scaffold**
([#929](#929))
- `pyproject.toml`, `src/template_project/`, and `tests/` are no longer
shipped in `assets/workspace/`; a fresh scaffold is language-neutral.
Restore a Python layout on demand with the opt-in `nix flake init -t
github:vig-os/devcontainer#python` template
([#930](#930)).

### Fixed

- **Upgrade preview report follows template symlinks**
([#949](#949))
- On the Nix image the baked template is a tree of symlinks into the nix
store, so the `--preview`/`--force` classifier's `find … -type f`
matched zero files and the OVERWRITTEN/ADDED report was always empty
even though the real copy (`rsync -avL`) still overwrote them. The
classifier now uses `find -L` to follow symlinks and match the copy
semantics.

- **Upgrade preview no longer over-reports the baked `.venv` tree**
([#951](#951))
- Follow-up to the
[#949](#949) preview fix:
`find -L` also descended the baked `.venv` symlink tree, so the ADDED
section listed phantom `.venv/…/site-packages/*` files the real upgrade
never writes. The report `find` now mirrors the static excludes the
rsync copy applies (`.venv`, `docs/issues/`, `docs/pull-requests/`), so
ADDED matches what the upgrade actually does.

- **Autochangelog now records grouped Renovate PRs**
([#936](#936))
- `renovate-changelog-pr` parsed the update table only when the change
cell used an ASCII `->` arrow, but Renovate renders it with the Unicode
arrow `→` (U+2192). Every real Renovate PR body therefore parsed to
nothing; a changelog entry only appeared when the PR *title* happened to
match (digest bumps, single `update X to Y`), so grouped dependency PRs
were silently skipped. The change-cell parser now accepts both arrows.

- **Imageless upgrades stamp the real built tag**
([#921](#921))
- The image now bakes an authoritative built-tag record
(`/root/assets/VERSION`) distinct from the template `.vig-os` pin: the
release `build-image` action runs `nix build --impure` with
`VIG_OS_VERSION` set to the true publish tag (RCs included), which the
flake reads via `builtins.getEnv`. A plain, pure `nix build` reads `""`
and falls back to the checked-in repo pin, so ordinary builds stay
bit-reproducible.
- `init-workspace.sh` reads that record when no `VIG_OS_VERSION` is
forwarded, so a bare `podman run … init-workspace.sh` upgrade (no
`install.sh`) now pins `.vig-os` to the image's real tag instead of the
stale baked template pin
([#916](#916)); an explicit
`VIG_OS_VERSION` still wins, and an absent record leaves the pin
untouched.

- **Template `sync` recipe no longer forces `--all-extras`**
([#892](#892))
- The shipped `justfile.project` `sync` recipe used `uv sync
--all-extras --all-groups`, which forced every optional extra to
install. Repos that quarantine platform-limited dependencies (e.g.
cp312/cp313-only wheels) in extras got a hard `just sync` failure on the
cp314 image.
- The recipe is now parameterized (`sync *args="--all-groups"`) and
defaults to `--all-groups`: dev groups stay synced while extras become
opt-in via `just sync --all-extras`. The `update` recipe (which calls
`just sync`) uses the new default unchanged.

- **Version-skew hardening for the shipped CI glue**
([#854](#854))
- **CI-wired skew guard:** the shipped container `ci.yml` and the new
direnv `ci.yml` lint jobs now fail fast with an actionable `::error::`
if the toolchain does not provide `prek`, turning an opaque `just
precommit` exit 127 (old scaffold vs new image, or an image too old to
ship the prek hook runner) into a one-line diagnosis.
- **`prepare-release.yml` resolver unified:** the scaffold's forked
inline-awk image resolver with a silent `latest` fallback is replaced by
the shared `resolve-image` action, which hard-fails on a
missing/unreadable `DEVCONTAINER_VERSION` pin.
- **`devc-upgrade` honors the pin:** the recipe read `install.sh` from
`main` regardless of the consumer's pin; it now reads
`DEVCONTAINER_VERSION` from `.vig-os` and upgrades to that generation
(script ref + `--version`), keeping `main`/`latest` only for unpinned
repos.
- **pipefail in every mode:** `set shell := ["bash", "-euo", "pipefail",
"-c"]` moved from the devc-only `justfile.devc` to the root `justfile`
(the SSoT), so direnv/bare recipes get pipefail too.
- **`init-precommit.sh` derives its root** from the script location
instead of a hard-coded `/workspace/{{SHORT_NAME}}`.
- **Stale doc fixed:** `docs/container-ci-quirks.md` no longer describes
a removed `uv run bandit` `pre-commit` hook; the private-image
(unauthenticated `resolve-image` probe + missing `credentials:`)
limitation is documented, with the first-class fix tracked in
[#920](#920).
@vig-os-release-app
vig-os-release-app Bot enabled auto-merge July 9, 2026 13:14
@vig-os-release-app
vig-os-release-app Bot merged commit cbc431a into dev Jul 9, 2026
22 of 24 checks passed
@vig-os-release-app
vig-os-release-app Bot deleted the chore/sync-main-to-dev-14-1 branch July 9, 2026 13:26
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