@tokenfactory/acc-runner 0.40.27 → 0.40.29

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 (64) hide show
  1. package/dist/attachments/allowlist.d.ts +16 -0
  2. package/dist/attachments/allowlist.d.ts.map +1 -0
  3. package/dist/attachments/allowlist.js +34 -0
  4. package/dist/attachments/allowlist.js.map +1 -0
  5. package/dist/attachments/content-block.d.ts +16 -0
  6. package/dist/attachments/content-block.d.ts.map +1 -0
  7. package/dist/attachments/content-block.js +38 -0
  8. package/dist/attachments/content-block.js.map +1 -0
  9. package/dist/attachments/fetch-attachment.d.ts +24 -0
  10. package/dist/attachments/fetch-attachment.d.ts.map +1 -0
  11. package/dist/attachments/fetch-attachment.js +55 -0
  12. package/dist/attachments/fetch-attachment.js.map +1 -0
  13. package/dist/attachments/index.d.ts +21 -0
  14. package/dist/attachments/index.d.ts.map +1 -0
  15. package/dist/attachments/index.js +20 -0
  16. package/dist/attachments/index.js.map +1 -0
  17. package/dist/attachments/types.d.ts +39 -0
  18. package/dist/attachments/types.d.ts.map +1 -0
  19. package/dist/attachments/types.js +9 -0
  20. package/dist/attachments/types.js.map +1 -0
  21. package/dist/chat-cancel/cancel-controller.d.ts +77 -0
  22. package/dist/chat-cancel/cancel-controller.d.ts.map +1 -0
  23. package/dist/chat-cancel/cancel-controller.js +148 -0
  24. package/dist/chat-cancel/cancel-controller.js.map +1 -0
  25. package/dist/chat-cancel/cancel-source.d.ts +37 -0
  26. package/dist/chat-cancel/cancel-source.d.ts.map +1 -0
  27. package/dist/chat-cancel/cancel-source.js +26 -0
  28. package/dist/chat-cancel/cancel-source.js.map +1 -0
  29. package/dist/chat-cancel/child-terminator.d.ts +37 -0
  30. package/dist/chat-cancel/child-terminator.d.ts.map +1 -0
  31. package/dist/chat-cancel/child-terminator.js +81 -0
  32. package/dist/chat-cancel/child-terminator.js.map +1 -0
  33. package/dist/chat-cancel/index.d.ts +21 -0
  34. package/dist/chat-cancel/index.d.ts.map +1 -0
  35. package/dist/chat-cancel/index.js +20 -0
  36. package/dist/chat-cancel/index.js.map +1 -0
  37. package/dist/chat-cancel/types.d.ts +69 -0
  38. package/dist/chat-cancel/types.d.ts.map +1 -0
  39. package/dist/chat-cancel/types.js +7 -0
  40. package/dist/chat-cancel/types.js.map +1 -0
  41. package/dist/claim-deadman/deadman.d.ts +152 -0
  42. package/dist/claim-deadman/deadman.d.ts.map +1 -0
  43. package/dist/claim-deadman/deadman.js +176 -0
  44. package/dist/claim-deadman/deadman.js.map +1 -0
  45. package/dist/claim-deadman/heartbeat-signal.d.ts +48 -0
  46. package/dist/claim-deadman/heartbeat-signal.d.ts.map +1 -0
  47. package/dist/claim-deadman/heartbeat-signal.js +31 -0
  48. package/dist/claim-deadman/heartbeat-signal.js.map +1 -0
  49. package/dist/claim-deadman/index.d.ts +19 -0
  50. package/dist/claim-deadman/index.d.ts.map +1 -0
  51. package/dist/claim-deadman/index.js +17 -0
  52. package/dist/claim-deadman/index.js.map +1 -0
  53. package/dist/clarification.d.ts +48 -0
  54. package/dist/clarification.d.ts.map +1 -0
  55. package/dist/clarification.js +114 -0
  56. package/dist/clarification.js.map +1 -0
  57. package/dist/cli.d.ts.map +1 -1
  58. package/dist/cli.js +20 -0
  59. package/dist/cli.js.map +1 -1
  60. package/dist/watch.d.ts +74 -0
  61. package/dist/watch.d.ts.map +1 -1
  62. package/dist/watch.js +289 -1
  63. package/dist/watch.js.map +1 -1
  64. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * CX-3 STOP-CANCEL: SIGTERM → grace → SIGKILL of an engine child, with a
3
+ * provable-death promise.
4
+ *
5
+ * The chat-lane driver already SIGTERMs the engine child when its AbortSignal
6
+ * fires (engines spawn the child bound to that signal). This terminator is the
7
+ * belt-and-suspenders escalation the operator's Stop needs: SIGTERM first, and if
8
+ * the child has not exited within a short grace window, SIGKILL — so an engine
9
+ * that swallows SIGTERM (a wedged subprocess) is still provably dead well inside
10
+ * the CX-3 "cancel lands ≤ 2s / engine child provably dead" budget.
11
+ *
12
+ * Fully injectable clock/timer seams so the escalation is exercised without real
13
+ * wall-clock sleeps.
14
+ */
15
+ import type { ChildHandle, ChildTerminationResult } from "./types.js";
16
+ /** Default grace after SIGTERM before escalating to SIGKILL (ms). */
17
+ export declare const DEFAULT_TERMINATE_GRACE_MS = 1200;
18
+ export interface TerminateChildOptions {
19
+ /** Grace after SIGTERM before SIGKILL, ms (default DEFAULT_TERMINATE_GRACE_MS). */
20
+ graceMs?: number;
21
+ /**
22
+ * Schedule a callback after `ms`, returning a canceller. Injected in tests so
23
+ * the grace window advances on a virtual clock. Defaults to unref'd setTimeout.
24
+ */
25
+ schedule?: (ms: number, cb: () => void) => () => void;
26
+ }
27
+ /**
28
+ * Terminate one engine child. Resolves when the child's exit is observed, or when
29
+ * the SIGKILL escalation has been delivered after the grace window — whichever
30
+ * comes first. Never rejects: a kill() that throws (already-dead race) resolves as
31
+ * alreadyDead, because the caller's contract is "the child will not keep running",
32
+ * not "I personally delivered the fatal signal".
33
+ */
34
+ export declare function terminateEngineChild(child: ChildHandle, opts?: TerminateChildOptions): Promise<ChildTerminationResult>;
35
+ /** Synchronous best-effort: SIGTERM now, no waiting. For shutdown fan-out. */
36
+ export declare function signalTerminate(child: ChildHandle): boolean;
37
+ //# sourceMappingURL=child-terminator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-terminator.d.ts","sourceRoot":"","sources":["../../src/chat-cancel/child-terminator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEtE,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,OAAQ,CAAC;AAEhD,MAAM,WAAW,qBAAqB;IACpC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CACvD;AAQD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,EAClB,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAuDjC;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAO3D"}
@@ -0,0 +1,81 @@
1
+ /** Default grace after SIGTERM before escalating to SIGKILL (ms). */
2
+ export const DEFAULT_TERMINATE_GRACE_MS = 1_200;
3
+ function defaultSchedule(ms, cb) {
4
+ const t = setTimeout(cb, ms);
5
+ t.unref?.();
6
+ return () => clearTimeout(t);
7
+ }
8
+ /**
9
+ * Terminate one engine child. Resolves when the child's exit is observed, or when
10
+ * the SIGKILL escalation has been delivered after the grace window — whichever
11
+ * comes first. Never rejects: a kill() that throws (already-dead race) resolves as
12
+ * alreadyDead, because the caller's contract is "the child will not keep running",
13
+ * not "I personally delivered the fatal signal".
14
+ */
15
+ export function terminateEngineChild(child, opts = {}) {
16
+ const graceMs = Math.max(0, opts.graceMs ?? DEFAULT_TERMINATE_GRACE_MS);
17
+ const schedule = opts.schedule ?? defaultSchedule;
18
+ // Already gone: nothing to signal.
19
+ if (child.pid === undefined) {
20
+ return Promise.resolve({ killed: true, escalated: false, alreadyDead: true, exited: true });
21
+ }
22
+ return new Promise((resolve) => {
23
+ let settled = false;
24
+ let escalated = false;
25
+ let sawExit = false;
26
+ let cancelGrace = null;
27
+ const finish = () => {
28
+ if (settled)
29
+ return;
30
+ settled = true;
31
+ cancelGrace?.();
32
+ resolve({ killed: true, escalated, alreadyDead: false, exited: sawExit });
33
+ };
34
+ // Resolve as soon as the child actually exits (the common, fast path).
35
+ try {
36
+ child.once("exit", () => {
37
+ sawExit = true;
38
+ finish();
39
+ });
40
+ }
41
+ catch {
42
+ /* an emitter that refuses a listener still gets the signals below */
43
+ }
44
+ // SIGTERM: the graceful ask.
45
+ try {
46
+ child.kill("SIGTERM");
47
+ }
48
+ catch {
49
+ // kill() throwing (ESRCH) means the child is already dead → we're done.
50
+ resolve({ killed: true, escalated: false, alreadyDead: true, exited: true });
51
+ return;
52
+ }
53
+ // Escalate to SIGKILL if it has not exited within the grace window.
54
+ cancelGrace = schedule(graceMs, () => {
55
+ if (settled)
56
+ return;
57
+ escalated = true;
58
+ try {
59
+ child.kill("SIGKILL");
60
+ }
61
+ catch {
62
+ /* already gone between the grace expiry and the SIGKILL — fine */
63
+ }
64
+ // Give the exit event a beat; if it never arrives (detached emitter in a
65
+ // test double) resolve anyway so the caller is never left hanging.
66
+ schedule(0, finish);
67
+ });
68
+ });
69
+ }
70
+ /** Synchronous best-effort: SIGTERM now, no waiting. For shutdown fan-out. */
71
+ export function signalTerminate(child) {
72
+ if (child.pid === undefined)
73
+ return false;
74
+ try {
75
+ return child.kill("SIGTERM");
76
+ }
77
+ catch {
78
+ return false;
79
+ }
80
+ }
81
+ //# sourceMappingURL=child-terminator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-terminator.js","sourceRoot":"","sources":["../../src/chat-cancel/child-terminator.ts"],"names":[],"mappings":"AAgBA,qEAAqE;AACrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAYhD,SAAS,eAAe,CAAC,EAAU,EAAE,EAAc;IACjD,MAAM,CAAC,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;IACZ,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAkB,EAClB,OAA8B,EAAE;IAEhC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,IAAI,0BAA0B,CAAC,CAAC;I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C;YAC7E,OAAO;QACT,CAAC;QAED,oEAAoE;QACpE,WAAW,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;YACnC,IAAI,OAAO;gBAAE,OAAO;YACpB,SAAS,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxB,CAAC;YAAC,MAAM,CAAC;gBACP,kEAAkE;YACpE,CAAC;YACD,yEAAyE;YACzE,mEAAmE;YACnE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,KAAkB;IAChD,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC1C,IAAI,CAAC;QACH,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * CX-3 STOP-CANCEL: the runner-side chat-cancel barrel.
3
+ *
4
+ * When the operator hits Stop, acc.cancel_chat_turn (migration 0278) makes the
5
+ * turn terminal-CANCELLED server-side and persists the partial reply. These
6
+ * primitives tear the still-running engine down locally so the child is provably
7
+ * dead and the slot frees:
8
+ * - child-terminator.ts — SIGTERM → grace → SIGKILL with a provable-death promise.
9
+ * - cancel-controller.ts — registers in-flight turns; reconciles against the
10
+ * server's cancel truth and aborts + terminates each.
11
+ * - cancel-source.ts — the acc.chat_turns-backed CancelSource.
12
+ *
13
+ * Wiring into ChatCompanion.launch (register-per-turn + reconcile loop) is a
14
+ * follow-up, mirroring the AS-3 resume-controller and FLEET-SERVE watch-chat
15
+ * primitives that shipped ahead of their watch.ts wiring.
16
+ */
17
+ export { DEFAULT_TERMINATE_GRACE_MS, signalTerminate, terminateEngineChild, type TerminateChildOptions, } from "./child-terminator.js";
18
+ export { ChatCancelController, type ChatCancelControllerOptions, } from "./cancel-controller.js";
19
+ export { buildSupabaseCancelSource, type CancelQueryClient, } from "./cancel-source.js";
20
+ export type { CancellableTurn, CancelSource, ChatCancelReason, ChildHandle, ChildTerminationResult, TurnCancelResult, } from "./types.js";
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat-cancel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,KAAK,2BAA2B,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * CX-3 STOP-CANCEL: the runner-side chat-cancel barrel.
3
+ *
4
+ * When the operator hits Stop, acc.cancel_chat_turn (migration 0278) makes the
5
+ * turn terminal-CANCELLED server-side and persists the partial reply. These
6
+ * primitives tear the still-running engine down locally so the child is provably
7
+ * dead and the slot frees:
8
+ * - child-terminator.ts — SIGTERM → grace → SIGKILL with a provable-death promise.
9
+ * - cancel-controller.ts — registers in-flight turns; reconciles against the
10
+ * server's cancel truth and aborts + terminates each.
11
+ * - cancel-source.ts — the acc.chat_turns-backed CancelSource.
12
+ *
13
+ * Wiring into ChatCompanion.launch (register-per-turn + reconcile loop) is a
14
+ * follow-up, mirroring the AS-3 resume-controller and FLEET-SERVE watch-chat
15
+ * primitives that shipped ahead of their watch.ts wiring.
16
+ */
17
+ export { DEFAULT_TERMINATE_GRACE_MS, signalTerminate, terminateEngineChild, } from "./child-terminator.js";
18
+ export { ChatCancelController, } from "./cancel-controller.js";
19
+ export { buildSupabaseCancelSource, } from "./cancel-source.js";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat-cancel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,GAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,GAE1B,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * CX-3 STOP-CANCEL (runner side): shared wire shapes for the chat-cancel
3
+ * primitives. Kept dependency-free (no execa / supabase imports) so the whole
4
+ * subsystem is exercised deterministically with plain fakes.
5
+ */
6
+ /** Why a turn is being torn down locally. Extensible; additive values are ignored by older peers. */
7
+ export type ChatCancelReason = "operator_cancelled" | "runner_shutdown";
8
+ /**
9
+ * The minimal child-process surface the terminator needs. `ExecaChildProcess`
10
+ * (what the engines spawn) is structurally assignable to this, so a real engine
11
+ * child and a test double share one code path.
12
+ */
13
+ export interface ChildHandle {
14
+ /** OS pid, or undefined once the child has been reaped. */
15
+ readonly pid?: number | undefined;
16
+ /** True once a kill signal has been delivered (Node sets this on kill()). */
17
+ readonly killed: boolean;
18
+ /** Deliver a signal. Returns false when the child is already gone. */
19
+ kill(signal?: NodeJS.Signals | number): boolean;
20
+ /** Subscribe once to a lifecycle event (exit/close ⇒ the child is dead). */
21
+ once(event: "exit" | "close", listener: (...args: unknown[]) => void): unknown;
22
+ }
23
+ /**
24
+ * A turn currently in flight on this runner that CAN be cancelled: aborting the
25
+ * controller stops the drive loop (and, when wired to the engine's spawn, SIGTERMs
26
+ * the child); `child` is the optional direct handle the terminator escalates on so
27
+ * the engine process is provably dead even if the abort→SIGTERM plumbing lags.
28
+ */
29
+ export interface CancellableTurn {
30
+ turnId: string;
31
+ conversationId: string;
32
+ /** Abort the drive loop for this turn (forwarded to engine.streamTurn's signal). */
33
+ abort: (reason: ChatCancelReason) => void;
34
+ /** Optional direct engine-child handle for provable termination. */
35
+ child?: ChildHandle | undefined;
36
+ }
37
+ /**
38
+ * The server-side source of cancel truth. Given the turn ids currently in flight
39
+ * on this runner, return the subset the operator has cancelled server-side
40
+ * (acc.chat_turns.status = 'cancelled', set by acc.cancel_chat_turn / migration
41
+ * 0278). The controller reconciles against this so a browser Stop reliably tears
42
+ * the local turn down within one poll cycle — no direct browser→runner channel
43
+ * required.
44
+ */
45
+ export interface CancelSource {
46
+ listCancelled(turnIds: readonly string[]): Promise<string[]>;
47
+ }
48
+ /** The outcome of terminating one engine child. */
49
+ export interface ChildTerminationResult {
50
+ /** True when a kill signal was delivered (or the child was already dead). */
51
+ killed: boolean;
52
+ /** True when SIGTERM did not land within the grace window and SIGKILL was sent. */
53
+ escalated: boolean;
54
+ /** True when the child was already gone before we tried (no pid / already killed). */
55
+ alreadyDead: boolean;
56
+ /** True when we observed the child's exit event before resolving. */
57
+ exited: boolean;
58
+ }
59
+ /** The outcome of cancelling one in-flight turn locally. */
60
+ export interface TurnCancelResult {
61
+ turnId: string;
62
+ /** True when the turn was registered and its abort was fired. */
63
+ aborted: boolean;
64
+ /** Present when the turn had a child handle we terminated. */
65
+ child?: ChildTerminationResult;
66
+ /** True when the turn was not registered here (nothing to cancel). */
67
+ notFound: boolean;
68
+ }
69
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/chat-cancel/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qGAAqG;AACrG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,iBAAiB,CAAC;AAExE;;;;GAIG;AACH,MAAM,W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B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * CX-3 STOP-CANCEL (runner side): shared wire shapes for the chat-cancel
3
+ * primitives. Kept dependency-free (no execa / supabase imports) so the whole
4
+ * subsystem is exercised deterministically with plain fakes.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/chat-cancel/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * CLAIM-DEADMAN: dead-man switch for a wedged claim channel.
3
+ *
4
+ * The incident (2026-07-22 ~18:24 IST): a dispatcher sent 12+ `task.dispatched`
5
+ * events to a runner whose HTTP heartbeat was current (hb_age 0min) but whose
6
+ * Realtime *claim subscription* was dead. The 90s claim watchdog —
7
+ * which resubscribes the channel when a task sits assigned-but-unclaimed — had
8
+ * itself stopped firing, so the board sat 12 queued / 0 running with two online
9
+ * runners and needed a manual `pkill acc-runner watch`.
10
+ *
11
+ * HTTP heartbeat and the WS claim channel fail INDEPENDENTLY. The heartbeat says
12
+ * "I'm alive"; the claim path says nothing. This state machine closes that seam
13
+ * with a stronger, later escalation than the 90s watchdog resubscribe:
14
+ *
15
+ * 1. track `pending-dispatch` (work the server is offering this runner) vs
16
+ * the last instant a claim was actually processed;
17
+ * 2. when work is pending AND no claim has landed for `wedgeThresholdMs`
18
+ * (default 120s, > the 90s watchdog so the cheap resubscribe gets first
19
+ * crack), TEAR DOWN + FULLY REBUILD the Realtime client (not just a
20
+ * resubscribe) — up to `maxRebuilds` times, paced by `rebuildGraceMs`;
21
+ * 3. if still wedged after the rebuild budget, fall back to DEGRADED
22
+ * DB-poll claiming (the caller polls the claim path directly every ~15s);
23
+ * 4. recovery is declared when the offered backlog drains to zero after a
24
+ * wedge episode — i.e. the board is unblocked again, whether the WS came
25
+ * back or the DB-poll fallback carried the load.
26
+ *
27
+ * This class is PURE and clock-injectable (`now`) so the thresholds are proven
28
+ * with a fake clock in unit tests; the watch loop owns the side effects (client
29
+ * rebuild, fallback timer, audit events). It never throws.
30
+ */
31
+ /** Default: no claim processed for this long, while work is pending, = wedged. */
32
+ export declare const DEFAULT_WEDGE_THRESHOLD_MS = 120000;
33
+ /**
34
+ * Default: minimum gap between escalation steps, so a rebuild has time to take
35
+ * effect before the next step is considered. Aligns with the fallback poll
36
+ * cadence. With the defaults the ladder is: wedge@120s, rebuild#1@120s,
37
+ * rebuild#2@135s, fallback@150s — comfortably inside the 3-min recovery target.
38
+ */
39
+ export declare const DEFAULT_REBUILD_GRACE_MS = 15000;
40
+ /** Default: full Realtime-client rebuilds before falling back to DB-poll claiming. */
41
+ export declare const DEFAULT_MAX_REBUILDS = 2;
42
+ /** Default: DB-poll fallback cadence (ms) — the caller's degraded claim loop. */
43
+ export declare const DEFAULT_FALLBACK_POLL_MS = 15000;
44
+ /** Default: how often the watch loop evaluates the deadman. */
45
+ export declare const DEFAULT_DEADMAN_CHECK_MS = 30000;
46
+ export type DeadmanActionKind = "none" | "rebuild" | "fallback";
47
+ export interface DeadmanDecision {
48
+ /**
49
+ * What the watch loop should do this tick:
50
+ * - "none": healthy, or wedged-but-waiting-out-the-rebuild-grace.
51
+ * - "rebuild": tear down + fully rebuild the Realtime client (attempt N).
52
+ * - "fallback": the rebuild budget is spent — run/keep the degraded DB-poll
53
+ * claim loop until the backlog drains.
54
+ */
55
+ action: DeadmanActionKind;
56
+ /** 1-based rebuild attempt when action === "rebuild". */
57
+ rebuildAttempt?: number;
58
+ /**
59
+ * True on the single tick that first detects the wedge this episode — the
60
+ * caller emits `runner.claim_channel_wedged` exactly once per episode.
61
+ */
62
+ wedged: boolean;
63
+ /** Snapshot for the audit payload. */
64
+ pendingDispatch: number;
65
+ /** ms since the last processed claim (staleness of the claim path). */
66
+ msSinceClaim: number;
67
+ }
68
+ export interface DispatchSignal {
69
+ /**
70
+ * How many tasks the server is currently offering this runner (assigned +
71
+ * queued, i.e. dispatched-but-unclaimed). The "server already knows" input:
72
+ * delivered via the heartbeat response or read from the assigned-queued RPC —
73
+ * either way an HTTP path that survives a dead WS.
74
+ */
75
+ pendingDispatch: number;
76
+ /**
77
+ * The dispatcher marked this runner SUSPECT after N consecutive undelivered
78
+ * dispatch offers. A redundant confirmation that work is genuinely being
79
+ * offered even if `pendingDispatch` momentarily reads 0.
80
+ */
81
+ suspect?: boolean;
82
+ }
83
+ export interface ClaimDeadmanOptions {
84
+ wedgeThresholdMs?: number;
85
+ rebuildGraceMs?: number;
86
+ maxRebuilds?: number;
87
+ /** Injected clock. Defaults to Date.now. */
88
+ now?: () => number;
89
+ }
90
+ export declare class ClaimDeadman {
91
+ private readonly wedgeThresholdMs;
92
+ private readonly rebuildGraceMs;
93
+ private readonly maxRebuilds;
94
+ private readonly now;
95
+ /** Current pending-dispatch count (offered work), from the last signal. */
96
+ private pending;
97
+ private suspect;
98
+ /** Last instant a claim was actually processed (any path). */
99
+ private lastClaimMs;
100
+ /** Full-client rebuilds performed this wedge episode. */
101
+ private rebuilds;
102
+ /** Latched: the DB-poll fallback is engaged for this episode. */
103
+ private fallbackActive;
104
+ /** Whether the `wedged` event has already been emitted this episode. */
105
+ private wedgedEmitted;
106
+ /** Last escalation instant, for pacing steps by rebuildGraceMs. */
107
+ private lastEscalationMs;
108
+ constructor(opts?: ClaimDeadmanOptions);
109
+ /**
110
+ * Feed the pending-dispatch signal (from the heartbeat response or the
111
+ * assigned-queued read). Returns `{ recovered: true }` on the transition where
112
+ * an active wedge episode's offered backlog has drained to zero — the caller
113
+ * then emits `runner.claim_channel_recovered` and stops the fallback loop.
114
+ */
115
+ observeDispatchSignal(signal: DispatchSignal): {
116
+ recovered: boolean;
117
+ };
118
+ /**
119
+ * A claim was processed (a task enqueued/claimed via ANY path — realtime,
120
+ * poll, scan, watchdog, or the DB-poll fallback). Resets the staleness clock
121
+ * so a runner that IS claiming — even slowly, even via the fallback — is never
122
+ * treated as wedged. Recovery itself is declared by the backlog draining
123
+ * (observeDispatchSignal), not by an individual claim, so a fallback claim
124
+ * keeps the runner functional without prematurely clearing the episode.
125
+ */
126
+ observeClaimProcessed(): void;
127
+ /**
128
+ * A heartbeat failed — the network/auth path is down, which is a DIFFERENT
129
+ * failure (the claim RPC would fail too). Not a wedge: clear the staleness
130
+ * clock and drop the pending signal so an outage never trips the deadman the
131
+ * instant heartbeats recover. Mirrors the claim watchdog's heartbeat-failure
132
+ * guard. Does not clear an in-flight episode's escalation state — a recovery
133
+ * is only ever declared by the backlog draining.
134
+ */
135
+ observeHeartbeatFailure(): void;
136
+ /** Evaluate the escalation ladder for this tick. Never throws. */
137
+ tick(): DeadmanDecision;
138
+ /** True while a wedge episode is in progress (escalated or already degraded). */
139
+ isFallbackActive(): boolean;
140
+ /** Introspection for tests / telemetry. */
141
+ snapshot(): {
142
+ pending: number;
143
+ suspect: boolean;
144
+ rebuilds: number;
145
+ fallbackActive: boolean;
146
+ wedgedEmitted: boolean;
147
+ };
148
+ private inEpisode;
149
+ private reset;
150
+ private decision;
151
+ }
152
+ //# sourceMappingURL=deadman.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deadman.d.ts","sourceRoot":"","sources":["../../src/claim-deadman/deadman.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,SAAU,CAAC;AAClD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B,yDAA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/B,kEAAkE;IAClE,IAAI,IAAI,eAAe;IAwCvB,iFAAiF;IACjF,gBAAgB,IAAI,OAAO;IAI3B,2CAA2C;IAC3C,QAAQ,IAAI;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,OAAO,CAAC;QACxB,aAAa,EAAE,OAAO,CAAC;KACxB;IAUD,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,KAAK;IAQb,OAAO,CAAC,QAAQ;CAOjB"}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * CLAIM-DEADMAN: dead-man switch for a wedged claim channel.
3
+ *
4
+ * The incident (2026-07-22 ~18:24 IST): a dispatcher sent 12+ `task.dispatched`
5
+ * events to a runner whose HTTP heartbeat was current (hb_age 0min) but whose
6
+ * Realtime *claim subscription* was dead. The 90s claim watchdog —
7
+ * which resubscribes the channel when a task sits assigned-but-unclaimed — had
8
+ * itself stopped firing, so the board sat 12 queued / 0 running with two online
9
+ * runners and needed a manual `pkill acc-runner watch`.
10
+ *
11
+ * HTTP heartbeat and the WS claim channel fail INDEPENDENTLY. The heartbeat says
12
+ * "I'm alive"; the claim path says nothing. This state machine closes that seam
13
+ * with a stronger, later escalation than the 90s watchdog resubscribe:
14
+ *
15
+ * 1. track `pending-dispatch` (work the server is offering this runner) vs
16
+ * the last instant a claim was actually processed;
17
+ * 2. when work is pending AND no claim has landed for `wedgeThresholdMs`
18
+ * (default 120s, > the 90s watchdog so the cheap resubscribe gets first
19
+ * crack), TEAR DOWN + FULLY REBUILD the Realtime client (not just a
20
+ * resubscribe) — up to `maxRebuilds` times, paced by `rebuildGraceMs`;
21
+ * 3. if still wedged after the rebuild budget, fall back to DEGRADED
22
+ * DB-poll claiming (the caller polls the claim path directly every ~15s);
23
+ * 4. recovery is declared when the offered backlog drains to zero after a
24
+ * wedge episode — i.e. the board is unblocked again, whether the WS came
25
+ * back or the DB-poll fallback carried the load.
26
+ *
27
+ * This class is PURE and clock-injectable (`now`) so the thresholds are proven
28
+ * with a fake clock in unit tests; the watch loop owns the side effects (client
29
+ * rebuild, fallback timer, audit events). It never throws.
30
+ */
31
+ /** Default: no claim processed for this long, while work is pending, = wedged. */
32
+ export const DEFAULT_WEDGE_THRESHOLD_MS = 120_000;
33
+ /**
34
+ * Default: minimum gap between escalation steps, so a rebuild has time to take
35
+ * effect before the next step is considered. Aligns with the fallback poll
36
+ * cadence. With the defaults the ladder is: wedge@120s, rebuild#1@120s,
37
+ * rebuild#2@135s, fallback@150s — comfortably inside the 3-min recovery target.
38
+ */
39
+ export const DEFAULT_REBUILD_GRACE_MS = 15_000;
40
+ /** Default: full Realtime-client rebuilds before falling back to DB-poll claiming. */
41
+ export const DEFAULT_MAX_REBUILDS = 2;
42
+ /** Default: DB-poll fallback cadence (ms) — the caller's degraded claim loop. */
43
+ export const DEFAULT_FALLBACK_POLL_MS = 15_000;
44
+ /** Default: how often the watch loop evaluates the deadman. */
45
+ export const DEFAULT_DEADMAN_CHECK_MS = 30_000;
46
+ export class ClaimDeadman {
47
+ wedgeThresholdMs;
48
+ rebuildGraceMs;
49
+ maxRebuilds;
50
+ now;
51
+ /** Current pending-dispatch count (offered work), from the last signal. */
52
+ pending = 0;
53
+ suspect = false;
54
+ /** Last instant a claim was actually processed (any path). */
55
+ lastClaimMs;
56
+ /** Full-client rebuilds performed this wedge episode. */
57
+ rebuilds = 0;
58
+ /** Latched: the DB-poll fallback is engaged for this episode. */
59
+ fallbackActive = false;
60
+ /** Whether the `wedged` event has already been emitted this episode. */
61
+ wedgedEmitted = false;
62
+ /** Last escalation instant, for pacing steps by rebuildGraceMs. */
63
+ lastEscalationMs = null;
64
+ constructor(opts = {}) {
65
+ this.wedgeThresholdMs = opts.wedgeThresholdMs ?? DEFAULT_WEDGE_THRESHOLD_MS;
66
+ this.rebuildGraceMs = opts.rebuildGraceMs ?? DEFAULT_REBUILD_GRACE_MS;
67
+ this.maxRebuilds = opts.maxRebuilds ?? DEFAULT_MAX_REBUILDS;
68
+ this.now = opts.now ?? Date.now;
69
+ this.lastClaimMs = this.now();
70
+ }
71
+ /**
72
+ * Feed the pending-dispatch signal (from the heartbeat response or the
73
+ * assigned-queued read). Returns `{ recovered: true }` on the transition where
74
+ * an active wedge episode's offered backlog has drained to zero — the caller
75
+ * then emits `runner.claim_channel_recovered` and stops the fallback loop.
76
+ */
77
+ observeDispatchSignal(signal) {
78
+ const wasWedged = this.inEpisode();
79
+ this.pending = Math.max(0, Math.floor(signal.pendingDispatch || 0));
80
+ this.suspect = Boolean(signal.suspect);
81
+ if (wasWedged && this.pending === 0 && !this.suspect) {
82
+ this.reset();
83
+ return { recovered: true };
84
+ }
85
+ return { recovered: false };
86
+ }
87
+ /**
88
+ * A claim was processed (a task enqueued/claimed via ANY path — realtime,
89
+ * poll, scan, watchdog, or the DB-poll fallback). Resets the staleness clock
90
+ * so a runner that IS claiming — even slowly, even via the fallback — is never
91
+ * treated as wedged. Recovery itself is declared by the backlog draining
92
+ * (observeDispatchSignal), not by an individual claim, so a fallback claim
93
+ * keeps the runner functional without prematurely clearing the episode.
94
+ */
95
+ observeClaimProcessed() {
96
+ this.lastClaimMs = this.now();
97
+ }
98
+ /**
99
+ * A heartbeat failed — the network/auth path is down, which is a DIFFERENT
100
+ * failure (the claim RPC would fail too). Not a wedge: clear the staleness
101
+ * clock and drop the pending signal so an outage never trips the deadman the
102
+ * instant heartbeats recover. Mirrors the claim watchdog's heartbeat-failure
103
+ * guard. Does not clear an in-flight episode's escalation state — a recovery
104
+ * is only ever declared by the backlog draining.
105
+ */
106
+ observeHeartbeatFailure() {
107
+ this.lastClaimMs = this.now();
108
+ this.pending = 0;
109
+ this.suspect = false;
110
+ }
111
+ /** Evaluate the escalation ladder for this tick. Never throws. */
112
+ tick() {
113
+ const now = this.now();
114
+ const msSinceClaim = now - this.lastClaimMs;
115
+ const offered = this.pending > 0 || this.suspect;
116
+ const stale = msSinceClaim >= this.wedgeThresholdMs;
117
+ // Nothing offered and not already degraded → healthy.
118
+ if (!offered && !this.fallbackActive) {
119
+ return this.decision("none", false, msSinceClaim);
120
+ }
121
+ // Already degraded → keep the DB-poll fallback running until the backlog
122
+ // drains (observeDispatchSignal declares recovery + resets).
123
+ if (this.fallbackActive) {
124
+ return this.decision("fallback", false, msSinceClaim);
125
+ }
126
+ // Offered but a claim landed recently → the claim path is working, not wedged.
127
+ if (!stale) {
128
+ return this.decision("none", false, msSinceClaim);
129
+ }
130
+ // Wedged. Pace escalation steps so a rebuild gets time to take effect.
131
+ if (this.lastEscalationMs !== null &&
132
+ now - this.lastEscalationMs < this.rebuildGraceMs) {
133
+ return this.decision("none", false, msSinceClaim);
134
+ }
135
+ const wedged = !this.wedgedEmitted;
136
+ this.wedgedEmitted = true;
137
+ this.lastEscalationMs = now;
138
+ if (this.rebuilds < this.maxRebuilds) {
139
+ this.rebuilds += 1;
140
+ const d = this.decision("rebuild", wedged, msSinceClaim);
141
+ d.rebuildAttempt = this.rebuilds;
142
+ return d;
143
+ }
144
+ // Rebuild budget spent — degrade to DB-poll claiming.
145
+ this.fallbackActive = true;
146
+ return this.decision("fallback", wedged, msSinceClaim);
147
+ }
148
+ /** True while a wedge episode is in progress (escalated or already degraded). */
149
+ isFallbackActive() {
150
+ return this.fallbackActive;
151
+ }
152
+ /** Introspection for tests / telemetry. */
153
+ snapshot() {
154
+ return {
155
+ pending: this.pending,
156
+ suspect: this.suspect,
157
+ rebuilds: this.rebuilds,
158
+ fallbackActive: this.fallbackActive,
159
+ wedgedEmitted: this.wedgedEmitted,
160
+ };
161
+ }
162
+ inEpisode() {
163
+ return this.wedgedEmitted || this.rebuilds > 0 || this.fallbackActive;
164
+ }
165
+ reset() {
166
+ this.rebuilds = 0;
167
+ this.fallbackActive = false;
168
+ this.wedgedEmitted = false;
169
+ this.lastEscalationMs = null;
170
+ this.lastClaimMs = this.now();
171
+ }
172
+ decision(action, wedged, msSinceClaim) {
173
+ return { action, wedged, pendingDispatch: this.pending, msSinceClaim };
174
+ }
175
+ }
176
+ //# sourceMappingURL=deadman.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deadman.js","sourceRoot":"","sources":["../../src/claim-deadman/deadman.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAClD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,iFAAiF;AACjF,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAkD/C,MAAM,OAAO,YAAY;IACN,gBAAgB,CAAS;IACzB,cAAc,CAAS;IACvB,WAAW,CAAS;IACpB,GAAG,CAAe;IAEnC,2EAA2E;IACnE,OAAO,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,KAAK,CAAC;IACxB,8DAA8D;IACtD,WAAW,CAAS;IAC5B,yDAAyD;IACjD,QAAQ,GAAG,CAAC,CAAC;IACrB,iEAAiE;IACzD,cAAc,GAAG,KAAK,CAAC;IAC/B,wEAAwE;IAChE,aAAa,GAAG,KAAK,CAAC;IAC9B,mEAAmE;IAC3D,gBAAgB,GAAkB,IAAI,CAAC;IAE/C,YAAY,OAA4B,EAAE;QACxC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,0BAA0B,CAAC;QAC5E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,wBAAwB,CAAC;QACtE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,oBAAoB,CAAC;QAC5D,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CA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