Repository navigation
Description
Description
Promote .vig-os from a single-purpose version pin into the project's declarative manifest: persist the delivery mode (devcontainer | direnv | both | new bare), the project identity (short name, org, GitHub repo), and — later — enabled capability modules, so init-workspace.sh reads the project's shape on every (re)scaffold instead of asking again. Add a bare mode for projects that want the standards (hooks, recipes, CI, conventions) without any container or flake machinery — no .devcontainer/ directory that only brings confusion.
Problem Statement
Today .vig-os holds exactly one key (DEVCONTAINER_VERSION, assets/workspace/.vig-os), while every other install-time choice is transient:
- Mode is not persisted.
--mode devcontainer|direnv|bothexists only as an install flag (install.sh~317,init-workspace.sh~79–102). On a--forceupgrade the mode must be re-supplied; omitted, it defaults toboth, so a direnv-mode repo silently gets a template.devcontainer/re-added. 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 paper over symptoms of exactly this non-persistence. - Identity is not persisted.
SHORT_NAME/ORG_NAME/GITHUB_REPOSITORYare substituted once into the scaffold (init-workspace.sh~407–437) and forgotten. Upgrades re-copy managed files containing{{SHORT_NAME}}-style placeholders, so the user must re-enter the same identity every upgrade — a typo drifts compose project names, renovate presets, and src/ layout. - No thin deployment exists. The thinnest mode today (
direnv) still assumes a Nix flake. A pure-standards repo (host-nativeuv, no container, no flake) has no supported shape; 0.4.0 field-validation showed.devcontainer/confuses repos that never use it. - Modules need a home. The capability-module work (feat(workspace): generate .pre-commit-config.yaml from the flake (git-hooks.nix) — composable base hooks, consumer-extensible in the project flake #883 hooks, feat(flake): modular capability shells — opt-in vigos capability modules (native, geant4, rust, …) on top of mkProjectShell #884 capability shells) needs a per-project declaration of enabled modules;
.vig-osis the natural SSoT.
Proposed Solution
1. Extend .vig-os with new keys (format unchanged: flat KEY=VALUE, # comments):
# vig-os devcontainer configuration
DEVCONTAINER_VERSION=0.4.0
DEVKIT_MODE=direnv # devcontainer | direnv | both | bare
DEVKIT_PROJECT=my_proj # persisted SHORT_NAME
DEVKIT_ORG=EXOMA # persisted ORG_NAME
DEVKIT_REPO=exoma-ch/my-proj # persisted GITHUB_REPOSITORY
DEVKIT_MODULES="" # reserved: space-separated capability modules (#884)This is backward-safe by construction: all three existing parsers (.github/actions/resolve-image/action.yml ~31–51, .devcontainer/scripts/initialize.sh ~26–44, .devcontainer/scripts/version-check.sh ~204+) are line-based case DEVCONTAINER_VERSION=* matchers that skip unknown keys; nothing sources the file; docker-compose consumes the version only via the .env bridge. DEVCONTAINER_VERSION itself is not renamed here (it is sed-rewritten by release.yml ~532–539 and sparse-checked-out by several workflows) — key renames ride the #781 devkit rename with a read-both shim. New keys are named DEVKIT_* from the start so #781 does not have to touch them. All modes — including bare — keep writing DEVCONTAINER_VERSION (scaffold-version provenance, one code path).
2. Make init-workspace.sh read the manifest before prompting. Precedence: explicit flag/env > .vig-os value > prompt/default. Write back whatever was resolved (same sed/append pattern as the #852 version pin, init-workspace.sh ~398–405). Upgrades of a manifest-bearing repo become non-interactive and shape-preserving by default.
3. Add bare mode. Ships: root justfile + managed recipe file, justfile.project/justfile.local, .pre-commit-config.yaml, .github/ CI, pyproject.toml scaffolding, .vig-os. Prunes: .devcontainer/, flake.nix, .envrc (with the same pre-existence guards as #738/#859). Requires a host-native variant of the shipped ci.yml: the current template is container-based (resolve-image → jobs run inside the image), which is meaningless without an image — the bare variant runs on the runner with uv set up directly.
4. Migration/inference for existing consumers (no DEVKIT_MODE yet): infer conservatively on upgrade — populated .devcontainer/ + scaffold-stub flake ⇒ both; .devcontainer/ only ⇒ devcontainer; flake/envrc only ⇒ direnv. Ambiguous combinations (e.g. .devcontainer/ + consumer-authored flake, the #859 case) resolve to the wider mode and print what was inferred; interactive runs confirm. Never reshape a repo based on inference alone. On first upgrade, append the inferred/resolved keys to the legacy file so it self-documents from then on.
5. Mode switching is destructive (e.g. both → bare deletes .devcontainer/): out of scope here — the upgrade-guard issue (dedicated clean branch + diff preview) owns that; this issue only requires that a mode change never happens implicitly.
Alternatives Considered
- TOML/JSON manifest — structured, but breaks the three tolerant line parsers and the
release.ymlsed, and adds a parser dependency to host-side shell (initialize.shruns on the host before any container exists). Flat KV keeps every current consumer working; revisit only ifDEVKIT_MODULESoutgrows a quoted space-separated list. - Persisting mode in
devcontainer.jsonorflake.nix— circular: those files only exist in some modes; the manifest must exist in all of them. - Keeping mode as an install flag + better docs — does not fix upgrade drift or enable non-interactive shape-preserving upgrades.
- Naming new keys
VIG_OS_*or unprefixed — would need renaming again at [CHORE] Rename devcontainer → devkit (after publish-cutover #639) #781;DEVKIT_*is stable across the rename.
Additional Context
- Depends on fix(workspace): scaffold upgrade strands base recipes — justfile.project is preserved but now owns sync/precommit/test, breaking the shipped ci.yml #877:
direnv/bareviability requires the CI-contract recipes (sync,precommit,test, …) to live in a managed file outside.devcontainer/— today the managed imports are all.devcontainer/justfile.*(rootjustfiletemplate), so a no-.devcontainer/repo has only the preservedjustfile.project. fix(workspace): scaffold upgrade strands base recipes — justfile.project is preserved but now owns sync/precommit/test, breaking the shipped ci.yml #877's relocation decision should be made withbarein mind. - Coordinates [CHORE] Rename devcontainer → devkit (after publish-cutover #639) #781 (devcontainer → devkit rename):
DEVCONTAINER_VERSIONalias/shim and any future.vig-os→.devkitfile rename land there, reading the old name when the new one is absent. - Relates to feat(workspace): generate .pre-commit-config.yaml from the flake (git-hooks.nix) — composable base hooks, consumer-extensible in the project flake #883 (flake-generated hooks — its raw-YAML opt-out flag should live in this manifest) and feat(flake): modular capability shells — opt-in vigos capability modules (native, geant4, rust, …) on top of mkProjectShell #884 (capability shells —
DEVKIT_MODULESis reserved as their scaffold-level declaration) and the planned upgrade-guard issue (owns destructive mode switches). - Prior art in-repo: Smoke-test dispatch failed for 0.4.0-rc1 #852 (write-back of the version pin post-scaffold), [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 (mode-prune pre-existence guards — symptoms of non-persisted mode).
Tasks
- Define the
.vig-oskey set (DEVKIT_MODE,DEVKIT_PROJECT,DEVKIT_ORG,DEVKIT_REPO,DEVKIT_MODULESreserved) and document it indocs/MIGRATION.md+ template comments -
init-workspace.sh: read-manifest-before-prompt precedence; write back resolved values; never change persisted mode implicitly -
install.sh: forward/read the same keys; drop the requirement to re-pass--modeon upgrade - Mode inference for legacy consumers (conservative, transparent, confirm when interactive); append inferred keys on first upgrade
- Implement
baremode: template prune set + pre-existence guards - Host-native
ci.ymlvariant forbare(no resolve-image/container jobs) - Tests: scaffold/upgrade matrix across all four modes × (fresh | legacy-no-manifest | manifest-bearing); parser tolerance test (unknown keys ignored)
- Changelog entry
Acceptance criteria
- A repo scaffolded in any mode upgrades with
--forceand no mode/identity flags and keeps its shape and names. - Legacy consumers (version-only
.vig-os) upgrade without breakage; inferred mode is printed and persisted. baremode produces no.devcontainer/, noflake.nix/.envrc, and green CI on the host-native workflow.- Existing CI consumers of
.vig-os(resolve-image, initialize.sh, version-check.sh) are byte-for-byte unaffected by the new keys.
Impact
- Who benefits: every consumer repo (shape-preserving upgrades), pure-Python/standards-only repos (
bare), and the module work (declaration point). - Compatibility: backward compatible (
semver:minor) — new keys are additive; all existing parsers ignore them;DEVCONTAINER_VERSIONsemantics unchanged.
Changelog Category
Added
Activity
feat(flake): opt-in capability modules on mkProjectShell (native firs…
feat(setup): preflight guard for scaffold upgrades and --preview diff…
feat(flake): generate .pre-commit-config.yaml from one flake hook def…
test(workspace): expose the torn-manifest window that poisons DEVKIT_…
fix(workspace): close the torn-manifest window on aborted upgrades
ci(workspace): pin rust-just and prek in the bare-mode ci.yml
docs(workspace): flag env-var prompt suppression and record review fixes
test(workspace): isolate torn-state case from the CI GITHUB_REPOSITOR…
feat(workspace): .vig-os declarative manifest with persisted mode/ide…
c-vigo commentedon Jul 8, 2026
Delivered by #911 (merged to
devon 2026-07-07). Closing as complete for milestone 0.5.fix(workspace): ship nested scaffold docs + fix imageless DEVKIT_ORG …
chore: release 0.5.0 (#938)
feat(manifest): dual-key DEVKIT_VERSION pin parser with legacy fallba…