opencode-swarm 7.166.3 → 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.
Files changed (64) hide show
  1. package/.opencode/skills/council/SKILL.md +4 -1
  2. package/.opencode/skills/deep-dive/SKILL.md +1 -1
  3. package/.opencode/skills/deep-research/SKILL.md +4 -1
  4. package/.opencode/skills/gate-attribution/SKILL.md +3 -0
  5. package/.opencode/skills/pre-phase-briefing/SKILL.md +8 -0
  6. package/.opencode/skills/swarm-pr-review/SKILL.md +30 -30
  7. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  8. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  9. package/dist/cli/{coder-settlement-nx8ff9k1.js → coder-settlement-j5e1pz2k.js} +3 -3
  10. package/dist/cli/{config-doctor-n9cjh11e.js → config-doctor-35pd2khv.js} +2 -2
  11. package/dist/cli/{core-cbwrwhcz.js → core-92m54spz.js} +1 -1
  12. package/dist/cli/{curator-llm-factory-2gv6kt1v.js → curator-llm-factory-vj5aqyd1.js} +19 -19
  13. package/dist/cli/{curator-c7amtass.js → curator-pd098ytk.js} +19 -19
  14. package/dist/cli/{evidence-summary-service-5th3zm9c.js → evidence-summary-service-kwcme5fz.js} +6 -6
  15. package/dist/cli/{gate-evidence-py8v0w28.js → gate-evidence-msn4kya1.js} +2 -2
  16. package/dist/cli/{guardrail-explain-qzhjhtyk.js → guardrail-explain-2h9m8s4j.js} +20 -20
  17. package/dist/cli/{guardrail-log-rtdpk545.js → guardrail-log-p6trrsvy.js} +3 -3
  18. package/dist/cli/{guardrail-reset-s27fehv6.js → guardrail-reset-v6ds2t78.js} +19 -19
  19. package/dist/cli/{hive-promoter-56mfysq6.js → hive-promoter-j2pjzrdh.js} +19 -19
  20. package/dist/cli/{index-bwvbj3fp.js → index-7yax969v.js} +1 -1
  21. package/dist/cli/{index-4c50tm9j.js → index-9qceke8g.js} +1 -1
  22. package/dist/cli/{index-qa7t42e7.js → index-chdyjg3s.js} +3 -3
  23. package/dist/cli/{index-3a2xznmd.js → index-d2phtxg2.js} +2 -2
  24. package/dist/cli/{index-d5gvr6z4.js → index-d9vbyb5a.js} +1 -1
  25. package/dist/cli/{index-ms16gaa4.js → index-dczrrnzp.js} +2 -2
  26. package/dist/cli/{index-tzq6t9wc.js → index-gbbahxhw.js} +3 -3
  27. package/dist/cli/{index-b7ra4hwj.js → index-gw2d37dz.js} +1 -1
  28. package/dist/cli/{index-ch293kd3.js → index-hdkt3n2k.js} +3 -3
  29. package/dist/cli/{index-gk1w1h9k.js → index-jhna6xnb.js} +5 -1
  30. package/dist/cli/{index-0jpv5z94.js → index-kg74hnbc.js} +1 -1
  31. package/dist/cli/{index-4mgggb8x.js → index-mqbgkv5h.js} +11 -3
  32. package/dist/cli/{index-t9kjxzdr.js → index-n5bqrkgw.js} +3 -3
  33. package/dist/cli/{index-xn16akay.js → index-qmqn59mw.js} +1 -1
  34. package/dist/cli/{index-8cky7ksv.js → index-r09mpxtp.js} +4 -4
  35. package/dist/cli/{index-87wqes24.js → index-t6hdjtfy.js} +1 -1
  36. package/dist/cli/{index-gbv76wf7.js → index-tnb4jf94.js} +2 -2
  37. package/dist/cli/{index-3f1tr4ha.js → index-va2m1y35.js} +1 -1
  38. package/dist/cli/{index-hfrb77tj.js → index-wkj8m6wh.js} +3 -3
  39. package/dist/cli/{index-dvhecfa9.js → index-wyca2c0w.js} +416 -72
  40. package/dist/cli/{index-h92cqbqa.js → index-ywa4jvg9.js} +5 -5
  41. package/dist/cli/{index-2c7eabkr.js → index-zq0btxga.js} +1 -1
  42. package/dist/cli/{index-w50dk71y.js → index-zs0nyasy.js} +21 -21
  43. package/dist/cli/index.js +19 -19
  44. package/dist/cli/{knowledge-escalator-stnveccq.js → knowledge-escalator-skbk8tq8.js} +6 -6
  45. package/dist/cli/{knowledge-events-ph6txm8h.js → knowledge-events-czaxq8hg.js} +4 -4
  46. package/dist/cli/{knowledge-store-tgyhr9nf.js → knowledge-store-wztr2gwz.js} +1 -1
  47. package/dist/cli/{knowledge-validator-2g547bcn.js → knowledge-validator-0eq5evs6.js} +2 -2
  48. package/dist/cli/{pending-delegations-873dtyw6.js → pending-delegations-2bran18p.js} +2 -2
  49. package/dist/cli/{pr-subscriptions-xmxdrj1z.js → pr-subscriptions-rdp58505.js} +1 -1
  50. package/dist/cli/{pr-workflow-gate-h7644byf.js → pr-workflow-gate-dgk3zzgs.js} +19 -19
  51. package/dist/cli/{scan-cursor-tx72gxp0.js → scan-cursor-ag6y6c14.js} +2 -2
  52. package/dist/cli/{schema-cpc92vq0.js → schema-qmh504jp.js} +3 -1
  53. package/dist/cli/{scope-persistence-xy3xs55f.js → scope-persistence-c1ctykah.js} +5 -5
  54. package/dist/cli/{skill-generator-4f1v5zwx.js → skill-generator-yqgwds3s.js} +7 -7
  55. package/dist/cli/{snapshot-coordination-init-w2nw33pn.js → snapshot-coordination-init-62pxgka1.js} +19 -19
  56. package/dist/cli/{worktree-collision-ownership-1g1qz8wc.js → worktree-collision-ownership-81773mwf.js} +2 -2
  57. package/dist/cli/{worktree-isolation-jwxtrh3z.js → worktree-isolation-j2ewvha7.js} +19 -19
  58. package/dist/config/schema.d.ts +24 -0
  59. package/dist/hooks/lane-liveness-watchdog.d.ts +102 -0
  60. package/dist/hooks/pr-workflow-gate.d.ts +87 -1
  61. package/dist/index.js +12 -11
  62. package/dist/tools/dispatch-lanes.d.ts +9 -0
  63. package/opencode-swarm.schema.json +35 -0
  64. package/package.json +1 -1
@@ -21,44 +21,44 @@ import {
21
21
  sanitizeWorktreeTaskId,
22
22
  standardWorktreeByCallID,
23
23
  standardWorktreeSerializationSessions
24
- } from "./index-dvhecfa9.js";
24
+ } from "./index-wyca2c0w.js";
25
25
  import"./index-d5qf7hvh.js";
26
26
  import"./index-m3tx1q9v.js";
27
- import"./index-4c50tm9j.js";
28
- import"./index-gk1w1h9k.js";
29
- import"./index-t9kjxzdr.js";
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-qa7t42e7.js";
34
- import"./index-h92cqbqa.js";
35
- import"./index-87wqes24.js";
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-hfrb77tj.js";
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-xn16akay.js";
47
- import"./index-b7ra4hwj.js";
48
- import"./index-2c7eabkr.js";
49
- import"./index-tzq6t9wc.js";
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-bwvbj3fp.js";
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-3a2xznmd.js";
57
+ } from "./index-d2phtxg2.js";
58
58
  import"./index-3qf1vxtb.js";
59
59
  import"./index-n832052r.js";
60
- import"./index-ms16gaa4.js";
61
- import"./index-3f1tr4ha.js";
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-8cky7ksv.js";
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-0jpv5z94.js";
79
+ import"./index-kg74hnbc.js";
80
80
  import"./index-9e6fdz2h.js";
81
81
  import"./index-4rhhvd1a.js";
82
- import"./index-4mgggb8x.js";
82
+ import"./index-mqbgkv5h.js";
83
83
  import"./index-0tc0pcmh.js";
84
84
  import"./index-bk5tah7q.js";
85
85
  import"./index-bpmtbmy9.js";
@@ -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
- export declare function settlePresumedStalePrWorkflowLanes(directory: string, sessionID: string): Promise<PrWorkflowStaleLaneSettlement>;
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
  *