opencode-swarm 7.188.8 → 7.188.10

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 (82) 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/cli/{auto-checkpoint-cdcf7yeb.js → auto-checkpoint-c4nesm12.js} +5 -5
  4. package/dist/cli/{checkpoint-jpc3a69d.js → checkpoint-sfnz4843.js} +9 -9
  5. package/dist/cli/{coder-settlement-rmaypr7g.js → coder-settlement-y7wjm4w3.js} +3 -3
  6. package/dist/cli/{config-doctor-b5t9hrzb.js → config-doctor-d01gbn5x.js} +7 -7
  7. package/dist/cli/{core-ky5b3mh6.js → core-1ymsg83x.js} +1 -1
  8. package/dist/cli/{curator-bsafet3m.js → curator-5ynapye5.js} +27 -27
  9. package/dist/cli/{curator-drift-2dwkkykq.js → curator-drift-9tnm8jdz.js} +5 -5
  10. package/dist/cli/{curator-llm-factory-ajtxk3sm.js → curator-llm-factory-9z688c52.js} +27 -27
  11. package/dist/cli/{dispatch-qvcztbpf.js → dispatch-1pbmmj8z.js} +50 -225
  12. package/dist/cli/{doctor-knowledge-receipt-phase-id-mckkwm0c.js → doctor-knowledge-receipt-phase-id-tkkznw6t.js} +5 -5
  13. package/dist/cli/{evidence-summary-service-svrt4se9.js → evidence-summary-service-jsg0x7q1.js} +10 -10
  14. package/dist/cli/{gate-evidence-jcw4mvwr.js → gate-evidence-6r2qbk89.js} +2 -2
  15. package/dist/cli/{guardrail-explain-5j0cg165.js → guardrail-explain-7m0h7db3.js} +28 -28
  16. package/dist/cli/{guardrail-log-h6fc7rnv.js → guardrail-log-p6s1sbxh.js} +3 -3
  17. package/dist/cli/{guardrail-reset-kjmqnr5r.js → guardrail-reset-shvx8e8g.js} +27 -27
  18. package/dist/cli/{hive-promoter-edp5c7k2.js → hive-promoter-f5cd2d49.js} +27 -27
  19. package/dist/cli/{index-kwbgrb3y.js → index-14d4cyxj.js} +1 -1
  20. package/dist/cli/{index-chsaj89g.js → index-3ad6fs6v.js} +1 -1
  21. package/dist/cli/{index-r89wr177.js → index-3j27qc81.js} +1 -1
  22. package/dist/cli/{index-fbw4g7yh.js → index-53t4xt8f.js} +1 -1
  23. package/dist/cli/{index-d4vrpe06.js → index-562bdvys.js} +1 -1
  24. package/dist/cli/{index-8hf3rt47.js → index-6yrx7ggm.js} +4 -4
  25. package/dist/cli/{index-nyy3hpwg.js → index-7cxtwt5e.js} +6 -6
  26. package/dist/cli/{index-js2jykf9.js → index-8xxk1gv4.js} +1 -1
  27. package/dist/cli/{index-hsmvdecz.js → index-9cqw29er.js} +2 -2
  28. package/dist/cli/{index-b81wsm2s.js → index-b0jte72h.js} +1 -1
  29. package/dist/cli/{index-e69469z9.js → index-d7m9qhpe.js} +2 -2
  30. package/dist/cli/{index-qg3tx5az.js → index-drpz069k.js} +1 -1
  31. package/dist/cli/{index-f0kk9daj.js → index-e7t7b5xs.js} +3 -3
  32. package/dist/cli/{index-8gyt9j0a.js → index-gjjn069b.js} +1 -1
  33. package/dist/cli/{index-n8n94des.js → index-hjpspz6z.js} +27 -27
  34. package/dist/cli/{index-h93hm2ew.js → index-hxfsxkb8.js} +245 -177
  35. package/dist/cli/{index-wbjk8xq9.js → index-hzezk176.js} +2 -2
  36. package/dist/cli/{index-vx8a8w3b.js → index-j2vv0h13.js} +506 -211
  37. package/dist/cli/{index-11v15np0.js → index-jna86fsj.js} +2 -2
  38. package/dist/cli/{index-fqyd21v7.js → index-ks6s6pmk.js} +4 -4
  39. package/dist/cli/{index-vhqcqq73.js → index-mbqaxnsy.js} +1 -1
  40. package/dist/cli/{index-9m3pcjf2.js → index-n3h6rwpf.js} +2 -2
  41. package/dist/cli/{index-kbkk7vnh.js → index-pkhbd2t5.js} +2 -1
  42. package/dist/cli/{index-d1yjbjf9.js → index-qq95qr3b.js} +3 -3
  43. package/dist/cli/{index-pd9hkz4f.js → index-rpb18d3f.js} +3 -3
  44. package/dist/cli/{index-s55t0cdc.js → index-rrs4vj8e.js} +5 -5
  45. package/dist/cli/{index-kx0sr39t.js → index-scjtkt0e.js} +29 -29
  46. package/dist/cli/{index-0g7wya30.js → index-sjh07rja.js} +1 -1
  47. package/dist/cli/{index-gfqz06ra.js → index-tegqnetn.js} +2 -2
  48. package/dist/cli/{index-yyh5kegx.js → index-vz1ze26j.js} +1 -1
  49. package/dist/cli/{index-sarq27b9.js → index-w11m4vrb.js} +1 -1
  50. package/dist/cli/{index-mcnqpmw6.js → index-zwn2w04v.js} +2 -2
  51. package/dist/cli/index.js +28 -28
  52. package/dist/cli/{knowledge-escalator-ndsm1023.js → knowledge-escalator-rjwqcj4c.js} +8 -8
  53. package/dist/cli/{knowledge-events-pcbxvykz.js → knowledge-events-0f3tf23t.js} +6 -6
  54. package/dist/cli/{knowledge-store-00t92ypz.js → knowledge-store-azahpegn.js} +1 -1
  55. package/dist/cli/{knowledge-validator-f8mkzp37.js → knowledge-validator-9yvg7gn9.js} +2 -2
  56. package/dist/cli/{mcp-sawqgyk6.js → mcp-mxgxbdd2.js} +1 -1
  57. package/dist/cli/{model-preflight-7rrjh3wp.js → model-preflight-c9qb1630.js} +27 -27
  58. package/dist/cli/{pending-delegations-2161efex.js → pending-delegations-rm86drz1.js} +2 -2
  59. package/dist/cli/{pr-subscriptions-m47zghfv.js → pr-subscriptions-0y73v5dw.js} +1 -1
  60. package/dist/cli/{pr-workflow-gate-hmtae8gc.js → pr-workflow-gate-f1wr818p.js} +27 -27
  61. package/dist/cli/{scan-cursor-gdy1qjed.js → scan-cursor-abq3sdt6.js} +2 -2
  62. package/dist/cli/{schema-qaxjz2de.js → schema-0c4cddzy.js} +1 -1
  63. package/dist/cli/{scope-persistence-dnx61ybv.js → scope-persistence-f8ss7vna.js} +5 -5
  64. package/dist/cli/{server-6wmhhy81.js → server-bc0s1v3y.js} +27 -27
  65. package/dist/cli/{skill-generator-sgv3bdgt.js → skill-generator-2z0p2rjb.js} +9 -9
  66. package/dist/cli/{snapshot-coordination-init-qbtzxwga.js → snapshot-coordination-init-sn7red7a.js} +27 -27
  67. package/dist/cli/{speckit-checkoff-yepzgcmj.js → speckit-checkoff-t3pm0yn0.js} +3 -3
  68. package/dist/cli/{worktree-collision-ownership-cswsfrj6.js → worktree-collision-ownership-g14dwsby.js} +2 -2
  69. package/dist/cli/{worktree-isolation-vj7egepy.js → worktree-isolation-av55nenq.js} +27 -27
  70. package/dist/commands/recover.d.ts +1 -1
  71. package/dist/commands/registry.d.ts +1 -1
  72. package/dist/config/evidence-schema.d.ts +3 -0
  73. package/dist/index.js +208 -208
  74. package/dist/lang/backend.d.ts +7 -0
  75. package/dist/lang/backends/java.d.ts +39 -0
  76. package/dist/lang/default-backend.d.ts +40 -0
  77. package/dist/tools/build-check.d.ts +13 -0
  78. package/dist/tools/test-runner.d.ts +31 -1
  79. package/dist/utils/windows-batch.d.ts +58 -0
  80. package/dist/workflow/session-view.d.ts +47 -0
  81. package/dist/workflow/stage-a-repair.d.ts +1 -0
  82. package/package.json +1 -1
@@ -36,6 +36,13 @@ export interface TestFrameworkSelection {
36
36
  * cannot avoid a shell-mediated invocation (e.g. PowerShell `-EncodedCommand`)
37
37
  * still produce an array; the array's first element is the binary and the
38
38
  * rest are individual arguments.
39
+ *
40
+ * On win32 an array whose `argv[0]` is a `cmd.exe` contained-launcher tuple
41
+ * (from `resolveContainedWindowsBatchCommand`) additionally requires the
42
+ * spawner to pass `windowsVerbatimArguments: true`, so the pre-quoted tail
43
+ * reaches cmd.exe unmodified. A caller spawning a Windows wrapper this way
44
+ * must gate on `isWindowsCommandInterpreterLaunch(cmd)`;
45
+ * `src/tools/test-runner.ts` is the reference implementation.
39
46
  */
40
47
  cmd: string[];
41
48
  /** Explicit cwd for the spawn (invariant 3). */
@@ -13,6 +13,9 @@
13
13
  * - `selectEntryPoints` scans the tree for `.java` files declaring
14
14
  * `public static void main`.
15
15
  * - `selectFramework` detects Spring vs Servlet from pom.xml / build.gradle.
16
+ * - `buildTestCommand` builds the Maven test argv via the exported
17
+ * `buildMavenTestCommand` (runnable wrapper first, else `mvn`), which the
18
+ * test-runner's legacy switch shares so both paths emit identical argv.
16
19
  *
17
20
  * Invariants identical to other backends — see `python.ts` and `go.ts` for
18
21
  * the rationale; `tests/unit/lang/backend-purity.test.ts` enforces them.
@@ -60,6 +63,41 @@ declare function resolveMvnwCommand(dir: string): string;
60
63
  * Maven wrapper.
61
64
  */
62
65
  declare function resolveGradlewCommand(dir: string): string;
66
+ /**
67
+ * True when `filePath` is a regular file with at least one POSIX execute bit
68
+ * set. Uses `statSync({ throwIfNoEntry: false })` so a missing wrapper is a
69
+ * plain `false` rather than exception-based control flow (the same rationale
70
+ * as {@link wrapperExists}); any other stat failure is also treated as "not
71
+ * executable". Only meaningful on POSIX — Windows reports no execute bits.
72
+ */
73
+ declare function isExecutableFile(filePath: string): boolean;
74
+ /**
75
+ * Build the Maven wrapper invocation for `dir` when a RUNNABLE wrapper exists,
76
+ * otherwise null. This is the single source of truth for "is there a usable
77
+ * Maven wrapper" — the command builders below and the test-runner's nested
78
+ * Maven detection both use it, so detection never accepts a wrapper the
79
+ * command path would not launch.
80
+ *
81
+ * - win32: only `mvnw.cmd`, launched through a validated `cmd.exe`
82
+ * (`resolveContainedWindowsBatchCommand`): the wrapper's realpath must stay
83
+ * inside `dir`, and every token (wrapper path and `args`) is rejected when it
84
+ * contains a cmd.exe metacharacter. A bare `mvnw.cmd` argv[0] is never
85
+ * emitted (spawn resolves it against PATH, not the cwd), and a POSIX-only
86
+ * `mvnw` is never used on win32 (it is not runnable there).
87
+ * - POSIX: `./mvnw` (relative to the spawn cwd, which callers set to `dir`)
88
+ * only when it is a regular file with an execute bit. A wrapper that lost
89
+ * its mode bit (zip download, Windows-authored checkout) would fail with
90
+ * EACCES, so it is skipped.
91
+ */
92
+ export declare function resolveMavenWrapperCommand(dir: string, args: string[]): string[] | null;
93
+ /**
94
+ * Build the Maven test argv for `dir`: the runnable wrapper from
95
+ * {@link resolveMavenWrapperCommand} when there is one, otherwise `mvn` from
96
+ * PATH. `-Dtest=<targets>` is appended when targets are given. Shared by the
97
+ * Java backend's dispatch `buildTestCommand` and the test-runner's legacy
98
+ * (`SWARM_LANG_BACKEND=legacy`) switch so both paths emit identical argv.
99
+ */
100
+ export declare function buildMavenTestCommand(dir: string, targets?: string[]): string[];
63
101
  /**
64
102
  * Build the Java backend from the registered profile.
65
103
  */
@@ -69,6 +107,7 @@ export declare const _internals: {
69
107
  isMainClass: typeof isMainClass;
70
108
  detectFramework: typeof detectFramework;
71
109
  wrapperExists: typeof wrapperExists;
110
+ isExecutableFile: typeof isExecutableFile;
72
111
  resolveMvnwCommand: typeof resolveMvnwCommand;
73
112
  resolveGradlewCommand: typeof resolveGradlewCommand;
74
113
  MAX_ENTRY_POINT_ENTRIES: typeof MAX_ENTRY_POINT_ENTRIES;
@@ -34,6 +34,46 @@ export declare function defaultSelectTestFramework(profile: LanguageProfile, dir
34
34
  * `opts.scope` defaults to `'all'`; `opts.coverage` defaults to `false`.
35
35
  * Returns null when the framework name is not in the supported set.
36
36
  */
37
+ /**
38
+ * Build the Gradle test argv for `dir` (issue #3040). On win32 with a
39
+ * `gradlew.bat` wrapper, route through the contained cmd.exe launcher
40
+ * (`resolveContainedWindowsBatchCommand`) — Bun resolves a bare executable
41
+ * name against PATH only, never the spawn cwd, so a bare `gradlew.bat` can
42
+ * never start. Falls back to plain `gradle` from PATH when the helper rejects
43
+ * the wrapper or an argument (including a token ending in a backslash, which
44
+ * the launcher's quoting would mangle — the same guard `buildMavenTestCommand`
45
+ * carries). When `gradlew.bat` is absent, the historical chain applies on ANY
46
+ * platform — `./gradlew` when a `gradlew` file exists (yes, even on win32,
47
+ * preserving the pre-#3040 behavior), else `gradle`. Shared by
48
+ * `defaultBuildTestCommand` and the test-runner's legacy
49
+ * (`SWARM_LANG_BACKEND=legacy`) switch so both routes emit identical argv.
50
+ */
51
+ export declare function buildGradleTestCommand(dir: string, targets?: string[]): string[];
52
+ /**
53
+ * Build the argv for a Composer `vendor/bin` tool (`phpunit`, `pest`) for `dir`
54
+ * (issue #3050).
55
+ *
56
+ * On win32 a Composer `.bat` shim must never become a raw spawn target: Node's
57
+ * `child_process.spawn` rejects a batch file outright (EINVAL), and although
58
+ * Bun tolerates one, that tolerance is a runtime accident rather than a
59
+ * contract, so behaviour must not depend on which runtime is hosting the
60
+ * plugin. Route the wrapper through the contained cmd.exe launcher
61
+ * (`resolveContainedWindowsBatchCommand`), the same path the Maven (#3021) and
62
+ * Gradle (#3040) wrappers already take.
63
+ *
64
+ * When the launcher declines — no shim present, a symlink escaping `dir`, an
65
+ * unresolvable `ComSpec`, or an argument carrying a cmd.exe metacharacter — the
66
+ * fallback runs the PHP interpreter against the extensionless Composer proxy
67
+ * rather than re-emitting the batch file. Composer writes both, the proxy is
68
+ * what the `.bat` itself invokes, and the `php-artisan` arm of the very same
69
+ * switch already hardcodes `php`.
70
+ *
71
+ * Non-win32 is unchanged: the historical cwd-relative extensionless proxy.
72
+ * Shared by `defaultBuildTestCommand`, the test-runner's legacy
73
+ * (`SWARM_LANG_BACKEND=legacy`) switch, and the PHP backend's
74
+ * `selectTestFramework`, so all three routes emit identical argv.
75
+ */
76
+ export declare function buildPhpVendorCommand(dir: string, name: string, args?: string[]): string[];
37
77
  export declare function defaultBuildTestCommand(profile: LanguageProfile, framework: string, files: string[], dir?: string, opts?: BuildTestCommandOpts): string[] | null;
38
78
  export declare function buildNativeTargetCommand(target: NativeTestTarget): string[];
39
79
  /**
@@ -37,6 +37,19 @@ export interface BuildRun {
37
37
  duration_ms: number;
38
38
  stdout_tail: string;
39
39
  stderr_tail: string;
40
+ /**
41
+ * Set only when the process could not be created at all — the `bunSpawn`
42
+ * `spawnError` value contract (`src/utils/bun-compat.ts`), which is how
43
+ * process-creation failures surface on every runtime.
44
+ *
45
+ * Without it a launch failure is indistinguishable from a build that ran and
46
+ * exited non-zero: `spawnError` and `exitCode` are mutually exclusive, so a
47
+ * failed spawn resolves `exited` to the sentinel 1 and this record would read
48
+ * "exit 1" either way (issue #3050). Absent — not null — when the process did
49
+ * start, so "no launch failure" stays distinguishable from "field present but
50
+ * empty".
51
+ */
52
+ spawn_error?: string;
40
53
  }
41
54
  export interface BuildCheckResult {
42
55
  verdict: EvidenceVerdict;
@@ -16,6 +16,7 @@ export declare const MAX_SAFE_SOURCE_FILES = 1;
16
16
  export declare const MAX_RAW_FILE_ENTRIES = 512;
17
17
  export declare const MAX_FILE_PATH_LENGTH = 4096;
18
18
  export declare const MAX_GRAPH_FILE_BYTES: number;
19
+ export declare const MAX_MAVEN_MODULE_PROBE_ENTRIES = 100;
19
20
  /**
20
21
  * Estimate the fan-out (number of unique test files) for given source files
21
22
  * by reading the cached impact map without spawning a subprocess.
@@ -161,7 +162,35 @@ export declare function parseTestOutputViaDispatch(framework: TestFramework, out
161
162
  totals: TestTotals;
162
163
  coveragePercent?: number;
163
164
  } | null>;
164
- export declare function detectTestFramework(cwd: string): Promise<TestFramework>;
165
+ /**
166
+ * Resolve the nearest Maven module directory under `root`.
167
+ *
168
+ * When `files` is provided, each file is resolved against `root`, paths
169
+ * outside `root` are dropped, and the directory containing each remaining file
170
+ * is walked upward toward `root` until a `pom.xml` is found. The first match
171
+ * wins (files are tried in the given order; later files are consulted only
172
+ * when an earlier one resolves to no module).
173
+ *
174
+ * When `files` is absent/empty, the immediate entries of `root` are probed one
175
+ * level deep for a `pom.xml`: hidden entries (any name starting with `.`) and
176
+ * `node_modules` are skipped, the remaining entries are sorted by name and at
177
+ * most {@link MAX_MAVEN_MODULE_PROBE_ENTRIES} of them are inspected.
178
+ *
179
+ * Containment is checked on canonical paths: a candidate module directory is
180
+ * accepted only when its realpath stays inside the realpath of `root`, so a
181
+ * symlink or junction that leads outside the project is skipped (the walk /
182
+ * probe continues with the next candidate). If `root` itself cannot be
183
+ * realpath'd, no module is resolved (fail closed). The returned path is the
184
+ * LEXICAL module path under `root`.
185
+ *
186
+ * Known limitations:
187
+ * - Multi-module reactor: nearest `pom.xml` wins. A child module that depends
188
+ * on sibling reactor modules may require the aggregator pom (out of scope).
189
+ * - `scope:'target'` native execution remains rooted at the project root; this
190
+ * resolver does not change native target handling.
191
+ */
192
+ export declare function resolveMavenModuleDir(root: string, files?: string[]): string | null;
193
+ export declare function detectTestFramework(cwd: string, files?: string[]): Promise<TestFramework>;
165
194
  /**
166
195
  * Returns true when `basename` matches a language-specific test file naming
167
196
  * convention that is NOT captured by the compound-extension or dot-separated
@@ -207,6 +236,7 @@ export declare const _internals: {
207
236
  existsSync: typeof fs.existsSync;
208
237
  readdirSync: typeof fs.readdirSync;
209
238
  readFileSync: typeof fs.readFileSync;
239
+ realpathSync: typeof fs.realpathSync;
210
240
  resolveLocalNodeTool: typeof resolveLocalNodeTool;
211
241
  bunSpawn: typeof bunSpawn;
212
242
  buildNativeTargetCommand: typeof buildNativeTargetCommand;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Safe launch of a Windows batch wrapper (`.cmd` / `.bat`) through a
3
+ * validated `cmd.exe`.
4
+ *
5
+ * Node cannot spawn a batch file directly at all: since the CVE-2024-27980
6
+ * hardening `child_process.spawn` rejects a `.cmd`/`.bat` target with EINVAL
7
+ * (measured on Node v24.16.0 for the absolute, cwd-relative and bare-name
8
+ * forms alike). Bun is more permissive — it routes batch files through cmd.exe
9
+ * itself — but that tolerance is a runtime accident rather than a contract, so
10
+ * a launcher must not depend on which runtime hosts the plugin. For the same
11
+ * reason a bare wrapper name such as `mvnw.cmd` is resolved against PATH only,
12
+ * never against the spawn `cwd`. The supported shape is
13
+ * `[<cmd.exe>, '/d', '/s', '/v:off', '/c', 'call "<abs>" "<arg>" ...']`
14
+ * spawned with `windowsVerbatimArguments: true`, so the pre-quoted tail reaches
15
+ * cmd.exe unmodified (the same pattern `src/tools/lint.ts` and
16
+ * `src/tools/pkg-audit.ts` use).
17
+ *
18
+ * Every token (the canonical wrapper path and each argument) is rejected when
19
+ * it contains a cmd.exe metacharacter instead of being escaped, so a caller
20
+ * never builds a command line cmd.exe could re-interpret. Callers must treat a
21
+ * `null` result as "do not launch the wrapper" and fall back to a non-batch
22
+ * command.
23
+ *
24
+ * Extracted from `src/tools/lint.ts` without behaviour change. The functions
25
+ * take their filesystem/environment dependencies explicitly so each caller
26
+ * keeps its own DI seam: lint passes thunks over `lint._internals`, while
27
+ * other callers use this module's `_internals` (the default).
28
+ */
29
+ export declare const WINDOWS_BATCH_WRAPPER_EXTENSIONS: readonly [".cmd", ".bat"];
30
+ /** Filesystem/environment dependencies of the batch-launch helpers. */
31
+ export interface WindowsBatchDeps {
32
+ platform: () => NodeJS.Platform;
33
+ comSpec: () => string | undefined;
34
+ realpathSync: (candidate: string) => string;
35
+ statSync: (candidate: string) => {
36
+ isFile(): boolean;
37
+ };
38
+ }
39
+ /**
40
+ * Build the constrained `cmd.exe /d /s /v:off /c call "<wrapper>" "<arg>"...`
41
+ * argv for an already-located batch wrapper, or null when the interpreter
42
+ * cannot be resolved, the wrapper is not a regular `.cmd`/`.bat` file, or any
43
+ * token contains a cmd.exe metacharacter.
44
+ */
45
+ export declare function buildWindowsBatchCommand(wrapperPath: string, args: string[], deps?: WindowsBatchDeps): string[] | null;
46
+ /**
47
+ * Build the launcher argv for `<cwd>/<fileName>` only on win32, and only when
48
+ * the wrapper's canonical path stays inside the canonical `cwd` (a symlink or
49
+ * junction that escapes `cwd` is rejected). Returns null otherwise.
50
+ */
51
+ export declare function resolveContainedWindowsBatchCommand(cwd: string, fileName: string, args: string[], deps?: WindowsBatchDeps): string[] | null;
52
+ /**
53
+ * True when `command` is a cmd.exe launcher that must be spawned with
54
+ * `windowsVerbatimArguments: true` (win32 only).
55
+ */
56
+ export declare function isWindowsCommandInterpreterLaunch(command: readonly string[], platform?: NodeJS.Platform): boolean;
57
+ /** Default dependencies (live process/filesystem); a DI seam for tests. */
58
+ export declare const _internals: WindowsBatchDeps;
@@ -0,0 +1,47 @@
1
+ import { type TaskWorkflowSnapshot } from '../gate-evidence.js';
2
+ import { type AgentSessionState, type TaskWorkflowState } from '../state.js';
3
+ /**
4
+ * Session-view refresh for Stage A recovery writers (issue #3043).
5
+ *
6
+ * The Stage B settlement loop filters on the session's in-memory
7
+ * `taskWorkflowStates` view while dispatch admission reads the durable
8
+ * workflow evidence, so a recovery writer that advances the durable evidence
9
+ * WITHOUT refreshing the calling session's in-memory twin leaves every later
10
+ * verdict in that session silently skipped — the #3032 split-brain class.
11
+ * The blocked-start arm was the last uncovered shape: `blocked` is
12
+ * at-or-above the durable eligible states, so PR #3038's consumer-side
13
+ * `isRepairableStageBView` guard deliberately refuses to repair it (it
14
+ * protects `update_task_status`'s permissive fallback), and only the WRITER —
15
+ * whose own audited repair write is the authority that the blocked label was
16
+ * drift, not a real block — may refresh it.
17
+ */
18
+ /**
19
+ * Apply a durable workflow snapshot to one session's in-memory view of one
20
+ * task. The exact mutation steps of the update_task_status recovery legs'
21
+ * `syncCallerWorkflowFromEvidence` (extracted so the clear-set can never
22
+ * drift between the two surfaces); the caller owns the refresh DECISION.
23
+ * Pure in-memory bookkeeping aligned to a durable write the caller already
24
+ * made or verified — it must never throw into the recovery result.
25
+ */
26
+ export declare function applySessionWorkflowView(session: AgentSessionState, taskId: string, workflow: TaskWorkflowSnapshot): void;
27
+ /** States a Stage A recovery writer can leave durable evidence at. */
28
+ export type StageARecoveredState = 'pre_check_passed' | 'reviewer_run' | 'tests_run';
29
+ export declare function isStageARecoveredState(state: string): state is StageARecoveredState;
30
+ /**
31
+ * Whether a session's in-memory view may be refreshed to `recoveredState`
32
+ * after a Stage A recovery writer committed (or verified) that durable state.
33
+ *
34
+ * One ordered rule:
35
+ * - absent / `rework_required` / `blocked` views always refresh — the first
36
+ * two mirror the #3038 consumer-side guard's forward-progress exceptions;
37
+ * `blocked` is the #3043 arm and is repairable HERE only, because this
38
+ * predicate runs at the writer that just proved the blocked label was
39
+ * drift (the consumer-side guard keeps refusing it).
40
+ * - otherwise refresh only when the view is not barrier-ahead-or-terminal
41
+ * (`tests_run` / `closed` / `complete` are never downgraded — a map ahead
42
+ * of durable is the legitimate settlement-barrier shape, and terminal
43
+ * completions are never un-completed in memory) AND ranks below the
44
+ * recovered state (the map lags durable; refreshing is forward, not a
45
+ * downgrade).
46
+ */
47
+ export declare function shouldRefreshStageARecoveryView(view: TaskWorkflowState | undefined, recoveredState: StageARecoveredState): boolean;
@@ -102,4 +102,5 @@ export declare function scanWedgedStageA(directory: string, options?: {
102
102
  */
103
103
  export declare function repairWedgedStageA(directory: string, options?: {
104
104
  taskIds?: string[];
105
+ sessionId?: string;
105
106
  }): Promise<StageARepairResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.188.8",
3
+ "version": "7.188.10",
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",