Skip to content

build(devkit): adopt vigOS devkit 1.1.0 (direnv) — rollout pilot - #32

Merged
c-vigo merged 3 commits into
mainfrom
feature/29-adopt-devkit-direnv
Jul 14, 2026
Merged

c-vigo merged 3 commits into
mainfrom
feature/29-adopt-devkit-direnv

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adopt the vigOS devkit 1.1.0 (direnv) — first rollout pilot

First real deployment of the mode-aware devkit (1.1.0) to a consumer repo, in
direnv mode. This is the pilot for the wider vigOS rollout.

What changed

  • Replaced the legacy apt/Debian .devcontainer/ with the devkit 1.1.0
    direnv scaffold (Nix flake + .envrc, mode-aware CI, shared standards kit).
    Pruned via --prune-devcontainer, which removes the old post-create.sh
    (the Debian-only script from [BUG] post-create.sh masks failures (false 'tsx installed') and assumes apt/Debian base — breaks on Nix devcontainer #30).
  • Wired the Node toolchain for this JS action: nodejs in the flake
    dev-shell + npm-mapped justfile.project recipes (sync/lint/test/
    build/bundle). Build tools (tsc, jest, ncc, tsx, eslint, prettier) come
    from npm ci; nixpkgs provides node + npm.
  • Opted into the flake-generated pre-commit config (hooks = { }), so hooks
    use flake-sourced tools — fixes the typos hook, which previously downloaded
    a glibc binary that cannot run on NixOS. Adds commit-message validation +
    branch-naming enforcement.
  • Restored Node/Action .gitignore entries the Python-only scaffold dropped
    (node_modules/, *.tsbuildinfo, coverage/) and removed the blanket
    dist/ ignore so the committed dist/index.js bundle stays tracked.

Verification (local, NixOS, direnv)

  • just sync/lint/test/build/bundle all pass — 80 jest tests green, tsc
    compiles, ncc bundles dist/index.js.
  • just precommit fully green (typos now via the flake; no-commit-to-branch
    satisfied by this branch name).
  • Dev-shell delivers node v24.16.0 + npm 11.13.0 + the devkit toolchain with no
    Nix eval warnings.

Notes / follow-ups (not in this PR)

Closes #29
Closes #30

c-vigo added 2 commits July 13, 2026 18:50
Replace the legacy apt/Debian-based .devcontainer/ with the devkit 1.1.0
direnv scaffold: Nix flake + .envrc, mode-aware CI, and the shared standards
kit. Wire the Node toolchain for this JS action -- nodejs in the flake
dev-shell and npm-mapped justfile.project recipes (sync/lint/test/build/
bundle). Opt into the flake-generated pre-commit config (flake-sourced
tooling, NixOS-safe typos) and restore the Node/Action .gitignore entries the
Python-only scaffold dropped (dist/index.js stays committed).

Refs: #29
commit-action is a TypeScript action with no Python code; point the CodeQL
language matrix at javascript-typescript (+ actions). The repo's GitHub
default CodeQL setup was disabled so this advanced config is authoritative
(the two cannot coexist).

Refs: #29
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

The sync/lint/test recipes were mapped to npm, but `update` still ran
`uv lock --upgrade` unconditionally, which fails on a Node repo. Branch on
package.json -> `npm update`.

Refs: #29
@c-vigo
c-vigo merged commit 3fea654 into main Jul 14, 2026
9 checks passed
c-vigo added a commit that referenced this pull request Jul 14, 2026
## Unblock `Sync main to dev`

`dev` is stuck 4 commits behind `main` and cannot catch up: the sync
workflow has
been failing on every push to `main` since #32.

Failing run:
https://github.com/vig-os/commit-action/actions/runs/29314999211

### The bug

The `sync` job checks out `dev`, then invokes a **local** composite
action:

```yaml
      - name: Checkout dev
        with:
          ref: dev                                        # ← workspace is now dev's tree
      - name: Set up devkit toolchain
        uses: ./.github/actions/setup-devkit-toolchain    # ← resolved from dev's tree
```

GitHub resolves `uses: ./…` against the **checked-out workspace**, not
the
workflow's ref. `.github/actions/` landed on `main` with the devkit
1.1.0 adoption
(#32) and does not exist on `dev`, so the step dies:

```
Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under
'…/.github/actions/setup-devkit-toolchain'.
```

`resolve-toolchain` and `check` pass because they check out the
**default** ref
(`main`), where the action does exist. Only `sync` pins `dev`.

This is a **bootstrap deadlock** — the only thing that would carry the
action onto
`dev` is the very sync PR this job can no longer open. It cannot
self-heal.

### The fix

Drop `ref: dev`, so the workspace is the triggering `main` SHA where the
action is
guaranteed to exist.

Nothing downstream reads dev's **working tree**. Every subsequent step
already
operates on remote refs or the API:

| Step | Operates on |
|---|---|
| Re-check if dev is still behind main | `git fetch origin main dev` →
`git rev-list --count origin/main ^origin/dev` |
| Detect merge conflicts | `git merge-tree --write-tree origin/dev
origin/main` |
| Create sync branch from main | `git checkout -b "$SYNC_BRANCH"
origin/main` |
| Existing-PR check · stale-branch cleanup · Create PR · auto-merge |
`gh` / REST API |

`fetch-depth: 0` and the commit-app token are unchanged, so merge-base
and push
behavior are identical. The job now builds against the *newer* tree —
the one whose
actions it actually references.

### Upstream

This file is the devkit scaffold template **verbatim** (`diff` against
`assets/workspace/.github/workflows/sync-main-to-dev.yml` on
`devkit@main` is
empty), so the defect ships to every scaffolded repo. The devkit's own
copy has the
same pattern with `./.github/actions/setup-env` — latent, one rename
away from
firing.

Filed upstream as **vig-os/devkit#1034**. This PR is the **local** fix
so
development can continue without waiting on a devkit release. A header
comment and
a step comment mark the divergence so a future re-scaffold does not
silently revert
it.

### Verification

- `just precommit` fully green locally (incl. `yamllint --strict`,
`check-yaml`).
- Behavioral proof is the next push to `main`: merging this PR itself
triggers
`Sync main to dev`, which should now open the `chore/sync-main-to-dev-*`
PR that
  finally brings `.github/actions/` onto `dev`.

Refs: #36
c-vigo added a commit to vig-os/devkit that referenced this pull request Jul 14, 2026
)

## Summary

Bundles the two pilot-surfaced "CI layer is Python-shaped" bugs (both
from vig-os/commit-action#32) — same theme, one CI run.

### #1028 — gate python/uv env in `setup-devkit-toolchain`
All three Python-assuming spots now gate on `pyproject.toml` at the repo
root: `UV_PROJECT_ENVIRONMENT` (container branch), the Nix-CPython
`$GITHUB_PATH` filter, and the `UV_PYTHON_DOWNLOADS_JSON_URL` forward
(direnv branch). On a non-Python consumer the composite is a no-op for
those steps — and the Nix python stays on PATH, removing the latent
footgun. `DEVKIT_MODULES` was verified still Reserved/empty in
`.vig-os`, so file presence is the gating signal (the issue's primary
suggestion). The devkit itself has a root `pyproject.toml`, so its own
CI is unchanged.

### #1029 — language-neutral release pipeline with opt-in bundle
- Neutral labels: "Sync Python dependencies" → "Sync dependencies"
(`release-core.yml`), "Pytest" → "Run tests" (`ci.yml` header).
Remaining `python` hits in the scaffold workflows are genuinely
Python-specific and untouched.
- Opt-in release artifact: the `finalize` job detects a `bundle` just
recipe (`just --summary | grep -qw bundle`), runs `just bundle`, and
adds `dist` to the existing finalization commit's `FILE_PATHS` — so the
tagged commit ships a fresh bundle. Zero new config surface: the
recipe's presence is the flag, matching the capability-by-presence idiom
of the #1028 fix. Verified `commit-action`'s `FILE_PATHS` supports
directories ("directory expansion" per its README) and that
`commit-action` itself already defines a `bundle` recipe.
- Release choreography untouched (epic #988 keeps it single-source) —
the step is additive and gated.

TDD: each fix lands as failing-test commit → implementation commit
(`tests/bats/init-workspace.bats`, 3 new shape tests).

## Test evidence
- `bats tests/bats/init-workspace.bats` → 162 ok / 0 failed
- `bats tests/bats/just.bats` → 46 ok
- `actionlint` clean on both edited workflows
- `prek run --all-files` → green (re-verified independently before push)

Closes #1028
Closes #1029
Refs: #988, #1027
c-vigo added a commit to vig-os/sync-issues-action that referenced this pull request Jul 15, 2026
## Adopt vigOS devkit 1.3.0 (direnv) — replace the bespoke CI/release
stack

Second consumer of the mode-aware devkit, following the commit-action
pilot (vig-os/commit-action#32). Deployed off `dev` with the released
`install.sh --version 1.3.0 --mode direnv --prune-devcontainer`.

### What changed
- **Devkit scaffold (direnv)**: Nix flake dev-shell (+`pkgs.nodejs`),
`.envrc`, managed workflows/justfiles at 1.3.0; legacy `.devcontainer/`
pruned. Tag scheme declared day one: `DEVKIT_TAG_PREFIX=v`,
`DEVKIT_FLOATING_TAGS=major,minor`.
- **Flake-generated pre-commit hooks** (`hooks = { }`, `hooksExcludes =
["^dist/"]`): replaces the committed `.pre-commit-config.yaml` whose
binary `typos` hook could not run on NixOS. `scripts/setup-node.sh` +
`.node/` provisioning retired — node flows from the flake.
- **Crown jewels preserved**:
- 8-scenario `integration-test.yml` matrix kept, wired to PRs via
`integration-pr.yml` and to pushed tags via `published-tag-smoke.yml`
(runs the action checked out AT the tag — consumer semantics).
- **Provenance attestation** re-homed in `attest-release.yml` (tag
push). ⚠️ Deviation from the plan: it cannot live in the
`release-extension.yml` seam — the managed `release.yml` calls the seam
under a `contents: read, packages: read` token ceiling and a called
workflow can never elevate `GITHUB_TOKEN` (`id-token: write` would be
denied). Devkit seam limitation to be filed upstream.
- **release-extension.yml re-purposed** as the dist-freshness release
backstop (ported from commit-action): its old floating-tag mover is
superseded by the managed promote's native `DEVKIT_FLOATING_TAGS` job.
- **Ported gates**: `dist-check.yml` (Dist Check, PRs to
release/**+main), `js-quality.yml` (eslint + prettier via `just`).
- **codeql.yml push paths hand-patched to TS** — devkit renders only the
language matrix; upstream fix tracked in vig-os/devkit#1142 (re-apply
after every upgrade until fixed).
- **Retired**: `security-scan.yml` (pure placeholder), `CODEOWNERS`,
`prepare_changelog.py` + `release_helpers.sh` + their tests,
`resolve-image` composite.
- `package.json`: add `bundle` alias (devkit-standard name driving `just
bundle` and release-core's native dist prep) and `format:check`.

### Verification (local, NixOS, direnv)
- `nix develop` resolves: node v24.16.0, npm 11.13.0, just, prek;
flake-generated pre-commit config self-installs.
- `just sync / lint / format-check / build / bundle` green; **115 jest
tests pass**; `dist/` clean after rebuild (bundle fresh).
- **Full prek suite green — including `typos`, now flake-sourced** (the
pilot's NixOS fix, reproduced here).
- `actionlint` clean across all workflows.

### Follow-ups (not this PR)
- node24 runtime (#77) — next PR after this merges
- Required status checks on Dev/Main rulesets (CI Summary / + Dist
Check) — pending approval
- First devkit release train exercises the floating-tag move live (#106
checklist)

Refs: #106
@c-vigo
c-vigo deleted the feature/29-adopt-devkit-direnv branch July 16, 2026 17:32
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.

[BUG] post-create.sh masks failures (false 'tsx installed') and assumes apt/Debian base — breaks on Nix devcontainer [TASK] Update devcontainer

2 participants