opencode-swarm 7.147.0 → 7.148.0

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 (99) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +26 -11
  2. package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +39 -13
  3. package/dist/cli/{ast-diff-665tewz6.js → ast-diff-ekd9v10f.js} +2 -2
  4. package/dist/cli/{config-doctor-7a2z00qt.js → config-doctor-z2wam5wn.js} +2 -2
  5. package/dist/cli/{core-50jqqm4g.js → core-k7m76ce0.js} +2 -2
  6. package/dist/cli/{curation-policy-g353f457.js → curation-policy-kd8j8cne.js} +4 -4
  7. package/dist/cli/{curator-drift-r50x1rac.js → curator-drift-fv4rttf4.js} +2 -2
  8. package/dist/cli/{curator-3t7e3hf9.js → curator-jwpm52kg.js} +31 -31
  9. package/dist/cli/curator-llm-factory-4qt8b15s.js +64 -0
  10. package/dist/cli/{dispatch-ndxbsk98.js → dispatch-w0rzasz3.js} +2 -2
  11. package/dist/cli/{evidence-summary-service-8n16gxgm.js → evidence-summary-service-90z295j3.js} +11 -11
  12. package/dist/cli/{gate-evidence-496qt72z.js → gate-evidence-3q6q71fw.js} +6 -6
  13. package/dist/cli/guardrail-explain-44xt373y.js +65 -0
  14. package/dist/cli/{guardrail-log-dy9b5qtt.js → guardrail-log-kbp5jztb.js} +4 -4
  15. package/dist/cli/guardrail-reset-vpazhh8k.js +90 -0
  16. package/dist/cli/{hive-promoter-mspppqbp.js → hive-promoter-tdrkz9nh.js} +31 -31
  17. package/dist/cli/{index-tya6ytex.js → index-016708th.js} +2 -2
  18. package/dist/cli/{index-er61pycf.js → index-07zgs6y0.js} +6 -6
  19. package/dist/cli/{index-hw1yghpg.js → index-2y14mjfn.js} +3 -3
  20. package/dist/cli/{index-w8pgjr75.js → index-4cgee5vh.js} +1 -1
  21. package/dist/cli/{index-ms46zgwb.js → index-52gnz782.js} +4 -4
  22. package/dist/cli/{index-sh8xbyca.js → index-702zx3rk.js} +10 -4
  23. package/dist/cli/{index-k5ng170v.js → index-7ac5z627.js} +2 -2
  24. package/dist/cli/{index-8py21zn6.js → index-7hctrdk8.js} +1 -1
  25. package/dist/cli/{index-yq1fxahj.js → index-9pmmexsd.js} +1 -1
  26. package/dist/cli/{index-92r9z3yk.js → index-crpb0qke.js} +32583 -31080
  27. package/dist/cli/{index-rpy0bent.js → index-d3bdr78h.js} +2 -2
  28. package/dist/cli/{index-15twmgzf.js → index-dfvh1r8g.js} +33 -33
  29. package/dist/cli/{index-20ndbsmh.js → index-dmbaaz6d.js} +8 -5
  30. package/dist/cli/{index-mfmegbz2.js → index-ffevkn7k.js} +1 -1
  31. package/dist/cli/{index-e1pxav9g.js → index-fxvgaeq4.js} +1 -1
  32. package/dist/cli/{index-z9yhhk6q.js → index-g8wwj0sz.js} +1 -1
  33. package/dist/cli/{index-w4ybhzyg.js → index-gwrv6c56.js} +6 -6
  34. package/dist/cli/{index-hmssmyvh.js → index-h879g4r4.js} +1 -1
  35. package/dist/cli/{index-b67y7an8.js → index-jpa03jcc.js} +10 -2
  36. package/dist/cli/{index-6c17bqbj.js → index-k6h5yc1j.js} +5 -5
  37. package/dist/cli/{index-argd4rp4.js → index-n0fpefqx.js} +4 -4
  38. package/dist/cli/{index-bgefx261.js → index-n96wwf56.js} +4 -4
  39. package/dist/cli/{index-abtrcs16.js → index-nj6rmyeh.js} +1 -1
  40. package/dist/cli/{index-hcb25p12.js → index-p62we2ar.js} +2 -2
  41. package/dist/cli/{index-3p4wgm0d.js → index-pgvx3rkq.js} +1 -1
  42. package/dist/cli/index-q7sjgr1y.js +52 -0
  43. package/dist/cli/{index-f75qjtn5.js → index-qcm97jfh.js} +1 -1
  44. package/dist/cli/{index-mdwvn7qe.js → index-qwj7qjjp.js} +2 -2
  45. package/dist/cli/{index-zj6t9zgx.js → index-r3mvsbtq.js} +8 -1
  46. package/dist/cli/{index-ddpkwdcb.js → index-r9wnyq0v.js} +1 -1
  47. package/dist/cli/{index-yjvtk1w2.js → index-rcjq8dm4.js} +2 -2
  48. package/dist/cli/{index-a3fky5pd.js → index-sycndcwd.js} +1 -1
  49. package/dist/cli/{index-pna97bbk.js → index-x4rxh8j9.js} +3 -3
  50. package/dist/cli/{index-p3k155dv.js → index-y586zet4.js} +1 -1
  51. package/dist/cli/{index-at1m1k5k.js → index-ykjjqg79.js} +6 -6
  52. package/dist/cli/{index-tp5ytzzg.js → index-zwpttdgn.js} +1 -1
  53. package/dist/cli/index.js +31 -31
  54. package/dist/cli/{knowledge-escalator-7gw36zj8.js → knowledge-escalator-0qnm48g8.js} +11 -11
  55. package/dist/cli/{knowledge-events-r1xak0yw.js → knowledge-events-3zv81nzp.js} +9 -9
  56. package/dist/cli/{knowledge-link-jkx8xjxp.js → knowledge-link-w91bcyx2.js} +3 -3
  57. package/dist/cli/{knowledge-store-wzzke013.js → knowledge-store-njtx6wj1.js} +4 -4
  58. package/dist/cli/{knowledge-validator-mma2bbgp.js → knowledge-validator-7eqj5afv.js} +6 -6
  59. package/dist/cli/{pending-delegations-k2yqg1sj.js → pending-delegations-k4x00mqc.js} +3 -3
  60. package/dist/cli/{pr-subscriptions-js5v2xr6.js → pr-subscriptions-x2mqc3f1.js} +3 -3
  61. package/dist/cli/{runner-q7d22d1w.js → runner-gfzkp9nv.js} +5 -5
  62. package/dist/cli/{runtime-x10qb3z1.js → runtime-wjwbpp9j.js} +2 -2
  63. package/dist/cli/{scan-cursor-0vcx58aa.js → scan-cursor-a6dhyf55.js} +5 -5
  64. package/dist/cli/{schema-qr135rxc.js → schema-p0vn1zgh.js} +1 -1
  65. package/dist/cli/{scope-persistence-x7v9mb9k.js → scope-persistence-zs97zkt7.js} +7 -7
  66. package/dist/cli/{skill-generator-aee04dwa.js → skill-generator-5qg15q1j.js} +14 -13
  67. package/dist/cli/{workspace-snapshot-kznz5e13.js → workspace-snapshot-nq25j94x.js} +2 -2
  68. package/dist/cli/{worktree-collision-ownership-xj0bsg92.js → worktree-collision-ownership-q2gswg16.js} +4 -4
  69. package/dist/cli/{worktree-isolation-ar52a7xr.js → worktree-isolation-ndb5fwys.js} +31 -31
  70. package/dist/cli/{worktree-provisioning-owner-72cyddz5.js → worktree-provisioning-owner-cve95q4f.js} +3 -3
  71. package/dist/commands/guardrail-reset.d.ts +2 -0
  72. package/dist/commands/registry.d.ts +16 -3
  73. package/dist/config/schema.d.ts +2 -0
  74. package/dist/failures/action-circuit.d.ts +69 -0
  75. package/dist/failures/action-identity.d.ts +33 -0
  76. package/dist/failures/invocation-failure.d.ts +77 -0
  77. package/dist/full-auto/oversight.d.ts +21 -0
  78. package/dist/full-auto/policy.d.ts +22 -0
  79. package/dist/full-auto/recovery.d.ts +43 -0
  80. package/dist/full-auto/severe-result.d.ts +86 -0
  81. package/dist/full-auto/state.d.ts +18 -0
  82. package/dist/hooks/full-auto-intercept.d.ts +1 -1
  83. package/dist/hooks/gate-denial-tracker.d.ts +1 -1
  84. package/dist/hooks/guardrails/nontransient-circuit.d.ts +19 -5
  85. package/dist/hooks/pr-workflow-gate.d.ts +64 -3
  86. package/dist/index.js +2866 -2816
  87. package/dist/lang/symbol-visibility.d.ts +10 -7
  88. package/dist/learning/admission.d.ts +1 -1
  89. package/dist/models/model-override-state.d.ts +47 -0
  90. package/dist/models/task-model-routing.d.ts +71 -0
  91. package/dist/services/diagnose-service.d.ts +2 -2
  92. package/dist/tools/dispatch-lanes.d.ts +16 -1
  93. package/dist/tools/repo-graph/types.d.ts +6 -4
  94. package/dist/utils/model-dispatch-fallback.d.ts +31 -10
  95. package/dist/utils/timeout.d.ts +18 -4
  96. package/package.json +1 -1
  97. package/dist/cli/curator-llm-factory-7cm4494k.js +0 -64
  98. package/dist/cli/guardrail-explain-my9zj5pj.js +0 -65
  99. package/dist/cli/index-wx8zdh4a.js +0 -24
@@ -0,0 +1,69 @@
1
+ export interface ActionCircuitEntry {
2
+ sessionID: string;
3
+ invocationID: number;
4
+ actionDigest: string;
5
+ circuitKind: string;
6
+ count: number;
7
+ hardStop: boolean;
8
+ generationToken: number;
9
+ lastSignalDigest: string | null;
10
+ firstSeenAt: number;
11
+ updatedAt: number;
12
+ expiresAt: number;
13
+ }
14
+ export interface ActionCircuitResetRecord {
15
+ sessionID: string;
16
+ invocationID: number;
17
+ actionDigest: string;
18
+ reason: 'success' | 'external' | 'invocation' | 'session';
19
+ actor: string | null;
20
+ at: number;
21
+ }
22
+ export declare function armActionCircuitAttempt(sessionID: string, invocationID: number, actionDigest: string): number;
23
+ export declare function noteActionCircuitFailure(input: {
24
+ sessionID: string;
25
+ invocationID: number;
26
+ actionDigest: string;
27
+ circuitKind: string;
28
+ signal: string;
29
+ hardStopThreshold: number;
30
+ now?: number;
31
+ generationToken?: number;
32
+ }): {
33
+ entry: ActionCircuitEntry | null;
34
+ enteredHardStop: boolean;
35
+ ignoredLateEvent: boolean;
36
+ };
37
+ export declare function clearActionCircuit(sessionID: string, invocationID: number, actionDigest: string, options?: {
38
+ reason?: 'success' | 'external' | 'invocation' | 'session';
39
+ actor?: string | null;
40
+ now?: number;
41
+ }): void;
42
+ export declare function resetActionCircuitExternally(input: {
43
+ sessionID: string;
44
+ invocationID: number;
45
+ actionDigest: string;
46
+ actor?: string | null;
47
+ now?: number;
48
+ }): void;
49
+ export declare function clearInvocationActionCircuits(sessionID: string, invocationID: number, now?: number): void;
50
+ export declare function clearSessionActionCircuits(sessionID: string, now?: number): void;
51
+ export declare function getBlockingActionCircuit(sessionID: string, invocationID: number, actionDigest: string): ActionCircuitEntry | null;
52
+ export declare function listBlockingActionCircuitsForInvocation(sessionID: string, invocationID: number): ActionCircuitEntry[];
53
+ export declare function peekActionCircuitCount(sessionID: string, invocationID: number, actionDigest: string, circuitKind: string): number;
54
+ export declare function expireActionCircuit(sessionID: string, invocationID: number, actionDigest: string, circuitKind: string): void;
55
+ export declare function clearAllActionCircuits(): void;
56
+ export declare const _test_exports: {
57
+ ACTION_CIRCUIT_TTL_MS: number;
58
+ MAX_TRACKED_ACTION_CIRCUITS: number;
59
+ size: () => number;
60
+ getGenerationToken: (sessionID: string, invocationID: number, actionDigest: string) => number;
61
+ getResetAudit: () => {
62
+ sessionID: string;
63
+ invocationID: number;
64
+ actionDigest: string;
65
+ reason: "success" | "external" | "invocation" | "session";
66
+ actor: string | null;
67
+ at: number;
68
+ }[];
69
+ };
@@ -0,0 +1,33 @@
1
+ type PresenceMarker = 'missing' | 'empty' | 'value';
2
+ type BackgroundMarker = PresenceMarker | 'invalid';
3
+ export interface ActionIdentityV1 {
4
+ version: 1;
5
+ tool: string;
6
+ role: string;
7
+ swarm: string | null;
8
+ taskId: string | null;
9
+ taskMarker: PresenceMarker;
10
+ phase: string | null;
11
+ phaseMarker: PresenceMarker;
12
+ parentSessionDigest: string | null;
13
+ parentSessionMarker: PresenceMarker;
14
+ parentInvocation: string | null;
15
+ parentInvocationMarker: PresenceMarker;
16
+ dispatchGeneration: string | null;
17
+ dispatchGenerationMarker: PresenceMarker;
18
+ mode: string | null;
19
+ modeMarker: PresenceMarker;
20
+ background: boolean | null;
21
+ backgroundMarker: BackgroundMarker;
22
+ scopeDigest: string | null;
23
+ scopeMarker: PresenceMarker;
24
+ additionalDigest: string;
25
+ digest: string;
26
+ pattern: string;
27
+ }
28
+ export interface ActionIdentityInput {
29
+ tool: string;
30
+ args?: unknown;
31
+ }
32
+ export declare function createActionIdentity(input: ActionIdentityInput): ActionIdentityV1;
33
+ export {};
@@ -0,0 +1,77 @@
1
+ import type { ActionIdentityInput, ActionIdentityV1 } from './action-identity.js';
2
+ export type InvocationFailureSource = 'provider' | 'shell' | 'filesystem' | 'git' | 'policy' | 'validation' | 'cancellation' | 'deadline';
3
+ export type InvocationFailureRetryClass = 'retry_same' | 'retry_fallback' | 'repair_then_retry' | 'operator_action' | 'do_not_retry';
4
+ export type InvocationFailureRisk = 'low' | 'medium' | 'high';
5
+ export interface InvocationFailureEvidence {
6
+ display: string;
7
+ statusCode?: number;
8
+ exitCode?: number;
9
+ code?: string;
10
+ signal?: string;
11
+ }
12
+ export interface InvocationFailureRecordV1 {
13
+ version: 1;
14
+ source: InvocationFailureSource;
15
+ category: string;
16
+ retryClass: InvocationFailureRetryClass;
17
+ risk: InvocationFailureRisk;
18
+ action: ActionIdentityV1 | null;
19
+ evidence: InvocationFailureEvidence;
20
+ occurredAt: string;
21
+ }
22
+ export interface ToolFailureClassificationInput {
23
+ tool: string;
24
+ args?: unknown;
25
+ output: string;
26
+ error?: unknown;
27
+ metadata?: unknown;
28
+ correlation?: {
29
+ sandboxWrapped?: boolean;
30
+ originalCommand?: string;
31
+ };
32
+ }
33
+ export declare function sanitizeFailureEvidenceDisplay(value: string): string;
34
+ declare function isNeutralExitOne(command: string): boolean;
35
+ export declare function classifyProviderFailure(error: unknown, action?: ActionIdentityInput): InvocationFailureRecordV1;
36
+ export declare function isRetryableProviderFailure(record: InvocationFailureRecordV1): boolean;
37
+ export declare function classifyToolInvocationFailure(input: ToolFailureClassificationInput): InvocationFailureRecordV1 | null;
38
+ export declare function createFilesystemFailure(input: {
39
+ reason: 'busy_lock' | 'permission' | 'read_only' | 'no_space' | 'path_containment' | 'not_found' | 'unknown';
40
+ display: string;
41
+ code?: string;
42
+ idempotent?: boolean;
43
+ action?: ActionIdentityInput;
44
+ }): InvocationFailureRecordV1;
45
+ export declare function createGitFailure(input: {
46
+ reason: 'conflict' | 'rebase' | 'dirty_primary' | 'lock_busy' | 'timeout' | 'command_unavailable' | 'corrupt_repository';
47
+ display: string;
48
+ code?: string;
49
+ idempotent?: boolean;
50
+ action?: ActionIdentityInput;
51
+ }): InvocationFailureRecordV1;
52
+ export declare function createPolicyFailure(input: {
53
+ reason: 'gate_denial' | 'containment' | 'destructive';
54
+ display: string;
55
+ code?: string;
56
+ action?: ActionIdentityInput;
57
+ }): InvocationFailureRecordV1;
58
+ export declare function createValidationFailure(input: {
59
+ display: string;
60
+ code?: string;
61
+ action?: ActionIdentityInput;
62
+ }): InvocationFailureRecordV1;
63
+ export declare function createCancellationFailure(input: {
64
+ display: string;
65
+ action?: ActionIdentityInput;
66
+ }): InvocationFailureRecordV1;
67
+ export declare function createDeadlineFailure(input: {
68
+ display: string;
69
+ code?: string;
70
+ idempotent?: boolean;
71
+ action?: ActionIdentityInput;
72
+ }): InvocationFailureRecordV1;
73
+ export declare const _test_exports: {
74
+ isNeutralExitOne: typeof isNeutralExitOne;
75
+ sanitizeFailureEvidenceDisplay: typeof sanitizeFailureEvidenceDisplay;
76
+ };
77
+ export {};
@@ -1,3 +1,5 @@
1
+ import { sleep } from '../utils/bun-compat';
2
+ import { teardownEphemeralSession } from '../utils/ephemeral-session-teardown';
1
3
  import { type ParsedCriticResponse } from './critic-response-parser';
2
4
  export interface FullAutoCriticResult extends ParsedCriticResponse {
3
5
  }
@@ -48,6 +50,10 @@ export interface DispatchFullAutoOversightInput {
48
50
  max_dispatch_retries?: number;
49
51
  /** Override for max consecutive dispatch failures (default from schema: 3). */
50
52
  max_consecutive_dispatch_failures?: number;
53
+ /** Total wall-clock deadline across create, prompt, backoff, parse, and cleanup. */
54
+ total_timeout_ms?: number;
55
+ /** Cleanup sub-budget for ephemeral-session teardown. */
56
+ cleanup_timeout_ms?: number;
51
57
  };
52
58
  }
53
59
  export declare function parseFullAutoCriticResponse(rawResponse: string): FullAutoCriticResult;
@@ -89,4 +95,19 @@ export declare function dispatchFullAutoOversight(input: DispatchFullAutoOversig
89
95
  */
90
96
  export declare const _internals: {
91
97
  resetSequence: () => void;
98
+ now: () => number;
99
+ sleep: typeof sleep;
100
+ setTimer: typeof setTimeout;
101
+ clearTimer: typeof clearTimeout;
102
+ teardownEphemeralSession: typeof teardownEphemeralSession;
92
103
  };
104
+ export declare function probeFullAutoOversightHealth(input: {
105
+ directory: string;
106
+ sessionID: string;
107
+ totalTimeoutMs?: number;
108
+ cleanupTimeoutMs?: number;
109
+ }): Promise<{
110
+ healthy: boolean;
111
+ attempts: number;
112
+ reason: string;
113
+ }>;
@@ -41,6 +41,7 @@ export interface FullAutoClassifierInput {
41
41
  sessionID: string;
42
42
  agentName?: string;
43
43
  normalizedAgentName?: string;
44
+ generatedAgentNames?: string[];
44
45
  toolName: string;
45
46
  args: Record<string, unknown> | undefined;
46
47
  directory: string;
@@ -51,6 +52,27 @@ export interface FullAutoClassifierInput {
51
52
  planSummary?: string;
52
53
  changedFiles?: string[];
53
54
  fullAutoConfig: FullAutoPolicyConfig | undefined;
55
+ pluginConfig?: {
56
+ memory?: {
57
+ enabled?: boolean;
58
+ };
59
+ external_skills?: {
60
+ curation_enabled?: boolean;
61
+ };
62
+ council?: {
63
+ enabled?: boolean;
64
+ general?: {
65
+ enabled?: boolean;
66
+ };
67
+ };
68
+ turbo?: unknown;
69
+ skills?: {
70
+ enabled?: boolean;
71
+ };
72
+ tool_filter?: {
73
+ overrides?: Record<string, string[]>;
74
+ };
75
+ };
54
76
  }
55
77
  export declare function isReadOnlyTool(toolName: string): boolean;
56
78
  export declare function isWriteLikeTool(toolName: string): boolean;
@@ -0,0 +1,43 @@
1
+ import type { FullAutoRunState } from './state';
2
+ declare const VALID_MODES: readonly ["assisted", "supervised", "strict"];
3
+ export type FullAutoMode = (typeof VALID_MODES)[number];
4
+ export type ParsedFullAutoCommand = {
5
+ kind: 'status';
6
+ } | {
7
+ kind: 'enable';
8
+ mode?: FullAutoMode;
9
+ } | {
10
+ kind: 'disable';
11
+ } | {
12
+ kind: 'retry_oversight';
13
+ } | {
14
+ kind: 'resume';
15
+ } | {
16
+ kind: 'abort';
17
+ } | {
18
+ kind: 'toggle';
19
+ } | {
20
+ kind: 'invalid';
21
+ message: string;
22
+ };
23
+ type RecoveryBlockerEvaluator = (input: {
24
+ directory: string;
25
+ sessionID: string;
26
+ }) => string[];
27
+ export declare function isFullAutoMode(value: string): value is FullAutoMode;
28
+ export declare function parseFullAutoCommandArgs(args: string[], options?: {
29
+ allowToggle?: boolean;
30
+ }): ParsedFullAutoCommand;
31
+ export declare function isInfrastructurePauseReason(reason: string | undefined): boolean;
32
+ export declare function canRetryOversight(state: FullAutoRunState | undefined): state is FullAutoRunState;
33
+ export declare function canResumeFromProbe(state: FullAutoRunState | undefined, now?: number): state is FullAutoRunState;
34
+ export declare function registerFullAutoRecoveryBlockerEvaluator(evaluator: RecoveryBlockerEvaluator): void;
35
+ export declare function getFullAutoRecoveryBlockers(input: {
36
+ directory: string;
37
+ sessionID: string;
38
+ }): string[];
39
+ export declare function isAllowedPausedSwarmCommand(command: string, args: string[], status: 'paused' | 'terminated'): boolean;
40
+ export declare const _internals: {
41
+ resetRecoveryBlockerEvaluator: () => void;
42
+ };
43
+ export {};
@@ -0,0 +1,86 @@
1
+ import { getModifiedFilesForTask } from '../state';
2
+ export type FullAutoSevereCategory = 'external_instructions' | 'out_of_scope_files' | 'protected_state_mutation';
3
+ export interface FullAutoSevereEnvelopeV1 {
4
+ version: 1;
5
+ kind: 'full_auto_severe';
6
+ parent_session_id: string;
7
+ parent_call_id: string;
8
+ run_generation: number;
9
+ correlation_nonce: string;
10
+ category: FullAutoSevereCategory;
11
+ path_digests?: string[];
12
+ path_count?: number;
13
+ evidence_event_ids?: string[];
14
+ }
15
+ export interface RegisteredSevereEvent {
16
+ id: string;
17
+ sessionID: string;
18
+ category: string;
19
+ callID?: string;
20
+ generation?: number;
21
+ pathDigests?: string[];
22
+ recordedAt: number;
23
+ }
24
+ type PendingCorrelation = {
25
+ sessionID: string;
26
+ callID: string;
27
+ generation: number;
28
+ subagent: string;
29
+ createdAt: number;
30
+ nonce: string;
31
+ };
32
+ type ChildSessionBinding = {
33
+ childSessionID: string;
34
+ parentSessionID: string;
35
+ parentCallID: string;
36
+ generation: number;
37
+ createdAt: number;
38
+ };
39
+ declare function digestPath(filePath: string): string;
40
+ export declare function registerFullAutoSevereCorrelation(input: {
41
+ sessionID: string;
42
+ callID: string;
43
+ generation: number;
44
+ subagent: string;
45
+ }): {
46
+ nonce: string;
47
+ instruction: string;
48
+ };
49
+ export declare function clearFullAutoSevereCorrelation(sessionID: string, callID: string): void;
50
+ export declare function clearFullAutoSevereSession(sessionID: string): void;
51
+ export declare function bindFullAutoSevereChildSession(input: {
52
+ childSessionID: string;
53
+ parentSessionID: string;
54
+ parentCallID: string;
55
+ generation: number;
56
+ }): void;
57
+ export declare function recordFullAutoSevereEvidenceEvent(input: {
58
+ sessionID: string;
59
+ category: string;
60
+ callID?: string;
61
+ generation?: number;
62
+ paths?: string[];
63
+ childSessionID?: string;
64
+ }): string;
65
+ export declare function extractFullAutoSevereEnvelope(text: string): FullAutoSevereEnvelopeV1 | null;
66
+ export declare function validateFullAutoSevereEnvelope(input: {
67
+ envelope: FullAutoSevereEnvelopeV1 | null;
68
+ sessionID: string;
69
+ callID: string;
70
+ generation: number;
71
+ declaredScope?: string[] | null;
72
+ currentTaskID?: string | null;
73
+ session?: Parameters<typeof getModifiedFilesForTask>[0];
74
+ projectDirectory: string;
75
+ }): {
76
+ accepted: boolean;
77
+ category?: FullAutoSevereCategory;
78
+ reason: string;
79
+ };
80
+ export declare const _internals: {
81
+ pendingCorrelations: Map<string, PendingCorrelation>;
82
+ evidenceEvents: Map<string, RegisteredSevereEvent>;
83
+ childBindings: Map<string, ChildSessionBinding>;
84
+ digestPath: typeof digestPath;
85
+ };
86
+ export {};
@@ -19,6 +19,8 @@ export interface FullAutoRunState {
19
19
  status: FullAutoStatus;
20
20
  sessionID: string;
21
21
  mode: 'assisted' | 'supervised' | 'strict';
22
+ runGeneration?: number;
23
+ pauseGeneration?: number;
22
24
  planID?: string;
23
25
  currentPhase?: number;
24
26
  currentTaskID?: string;
@@ -50,6 +52,14 @@ export interface FullAutoRunState {
50
52
  phase?: number;
51
53
  escalatedAt: string;
52
54
  };
55
+ lastRecoveryProbe?: {
56
+ pauseGeneration: number;
57
+ checkedAt: string;
58
+ expiresAt: string;
59
+ attempts: number;
60
+ outcome: 'healthy' | 'unhealthy';
61
+ reason: string;
62
+ };
53
63
  }
54
64
  export interface FullAutoPersistedState {
55
65
  version: 2;
@@ -155,6 +165,14 @@ export declare function recordFullAutoEscalation(directory: string, sessionID: s
155
165
  deadlockCount: number;
156
166
  phase?: number;
157
167
  }): FullAutoRunState | undefined;
168
+ export declare function recordFullAutoRecoveryProbe(directory: string, sessionID: string, probe: {
169
+ pauseGeneration: number;
170
+ checkedAt: string;
171
+ expiresAt: string;
172
+ attempts: number;
173
+ outcome: 'healthy' | 'unhealthy';
174
+ reason: string;
175
+ }): FullAutoRunState | undefined;
158
176
  export interface DenialLimitDecision {
159
177
  pause: boolean;
160
178
  reason?: string;
@@ -53,7 +53,7 @@ export declare function injectVerdictIntoMessages(messages: MessageWithParts[],
53
53
  * This function encapsulates the critic invocation and event writing flow.
54
54
  * The critic response is awaited before writing the event to events.jsonl.
55
55
  */
56
- export declare function dispatchCriticAndWriteEvent(directory: string, architectOutput: string, criticContext: string, criticModel: string, escalationType: 'phase_completion' | 'question', interactionCount: number, deadlockCount: number, oversightAgentName: string, sessionID?: string, maxDispatchRetries?: number, maxConsecutiveDispatchFailures?: number): Promise<CriticDispatchResult>;
56
+ export declare function dispatchCriticAndWriteEvent(directory: string, architectOutput: string, criticContext: string, criticModel: string, escalationType: 'phase_completion' | 'question', interactionCount: number, deadlockCount: number, oversightAgentName: string, sessionID?: string, maxDispatchRetries?: number, maxConsecutiveDispatchFailures?: number, totalTimeoutMs?: number): Promise<CriticDispatchResult>;
57
57
  /**
58
58
  * Creates the full-auto intercept hook factory.
59
59
  *
@@ -163,7 +163,7 @@ export declare function resetGateDenialStreaks(sessionID: string, tool: string,
163
163
  */
164
164
  export declare function clearGateDenialStreaks(): void;
165
165
  export declare const _test_exports: {
166
- readonly MAX_TRACKED_DENIAL_STREAKS: 500;
166
+ readonly MAX_TRACKED_DENIAL_STREAKS: number;
167
167
  readonly GATE_DENIAL_TTL_MS: number;
168
168
  readonly MAX_CODE_LENGTH: 64;
169
169
  readonly MAX_DISCRIMINATOR_LENGTH: 64;
@@ -29,12 +29,24 @@ type ToolAfterOutput = {
29
29
  [key: string]: unknown;
30
30
  };
31
31
  declare function isNeutralExitOne(command: string): boolean;
32
- declare function classifyFatalSignal(signal: string, sandboxWrapped: boolean): NonTransientErrorCategory | null;
33
32
  export declare function classifyToolOutcome(input: ToolAfterInput, output: ToolAfterOutput, correlation?: PendingToolExecution): ToolOutcome;
34
- export declare function recordNonTransientFailure(sessionID: string, category: NonTransientErrorCategory, signal: string): NonTransientCircuitState | null;
35
- export declare function clearNonTransientCircuit(sessionID: string): void;
33
+ type ActionContext = {
34
+ tool: string;
35
+ args?: unknown;
36
+ /**
37
+ * A synchronous failure can occur after toolBefore armed an attempt but before
38
+ * the host can return its result. Re-arm that exact attempt only at this
39
+ * trusted call site; toolAfter results must remain unable to revive a stale
40
+ * generation.
41
+ */
42
+ armAttempt?: boolean;
43
+ };
44
+ declare function isAllowedRecoverySwarmCommand(args: unknown): boolean;
45
+ declare function isRecoveryAllowedTool(tool: string, args: unknown): boolean;
46
+ export declare function recordNonTransientFailure(sessionID: string, category: NonTransientErrorCategory, signal: string, context?: ActionContext): NonTransientCircuitState | null;
47
+ export declare function clearNonTransientCircuit(sessionID: string, context?: ActionContext): void;
36
48
  export declare function nonTransientHardStopMessage(circuit: NonTransientCircuitState): string;
37
- export declare function assertNonTransientCircuitAllowsTool(sessionID: string): void;
49
+ export declare function assertNonTransientCircuitAllowsTool(sessionID: string, context?: ActionContext): void;
38
50
  export declare function rememberToolExecution(sessionID: string, callID: string, tool: string, originalCommand: string): void;
39
51
  export declare function isToolExecutionCurrent(sessionID: string, execution: PendingToolExecution): boolean;
40
52
  export declare function markToolExecutionSandboxWrapped(sessionID: string, callID: string): void;
@@ -42,6 +54,8 @@ export declare function takeToolExecution(sessionID: string, callID: string): Pe
42
54
  export declare function forgetToolExecution(sessionID: string, callID: string): void;
43
55
  export declare const _test_exports: {
44
56
  isNeutralExitOne: typeof isNeutralExitOne;
45
- classifyFatalSignal: typeof classifyFatalSignal;
57
+ classifyFatalSignal: (signal: string, sandboxWrapped: boolean, tool?: string) => NonTransientErrorCategory | null;
58
+ isAllowedRecoverySwarmCommand: typeof isAllowedRecoverySwarmCommand;
59
+ isRecoveryAllowedTool: typeof isRecoveryAllowedTool;
46
60
  };
47
61
  export {};
@@ -529,6 +529,59 @@ declare function probeAlivePrWorkflowLaneSessions(directory: string, records: Ba
529
529
  alive: Set<string>;
530
530
  degradedReason?: PrWorkflowLaneProbeDegradedReason;
531
531
  }>;
532
+ /** One still-pending pr-review lane's host liveness reading (issue #2280 Part B). */
533
+ export interface PrWorkflowPendingLaneLiveness {
534
+ laneId: string;
535
+ /**
536
+ * Milliseconds since the lane record last changed — the same aging field
537
+ * (`updatedAt`) the 30-minute presumed-stale sweep measures age by, so the
538
+ * advisory and the terminal sweep can never disagree about how old a lane is.
539
+ */
540
+ pendingMs: number;
541
+ /**
542
+ * Host session status when known: `'busy'`/`'retry'` are live; any other
543
+ * reported type is an affirmative non-live reading; `'absent'` means the host
544
+ * enumerated sessions without ours; `'unknown'` means the probe degraded (or
545
+ * the record has no session id to probe at all).
546
+ */
547
+ hostStatus: string;
548
+ /**
549
+ * Past threshold AND the host did not affirmatively report the session live
550
+ * (non-live status, session absent, or probe degraded). DIAGNOSTIC ONLY — a
551
+ * `true` value never cancels, retries, replaces, or settles the lane.
552
+ */
553
+ stalledSuspect: boolean;
554
+ /**
555
+ * Why the reading is not a real host status: the probe's own failure reasons,
556
+ * plus `'advisory-unavailable'` when the advisory's surrounding accounting
557
+ * failed unexpectedly after the past-threshold set was already known — so an
558
+ * emitted entry always distinguishes "degraded" from a missing probe, and an
559
+ * ABSENT `pending_liveness` keeps meaning "no lane was past the threshold".
560
+ */
561
+ degradedReason?: PrWorkflowLaneProbeDegradedReason | 'advisory-unavailable';
562
+ }
563
+ /**
564
+ * Bounded, fail-open liveness advisory for still-pending pr-review lanes
565
+ * (issue #2280 Part B).
566
+ *
567
+ * ALERT-ONLY, by design: this reads host session status and reports it; it
568
+ * never cancels, retries, replaces, or settles anything. A stalled-suspect
569
+ * critic may still be thinking — automatic replacement would risk duplicate
570
+ * long-running critics racing on the same items — and the 30-minute
571
+ * presumed-stale sweep (issue #2251) remains the only terminal backstop.
572
+ *
573
+ * Cost model: below the threshold there is NO host round-trip at all; past it,
574
+ * exactly ONE session-status call regardless of how many lanes are pending,
575
+ * deadline-bounded through the same `_test_exports` seams as the #2251 probe
576
+ * and additionally clamped to the caller's remaining collection budget
577
+ * (`probeBudgetMs`) — the diagnostic must never add wait beyond the budget the
578
+ * caller already granted the collection itself. Any failure mode degrades
579
+ * (`hostStatus: 'unknown'`, `stalledSuspect: true`, reason named) instead of
580
+ * throwing — collection must never block or fail on this advisory.
581
+ */
582
+ export declare function collectPrWorkflowPendingLaneLiveness(directory: string, records: readonly BackgroundDelegationRecord[], options?: {
583
+ probeBudgetMs?: number;
584
+ }): Promise<PrWorkflowPendingLaneLiveness[]>;
532
585
  export interface PrWorkflowStaleLaneSettlement {
533
586
  /**
534
587
  * Every lane that still blocks: lanes with a fresh `updatedAt` PLUS lanes
@@ -595,9 +648,11 @@ export interface PrWorkflowStaleLaneSettlement {
595
648
  * Issue #2251 adds the second, stronger contradiction: a lane PAST the horizon
596
649
  * whose session the host affirmatively reports as `busy`/`retry` is genuinely
597
650
  * running (nothing heartbeats `updatedAt`, so age alone cannot see this) and is
598
- * retained instead of discarded. The probe is fail-open — see
599
- * {@link probeAlivePrWorkflowLaneSessions} so an unavailable, erroring or
600
- * empty probe leaves the age-only behaviour exactly as it was.
651
+ * retained instead of discarded. The probe is fail-open — the settlement
652
+ * consumes it through the alive-set wrapper {@link
653
+ * probeAlivePrWorkflowLaneSessions}; the fail-open taxonomy itself lives in
654
+ * {@link probePrWorkflowLaneSessionStatusTypes} — so an unavailable, erroring
655
+ * or empty probe leaves the age-only behaviour exactly as it was.
601
656
  */
602
657
  export declare function settlePresumedStalePrWorkflowLanes(directory: string, sessionID: string): Promise<PrWorkflowStaleLaneSettlement>;
603
658
  /**
@@ -863,6 +918,12 @@ export declare const _test_exports: {
863
918
  * `checkoutMutationActionTimeoutMs` above.
864
919
  */
865
920
  laneLivenessProbeTimeoutMs: number;
921
+ /**
922
+ * Pending-liveness advisory threshold (issue #2280 Part B), seam-read at
923
+ * call time for the same clock reason — a test drives the boundary by
924
+ * shortening the threshold, not by waiting minutes.
925
+ */
926
+ pendingLaneLivenessThresholdMs: number;
866
927
  resolveCurrentGitHead: typeof resolveCurrentGitHead;
867
928
  resolveCurrentGitHeadAsync: typeof resolveCurrentGitHeadAsync;
868
929
  resolveCurrentUpstreamPushTarget: typeof resolveCurrentUpstreamPushTarget;