Skip to content

feat(workspace): .vig-os declarative manifest with persisted mode/identity and bare mode - #911

Merged
c-vigo merged 14 commits into
devfrom
feature/885-vig-os-manifest-bare-mode
Jul 7, 2026
Merged

c-vigo merged 14 commits into
devfrom
feature/885-vig-os-manifest-bare-mode

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Promotes .vig-os from a single-purpose version pin into the project's declarative manifest and adds the new bare delivery mode.

Closes #885

Type of Change

  • feat -- New feature

Modifiers

  • Breaking change (!) -- backward compatible (semver:minor); all existing .vig-os parsers are byte-for-byte unaffected (regression-tested).

Changes Made

Changelog Entry

Added

  • .vig-os project manifest and new bare delivery mode (#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, pyproject.toml, .vig-os), prunes .devcontainer//flake.nix/.envrc behind 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-native ci.yml (no image resolution, no container jobs — setup-uv on the runner drives the same just sync|precommit|test contract).

(mirrored in assets/workspace/.devcontainer/CHANGELOG.md)

Testing

  • Tests pass locally (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 performed (describe below)

Manual Testing Details

  • TDD: each sub-feature landed as a RED bats commit (verified failing) followed by its GREEN implementation commit.
  • Full hook suite green locally: 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.
  • The 9 githooks.bats failures observed in a nix dev-shell are pre-existing and environmental (IN_NIX_SHELL set); all 12 pass with env -u IN_NIX_SHELL. No .githooks files are touched by this PR.

Checklist

Review follow-up

Addresses the review on the torn-manifest window plus the nits, belt and braces:

  • Torn-state fix (defect): the template .vig-os now ships DEVKIT_MODE= (empty = unset to every parser), and init-workspace.sh persists the resolved DEVKIT_MODE/DEVKIT_PROJECT/DEVKIT_ORG immediately after the template rsync — before any abort-capable step (notably resolve_github_repository). An upgrade aborted inside the window (e.g. --no-prompts on a legacy tree with a non-github origin) can no longer persist DEVKIT_MODE=both in a direnv-shaped repo, so the next --force run infers/refuses as if the torn run never happened. DEVKIT_REPO stays in the late write-back (only known after origin resolution); DEVKIT_PROJECT/ORG/REPO already 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.
  • Pinned bare CI tools (nit): the bare ci.yml now installs rust-just==1.51.0 and prek==0.3.11 — the versions the flake toolchain ships — with a comment noting the Renovate/manual bump path.
  • MIGRATION.md (nit): explicitly flags that SHORT_NAME/ORG_NAME env 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 precommit exits 0 (52 hooks passed).

c-vigo added 9 commits July 7, 2026 16:09
…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 c-vigo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

c-vigo added 5 commits July 7, 2026 16:48
…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
MIGRATION.md now states explicitly that SHORT_NAME/ORG_NAME environment
variables suppress the interactive prompts (precedence flag/env >
manifest > prompt); the #885 changelog entry records the torn-manifest
hardening and the pinned bare-mode CI tools.

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
@c-vigo
c-vigo merged commit 55bbac6 into dev Jul 7, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/885-vig-os-manifest-bare-mode branch July 7, 2026 15:13
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