instar 1.3.30 → 1.3.32

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.
@@ -24,6 +24,7 @@ import os from 'node:os';
24
24
  import { execFileSync } from 'node:child_process';
25
25
  import crypto from 'node:crypto';
26
26
  import { SafeGitExecutor } from './SafeGitExecutor.js';
27
+ import { ensureInstarBashPreToolUseHooks } from './instarSettingsHooks.js';
27
28
  import { resolveAgentHome as resolveAgentHomeForWorktree } from './InstarWorktreeManager.js';
28
29
  import { fileURLToPath } from 'node:url';
29
30
  import { TreeGenerator } from '../knowledge/TreeGenerator.js';
@@ -1263,9 +1264,11 @@ export class PostUpdateMigrator {
1263
1264
  }
1264
1265
  };
1265
1266
  // Marker = the latest capability signature (bumped each time the bundled hook/
1266
- // setup gains a feature, so prior installs upgrade): now the independent
1267
- // completion evaluator (mirrors /goal). Absent from multi-session-only installs.
1268
- upgrade('.claude/skills/autonomous/hooks/autonomous-stop-hook.sh', 'Native /goal delegation', 'Autonomous Mode Stop Hook', 'skills/autonomous/hooks/autonomous-stop-hook.sh (topic-keyed + multi-session + completion evaluator + native /goal)');
1267
+ // setup gains a feature, so prior installs upgrade): now notify-on-stop —
1268
+ // terminal exits (completion/duration/emergency) send a Telegram explaining
1269
+ // why the run stopped (2026-05-27 silent-stalls postmortem, Task 2). The
1270
+ // `notify_terminal_stop` function name is absent from all prior installs.
1271
+ upgrade('.claude/skills/autonomous/hooks/autonomous-stop-hook.sh', 'notify_terminal_stop', 'Autonomous Mode Stop Hook', 'skills/autonomous/hooks/autonomous-stop-hook.sh (topic-keyed + multi-session + completion evaluator + native /goal + notify-on-stop)');
1269
1272
  upgrade('.claude/skills/autonomous/scripts/setup-autonomous.sh', 'native-goal/set', 'autonomous-state.local.md', 'skills/autonomous/scripts/setup-autonomous.sh (per-topic + completion-condition + native /goal)');
1270
1273
  }
1271
1274
  /**
@@ -3576,6 +3579,23 @@ Create worktrees for collaborator repos with \`instar worktree create <branch>\`
3576
3579
  result.upgraded.push('.claude/settings.json: migrated compaction hook from Notification to SessionStart');
3577
3580
  }
3578
3581
  }
3582
+ // Ensure the canonical instar Bash PreToolUse hooks are present (dark-guardrail
3583
+ // migration gap, 2026-05-27). init.ts wires these for NEW agents; existing
3584
+ // agents previously only got slopcheck + the MCP gate ensured here, so
3585
+ // deferral-detector (the false-blocker pre-filter), grounding-before-messaging,
3586
+ // external-communication-guard, and post-action-reflection shipped to disk but
3587
+ // were never switched on. Both paths now share INSTAR_BASH_PRETOOLUSE_HOOKS so
3588
+ // they cannot drift again. Idempotent: appends only missing hooks, never
3589
+ // reorders/removes; safe to re-run. (slopcheck stays in its own block below.)
3590
+ {
3591
+ const added = ensureInstarBashPreToolUseHooks(preToolUse);
3592
+ if (added.length > 0) {
3593
+ patched = true;
3594
+ for (const fname of added) {
3595
+ result.upgraded.push(`.claude/settings.json: added PreToolUse ${fname} hook (dark-guardrail wiring)`);
3596
+ }
3597
+ }
3598
+ }
3579
3599
  // Ensure PreToolUse Bash slopcheck-guard hook exists (cherry-pick 2026-05-23).
3580
3600
  // Existing agents only get new Bash-matcher hooks through an explicit ensure
3581
3601
  // block here — there is no wholesale settings-template refresh on migration.