Skip to content

feat: mode-aware scaffold — CI/release toolchain per deployment mode - #997

Merged
c-vigo merged 38 commits into
devfrom
feature/988-mode-aware-scaffold
Jul 13, 2026
Merged

c-vigo merged 38 commits into
devfrom
feature/988-mode-aware-scaffold

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Epic integration branch for #988: makes the scaffold honor the deployment mode
(devcontainer / direnv / both / bare) end-to-end — CI and
release/automation workflows — while keeping the release choreography
single-source.

Sub-issue PRs land into this branch; this draft PR exists to run the automated
CI suite on the integrated state. Plan: docs/plans/2026-07-13-mode-aware-scaffold-plan.md
(also posted on #988).

Sub-issues

Refs: #988

c-vigo and others added 30 commits July 13, 2026 09:15
Temporary spike (on: pull_request) validating whether a job-level
container: image driven by a resolve job's output runs on the host when
the image is empty, with/without credentials, across a workflow_call
boundary, plus a conditional container-map expression variant. To be
removed once #992 is decided.

Refs: #992
Add a parity test asserting prepare-changelog and renovate-changelog-pr
are on the dev-shell's own PATH (nix develop --ignore-environment), the
gap that blocks mode-aware release workflows for container-less modes.

Refs: #993
Record the #992 spike verdict: adopt Option A (resolve-toolchain job
outputs image; empty image => host, non-empty => container). Spike on
real ubuntu-24.04 runners proved empty-image runs on host cleanly, the
credentials block is inert when image is empty, and the pattern survives
a workflow_call boundary. Includes per-case evidence and run links.

Refs: #992
The #992 spike is complete; its verdict is recorded in
docs/rfcs/ADR-conditional-container-toolchain.md and the evidence
persists in the run logs (run 29231840324). The temporary spike
workflows must not merge.

Refs: #992
Adopt Option A (conditional job-level container via resolve-toolchain output). ADR: docs/rfcs/ADR-conditional-container-toolchain.md

Refs: #992
Expose packages/vig-utils on the vigos overlay (pkgs.vig-utils) and add it
to the devTools SSoT, so prepare-changelog, renovate-changelog-pr, and the
other console scripts reach every nix develop shell — the devkit's own and
any consumer mkProjectShell (direnv mode) — matching the image. Defined once
on the overlay and reused by pythonEnv/the hook check (no duplicate builder).
lowPrio in devTools yields to pythonEnv's identical scripts in the image
buildEnv, mirroring the wrapped-neovim collision guard.

Refs: #993
Add the version-pinned host-native install command for bare mode
(uv tool install vig-utils @ git+.../devkit@<DEVKIT_VERSION>#subdirectory=...),
consumed later by the setup-devkit-toolchain composite (#994).

Refs: #993
Scaffold each delivery mode (devcontainer, direnv, bare, both) into a temp
workspace via the real init-workspace.sh and run actionlint over the rendered
.github/workflows/ tree, plus the standalone smoke-test workflow. RED until
actionlint lands in the toolchain.

Refs: #995
actionlint joins devTools (dev-shell, image, vigos.packages home module) so
GitHub Actions workflows can be linted from the toolchain SSoT.

Refs: #995
Devkit-only, runner-only: actionlint auto-discovers and lints this repo's own
.github/workflows/ with its bundled shellcheck disabled (-shellcheck=). The
per-mode rendered consumer templates are validated in tests/bats instead, since
linting them in-place resolves reusable-workflow siblings against the wrong
root. Defined once in nix/hooks.nix and rendered into .pre-commit-config.yaml.

Refs: #995
Assert the two new mode-aware composites — resolve-toolchain and
setup-devkit-toolchain — ship in every rendered mode tree, SHA-pin every
action reference, and wire each mode branch (container in-image env, direnv
Nix dev-shell + skew guard, bare uv/vig-utils install, host-mode retry shim,
explicit empty image for host modes).

Refs: #994
Two mode-aware composite actions scaffolded into every workspace mode:

resolve-toolchain (evolves resolve-image, which stays for now) reads .vig-os
with the same tolerant KEY=VALUE parsing and emits mode + image + image-tag.
Container-ish modes (devcontainer/both) get the ghcr devcontainer image and
keep the docker manifest-inspect accessibility probe; host modes (direnv/bare)
get an explicit empty image so the downstream job runs on the host runner
(Option A, docs/rfcs/ADR-conditional-container-toolchain.md). Missing
DEVKIT_MODE defaults to both.

setup-devkit-toolchain is the single step-level toolchain preamble, gated per
DEVKIT_MODE and safe as the first step after checkout in every job:
- devcontainer/both: export UV_PROJECT_ENVIRONMENT + PREK_HOME, apply the git
  safe.directory fix, run the prek version-skew guard (#854).
- direnv: install-nix + vig-os Cachix substituter, build the repo's own flake
  dev-shell once and prepend its bin dirs to PATH (mirrors setup-env, filtering
  podman/python3 and forwarding UV_PYTHON_DOWNLOADS_JSON_URL); host-side skew
  guard points at nix flake update vigos.
- bare: setup-uv + pinned uv tool install of rust-just, prek, and vig-utils
  pinned to the devkit-version input (#993).
- direnv + bare: embed a self-contained retry shim via BASH_ENV (in-container
  jobs use the image-baked retry binary).

Refs: #994
A typo'd manifest mode must fail the resolve step loudly instead of being
silently classified as a host mode (empty image), matching the
init-workspace.sh corrupt-persisted-mode guard.

Refs: #994
An unrecognized manifest mode previously fell through the catch-all image
branch and was silently treated as a host mode (empty image), flipping a
container repo's CI onto host runners. Validate the mode after the default
is applied — failing loudly like the init-workspace.sh persisted-mode
guard — and close the image case statement with an explicit direnv|bare arm.

Refs: #994
Rework the per-mode ci.yml render assertions (#854/#885) for the
collapsed, mode-aware ci.yml: every mode's rendered ci.yml wires both
the resolve-toolchain and setup-devkit-toolchain composites, selects its
container via the resolved-image expression, carries no hardcoded
devcontainer image literal, and delegates provisioning to the composite
(no inline nix develop, container-only env, or prek skew guard). Drop the
now-obsolete overlay-specific tests and assert the overlay dirs are no
longer deployed by init-workspace.

Refs: #991
…orkflow

Replace the container-based ci.yml plus the direnv and bare per-mode
overlays with a single mode-aware workflow (ADR Option A). A leading
resolve-toolchain job reads .vig-os and outputs the delivery mode +
container image (empty for direnv/bare, so the job runs on the host);
every job declares container: image via that output with an
unconditional-but-inert GHCR credentials block, and calls the
setup-devkit-toolchain composite as its first step to provision the
toolchain for its mode. Plain just sync|precommit|test then runs
identically in every mode.

Remove the workspace-direnv and workspace-bare overlay trees and the
init-workspace.sh overlay-deployment blocks that applied them.

Refs: #991
Add a #991 bats section asserting the scaffolded release/automation
workflows carry no hardcoded devcontainer job image, drop the
resolve-image action, provision via the setup-devkit-toolchain composite,
resolve the toolchain via resolve-toolchain (or thread it through the
reusable workflow_call inputs), and that resolve-image is absent from every
rendered mode tree. Update the #854 prepare-release assertion for the
resolve-toolchain composite.

Refs: #991
The rendered-ci.yml assertion greps for a literal GitHub Actions
expression; annotate the intentional single-quoted string so shellcheck
(SC2016) stays green.

Refs: #991
Update the delivery-mode descriptions and rename the direnv-mode CI
section to 'Mode-aware CI', describing how one ci.yml serves every mode
via resolve-toolchain + setup-devkit-toolchain. Add the Unreleased
Changed entry for collapsing the per-mode overlays. The release-workflow
supported-boundary prose is left for the release-set conversion.

Refs: #991
c-vigo and others added 8 commits July 13, 2026 10:26
Convert the eight container-coupled scaffold workflows to the Option-A
pattern (docs/rfcs/ADR-conditional-container-toolchain.md): the
orchestrators resolve mode/image/version ONCE via resolve-toolchain and
thread them (toolchain_mode/toolchain_image/devkit_version workflow_call
inputs) into the reusable workflows; every formerly-container job runs
'container: image:' from the resolved output (empty => host) with the
inert-on-host GHCR credentials block, and provisions via the
setup-devkit-toolchain composite as its first step. Release choreography
is unchanged. The retired resolve-image action is removed from the
scaffold (manifest sync entry dropped); the devkit's own root copy stays
(#996).

Refs: #991
Rewrite the MIGRATION.md supported-boundary paragraphs (the release set is
no longer devcontainer-mode-only) and add the DOWNSTREAM_RELEASE.md
toolchain-provisioning note; CHANGELOG Unreleased entry.

Refs: #991
… scaffolds

The in-image CI notes are container-only: exclude them from the
container-less copies, prune a previously scaffolded copy on upgrade, and
reflect the filtered set truthfully in the --preview report (same class as
the .devcontainer/ mode filter). Also declare the devkit's own delivery
mode (direnv) in its .vig-os.

Refs: #989
@c-vigo
c-vigo marked this pull request as ready for review July 13, 2026 10:10
@c-vigo
c-vigo merged commit 0595a3a into dev Jul 13, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/988-mode-aware-scaffold branch July 13, 2026 10:10
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