⬆️ build(deps): niyam's sessions run sarathi and kavach 0.8.9

Merged
AT
4d ago
+10-10

Moves @veda-hq/sarathi from 0.8.2 to 0.8.9. sarathi 0.8.9 depends on exactly @veda-hq/kavach 0.8.9, so kavach moves from 0.7.19 (what sarathi 0.8.2 carried) to 0.8.9 with it. Only package.json's sarathi line and the two packages' lockfile entries change; niyam's own version and every other pin stay.

What reaches niyam's sessions

From git log v0.8.2..v0.8.9 -- packages/sarathi packages/kavach in veda, plus v0.7.19..v0.8.2 -- packages/kavach (only python/tests/ changes there) for kavach's longer range:

  • kavach 0.8.3 (https://github.com/veda-hq/veda/pull/406): git log and git show with search and display options (-i, -E, --all-match, --committer …) pass, and so does pnpm --dir <pkg> pack. Newly refused: a second folder-moving option after pnpm --dir, such as pnpm --dir docs exec --dir . touch …, which 0.7.19 let through.
  • kavach 0.8.7 (https://github.com/veda-hq/veda/pull/439): git config reads under -C pass, wherever -C points. Writes under -C stay refused.
  • kavach 0.8.9 (https://github.com/veda-hq/veda/pull/594): for other-sessions-worktree, a failed scan of the desktop app's session records logs a scan-failed row and lets the write through, instead of reading silently as "no owner".
  • sarathi 0.8.9 (https://github.com/veda-hq/veda/pull/587): a new sarathi where subcommand. It does nothing here until .claude/sarathi.json gives it a where config.
  • Does not reach niyam: sarathi 0.8.6's hooks-path handler fix (https://github.com/veda-hq/veda/pull/434), since .claude/sarathi.json does not run worktree-hooks-path.sh. The rest of the range is mutation sweeps and CI. The sweeps also tidy source that sarathi's hook runner loads (cli.ts, config.ts, run.ts, merge.ts, worktree/settings.ts), each stated as removing checks no input can tell apart, so behaviour-preserving; pnpm hooks:check and the probe below run that code.

other-sessions-worktree stays at warn

The rule has warned in niyam since kavach 0.7.19 (https://github.com/veda-hq/veda/pull/377), because .claude/kavach.json does not name it under rules. This PR does not add "other-sessions-worktree": "refuse". 0.8.9's fail-open scan-failed row is now available here, and veda set the rule to refuse with it in place (https://github.com/veda-hq/veda/issues/363). Setting it to refuse in niyam is a separate decision for Alok.

Checks, run locally on this commit

  • Lockfile integrities match npm view (2026-11-26): sarathi 0.8.9 sha512-4OFJVCvt…NBNaDGw==, kavach 0.8.9 sha512-tIFg2iUR…M9pUIVaA==. npm view @veda-hq/sarathi@0.8.9 dependencies is { '@veda-hq/kavach': '0.8.9' }.
  • pnpm check passes: 2799 and 138 tests, 0 failures. pins passes, and provenance reports @veda-hq/kavach@0.8.9 and @veda-hq/sarathi@0.8.9 built and signed by veda's release.yml.
  • pnpm hooks:check: .claude/sarathi.json is valid (SessionStart 1, PreToolUse 4, PostToolUse 1, Stop 1).
  • .claude/kavach.json loads under kavach 0.8.9. A script under .tmp/ ran .claude/hooks/sarathi.sh PreToolUse on Bash events, with CLAUDE_PROJECT_DIR set to the main checkout (sarathi 0.8.2), then to this branch:
main    passed (exit 0)   cat package.json
main    refused (exit 2)  git log --oneline --grep=sarathi -i -n 3
main    refused (exit 2)  git -C /Users/alok/code/athya/veda config --get-all core.hooksPath
main    passed (exit 0)   niyam propose 1
main    passed (exit 0)   niyam state 1 --title 'probe'
main    passed (exit 0)   pnpm --dir docs exec --dir . touch .githooks/pre-push
branch  passed (exit 0)   cat package.json
branch  passed (exit 0)   git log --oneline --grep=sarathi -i -n 3
branch  passed (exit 0)   git -C /Users/alok/code/athya/veda config --get-all core.hooksPath
branch  passed (exit 0)   niyam propose 1
branch  passed (exit 0)   niyam state 1 --title 'probe'
branch  refused (exit 2)  pnpm --dir docs exec --dir . touch .githooks/pre-push
        BLOCKED: mutation targets could not be resolved: this command uses `pnpm` with a folder the guard cannot place: one named before the subcommand and moved again after it (`--dir`, …

git push --no-verify origin HEAD was refused under both, but by the worktree guard for a remote it cannot place from the probe's event, not for the flag, so it shows nothing about the bypass rule.

After merge

Hooks load sarathi from the main checkout's node_modules at the pinned version, so /Users/alok/code/athya/niyam needs git pull and pnpm install run together. Between the two, .claude/hooks/sarathi.sh refuses every PreToolUse call in sessions already running, until a session start (or resume) installs the pin or pnpm install runs. That step is the owner's.

Auto-merge is on: an existing dependency's pin moving is none of CLAUDE.md's exceptions. Approval: Alok's 👍 (2026-11-26T02:52Z) on https://github.com/veda-hq/niyam/issues/678#issuecomment-7175474838 (proposal page: https://claude.ai/artifact/5H6Z2vphZZkJXWbkLhUzj9).

Slice: #678

🤖 Generated with Claude Code


Summary by cubic

Moves @veda-hq/sarathi from 0.8.2 to 0.8.9, pulling @veda-hq/kavach from 0.7.19 to 0.8.9 with it since sarathi 0.8.9 pins kavach to exactly that version. Only the package.json sarathi line and the lockfile entries change.

Session behavior changes

  • git log and git show search and display options now pass; a second folder-moving flag after pnpm --dir is now refused.
  • git config reads under -C now pass anywhere -C points.
  • A failed scan of the app's session records logs a scan-failed row and lets the write through instead of reading as "no owner".
  • The new sarathi where subcommand is unused here until it gets config.
  • other-sessions-worktree still warns; promoting it to refuse is a separate decision.

After merge, run git pull and pnpm install together on the main checkout — between them, hooks refuse every PreToolUse call.