opencode-swarm 7.173.1 → 7.174.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 (103) hide show
  1. package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +37 -0
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/agents/critic.d.ts +44 -2
  5. package/dist/background/pr-review-contract.d.ts +24 -0
  6. package/dist/background/stage-b-gates.d.ts +29 -0
  7. package/dist/cli/{coder-settlement-kxxmd9jt.js → coder-settlement-pwct8te4.js} +11 -11
  8. package/dist/cli/{config-doctor-nzcya5zr.js → config-doctor-tnta65bf.js} +2 -2
  9. package/dist/cli/{core-s9a9kmcc.js → core-421gbna2.js} +3 -3
  10. package/dist/cli/{curation-policy-tx4kb30e.js → curation-policy-dw25zm05.js} +5 -5
  11. package/dist/cli/{curator-drift-047n8fjw.js → curator-drift-x3tt8apf.js} +4 -4
  12. package/dist/cli/curator-llm-factory-4e73613g.js +72 -0
  13. package/dist/cli/{curator-jkp8558s.js → curator-yrhc4epa.js} +36 -36
  14. package/dist/cli/{evidence-summary-service-ek50h5b3.js → evidence-summary-service-f4vem356.js} +15 -15
  15. package/dist/cli/{gate-evidence-8dk50ten.js → gate-evidence-t2dyfvc4.js} +6 -6
  16. package/dist/cli/guardrail-explain-hf5gawe2.js +73 -0
  17. package/dist/cli/{guardrail-log-hq5xpm7g.js → guardrail-log-9dkyvdbw.js} +7 -7
  18. package/dist/cli/{guardrail-reset-gttz1y0h.js → guardrail-reset-26bxnh2e.js} +36 -36
  19. package/dist/cli/{hive-promoter-44p7ng87.js → hive-promoter-6s6xbq5x.js} +36 -36
  20. package/dist/cli/{index-gwz9p53s.js → index-0c7y177k.js} +2 -2
  21. package/dist/cli/{index-m53v442a.js → index-23fwhwrb.js} +36 -36
  22. package/dist/cli/{index-p36b6t7w.js → index-2qawngxn.js} +8 -8
  23. package/dist/cli/{index-fnx0jzf7.js → index-2xwavnbg.js} +1 -1
  24. package/dist/cli/{index-z35ynvj4.js → index-3yw5h3bt.js} +1 -1
  25. package/dist/cli/{index-jmn35na4.js → index-5prgmf00.js} +3 -3
  26. package/dist/cli/{index-za1kvsa0.js → index-5t71wd7j.js} +2 -2
  27. package/dist/cli/{index-dktpzjy9.js → index-6tbnev6y.js} +1 -1
  28. package/dist/cli/{index-yzwb6ja4.js → index-6v1cz898.js} +1 -1
  29. package/dist/cli/{index-yeehyat1.js → index-8d3qzvbb.js} +2 -2
  30. package/dist/cli/{index-bsnpv4xd.js → index-8tn4yx8b.js} +2 -2
  31. package/dist/cli/{index-pynk60z5.js → index-9gpf4tt4.js} +8 -8
  32. package/dist/cli/{index-62pcs7jg.js → index-bf6w27sb.js} +3 -3
  33. package/dist/cli/{index-ndvgkxpf.js → index-c60t3sw6.js} +2 -2
  34. package/dist/cli/{index-m51cmzxt.js → index-cw1nbtvh.js} +1 -1
  35. package/dist/cli/{index-evf5r7bk.js → index-czhbsgdh.js} +1 -1
  36. package/dist/cli/{index-53c0ajk4.js → index-ddz0a0ew.js} +1 -1
  37. package/dist/cli/{index-c5nrcde1.js → index-dfd6d64k.js} +38 -38
  38. package/dist/cli/{index-1xfxzjq9.js → index-dfey3jpn.js} +2 -2
  39. package/dist/cli/{index-gwtb07gc.js → index-e4g3487s.js} +3 -3
  40. package/dist/cli/{index-psb9rxt8.js → index-fagcasf8.js} +5 -5
  41. package/dist/cli/{index-18b9snn6.js → index-hkx8tqa4.js} +6 -6
  42. package/dist/cli/{index-wf3s2t1t.js → index-jd2f7thw.js} +2567 -2138
  43. package/dist/cli/{index-0dfhahxm.js → index-jj09bfnn.js} +2 -2
  44. package/dist/cli/{index-wr4m11x4.js → index-kj7h2yfv.js} +1 -1
  45. package/dist/cli/{index-90qbc4rp.js → index-kyakvkpk.js} +10 -3
  46. package/dist/cli/{index-r8g2meas.js → index-m8c44754.js} +5 -3
  47. package/dist/cli/{index-43dmpa9w.js → index-mjtja1wq.js} +2 -2
  48. package/dist/cli/{index-r93ptj7j.js → index-mmnk7nt1.js} +19 -1
  49. package/dist/cli/{index-hhws1xkc.js → index-nwew2anc.js} +1 -1
  50. package/dist/cli/{index-dx9pz5n6.js → index-nxnmy2da.js} +7 -7
  51. package/dist/cli/{index-j0vvq8se.js → index-py58gern.js} +7 -7
  52. package/dist/cli/{index-6z404f7y.js → index-qc4nvg0m.js} +4 -4
  53. package/dist/cli/{index-samx6zgc.js → index-rgvg7d6k.js} +1 -1
  54. package/dist/cli/{index-mt8pbzda.js → index-rjjtn1w5.js} +12 -12
  55. package/dist/cli/{index-cm0339fe.js → index-s6wb6sjk.js} +4 -4
  56. package/dist/cli/{index-vwnd2szd.js → index-saw0ambb.js} +10 -7
  57. package/dist/cli/{index-pjw95rxm.js → index-snd34n1y.js} +65 -10
  58. package/dist/cli/{index-mjqjbq94.js → index-v8ykb3hq.js} +11 -11
  59. package/dist/cli/{index-kdyvk541.js → index-vsvdh976.js} +2 -2
  60. package/dist/cli/{index-7gkdxs00.js → index-vwjfm0s6.js} +7 -7
  61. package/dist/cli/index.js +37 -37
  62. package/dist/cli/{knowledge-escalator-ttp4x29h.js → knowledge-escalator-bra0fkfm.js} +12 -12
  63. package/dist/cli/{knowledge-events-dx9mjgqb.js → knowledge-events-v4hq7wr9.js} +10 -10
  64. package/dist/cli/{knowledge-link-f7bhq7cx.js → knowledge-link-dw12x2ns.js} +4 -4
  65. package/dist/cli/{knowledge-store-6sq9rxma.js → knowledge-store-3hx2896s.js} +5 -5
  66. package/dist/cli/{knowledge-validator-h49dkw2z.js → knowledge-validator-9wj31ym5.js} +7 -7
  67. package/dist/cli/{mcp-kd7w2572.js → mcp-d7yptqpg.js} +1 -1
  68. package/dist/cli/{pending-delegations-n4qyymj2.js → pending-delegations-8ghc75b2.js} +11 -11
  69. package/dist/cli/{pr-subscriptions-n8vkm5mv.js → pr-subscriptions-yceed093.js} +11 -11
  70. package/dist/cli/{pr-workflow-gate-j67jhtzt.js → pr-workflow-gate-sc4c4cmk.js} +42 -36
  71. package/dist/cli/{runner-58k70bnr.js → runner-k1pmc3z8.js} +5 -5
  72. package/dist/cli/{scan-cursor-sz8ncpw2.js → scan-cursor-mtja4626.js} +6 -6
  73. package/dist/cli/{schema-70c0yw8p.js → schema-x2nb18fg.js} +5 -1
  74. package/dist/cli/{scope-persistence-0dzyv0vt.js → scope-persistence-tafxf6yz.js} +14 -14
  75. package/dist/cli/{server-njmemwbm.js → server-hk378mzc.js} +36 -36
  76. package/dist/cli/{skill-generator-kf5yqmvk.js → skill-generator-vz5vtgk6.js} +14 -14
  77. package/dist/cli/{snapshot-coordination-init-ezf5xqy2.js → snapshot-coordination-init-8x5n1q8c.js} +36 -36
  78. package/dist/cli/{telemetry-zed80n86.js → telemetry-m580862y.js} +1 -1
  79. package/dist/cli/{workspace-snapshot-62be4368.js → workspace-snapshot-6aw002e8.js} +3 -3
  80. package/dist/cli/{worktree-collision-ownership-fe176vyv.js → worktree-collision-ownership-cfx1tsaf.js} +12 -12
  81. package/dist/cli/{worktree-isolation-c0b1h3f1.js → worktree-isolation-t3fm1c5w.js} +36 -36
  82. package/dist/config/index.d.ts +2 -2
  83. package/dist/config/schema.d.ts +22 -8
  84. package/dist/events/core-events.d.ts +2 -0
  85. package/dist/evidence/task-gate-requirements.d.ts +24 -0
  86. package/dist/gate-evidence.d.ts +12 -0
  87. package/dist/hooks/pr-workflow-gate.d.ts +22 -0
  88. package/dist/index.d.ts +8 -0
  89. package/dist/index.js +481 -469
  90. package/dist/parallel/review-router.d.ts +8 -2
  91. package/dist/pr-review/completion.d.ts +2 -1
  92. package/dist/pr-review/finding-policy.d.ts +194 -0
  93. package/dist/review/routing-enforcement.d.ts +163 -0
  94. package/dist/session/snapshot-writer.d.ts +2 -0
  95. package/dist/state.d.ts +28 -0
  96. package/dist/tools/complete-pr-workflow.d.ts +2 -1
  97. package/dist/tools/tool-metadata.d.ts +16 -16
  98. package/dist/tools/update-task-status.d.ts +0 -10
  99. package/dist/tools/write-pr-review-artifact.d.ts +7 -0
  100. package/opencode-swarm.schema.json +11 -0
  101. package/package.json +1 -1
  102. package/dist/cli/curator-llm-factory-dza1qtwr.js +0 -72
  103. package/dist/cli/guardrail-explain-s29vngen.js +0 -73
@@ -106,6 +106,8 @@ export declare const _internals: {
106
106
  readonly limits: CoreEventLimits;
107
107
  readonly emitHealth: typeof emitCoreEventsHealth;
108
108
  };
109
+ /** Canonical project-root path for the bounded core-event store. */
110
+ export declare function coreEventsFilePath(directory: string): string;
109
111
  export type CoreEventCoverage = 'complete' | 'truncated' | 'empty';
110
112
  /** The bounded view of the retained window. `text` is manifest-stripped event
111
113
  * lines in append order (possibly starting mid-line when truncated). */
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { TaskEvidence, TaskWorkflowTransitionEvent } from '../gate-evidence.js';
3
+ import type { ReviewRouteEvidence } from '../review/routing-enforcement.js';
3
4
  declare const TaskGateRequirementsReceiptSchema: z.ZodObject<{
4
5
  schemaVersion: z.ZodLiteral<1>;
5
6
  taskId: z.ZodString;
@@ -10,11 +11,34 @@ declare const TaskGateRequirementsReceiptSchema: z.ZodObject<{
10
11
  sourceEvent: z.ZodString;
11
12
  sourceTransitionId: z.ZodNullable<z.ZodString>;
12
13
  recordedAt: z.ZodString;
14
+ routeBinding: z.ZodOptional<z.ZodObject<{
15
+ role: z.ZodEnum<{
16
+ reviewer: "reviewer";
17
+ test_engineer: "test_engineer";
18
+ }>;
19
+ identity: z.ZodString;
20
+ sessionId: z.ZodString;
21
+ taskId: z.ZodString;
22
+ slotId: z.ZodString;
23
+ callId: z.ZodString;
24
+ childSessionId: z.ZodString;
25
+ generation: z.ZodNumber;
26
+ }, z.core.$strict>>;
13
27
  previousChainHash: z.ZodNullable<z.ZodString>;
14
28
  chainHash: z.ZodString;
15
29
  }, z.core.$strict>;
16
30
  export type TaskGateRequirementsReceipt = z.infer<typeof TaskGateRequirementsReceiptSchema>;
17
31
  export declare function taskGateRequirementsReceiptPath(directory: string, taskId: string): string;
18
32
  export declare function readTaskGateRequirementsReceipts(directory: string, taskId: string): Promise<TaskGateRequirementsReceipt[]>;
33
+ /** Synchronous twin used by the synchronous Stage-B and status predicates. */
34
+ export declare function readTaskGateRequirementsReceiptsSync(directory: string, taskId: string): TaskGateRequirementsReceipt[];
35
+ /**
36
+ * Reconstructs exact route evidence from the append-only durable requirement
37
+ * chain. A retry for the same call/child/generation replaces that dispatch's
38
+ * row; distinct dispatch identities retain distinct route slots.
39
+ */
40
+ export declare function routeEvidenceFromTaskGateRequirements(receipts: readonly TaskGateRequirementsReceipt[]): ReviewRouteEvidence[];
41
+ /** Positive proof that an evidence chain predates v1 route-bound receipts. */
42
+ export declare function isLegacyTaskGateRequirementsChain(receipts: readonly TaskGateRequirementsReceipt[]): boolean;
19
43
  export declare function appendTaskGateRequirementsReceiptIfNeeded(directory: string, taskId: string, current: TaskEvidence | null, next: TaskEvidence, event: TaskWorkflowTransitionEvent): Promise<void>;
20
44
  export {};
@@ -17,6 +17,7 @@
17
17
  * that requires a protected trust root outside the project workspace.
18
18
  */
19
19
  import { appendTaskGateRequirementsReceiptIfNeeded } from './evidence/task-gate-requirements.js';
20
+ import type { ReviewRouteEvidence } from './review/routing-enforcement.js';
20
21
  import type { TaskWorkflowState } from './state';
21
22
  export declare const _internals: {
22
23
  appendTaskGateRequirementsReceiptIfNeeded: typeof appendTaskGateRequirementsReceiptIfNeeded;
@@ -117,6 +118,15 @@ export type TaskWorkflowTransitionEvent = {
117
118
  type: 'stage_b_completed';
118
119
  gate: 'reviewer' | 'test_engineer';
119
120
  sessionId: string;
121
+ /** Exact v1 route tuple persisted with durable gate requirements evidence. */
122
+ routeBinding?: ReviewRouteEvidence;
123
+ /**
124
+ * The v1 route predicate evaluated over this completion's prospective
125
+ * tuple set. When false, retain the sequential intermediate state even
126
+ * though the role-level gate summary is now present; only true permits
127
+ * the durable Stage-B transition to tests_run.
128
+ */
129
+ routeComplete?: boolean;
120
130
  turbo?: boolean;
121
131
  ensureDefaultStageB?: boolean;
122
132
  expectedGeneration: number;
@@ -206,6 +216,8 @@ export declare function recordGateEvidence(directory: string, taskId: string, ga
206
216
  expectedGeneration?: number;
207
217
  transitionId?: string;
208
218
  ensureDefaultStageB?: boolean;
219
+ routeBinding?: ReviewRouteEvidence;
220
+ routeComplete?: boolean;
209
221
  }): Promise<void>;
210
222
  /**
211
223
  * Compatibility API for a settled non-gate dispatch. Coder callers represent
@@ -12,6 +12,7 @@ import { classifyPrWorkflowGitState, type PrWorkflowGitState } from '../git/pr-w
12
12
  import { type PrReviewReentryAuthorizationRecord, type PrReviewReentryBindingContext, type PrReviewReentryRole } from '../pr-review/authorization.js';
13
13
  import { classifyPrReviewCircuitSignal, type PrReviewCircuitLegacyRecord, type PrReviewCircuitRecordV2, type PrReviewResiliencePolicyRecord, resolvePrReviewResiliencePolicy } from '../pr-review/circuit.js';
14
14
  import { type PrReviewDimensionCancellationRecord, type PrReviewPartialBaseCoverageRecord, type PrReviewReportVerdict, type PrReviewTerminalCoverageSettlement } from '../pr-review/completion.js';
15
+ import { type CriticOutcome } from '../pr-review/finding-policy.js';
15
16
  import { type PrReviewComposablePhase, type PrReviewPhaseComposition, parseCriticVerdict } from '../pr-review/legacy-transcript-adapter.js';
16
17
  import { withPrWorkflowCheckoutMutationLock, workflowCheckoutMutationLockRelativePath, workflowGateStateLockRelativePath, workflowGateStateRelativePath } from '../pr-review/persistence.js';
17
18
  import { classifyLaneLivenessCondition, type EffectivePrLaneHorizon, resolveEffectivePrLaneHorizonMs } from './lane-liveness-watchdog.js';
@@ -1322,6 +1323,12 @@ export declare function markPrReviewHandoffComplete(directory: string, sessionID
1322
1323
  state: PrWorkflowGateState;
1323
1324
  alreadyOffered: boolean;
1324
1325
  }>;
1326
+ /** Read-only final finding-policy projection for completion reports. */
1327
+ export declare function readPrReviewFinalFindingPolicyForReport(directory: string, sessionID: string): Promise<{
1328
+ policyVersion: 1;
1329
+ permittedVerdicts: readonly PrReviewReportVerdict[];
1330
+ blockingFindingIds: string[];
1331
+ } | null>;
1325
1332
  export declare function transitionPrReviewToFeedback(directory: string, sessionID: string, request: {
1326
1333
  runId: string;
1327
1334
  handoffPath: string;
@@ -1682,6 +1689,12 @@ interface CandidateArtifactParseResult {
1682
1689
  declare function resolvePrReviewRowFamily(workflowLane: string | undefined, mode?: string): RowFormatFamily;
1683
1690
  declare function parseCanonicalCandidateRows(text: string, fallbackFamily: RowFormatFamily): CandidateArtifactParseResult;
1684
1691
  declare function extractCandidateIds(text: string, fallbackFamily: RowFormatFamily, scopeToLanes?: readonly string[]): string[];
1692
+ /** Read the durable critic settlement projection used by terminal readiness. */
1693
+ export declare function readAuthoritativePrReviewCriticSettlements(directory: string, sessionID: string): Promise<Array<{
1694
+ findingId: string;
1695
+ terminal: boolean;
1696
+ status: CriticOutcome;
1697
+ }>>;
1685
1698
  /**
1686
1699
  * **B1 invariant — the accounting defect class's most dangerous recurrence.**
1687
1700
  *
@@ -1708,6 +1721,15 @@ declare function extractCandidateIds(text: string, fallbackFamily: RowFormatFami
1708
1721
  * already computed: no digest resolution, no artifact reads, no subprocess work.
1709
1722
  */
1710
1723
  declare function assertSettledPhaseHasAuthoritativeVerdicts(phase: PrReviewComposablePhase, composed: Pick<PrReviewPhaseComposition, 'requiredInventory' | 'unclaimed'>, authoritative: ReadonlyMap<string, unknown>, origin: string): void;
1724
+ /**
1725
+ * Read the authenticated critic verdict map for artifact adapters. Keeping
1726
+ * this behind the same B1-guarded accessor prevents a caller-supplied policy
1727
+ * field from becoming a second authority for critic settlement.
1728
+ */
1729
+ export declare function readAuthoritativePrReviewCriticVerdicts(directory: string, sessionID: string): Promise<Map<string, {
1730
+ status: string;
1731
+ severity: string;
1732
+ }>>;
1711
1733
  interface ExpectedWorkflowLane {
1712
1734
  laneId: string;
1713
1735
  workflowLane: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Plugin } from '@opencode-ai/plugin';
2
+ import { type SoundingBoardResponse } from './agents/critic.js';
2
3
  import { loadPluginConfigWithMetaAsync } from './config';
3
4
  import { resolveAutoReviewConfig } from './config/schema';
4
5
  import { createRepoGraphBuilderHook } from './hooks';
@@ -18,6 +19,13 @@ export declare function capSessionMap<K, V>(map: Map<K, V>, max: number,
18
19
  * fresh entry can be the oldest and evict itself at the cap — mirroring
19
20
  * the stored-input-args guard). */
20
21
  justInserted?: K): void;
22
+ /**
23
+ * Apply the sounding-board response contract at the host handoff boundary.
24
+ * Missing/malformed category metadata may never preserve UNNECESSARY: the
25
+ * response is surfaced as APPROVED with an observable warning. A caller-owned
26
+ * category is passed separately so a model cannot relabel a sticky decision.
27
+ */
28
+ export declare function applySoundingBoardResponsePolicy(rawResponse: string, args?: unknown): SoundingBoardResponse | null;
21
29
  /** @internal — test-only: clears delegation-telemetry pairing state so one
22
30
  * test's unconsumed entries (e.g. a before with no matching after) cannot
23
31
  * leak into the next. Mirrors resetTelemetryForTesting / resetSwarmState. */