š fix(kavach): pnpm --dir pack, pariksha's --root and git log -i pass, 0.8.3
Slice: #404
Under work item #43. Page: https://claude.ai/artifact/5eNtsuuvsFuTDTCfZLWT3Y
These four commands were refused on 2026-11-21/22 while releasing pariksha 0.7.20 (#370, #393). Each writes nothing, or only inside the session's own worktree. I reproduced all four through the pinned sarathi 0.7.19 and kavach 0.7.19, as the hook runs them. Three now pass, each next to its write-shaped neighbour, which stays refused. The fourth is fixed in athya-rules.
1. pnpm --dir packages/pariksha pack --pack-destination ../../.tmp/pack
pnpm_selected_directoryread the--dirfolder only forexecandrun. It now reads it forpacktoo, under--dir/-Conly.--pack-destinationand--outare read from that folder. I probed pnpm 12.9: the tarball lands there.- The folder itself counts as a target, since
packwrites its tarball there by default. Sopnpm --dir .githooks pack, which kavach 0.7.19 passed, is refused.
The hole closed in the same reader
- pnpm reads
-C/--diranywhere on the line, the last one winning, and reads it from the shell's folder. I probed this:pnpm --dir A exec --dir B pwdprinted B.-w,-rand--filterin the slot move it too. - kavach 0.7.19 allowed
pnpm --dir docs exec --dir . touch .githooks/pre-push, which runstouchin the root. - Now, with a folder selected, the line is unresolved if its subcommand's slot holds any of these: a folder-moving option (
-C,--dir,-w,-r,--filter),--store-diror--state-dir, or an option the reader does not list. - The slot runs up to the program or script for
execandrun, and to the end of the line forpack. The nested reader (runner_program) refuses a slot--dirafter a selector too. - A
packwhose-C/--diris not one selector beforepackis unresolved too. kavach 0.7.19 passedpnpm pack --dir .githooksandpnpm --dir a --dir .githooks packas naming no target, since a bare.githooksis not path-shaped. - These lines get their own refusal reason (
pnpm_folder_unplaced), which says how to fix them: name the folder once, before the subcommand. - This can newly refuse a
runline with an option before its script that pnpm's tables do not list, and such a line may have passed in 0.7.19.
2. pnpm --dir packages/pariksha exec node src/cli.ts boundary --root ../..
- This was not a relative-path bug. An absolute
--rootwas refused too, and so was the releasedpnpm exec pariksha boundary --root .. - The generic reader counts every path-shaped word of an unknown program as written, and
refuse_named_rootrefuses a word that is the root. pariksha_read_valuesnow drops the values of a reading check's own options. Those checks areboundary(--root,--deny) andown-provenance(--config,--root), audited in pariksha 0.7.20'ssrc/cli.ts.- The line must be the bare
parikshabin, or a barenode <file>where the file issrc/cli.ts, or thebin, of the package named@veda-hq/pariksha. A.tmp/nodedoes not count, and aparikshathat is not an installed bin is refused as one ("a bin that is not installed"). It must hold only that check's options, each with its value as the next word. - Still refused:
codeql-baselineanddoc-references --write-baseline, which write under--root.- An extra word,
--root=, or a node option before the script. - Another package's
src/cli.ts. pnpm exec prettier --write .andrm -rf ..- The same pariksha line from the main checkout, which the session does not own.
- Not
readOnlyCommandsin veda's settings. That path returns before the ownership check and the push wait, andpnpm execcan install packages. So the same line from the main checkout could write there. - A look-alike manifest named
@veda-hq/parikshagains nothing thatpnpm exec node .tmp/x.mjsdoes not already have. The README already says that repository code a command runs can write anything.
3. git log origin/main --oneline -i --grep=athya -5
- The exact-name list that
log,showand the other read verbs share gains git 2.54's options that choose commits or how they show:-i,-E,-F,-P,--all-match,--committer,--notes=,--word-diff=, and more. - I ran each one through
git log -1andgit show.--min-parentsand--max-parentstake only the=form. - Still refused:
--ext-diff,--textconvand--show-signature, which run programs, and--remerge-diffand--diff-merges, whoseremergewrites objects. --outputis still read as a write, wherever it points.git shortlogalready passed-i; its--outputand an abbreviation are pinned too.- One correction to the report: git 2.54 refused
--outp=on log, show, diff and shortlog (probed). kavach refuses it all the same.
4. athya-rules agent wait: fixed in athya-rules, https://github.com/athya-hq/athya-rules/issues/127
waitonly reads. But~/.local/bin/athya-rulesresolves the installed plugin on every run, and honoursATHYA_RULES_ROOTandATHYA_RULES_NODE.- So kavach cannot bind the name to code it has read. Admitting it would let a session run any checkout as "read-only".
- A shell wait such as
until [ -e <out> ] || [ ! -e <out>.running ]; do sleep 2; donealready passes kavach. So the router's instructions change instead.
Tests
ReportedFalseRefusalsTestruns each case through the adapter as sarathi runs it, withprotectedPathsset like veda's. It carries the passing rows, their refused neighbours, the hole and thepacktwins. The main-checkout rows assert the not-owned refusal.ProtectedPathsTest's fixture moves intoProtectedFixture, so both classes share it.- Three corpus rows:
git log -i --output=<main>is an attack;git log -i --grepandgit show -i ā¦are near-misses. - The rows that pass now were refused by kavach 0.7.19, and the hole's rows were allowed by it. I ran the same lines through the pinned sarathi before the fix.
pnpm --dir packages/kavach checkpasses: typecheck, Python tests, node tests with coverage, build.
Release: kavach and sarathi move to 0.8.3, with sarathi's VERSION in cli.ts. That is the next tag, per the 0114 coordinator, and I tag only on its go. Then veda's root pin of @veda-hq/sarathi moves to 0.8.3 in its own pull request.
What is still Alok's: these guards protect sessions only after the release, the pin bump, and pnpm install in the main checkout. The install is Alok's step.
Not done:
pnpm --prefixis not read; such a line keeps today's reading.- Case 4 still fails until https://github.com/athya-hq/athya-rules/issues/127 is built, so "all four pass" is unmet by design.
š¤ Generated with Claude Code
Summary by cubic
Fixes three commands refused by kavach while releasing pariksha 0.7.20, and closes a hole in the same reader; kavach and sarathi move to 0.8.3.
pnpm --dir <pkg> packnow reads--pack-destinationand--outfrom the selected folder and counts the folder itself as written, matching pnpm 12.9.- Reading pariksha checks (
boundary,own-provenance) no longer count their--root,--config, or--denyvalues as written; write-shaped checks likecodeql-baselinestay refused. git logandgit showaccept git 2.54's search and display options (-i,-E,--all-match,--committer, and more);--ext-diff,--textconv,--show-signature,--remerge-diff, and--diff-mergesstay refused.- Closed a hole: with a folder selected before the subcommand, a second folder-moving option in its slot (
--dir,-C,-w,-r,--filter) or an unknown option leaves the line unresolved;--store-diris read from the workspace root, or from--dironly outside a workspace (pnpm --dir docs exec --dir . touch .githooks/pre-pushpreviously passed and ran in the root). - The fourth reported command,
athya-rules agent wait, stays refused; the router's instructions change in athya-rules instead.