Repository navigation
Description
Description
Deploying the devkit to vig-os repos (rollout pilot: commit-action, --mode direnv)
revealed that the CI and release layer of the scaffold is hard-coupled to the
devcontainer image regardless of the chosen DEVKIT_MODE. Every scaffolded CI
and release job runs inside container: ghcr.io/vig-os/devcontainer:<tag> via the
resolve-image job; no workflow branches on mode. A repo that deliberately picks
direnv or bare to be container-free is therefore only half-honored: local dev
skips the container, but CI still mandates the image.
This epic makes the scaffold honor the deployment mode end-to-end while keeping
the release choreography single-source.
The three axes (currently conflated)
| Axis | Answers | Correct granularity |
|---|---|---|
| Deployment mode (container/direnv/bare) | how a developer gets a local env | per-repo choice |
| CI toolchain | how CI jobs get their tools | should track the mode (today: always the container) |
| Release artifact | what the repo ships (image / JS action / crate / flake) | per artifact type, not per mode |
Agreed design direction
- One release pipeline, not three.
release-core/publish/extensionare already
reusableworkflow_callworkflows — the choreography (version bump, changelog
finalize, tag, PR merge, draft release, rollback) stays single-source. Three
per-mode copies are explicitly rejected (SSoT/DRY: triplicates the most fragile
automation). - Mode-adaptive toolchain preamble. A shared
setup-devkit-toolchaincomposite
action branches onDEVKIT_MODEfrom.vig-os(the same sourceresolve-image
already reads):container→container:image;direnv→install-nix-actionnix develop;bare→ host-nativesetup-node/uv/etc.
- Publish step keyed on artifact type, not mode. Image push vs
npm publish/
marketplace vscargo publishis a small per-repo hook. - Known awkward spot: GitHub's job-level
container:key can't be conditionally
unset by expression — needsif:-gated job wrappers or a documented
"container unless mode≠container" default.
Acceptance Criteria
- A
direnv/bareconsumer's CI and release run container-free (no forced
ghcr.io/vig-os/devcontainerpull). - Release choreography remains single-source (no per-mode pipeline copies).
- Scaffold stops shipping container-only artifacts into container-less modes (#D1).
- Mode-switch migration path for a stale
.devcontainer/is defined (#D2). - Mode-aware CI/release toolchain implemented (#D3).
Sub-issues
- D1 — direnv/bare scaffold ships container-only artifacts
- D2 — mode-switch doesn't prune a pre-existing
.devcontainer/ - D3 — CI + release workflows hard-coupled to the container image toolchain
Additional Context
Surfaced by the devkit rollout pilot; blocks resuming deployment to commit-action
(vig-os/commit-action#29, also closes #30) and the other vig-os code repos.
Pilot preview was read-only — no consumer repos were modified.
Activity
c-vigo commentedon Jul 13, 2026
Implementation plan (approved 2026-07-13)
Scope corrections from research
The epic text says "no workflow branches on mode" — that is no longer accurate, which shrinks D3:
ci.ymlis already mode-aware via whole-file overlays (assets/workspace-direnv/,assets/workspace-bare/, applied byinit-workspace.sh), with per-mode bats render assertions intests/bats/init-workspace.bats.release.yml(rollback),release-core.yml(validate/finalize/test),release-publish.yml(publish),prepare-release.yml(prepare + inline resolve-image),promote-release.yml(4 jobs),sync-main-to-dev.yml(2),renovate-changelog-build.yml(1),sync-issues.yml(1). Already host-safe:release-extension.yml,renovate-changelog-commit.yml,codeql.yml,scorecard.yml..github/actions/setup-env(install-nix + cachix +nix develop --profile+GITHUB_PATHexport +retryshim viaBASH_ENV) — the direnv branch at release scale. The bare branch prototype isworkspace-bare'sci.yml(setup-uv+uv tool install). The container branch is the status quo.retry(solved by the setup-env shim), andprepare-changelog/renovate-changelog-pr— console scripts ofpackages/vig-utils, baked into the image but not indevTools, so consumer dev-shells lack them today.git/gh/jqare free on hosted runners.UV_PROJECT_ENVIRONMENT=/root/...,PREK_HOME=/opt/prek-cache,safe.directorysteps, GHCRcontainer.credentials.{{PLACEHOLDER}}tokens exist in any workflow file — the sed substitution engine is untouched.Architecture
One release choreography + a shared
setup-devkit-toolchaincomposite action branching onDEVKIT_MODEfrom.vig-os, using theGITHUB_PATH-export pattern from the devkit's ownsetup-env— after it runs, plainrun: just syncworks in every mode, so the ~2 000 lines of choreography steps stay untouched.The composite cannot set job-level
container:. Two resolutions, decided by a spike:resolve-toolchainjob reads.vig-osand outputsmode+image(empty unless container mode); jobs declarecontainer: image: ${{ needs.resolve-toolchain.outputs.image }}(empty image = host). Single-source, container-mode byte-identical to today. Risk: empty-image-skips-container (esp. withcredentials:) is folklore, not documented contract.container:from the release/automation set entirely; every mode provisions via the composite (direnv → repo's own flake; container/bare →nix develop github:vig-os/devkit?ref=<DEVKIT_VERSION>via Cachix — the.vig-ospin still governs the toolchain version). This is how the devkit releases itself. Image parity stays covered byci.ymlon the release PR and by the smoke-test repo.Spike Option A first; if clean, use A for
ci.yml+ release set and collapse the three driftingci.ymloverlays into one file. If fragile, adopt B for the release set and keepci.ymlon thin overlays around the composite. Outcome recorded as an ADR indocs/rfcs/.Work breakdown
container:semantics + ADRsetup-devkit-toolchaincomposite action (scaffolded into consumers)ci.yml(collapse overlays per spike) + convert release/automation set--prune-devcontainer+ prompt + preview + MIGRATION.md runbookOrder: spike → vig-utils/actionlint/#990 (parallel) → composite → #991 conversions → #989 → release 1.1.0 → resume rollout (commit-action pilot). Bare-mode release is in scope (pinned uv-tool path).
Smoke-test repo decision
Keep
devkit-smoke-testsingle-mode (container lane + release-pipeline E2E). Mode coverage lives in the devkit: per-mode rendered-workflow bats assertions + actionlint. The commit-action pilot is the live direnv validation immediately after 1.1.0; bare has no consumer yet and is validated hermetically. #991's "smoke-tested across all three modes" AC is reworded accordingly. A real-runner direnv leg in the smoke-test dispatch is a deferred follow-up, not part of this epic.Additional fixes surfaced
sync-main-to-dev.ymlis the lone devkit-own workflow still on container+resolve-image (stale template copy) — separate cleanup issue, not blocking..vig-oscarries noDEVKIT_MODE; smoke-test's saysbothwhile its automation deploys--docker— trivial truthfulness fixes folded into the work above.justfile.projectrecipes, node inextraPackages, release-app secrets; Mode-switch doesn't prune a pre-existing .devcontainer/ on container→direnv migration #990 then prunes its broken apt.devcontainer/.Execution mechanics
Epic integration branch
feature/988-mode-aware-scaffoldwith a draft PR intodev(carries automated CI for the integrated state). Sub-issue branches PR into the epic branch (no automated CI there; targeted local CI per PR: bats, pytest scope, prek, actionlint).docs: add mode-aware scaffold implementation plan
c-vigo commentedon Jul 13, 2026
Epic implementation complete on the integration branch
All seven sub-issues are merged into
feature/988-mode-aware-scaffoldand closed:docs/rfcs/ADR-conditional-container-toolchain.mdprepare-changelog/renovate-changelog-prin every dev-shell; pinned bare-mode uv-tool path--prune-devcontainer+ prompt + preview; #738 default intactresolve-toolchain+setup-devkit-toolchainscaffolded actionsci.yml(overlays removed); all 8 release/automation workflows on resolve-once threading; scaffoldresolve-imageretired; choreography unchangedcontainer-ci-quirks.mdmode-filtered; truthful preview; devkit.vig-osdeclaresDEVKIT_MODE=direnvFollow-ups filed outside the epic: #1003 (re-enable actionlint shellcheck + harden run-blocks), #996 (devkit-own
sync-main-to-dev.ymloff the container).Acceptance criteria: D1/D2/D3 and single-source choreography are ticked. The
"direnv/bare consumer's CI and release run container-free" AC is implemented and
hermetically verified (per-mode rendered trees + actionlint + 246-test bats
suite); its live validation is deliberately deferred to the rollout pilot
(
vig-os/commit-action, direnv) right after release, per the plan — thesmoke-test repo continues to cover the container lane end-to-end.
Next steps: review/merge draft PR #997 (epic →
dev, full CI runs there),release 1.1.0, then resume the rollout with the commit-action pilot
(vig-os/commit-action#29: npm-mapped
justfile.projectrecipes, node inextraPackages, release-app secrets,--prune-devcontainerfor the staleapt container).
c-vigo commentedon Jul 13, 2026
Local validation runbook: mode-aware scaffold via the dev image
Purpose: validate epic #988 end-to-end locally against the image actually
shipped to consumers, before merging #997. Parameterized by image tag —
run now with
dev(localjust buildof the epic branch), repeat withthe RC tag during the release cycle (pulled from GHCR; that run also drops
the local-path overrides marked ⟨RC⟩ below).
What this adds over the merged bats/pytest suites: bats renders templates from
the repo checkout — this runbook exercises the baked image assets
(
/root/assets/workspace, build-time placeholder manifest,VERSIONrecord),the real
install.sh/podman rundelivery path, and actual toolchainexecution per mode (not structural greps).
Phase 0 — Build & image sanity (sequential)
just buildon the epic branch →ghcr.io/vig-os/devcontainer:dev(podman).⟨RC⟩ replace with
podman pull ghcr.io/vig-os/devcontainer:<rc-tag>.lowPrio/pythonEnv duplication resolves in pythonEnv's favor);
/root/assets/workspacecontains the two composites and the single ci.yml,contains NO
.github/actions/resolve-image/and NO overlay dirs;/root/assets/VERSIONsane.uv run pytest tests/test_image.pyagainst the dev tag (thesuite devkit CI runs post-build).
Phase 1 — Scaffold matrix from the image (per-mode, parallel)
For each mode
devcontainer | direnv | both | bare, scaffold a fresh tempworkspace through the image (podman run of the baked
init-workspace.sh,plus one
install.sh --version devpass to cover the wrapper): assert modeshape (composites present in every mode;
container-ci-quirks.mdand.devcontainer/only in container-ish modes;.vig-ospins version+mode),actionlintclean over the baked-rendered.github/,--force --previewidempotency, and the #990 container→direnv migration with
--prune-devcontainerover a devcontainer-shaped tree.Phase 2 — Toolchain execution per mode (the meat, parallel)
Run the real CI contract and the release-tool surface in each mode's actual
environment, mimicking what the converted workflows do:
apply the composite's container branch env (
UV_PROJECT_ENVIRONMENT,PREK_HOME, safe.directory), thenjust sync && just precommit && just test;verify
retry,prepare-changelog,renovate-changelog-pr,gh,jq,prek,uvresolve.nix developon the scaffolded flake with thevigosinputoverridden to the local epic checkout (
--override-input vigos path:…) —⟨RC⟩ drop the override and pin the RC ref instead; same contract + tool set
(this is the Expose vig-utils console scripts host-side (dev-shell + pinned uv-tool path) #993 dev-shell delivery validated through a real consumer flake).
UV_TOOL_DIR/UV_TOOL_BIN_DIRsandboxed):
uv tool install rust-just prek+ vig-utils fromgit+https://github.com/vig-os/devkit@feature/988-mode-aware-scaffold(the literal URL form the composite uses — ⟨RC⟩
@<rc-tag>); same contract +tool set.
resolve-toolchainresolve script againstthe scaffolded
.vig-os(mode/image/tag outputs incl. the corrupt-moderefusal) and source the composite's retry shim + one failing/succeeding
retryinvocation.Phase 3 — Release-tool dry exercise (folded into Phase 2 agents)
prepare-changelog prepare|unprepareroundtrip on a temp copy of thescaffolded CHANGELOG and
renovate-changelog-pr --help, in each mode'senvironment — the release choreography's tool calls, without touching GitHub.
Out of scope locally (covered elsewhere)
GitHub-side semantics (empty-image
container:, workflow_call threading) —proven by the #992 spike on real runners and re-proven live by the RC cycle's
smoke-test lane + the commit-action pilot.
Exit criteria
Consolidated pass/fail matrix (mode × {scaffold, actionlint, contract, tools,
release-tools, upgrade/prune}). Any failure → issue on vig-os/devkit, fix on
the epic branch, re-run the affected lane.
c-vigo commentedon Jul 13, 2026
Local validation results — dev image (runbook above, first execution)
Image:
ghcr.io/vig-os/devcontainer:dev(localjust buildof the epic branch @0e3ba2e8). All lanes green — no defects found.resolve-image/overlays absent, vig-utils +retryon image PATHtest_image.py116/116;test_integration.py+test_install_script.py145/146 (+3 expected skips) — the 1 failure is host-localghmulti-account/dbus-launch, unrelated surface, passes in CIinstall.sh --skip-pull; shape, placeholders, actionlint,--force --previewidempotency, #990 migration (prune.devcontainer/+container-ci-quirks.md), in-container CI contract (just sync/precommitgreen on feature branch, full tool set resolves), release tools.devcontainer/, no quirks doc), actionlint, consumermkProjectShelldev-shell delivers the full tool set incl.prepare-changelog/renovate-changelog-pr(#993 proven through a real consumer flake),just precommitgreen, resolve script (mode=direnv, empty image, corrupt-mode refusal), retry shim, release toolsuv tool installincl. the literalgit+https://…@<ref>#subdirectory=packages/vig-utilsURL end-to-end from GitHub, pinned versions confirmed, fail-fast on emptydevkit-version, resolve script (mode=bare, empty image), retry shim, release tools, no host pollutionRecurring non-defects (documented so the RC run doesn't re-triage them):
prepare/unprepareare not strict inverses by design;just sync|testno-op on the language-neutral scaffold (pyproject.tomlguard);no-commit-to-branchfires onmasterin test harnesses (working as designed); NixOS host needs a glibc loader shim for manylinux prebuilts (native on ubuntu runners).Runbook corrections for the RC repetition:
install.shhas no--no-prompts(that's the inner script's flag) — the wrapper is non-interactive when given--name/--org/--repo.--skip-pullflag with a local tag; with a published RC tag, plain--version <rc-tag>pulls from GHCR as normal./root/assets/VERSIONequals the RC tag (on the dev build it shows the flake's1.0.1pin and the pin is forwarded viaVIG_OS_VERSION=devinstead — worked as designed).Green light from local validation: ready for #997 review → merge → 1.0.x→1.1.0 RC cycle, where this runbook re-runs against the RC image.
c-vigo commentedon Jul 13, 2026
Additional evidence: a real container→direnv migration dry-run on the pilot repo (
commit-action, throwaway branch, host-side scaffold from the epic checkout with--mode direnv --prune-devcontainer --force) passed every epic check — old.devcontainer/(incl. the broken post-create.sh, commit-action#30) pruned, quirks doc excluded, composites scaffolded, mode-aware ci.yml actionlint-clean,.vig-ospersisted, #738 preserves intact, and the scaffolded flake evaluates against the epic devkit. Pilot-side prerequisites unchanged (node inextraPackages, npm recipes — commit-action#29). One leftover surfaced outside epic scope: the flake stub still referencesgithub:vig-os/devcontainerpost-rename → filed #1009.feat: mode-aware scaffold — CI/release toolchain per deployment mode (#…
fix(workspace): point scaffolded flake stub at github:vig-os/devkit (#…
docs(workspace): document --skip-pull in install.sh usage (#1011)
fix(ci): make scaffolded CI and release pipeline language-neutral (#1033
c-vigo commentedon Jul 14, 2026
Closing — all acceptance criteria met
The last open criterion (container-free CI and release for a direnv/bare consumer) is now checked:
vig-os/commit-action(direnv mode, devkit 1.1.0) has been running scaffolded CI on plain runners in production since adoption — the entire 2026-07-14 issue batch ([BUG] setup-devkit-toolchain applies python/uv CI env unconditionally on non-python consumers #1028, [BUG] Release pipeline is python-shaped: no artifact/bundle step for node/TS consumers, stale 'Sync Python dependencies' labels #1029, [BUG] sync-main-to-dev checks out dev, then runs a local action that only exists on main #1034, [BUG] Renovate preset does not remediate transitive npm vulns — 12 of 21 alerts unreported, including the only critical #1041, [BUG] Renovate preset does not group npm updates — one PR per package, all mutually conflicting #1047) came from those real container-free runs. [BUG] setup-devkit-toolchain applies python/uv CI env unconditionally on non-python consumers #1028's fix specifically exercised the direnv branch ofsetup-devkit-toolchain(nix-develop provisioning, noghcr.io/vig-os/devcontainerpull) and is merged.The residual — commit-action's first production release through the pipeline — is rollout validation, tracked by the pilot and the #1040 onboarding epic, not engineering on this epic. Sub-issues D1/D2/D3 closed long since; shipped in 1.1.0.