š fix(onboard): follow a pre-push hook's dvara hand-off (#540)
Merged
AT
4d ago+247+247+012345678901234567890123456789-7-7-0123456789
Slice: #540
niyam onboard 0.7.12 in athya_mono (athya-hq/athya_mono#3852, 2026-11-21) ended with "add the line niyam pre-push "$@" to the pre-push git hook .husky/pre-push, which is your own". That step was already done. Since W-61 (athya-hq/athya_mono#3814), .husky/pre-push runs exec node_modules/.bin/dvara run "$B" "$@", and athya-rules' body runs "$cli" pre-push "$@". prePushHook read only the hook.
What changes
prePushHook(src/onboard.ts) has a new state,body. When the hook doesn't itself run niyam, it follows one uncommented[exec] [<dir>/]dvara run <file> "$@"line and applies the same line testoursuses to that file.- The file is a literal path, or one variable set exactly once, plainly, before the hand-off. Every line that sets the variable counts:
export B=,B+=,x && B=,B="$(ā¦)",B=x # note. - The file must be inside the repository (read lexically, so pnpm's links work) and exist.
- The file is a literal path, or one variable set exactly once, plainly, before the hand-off. Every line that sets the variable counts:
- Any miss stays
own, so the By hand step shows as before. A comment saying the line is elsewhere counts for nothing. - onboard treats
bodyasours. - Cloud
session-startsays the hand-off "was not checked for a cloud session", because athya-rules' body skips niyam whenCLAUDE_CODE_REMOTE=true. - README's pre-push paragraph and
docs/decisions.mddescribe the change. Alok approved #540 with a š on its proposal (18:12:41Z), after the slice's last edit.
Checked
- Real files:
prePushHookon athya_mono's own.husky/pre-pushreadsbodywith athya-rules 0.5.7 (installed) and with 0.5.10 (pinned).athya-rules 0.5.7 (installed): {"path":".husky/pre-push",ā¦,"state":"body","body":"node_modules/@athya-hq/rules/dvara/hooks/pre-push"} athya-rules 0.5.10 (pinned): {"path":".husky/pre-push",ā¦,"state":"body","body":"node_modules/@athya-hq/rules/dvara/hooks/pre-push"} - dvara 0.6.18's
run(dist/supervisor.js) isspawn("bash", [hook, ...args])with stdin inherited, so the body is what the push runs. - New tests:
- athya's hook and body read
body, and onboard lists no pre-push step in the terminal or the PR. - These forms are followed: a literal path,
${B}, a quoted absolute path, and a path through./... - 17 misses stay
own: body missing, body without the line, commented hand-off, variable unset, variable set twice, set from another variable, set again by a comment,export, a command, a condition or+=, set after the hand-off, set only with a trailing comment, path outside the repository, no"$@", two hand-offs, marker comment alone. - Cloud session-start prints its line for
body.
- athya's hook and body read
pnpm checkexit 0 (rebased on main 35b77ea):pnpm test: tests 2129, pass 2129, fail 0 pnpm test:scripts: tests 133, pass 133, fail 0 onboard.ts | line 99.58 | branch 96.93 | funcs 98.72 session-start.ts | line 100.00 | branch 99.02 | funcs 100.00
After merge: a niyam release. athya_mono's next onboard then lists no pre-push step.
Guards: none; no guard file changes.
š¤ Generated with Claude Code
Summary by cubic
Fixes niyam onboard so a pre-push hook that hands off to a body file via dvara no longer gets a needless "By hand" step.
prePushHooknow follows one uncommenteddvara run <file> "$@"line to the body and reports it asbodywhen the body runs niyam pre-push; any miss keeps the hookown.- The hand-off line, and the variable's assignment if it names one, must sit outside any
if,case, loop, or{ }block, and the body must be readable; anything else keeps the hookown. onboardtreatsbodylikeours, listing no pre-push step; cloudsession-startreadsbodyas unchecked, since a body may skip niyam there.- Requires a niyam release after merge, so the next onboard in
athya_monolists no pre-push step.