@veda-hq/niyam 0.6.20 → 0.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1420,7 +1420,7 @@ tag and the commit. Install the attached package on each machine with pnpm,
1420
1420
  once; nothing is built on install:
1421
1421
 
1422
1422
  ```bash
1423
- pnpm add -g https://github.com/veda-hq/niyam/releases/download/v0.6.20/veda-hq-niyam-0.6.20.tgz
1423
+ pnpm add -g https://github.com/veda-hq/niyam/releases/download/v0.6.21/veda-hq-niyam-0.6.21.tgz
1424
1424
  ```
1425
1425
 
1426
1426
  The package puts one command on `PATH`, `niyam`. Since P-57 a release
@@ -128,6 +128,7 @@ function loadState(sys, root, branch) {
128
128
  }
129
129
  }
130
130
  function saveState(sys, root, state) {
131
+ sys.confine(root, statePath(root, state.branch));
131
132
  sys.mkdir(stateDir(root));
132
133
  sys.write(statePath(root, state.branch), JSON.stringify(state));
133
134
  }
@@ -187,8 +188,11 @@ function recheckSeconds(sys) {
187
188
  * hook can reach the same push. A lock older than three minutes is abandoned.
188
189
  */
189
190
  export async function withLock(sys, root, branch, body) {
190
- sys.mkdir(stateDir(root));
191
191
  const path = `${statePath(root, branch)}.lock`;
192
+ // Every record the body may touch, checked before any is: a link out of the toplevel stops it before GitHub is asked.
193
+ for (const each of [path, statePath(root, branch), optoutPath(root, branch)])
194
+ sys.confine(root, each);
195
+ sys.mkdir(stateDir(root));
192
196
  const deadline = sys.now().getTime() + LOCK_WAIT_MS;
193
197
  while (!sys.claim(path)) {
194
198
  const changed = sys.modified(path);
@@ -526,6 +530,7 @@ async function autofixMessage(sys, root, settings, state, session, pulls) {
526
530
  if (sys.exists(ack))
527
531
  return '';
528
532
  try {
533
+ sys.confine(root, ack);
529
534
  sys.mkdir(dirname(ack));
530
535
  sys.write(ack, '');
531
536
  }
@@ -855,6 +860,7 @@ export async function spawnWatchers(sys, io, args, stdin) {
855
860
  if (opted)
856
861
  continue;
857
862
  try {
863
+ sys.confine(root, `${stateDir(root)}/watch.log`);
858
864
  sys.mkdir(stateDir(root));
859
865
  // Its own session and no inherited descriptors: git, the hook's
860
866
  // supervisor and a closing terminal neither wait on it nor end it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veda-hq/niyam",
3
- "version": "0.6.20",
3
+ "version": "0.6.21",
4
4
  "description": "Work rules for repos that track work in GitHub Issues: setup, agent identity, push and PR checks.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "@types/node": "24.19.2",
29
29
  "@veda-hq/dvara": "0.5.16",
30
30
  "@veda-hq/pariksha": "0.5.20",
31
+ "@veda-hq/sarathi": "0.6.10",
31
32
  "typescript": "7.0.2"
32
33
  },
33
34
  "dependencies": {
@@ -44,8 +45,9 @@
44
45
  "provenance": "node scripts/own-provenance.mjs",
45
46
  "smoke": "node dist/cli.js --version",
46
47
  "scan:secrets": "gitleaks dir --no-banner --redact --config=.gitleaks.toml . && trufflehog filesystem . --no-update --fail --results=verified,unknown --exclude-paths=.trufflehog-exclude",
47
- "check": "pnpm provenance && pnpm typecheck && pnpm lint && pnpm test && pnpm test:scripts && pnpm pins && pnpm pariksha && pnpm build && pnpm smoke",
48
+ "check": "pnpm provenance && pnpm typecheck && pnpm lint && pnpm test && pnpm test:scripts && pnpm pins && pnpm pariksha && pnpm hooks:check && pnpm build && pnpm smoke",
48
49
  "pins": "node scripts/released-pins.mjs",
49
- "pariksha": "node_modules/.bin/pariksha absolute-paths && node_modules/.bin/pariksha aggregate-gate-needs && node_modules/.bin/pariksha masked-exit-codes && node_modules/.bin/pariksha pnpm-settings --config pariksha-pnpm-settings.json && node_modules/.bin/pariksha shell-gates --all"
50
+ "pariksha": "node_modules/.bin/pariksha absolute-paths && node_modules/.bin/pariksha aggregate-gate-needs && node_modules/.bin/pariksha masked-exit-codes && node_modules/.bin/pariksha pnpm-settings --config pariksha-pnpm-settings.json && node_modules/.bin/pariksha shell-gates --all",
51
+ "hooks:check": "node_modules/.bin/sarathi check --settings .claude/settings.json"
50
52
  }
51
53
  }