opencode-swarm 7.166.4 → 7.167.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.
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/cli/{coder-settlement-yynntj5j.js → coder-settlement-j5e1pz2k.js} +3 -3
- package/dist/cli/{config-doctor-8asc35km.js → config-doctor-35pd2khv.js} +2 -2
- package/dist/cli/{core-qrbhs2q4.js → core-92m54spz.js} +1 -1
- package/dist/cli/{curator-llm-factory-rs4921ks.js → curator-llm-factory-vj5aqyd1.js} +19 -19
- package/dist/cli/{curator-qk4xmkv4.js → curator-pd098ytk.js} +19 -19
- package/dist/cli/{evidence-summary-service-rktcp3s4.js → evidence-summary-service-kwcme5fz.js} +6 -6
- package/dist/cli/{gate-evidence-k6nzqca1.js → gate-evidence-msn4kya1.js} +2 -2
- package/dist/cli/{guardrail-explain-jdspxzjr.js → guardrail-explain-2h9m8s4j.js} +20 -20
- package/dist/cli/{guardrail-log-962pzjev.js → guardrail-log-p6trrsvy.js} +3 -3
- package/dist/cli/{guardrail-reset-dv02t0bm.js → guardrail-reset-v6ds2t78.js} +19 -19
- package/dist/cli/{hive-promoter-9zzr28p2.js → hive-promoter-j2pjzrdh.js} +19 -19
- package/dist/cli/{index-wd86yj53.js → index-7yax969v.js} +1 -1
- package/dist/cli/{index-n189w64j.js → index-9qceke8g.js} +1 -1
- package/dist/cli/{index-qv4byzwp.js → index-chdyjg3s.js} +3 -3
- package/dist/cli/{index-st1zw5ps.js → index-d2phtxg2.js} +2 -2
- package/dist/cli/{index-0v6bf0j9.js → index-d9vbyb5a.js} +1 -1
- package/dist/cli/{index-gr5wg0nj.js → index-dczrrnzp.js} +2 -2
- package/dist/cli/{index-kz44j3qe.js → index-gbbahxhw.js} +3 -3
- package/dist/cli/{index-8ewgab6z.js → index-gw2d37dz.js} +1 -1
- package/dist/cli/{index-gsftf6c8.js → index-hdkt3n2k.js} +3 -3
- package/dist/cli/{index-gccxen4x.js → index-jhna6xnb.js} +5 -1
- package/dist/cli/{index-9eswrdp5.js → index-kg74hnbc.js} +1 -1
- package/dist/cli/{index-shqhq68n.js → index-mqbgkv5h.js} +11 -3
- package/dist/cli/{index-kwervbv6.js → index-n5bqrkgw.js} +3 -3
- package/dist/cli/{index-bxrxqwce.js → index-qmqn59mw.js} +1 -1
- package/dist/cli/{index-3s194swm.js → index-r09mpxtp.js} +4 -4
- package/dist/cli/{index-7g5kdtvw.js → index-t6hdjtfy.js} +1 -1
- package/dist/cli/{index-m9q6f3ty.js → index-tnb4jf94.js} +2 -2
- package/dist/cli/{index-v5wanchr.js → index-va2m1y35.js} +1 -1
- package/dist/cli/{index-z62gdhkd.js → index-wkj8m6wh.js} +3 -3
- package/dist/cli/{index-5qws47d4.js → index-wyca2c0w.js} +416 -72
- package/dist/cli/{index-n65x6e1y.js → index-ywa4jvg9.js} +5 -5
- package/dist/cli/{index-3ct7fd75.js → index-zq0btxga.js} +1 -1
- package/dist/cli/{index-x8c42y8s.js → index-zs0nyasy.js} +21 -21
- package/dist/cli/index.js +19 -19
- package/dist/cli/{knowledge-escalator-w4bfnks3.js → knowledge-escalator-skbk8tq8.js} +6 -6
- package/dist/cli/{knowledge-events-wmnx8m6b.js → knowledge-events-czaxq8hg.js} +4 -4
- package/dist/cli/{knowledge-store-5442ph4m.js → knowledge-store-wztr2gwz.js} +1 -1
- package/dist/cli/{knowledge-validator-5rmardr4.js → knowledge-validator-0eq5evs6.js} +2 -2
- package/dist/cli/{pending-delegations-ea6zpqw2.js → pending-delegations-2bran18p.js} +2 -2
- package/dist/cli/{pr-subscriptions-yqxt0avv.js → pr-subscriptions-rdp58505.js} +1 -1
- package/dist/cli/{pr-workflow-gate-px36rczj.js → pr-workflow-gate-dgk3zzgs.js} +19 -19
- package/dist/cli/{scan-cursor-efrage98.js → scan-cursor-ag6y6c14.js} +2 -2
- package/dist/cli/{schema-w2sds948.js → schema-qmh504jp.js} +3 -1
- package/dist/cli/{scope-persistence-dd7p3tdv.js → scope-persistence-c1ctykah.js} +5 -5
- package/dist/cli/{skill-generator-c0720k51.js → skill-generator-yqgwds3s.js} +7 -7
- package/dist/cli/{snapshot-coordination-init-dp42vvme.js → snapshot-coordination-init-62pxgka1.js} +19 -19
- package/dist/cli/{worktree-collision-ownership-emh2yhpx.js → worktree-collision-ownership-81773mwf.js} +2 -2
- package/dist/cli/{worktree-isolation-a8f1yahq.js → worktree-isolation-j2ewvha7.js} +19 -19
- package/dist/config/schema.d.ts +24 -0
- package/dist/hooks/lane-liveness-watchdog.d.ts +102 -0
- package/dist/hooks/pr-workflow-gate.d.ts +87 -1
- package/dist/index.js +12 -11
- package/dist/tools/dispatch-lanes.d.ts +9 -0
- package/opencode-swarm.schema.json +35 -0
- package/package.json +1 -1
|
@@ -21,44 +21,44 @@ import {
|
|
|
21
21
|
sanitizeWorktreeTaskId,
|
|
22
22
|
standardWorktreeByCallID,
|
|
23
23
|
standardWorktreeSerializationSessions
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-wyca2c0w.js";
|
|
25
25
|
import"./index-d5qf7hvh.js";
|
|
26
26
|
import"./index-m3tx1q9v.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
27
|
+
import"./index-9qceke8g.js";
|
|
28
|
+
import"./index-jhna6xnb.js";
|
|
29
|
+
import"./index-n5bqrkgw.js";
|
|
30
30
|
import"./index-5bd84nxc.js";
|
|
31
31
|
import"./index-txdagbh7.js";
|
|
32
32
|
import"./index-cw912re7.js";
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
33
|
+
import"./index-chdyjg3s.js";
|
|
34
|
+
import"./index-ywa4jvg9.js";
|
|
35
|
+
import"./index-t6hdjtfy.js";
|
|
36
36
|
import"./index-70ha9e09.js";
|
|
37
37
|
import"./index-1aex5zd9.js";
|
|
38
38
|
import"./index-9ss2m4rs.js";
|
|
39
39
|
import"./index-3nm1b3t2.js";
|
|
40
40
|
import"./index-zsrtt42s.js";
|
|
41
|
-
import"./index-
|
|
41
|
+
import"./index-wkj8m6wh.js";
|
|
42
42
|
import"./index-251vrmge.js";
|
|
43
43
|
import"./index-9wv6a3jx.js";
|
|
44
44
|
import"./index-b43rt5ph.js";
|
|
45
45
|
import"./index-q7sjgr1y.js";
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
46
|
+
import"./index-qmqn59mw.js";
|
|
47
|
+
import"./index-gw2d37dz.js";
|
|
48
|
+
import"./index-zq0btxga.js";
|
|
49
|
+
import"./index-gbbahxhw.js";
|
|
50
50
|
import"./index-sahf5yz3.js";
|
|
51
51
|
import"./index-p612v1mv.js";
|
|
52
|
-
import"./index-
|
|
52
|
+
import"./index-7yax969v.js";
|
|
53
53
|
import"./index-qww0h314.js";
|
|
54
54
|
import"./index-rtry5xyf.js";
|
|
55
55
|
import {
|
|
56
56
|
resolveWorktreeIsolationConfig
|
|
57
|
-
} from "./index-
|
|
57
|
+
} from "./index-d2phtxg2.js";
|
|
58
58
|
import"./index-3qf1vxtb.js";
|
|
59
59
|
import"./index-n832052r.js";
|
|
60
|
-
import"./index-
|
|
61
|
-
import"./index-
|
|
60
|
+
import"./index-dczrrnzp.js";
|
|
61
|
+
import"./index-va2m1y35.js";
|
|
62
62
|
import"./index-qd619x3r.js";
|
|
63
63
|
import"./index-75f9jj3h.js";
|
|
64
64
|
import"./index-6d4dc99f.js";
|
|
@@ -66,7 +66,7 @@ import"./index-rk10x4zr.js";
|
|
|
66
66
|
import"./index-ry16d01s.js";
|
|
67
67
|
import"./index-n4fzmqz8.js";
|
|
68
68
|
import"./index-qd726agw.js";
|
|
69
|
-
import"./index-
|
|
69
|
+
import"./index-r09mpxtp.js";
|
|
70
70
|
import"./index-vzm6zre7.js";
|
|
71
71
|
import"./index-ae75rja9.js";
|
|
72
72
|
import"./index-t8tw1bhs.js";
|
|
@@ -76,10 +76,10 @@ import"./index-f6zgz02s.js";
|
|
|
76
76
|
import"./index-7qefgq4j.js";
|
|
77
77
|
import"./index-ee6ydtfe.js";
|
|
78
78
|
import"./index-7g4c7s5r.js";
|
|
79
|
-
import"./index-
|
|
79
|
+
import"./index-kg74hnbc.js";
|
|
80
80
|
import"./index-9e6fdz2h.js";
|
|
81
81
|
import"./index-4rhhvd1a.js";
|
|
82
|
-
import"./index-
|
|
82
|
+
import"./index-mqbgkv5h.js";
|
|
83
83
|
import"./index-0tc0pcmh.js";
|
|
84
84
|
import"./index-bk5tah7q.js";
|
|
85
85
|
import"./index-bpmtbmy9.js";
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1872,6 +1872,23 @@ export declare const PrReviewResilienceConfigSchema: z.ZodObject<{
|
|
|
1872
1872
|
max_retry_attempts_after_initial: z.ZodDefault<z.ZodNumber>;
|
|
1873
1873
|
circuit_open_duration_ms: z.ZodDefault<z.ZodNumber>;
|
|
1874
1874
|
}, z.core.$strict>;
|
|
1875
|
+
/**
|
|
1876
|
+
* Issue #2506 (G2): the lane-liveness watchdog. Default OFF; each numeric knob
|
|
1877
|
+
* disables its own feature at 0. When enabled, `timeout_ms` becomes the ONE
|
|
1878
|
+
* effective PR-lane settlement horizon (the 30-minute reachability floor
|
|
1879
|
+
* remains the fallback when the watchdog is off or `timeout_ms` is 0), and
|
|
1880
|
+
* stall detection escalates low-output lanes BEFORE that horizon. Parameter
|
|
1881
|
+
* surface adopted with credit from opencode-ensemble (reimplemented per ADR
|
|
1882
|
+
* 0002 — no upstream code is ported).
|
|
1883
|
+
*/
|
|
1884
|
+
export declare const LaneLivenessWatchdogConfigSchema: z.ZodObject<{
|
|
1885
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1886
|
+
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
1887
|
+
stall_threshold_ms: z.ZodDefault<z.ZodNumber>;
|
|
1888
|
+
stall_min_steps: z.ZodDefault<z.ZodNumber>;
|
|
1889
|
+
stall_token_threshold: z.ZodDefault<z.ZodNumber>;
|
|
1890
|
+
}, z.core.$strict>;
|
|
1891
|
+
export type LaneLivenessWatchdogConfig = z.infer<typeof LaneLivenessWatchdogConfigSchema>;
|
|
1875
1892
|
/**
|
|
1876
1893
|
* Issue #2384: deprecated transcript-row settlement for Profile A PR-review
|
|
1877
1894
|
* base/micro discovery lanes is an explicit compatibility opt-in. Omitted
|
|
@@ -1977,6 +1994,13 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
1977
1994
|
max_retry_attempts_after_initial: z.ZodDefault<z.ZodNumber>;
|
|
1978
1995
|
circuit_open_duration_ms: z.ZodDefault<z.ZodNumber>;
|
|
1979
1996
|
}, z.core.$strict>>;
|
|
1997
|
+
lane_liveness_watchdog: z.ZodOptional<z.ZodObject<{
|
|
1998
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1999
|
+
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
2000
|
+
stall_threshold_ms: z.ZodDefault<z.ZodNumber>;
|
|
2001
|
+
stall_min_steps: z.ZodDefault<z.ZodNumber>;
|
|
2002
|
+
stall_token_threshold: z.ZodDefault<z.ZodNumber>;
|
|
2003
|
+
}, z.core.$strict>>;
|
|
1980
2004
|
pr_review_legacy_transcript_compatibility: z.ZodOptional<z.ZodBoolean>;
|
|
1981
2005
|
gates: z.ZodOptional<z.ZodObject<{
|
|
1982
2006
|
syntax_check: z.ZodDefault<z.ZodObject<{
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { LaneLivenessWatchdogConfig } from '../config/schema.js';
|
|
2
|
+
/** The five frozen defaults from the #2506 contract (0 disables a feature). */
|
|
3
|
+
export declare const LANE_LIVENESS_WATCHDOG_DEFAULTS: LaneLivenessWatchdogConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Upper bound on lane ids named in one `pr_workflow_lane_watchdog` event or
|
|
6
|
+
* disclosure. Defined here (not imported from the gate) so this module never
|
|
7
|
+
* depends on the gate layer.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_LANE_LIVENESS_DISCLOSED_IDS = 10;
|
|
10
|
+
/**
|
|
11
|
+
* The typed liveness conditions #2506 requires to be distinguishable. A
|
|
12
|
+
* temporarily slow provider or an expired observation budget must never be
|
|
13
|
+
* reported as child failure.
|
|
14
|
+
*
|
|
15
|
+
* - `observer_deadline` — the CALLER's collection wait budget expired while
|
|
16
|
+
* the session is live or unknown. Says nothing about the child; never a
|
|
17
|
+
* terminal transition.
|
|
18
|
+
* - `provider_retry_in_flight` — the host reports the session in `retry`:
|
|
19
|
+
* provider latency with its own bounded retry owner. Retained.
|
|
20
|
+
* - `completed_failure` — the ledger already holds a terminal error: the
|
|
21
|
+
* lane completed, with a real (failed) outcome.
|
|
22
|
+
* - `idle_failed_child` — an open record whose session is idle or absent
|
|
23
|
+
* below the horizon: the child failed without a terminal write.
|
|
24
|
+
* - `execution_deadline` — the lane exceeded the effective execution
|
|
25
|
+
* horizon: aborted best-effort and settled with its real outcome.
|
|
26
|
+
*/
|
|
27
|
+
export type LaneLivenessCondition = 'observer_deadline' | 'provider_retry_in_flight' | 'completed_failure' | 'idle_failed_child' | 'execution_deadline';
|
|
28
|
+
export interface ClassifyLaneLivenessInput {
|
|
29
|
+
/** Host session status type, when a probe ran. `undefined` = unknown. */
|
|
30
|
+
sessionStatusType?: string;
|
|
31
|
+
/** Ledger record status string (e.g. `pending`, `running`, `error`). */
|
|
32
|
+
recordStatus: string;
|
|
33
|
+
/** Whether the caller's observation/collection budget expired. */
|
|
34
|
+
waitBudgetExpired: boolean;
|
|
35
|
+
/** Whether the lane's age exceeds the EFFECTIVE horizon. */
|
|
36
|
+
exceededEffectiveHorizon: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Classify one lane's liveness with the frozen precedence
|
|
40
|
+
* `completed_failure > observer_deadline > provider_retry_in_flight >
|
|
41
|
+
* execution_deadline > idle_failed_child`:
|
|
42
|
+
* a terminal error is a real outcome and wins over every in-flight signal;
|
|
43
|
+
* an expired observation budget on a live-or-unknown session is observer
|
|
44
|
+
* noise, not child failure; a `retry` session is provider latency even past
|
|
45
|
+
* the horizon; only then may the execution deadline fire; everything else
|
|
46
|
+
* is an open, low-signal lane below the horizon.
|
|
47
|
+
*/
|
|
48
|
+
export declare function classifyLaneLivenessCondition(input: ClassifyLaneLivenessInput): LaneLivenessCondition;
|
|
49
|
+
export interface EffectivePrLaneHorizon {
|
|
50
|
+
/** The ONE effective PR-lane settlement horizon, in ms. */
|
|
51
|
+
horizonMs: number;
|
|
52
|
+
/** Which configured value won. */
|
|
53
|
+
source: 'watchdog-timeout' | 'reachability-floor';
|
|
54
|
+
/**
|
|
55
|
+
* True when `backgroundPendingTimeoutMs` was provided, is > 0, and
|
|
56
|
+
* disagrees with the effective horizon. The disagreement is disclosed,
|
|
57
|
+
* never resolved into a second horizon.
|
|
58
|
+
*/
|
|
59
|
+
conflictDisclosed: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the single effective PR-lane settlement horizon (#2506 AC2).
|
|
63
|
+
*
|
|
64
|
+
* Precedence: an ENABLED watchdog with `timeout_ms > 0` owns the horizon;
|
|
65
|
+
* everything else (no config, `enabled: false`, or `timeout_ms: 0` — "0
|
|
66
|
+
* disables the feature") falls back to the 30-minute reachability floor
|
|
67
|
+
* (`DEFAULT_STALE_DELEGATION_TIMEOUT_MS`), which must never disappear: it is
|
|
68
|
+
* the guarantee that abort and completion cannot be permanently blocked by a
|
|
69
|
+
* lane whose backing process died.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveEffectivePrLaneHorizonMs(watchdog?: LaneLivenessWatchdogConfig, backgroundPendingTimeoutMs?: number): EffectivePrLaneHorizon;
|
|
72
|
+
/** Per-lane activity within the last `stall_threshold_ms` window. */
|
|
73
|
+
export interface LaneActivity {
|
|
74
|
+
/** Observable transcript steps in the window. */
|
|
75
|
+
stepsObserved: number;
|
|
76
|
+
/**
|
|
77
|
+
* Token ESTIMATE derived from transcript text length — the host API does
|
|
78
|
+
* not expose provider-true token counts; every surface that reports this
|
|
79
|
+
* value must label it an estimate.
|
|
80
|
+
*/
|
|
81
|
+
estimatedTokens: number;
|
|
82
|
+
/** Epoch-ms timestamp of the last observed activity, when known. */
|
|
83
|
+
lastActivityAtMs?: number;
|
|
84
|
+
}
|
|
85
|
+
export declare const ZERO_LANE_ACTIVITY: LaneActivity;
|
|
86
|
+
/** The overridable activity reader the gate seam exposes for tests. */
|
|
87
|
+
export type ReadLaneActivity = (directory: string, subagentSessionId: string) => LaneActivity | null | Promise<LaneActivity | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Default transcript-derived activity reader. The host API exposes no
|
|
90
|
+
* per-session token counts and no bounded transcript read on this path (a
|
|
91
|
+
* per-lane `session.messages` call would violate the frozen one-status-call
|
|
92
|
+
* budget), so a lane with no stored activity information reads as ZERO
|
|
93
|
+
* activity — the conservative direction for stall escalation (escalate,
|
|
94
|
+
* then let the operator inspect). This is the #2506 frozen contract: "an
|
|
95
|
+
* absent transcript reads as zero activity".
|
|
96
|
+
*/
|
|
97
|
+
export declare const defaultReadLaneActivity: ReadLaneActivity;
|
|
98
|
+
/** Feature activation derived from the config (each knob disables at 0). */
|
|
99
|
+
export declare function laneLivenessWatchdogFeatures(watchdog?: LaneLivenessWatchdogConfig): {
|
|
100
|
+
deadlineActive: boolean;
|
|
101
|
+
stallActive: boolean;
|
|
102
|
+
};
|
|
@@ -6,6 +6,7 @@ import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type
|
|
|
6
6
|
import { PR_REVIEW_BASE_DIMENSION_IDS, type PrReviewLaneResultEnvelope, type PrReviewRiskImpact, type PrReviewRiskTag } from '../background/pr-review-contract.js';
|
|
7
7
|
import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-contract.js';
|
|
8
8
|
import { type RevisionDigestResult, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveCurrentLocalHeadRefAsync, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailed, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolveRemoteUrlIdentity, resolveRemoteUrlIdentityAsync } from '../background/workspace-snapshot.js';
|
|
9
|
+
import type { LaneLivenessWatchdogConfig } from '../config/schema.js';
|
|
9
10
|
import { type PrReviewResilienceConfig } from '../config/schema.js';
|
|
10
11
|
import { classifyPrWorkflowGitState, type PrWorkflowGitState } from '../git/pr-workflow-state.js';
|
|
11
12
|
import { type PrReviewReentryAuthorizationRecord, type PrReviewReentryBindingContext, type PrReviewReentryRole } from '../pr-review/authorization.js';
|
|
@@ -13,6 +14,7 @@ import { classifyPrReviewCircuitSignal, type PrReviewCircuitLegacyRecord, type P
|
|
|
13
14
|
import { type PrReviewDimensionCancellationRecord, type PrReviewPartialBaseCoverageRecord, type PrReviewReportVerdict, type PrReviewTerminalCoverageSettlement } from '../pr-review/completion.js';
|
|
14
15
|
import { type PrReviewComposablePhase, type PrReviewPhaseComposition, parseCriticVerdict } from '../pr-review/legacy-transcript-adapter.js';
|
|
15
16
|
import { withPrWorkflowCheckoutMutationLock, workflowCheckoutMutationLockRelativePath, workflowGateStateLockRelativePath, workflowGateStateRelativePath } from '../pr-review/persistence.js';
|
|
17
|
+
import { classifyLaneLivenessCondition, type EffectivePrLaneHorizon, resolveEffectivePrLaneHorizonMs } from './lane-liveness-watchdog.js';
|
|
16
18
|
export type { PrReviewDimensionCancellationRecord, PrReviewDimensionTerminalState, PrReviewPartialBaseCoverageRecord, PrReviewPartialBaseCoverageRecordV1, PrReviewPartialBaseCoverageRecordV2, PrReviewReportVerdict, PrReviewTerminalCoverageKind, PrReviewTerminalCoverageSettlement, PrReviewUnresolvedDimensionRecord, } from '../pr-review/completion.js';
|
|
17
19
|
export { allowedPrReviewReportVerdicts, normalizePrReviewPartialBaseCoverageRecord, PR_REVIEW_REPORT_VERDICTS, readPrReviewTerminalCoverageForReport, rollbackPrReviewPartialBaseCoverageAdmission, } from '../pr-review/completion.js';
|
|
18
20
|
export { ensurePrWorkflowSafeParentDirectory, PrWorkflowCheckoutMutationTimeoutError, prWorkflowSessionFileStem, withPrWorkflowCheckoutMutationLock, writePrWorkflowAtomicJson, } from '../pr-review/persistence.js';
|
|
@@ -650,9 +652,29 @@ interface PrWorkflowLaneLivenessSessionOps {
|
|
|
650
652
|
}> | null;
|
|
651
653
|
error?: unknown;
|
|
652
654
|
}>;
|
|
655
|
+
/**
|
|
656
|
+
* Issue #2506: the watchdog's best-effort, one-attempt lane abort. The
|
|
657
|
+
* host session object exposes it; the seam type keeps it optional so the
|
|
658
|
+
* probe-only hosts of the #2251 era remain valid.
|
|
659
|
+
*/
|
|
660
|
+
abort?: (args: unknown) => Promise<unknown>;
|
|
653
661
|
}
|
|
654
662
|
/** Why a probe produced no evidence of life. Absent means the probe ran. */
|
|
655
663
|
export type PrWorkflowLaneProbeDegradedReason = 'probe-unavailable' | 'probe-error' | 'probe-timeout' | 'probe-no-data';
|
|
664
|
+
/**
|
|
665
|
+
* Core session-status probe shared by the fail-open liveness probe below and
|
|
666
|
+
* the pending-lane liveness advisory (issue #2280 Part B). Same host call,
|
|
667
|
+
* deadline, and failure taxonomy as the probe; instead of collapsing each
|
|
668
|
+
* session to allowlist membership it records the status TYPE the host reported
|
|
669
|
+
* for every record that has one, so a caller can distinguish "live" from
|
|
670
|
+
* "affirmatively non-live" from "session absent". Failure modes return the
|
|
671
|
+
* empty map plus a `degradedReason` — a probe that did not fully read its
|
|
672
|
+
* response never yields a partial map.
|
|
673
|
+
*/
|
|
674
|
+
declare function probePrWorkflowLaneSessionStatusTypes(directory: string, records: readonly BackgroundDelegationRecord[], timeoutMs?: number): Promise<{
|
|
675
|
+
statuses: Map<string, string>;
|
|
676
|
+
degradedReason?: PrWorkflowLaneProbeDegradedReason;
|
|
677
|
+
}>;
|
|
656
678
|
/**
|
|
657
679
|
* Probe which of `records` have a session the host affirmatively reports as
|
|
658
680
|
* still running (issue #2251).
|
|
@@ -757,6 +779,14 @@ export interface PrWorkflowStaleLaneSettlement {
|
|
|
757
779
|
freshOpenLanes: number;
|
|
758
780
|
/** Lanes stale past the horizon, treated as settled with disclosure. */
|
|
759
781
|
presumedStaleLaneIds: string[];
|
|
782
|
+
/**
|
|
783
|
+
* Present ONLY when the configured `hooks.background_pending_timeout_minutes`
|
|
784
|
+
* disagrees with the ONE effective horizon this settlement used (issue
|
|
785
|
+
* #2506 AC2). Fixed template, no second horizon is created — the field
|
|
786
|
+
* exists so the disagreement is observable on tool responses instead of
|
|
787
|
+
* being silently absorbed.
|
|
788
|
+
*/
|
|
789
|
+
horizonConflictNote?: string;
|
|
760
790
|
/**
|
|
761
791
|
* Lanes past the horizon that the probe spared. Present only when non-empty.
|
|
762
792
|
*/
|
|
@@ -809,7 +839,33 @@ export interface PrWorkflowStaleLaneSettlement {
|
|
|
809
839
|
* {@link probePrWorkflowLaneSessionStatusTypes} — so an unavailable, erroring
|
|
810
840
|
* or empty probe leaves the age-only behaviour exactly as it was.
|
|
811
841
|
*/
|
|
812
|
-
|
|
842
|
+
/**
|
|
843
|
+
* Issue #2506 (G2): optional lane-liveness watchdog options for the on-demand
|
|
844
|
+
* settlement entry points. The two-argument call shape every existing caller
|
|
845
|
+
* uses means "watchdog disabled" (the default-off config contract).
|
|
846
|
+
*/
|
|
847
|
+
export interface PrWorkflowLaneLivenessOptions {
|
|
848
|
+
laneLivenessWatchdog?: LaneLivenessWatchdogConfig;
|
|
849
|
+
backgroundPendingTimeoutMs?: number;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* The #2506 stall-escalation evaluation for the lanes a settlement still
|
|
853
|
+
* considers open or probe-retained: escalate each lane whose session is
|
|
854
|
+
* busy/retry and whose observed activity in the last `stall_threshold_ms`
|
|
855
|
+
* missed BOTH the step and the estimated-token thresholds, deduped per lane
|
|
856
|
+
* against the last escalation event unless activity was observed since.
|
|
857
|
+
* Advisory by design: an escalated lane is never settled or aborted here —
|
|
858
|
+
* the operator response (inspect, or the human-only force abort) owns that.
|
|
859
|
+
*/
|
|
860
|
+
declare function evaluateLaneLivenessWatchdogEscalation(args: {
|
|
861
|
+
directory: string;
|
|
862
|
+
sessionID: string;
|
|
863
|
+
lanes: BackgroundDelegationRecord[];
|
|
864
|
+
sessionTypes: Map<string, string>;
|
|
865
|
+
watchdog: LaneLivenessWatchdogConfig;
|
|
866
|
+
horizon: EffectivePrLaneHorizon;
|
|
867
|
+
}): Promise<void>;
|
|
868
|
+
export declare function settlePresumedStalePrWorkflowLanes(directory: string, sessionID: string, options?: PrWorkflowLaneLivenessOptions): Promise<PrWorkflowStaleLaneSettlement>;
|
|
813
869
|
/**
|
|
814
870
|
* Abort an active PR workflow gate without reaching terminal completion.
|
|
815
871
|
*
|
|
@@ -853,6 +909,8 @@ export declare function abortPrWorkflow(directory: string, sessionID: string, op
|
|
|
853
909
|
* `recovery`/`force` aborts remain refused while armed.
|
|
854
910
|
*/
|
|
855
911
|
cancelPublication?: boolean;
|
|
912
|
+
/** Issue #2506: lane-liveness watchdog config for this settlement. */
|
|
913
|
+
laneLiveness?: PrWorkflowLaneLivenessOptions;
|
|
856
914
|
}): Promise<{
|
|
857
915
|
mode: PrWorkflowMode;
|
|
858
916
|
prHeadSha?: string;
|
|
@@ -914,6 +972,8 @@ export declare function recoverArmedPrWorkflow(directory: string, sessionID: str
|
|
|
914
972
|
generation: number;
|
|
915
973
|
workflowInstanceId?: string;
|
|
916
974
|
reason: string;
|
|
975
|
+
/** Issue #2506: lane-liveness watchdog config for this settlement. */
|
|
976
|
+
laneLiveness?: PrWorkflowLaneLivenessOptions;
|
|
917
977
|
}): Promise<{
|
|
918
978
|
mode: PrWorkflowMode;
|
|
919
979
|
prHeadSha: string;
|
|
@@ -1250,6 +1310,8 @@ export declare function transitionPrReviewToFeedback(directory: string, sessionI
|
|
|
1250
1310
|
prUrl?: string;
|
|
1251
1311
|
exactCommand?: string;
|
|
1252
1312
|
confirmedByUser?: boolean;
|
|
1313
|
+
/** Issue #2506 review round 2: watchdog policy for the readiness settle. */
|
|
1314
|
+
laneLiveness?: PrWorkflowLaneLivenessOptions;
|
|
1253
1315
|
}): Promise<PrWorkflowGateState>;
|
|
1254
1316
|
export declare function declarePrFeedbackScope(directory: string, sessionID: string, taskId: string, files: string[]): Promise<PrWorkflowGateState>;
|
|
1255
1317
|
export declare function resolvePrFeedbackScopeDeclaration(directory: string, sessionID: string, taskId: string): Promise<PrFeedbackScopeDeclarationRecord | null>;
|
|
@@ -1291,6 +1353,8 @@ export declare function reserveActivePrReviewReentryAuthorization(directory: str
|
|
|
1291
1353
|
}): Promise<PrReviewReentryAuthorizationRecord | null>;
|
|
1292
1354
|
export declare function completePrWorkflow(directory: string, sessionID: string, expectedMode: PrWorkflowMode, prHeadSha: string, options?: {
|
|
1293
1355
|
reportVerdict?: PrReviewReportVerdict;
|
|
1356
|
+
/** Issue #2506: lane-liveness watchdog config for this settlement. */
|
|
1357
|
+
laneLiveness?: PrWorkflowLaneLivenessOptions;
|
|
1294
1358
|
}): Promise<PrWorkflowCompletionStatus>;
|
|
1295
1359
|
export declare const _test_exports: {
|
|
1296
1360
|
classifyPrReviewCircuitSignal: typeof classifyPrReviewCircuitSignal;
|
|
@@ -1339,6 +1403,28 @@ export declare const _test_exports: {
|
|
|
1339
1403
|
sweepStaleDelegationsAsync: typeof sweepStaleDelegations;
|
|
1340
1404
|
/** The fail-open liveness probe (issue #2251). */
|
|
1341
1405
|
probeLaneLivenessAsync: typeof probeAlivePrWorkflowLaneSessions;
|
|
1406
|
+
/**
|
|
1407
|
+
* The types-carrying variant of the liveness probe (issue #2506): one
|
|
1408
|
+
* shared status call returning per-session status TYPES, so the watchdog
|
|
1409
|
+
* can distinguish `retry` (provider latency) from `busy` (past-deadline
|
|
1410
|
+
* execution) without a second host round-trip. Seam for the same
|
|
1411
|
+
* order-independence reason as `probeLaneLivenessAsync`.
|
|
1412
|
+
*/
|
|
1413
|
+
probeLaneSessionStatusTypesAsync: typeof probePrWorkflowLaneSessionStatusTypes;
|
|
1414
|
+
/**
|
|
1415
|
+
* The #2506 lane-liveness watchdog surface: the pure policy functions,
|
|
1416
|
+
* the overridable transcript-activity reader, and the live budget
|
|
1417
|
+
* counters (zeroed by `resetTrackedStateCache`).
|
|
1418
|
+
*/
|
|
1419
|
+
laneLivenessWatchdog: {
|
|
1420
|
+
resolveEffectivePrLaneHorizonMs: typeof resolveEffectivePrLaneHorizonMs;
|
|
1421
|
+
classifyLaneLivenessCondition: typeof classifyLaneLivenessCondition;
|
|
1422
|
+
evaluateLaneLivenessWatchdog: typeof evaluateLaneLivenessWatchdogEscalation;
|
|
1423
|
+
readLaneActivity: import("./lane-liveness-watchdog.js").ReadLaneActivity;
|
|
1424
|
+
hostStatusCalls: number;
|
|
1425
|
+
hostAbortCalls: number;
|
|
1426
|
+
evaluations: number;
|
|
1427
|
+
};
|
|
1342
1428
|
/**
|
|
1343
1429
|
* Session handle for the liveness probe.
|
|
1344
1430
|
*
|