Repository navigation
feat(workspace): .vig-os declarative manifest with persisted mode/identity and bare mode - #911
Conversation
…nifest .vig-os becomes the project's declarative manifest: DEVKIT_MODE, DEVKIT_PROJECT, DEVKIT_ORG, DEVKIT_REPO (and reserved DEVKIT_MODULES) are resolved with flag/env > .vig-os > prompt/default precedence, written back on every (re)scaffold, and read by install.sh so upgrades need no mode/identity flags. An explicit --mode contradicting the persisted DEVKIT_MODE refuses, pointing at --preview and the preflight-guard flow. Refs: #885
A version-only .vig-os (or none) gets its DEVKIT_MODE inferred from the tree shape on --force upgrades: populated .devcontainer/ plus flake/envrc widens to both (ambiguity resolves wide, with a printed note), single markers map to devcontainer/direnv, interactive runs confirm, and the result is persisted so the manifest self-documents from the first upgrade. Refs: #885
bare scaffolds the standards layer only (justfiles, hooks config, .github CI, pyproject, .vig-os) and prunes .devcontainer/, flake.nix and .envrc behind the #738/#859 pre-existence guards. The shipped ci.yml is replaced by a host-native variant (assets/workspace-bare/): no image resolution and no in-container jobs — setup-uv on the runner drives the same just sync|precommit|test contract. The preview report now names a pre-existing consumer .devcontainer/ as preserved in direnv/bare modes. Refs: #885
Characterization coverage (no RED phase: the three consumers — resolve-image action, initialize.sh, version-check.sh — are tolerant line-based parsers by construction): each runs against a version-only and a full #885 manifest with byte-identical results, locking in the backward-compatibility acceptance criterion. Refs: #885
c-vigo
left a comment
There was a problem hiding this comment.
Solid PR overall — parser tolerance is real (ran the new suites: manifest-parsers 4/4, init-workspace 100/100, install 87/87, pytest 2/2, all green from a scratch clone; every .vig-os consumer incl. flake.nix:870 and prepare-release.yml:68 is ^DEVCONTAINER_VERSION=-anchored), refusal ordering is correct in both layers, and the bats coverage is genuinely end-to-end. One real defect and one smaller point:
Torn-manifest window can legitimize a mode nobody chose. The template ships DEVKIT_MODE=both (assets/workspace/.vig-os:13). On a --force upgrade of a direnv/bare/devcontainer repo, the rsync at init-workspace.sh:634 overwrites .vig-os with that template line, and the corrective write-back only runs at :788. Everything in between runs under set -e, and resolve_github_repository (:751) sits inside the window — it exits 1 with --no-prompts on a legacy tree (no DEVKIT_REPO) whose origin isn't github.com. Result: the aborted upgrade leaves DEVKIT_MODE=both persisted in a direnv-shaped repo; the next --force run trusts the manifest (no inference, no refusal — no --mode flag involved) and silently re-adds .devcontainer/ — the exact drift this issue exists to kill, now with manifest legitimacy. Pre-#885 the same abort left a version-only file, so the next run re-inferred correctly. The install.sh dirty-tree preflight mitigates that entry point, but direct podman run … init-workspace.sh --force has no preflight. Two cheap fixes, either works: ship the template with DEVKIT_MODE= (empty falls through to inference; the key-set bats test still passes), or write DEVKIT_MODE/DEVKIT_PROJECT/DEVKIT_ORG back immediately after the copy — all three are resolved before the rsync; only DEVKIT_REPO needs to stay after :751.
Floating tool versions in the shipped bare ci.yml. uv tool install rust-just / uv tool install prek (workspace-bare ci.yml:61-62) are unpinned, so a bad prek/just release breaks every bare consumer's CI with no change on their side and nothing to roll back — unlike the container template, where the whole toolchain rides the pinned image, and unlike our own workflow practice (safety==3.7.0 in ci.yml:255). Suggest pinning both (uv tool install rust-just==x.y.z prek==x.y.z); a renovate regex manager can keep them fresh later. Non-blocking if you'd rather track latest deliberately, but worth a conscious decision.
Nit, no action needed: a DEVKIT_ORG containing spaces round-trips exactly through container-direct upgrades but gets sanitize_for_security'd to underscores when the upgrade goes through install.sh — pre-existing sanitizer behavior, just newly reachable via the manifest.
…MODE An upgrade abort between the template rsync and the resolved write-back (e.g. resolve_github_repository under --no-prompts with a non-github origin) persists the template's DEVKIT_MODE=both; the next --force run trusts it and silently re-adds .devcontainer/ to a direnv-shaped repo. Refs: #885
Ship the template .vig-os with DEVKIT_MODE empty (parsers treat empty as unset, so an abort mid-scaffold falls back to inference instead of legitimizing a mode nobody chose), and write the resolved mode and identity back immediately after the template copy — before any step that can abort — so the manifest never lies mid-run. DEVKIT_REPO stays in the late write-back: it is only known after resolve_github_repository. Refs: #885
Unpinned uv tool installs let an upstream release break every bare consumer's CI with no change on their side; pin to the versions the vig-os toolchain ships (just 1.51.0, prek 0.3.11), bumped via Renovate or manually alongside a devkit upgrade. Refs: #885
…Y env GitHub Actions exports GITHUB_REPOSITORY globally, which satisfied the repository resolver and masked the simulated abort, so the torn-state regression test failed in CI while passing locally. Refs: #885
Description
Promotes
.vig-osfrom a single-purpose version pin into the project's declarative manifest and adds the newbaredelivery mode.DEVKIT_MODE,DEVKIT_PROJECT,DEVKIT_ORG,DEVKIT_REPO(plus reservedDEVKIT_MODULES, feat(flake): modular capability shells — opt-in vigos capability modules (native, geant4, rust, …) on top of mkProjectShell #884) are persisted alongsideDEVCONTAINER_VERSION— flatKEY=VALUEformat unchanged,DEVCONTAINER_VERSIONnot renamed ([CHORE] Rename devcontainer → devkit (after publish-cutover #639) #781 owns that)..vig-os> prompt/default, in bothinit-workspace.shandinstall.sh; resolved values are written back on every (re)scaffold, so a manifest-bearing repo upgrades with--forceand no mode/identity flags while keeping its shape and names.both— inference printed, interactive runs confirm, persisted afterwards; never reshapes on inference alone).--modecontradicting the persistedDEVKIT_MODErefuses in both scripts, pointing at--preview(feat(workspace): preflight guard for scaffold upgrades — require a dedicated clean branch, add diff preview #886) and the deliberate DEVKIT_MODE-edit-on-a-clean-branch flow.--previewand--smoke-testare exempt.baremode: standards-only scaffold (justfiles,.pre-commit-config.yaml,.github/CI,pyproject.toml,.vig-os); prunes.devcontainer/,flake.nix,.envrcbehind the [BUG] install.sh --mode direnv --force overwrites populated consumer files (pyproject.toml, .devcontainer/) #738/[CHORE] Field-validate 0.4.0-rc4 in real consumer repos before finalize #859 pre-existence guards; ships a host-nativeci.yml(assets/workspace-bare/overlay): no resolve-image step, no container jobs — pinnedastral-sh/setup-uvplusuv tool install rust-just prekdrive the samejust sync|precommit|testcontract. The root justfile'simport?semantics keep the graph loading without.devcontainer/(proven by bats)..devcontainer/now appears as an explicit PRESERVED line in direnv/bare reports (previously silently absent).Closes #885
Type of Change
feat-- New featureModifiers
!) -- backward compatible (semver:minor); all existing.vig-osparsers are byte-for-byte unaffected (regression-tested).Changes Made
assets/workspace/.vig-os: manifest template with the new key set and cross-references (feat(workspace): generate .pre-commit-config.yaml from the flake (git-hooks.nix) — composable base hooks, consumer-extensible in the project flake #883/feat(flake): modular capability shells — opt-in vigos capability modules (native, geant4, rust, …) on top of mkProjectShell #884/[CHORE] Rename devcontainer → devkit (after publish-cutover #639) #781 noted in comments).assets/init-workspace.sh: tolerant manifest reader + write-back; flag/env > manifest > prompt precedence for SHORT_NAME/ORG_NAME/GITHUB_REPOSITORY/MODE; mode-mismatch refusal; conservative legacy inference;baremode (rsync exclusion, prune with guards, host-native ci.yml overlay, report/DELETED integration);DEVKIT_MODULESround-trip across the managed-file overwrite.install.sh: reads the same keys host-side (mode/name/org/repo defaults), refuses conflicting--modebefore pulling the image, accepts/forwards--mode bare, skips the host user-conf step for bare, bare-aware next-steps hint.assets/workspace-bare/.github/workflows/ci.yml: host-native CI template (SHA-pinned actions; yamllint-clean via the hook suite).docs/MIGRATION.md: four delivery modes + a.vig-osproject manifest section (keys, precedence, inference, mode-switch policy, future flags note for feat(workspace): generate .pre-commit-config.yaml from the flake (git-hooks.nix) — composable base hooks, consumer-extensible in the project flake #883).init-workspace.bats(manifest matrix across modes × fresh/legacy/manifest-bearing, refusal/preview, inference incl. the [CHORE] Field-validate 0.4.0-rc4 in real consumer repos before finalize #859 ambiguity, bare shape + CI-contract resolution), 9 ininstall.bats, newmanifest-parsers.bats+tests/test_resolve_image_manifest.py(parser tolerance, byte-identical outputs).Changelog Entry
Added
.vig-osproject manifest and newbaredelivery mode (#885).vig-osnow persists the delivery mode and identity (DEVKIT_MODE,DEVKIT_PROJECT,DEVKIT_ORG,DEVKIT_REPO, reservedDEVKIT_MODULES) alongside the version pin — flatKEY=VALUEformat 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--forceand no mode/identity flags while keeping shape and names.--modecontradicting the persistedDEVKIT_MODErefuses, pointing at--previewand the preflight-guard flow.baremode ships the standards layer only (justfiles, hooks config,.github/CI,pyproject.toml,.vig-os), prunes.devcontainer//flake.nix/.envrcbehind the [BUG] install.sh --mode direnv --force overwrites populated consumer files (pyproject.toml, .devcontainer/) #738/[CHORE] Field-validate 0.4.0-rc4 in real consumer repos before finalize #859 pre-existence guards, and scaffolds a host-nativeci.yml(no image resolution, no container jobs —setup-uvon the runner drives the samejust sync|precommit|testcontract).(mirrored in
assets/workspace/.devcontainer/CHANGELOG.md)Testing
just test-bats: 100/100 init-workspace, 87/87 install, 4/4 manifest-parsers;uv run pytest tests/test_resolve_image_manifest.py: 2 passed)Manual Testing Details
just precommit(prek run --all-files) exits 0 — includes yamllint (strict) over the new host-native ci.yml, shellcheck over both scripts, and check-action-pins.githooks.batsfailures observed in a nix dev-shell are pre-existing and environmental (IN_NIX_SHELLset); all 12 pass withenv -u IN_NIX_SHELL. No.githooksfiles are touched by this PR.Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)import?+ justfile.project, see bats)Review follow-up
Addresses the review on the torn-manifest window plus the nits, belt and braces:
.vig-osnow shipsDEVKIT_MODE=(empty = unset to every parser), andinit-workspace.shpersists the resolvedDEVKIT_MODE/DEVKIT_PROJECT/DEVKIT_ORGimmediately after the template rsync — before any abort-capable step (notablyresolve_github_repository). An upgrade aborted inside the window (e.g.--no-promptson a legacy tree with a non-github origin) can no longer persistDEVKIT_MODE=bothin a direnv-shaped repo, so the next--forcerun infers/refuses as if the torn run never happened.DEVKIT_REPOstays in the late write-back (only known after origin resolution);DEVKIT_PROJECT/ORG/REPOalready shipped empty in the template, so empty-as-unset covers them. Reproduced RED with a new end-to-end bats test (abort, assert manifest not poisoned, re-run, assert.devcontainer/is NOT re-added), then GREEN.ci.ymlnow installsrust-just==1.51.0andprek==0.3.11— the versions the flake toolchain ships — with a comment noting the Renovate/manual bump path.SHORT_NAME/ORG_NAMEenv vars now suppress the interactive prompts (precedence flag/env > manifest > prompt).Verification: init-workspace 102/102, install 87/87, manifest-parsers 4/4 (193/193 in one run);
just precommitexits 0 (52 hooks passed).