opencode-swarm 7.174.0 → 7.176.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 (88) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/pending-delegations.d.ts +10 -0
  4. package/dist/background/pr-review-contract.d.ts +3 -0
  5. package/dist/background/status-artifact.d.ts +24 -1
  6. package/dist/cli/{coder-settlement-pwct8te4.js → coder-settlement-y3ftsdje.js} +10 -10
  7. package/dist/cli/{config-doctor-tnta65bf.js → config-doctor-3x9d5y3w.js} +2 -2
  8. package/dist/cli/{core-421gbna2.js → core-hf9pjm7y.js} +3 -3
  9. package/dist/cli/{curation-policy-dw25zm05.js → curation-policy-8h25hyf8.js} +4 -4
  10. package/dist/cli/{curator-drift-x3tt8apf.js → curator-drift-qxgs5ee4.js} +2 -2
  11. package/dist/cli/{curator-llm-factory-4e73613g.js → curator-llm-factory-rs8zyytn.js} +33 -33
  12. package/dist/cli/{curator-yrhc4epa.js → curator-pf4n52b1.js} +33 -33
  13. package/dist/cli/{evidence-summary-service-f4vem356.js → evidence-summary-service-t4nnvgyz.js} +14 -14
  14. package/dist/cli/{gate-evidence-t2dyfvc4.js → gate-evidence-d6wmarwz.js} +6 -6
  15. package/dist/cli/{guardrail-explain-hf5gawe2.js → guardrail-explain-x8n8dtq6.js} +34 -34
  16. package/dist/cli/{guardrail-log-9dkyvdbw.js → guardrail-log-ehwt0w51.js} +6 -6
  17. package/dist/cli/{guardrail-reset-26bxnh2e.js → guardrail-reset-ceqcapzm.js} +33 -33
  18. package/dist/cli/{hive-promoter-6s6xbq5x.js → hive-promoter-9dgmk5nq.js} +33 -33
  19. package/dist/cli/{index-nwew2anc.js → index-2xm1xtqy.js} +1 -1
  20. package/dist/cli/{index-a1w58b47.js → index-4ddpvd5c.js} +32 -0
  21. package/dist/cli/{index-jd2f7thw.js → index-509g4m8s.js} +508 -260
  22. package/dist/cli/{index-0hgmsyfp.js → index-549wxbe1.js} +1 -1
  23. package/dist/cli/{index-saw0ambb.js → index-569pn3vz.js} +16 -10
  24. package/dist/cli/{index-bf6w27sb.js → index-580v9v50.js} +3 -3
  25. package/dist/cli/{index-5prgmf00.js → index-68nc7zev.js} +3 -3
  26. package/dist/cli/{index-c60t3sw6.js → index-9fnjkqsr.js} +1 -1
  27. package/dist/cli/{index-vsvdh976.js → index-bym86sb4.js} +1 -1
  28. package/dist/cli/{index-0c7y177k.js → index-c45zvjeg.js} +2 -2
  29. package/dist/cli/{index-ddz0a0ew.js → index-cfjbrcv7.js} +3 -3
  30. package/dist/cli/{index-e4g3487s.js → index-crx99j5b.js} +3 -3
  31. package/dist/cli/{index-dfd6d64k.js → index-dn5kkjfv.js} +35 -35
  32. package/dist/cli/{index-nxnmy2da.js → index-dq0fbb2g.js} +4 -4
  33. package/dist/cli/{index-mmnk7nt1.js → index-eawhasqk.js} +1 -1
  34. package/dist/cli/{index-snd34n1y.js → index-fh8jh5n1.js} +5 -5
  35. package/dist/cli/{index-dfey3jpn.js → index-g9pqwf7v.js} +3 -3
  36. package/dist/cli/{index-6v1cz898.js → index-gtjx3q5h.js} +1 -1
  37. package/dist/cli/{index-m8c44754.js → index-hvt8902r.js} +5 -5
  38. package/dist/cli/{index-z2deqhpp.js → index-n1tcj1q7.js} +1 -1
  39. package/dist/cli/{index-2qawngxn.js → index-n1wean2y.js} +16 -9
  40. package/dist/cli/{index-8d3qzvbb.js → index-n5aa7f72.js} +2 -2
  41. package/dist/cli/{index-s6wb6sjk.js → index-pd3yg1mh.js} +4 -4
  42. package/dist/cli/{index-rgvg7d6k.js → index-r3ftkdvn.js} +1 -1
  43. package/dist/cli/{index-vwjfm0s6.js → index-rekx0gq7.js} +3 -3
  44. package/dist/cli/{index-23fwhwrb.js → index-rm1k8ekt.js} +33 -33
  45. package/dist/cli/{index-qc4nvg0m.js → index-s0w34gp3.js} +4 -4
  46. package/dist/cli/{index-kyakvkpk.js → index-s1cm0jre.js} +3 -1
  47. package/dist/cli/{index-mjtja1wq.js → index-t4kwsbhj.js} +1 -1
  48. package/dist/cli/{index-hkx8tqa4.js → index-t5t6cqfb.js} +4 -4
  49. package/dist/cli/{index-cw1nbtvh.js → index-twymcfj9.js} +1 -1
  50. package/dist/cli/{index-py58gern.js → index-wdcsy80q.js} +6 -6
  51. package/dist/cli/{index-9gpf4tt4.js → index-wer28675.js} +7 -7
  52. package/dist/cli/{index-rjjtn1w5.js → index-wn00ra10.js} +2 -2
  53. package/dist/cli/{index-fagcasf8.js → index-wpae4r9j.js} +5 -5
  54. package/dist/cli/{index-3yw5h3bt.js → index-z9nzrjf7.js} +1 -1
  55. package/dist/cli/{index-v8ykb3hq.js → index-zpa6ywts.js} +9 -9
  56. package/dist/cli/{index-0mhftbpp.js → index-zz7gzw57.js} +1 -1
  57. package/dist/cli/index.js +34 -34
  58. package/dist/cli/{knowledge-escalator-bra0fkfm.js → knowledge-escalator-0eyjbhap.js} +12 -12
  59. package/dist/cli/{knowledge-events-v4hq7wr9.js → knowledge-events-64k22qmf.js} +10 -10
  60. package/dist/cli/{knowledge-link-dw12x2ns.js → knowledge-link-yx57s7zb.js} +3 -3
  61. package/dist/cli/{knowledge-store-3hx2896s.js → knowledge-store-q3k2zf8a.js} +4 -4
  62. package/dist/cli/{knowledge-validator-9wj31ym5.js → knowledge-validator-ywbk1gpw.js} +6 -6
  63. package/dist/cli/{mcp-d7yptqpg.js → mcp-yas626k0.js} +1 -1
  64. package/dist/cli/{pending-delegations-8ghc75b2.js → pending-delegations-91a6nb8z.js} +6 -6
  65. package/dist/cli/{pr-subscriptions-yceed093.js → pr-subscriptions-dyn9hn9g.js} +6 -6
  66. package/dist/cli/{pr-workflow-gate-sc4c4cmk.js → pr-workflow-gate-xwz3f6zm.js} +33 -33
  67. package/dist/cli/{runner-k1pmc3z8.js → runner-j4hrfyve.js} +4 -4
  68. package/dist/cli/{scan-cursor-mtja4626.js → scan-cursor-etrpan51.js} +7 -7
  69. package/dist/cli/{schema-x2nb18fg.js → schema-aarfgdn3.js} +1 -1
  70. package/dist/cli/{scope-persistence-tafxf6yz.js → scope-persistence-j0vzwybd.js} +12 -12
  71. package/dist/cli/{server-hk378mzc.js → server-rhpwneb6.js} +33 -33
  72. package/dist/cli/{skill-generator-vz5vtgk6.js → skill-generator-m6yrxy2s.js} +14 -14
  73. package/dist/cli/{snapshot-coordination-init-8x5n1q8c.js → snapshot-coordination-init-1yn3fyt4.js} +33 -33
  74. package/dist/cli/{telemetry-m580862y.js → telemetry-1cfatyt0.js} +1 -1
  75. package/dist/cli/{workspace-snapshot-6aw002e8.js → workspace-snapshot-07rzjg7s.js} +3 -3
  76. package/dist/cli/{worktree-collision-ownership-cfx1tsaf.js → worktree-collision-ownership-g6bjm090.js} +9 -9
  77. package/dist/cli/{worktree-isolation-t3fm1c5w.js → worktree-isolation-6kebmn1t.js} +33 -33
  78. package/dist/commands/registry.d.ts +1 -1
  79. package/dist/hooks/pr-workflow-gate.d.ts +6 -0
  80. package/dist/index.js +511 -510
  81. package/dist/observability/startup-contract.d.ts +134 -0
  82. package/dist/pr-review/types.d.ts +8 -0
  83. package/dist/tools/dispatch-lanes.d.ts +29 -0
  84. package/dist/workflow/coder-settlement.d.ts +7 -0
  85. package/dist/workflow/recovery-invocation.d.ts +35 -0
  86. package/dist/workflow/stage-a-repair.d.ts +17 -0
  87. package/dist/workflow/task-recovery-status.d.ts +61 -0
  88. package/package.json +3 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * The startup and first-use latency contract (issue #2670).
3
+ *
4
+ * Stage model — every interval the issue names, measured and emitted
5
+ * SEPARATELY as single-line `STARTUP-CONTRACT <json>` rows on stdout:
6
+ *
7
+ * import performance.now() at the end of src/index.ts module
8
+ * evaluation (ms since performance.timeOrigin, i.e.
9
+ * process start). The fresh-process harness child's own
10
+ * external import timer additionally includes its
11
+ * node:perf_hooks import and preload; the two values are
12
+ * intentionally not expected to be identical.
13
+ * server server() entry -> resolution (the plugin wrapper in
14
+ * src/index.ts).
15
+ * first_turn time from server resolution until the FIRST
16
+ * experimental.chat.messages.transform invocation
17
+ * settles (success or rejection), once per process.
18
+ * first_tool time from server resolution until the FIRST tool
19
+ * execute settles (success or rejection), once per
20
+ * process, labeled with the tool name.
21
+ * readiness queue_settled: the wrapper-owned post-resolution queue
22
+ * has fully drained (every scheduled task settled),
23
+ * measured from drain scheduling. Optional work NEVER
24
+ * gates manifest delivery (AGENTS.md invariant 1).
25
+ * optional_task per-task outcome rows: task name, `completed|failed`,
26
+ * duration from drain start; failed rows carry a bounded
27
+ * error string (<=200 chars, no stack, single line).
28
+ *
29
+ * Emission is gated behind OPENCODE_SWARM_DEBUG=1 exactly like
30
+ * src/utils/logger.ts — ZERO contract rows appear with the env var unset
31
+ * (no chat-visible noise, invariant 10; asserted by the frozen acceptance
32
+ * checks' debug-off probe and the unit suite).
33
+ *
34
+ * All collectors are in-memory only: no filesystem writes, no awaits added
35
+ * to any init path, no new module-load side effects beyond one
36
+ * performance.now() capture (invariant 1). Per-boot state resets on every
37
+ * server() entry so repeated boots in one process (tests) stay coherent;
38
+ * the import mark is captured once per process.
39
+ *
40
+ * The advisory counter is a STARTUP-window counter: the window opens at
41
+ * server entry and closes at queue settle (or at server resolution when no
42
+ * queue is scheduled) and never re-opens — late-session advisories never
43
+ * contribute to `queue_settled.advisories`.
44
+ */
45
+ type PostResolutionTaskLike = () => void | Promise<void>;
46
+ interface StartupContractState {
47
+ importMarkMs: number | null;
48
+ serverStartMark: number | null;
49
+ serverResolvedMark: number | null;
50
+ serverMs: number | null;
51
+ queueScheduledAt: number | null;
52
+ queuePending: number;
53
+ queueTasks: number;
54
+ queueCompleted: number;
55
+ queueFailed: number;
56
+ queueSettled: boolean;
57
+ queueSettledMs: number | null;
58
+ advisoryCount: number;
59
+ advisoryWindowOpen: boolean;
60
+ firstTurnDone: boolean;
61
+ firstToolDone: boolean;
62
+ firstToolName: string | null;
63
+ firstTurnMs: number | null;
64
+ firstToolMs: number | null;
65
+ }
66
+ /** Capture the import-stage mark. Called once at src/index.ts module scope. */
67
+ export declare function markStartupImportComplete(): void;
68
+ /**
69
+ * Begin the server-interval and open the startup advisory window. Resets
70
+ * per-boot state (the import mark persists). Called at server() entry.
71
+ */
72
+ export declare function beginStartupServerInterval(): void;
73
+ /** Resolve the server interval and emit the init row. Called just before the wrapper returns its hooks. */
74
+ export declare function endStartupServerInterval(): void;
75
+ /**
76
+ * Record that optional tasks were scheduled onto the post-resolution queue:
77
+ * captures the settle-interval origin. Task and pending counts are owned by
78
+ * the wrapper (one increment per wrapped task, one decrement per settle), so
79
+ * late-appended tasks are accounted correctly.
80
+ */
81
+ export declare function noteQueueScheduled(): void;
82
+ /**
83
+ * Wrap one post-resolution task so its settle outcome is recorded. Settle
84
+ * tracking is try/finally-structured: a synchronous throw and an async
85
+ * rejection both record and re-raise, preserving the drain loop's existing
86
+ * non-fatal catch semantics (src/index.ts). Tasks appended to the array
87
+ * after a settle still get outcome rows (bounded late-task behavior).
88
+ */
89
+ export declare function wrapPostResolutionTask(task: PostResolutionTaskLike): PostResolutionTaskLike;
90
+ /**
91
+ * Observe the FIRST invocation of a host-facing handler (chat transform or
92
+ * tool execute) without changing it: returns the handler's own result /
93
+ * promise untouched and attaches a detached observation that records the
94
+ * first-use interval when the invocation SETTLES (success or rejection —
95
+ * an errored first call is still a first use). No extra awaits on the
96
+ * observed path, no writes to any argument, no rebinding.
97
+ */
98
+ export declare function withStartupFirstUseTracking<Args extends unknown[], Result>(stage: 'first_turn' | 'first_tool', label: string | undefined, handler: (...args: Args) => Result): (...args: Args) => Result;
99
+ /**
100
+ * Tool-execute specialization of the first-use observation with a FIXED
101
+ * two-parameter signature: the plugin's ToolDefinition.execute contract is
102
+ * `(args, ctx) => ...`, and the registration-convention tests assert
103
+ * `execute.length >= 2` on tool definitions. The wrapper still returns the
104
+ * wrapped execute's own result untouched and records the interval when the
105
+ * invocation settles (success or rejection).
106
+ */
107
+ export declare function withStartupFirstToolTracking<Args, Result>(name: string, execute: (args: Args, ctx: unknown) => Result): (args: Args, ctx: unknown) => Result;
108
+ /**
109
+ * Count a startup-window advisory (readiness warning). Called from
110
+ * warning-buffer's addDeferredWarning; the window opens at server entry
111
+ * and closes at queue settle (never re-opens), so late-session advisories
112
+ * never contribute.
113
+ */
114
+ export declare function noteStartupAdvisory(): void;
115
+ /**
116
+ * The collected contract state, as a structured report.
117
+ *
118
+ * @internal Unit-test seam and future surfaces; not a public API.
119
+ */
120
+ export declare function buildStartupContractReport(): StartupContractState;
121
+ /**
122
+ * DI seam for testability (repo convention; see src/utils/logger.ts).
123
+ * Internal calls route through `_internals` so tests can inject a
124
+ * deterministic performance clock and capture emissions without
125
+ * mock.module.
126
+ */
127
+ export declare const _internals: {
128
+ performance: {
129
+ now: () => number;
130
+ };
131
+ isDebugEnabled: () => boolean;
132
+ emitLine: (line: string) => void;
133
+ };
134
+ export {};
@@ -155,6 +155,14 @@ export type PrReviewEvent = {
155
155
  semanticEnvelopeDigest: string;
156
156
  outcome: 'CLEAN' | 'FINDINGS' | 'INCOMPLETE';
157
157
  existingReceiptDigest?: string | undefined;
158
+ /**
159
+ * Provenance marker on the reducer event. Currently no consumer reads
160
+ * this field — the durable provenance record is the receipt-side
161
+ * `submittedBy` / `submittedByParentSessionId` (see
162
+ * `PrReviewResultReceiptSchema`). Kept for ledger parity with the
163
+ * receipt.
164
+ */
165
+ submittedBy?: 'workflow_parent' | undefined;
158
166
  } | {
159
167
  type: 'circuit_advance_requested';
160
168
  nowMs: number;
@@ -364,6 +364,7 @@ export declare const _internals: {
364
364
  };
365
365
  export declare const _test_exports: {
366
366
  validatePrReviewMicroDispatch: typeof validatePrReviewMicroDispatch;
367
+ resolveCollectExpectedWorkflowIdentity: typeof resolveCollectExpectedWorkflowIdentity;
367
368
  applyCommonPrompt: typeof applyCommonPrompt;
368
369
  applyExplorerFormatSuffix: typeof applyExplorerFormatSuffix;
369
370
  applyPrWorkflowPromptContract: typeof applyPrWorkflowPromptContract;
@@ -526,6 +527,34 @@ type LaneDiagnostics = Map<string, Set<string>>;
526
527
  */
527
528
  declare function assembleCollectionDiagnostics(hostTimeouts: ReadonlySet<string>, settleFailureLogs: LaneDiagnostics, collectionResourceFailures: LaneDiagnostics): string[];
528
529
  declare function addLaneDiagnostic(diagnostics: LaneDiagnostics, laneLabel: string, message: string): void;
530
+ /**
531
+ * Issue #2585 live-proof defect (found by AC11 case-01 against the real host,
532
+ * present byte-identically on main 3ea01cbc7): the collect-time discovery
533
+ * validation built its `expected` WITHOUT the workflow identity triple, so
534
+ * `validateExactStructuredReceiptCoverage` rejected EVERY child-submitted
535
+ * structured receipt with `missing live workflow instance/revision/base
536
+ * identity` — deterministic, prompt-insensitive, unrepairable from the
537
+ * orchestrator — and every base dimension settled as a contract failure
538
+ * (NO_COVERAGE → forced INCOMPLETE). The dispatch-side record carries the
539
+ * instance (jobId binding) and revision (workflowGeneration); the live gate
540
+ * state of the dispatching parent carries the merge-base. Derive the triple
541
+ * from those two authoritative sources instead of leaving it undefined.
542
+ *
543
+ * Pure: exported through `_test_exports` for the regression test. Returns
544
+ * undefined whenever any leg is missing — callers then keep the validator's
545
+ * explicit missing-identity rejection (today's behavior) rather than guessing.
546
+ */
547
+ /** Minimal structural slice of the PR_REVIEW gate state the identity needs. */
548
+ interface PrReviewCollectParentStateSlice {
549
+ mode?: string;
550
+ workflowInstanceId?: string;
551
+ prReviewBaseSha?: string;
552
+ }
553
+ export declare function resolveCollectExpectedWorkflowIdentity(record: BackgroundDelegationRecord, parentState: PrReviewCollectParentStateSlice | null): {
554
+ workflowInstanceId: string;
555
+ workflowRevision: number;
556
+ baseSha: string;
557
+ } | undefined;
529
558
  declare function consumePrReviewReceiptAppendFailureLog(loggedFailures: Set<string>, parentSessionId: string, correlationId: string): boolean;
530
559
  declare function startAsyncLanePrompt(args: {
531
560
  session: SessionOps;
@@ -114,6 +114,13 @@ export interface CoderSettlementWalState {
114
114
  ownedInProcess: boolean;
115
115
  /** A different, still-alive host process owns the dispatch. Never force-releasable from here. */
116
116
  ownedByLiveForeignPid: boolean;
117
+ /**
118
+ * Generation fence the dispatch declared on its WAL (issue #2665): the
119
+ * workflow generation the owning transition expected to CAS against.
120
+ * Retained through recovery status so a stale-generation receipt is
121
+ * visible without re-reading the WAL bytes.
122
+ */
123
+ expectedGeneration?: number;
117
124
  }
118
125
  /**
119
126
  * Bounded inventory of durable coder-settlement WALs for diagnostics and
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Static recovery-invocation guidance (issue #2665).
3
+ *
4
+ * One shell-correct form per supported shell for the recovery entry points,
5
+ * plus the category glossary and the deterministic-repair boundary text the
6
+ * operator runbook publishes. Everything here is a module constant: this
7
+ * module MUST NOT read environment variables or the host platform, or any
8
+ * environment signal to choose an invocation string — the contract is
9
+ * documented per shell, never sniffed (issue #2665 AC3: "without introducing
10
+ * a new heuristic path detector"; the anti-detection source scan lives in
11
+ * tests/unit/workflow/task-recovery-status.test.ts).
12
+ */
13
+ /** The compact operator runbook that carries the full guidance. */
14
+ export declare const RECOVERY_RUNBOOK_DOC_PATH = "docs/troubleshooting/recovery-runbook.md";
15
+ export interface RecoveryInvocationForm {
16
+ /** Shell or entry surface the form is correct for. */
17
+ surface: 'host' | 'powershell' | 'git-bash' | 'cli';
18
+ /** Shell-correct invocation string (placeholders in angle brackets). */
19
+ invocation: string;
20
+ /** One-line explanation, including the known friction where relevant. */
21
+ note: string;
22
+ }
23
+ /**
24
+ * Shell-correct invocations for `/swarm recover <task_id>`.
25
+ *
26
+ * The Git Bash form doubles the leading slash of the `/swarm ...` message
27
+ * argument: MSYS path conversion rewrites a single leading-slash argument to
28
+ * a path under the Git install root (`C:/Program Files/Git/swarm ...`) before
29
+ * the host ever sees it. Setting `MSYS_NO_PATHCONV=1` for the whole
30
+ * invocation is NOT shell-correct because `--dir /c/...` arguments then stop
31
+ * converting too.
32
+ */
33
+ export declare const RECOVERY_INVOCATIONS: readonly RecoveryInvocationForm[];
34
+ /** One-line per-shell quick forms for operator-facing output surfaces. */
35
+ export declare function renderRecoveryInvocationQuickForms(docPath?: string): string;
@@ -1,3 +1,4 @@
1
+ import { type TaskRecoveryStatus } from './task-recovery-status.js';
1
2
  export type StageARepairOutcome = {
2
3
  taskId: string;
3
4
  outcome: 'repaired';
@@ -26,6 +27,22 @@ export type PreCheckGreennessResult = {
26
27
  green: false;
27
28
  reason: 'no_pre_check_bundles' | 'pre_check_failed_or_stale';
28
29
  };
30
+ export interface StageAScanResult {
31
+ /** One entry per enumerated task, classified in the shared #2665 vocabulary. */
32
+ results: TaskRecoveryStatus[];
33
+ truncated: boolean;
34
+ }
35
+ /**
36
+ * Read-only wedge scan (issue #2665): classifies every enumerated task via
37
+ * the shared recovery vocabulary WITHOUT emitting transitions, writing
38
+ * evidence, or appending events. Tasks whose evidence cannot be read are
39
+ * skipped (their failure surfaces through the repair path's per-task error
40
+ * outcomes and the diagnose evidence checks). `repairAllowed` is true only
41
+ * for the `live_wedge` category with green post-settlement pre-check proof.
42
+ */
43
+ export declare function scanWedgedStageA(directory: string, options?: {
44
+ taskIds?: string[];
45
+ }): Promise<StageAScanResult>;
29
46
  /**
30
47
  * Repair path for tasks already wedged at `coder_delegated`
31
48
  * (TASK_WORKFLOW_STAGE_A_REQUIRED post-reset wedge). For each flat task
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Task recovery status classification (issue #2665).
3
+ *
4
+ * Pure classification over facts the durable receipts already carry: the
5
+ * coder-settlement WAL inventory (`CoderSettlementWalState`), the per-task
6
+ * evidence workflow snapshot, and (for the wedge class) the Stage A scan.
7
+ * This module never reads the filesystem, never writes state, and never
8
+ * repairs anything — it is the "task/generation-specific missing explanation"
9
+ * that connects status and repair to the same transition receipts
10
+ * (`transitionId` + `generation`), per the issue's scope quote: add the
11
+ * explanation, not another recovery engine.
12
+ */
13
+ import type { TaskEvidence, TaskWorkflowSnapshot } from '../gate-evidence.js';
14
+ import type { CoderSettlementWalState } from './coder-settlement.js';
15
+ export type TaskRecoveryCategory = 'healthy' | 'missing' | 'stale' | 'ambiguous' | 'corrupt' | 'live_wedge';
16
+ export interface TaskRecoveryStatus {
17
+ taskId: string;
18
+ category: TaskRecoveryCategory;
19
+ /** Workflow generation from the durable evidence snapshot, when one exists. */
20
+ generation?: number;
21
+ /** Owning transition id from the settlement WAL / evidence chain tip. */
22
+ transitionId?: string;
23
+ /** Deterministic repair allowed without an operator assertion? */
24
+ repairAllowed: boolean;
25
+ /** An external (process/provider) effect may still be in flight or unresolved. */
26
+ uncertainExternalEffect: boolean;
27
+ explanation: string;
28
+ /** Host-command-path form; per-shell forms live in recovery-invocation.ts. */
29
+ suggestedNextCommand: string;
30
+ }
31
+ /**
32
+ * Classify one settlement-WAL entry against the task's workflow snapshot.
33
+ *
34
+ * Category mapping (issue #2665 AC1 vocabulary):
35
+ * - `unreadable` → corrupt (facts corrupt; recovery refuses, never rewrites)
36
+ * - owned in this process / by a live foreign pid → ambiguous (external
37
+ * effect stays uncertain; never force a foreign owner)
38
+ * - `DISPATCHED`/`PREPARED` with a dead owner → stale (deterministic repair)
39
+ * - terminal → healthy
40
+ *
41
+ * When the WAL records an `expectedGeneration` that disagrees with the
42
+ * workflow snapshot's generation, the stale explanation names the generation
43
+ * conflict explicitly — the settle path's CAS already refuses stale and
44
+ * foreign receipts; this makes that refusal visible in status.
45
+ */
46
+ export declare function classifySettlementWalState(entry: CoderSettlementWalState, workflow: TaskWorkflowSnapshot | null): TaskRecoveryStatus;
47
+ /**
48
+ * Classify a task's evidence-workflow state for recovery purposes. The
49
+ * `live_wedge` class is the "live-shaped task wedge" of issue #2665 AC2:
50
+ * the workflow sits at `coder_delegated` with no pre_check gate proof —
51
+ * deterministically repairable by the Stage A repair (which never re-runs
52
+ * the coder and never edits evidence speculatively) when green
53
+ * post-settlement pre-check proof exists.
54
+ */
55
+ export declare function classifyEvidenceRecoveryTask(taskId: string, evidence: TaskEvidence | null, greenPreCheck: boolean | null): TaskRecoveryStatus;
56
+ /**
57
+ * One diagnose-detail line per non-healthy task. Healthy tasks are rendered
58
+ * by their COUNT only (never a per-task line) so no category token can
59
+ * attach to a healthy task id (plan-critic B1).
60
+ */
61
+ export declare function renderTaskRecoveryLine(status: TaskRecoveryStatus): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.174.0",
3
+ "version": "7.176.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -111,6 +111,8 @@
111
111
  "package:smoke": "node scripts/package-smoke.mjs",
112
112
  "prepare": "bun run build",
113
113
  "repro:704": "node scripts/repro-704.mjs",
114
+ "repro:2669": "node scripts/repro-2669.mjs",
115
+ "repro:2670": "node scripts/repro-2670.mjs",
114
116
  "repro:1144": "bun scripts/repro-1144.mjs",
115
117
  "repro:1873": "bun build scripts/repro-1873-entry.ts --outdir dist-build-test/repro-1873 --target node --format esm && node scripts/repro-1873.mjs",
116
118
  "repro:2487": "bun build scripts/repro-2487-parity-entry.ts --outdir dist-build-test/repro-2487 --target node --format esm && node scripts/repro-2487-parity.mjs",