Repository navigation
feat(workspace): ship a doctor host-preflight recipe on the consumer surface - #1451
Merged
Merged
Conversation
This was referenced Aug 12, 2026
Closed
c-vigo
added a commit
that referenced
this pull request
Aug 12, 2026
…lbacks (#1460) ## Description Fixes #1459. **Targets `release/1.8.0`.** Restores the #1447 and #1448 content that two failed `release.yml` dispatches stripped off the release branch. Both PRs (#1449, #1451) merged green and both issues are closed, but the content is absent from the branch tip. Without this, 1.8.0 would ship claiming two fixes it does not contain, and the changelog would omit both. | Rollback commit | Time | Triggering run | Destroyed | |---|---|---|---| | `71cd72fb` | 09:49Z | `31583273344` (failed: `Candidate tag '1.8.0-rc2' already exists on origin`) | **#1447** — `nix/hooks.nix` fix, 102 lines of tests, changelog entry | | `c1cc5d82` | 09:59Z | `31584765199` (failed: validate's PR gate — #1441 is a draft with `REVIEW_REQUIRED`) | **#1448** — 77-line `doctor` recipe, 241-line `consumer-doctor.bats`, changelog entry | ## Type of Change - [x] `revert` -- Reverts a previous commit ### Modifiers - [ ] Breaking change (`!`) -- This change breaks backward compatibility ## Changes Made `git revert --no-commit c1cc5d8 71cd72f`, squashed into one commit. No hand edits, no conflicts: ``` CHANGELOG.md | 31 ++ assets/workspace/.devcontainer/CHANGELOG.md | 31 ++ assets/workspace/justfile | 77 ++ nix/hooks.nix | 12 +- tests/bats/consumer-doctor.bats | 241 ++ tests/test_flake_hooks.py | 102 ++ 6 files changed, 490 insertions(+), 4 deletions(-) ``` ## Root cause (tracked separately — not fixed here) `release.yml`'s **Rollback on Failure** job (`.github/workflows/release.yml:1551`) builds a commit whose **tree is `PRE_SHA`** — the branch tip captured when `validate` started — parented onto the current tip. A tree-level reset expressed as a commit. Two properties make it destructive: 1. It runs when **`validate`** fails. `Finalize Release` was **skipped** in both runs — nothing needed rolling back — yet the tree was reset anyway. 2. `PRE_SHA` is a run-start snapshot, so **anything merged to the release branch while a release run is in flight is destroyed if that run fails**, related to the release or not. The trigger was merging into the release branch while a run was live. The defect is that a rollback for a step that never executed discards unrelated merged commits. Filed separately; this PR only restores content. **Interim operating rule:** never merge into a release branch while a `release.yml` run is in flight. ## Changelog Entry No new entry. This restores the #1447 and #1448 entries that the rollbacks deleted from the `## [1.8.0] - TBD` section; adding a "restored the changelog" bullet would be noise in the released notes. ## Testing - [x] Tests pass locally - [x] Manual testing performed (describe below) ### Manual Testing Details Content restoration verified item by item on the branch: | item | present | |---|---| | `check-expirations` store-path entry (`nix/hooks.nix`) | yes | | `TestNoConsumerHookResolvesVigUtilsThroughTheVenv` | yes | | consumer `doctor` recipe (`assets/workspace/justfile`) | yes | | `tests/bats/consumer-doctor.bats` | yes | | changelog entries #1447 / #1448 | yes / yes | | #1434 title bullet (from #1453) | exactly 1, not duplicated | - `bats tests/bats/` -> **496 ok, 0 not ok, exit 0** — exactly the pre-loss baseline, confirming #1448's 14 tests are back and passing. - `uv run pytest tests/test_flake_hooks.py` -> 63 passed, exit 0 — #1447's tests restored and green. - `uv run pytest tests/ -q` -> 780 passed, 20 skipped, 1 failed. The single failure is the known `tests/test_image.py::TestFileStructure::test_manifest_files`, which checksums the working-tree `CHANGELOG.md` against a stale locally cached devcontainer image; it reproduces on a clean `dev` without this branch, and CI rebuilds the image. - `prek run --all-files` -> exit 0, fully green. - `git status` clean; no stray or untracked files in the revert. ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly - [x] I have updated `CHANGELOG.md` (restores the deleted entries) - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective or that my feature works (restores the deleted tests) - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Additional Notes **Merge only while no `release.yml` run is in flight** — otherwise this PR is subject to the very defect it repairs. I will re-check immediately before merging. **`1.8.0-rc2` is stale.** It is tagged at `b60b306a`, which predates #1447, #1448, #1453 and #1454. After this lands (and #1454 after it) the branch matches no existing RC, so a fresh candidate is warranted before finalize rather than finalizing content no RC validated. Published tags are immutable, so it must be rc3 — re-dispatching rc2 is what failed at 09:31. #1454 is complete and pushed but not yet PR'd: its `consumer-doctor.bats` additions conflict until this restores the base file. Closes #1459 Refs: #1459
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements #1448. Targets
release/1.8.0— the train is cut and1.8.0-rc1is tagged; this lands ahead of rc2.just doctor(#1418, extended with acore.hooksPathdiagnostic in #1430) existed only in devkit's ownjustfile. The scaffolded consumer surface shipped no equivalent, so a consumer clone got no host preflight at all — the same "configured, believed active, never executed" failure #1430 documents, in the population devkit actually ships to, where the person committing is least likely to know devkit's installer exists.Type of Change
feat-- New featuretest-- Adding or updating testsrefactor-- Code restructuring (no behavior change)Modifiers
!) -- This change breaks backward compatibilityChanges Made
assets/workspace/justfile-- new[group('info')] doctorrecipe. Diagnostics only:PASS/WARNlines, always exits 0. Reports git identity, commit signing,core.hooksPath, ssh-agent andghauth.tests/bats/consumer-doctor.bats-- 14 tests driving the real shipped justfile in a fixture workspace, using thedoctor.batsharness idiom (GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEMpinned,SSH_AUTH_SOCKstripped, stubgh) so host state never leaks in.CHANGELOG.md(+ hook-synced mirror) -- entry under the 1.8.0### Added.Why the managed root justfile. It is the only managed justfile layer present in every delivery mode —
direnv/bareship no.devcontainer/— andjustfile.projectis aPRESERVE_FILESentry, so a recipe placed there would never reach an existing consumer on upgrade. (Note: the.devcontainer/justfile.baselayer named in the issue's context was retired in 0.4.0 and no longer exists.)Mode-aware remediation. Devkit's hint is
./scripts/init.sh, a file no consumer has. The consumer hint is driven byDEVKIT_MODEin.vig-os, with the universal command always first and the mode entry point named on top of it:direnv(run: git config core.hooksPath .githooks); normally set on dev-shell entry: run direnv allowdevcontainer(run: git config core.hooksPath .githooks); normally set by the devcontainer setup: reopen the containerboth(run: …); normally set by the devcontainer setup (reopen the container) or on dev-shell entry (direnv allow)bare/ no.vig-os(run: git config core.hooksPath .githooks)— nothing wires it, so no entry point is named./scripts/init.shnever appears in any mode, and that is test-enforced. The.vig-osread uses the samesed -n 's/^KEY=//p' … | head -n1form the scaffoldeddevkit-upgrade.ymlalready uses.Sharing vs. duplication — two implementations, drift pinned by a test. Three sharing routes were evaluated and rejected: a synced shared script (needs a brand-new always-shipped managed root path —
.devcontainer/is absent in direnv/bare and there is no scaffolded rootscripts/); a manifest transform (scripts/manifest.tomltransforms whole files, so splicing one recipe from file A into file B needs a new transform type bought for a single recipe); and importing devkit's justfile (never scaffolded, full of image/release recipes). The two also genuinely differ in behavior, not just wording — see the hint table.Rather than force the abstraction, the shared contract is pinned:
consumer doctor checks exactly what devkit's doctor checksruns both recipes under the same controlled environment, extracts the check labels from thePASS|WARN <label>:lines, and asserts the sets are non-empty and identical. Adding a check to one and not the other now fails CI.Manifest/sync wiring: none needed, and verified why.
scripts/manifest.tomlgoverns only files copied from the repo root intoassets/workspace/;assets/workspace/justfileis authored directly in the scaffold tree, picked up byinit-workspace.sh's rsync ofTEMPLATE_DIR, and already in the never-migrate managed literal list (assets/init-workspace.sh:1124). The.vig-osmanifest contract suite declares keys; this adds no knob, it only reads the existingDEVKIT_MODE.Changelog Entry
Placed in
## [1.8.0] - TBD->### Added, not## Unreleased: the changelog was frozen for 1.8.0 at046ca547, and the post-freeze fixes on this branch (#1443, #1444, #1447) all did the same. An Unreleased entry would be stranded out of these release notes.Testing
Manual Testing Details
b60b306a:bats tests/bats/-> 482 ok, exit 0;uv run pytest tests/ -q-> 1 failed, 776 passed, 20 skipped.bats tests/bats/consumer-doctor.bats-> 14/14not ok, allerror: justfile does not contain recipe 'doctor'(the drift guard failing on an empty consumer label set while printing devkit's six).release/1.8.0:bats tests/bats/-> 496 ok, 0 failures, exit 0 (482 + 14 new).uv run pytest tests/test_flake_hooks.py-> 63 passed, exit 0 (confirms [BUG] check-expirations consumer fragment still resolves through the project venv (uv run) instead of a store path #1447's tests still hold after the merge).prek run --all-files-> exit 0, fully green.tests/test_image.py::TestFileStructure::test_manifest_files. Verified pre-existing, and provably the stale image: the destination sha is byte-identical between the baseline and final runs (0b4f7b0ff94c…); only the source sha moved whenCHANGELOG.mdwas edited. CI rebuilds the image.Real output, from workspaces produced by the actual
assets/init-workspace.sh --no-prompts --mode <mode>:Checklist
docs/templates/, then runjust docs)CHANGELOG.md(and pasted the entry above)Additional Notes
Known limitation, worth a follow-up covering both doctors together. Linked worktrees are not special-cased.
justfile.worktreedeliberately--unsetscore.hooksPathand installs prek hooks into.git/hooks, andgithooksPathHookguards itself to the main worktree — sojust doctorinside ajust worktree-startworktree reportsWARN git hooks … inertwhen the hooks are in fact live. Devkit's owndoctorhas the identical behavior today, so this is not a regression, but a diagnostic that lies is exactly the failure class #1430 is about. Left alone here under YAGNI/minimal-diff given this is an rc; the fix (detect git-dir != common-dir, then PASS on an installed.git/hooks/pre-commit) should land in both recipes at once.Not done deliberately: no consumer docs edit (the scaffolded
README.mdis a seeded stub enumerating no recipes), no.vig-osknob, no changes to devkit's ownjustfile.Closes #1448
Refs: #1448