✨ feat: dvara runs niyam's git hooks and records gate from its pinned release
Merged
AT
18d ago+1057+1057+0123456789012345678901234567890123456789-1-1-0123456789
Slice: #296
niyam is now guarded by the released dvara it pins, never by a copy being changed (0114 spec, rule T-9; Work item #295).
What changes
package.jsonpins@veda-hq/dvara0.5.16 exactly, as a devDependency. It resolves from the registry with an integrity hash..dvara.jsonturns on dvara's records and frozen gates..dvara/records-baseline.json(tracked; the rest of.dvara/is ignored) holds the two findings already in the tree: TruffleHog'sfile://$PWDin ci.yml and a.git/configmention in docs/decisions.md.- Tracked git hooks in
.githooks/, run under the installed dvara:- pre-commit runs records and frozen on what is staged.
- pre-push runs records and frozen on the branch, then
scripts/released-pins.mjs. Last, for an agent session's push, it runsniyam pre-pushwith git's refs, as onboard's hook does.niyam onboardreads that"$cli" pre-pushline as its own and leaves the file alone. - Both refuse, saying to run
pnpm install, when the pinned dvara is not installed.
scripts/hooks-path.mjs(thepreparescript) pointscore.hooksPathat.githooksfrom the main checkout's install only. That setting is shared by every worktree, so a worktree's install changes nothing and CI sets nothing. A hooksPath someone else set is left alone, with a note.scripts/released-pins.mjs(pnpm pins, inpnpm checkand pre-push) fails any@veda-hq/*pin in these cases:- it is not an exact version;
- the lockfile entry is
link:,file:orworkspace:, or has no integrity hash, or comes from a tarball URL, a directory or git; - it is not installed at its version, or is linked from inside the checkout.
- CI calls veda's shared checks,
veda-hq/veda/.github/workflows/checks.yml@7c6fa9e56bb08afe56581c0e166d9700768d1a0b, withrequire: dvara,actionlint. That runs dvara's gates at the pinned version, and actionlint with ShellCheck 0.11.0. pnpm test:scripts: tests for both scripts (100% lines and functions), andgithooks.test.mjs, which runs the real hooks under git in a throwaway repo.
Checked locally: pnpm check passes. dvara records --base origin/main and dvara frozen --base origin/main pass. So does actionlint with ShellCheck 0.11.0 over every workflow, and ShellCheck over both hooks.
For Alok
- Auto-merge: turned on at the owner's request; it merged once the checks passed.
- Third-party packages: dvara brings
mdast-util-from-markdown2.0.3 and its tree into the lockfile, as dev-only packages. - One owner step after merge: add
veda-checks / Checksto themainruleset's required checks, so a dvara or actionlint refusal blocks a merge:niyam owner-step required-checks veda-hq/niyam main. - The hooks come on when you install: after this merges,
git pullandpnpm installin your main niyam checkout turns them on. From then on, git runs.githooks/in every worktree instead of.git/hooks/pre-push. A worktree on an older branch, with no.githooks/, then runs no pre-push hook until it merges main. The Claude Codeniyam guardhook still checks its pushes.
🤖 Generated with Claude Code
Summary by cubic
Makes niyam's git hooks run under the released @veda-hq/dvara 0.5.16 it pins, never a copy being changed.
- Adds tracked
.githooks/running dvara's records and frozen gates: pre-commit on staged changes, pre-push on the branch plus a check that every@veda-hq/*pin resolves from the registry with an integrity hash. - Adds
scripts/released-pins.mjs(pnpm pins) failing exact-version, registry resolution, and installed-version checks; it's part ofpnpm checkand pre-push.pnpm checkruns provenance ahead of pins, and own-provenance now covers the dvara pin, including its signature. - Prepares
core.hooksPathfrom the main checkout's install only, so worktrees stay dormant and CI sets nothing. - CI calls veda's shared checks at a pinned commit with dvara and actionlint required.
- Records baseline covers the two existing findings; dvara brings dev-only markdown packages into the lockfile.
Owner step after merge
- Add
veda-checks / Checksto themainruleset's required checks so dvara or actionlint refusals block merges.