Repository navigation
feat(nix): migrate the devcontainer to a Nix toolchain + Claude-native setup (#625) - #670
Conversation
Replace the cursor-agent invocations in the worktree recipes with the claude CLI. worktree-start/worktree-attach now launch 'claude --dangerously-skip-permissions' in the tmux session, mapping 'agent chat --yolo --approve-mcps' (autonomous, auto-approve shell and MCP prompts) onto claude's permission-bypass flag. The cursor-specific directory-trust helper and the 'tmux send-keys a' approval trigger are no longer needed and are removed. Prerequisite, auth (claude auth status/login, ANTHROPIC_API_KEY), requirements.yaml, and the generated docs now reference the claude CLI. Refs: #627
Replace Debian/FHS-specific assertions in tests/test_image.py with path-agnostic equivalents so the suite is valid against both the current Debian image and the future Nix image: - convert dpkg host.package(...).is_installed checks (git, curl, openssh-client, nano, tmux, rsync) to --version/-V runs - resolve gh, just, hadolint, taplo and cargo-installed tools via PATH (command -v) instead of hardcoded /usr/local/bin, /root/.cargo/bin and /root/.local/bin locations - drop the DEBIAN_FRONTEND env assertion and apt-sourced version-prefix checks (git, curl, tmux, rsync) from EXPECTED_VERSIONS Refs: #635
Move agent rules and skills from .cursor/ to .claude/ and delete the root .cursor/ directory: - Move the 30 skills to .claude/skills/ and rewrite the 29 .claude/commands/*.md wrappers to point at the new paths and .claude-located rules. - Split the 7 .cursor/rules/*.mdc: static principles (coding-principles, commit-messages, changelog, single-source-of-truth) are consolidated into CLAUDE.md; workflow rules (branch-naming, tdd, subagent-delegation) become on-demand .claude/skills/. - Port agent-models.toml and worktrees.json to .claude/. - Update path consumers: docs/generate.py scan path, the check-skill-names and generate-docs pre-commit hooks, the check-skill-names and derive-branch-summary shell entrypoints, scripts/manifest.toml, docs/SKILL_PIPELINE.md(.j2), docs/RELEASE_CYCLE.md, CLAUDE.md command table, CODEOWNERS, label-taxonomy.toml, and the vig-utils README/tests. The downstream assets/workspace/.cursor/ template is left for #629. Refs: #626
## Summary Implements C1 (#626): make `.claude/` the single source of truth for agent rules and skills, removing the `.cursor/` indirection. - **Skills:** moved the 30 `.cursor/skills/*/SKILL.md` (and the `inception_explore/README.md` sibling) to `.claude/skills/`; rewrote the 29 `.claude/commands/*.md` wrappers to point at `.claude/skills/...` and `.claude/`-located rules. - **Rules split** (7 `.mdc`): static principles (`coding-principles`, `commit-messages`, `changelog`, `single-source-of-truth`) consolidated into `CLAUDE.md`; workflow rules (`branch-naming`, `tdd`, `subagent-delegation`) became on-demand `.claude/skills/` with `disable-model-invocation: true`. - **Config:** ported `agent-models.toml` and `worktrees.json` to `.claude/`. - **Path consumers updated:** `docs/generate.py` scan path + docstrings; `.pre-commit-config.yaml` (`check-skill-names` entry/`files`, `generate-docs` `files` now also fires on `.claude/skills/**/SKILL.md` — folds in #144); `check-skill-names.sh` and `derive-branch-summary.sh` defaults; `scripts/manifest.toml`; `docs/SKILL_PIPELINE.md(.j2)`; `docs/RELEASE_CYCLE.md`; `CLAUDE.md` command table + rule pointers; `.github/CODEOWNERS`; `.github/label-taxonomy.toml`; vig-utils `README.md` and tests. - **Deleted** the root `.cursor/`. ## TDD - `packages/vig-utils/tests/test_claude_ssot.py` asserts no tracked file (outside `assets/workspace/`, archival `docs/issues|pull-requests|plans/`, and append-only `CHANGELOG.md`) references `.cursor/skills/`, and that root `.cursor/` is gone. Committed failing first (RED), then implementation (GREEN). ## Verification - All 492 vig-utils tests pass. - `pre-commit run --all-files` green. - `just docs` regenerates cleanly; command table intact (33 rows); the 3 new workflow skills do not leak into the table. - Every command wrapper resolves to an existing `.claude/skills/.../SKILL.md`; no `.cursor/` path in any wrapper; root `.cursor/` deleted. ## Coordination notes - The downstream `assets/workspace/.cursor/` template is **#629 (C4)'s** scope and is intentionally left in place. The mandatory `sync-manifest` pre-commit hook now also propagates `.claude/skills/` + `.claude/worktrees.json` into `assets/workspace/.claude/`; the stale `assets/workspace/.cursor/` tree is for #629 to remove. - `justfile.worktree` recipe bodies were not edited (C2/W2). The `~/.cursor/cli-config.json` reference in `SKILL_PIPELINE.md` is the cursor-agent CLI runtime (#627) and was left untouched. - #144 is effectively resolved by the updated `generate-docs` hook filter. Refs: #626
…' into feature/627-worktree-claude-cli # Conflicts: # CHANGELOG.md # assets/workspace/.devcontainer/CHANGELOG.md
…' into feature/635-portable-testinfra # Conflicts: # CHANGELOG.md # assets/workspace/.devcontainer/CHANGELOG.md
## Summary Implements C2 (#627): replaces the `cursor-agent` CLI with the `claude` CLI throughout the worktree pipelines. This is a functional change — the recipes now drive `claude` end-to-end. ### Changes - **`justfile.worktree`** (+ synced template `assets/workspace/.devcontainer/justfile.worktree`, regenerated via `sync-manifest`): - Prereq check `command -v agent` → `command -v claude` (install hint → `npm install -g @anthropic-ai/claude-code`). - Auth block `agent status`/`agent login`/`CURSOR_API_KEY` → `claude auth status`/`claude auth login`/`ANTHROPIC_API_KEY`. - tmux launches `agent chat --yolo --approve-mcps "$PROMPT"` (and no-prompt `agent chat --approve-mcps`) → `claude --dangerously-skip-permissions "$PROMPT"` / `claude --dangerously-skip-permissions`, in all three sites (existing-worktree, new-worktree, attach-restart). - Removed the cursor-specific `_wt_ensure_trust` helper + calls and the `tmux send-keys "a"` approval trigger (no longer needed — see decisions). - **`scripts/requirements.yaml`**: `agent` (cursor.com installer) entry → `claude` entry (`command -v claude`, `claude --version`, `npm install -g @anthropic-ai/claude-code`). - **Docs**: `README.md` / `CONTRIBUTE.md` recipe help regenerated; `docs/templates/SKILL_PIPELINE.md.j2` (and generated `docs/SKILL_PIPELINE.md`) updated to describe the `claude` runtime. - **`tests/bats/worktree-claude-cli.bats`**: lightweight recipe-grep tests (no `cursor-agent`/`agent chat` survives; `claude` is driven; prereq checks `claude`). The full `worktree.bats` functional rewrite is C5's (#630) — not done here. - **`CHANGELOG.md`** Unreleased / Changed entry. ### Decisions (flag-mapping) - `--yolo` (auto-approve shell commands) **and** `--approve-mcps` (auto-approve MCP servers) both map onto **`claude --dangerously-skip-permissions`**, which bypasses all permission and MCP approval prompts — the autonomous, no-human-at-terminal equivalent. - **tmux pattern kept**: the detached `tmux new-session` driving is retained (so `worktree-attach`, list/stop/clean lifecycle and idle/dashboard features still work). The prompt is now passed as a positional arg to `claude` at launch instead of via the interactive session, so the post-launch `send-keys "a"` accept-trigger (which dismissed cursor-agent's trust prompt) is **removed** — `--dangerously-skip-permissions` means there is no prompt to accept. - **Trust helper removed**: `_wt_ensure_trust` wrote `~/.cursor/cli-config.json` `trustedDirectories`, which is cursor-agent-only and unread by `claude`; with `--dangerously-skip-permissions` directory trust is moot, so it is dead code and was dropped. `jq` requirement stays (still used for issue-metadata parsing). - Did **not** touch `_read_model`/`.cursor/agent-models.toml` or `.cursor/rules` paths (W1/C1's domain). ### Verification - `grep -n 'cursor-agent\|agent chat' justfile.worktree assets/workspace/.devcontainer/justfile.worktree` → empty. - `scripts/requirements.yaml` lists `claude`, not `agent`. - `just precommit` → all hooks green (including `sync-manifest`, `generate-docs`, `shellcheck`, `just` format). - `just --list` parses the worktree recipes; help text shows "launch the claude CLI". Refs: #627
…' into feature/635-portable-testinfra # Conflicts: # CHANGELOG.md # assets/workspace/.devcontainer/CHANGELOG.md
…es (#645) ## Summary Makes `tests/test_image.py` path-agnostic (T2.2) so the testinfra suite stays valid against **both** the current Debian image and the future Nix image. Pure test refactor — no `conftest.py` image source/name changes. - Convert dpkg `host.package(...).is_installed` checks (`git`, `curl`, `openssh-client`, `nano`, `tmux`, `rsync`) to `--version`/`-V` runs via a small `assert_tool_runs` helper. - Resolve `gh`, `just`, `hadolint`, `taplo` and cargo-installed tools via PATH (`command -v`, new `assert_tool_on_path` helper) instead of hardcoded `/usr/local/bin`, `/root/.cargo/bin`, `/root/.local/bin`. - Drop the `DEBIAN_FRONTEND` env assertion and the apt-sourced version-prefix checks (`git`, `curl`, `tmux`, `rsync`) from `EXPECTED_VERSIONS`. - Reviewed the `/root/assets/workspace/` mount assertions: they use POSIX `host.file(...)` checks on image-controlled `/root/...` paths (not Debian-FHS/dpkg), so they are already portable and left functionally intact. Note: bumped the manually-installed `just` version pin `1.53.` -> `1.54.` to match the current latest-release binary in the image (the old pin was already failing on a fresh build, independent of this refactor). ## Verification - Built the Debian image with isolated tag `wt635` (`./scripts/build.sh wt635 ...`), no `:latest`/`:dev` clobber, nothing pushed. - `just test-image wt635`: **64 passed in 193.32s** (green). - `just precommit`: all hooks pass. - No Debian/FHS-only assertions remain (no `is_installed`/`host.package`, no hardcoded `/usr/local/bin` etc., no `DEBIAN_FRONTEND`, no apt version prefixes) — remaining textual matches are docstrings/comments only. Refs: #635
Delete the unpinned cursor.com/install build step and its /root/.local/bin PATH entry, leaving an all-nixpkgs toolchain ahead of the Nix migration. Refs: #628
Remove test_cursor_agent_installed, which asserts a feature removed in the same change; keeps the suite coherent and green. Refs: #628
Remove the CVE-2026-55388 (piscina) .trivyignore entry, which only existed for the now-removed cursor-agent CLI. Refs: #628
Replace the stale assets/workspace/.cursor/ template tree with the Claude-native .claude/ payload (skills, agent-models.toml, worktrees.json) via the sync manifest, and drop Cursor editor glue: - Remove assets/workspace/.cursor/; add .claude/agent-models.toml to the workspace sync manifest so the template carries the same payload the old .cursor/ template did. - Drop the cursor-remote-ssh socket glob from verify-auth.sh. - Drop the command -v cursor fallback in justfile.devc open recipe (VS Code only). - COMMIT_MESSAGE_STANDARD.md: VS Code / Cursor -> VS Code. Refs: #629
## C4 #629 — Migrate templates & editor glue off Cursor (VS Code only) Reconciles the workspace template left behind by C1 (#626) and removes the remaining Cursor **editor** glue in #629's scope. Decision: **VS Code only**. ### Changes - **Template `.cursor/` → `.claude/`**: deleted the stale `assets/workspace/.cursor/` tree. C1's sync-manifest hook already propagated `.claude/skills/` and `.claude/worktrees.json`; this PR adds `.claude/agent-models.toml` to `scripts/manifest.toml` so the template carries the **same payload the old `.cursor/` template did** (skills + agent-models.toml + worktrees.json). The template's synced `subagent-delegation` skill references `agent-models.toml`, so this also fixes a dangling reference C1 left. - **`verify-auth.sh`**: dropped the `/tmp/cursor-remote-ssh-*.sock` glob from the SSH-agent socket scan. - **`justfile.devc`**: `open` recipe now launches VS Code only (removed the `command -v cursor` fallback). - **`docs/COMMIT_MESSAGE_STANDARD.md`** (root SSoT + synced template copy): "VS Code / Cursor" → "VS Code". - **CHANGELOG**: added an `## Unreleased` Changed entry. ### Scope boundaries (intentionally NOT touched) - `justfile.worktree` and `solve-and-pr/SKILL.md` `cursor-agent` references → owned by **#627** (worktree pipelines cursor-agent → claude); they sync from the root SSoT, so editing them here would collide with #627. - `.github/agent-blocklist.toml` "cursor" entries → AI commit-identity blocklist, explicitly **kept** per **#630**. Not editor glue. - `setup-git-conf.sh` had no remaining `cursor` references on the epic tip. ### TDD - RED: `tests/bats/init-workspace.bats` — assert template scaffolds `.claude/` (+ `skills/`), does NOT scaffold `.cursor/`, and carries no `cursor-remote` / `command -v cursor` glue. Committed failing first. - GREEN: implementation makes all four pass; full `init-workspace.bats` suite 27/27 green. - Build-free rationale: the integration `initialized_workspace` fixture requires a container image build (out of bounds this batch). `init-workspace.sh` rsyncs `assets/workspace/` verbatim, so structural assertions on the template tree are a faithful proxy for what new workspaces scaffold. ### Verification - `just precommit` — all hooks pass (sync-manifest, check-skill-names, generate-docs, shellcheck, taplo, etc.). - `grep -rn 'cursor' assets/workspace justfile.devc` (excluding CHANGELOG prose) returns only the out-of-scope #627/#630 hits listed above. - No `assets/workspace/.cursor/` remains. Refs: #629
Removes the unpinned `cursor-agent` CLI install from the devcontainer image and the CVE ignore tied to it. - Delete the cursor-agent install block from `Containerfile` and `build/Containerfile` (+ dead PATH note) - Drop `CVE-2026-55388` (piscina, bundled in cursor-agent) from `.trivyignore` - Remove the now-invalid `test_cursor_agent_installed` image test (atomically coupled to the install removal; pre-empts that one bullet of C5 #630) - Changelog entry Verification deferred to CI (image suite): build + image tests + Trivy security scan. Local build was not completed in-worktree. Refs: #628
…650) ## Summary Implements C5 (#630) of the Nix/Claude migration epic (#625): adapts the Cursor-coupled worktree test to the `claude` CLI and locks in the AI-identity blocklist so removing Cursor never weakens the org "never name an AI in history" control. - **`tests/bats/worktree.bats`** — replaced the `send-keys 'a' approves agent trust prompt` case (which skipped on `command -v agent` and asserted `"Cursor Agent"`) with `claude CLI launches in tmux without an interactive trust prompt`: skips on `command -v claude`, launches `claude --dangerously-skip-permissions --version` the way the migrated recipes do, and asserts no trust prompt stalls the pane. No assertion expecting `cursor-agent`/"Cursor Agent" remains. - **Blocklist regression test** — added `TestCanonicalBlocklist` in `packages/vig-utils/tests/test_check_pr_agent_fingerprints.py` exercising the REAL `.github/agent-blocklist.toml` (not a mock): a parametrized test proves BOTH `cursor` and `claude` are rejected in a commit message, plus a guard that both names stay in the blocklist. The `cursor` entries are intentionally kept. - **CHANGELOG** — `## Unreleased` Changed entry for #630. ## Reconciliation with C2 (#627) C2 added `tests/bats/worktree-claude-cli.bats` (static recipe-grep: justfiles drive `claude`, no `cursor-agent` survives). That file is kept as-is — it covers the recipe layer. This PR covers the complementary runtime/behavioral layer in `worktree.bats`, so there is no duplication. C3 (#628) already removed `test_cursor_agent_installed`; not touched. ## Verification - `just precommit` — all hooks pass. - `uv run pytest` (vig-utils) — 495 passed (incl. 3 new blocklist tests). - `CI=true npx bats tests/bats/worktree.bats tests/bats/worktree-claude-cli.bats` — 13 passed (tmux integration cases skip under CI by design). - Blocklist test confirmed proving cursor + claude both rejected against the canonical TOML. Done via TDD: blocklist regression test committed first (passes against current blocklist as a guard), then the bats rewrite, then the changelog. Refs: #630
Factor a single devTools list as the source of truth shared by the dev-shell now and the image later. Absorb the #545 agent-CLI toolkit (rg, fd, bat, eza, delta, lazygit, zoxide, starship, freeze, expect, neovim, claude). Pin nixpkgs to nixos-25.05 and overlay fast-movers (uv, gh, claude-code) from nixpkgs-unstable. Add reusable lib.mkProjectShell, overlays.default and a packages.devcontainerImage stub, and refresh flake.lock. Refs: #631
Build the flake dev-shell and push its closure to the vig-os Cachix cache via cachix/install-nix-action (upstream CppNix) + cachix/cachix-action. The job is a standalone, non-required workflow with continue-on-error so it never affects the existing CI gate, and adds workflow_dispatch for on-branch validation. Refs: #631
## Summary Implements **T1.1 (#631)** — collapses the flake dev-shell and the (future) image tool list into a single `devTools` source of truth and lays the reusable flake outputs the rest of the Nix track depends on. ### What changed - **Single `devTools` SSoT** in `flake.nix` — shared basis for the dev-shell now and the image later (#634). Absorbs the #545 agent-CLI toolkit (`rg`, `fd`, `bat`, `eza`, `delta`, `lazygit`, `zoxide`, `starship`, `freeze`, `expect`, `nvim`) plus `claude`, on top of the existing toolchain (`just`, `git`, `gh`, `uv`, `nodejs`, `jq`, `tmux`, `shellcheck`, `hadolint`, `taplo`, `podman`). - **Channel switch** — `nixpkgs` pinned to `nixos-25.05`; new `nixpkgs-unstable` input overlaid **only** for fast-movers `uv`, `gh`, `claude-code`. `flake.lock` refreshed. - **Reusable outputs** — `lib.mkProjectShell` (downstream repos build the shared shell + extra packages), `overlays.default` (the fast-mover overlay), and a `packages.devcontainerImage` **stub** (placeholder; real image is T2.1/#634). - **Cachix CI** — new non-blocking `nix-cachix.yml` workflow that builds the dev-shell and pushes its closure to the `vig-os` cache. - **TDD parity test** — `tests/test_flake_devshell.py` reads the binary names straight from the flake (`nix eval .#devShellTools.<system>`) and runs `nix develop -c <tool> <version-flag>` for each, so it can never drift from `devTools`. ### How `claude` is provided `claude` is the **`claude-code`** package from nixpkgs (binary `claude`, via `meta.mainProgram`). It is a fast-mover, so it is sourced from `nixpkgs-unstable` through `overlays.default` (unstable `2.1.x` vs stable `1.0.85`). No custom fetch/overlay-from-scratch needed — it is packaged cleanly in nixpkgs. > Note: nixpkgs `freeze` is an EDR-bypass payload toolkit (optiv/Freeze), **not** the charmbracelet terminal-screenshot tool #545 intended. Used **`charm-freeze`** (binary `freeze`) instead. ### Evaluator choice + rationale **Upstream CppNix** via `cachix/install-nix-action` (SHA-pinned `v31.10.6`). It is the most broadly supported installer, pairs natively with `cachix/cachix-action`, and needs no extra infra. The flake is **installer-agnostic** — swapping to the Lix `lix-installer` or the Determinate installer requires **zero flake changes**, so this decision is cheaply reversible. ### Cachix wiring - `cachix/install-nix-action@…v31.10.6` (flakes enabled) → `cachix/cachix-action@…v17` with `name: ${{ vars.CACHIX_CACHE }}` and `authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}` (token never printed/hardcoded). - Builds `nix develop --profile dev-profile` and pushes `nix path-info -r ./dev-profile | cachix push`. - **Non-blocking:** standalone workflow (not a required check) + `continue-on-error: true` → existing CI is unaffected. - Adds **`workflow_dispatch`** plus a push trigger on the epic branch for on-branch validation. - Actions are SHA-pinned per `check-action-pins` policy. ### Verification (local, against the public `vig-os` cache) - `nix flake check` → **all checks passed** (`devShellTools` shows only a benign "unknown flake output" warning). - `tests/test_flake_devshell.py` → **2 passed** — every one of the 23 tools runs inside `nix develop` (incl. `claude --version`, `nvim --version`, `rg --version`, `freeze --version`, `tmux -V`, `expect -v`). - `just precommit` → **all hooks pass** (incl. `check-action-pins`, agent-identity, yamllint). ### TDD trail - `test(nix):` failing parity test committed first (RED). - `feat(nix):` flake SSoT + outputs making it pass (GREEN). - `ci(nix):` non-blocking Cachix workflow. Refs: #631
Switch .envrc from bare `use flake` to nix-direnv so the dev-shell evaluation is GC-rooted and cached under .direnv/, making re-entry instant and protecting the closure from garbage collection. nix-direnv self-bootstraps on first `direnv allow` and falls back to bare `use flake` when unavailable. Document the clone -> `direnv allow` onboarding flow, the vig-os Cachix substituter (binary fetch instead of from-source build on first allow), and enabling the nix-command/flakes experimental features in the CONTRIBUTE.md.j2 source template; regenerate with `just docs`. Folds in the Nix-flake-as-alternative-dev-setup documentation request. Refs: #633
Add a provision-via-flake mode to the setup-env action that installs Nix (SHA-pinned) plus the vig-os Cachix substituter, builds the flake dev-shell, and prepends its tools to PATH so subsequent steps run inside the shell. The ad-hoc installs of uv/Python, just, hadolint, and taplo are gated off in this mode; podman, Node.js, BATS, and the devcontainer CLI keep their dedicated paths. Enable the mode across the CI build/test path (build-image, test-image, test-integration, project-checks). The Debian image is still built unchanged and the Docker type=gha cache stays intact. Refs: #632
Split the substituters/trusted-public-keys lines into whitespace tokens and assert exact membership instead of URL-substring-in-string, clearing the CodeQL py/incomplete-url-substring-sanitization alerts and making the assertions stricter. Refs: #784
… url-substring) (#785) Closes #784. CodeQL flagged two high-severity `py/incomplete-url-substring-sanitization` alerts at `tests/test_image.py:1118,1121` — the #773 `nix.conf` assertions used `"https://cache.nixos.org" in sub_line` (URL-substring-in-string), which CodeQL treats as bypassable host validation. **Fix:** split the `substituters` / `trusted-public-keys` lines into whitespace tokens (`split("=", 1)[1].split()` — maxsplit=1 preserves the base64 keys' trailing `=`) and assert **exact membership** in the token list. Clears the alerts and tightens the assertion (URL/key must be a whole token, not an accidental substring). No behaviour change; test-only. Verified: `ast.parse` OK, `ruff check` + `ruff format --check` clean. In-container assertions validated by the dispatched image-suite CI.
Took you up on the offer — all of A–E are now filed as tracked, scoped issues, with the move-in/stay-out (relocate-vs-eliminate) framing preserved in each body. I also pulled the two small, low-risk A items onto the migration branch now rather than deferring them, since one is security-critical and both are cheap; everything heavier stays sequenced as you intended. Done now — landed on the migration branch (sub-issues of #625)
Deferred — sequenced follow-ups (separate issues, NOT on this branch)
Agree these deserve their own focused PRs — bundling the architectural ones (uv2nix, sops-nix, garnix, Cachix) into #670 would defeat the gating. Thanks again for the depth here; the Tier-0 move-in/stay-out table in particular made #779 trivial to scope. |
gerchowl
left a comment
There was a problem hiding this comment.
Approve ✅ (for the gated scope)
Did a second verification round against the updated branch — not just reading the reply, but checking the diffs and CI. Everything load-bearing is genuinely landed:
- B1 — release retag —
release.yml:1004-1008captures the loaded tag (docker load | sed -n 's/^Loaded image: //p') and retags from it; no more static$BUILD_VERSION-$archassumption against the bakednix-devtag. ✔ - B2 — vulnix gate on publish — dedicated
vulnix-gatejob (release.yml:807) over.#devcontainerImageEnv, in bothpublish's androllback'sneeds:, with the cancelled/failure guard. Hard CVE gate on the publish path now. ✔ - M1 — two-sided parity gate —
tests/test_image.pyreads the tool list fromnix eval .#devShellTools(never hardcoded), parametrizes per-tool, and asserts each resolves on PATH inside the running container. The "never drift" claim is now backed by an actual image-side gate. ✔ - M2 — fail-loud gate —
vulnix_gate.py:72-76blocks on unscored (score is None) findings;security-scan.yml:85-90drops the blanket|| trueand fails on a vulnix exit > 2. ✔
CI is green across the board, including the now-blocking Security Scan (9m44s). The remaining majors/nits are all attributed to merged sub-PRs with issue refs, and A–E are filed as #773–#781 with the relocate-vs-eliminate framing intact — with the two cheap/security-critical A items (#773 baked accept-flake-config removal, #774 uvPythonDownloadsJsonUrl drift) correctly pulled forward.
One non-blocking observation on M1: the parity gate skips (rather than fails) if nix eval can't resolve the tool list at collection time. The reasoning in the comment is sound (both image-test lanes provision nix), but it does mean a future CI change that drops nix from the test-image lane would turn the gate into a silent green skip rather than a failure. Worth a one-line guard later (e.g. assert the list is non-empty in the lanes that should have nix) — not a merge concern.
Accepted carve-out: the unparenthesized except A, B: — agreed. The repo is 3.14-only and ruff format (PEP 758) removes the parens, so parenthesizing would fail the formatter gate. My original concern was the pre-3.14 SyntaxError, which is moot here.
Model review loop — every item addressed traceably, the architectural work correctly kept out of #670 to preserve the gating, and one well-reasoned pushback. Approving on the understanding that the versioned/:latest publish-cutover remains the separate, deliberate step after this merges (#639), where B1/B2 first do real work.
…#787) ## Summary Design-first ADR (issue #780, PR #670 roadmap thread D) recording the secrets-management **pattern** — not a migration. - `docs/security/ADR-secrets-management.md` — the decision record: - **Two secret classes:** runtime/downstream-consumer secrets → **sops-nix + age** (each consumer decrypts with their own key, no per-repo GitHub-secret dance); cloud/registry auth → **GitHub OIDC** (the real no-stored-secret lever). GitHub App installation tokens (`RELEASE_APP_*`, `COMMIT_APP_*`) stay as-is. - **Honest trust-model caveat:** on GitHub-hosted runners SOPS *relocates* the root of trust to one bootstrap key (`SOPS_AGE_KEY`) — it does not eliminate the GitHub secret. Only OIDC reaches zero stored credentials. - **Current landscape cited (file:line):** GHCR-via-`GITHUB_TOKEN` and keyless cosign are already correct; per-secret OIDC/sops/keep classification table. - **Concrete "now" lever:** honestly, OIDC retires zero *current* secrets today (GHCR already tokenless, cosign already keyless, App keys must stay); the win is preventive (never add a stored registry/cloud PAT — federate) plus `CACHIX_AUTH_TOKEN` as the one realistic future migration target. - `docs/security/examples/sops-nix/` — a small, clearly-marked **inert** reference example (`.sops.yaml`, plaintext `secrets.example.yaml`, `example.nix`, README). Placeholder recipients, no real key material, not wired into any live path. - `CHANGELOG.md` — one `Added` entry (mirrored to the workspace template copy by the managed sync-manifest hook). ## Relationship to #786 This is the **plumbing** layer (how secrets are stored/delivered); #786 is the **agent-behaviour** layer (how an agent must act around a secret). They compose and do not restate each other — the ADR cross-links #786 and vice-versa. No workflow is modified. Design only. Refs: #780
…tall` (#777) (#790) ## Summary Lands the **A7 flake-polish bucket** (roadmap thread A, PR #670 review), full scope per the plan: - **treefmt-nix** — `nix fmt` and the flake format gate now run `treefmt` across nix (`nixfmt-rfc-style`), python (`ruff-format`), and toml (`taplo`) in one pass, wrapping the same formatters the pre-commit hooks already run. `checks.format` → `checks.formatting` (`treefmt --fail-on-change`). - **deadnix + statix** — new `checks.deadnix` / `checks.statix` (scoped to the authored `flake.nix`; the downstream scaffold + example keep their idiomatic `{ self, … }` signatures), and both join `devTools`. Fixed the two findings this surfaced: unused overlay args (`_final`/`_prev`) and `inherit (pkgs) vulnix`. - **Modules** — `nixosModules.default` / `homeManagerModules.default` install the shared `devTools` toolchain via `programs.vigos-devtools.enable = true`. - **Install app** — `apps.install`, so `nix run github:vig-os/devcontainer#install` bootstraps a consumer project straight from the flake (`install.sh` stays the behavior SSoT). ## Verification - `nix flake check --accept-flake-config` → **all checks passed** (formatting, deadnix, statix, devShell, devShellTools). - `nix run .#install -- --help` exits 0. - `tests/test_flake_checks.py` extended (TDD RED→GREEN): formatter is treefmt, checks expose the new gates, install app is runnable, both modules are exposed. 4 passed. - Pre-commit clean (nixfmt, pymarkdown, typos, sync-manifest, agent-identity). Docs: `docs/NIX.md` (formatting/checks/modules/install app) + `CHANGELOG.md` (Added + Changed). Refs: #777
Migrate the devcontainer to a Nix toolchain
This epic replaces the Debian-based devcontainer (a
Containerfileonpython:3.14-slim, provisioned withapt+ ad-hoc installers) with a Nixflake that is the single source of truth for one toolchain, delivered two
ways. It is a large change; this description is the reviewer's map of the new
paradigm. Per-change detail is in the
## Unreleasedsection ofCHANGELOG.md;onboarding/architecture is in
docs/NIX.md; the consumer-facing contract is indocs/MIGRATION.md(also shipped in the image).The paradigm
flake.nix'sdevToolslist defines the toolchainonce. A parity test (
tests/test_flake_devshell.py) guarantees the dev-shelland the image never drift. The old per-OS
requirements.yamldual-manifest isgone.
dockerTools.buildLayeredImage(no basedistro, no
Dockerfile FROM), bit-reproducible, built natively foramd64 + arm64 (no QEMU). Published as
ghcr.io/vig-os/devcontainer.nix develop/direnv,consumed as a flake input (
vigos.lib.mkProjectShell).install.sh --mode devcontainer|direnv|bothscaffolds either.flake.lockis the controlling versiondocument;
nixpkgsis pinned (nixos-26.05) with a thinnixpkgs-unstableoverlay for fast-movers (
uv,gh,claude). Renovate'snixmanager bumpsthe lock through the normal PR/CI gate.
uv/Python 3.14, Node, shell tooling, linters, agent toolkit). Extra language
toolchains (Rust/Go/cc) are sourced on-demand via a project flake's
extraPackagesor ad-hocnix shell, never baked into every consumer.vulnix(nixpkgs-nativeCVE scanner) + a CycloneDX SBOM; "advance the pinned
nixpkgsrev" is theprimary CVE lever. A nightly
vulnix-gateis the publish go/no-go signal.What reviewers should focus on
flake.nix—devTools,mkProjectShell, and thebuildLayeredImageassembly (the bootstrap layer that restores the FHS conveniences a pure-Nix
userland lacks:
/usr/bin/env, an arch-aware manylinux loader +LD_LIBRARY_PATH,a writable npm prefix, the baked project
.venv,/etc/nix/nix.conf, and adocker → podmanshim).setup-envprovisions flake tooling from the dev-shell (the SSoT) forevery job that actually consumes it — the image build/test jobs and the vulnix
CVE gate — while jobs that only run
uv-managed project tools or GitHub-nativeactions use the lighter ad-hoc setup; the
Nix Image (discovery)workflowbuilds + tests the image on both arches and runs an in-container Nix runtime
smoke test.
runtime on
LD_LIBRARY_PATH(gated to avoid leaking into FHS host binaries).Consumer-facing contract (see
docs/MIGRATION.md)No
apt;#!/usr/bin/envworks;npm -gresolves;dockermaps topodman(DooD via mounted socket); Python is uv-managed CPython 3.14 (pin
requires-pythonas a range, not an exact patch); manylinux wheels run;pre-commit
ruff/typoscome from the flake.Cross-stack validation (final image)
The finished image + bare-nix dev-shell were exercised live against one real
consumer per stack, in both delivery modes (container
:devandnix developagainst the flake input):vig-os/sync-issues-actionact/tsx/local-action),npm ci && build && test; bare-nixpython3+pre-commitexoma-ch/brother-printer.venv+ post-create,uv sync, in-image pre-commit incl.pymarkdown,just test, DooDexo-pet/playground-carlospymarkdown/ruff/typosin-image,just testvig-os/devcontainer-smoke-testdocker→podmanDooD (sibling container spawn), on-demandnixvig-os/scitadelextraPackages/nix shellWhat a consumer must adapt for the new environment (the image is a pure-Nix
userland, not Debian):
apt-basedpost-createsteps — there is noapt. Get tools from thebaked toolchain,
uv/npm, or Nix. (e.g. the old node-via-aptpattern andbrother-printer's
apt install libusbstep now no-op; the latter only affectsopt-in hardware tests.)
requires-pythonas a range, not an exact patch — an==3.14.xpin canbe unsatisfiable against the image interpreter. (The smoke-test repo still
carries a stale
==3.14.6; it heals from the template at the next releasedispatch — the
(
extraPackages) or an ad-hocnix shell, never the base image.CONTAINER_HOSTandDOCKER_HOSTpointed at the mountedsocket (the scaffolded
docker-compose.ymldoes this); literaldockercallsresolve through the
podmanshim.Scope / sequencing
This PR is validated end-to-end (CI green on both arches; a cross-stack live
sweep across TypeScript/Python/Rust/shell consumers in both modes). The
versioned/
:latestpublish-cutover is intentionally gated and remains aseparate, deliberate step after this merges.