Repository navigation
fix(workspace): ship the commit-msg hooks to flake-generated consumers - #1439
Merged
Merged
Conversation
c-vigo
added a commit
that referenced
this pull request
Aug 12, 2026
The #1443 entry (c427dee) replaced the "Flake-generated hooks now carry the commit-message and agent-identity guards" title bullet instead of inserting above it, so #1434's three sub-bullets hung off #1444 and #1434 had no entry of its own — the release notes would have reported a consumer-facing change to local commit-message and agent-identity enforcement as part of an unrelated smoke-dispatch branch-naming fix. Restore the title line verbatim as merged in #1439, in its original slot ahead of #1414; the sub-bullets are byte-identical to that render and need no re-indentation. The hook-synced .devcontainer mirror follows. Documentation-only change to a data file, so RED-GREEN TDD does not apply. No test is added: the defect is a sub-bullet attached to the wrong parent, not an orphan, so a structural "every sub-bullet has a titled parent" assertion passes both before and after the fix and cannot express it. Refs: #1453
12 of 13 tasks
c-vigo
added a commit
that referenced
this pull request
Aug 12, 2026
## Description Fixes #1453. **Targets `release/1.8.0`** — the train is cut and `1.8.0-rc1` is tagged; this must land before the notes are finalized, after which the `[1.8.0]` section is released and immutable. The #1434 entry had lost its bold title bullet, so its three sub-bullets hung off the #1444 entry. As it stood, the 1.8.0 release notes would have presented a user-visible fix to local commit-message and agent-identity enforcement as part of an unrelated smoke-dispatch branch-naming fix, and #1434 would have had no entry at all. ## Type of Change - [x] `docs` -- Documentation only ### Modifiers - [ ] Breaking change (`!`) -- This change breaks backward compatibility ## Changes Made A **single added line**. No re-indentation was needed — the orphaned sub-bullets were already at the correct 2-space depth: ```diff (devkit-smoke-test#354) but every deploy overlays the template back over it, re-arming the regression for the next train. Dots now map to dashes in the template SSoT, matching the live listener +- **Flake-generated hooks now carry the commit-message and agent-identity guards** ([#1434](#1434)) - A direnv consumer on flake-generated hooks had **no local commit-message or agent-identity enforcement at all**: `validate-commit-msg`, ``` `### Fixed` now reads #1447, #1443, #1444, #1434, #1414, #1403, #1396, and #1444 keeps only its own sub-bullet. **The title is recovered, not invented.** `git show 20e5660:CHANGELOG.md` (the PR #1439 merge) carries this exact line, and #1439's body proposes it verbatim under "Changelog Entry". The restored 20-line region diffs byte-identical against the original, and the entry lands back in its original slot ahead of #1414. **Root cause — this corrects the guess in the issue.** It was *not* the changelog freeze. `046ca547` only moved headings (14 insertions / 4 deletions). The culprit is **`c427dee8`** (#1443), whose diff shows `-- **Flake-generated hooks…**`: it *replaced* the #1434 title line instead of inserting above it. `d0f276cd` (#1444) then inserted below that, inheriting the orphans. ## Changelog Entry No changelog entry needed — this **is** a changelog repair. Adding a "fixed the changelog" bullet to the section it repairs would be noise in the released notes. ## Testing - [x] Tests pass locally - [x] Manual testing performed (describe below) ### Manual Testing Details - `prek run --all-files` -> exit 0, fully green, including `pymarkdown` on both the root file and the synced mirror — which is the real risk here, since it validates list nesting. Re-run clean after `sync-manifest` mirrored the file. - `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`, **proved** pre-existing rather than assumed: stashing to a fully pristine tree reproduces it, and the stale image's *destination* hash is identical across both runs (`0b4f7b0ff94c…`) while only the source hash moves. CI rebuilds the image. - Re-verified after merging `release/1.8.0` in: `prek run --all-files` exit 0, the restored entry intact, #1448's entry present. - The mirror `assets/workspace/.devcontainer/CHANGELOG.md` was written by the hook, never hand-edited; its diff is the same single line. ## 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` (this PR *is* the changelog change) - [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 -- see below - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Additional Notes **No test was added, deliberately.** The defect is not an orphaned sub-bullet — the three sub-bullets had a perfectly valid parent (#1444). A "every sub-bullet has a titled parent entry" assertion passes identically before and after this fix, so it cannot express the bug. The only detecting heuristic would be "a sub-bullet cites an issue other than its parent's", which this changelog violates constantly by design (#1447's sub-bullet cites #1434; #1443's cites #1344/#1348/#1423). It would be almost entirely false positives. This is a semantic authorship error, not a structural one — which is also why `pymarkdown` passes it. TDD does not apply; the commit body says so explicitly rather than skipping it silently. Nothing below `## [1.8.0]` was touched. Every top-level bullet in the 1.8.0 section was checked against the canonical shape post-fix; all 19 conform. One suspected second instance was chased and cleared: the #1403 entry's sub-bullets about smoke deploys preserving `CHANGELOG.md` look misparented, but `git show 64b524a` proves all three were authored together as facets of the same sync-conflict fix. Two cosmetic inconsistencies remain, both pre-existing and deliberately out of scope: stray blank lines between three entries in `### Changed` (#1411, #1409, #1405) where every other section is contiguous, and trailing periods on four sub-bullets (#1403's three, #1396's one) where the rest of the section is period-free. **Worth flagging for the train:** this defect class — a hand-inserted entry silently consuming the line beneath it — survived a PR review and the freeze, and surfaced only by eye during #1447 review. Since the section becomes immutable at cut, one last read of the rendered notes before finalize is cheap insurance. Closes #1453 Refs: #1453
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
Fixes #1434. A direnv consumer on flake-generated hooks (the #1167 default) had no local commit-message or agent-identity enforcement at all.
validate-commit-msg,prepare-commit-msg-strip-trailersandcheck-agent-identitywere definedscaffold = truewith noconsumerfragment, somkProjectShell's generated config omitted all three. The scaffolded.githooks/commit-msgshim then ranprek run --hook-stage commit-msgagainst an empty stage and exited 0 — the exact false guarantee #1019 was filed to remove ("every scaffolded repo shipped aCOMMIT_MESSAGE_STANDARD.mdit could not enforce"), andgit commit --author="Claude <...>"passed locally too.Pre-existing since #883/#1167, not a regression; CI (
validate-commit-range,check-pr-agent-fingerprints) was the only line of defense for these consumers.Type of Change
fix-- Bug fixtest-- Adding or updating testsdocs-- Documentation onlyModifiers
!) -- This change breaks backward compatibilityChanges Made
Route chosen:
consumerfragments with Nix store-path entries, not "append the portable definition verbatim". The portableyamlentries areuv run <tool>, which resolves against the consumer's project venv — and a consumer venv has novig-utils(many consumers have nopyproject.tomlat all). Every other tool-naming consumer fragment (nixfmt,statix,deadnix,just-fmt,gitleaks,pymarkdown) already resolves${pkgs.<tool>}/bin/…, so the hook version follows the devkit pin the consumer bumps withnix flake update vigos. git-hooks.nix supportscommit-msg/prepare-commit-msgin itsstagesset, so "stage-gated" was never the blocker — the header's "not generatable" claim was stale and is corrected.nix/vig-utils.nix(new) -- the vig-utils package lifted verbatim out offlake.nix's overlay, so hook fragments build it from an un-overlaidpkgs.pkgs.vig-utilsexisted only viaoverlays.default, which would have made the generation surface fail eval on a plainpkgs. Follows the existingnix/pymarkdown.nixprecedent — one definition, no new overlay requirement.nix/hooks.nix--consumerfragments for the three hooks;defaultCommitTypes+refsOptionalTypesFor+validateCommitMsgArgshelpers, with the committed YAML render now deriving its argv from the same helper (one literal, not two);consumerrender takes a knob attrset ({ workflow, branchTypes, commitTypes, refsPolicy }) instead of four positional nullables.flake.nix--mkProjectShellgainscommitTypes ? null/refsPolicy ? nullwith eval-time asserts mirroring the scaffold guards (per-entry[a-z][a-z0-9]*, non-empty list; three-value enum).assets/workspace/flake.nix-- readsDEVKIT_COMMIT_TYPES/DEVKIT_REFS_POLICYfrom.vig-os, each forwarded behind abuiltins.functionArgs vigos.lib.mkProjectShell ? <arg>probe so a floatingvigosinput predating the argument still evaluates (Scaffolded flake breaks on fresh install while devkit main predates the workflow argument #1249 pattern). NewvigOsListhelper now that the comma-list parse has two callers.docs/MIGRATION.md,assets/workspace/.vig-os,CHANGELOG.md(+ hook-synced mirror).Knob-resolution consistency (the issue's hard requirement). The flake path resolves exactly as
render_commit_types/render_refs_policy(assets/init-workspace.sh) andresolve-toolchaindo: same default 11-type list, same trim/drop-empty parse, same charset allowlist,optionalmirroring the resolved list (the #1431 composition, not a hardcoded stock copy),requiredusing thenonesentinel. Divergence is now structurally impossible on the Nix side, sincevalidateCommitMsgArgsrenders both the committed YAML and the consumer config.Changelog Entry
(Full entry with sub-bullets is in
CHANGELOG.mdunder## Unreleased->### Fixed.)Testing
Manual Testing Details
Live behavioral proof against a real generated config symlinked into a scratch repo, not just render assertions:
prek run --hook-stage commit-msgontotally-invalid message…First line must match 'type(scope): short description'fix(hooks): …+Refs:check-agent-identitywithGIT_AUTHOR_NAME=Claudematches blocklisted AI agent identity: 'claude'commitTypes=[feat,fix,chore,record] refsPolicy=optional->record(registry): …no Refsperf(x): …Allowed types: chore, feat, fix, recordThe "before" row is grounded: the pre-fix generated config's hook list contained none of the three.
uv run pytest tests/test_flake_hooks.py-> 59 passed, exit 0 (baseline 45; RED run: 1 failed, 29 errors --function 'mkProjectShell' called with unexpected argument 'commitTypes').test_flake_hooks,test_flake_devshell,test_workflow_model,test_vig_os_manifest,test_ci_runner,test_scaffold_drift) -> 176 passed, 1 skipped, exit 0.prek run --all-files-> exit 0, fully green (re-run after mergingdev).nix flake check --accept-flake-config .on a clean tree -> exit 0,all checks passed!.--types feat,fix,chore,record --refs-optional-types feat,fix,chore,record, i.e.optionalmirrors the resolved list, matchingrender_refs_policy'sRESOLVED_COMMIT_TYPESbranch.Note:
tests/test_image.py::TestFileStructure::test_manifest_filesfails locally, and fails identically on a cleandevwithout this branch — it checksums the working-treeCHANGELOG.mdagainst a locally cached devcontainer image. Stale-image noise, unrelated to this change; CI rebuilds the image.Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Invariants held. Drift gate:
.pre-commit-config.yaml(both copies) is absent from the diff entirely — the argv refactor renders byte-identically. Zero-hooks parity:TestZeroHooksParitypasses with an identicaldrvPath; the three hooks exist only on theconsumersurface, inert without ahooks/hooksExcludesopt-in. Default-render stability: newtest_default_args_match_the_scaffolded_renderasserts consumer argv == scaffold argv == the stock six-element list.Adoption is a behavior change worth calling out in the release notes — a consumer whose history contains non-conformant messages will start seeing local rejections on its next
nix flake update vigos. Existing direnv consumers get nothing until they hand-port the.vig-osreader into their scaffold-onceflake.nix(the same one-time port as #1224/#1432, now documented inMIGRATION.md); until then the hooks ship with stock defaults, still strictly better than no hooks.Deliberately not done. No
check(sandbox) fragments — the Nix sandbox has no git repo and no commit to inspect, andcheck-agent-identityshort-circuits underCI=true; those would be dead weight.check-agent-identitydoes now run under a direnv consumer'sprek run --all-fileslint job, but returns 0 immediately whenCI/GITHUB_ACTIONSis set, so consumer CI is unaffected (container-mode consumers have shipped it since #1031).Suggested follow-up:
check-expirations's consumer fragment still usesuv run check-expirations— the exact venv-resolution weakness this issue is about, and now the odd one out among the vig-utils consumer fragments. Should move to the same store-path form.Closes #1434
Refs: #1434