instar 0.28.35 → 0.28.41
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/dashboard/index.html +40 -30
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +105 -46
- package/dist/commands/server.js.map +1 -1
- package/dist/core/CoherenceGate.d.ts +7 -0
- package/dist/core/CoherenceGate.d.ts.map +1 -1
- package/dist/core/CoherenceGate.js +7 -6
- package/dist/core/CoherenceGate.js.map +1 -1
- package/dist/core/CoherenceReviewer.d.ts +20 -5
- package/dist/core/CoherenceReviewer.d.ts.map +1 -1
- package/dist/core/CoherenceReviewer.js +36 -6
- package/dist/core/CoherenceReviewer.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +0 -14
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +2 -123
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts +9 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +18 -0
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/monitoring/CompactionSentinel.d.ts +143 -0
- package/dist/monitoring/CompactionSentinel.d.ts.map +1 -0
- package/dist/monitoring/CompactionSentinel.js +262 -0
- package/dist/monitoring/CompactionSentinel.js.map +1 -0
- package/dist/monitoring/PresenceProxy.d.ts +0 -40
- package/dist/monitoring/PresenceProxy.d.ts.map +1 -1
- package/dist/monitoring/PresenceProxy.js +4 -156
- package/dist/monitoring/PresenceProxy.js.map +1 -1
- package/dist/monitoring/PromptGate.d.ts.map +1 -1
- package/dist/monitoring/PromptGate.js +0 -75
- package/dist/monitoring/PromptGate.js.map +1 -1
- package/dist/threadline/adapters/RESTServer.d.ts +7 -1
- package/dist/threadline/adapters/RESTServer.d.ts.map +1 -1
- package/dist/threadline/adapters/RESTServer.js +62 -1
- package/dist/threadline/adapters/RESTServer.js.map +1 -1
- package/dist/threadline/relay/OfflineQueue.js +1 -1
- package/dist/threadline/relay/OfflineQueue.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-upgrade-guide.js +9 -115
- package/scripts/collect-metrics.py +25 -120
- package/scripts/upgrade-guide-validator.mjs +221 -0
- package/src/data/builtin-manifest.json +18 -18
- package/upgrades/0.28.36.md +40 -0
- package/upgrades/0.28.37.md +69 -0
- package/upgrades/0.28.38.md +41 -0
- package/upgrades/0.28.39.md +29 -0
- package/upgrades/0.28.40.md +32 -0
- package/upgrades/0.28.41.md +41 -0
- package/upgrades/NEXT.md +18 -0
- package/upgrades/0.28.10.md +0 -19
- package/upgrades/0.28.11.md +0 -19
- package/upgrades/0.28.13.md +0 -11
- package/upgrades/0.28.15.md +0 -11
- package/upgrades/0.28.18.md +0 -12
- package/upgrades/0.28.20.md +0 -19
- package/upgrades/0.28.21.md +0 -23
- package/upgrades/0.28.22.md +0 -23
- package/upgrades/0.28.23.md +0 -19
- package/upgrades/0.28.24.md +0 -18
- package/upgrades/0.28.25.md +0 -21
- package/upgrades/0.28.26.md +0 -20
- package/upgrades/0.28.27.md +0 -20
- package/upgrades/0.28.28.md +0 -20
- package/upgrades/0.28.30.md +0 -25
- package/upgrades/0.28.31.md +0 -38
- package/upgrades/0.28.32.md +0 -22
- package/upgrades/0.28.33.md +0 -22
- package/upgrades/0.28.35.md +0 -37
- package/upgrades/0.28.5.md +0 -17
- package/upgrades/0.28.7.md +0 -24
- package/upgrades/0.28.8.md +0 -21
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CompactionSentinel — Owns the full lifecycle of recovering a Claude session
|
|
3
|
+
* after context compaction.
|
|
4
|
+
*
|
|
5
|
+
* Prior behavior (before this class): three independent triggers —
|
|
6
|
+
* PreCompact hook event, SessionWatchdog 'compaction-idle' poll, and the
|
|
7
|
+
* compaction-recovery.sh endpoint — each called `recoverCompactedSession`
|
|
8
|
+
* fire-and-forget. If the injection didn't wake the session up (session
|
|
9
|
+
* genuinely hung, injection silently dropped, Claude process dead), nobody
|
|
10
|
+
* noticed. The idle-prompt zombie-killer then raced the recovery window
|
|
11
|
+
* and killed the session 15 minutes later, wiping the conversation.
|
|
12
|
+
*
|
|
13
|
+
* What this class adds:
|
|
14
|
+
* 1. Dedupe across triggers — once a session is in recovery, additional
|
|
15
|
+
* reports within the guard window are ignored.
|
|
16
|
+
* 2. Verification — after each inject attempt, watch the session's JSONL
|
|
17
|
+
* file for size/mtime growth, which is the cheapest reliable signal
|
|
18
|
+
* that Claude actually processed the prompt and produced output.
|
|
19
|
+
* 3. Retry with backoff — if verification fails within the window, try
|
|
20
|
+
* injecting again, up to `maxInjectAttempts`.
|
|
21
|
+
* 4. Zombie-kill veto — while a recovery is in flight, SessionManager's
|
|
22
|
+
* idle-prompt cleanup is told to leave the session alone via the
|
|
23
|
+
* activeRecoveryChecker hook.
|
|
24
|
+
* 5. Observable outcomes — emits `compaction:detected`,
|
|
25
|
+
* `compaction:inject-attempted`, `compaction:recovered`,
|
|
26
|
+
* `compaction:failed` events with a single `[Sentinel]` log prefix
|
|
27
|
+
* so the full lifecycle is greppable.
|
|
28
|
+
*
|
|
29
|
+
* Decoupling: the class takes a `recoverFn` in its deps rather than pulling
|
|
30
|
+
* in server.ts. The existing `recoverCompactedSession` helper is passed
|
|
31
|
+
* straight through, which keeps message-bus / topic-routing concerns out
|
|
32
|
+
* of this file.
|
|
33
|
+
*/
|
|
34
|
+
import { EventEmitter } from 'node:events';
|
|
35
|
+
export type CompactionTrigger = 'PreCompact' | 'watchdog-poll' | 'recovery-hook' | string;
|
|
36
|
+
export type CompactionStatus = 'pending-inject' | 'verifying' | 'retrying' | 'recovered' | 'failed';
|
|
37
|
+
export interface RecoveryState {
|
|
38
|
+
sessionName: string;
|
|
39
|
+
trigger: CompactionTrigger;
|
|
40
|
+
detectedAt: number;
|
|
41
|
+
attempts: number;
|
|
42
|
+
lastInjectAt: number;
|
|
43
|
+
baselineJsonlPath: string | null;
|
|
44
|
+
baselineJsonlSize: number | null;
|
|
45
|
+
baselineJsonlMtime: number | null;
|
|
46
|
+
status: CompactionStatus;
|
|
47
|
+
}
|
|
48
|
+
export interface CompactionSentinelDeps {
|
|
49
|
+
/**
|
|
50
|
+
* Actually perform a recovery injection on a session. The sentinel uses this
|
|
51
|
+
* rather than talking to SessionManager directly so topic/channel routing
|
|
52
|
+
* stays in server.ts. Returns whether the injection was accepted.
|
|
53
|
+
*/
|
|
54
|
+
recoverFn: (sessionName: string, triggerLabel: string) => Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Project directory, used to locate Claude Code's JSONL files for the
|
|
57
|
+
* verification check. Usually `config.projectDir`.
|
|
58
|
+
*/
|
|
59
|
+
projectDir: string;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve a session's Claude Code session UUID (from hook events). When
|
|
62
|
+
* present, the sentinel reads the jsonl file named exactly `<uuid>.jsonl`
|
|
63
|
+
* instead of falling back to most-recently-modified — which prevents
|
|
64
|
+
* false positives where a sibling session's output makes this one look
|
|
65
|
+
* recovered. Return undefined for sessions whose uuid isn't known yet.
|
|
66
|
+
*/
|
|
67
|
+
getClaudeSessionId?: (sessionName: string) => string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Override for the JSONL lookup root. Primarily for tests. Defaults to
|
|
70
|
+
* `$HOME/.claude/projects/<project-hash>`.
|
|
71
|
+
*/
|
|
72
|
+
jsonlRoot?: string;
|
|
73
|
+
/** Override for Date.now — for tests. */
|
|
74
|
+
now?: () => number;
|
|
75
|
+
/** Override timer setters — for tests. */
|
|
76
|
+
setTimer?: (fn: () => void, ms: number) => ReturnType<typeof setTimeout>;
|
|
77
|
+
clearTimer?: (handle: ReturnType<typeof setTimeout>) => void;
|
|
78
|
+
}
|
|
79
|
+
export interface CompactionSentinelConfig {
|
|
80
|
+
/** Ignore repeat reports for the same session within this window. */
|
|
81
|
+
dedupeWindowMs?: number;
|
|
82
|
+
/** How long to wait after injection before verifying output. */
|
|
83
|
+
verifyWindowMs?: number;
|
|
84
|
+
/** Max inject attempts before declaring failure. */
|
|
85
|
+
maxInjectAttempts?: number;
|
|
86
|
+
/** Max total time a recovery can block the zombie-killer. */
|
|
87
|
+
recoveryGuardMs?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface CompactionSentinelEvents {
|
|
90
|
+
'compaction:detected': [RecoveryState];
|
|
91
|
+
'compaction:inject-attempted': [RecoveryState & {
|
|
92
|
+
accepted: boolean;
|
|
93
|
+
}];
|
|
94
|
+
'compaction:recovered': [RecoveryState & {
|
|
95
|
+
jsonlDelta: number;
|
|
96
|
+
}];
|
|
97
|
+
'compaction:failed': [RecoveryState & {
|
|
98
|
+
reason: string;
|
|
99
|
+
}];
|
|
100
|
+
}
|
|
101
|
+
export declare class CompactionSentinel extends EventEmitter {
|
|
102
|
+
private readonly deps;
|
|
103
|
+
private readonly cfg;
|
|
104
|
+
private readonly active;
|
|
105
|
+
private readonly timers;
|
|
106
|
+
private readonly recentReports;
|
|
107
|
+
constructor(deps: CompactionSentinelDeps, config?: CompactionSentinelConfig);
|
|
108
|
+
private now;
|
|
109
|
+
private setTimer;
|
|
110
|
+
private clearTimer;
|
|
111
|
+
/**
|
|
112
|
+
* Report a compaction event for a session. Called by all three trigger paths
|
|
113
|
+
* (PreCompact hook, watchdog poll, recovery-hook endpoint). Deduped — if the
|
|
114
|
+
* same session is already in active recovery or was reported within the
|
|
115
|
+
* dedupe window, this is a no-op.
|
|
116
|
+
*/
|
|
117
|
+
report(sessionName: string, trigger: CompactionTrigger): void;
|
|
118
|
+
/**
|
|
119
|
+
* Predicate for SessionManager's zombie-killer: is this session currently
|
|
120
|
+
* being recovered? If yes, the zombie-killer should skip it.
|
|
121
|
+
*/
|
|
122
|
+
isRecoveryActive(sessionName: string): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Manually clear recovery state. Used when the session completes or is
|
|
125
|
+
* explicitly reset. Exposed mainly for tests and edge cases.
|
|
126
|
+
*/
|
|
127
|
+
clear(sessionName: string): void;
|
|
128
|
+
/** Stop all pending timers. Safe to call multiple times. */
|
|
129
|
+
stop(): void;
|
|
130
|
+
/** Get current active recovery state (test introspection). */
|
|
131
|
+
getState(sessionName: string): RecoveryState | undefined;
|
|
132
|
+
private attemptInjection;
|
|
133
|
+
private verifyRecovery;
|
|
134
|
+
private finalize;
|
|
135
|
+
/**
|
|
136
|
+
* Look up the JSONL file for this session. Prefers the exact file by
|
|
137
|
+
* Claude Code session UUID when known (prevents a sibling session's
|
|
138
|
+
* activity from looking like this session recovered). Falls back to the
|
|
139
|
+
* most recently-modified file in the project's jsonl root.
|
|
140
|
+
*/
|
|
141
|
+
private readJsonlBaseline;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=CompactionSentinel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactionSentinel.d.ts","sourceRoot":"","sources":["../../src/monitoring/CompactionSentinel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,GAAG,MAAM,CAAC;AAE1F,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAA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OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyB;IAC9C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqC;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoD;IAC3E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;gBAE/C,IAAI,EAAE,sBAAsB,EAAE,MAAM,GAAE,wBAA6B;IAW/E,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,UAAU;IAKlB;;;;;OAKG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAmC7D;;;OAGG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAO9C;;;OAGG;IACH,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAShC,4DAA4D;IAC5D,IAAI,IAAI,IAAI;IAOZ,8DAA8D;IAC9D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;YAI1C,gBAAgB;YAmChB,cAAc;IA2C5B,OAAO,CAAC,QAAQ;IAqBhB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CAoC1B"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CompactionSentinel — Owns the full lifecycle of recovering a Claude session
|
|
3
|
+
* after context compaction.
|
|
4
|
+
*
|
|
5
|
+
* Prior behavior (before this class): three independent triggers —
|
|
6
|
+
* PreCompact hook event, SessionWatchdog 'compaction-idle' poll, and the
|
|
7
|
+
* compaction-recovery.sh endpoint — each called `recoverCompactedSession`
|
|
8
|
+
* fire-and-forget. If the injection didn't wake the session up (session
|
|
9
|
+
* genuinely hung, injection silently dropped, Claude process dead), nobody
|
|
10
|
+
* noticed. The idle-prompt zombie-killer then raced the recovery window
|
|
11
|
+
* and killed the session 15 minutes later, wiping the conversation.
|
|
12
|
+
*
|
|
13
|
+
* What this class adds:
|
|
14
|
+
* 1. Dedupe across triggers — once a session is in recovery, additional
|
|
15
|
+
* reports within the guard window are ignored.
|
|
16
|
+
* 2. Verification — after each inject attempt, watch the session's JSONL
|
|
17
|
+
* file for size/mtime growth, which is the cheapest reliable signal
|
|
18
|
+
* that Claude actually processed the prompt and produced output.
|
|
19
|
+
* 3. Retry with backoff — if verification fails within the window, try
|
|
20
|
+
* injecting again, up to `maxInjectAttempts`.
|
|
21
|
+
* 4. Zombie-kill veto — while a recovery is in flight, SessionManager's
|
|
22
|
+
* idle-prompt cleanup is told to leave the session alone via the
|
|
23
|
+
* activeRecoveryChecker hook.
|
|
24
|
+
* 5. Observable outcomes — emits `compaction:detected`,
|
|
25
|
+
* `compaction:inject-attempted`, `compaction:recovered`,
|
|
26
|
+
* `compaction:failed` events with a single `[Sentinel]` log prefix
|
|
27
|
+
* so the full lifecycle is greppable.
|
|
28
|
+
*
|
|
29
|
+
* Decoupling: the class takes a `recoverFn` in its deps rather than pulling
|
|
30
|
+
* in server.ts. The existing `recoverCompactedSession` helper is passed
|
|
31
|
+
* straight through, which keeps message-bus / topic-routing concerns out
|
|
32
|
+
* of this file.
|
|
33
|
+
*/
|
|
34
|
+
import { EventEmitter } from 'node:events';
|
|
35
|
+
import fs from 'node:fs';
|
|
36
|
+
import path from 'node:path';
|
|
37
|
+
const DEFAULTS = {
|
|
38
|
+
dedupeWindowMs: 60_000, // 1 minute — catch overlapping triggers
|
|
39
|
+
verifyWindowMs: 25_000, // 25s — enough for claude to boot past recovery hook and emit output
|
|
40
|
+
maxInjectAttempts: 3,
|
|
41
|
+
recoveryGuardMs: 10 * 60_000, // 10 minutes — protection from zombie-killer
|
|
42
|
+
};
|
|
43
|
+
export class CompactionSentinel extends EventEmitter {
|
|
44
|
+
deps;
|
|
45
|
+
cfg;
|
|
46
|
+
active = new Map();
|
|
47
|
+
timers = new Map();
|
|
48
|
+
recentReports = new Map(); // sessionName → lastReportedAt
|
|
49
|
+
constructor(deps, config = {}) {
|
|
50
|
+
super();
|
|
51
|
+
this.deps = deps;
|
|
52
|
+
this.cfg = {
|
|
53
|
+
dedupeWindowMs: config.dedupeWindowMs ?? DEFAULTS.dedupeWindowMs,
|
|
54
|
+
verifyWindowMs: config.verifyWindowMs ?? DEFAULTS.verifyWindowMs,
|
|
55
|
+
maxInjectAttempts: config.maxInjectAttempts ?? DEFAULTS.maxInjectAttempts,
|
|
56
|
+
recoveryGuardMs: config.recoveryGuardMs ?? DEFAULTS.recoveryGuardMs,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
now() {
|
|
60
|
+
return this.deps.now ? this.deps.now() : Date.now();
|
|
61
|
+
}
|
|
62
|
+
setTimer(fn, ms) {
|
|
63
|
+
return this.deps.setTimer ? this.deps.setTimer(fn, ms) : setTimeout(fn, ms);
|
|
64
|
+
}
|
|
65
|
+
clearTimer(handle) {
|
|
66
|
+
if (this.deps.clearTimer)
|
|
67
|
+
this.deps.clearTimer(handle);
|
|
68
|
+
else
|
|
69
|
+
clearTimeout(handle);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Report a compaction event for a session. Called by all three trigger paths
|
|
73
|
+
* (PreCompact hook, watchdog poll, recovery-hook endpoint). Deduped — if the
|
|
74
|
+
* same session is already in active recovery or was reported within the
|
|
75
|
+
* dedupe window, this is a no-op.
|
|
76
|
+
*/
|
|
77
|
+
report(sessionName, trigger) {
|
|
78
|
+
const now = this.now();
|
|
79
|
+
if (this.active.has(sessionName)) {
|
|
80
|
+
return; // Recovery already in flight — ignore duplicate trigger.
|
|
81
|
+
}
|
|
82
|
+
const lastReport = this.recentReports.get(sessionName);
|
|
83
|
+
if (lastReport && now - lastReport < this.cfg.dedupeWindowMs) {
|
|
84
|
+
return; // Already reported recently.
|
|
85
|
+
}
|
|
86
|
+
this.recentReports.set(sessionName, now);
|
|
87
|
+
const baseline = this.readJsonlBaseline(sessionName);
|
|
88
|
+
const state = {
|
|
89
|
+
sessionName,
|
|
90
|
+
trigger,
|
|
91
|
+
detectedAt: now,
|
|
92
|
+
attempts: 0,
|
|
93
|
+
lastInjectAt: 0,
|
|
94
|
+
baselineJsonlPath: baseline?.path ?? null,
|
|
95
|
+
baselineJsonlSize: baseline?.size ?? null,
|
|
96
|
+
baselineJsonlMtime: baseline?.mtime ?? null,
|
|
97
|
+
status: 'pending-inject',
|
|
98
|
+
};
|
|
99
|
+
this.active.set(sessionName, state);
|
|
100
|
+
console.log(`[Sentinel] detected compaction on "${sessionName}" via ${trigger}; ` +
|
|
101
|
+
`baseline jsonl: ${state.baselineJsonlPath ? path.basename(state.baselineJsonlPath) : 'none'} ` +
|
|
102
|
+
`size=${state.baselineJsonlSize ?? 'n/a'}`);
|
|
103
|
+
this.emit('compaction:detected', state);
|
|
104
|
+
this.attemptInjection(state);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Predicate for SessionManager's zombie-killer: is this session currently
|
|
108
|
+
* being recovered? If yes, the zombie-killer should skip it.
|
|
109
|
+
*/
|
|
110
|
+
isRecoveryActive(sessionName) {
|
|
111
|
+
const state = this.active.get(sessionName);
|
|
112
|
+
if (!state)
|
|
113
|
+
return false;
|
|
114
|
+
// Don't claim active for terminal states (defense in depth).
|
|
115
|
+
return state.status !== 'recovered' && state.status !== 'failed';
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Manually clear recovery state. Used when the session completes or is
|
|
119
|
+
* explicitly reset. Exposed mainly for tests and edge cases.
|
|
120
|
+
*/
|
|
121
|
+
clear(sessionName) {
|
|
122
|
+
const timer = this.timers.get(sessionName);
|
|
123
|
+
if (timer) {
|
|
124
|
+
this.clearTimer(timer);
|
|
125
|
+
this.timers.delete(sessionName);
|
|
126
|
+
}
|
|
127
|
+
this.active.delete(sessionName);
|
|
128
|
+
}
|
|
129
|
+
/** Stop all pending timers. Safe to call multiple times. */
|
|
130
|
+
stop() {
|
|
131
|
+
for (const handle of this.timers.values())
|
|
132
|
+
this.clearTimer(handle);
|
|
133
|
+
this.timers.clear();
|
|
134
|
+
this.active.clear();
|
|
135
|
+
this.recentReports.clear();
|
|
136
|
+
}
|
|
137
|
+
/** Get current active recovery state (test introspection). */
|
|
138
|
+
getState(sessionName) {
|
|
139
|
+
return this.active.get(sessionName);
|
|
140
|
+
}
|
|
141
|
+
async attemptInjection(state) {
|
|
142
|
+
state.attempts += 1;
|
|
143
|
+
state.lastInjectAt = this.now();
|
|
144
|
+
state.status = 'pending-inject';
|
|
145
|
+
let accepted = false;
|
|
146
|
+
try {
|
|
147
|
+
accepted = await this.deps.recoverFn(state.sessionName, state.trigger);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
console.warn(`[Sentinel] recoverFn threw on "${state.sessionName}" (attempt ${state.attempts}):`, err);
|
|
151
|
+
}
|
|
152
|
+
console.log(`[Sentinel] inject-attempted on "${state.sessionName}" ` +
|
|
153
|
+
`(attempt ${state.attempts}/${this.cfg.maxInjectAttempts}, accepted=${accepted})`);
|
|
154
|
+
this.emit('compaction:inject-attempted', { ...state, accepted });
|
|
155
|
+
if (!accepted) {
|
|
156
|
+
// recoverFn returned false — typically means no unanswered user message,
|
|
157
|
+
// session not alive, or injection blocked. No point retrying; close out.
|
|
158
|
+
this.finalize(state, 'failed', 'recoverFn declined (no pending work or session gone)');
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
state.status = 'verifying';
|
|
162
|
+
const handle = this.setTimer(() => {
|
|
163
|
+
this.verifyRecovery(state).catch(err => {
|
|
164
|
+
console.warn(`[Sentinel] verify threw on "${state.sessionName}":`, err);
|
|
165
|
+
this.finalize(state, 'failed', `verify threw: ${String(err)}`);
|
|
166
|
+
});
|
|
167
|
+
}, this.cfg.verifyWindowMs);
|
|
168
|
+
this.timers.set(state.sessionName, handle);
|
|
169
|
+
}
|
|
170
|
+
async verifyRecovery(state) {
|
|
171
|
+
this.timers.delete(state.sessionName);
|
|
172
|
+
// Has the jsonl file grown? If so, claude processed the prompt and emitted.
|
|
173
|
+
const current = this.readJsonlBaseline(state.sessionName);
|
|
174
|
+
const grew = state.baselineJsonlSize !== null &&
|
|
175
|
+
current !== null &&
|
|
176
|
+
(current.size > state.baselineJsonlSize ||
|
|
177
|
+
(current.path === state.baselineJsonlPath &&
|
|
178
|
+
state.baselineJsonlMtime !== null &&
|
|
179
|
+
current.mtime > state.baselineJsonlMtime));
|
|
180
|
+
if (grew) {
|
|
181
|
+
const delta = (current?.size ?? 0) - (state.baselineJsonlSize ?? 0);
|
|
182
|
+
console.log(`[Sentinel] recovered "${state.sessionName}" after ${state.attempts} attempt(s) ` +
|
|
183
|
+
`(jsonl grew by ${delta} bytes)`);
|
|
184
|
+
this.emit('compaction:recovered', { ...state, jsonlDelta: delta });
|
|
185
|
+
this.finalize(state, 'recovered');
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
// No growth — session didn't respond within the window.
|
|
189
|
+
if (state.attempts >= this.cfg.maxInjectAttempts) {
|
|
190
|
+
this.finalize(state, 'failed', `no jsonl growth after ${state.attempts} attempts (${state.attempts * this.cfg.verifyWindowMs}ms total wait)`);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// Retry.
|
|
194
|
+
state.status = 'retrying';
|
|
195
|
+
console.log(`[Sentinel] retry "${state.sessionName}" ` +
|
|
196
|
+
`(attempt ${state.attempts}/${this.cfg.maxInjectAttempts} produced no output, re-injecting)`);
|
|
197
|
+
await this.attemptInjection(state);
|
|
198
|
+
}
|
|
199
|
+
finalize(state, status, reason) {
|
|
200
|
+
state.status = status;
|
|
201
|
+
if (status === 'failed') {
|
|
202
|
+
console.warn(`[Sentinel] failed "${state.sessionName}": ${reason ?? 'unknown'}`);
|
|
203
|
+
this.emit('compaction:failed', { ...state, reason: reason ?? 'unknown' });
|
|
204
|
+
}
|
|
205
|
+
// Keep the state around just long enough to exit the recovery-guard window
|
|
206
|
+
// (so the zombie-killer won't race the next prompt). Then clean up.
|
|
207
|
+
// Also clear the recentReports entry so a *new* compaction on this session
|
|
208
|
+
// can trigger a fresh recovery, even if the second compaction happens
|
|
209
|
+
// within the dedupe window of the first. Without this, the second
|
|
210
|
+
// compaction would be silently suppressed.
|
|
211
|
+
const keepFor = status === 'recovered' ? 5_000 : 30_000;
|
|
212
|
+
const handle = this.setTimer(() => {
|
|
213
|
+
this.timers.delete(state.sessionName);
|
|
214
|
+
this.active.delete(state.sessionName);
|
|
215
|
+
this.recentReports.delete(state.sessionName);
|
|
216
|
+
}, keepFor);
|
|
217
|
+
this.timers.set(state.sessionName, handle);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Look up the JSONL file for this session. Prefers the exact file by
|
|
221
|
+
* Claude Code session UUID when known (prevents a sibling session's
|
|
222
|
+
* activity from looking like this session recovered). Falls back to the
|
|
223
|
+
* most recently-modified file in the project's jsonl root.
|
|
224
|
+
*/
|
|
225
|
+
readJsonlBaseline(sessionName) {
|
|
226
|
+
try {
|
|
227
|
+
const root = this.deps.jsonlRoot
|
|
228
|
+
|| path.join(process.env.HOME || '/tmp', '.claude', 'projects', this.deps.projectDir.replace(/\//g, '-'));
|
|
229
|
+
if (!fs.existsSync(root))
|
|
230
|
+
return null;
|
|
231
|
+
// Prefer the exact file by claudeSessionId when available.
|
|
232
|
+
const uuid = this.deps.getClaudeSessionId?.(sessionName);
|
|
233
|
+
if (uuid) {
|
|
234
|
+
const exact = path.join(root, `${uuid}.jsonl`);
|
|
235
|
+
if (fs.existsSync(exact)) {
|
|
236
|
+
const st = fs.statSync(exact);
|
|
237
|
+
return { path: exact, size: st.size, mtime: st.mtimeMs };
|
|
238
|
+
}
|
|
239
|
+
// If uuid is known but file doesn't exist, return null rather than
|
|
240
|
+
// falling through — the session genuinely has no jsonl, and picking
|
|
241
|
+
// a sibling's file would be a false signal.
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
// Fallback: most-recently-modified jsonl in the project.
|
|
245
|
+
const entries = fs.readdirSync(root).filter(f => f.endsWith('.jsonl'));
|
|
246
|
+
if (entries.length === 0)
|
|
247
|
+
return null;
|
|
248
|
+
const latest = entries
|
|
249
|
+
.map(f => {
|
|
250
|
+
const full = path.join(root, f);
|
|
251
|
+
const st = fs.statSync(full);
|
|
252
|
+
return { path: full, size: st.size, mtime: st.mtimeMs };
|
|
253
|
+
})
|
|
254
|
+
.sort((a, b) => b.mtime - a.mtime)[0];
|
|
255
|
+
return latest;
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=CompactionSentinel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactionSentinel.js","sourceRoot":"","sources":["../../src/monitoring/CompactionSentinel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAuE7B,MAAM,QAAQ,GAAG;IACf,cAAc,EAAE,MAAM,EAAW,wCAAwC;IACzE,cAAc,EAAE,MAAM,EAAW,qEAAqE;IACtG,iBAAiB,EAAE,CAAC;IACpB,eAAe,EAAE,EAAE,GAAG,MAAM,EAAK,6CAA6C;CAC/E,CAAC;AASF,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACjC,IAAI,CAAyB;IAC7B,GAAG,CAAqC;IACxC,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC1C,MAAM,GAAG,IAAI,GAAG,EAAyC,CAAC;IAC1D,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC,CAAC,+BAA+B;IAE3F,YAAY,IAA4B,EAAE,SAAmC,EAAE;QAC7E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACj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,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;YAC1D,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -89,13 +89,6 @@ interface PresenceState {
|
|
|
89
89
|
tier3RecheckCount: number;
|
|
90
90
|
silencedUntil: number | null;
|
|
91
91
|
cancelled: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Timestamp + fingerprint of the last "session is awaiting your reply"
|
|
94
|
-
* notification we relayed to the user. Used to dedupe across tiers so we
|
|
95
|
-
* don't spam the user with the same pending question on every tick.
|
|
96
|
-
*/
|
|
97
|
-
awaitingInputRelayedAt: number | null;
|
|
98
|
-
awaitingInputFingerprint: string | null;
|
|
99
92
|
llmCallCount: number;
|
|
100
93
|
lastLlmCallAt: number;
|
|
101
94
|
conversationHistory: Array<{
|
|
@@ -125,26 +118,6 @@ export declare function detectQuotaExhaustion(snapshot: string): string | null;
|
|
|
125
118
|
* working and is waiting for new input.
|
|
126
119
|
*/
|
|
127
120
|
export declare function detectSessionIdle(snapshot: string): boolean;
|
|
128
|
-
export interface AwaitingInputDetection {
|
|
129
|
-
/** Which sentinel matched (for telemetry/debugging) */
|
|
130
|
-
label: string;
|
|
131
|
-
/** The single line that matched — used in the relay body */
|
|
132
|
-
matchLine: string;
|
|
133
|
-
/** Up to N trailing non-empty lines of context around the match (includes matchLine) */
|
|
134
|
-
context: string;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Detect whether the terminal snapshot shows the agent paused at a
|
|
138
|
-
* structured "awaiting user input" prompt — a plan, confirmation,
|
|
139
|
-
* or y/n question that needs a reply to unblock.
|
|
140
|
-
*
|
|
141
|
-
* Returns the match details if detected, null otherwise.
|
|
142
|
-
*
|
|
143
|
-
* Only inspects the last ~40 lines to avoid triggering on stale
|
|
144
|
-
* confirmation prompts from earlier in the session that have since
|
|
145
|
-
* been answered.
|
|
146
|
-
*/
|
|
147
|
-
export declare function detectAwaitingUserInput(snapshot: string): AwaitingInputDetection | null;
|
|
148
121
|
export declare class PresenceProxy {
|
|
149
122
|
private config;
|
|
150
123
|
private states;
|
|
@@ -188,19 +161,6 @@ export declare class PresenceProxy {
|
|
|
188
161
|
private buildTier2Prompt;
|
|
189
162
|
private buildTier3Prompt;
|
|
190
163
|
private callLlm;
|
|
191
|
-
/**
|
|
192
|
-
* Try to detect an "awaiting user input" prompt in the snapshot and, if
|
|
193
|
-
* found AND we haven't already relayed this specific question, send a
|
|
194
|
-
* Telegram notification so the user knows their reply is needed.
|
|
195
|
-
*
|
|
196
|
-
* Returns true if a relay was sent (caller should skip the normal
|
|
197
|
-
* idle-cancel or tier-progress logic to avoid noise). Returns false
|
|
198
|
-
* otherwise.
|
|
199
|
-
*
|
|
200
|
-
* Dedupe: keyed on a fingerprint of the match context. The same pending
|
|
201
|
-
* question won't be re-relayed across tiers.
|
|
202
|
-
*/
|
|
203
|
-
private maybeRelayAwaitingInput;
|
|
204
164
|
private sendProxyMessage;
|
|
205
165
|
/** System/delivery messages that should NOT be treated as real agent responses */
|
|
206
166
|
private isSystemMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceProxy.d.ts","sourceRoot":"","sources":["../../src/monitoring/PresenceProxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,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