instar 1.3.210 → 1.3.212

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.
Files changed (32) hide show
  1. package/.claude/skills/autonomous/SKILL.md +11 -3
  2. package/dist/commands/server.d.ts.map +1 -1
  3. package/dist/commands/server.js +11 -0
  4. package/dist/commands/server.js.map +1 -1
  5. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  6. package/dist/core/PostUpdateMigrator.js +30 -0
  7. package/dist/core/PostUpdateMigrator.js.map +1 -1
  8. package/dist/core/SessionRecoveryChannel.d.ts +103 -0
  9. package/dist/core/SessionRecoveryChannel.d.ts.map +1 -0
  10. package/dist/core/SessionRecoveryChannel.js +158 -0
  11. package/dist/core/SessionRecoveryChannel.js.map +1 -0
  12. package/dist/core/SessionRecoveryConsumer.d.ts +60 -0
  13. package/dist/core/SessionRecoveryConsumer.d.ts.map +1 -0
  14. package/dist/core/SessionRecoveryConsumer.js +110 -0
  15. package/dist/core/SessionRecoveryConsumer.js.map +1 -0
  16. package/dist/core/StuckInputSentinel.d.ts +59 -2
  17. package/dist/core/StuckInputSentinel.d.ts.map +1 -1
  18. package/dist/core/StuckInputSentinel.js +127 -1
  19. package/dist/core/StuckInputSentinel.js.map +1 -1
  20. package/dist/core/types.d.ts +23 -0
  21. package/dist/core/types.d.ts.map +1 -1
  22. package/dist/core/types.js.map +1 -1
  23. package/dist/lifeline/TelegramLifeline.d.ts +1 -0
  24. package/dist/lifeline/TelegramLifeline.d.ts.map +1 -1
  25. package/dist/lifeline/TelegramLifeline.js +28 -0
  26. package/dist/lifeline/TelegramLifeline.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/data/builtin-manifest.json +21 -21
  29. package/upgrades/1.3.211.md +63 -0
  30. package/upgrades/1.3.212.md +65 -0
  31. package/upgrades/side-effects/autonomous-stop-hook-path-fix.md +156 -0
  32. package/upgrades/side-effects/codex-wedge-self-recovery.md +162 -0
@@ -57,11 +57,19 @@ import json
57
57
  with open('.claude/settings.json') as f:
58
58
  s = json.load(f)
59
59
  hooks = s.setdefault('hooks', {}).setdefault('Stop', [])
60
- if not any('autonomous-stop-hook' in str(h) for h in hooks):
61
- hooks.append({'matcher': '', 'hooks': [{'type': 'command', 'command': 'bash .instar/hooks/instar/autonomous-stop-hook.sh', 'timeout': 10000}]})
60
+ # The stop hook ships ONLY in the skill dir — register THAT path. (A legacy bug
61
+ # registered '.instar/hooks/instar/autonomous-stop-hook.sh', where the file is
62
+ # never deployed, so the hook silently failed every Stop and the loop never
63
+ # re-engaged.) Self-heal: drop any prior autonomous-stop-hook entry (incl. the
64
+ # legacy wrong path), then add exactly one correct-path entry.
65
+ correct = 'bash \${CLAUDE_PROJECT_DIR}/.claude/skills/autonomous/hooks/autonomous-stop-hook.sh'
66
+ before = json.dumps(hooks)
67
+ hooks[:] = [e for e in hooks if not any('autonomous-stop-hook' in str(h.get('command','')) for h in e.get('hooks', []))]
68
+ hooks.append({'matcher': '', 'hooks': [{'type': 'command', 'command': correct, 'timeout': 10000}]})
69
+ if json.dumps(hooks) != before:
62
70
  with open('.claude/settings.json', 'w') as f:
63
71
  json.dump(s, f, indent=2)
64
- print('Stop hook registered')
72
+ print('Stop hook registered (correct skill path)')
65
73
  "
66
74
  ```
67
75
 
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAySH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA+wDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAi8PtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA+wDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA28PtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -20,6 +20,7 @@ import { closeAllSqlite } from '../core/SqliteRegistry.js';
20
20
  import { SessionManager } from '../core/SessionManager.js';
21
21
  import { StateManager } from '../core/StateManager.js';
22
22
  import { StuckInputSentinel } from '../core/StuckInputSentinel.js';
23
+ import { SessionRecoveryChannel } from '../core/SessionRecoveryChannel.js';
23
24
  import { JobScheduler } from '../scheduler/JobScheduler.js';
24
25
  import { IntegrationGate } from '../scheduler/IntegrationGate.js';
25
26
  import { JobRunHistory } from '../scheduler/JobRunHistory.js';
@@ -4105,8 +4106,18 @@ export async function startServer(options) {
4105
4106
  // StuckInputSentinel — persistent, restart-safe recovery for tmux prompts
4106
4107
  // that hold text but never submitted Enter. Complements the in-process
4107
4108
  // verifyInjection timers (PR #159) which die when the server crashes.
4109
+ //
4110
+ // Codex session-wedge self-recovery (dark by default): when enabled, the
4111
+ // sentinel escalates PAST the keypress ladder by requesting a tier-C recovery
4112
+ // (server restart + replay) via SessionRecoveryChannel — executed by the
4113
+ // lifeline-process consumer (SessionRecoveryConsumer). See
4114
+ // docs/specs/CODEX-SESSION-WEDGE-SELF-RECOVERY.md.
4115
+ const codexWedgeCfg = config.monitoring?.codexWedgeRecovery;
4108
4116
  const stuckInputSentinel = new StuckInputSentinel(sessionManager, {
4109
4117
  stateDir: config.stateDir,
4118
+ recoveryChannel: new SessionRecoveryChannel(config.stateDir),
4119
+ escalationEnabled: codexWedgeCfg?.enabled ?? false,
4120
+ escalationTimeoutTicks: codexWedgeCfg?.escalationTimeoutTicks,
4110
4121
  });
4111
4122
  stuckInputSentinel.start();
4112
4123
  // Proactive resume heartbeat: every 60s, update the topic→UUID mapping