opencode-swarm 7.160.0 → 7.160.1

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/.opencode/skills/swarm-pr-review/SKILL.md +28 -29
  2. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +21 -5
  3. package/dist/background/pending-delegations.d.ts +46 -1
  4. package/dist/background/pr-review-contract.d.ts +245 -2
  5. package/dist/cli/{coder-settlement-zn552sp9.js → coder-settlement-678ccmnf.js} +9 -9
  6. package/dist/cli/{config-doctor-ddtdz2g0.js → config-doctor-fr8dfrt2.js} +3 -3
  7. package/dist/cli/{core-embasn2j.js → core-4j1hbhey.js} +2 -2
  8. package/dist/cli/{curation-policy-agr6ga1s.js → curation-policy-47przjwg.js} +4 -4
  9. package/dist/cli/{curator-dgp6dxxn.js → curator-85d97240.js} +31 -31
  10. package/dist/cli/{curator-llm-factory-7cwvmc46.js → curator-llm-factory-s9s4s0q3.js} +31 -31
  11. package/dist/cli/{evidence-summary-service-sbnyann4.js → evidence-summary-service-9dyt2kzh.js} +13 -13
  12. package/dist/cli/{gate-evidence-5v67a1dz.js → gate-evidence-a6paafg8.js} +5 -5
  13. package/dist/cli/{guardrail-explain-2gwarnca.js → guardrail-explain-4a2xdtew.js} +32 -32
  14. package/dist/cli/{guardrail-log-zbnbff1y.js → guardrail-log-27nkntrx.js} +7 -7
  15. package/dist/cli/{guardrail-reset-3cnz54hx.js → guardrail-reset-xn7k3hn8.js} +31 -31
  16. package/dist/cli/{hive-promoter-7cr7t2kg.js → hive-promoter-k57j3kp6.js} +31 -31
  17. package/dist/cli/{index-q6gjwy7m.js → index-497a3hhj.js} +2 -2
  18. package/dist/cli/{index-sy5aeegg.js → index-61c3d769.js} +866 -37
  19. package/dist/cli/{index-rq7k03rk.js → index-7ezv5j23.js} +1 -1
  20. package/dist/cli/{index-4mm22fzj.js → index-7h2armwf.js} +1 -1
  21. package/dist/cli/{index-1f4n43yz.js → index-7npz9n4s.js} +5 -4
  22. package/dist/cli/{index-gt8cxfbp.js → index-7v0ex0jt.js} +2 -2
  23. package/dist/cli/{index-ebz97mks.js → index-8c9qzpy7.js} +1 -0
  24. package/dist/cli/{index-5m7qjj29.js → index-98jmggma.js} +6 -6
  25. package/dist/cli/{index-cn233hsy.js → index-awjx0wgk.js} +1 -1
  26. package/dist/cli/{index-962jgzdq.js → index-bqxffayb.js} +1 -1
  27. package/dist/cli/{index-h3re5c78.js → index-c9zp4xwc.js} +12 -1
  28. package/dist/cli/{index-p39xem8b.js → index-dh5q6z7y.js} +3 -3
  29. package/dist/cli/{index-7qv869f0.js → index-dq93ar40.js} +5 -5
  30. package/dist/cli/{index-3055dgzp.js → index-drqvph47.js} +4 -4
  31. package/dist/cli/{index-jmths6jj.js → index-e1ygmd4q.js} +33 -33
  32. package/dist/cli/{index-py6bqwnb.js → index-f72612zc.js} +16 -2
  33. package/dist/cli/{index-9q6w7kke.js → index-gjx53y3c.js} +1 -1
  34. package/dist/cli/{index-xs15netk.js → index-j3ss86kf.js} +1 -1
  35. package/dist/cli/{index-kkfgygvn.js → index-jszabr0r.js} +4 -4
  36. package/dist/cli/{index-9k3zc2t8.js → index-m1cw9fsh.js} +6 -6
  37. package/dist/cli/{index-wzx6atbv.js → index-m84z3aa8.js} +3 -3
  38. package/dist/cli/{index-e75bzfgd.js → index-mmr96pwr.js} +1 -1
  39. package/dist/cli/{index-85qjc7b2.js → index-nk498mx6.js} +1 -1
  40. package/dist/cli/{index-3yh737hc.js → index-nnzdayvk.js} +6 -6
  41. package/dist/cli/{index-va1edd2n.js → index-ny0g8fdg.js} +5 -5
  42. package/dist/cli/{index-yrar1ask.js → index-pkz91fwm.js} +3 -3
  43. package/dist/cli/{index-zjvf7edj.js → index-pqjcyj0p.js} +1 -1
  44. package/dist/cli/{index-9fspg1xw.js → index-prv20xq6.js} +1 -1
  45. package/dist/cli/{index-fzkx24q5.js → index-qc53dfzh.js} +2 -2
  46. package/dist/cli/{index-8bjv01t8.js → index-v8dsmee1.js} +4 -4
  47. package/dist/cli/{index-d9s5hb0m.js → index-wccdm7jv.js} +5 -5
  48. package/dist/cli/{index-w699ekk9.js → index-z0bxbb9g.js} +2 -2
  49. package/dist/cli/{index-rnyt2z5r.js → index-zdv914xa.js} +304 -438
  50. package/dist/cli/{index-s7w428r3.js → index-znf683sm.js} +1 -1
  51. package/dist/cli/{index-rhc8jve7.js → index-zpzvpybn.js} +2 -2
  52. package/dist/cli/index.js +31 -31
  53. package/dist/cli/{knowledge-escalator-zksm9833.js → knowledge-escalator-3q2x34cg.js} +12 -12
  54. package/dist/cli/{knowledge-events-ayta750w.js → knowledge-events-5y34w84b.js} +10 -10
  55. package/dist/cli/{knowledge-link-7c7fjnzc.js → knowledge-link-xezm8hr3.js} +3 -3
  56. package/dist/cli/{knowledge-store-q5axge8b.js → knowledge-store-fqv89q5k.js} +4 -4
  57. package/dist/cli/{knowledge-validator-3rrbva2p.js → knowledge-validator-fsdx14tk.js} +6 -6
  58. package/dist/cli/{model-preflight-x9szw1v4.js → model-preflight-yqqchzjn.js} +1 -1
  59. package/dist/cli/{pending-delegations-kc7tzxg9.js → pending-delegations-6ae7wy5q.js} +5 -3
  60. package/dist/cli/{pr-review-reentry-authorization-vag5gh50.js → pr-review-reentry-authorization-986tk381.js} +33 -32
  61. package/dist/cli/{pr-subscriptions-wbdw9a82.js → pr-subscriptions-asjevc5p.js} +3 -3
  62. package/dist/cli/{runner-p9wg6z34.js → runner-wsdcy2d6.js} +4 -4
  63. package/dist/cli/{scan-cursor-4fjwtt1k.js → scan-cursor-shn926r6.js} +5 -5
  64. package/dist/cli/{schema-d0nbzj5k.js → schema-98tdb9h0.js} +4 -2
  65. package/dist/cli/{scope-persistence-bckcbc8h.js → scope-persistence-cn34xnwr.js} +8 -8
  66. package/dist/cli/{skill-generator-kebhevet.js → skill-generator-kck7087c.js} +14 -14
  67. package/dist/cli/{worktree-collision-ownership-h8qswnrp.js → worktree-collision-ownership-6b3kshcv.js} +4 -4
  68. package/dist/cli/{worktree-isolation-q0kbmadz.js → worktree-isolation-he01qhss.js} +31 -31
  69. package/dist/config/constants.d.ts +8 -0
  70. package/dist/config/evidence-schema.d.ts +3 -0
  71. package/dist/config/schema.d.ts +8 -0
  72. package/dist/hooks/pr-workflow-gate.d.ts +25 -1
  73. package/dist/index.js +124 -111
  74. package/dist/tools/dispatch-lanes.d.ts +27 -3
  75. package/dist/tools/index.d.ts +1 -0
  76. package/dist/tools/manifest.d.ts +1 -0
  77. package/dist/tools/sast-baseline.d.ts +2 -0
  78. package/dist/tools/sast-scan.d.ts +2 -2
  79. package/dist/tools/submit-pr-review-result.d.ts +5 -0
  80. package/dist/tools/tool-metadata.d.ts +8 -0
  81. package/opencode-swarm.schema.json +4 -0
  82. package/package.json +1 -1
@@ -66,12 +66,7 @@ This protocol runs on any agent harness. Before Phase 0, detect which profile
66
66
  this session is in by checking the actual tool list — never assume from the
67
67
  harness name, and never guess:
68
68
 
69
- - **Profile A — structured PR-workflow controller.** The swarm plugin's
70
- controller tools are available in this session: `dispatch_lanes_async`,
71
- `collect_lane_results`, `retrieve_lane_output`, `parse_lane_candidates`,
72
- `write_pr_review_artifact`, `write_pr_review_trigger_eval`,
73
- `complete_pr_workflow`. Typical host: OpenCode with the swarm plugin. The
74
- controller mechanically enforces this skill's accounting: it computes the
69
+ - **Profile A — structured PR-workflow controller.** The swarm plugin's controller tools are available in this session: `dispatch_lanes_async`, `collect_lane_results`, `retrieve_lane_output`, `parse_lane_candidates`, `submit_pr_review_result`, `write_pr_review_artifact`, `write_pr_review_trigger_eval`, `complete_pr_workflow`. Typical host: OpenCode with the swarm plugin. The controller mechanically enforces this skill's accounting: it computes the
75
70
  depth tier itself from the bound merge-base diff (never from caller
76
71
  claims), enforces the tier's lane floors and full dimension/family
77
72
  partitions for consolidated dispatch, and gates structured reviewer/critic
@@ -101,11 +96,19 @@ harness name, and never guess:
101
96
 
102
97
  | Harness (typical) | Profile | Lane dispatch | Ledger persistence | Completion gate |
103
98
  |---|---|---|---|---|
104
- | OpenCode + swarm plugin | A | `dispatch_lanes_async` / `collect_lane_results` | `write_pr_review_artifact`, `write_pr_review_trigger_eval` | `complete_pr_workflow` |
99
+ | OpenCode + swarm plugin | A | `dispatch_lanes_async` / `collect_lane_results` | `submit_pr_review_result`, `write_pr_review_artifact`, `write_pr_review_trigger_eval` | `complete_pr_workflow` |
105
100
  | Claude Code | B | parallel `Agent`/`Task` subagents | ledger files in the session task workspace | Pre-Synthesis Gate checklist |
106
101
  | OpenAI Codex | B | parallel subagents (fresh context) | ledger files in working notes | Pre-Synthesis Gate checklist |
107
102
  | ZCode | B | parallel subagents (fresh context) | ledger files in working notes | Pre-Synthesis Gate checklist |
108
103
 
104
+ Host-native JSON-schema transport is optional and currently unregistered on the
105
+ tested OpenCode, Claude Code, Codex, and ZCode host matrix. Profile A therefore
106
+ uses the child-bound `submit_pr_review_result` tool as its supported baseline.
107
+ Any future native integration must implement the fixed internal
108
+ `promptJsonSchema({ sessionId, agent, schema, parts })` seam and pass the
109
+ adapter-present, unsupported-before-execution, provider-failure, timeout, and
110
+ per-session capability tests before registration.
111
+
109
112
  **Completion-gate assurance is NOT equivalent across profiles.** Only Profile A
110
113
  enforces completion MECHANICALLY: the controller's `complete_pr_workflow` receipt
111
114
  gate refuses synthesis unless base coverage, the 11-family trigger ledger, and the
@@ -155,10 +158,14 @@ ordering, vocabulary, or schema.
155
158
  Controller order is exact: bind the immutable head/base range; dispatch,
156
159
  settle, and parse base lanes; evaluate every trigger row; dispatch micro lanes;
157
160
  settle and parse every matched micro family; persist the trigger evaluation;
158
- persist post-explorer findings; run reviewers; run critics; then persist the
159
- final artifact and complete the workflow. The **initial** micro dispatch MUST
160
- supply the complete trigger-evaluation ledger; that dispatch freezes it for the
161
- session.
161
+ submit exactly one `submit_pr_review_result` receipt for each base/micro
162
+ discovery lane and then stop; persist post-explorer findings; run reviewers;
163
+ run critics; then persist the final artifact and complete the workflow. Transcript
164
+ `[CANDIDATE]` / `[CLEAN]` rows are deprecated legacy compatibility only for
165
+ lanes whose snapped `pr_review_legacy_transcript_compatibility` contract
166
+ explicitly enables them.
167
+ The **initial** micro dispatch MUST supply the complete trigger-evaluation
168
+ ledger; that dispatch freezes it for the session.
162
169
  Any subsequent micro batch in that same session MAY omit `trigger_evaluation`
163
170
  and reuse the frozen ledger. If a subsequent batch explicitly supplies a copy,
164
171
  that copy MUST remain exactly identical to the frozen ledger.
@@ -1107,28 +1114,17 @@ machine-readable rows as unfenced plain text; do not emit the backticks.
1107
1114
  [CANDIDATE] | candidate_id | lane | severity | category | file:line | claim | evidence_summary | impact_context | confidence | risk_impact | risk_tags
1108
1115
  ```
1109
1116
 
1110
- Profile A stores the full assistant transcript, so earlier unmarked progress
1111
- turns may precede the machine-readable section. The parser locates that section
1112
- at the first pipe-delimited line whose first field is exactly `[CANDIDATE]` and
1113
- ignores unmarked preamble, including incidental pipe-delimited text. That first
1114
- marker is authoritative and must be the exact canonical base or micro header;
1115
- a malformed marker or marker-prefixed data row without a header fails closed.
1116
- The Profile A controller coverage gate also refuses a missing marker. The pure
1117
- parser retains markerless positional fallback only for legacy callers outside
1118
- that controller trust boundary. Explorers should continue to make the canonical
1119
- header the first line of their final machine-readable response.
1117
+ Profile A now treats `submit_pr_review_result` as the authoritative settlement path for base and micro discovery lanes. The caller-bound structured receipt dominates later prose, truncation, or transcript incompleteness. Transcript candidate/clean rows remain deprecated compatibility only when `pr_review_legacy_transcript_compatibility` was explicitly enabled for that lane and no structured receipt exists; a present-but-invalid structured result fails closed and never falls back.
1118
+
1119
+ When compatibility mode is active, Profile A stores the full assistant transcript. The parser locates the first pipe-delimited line whose first field is exactly `[CANDIDATE]`, ignores unmarked preamble, and requires the exact canonical base/micro header; malformed markers or marker-prefixed rows without a header fail closed. The controller refuses a missing marker. Markerless positional fallback remains only for legacy callers outside that trust boundary; explorers should put the canonical header first.
1120
1120
 
1121
1121
  The confidence data value must be exactly LOW, MEDIUM, or HIGH.
1122
1122
 
1123
- Under Profile A the parser normalizes this into a structured `candidates[]`
1124
- array. On Profiles B/C — and as a Profile A fallback when the parser is
1125
- unavailable — the explorer emits the `[CANDIDATE]` row format directly in the
1126
- lane output as the extraction contract.
1123
+ Under Profile A the parser-backed transcript path is compatibility-only; a successful `submit_pr_review_result` receipt is authoritative. On Profiles B/C — and on a Profile A lane whose snapped contract explicitly enables deprecated legacy transcript compatibility and lacks a structured receipt — the explorer emits `[CANDIDATE]` rows directly as the extraction contract.
1127
1124
 
1128
1125
  Explorers must not use `CONFIRMED`, `DISPROVED`, or `PRE_EXISTING`.
1129
1126
 
1130
- A base lane that finds no surviving candidates must emit exactly one fully
1131
- populated clean row:
1127
+ A base lane that finds no surviving candidates must submit exactly one structured CLEAN result and then stop. Only a lane in the deprecated transcript-compatibility path may instead emit exactly one fully populated clean row:
1132
1128
 
1133
1129
  The fence below is documentation formatting only. Emit the clean attestation
1134
1130
  as unfenced plain text; do not emit the backticks.
@@ -1225,7 +1221,10 @@ artifact; and the completed ledger is persisted as `trigger-eval.json` in the
1225
1221
  session/task workspace before reviewer dispatch. A matched family with no
1226
1222
  attestation row is an unclosed coverage gap.
1227
1223
 
1228
- For each micro `output_ref` (Profile A), call `parse_lane_candidates` with
1224
+ For each micro lane in Profile A, prefer the single structured
1225
+ `submit_pr_review_result` receipt over transcript parsing. Only for a lane
1226
+ whose snapped contract explicitly enables deprecated transcript compatibility
1227
+ and lacks a structured receipt should you fall back to `parse_lane_candidates` against its `output_ref`, with
1229
1228
  `producer: "swarm-pr-review"`, `expected_family: "micro_lane"`, and
1230
1229
  `expected_micro_lane` set to the launch-micro-lane value from the
1231
1230
  provenance-linked trigger row. When the artifact came from a consolidated
@@ -1249,7 +1248,7 @@ errors, zero malformed rows, and a complete, non-degraded source:
1249
1248
  [CLEAN] | micro_lane | coverage_scope | evidence
1250
1249
  ```
1251
1250
 
1252
- Header-only or malformed zero output is `UNATTESTED`; apply the COVERAGE GATE (Phase 3). Under Profile A, the structured async PR-workflow path is required to preserve `L1`, exact-head, batch, and workflow-lane provenance; the active controller rejects blocking and direct-Task substitutes, and Task-derived findings or CLEAN prose cannot satisfy Phase 4's controller ledger. Under Profiles B/C, acceptance is the row contract itself: accept a candidate or clean row only when its `micro_lane` field matches the trigger row it claims, and treat prose-only "clean" claims as `UNATTESTED`.
1251
+ Header-only or malformed zero output is `UNATTESTED`; apply the COVERAGE GATE (Phase 3). Under Profile A, the structured async PR-workflow path must preserve `L1`, exact-head, batch, and workflow-lane provenance; the active controller rejects blocking and direct-Task substitutes, and Task-derived findings or CLEAN prose cannot satisfy Phase 4's controller ledger unless the lane explicitly runs deprecated transcript compatibility. Under Profiles B/C, acceptance is the row contract: accept a candidate or clean row only when its `micro_lane` matches the trigger row, and treat prose-only "clean" claims as `UNATTESTED`.
1253
1252
 
1254
1253
  Each micro-lane receives:
1255
1254
 
@@ -73,6 +73,13 @@ Use this template when dispatching a base explorer:
73
73
  ```text
74
74
  You are a base explorer. Optimize for recall, not final judgment.
75
75
  Return candidates only. Do not use CONFIRMED, DISPROVED, or PRE_EXISTING.
76
+ On Profile A structured PR-review discovery lanes, call `submit_pr_review_result`
77
+ exactly once with the canonical base-lane result and then stop. Do not append
78
+ duplicate `[CANDIDATE]` / `[CLEAN]` transcript rows or recap prose after that
79
+ tool call.
80
+ The transcript rows below are deprecated legacy compatibility only. Emit them
81
+ only when the dispatched lane explicitly enables
82
+ `pr_review_legacy_transcript_compatibility`.
76
83
  Do not narrate progress or repeat the prompt. Keep the complete final response at or below 12,000 characters; spend that budget on evidence-bearing rows and the minimum prose needed to make them auditable. When the controller-appended contract declares a per-lane final_response_char_budget, that number is authoritative over this template default.
77
84
 
78
85
  Lane:
@@ -114,6 +121,13 @@ Use this template when dispatching a micro-lane or council explorer:
114
121
  ```text
115
122
  You are a micro-lane or council explorer. Optimize for recall, not final judgment.
116
123
  Return candidates only. Do not use CONFIRMED, DISPROVED, or PRE_EXISTING.
124
+ On Profile A structured PR-review discovery lanes, call `submit_pr_review_result`
125
+ exactly once with the canonical micro-lane result and then stop. Do not append
126
+ duplicate `[CANDIDATE]` / `[CLEAN]` transcript rows or recap prose after that
127
+ tool call.
128
+ The transcript rows below are deprecated legacy compatibility only. Emit them
129
+ only when the dispatched lane explicitly enables
130
+ `pr_review_legacy_transcript_compatibility`.
117
131
  Do not narrate progress or repeat the prompt. Keep the complete final response at or below 12,000 characters; spend that budget on evidence-bearing rows and the minimum prose needed to make them auditable. When the controller-appended contract declares a per-lane final_response_char_budget, that number is authoritative over this template default.
118
132
 
119
133
  Micro/council lane:
@@ -146,10 +160,12 @@ Emit the final machine-readable header and rows as unfenced plain text. The
146
160
  Markdown fence around this prompt is documentation only; do not emit backticks.
147
161
  ```
148
162
 
149
- Under Profile A the orchestrator extracts candidates from the full lane
150
- artifact via `parse_lane_candidates` as the primary mechanism. On Profiles
151
- B/C and as a Profile A fallback when the parser is unavailable — the
152
- `[CANDIDATE]` row format above IS the extraction contract. Explorers emit
153
- structured records regardless of which harness runs them.
163
+ Under Profile A the authoritative discovery-settlement path is exactly one
164
+ `submit_pr_review_result` call per base/micro lane. Transcript
165
+ `[CANDIDATE]` / `[CLEAN]` rows remain a deprecated fallback only when the
166
+ lane's snapped `pr_review_legacy_transcript_compatibility` contract enables
167
+ them and no structured receipt exists. On Profiles B/C the `[CANDIDATE]` row
168
+ format above remains the extraction contract. Explorers emit structured
169
+ records regardless of which harness runs them.
154
170
 
155
171
  Do not let speed degrade validation quality.
@@ -36,6 +36,7 @@
36
36
  * escape `.swarm/` (Invariant 4).
37
37
  */
38
38
  import { type DelegationCheckpointAuditSummary } from './delegation-health.js';
39
+ import { type PrReviewResultReceipt } from './pr-review-contract.js';
39
40
  export declare const BACKGROUND_DELEGATIONS_FILE = "background-delegations.jsonl";
40
41
  export declare const BACKGROUND_DELEGATION_FALLBACK_DIR = "background-delegation-fallback";
41
42
  export declare const BACKGROUND_CODER_RESERVATIONS_FILE = "background-coder-reservations.json";
@@ -129,7 +130,7 @@ export type SweepableDelegationStatus = 'pending' | 'running' | 'ingestion_error
129
130
  */
130
131
  export declare const DEFAULT_SWEEPABLE_DELEGATION_STATUSES: ReadonlySet<SweepableDelegationStatus>;
131
132
  export interface BackgroundDelegationRecord {
132
- schemaVersion: 1 | 2 | 3;
133
+ schemaVersion: 1 | 2 | 3 | 4;
133
134
  /** Subagent session id from the dispatch envelope — the correlation key. */
134
135
  correlationId: string;
135
136
  /** Structured jobId from dispatch metadata when available, else null. */
@@ -164,6 +165,8 @@ export interface BackgroundDelegationRecord {
164
165
  * singleton lanes (legacy and tier-L dispatches).
165
166
  */
166
167
  ownedWorkflowLanes?: string[];
168
+ /** Dispatch-time snapshot; absent legacy records keep transcript compatibility. */
169
+ prReviewLegacyTranscriptCompatibility?: boolean;
167
170
  /** Canonical hash of prompt/provenance inputs captured at dispatch time. */
168
171
  promptHash?: string;
169
172
  /** Project/root provenance captured at dispatch time. */
@@ -281,6 +284,12 @@ export interface BackgroundDelegationResult {
281
284
  outputArtifactError?: string;
282
285
  transcriptIncomplete?: boolean;
283
286
  messageCount?: number;
287
+ /**
288
+ * Issue #2384: authoritative structured PR-review result receipt. Persisted
289
+ * separately from transcript text so compaction and preview truncation can
290
+ * never promote presentation-layer text into machine authority.
291
+ */
292
+ prReviewResultReceipt?: import('./pr-review-contract.js').PrReviewResultReceipt;
284
293
  /**
285
294
  * Durable failure provenance for a lane-atomic PR-workflow terminalization.
286
295
  * Optional because successful lanes and legacy terminal results have none.
@@ -487,6 +496,7 @@ export interface RecordPendingInput {
487
496
  mode?: string;
488
497
  workflowLane?: string;
489
498
  ownedWorkflowLanes?: string[];
499
+ prReviewLegacyTranscriptCompatibility?: boolean;
490
500
  promptHash?: string;
491
501
  workspace?: BackgroundWorkspaceSnapshot;
492
502
  taskChangeContext?: BackgroundTaskChangeContext;
@@ -533,6 +543,41 @@ export declare function appendDelegationTransition(directory: string, correlatio
533
543
  completedAt?: number;
534
544
  expectedCurrentStatuses?: readonly BackgroundDelegationStatus[];
535
545
  }): Promise<BackgroundDelegationRecord | null>;
546
+ export type PublishPrReviewResultReceiptOutcome = {
547
+ status: 'recorded';
548
+ record: BackgroundDelegationRecord;
549
+ } | {
550
+ status: 'duplicate';
551
+ record: BackgroundDelegationRecord;
552
+ } | {
553
+ status: 'conflict';
554
+ reason: string;
555
+ } | {
556
+ status: 'not_found';
557
+ reason: string;
558
+ } | {
559
+ status: 'terminal';
560
+ reason: string;
561
+ } | {
562
+ status: 'uncertain';
563
+ reason: string;
564
+ };
565
+ /**
566
+ * Atomically publish the child-bound PR-review receipt while its delegation is
567
+ * still live. The workflow gate performs the outer session-state validation;
568
+ * this inner transaction rechecks immutable delegation identity under the
569
+ * evidence lock and provides semantic exactly-once behavior.
570
+ */
571
+ export declare function publishPrReviewResultReceipt(directory: string, input: {
572
+ parentSessionId: string;
573
+ childSessionId: string;
574
+ batchId: string;
575
+ laneId: string;
576
+ expectedWorkflowInstanceId: string;
577
+ expectedWorkflowRevision: number;
578
+ expectedBaseSha: string;
579
+ receipt: PrReviewResultReceipt;
580
+ }): Promise<PublishPrReviewResultReceiptOutcome>;
536
581
  export interface BuildBackgroundCompletionEventIdInput {
537
582
  correlationId: string;
538
583
  jobId: string | null;
@@ -25,6 +25,249 @@ export type PrReviewRiskImpact = (typeof PR_REVIEW_RISK_IMPACTS)[number];
25
25
  */
26
26
  export declare const PR_REVIEW_RISK_TAGS: readonly ["SECURITY", "AUTH_PERMISSIONS", "STATE_INTEGRITY", "WRITE_PATH", "EVIDENCE_INTEGRITY", "GIT", "CONFIGURATION"];
27
27
  export type PrReviewRiskTag = (typeof PR_REVIEW_RISK_TAGS)[number];
28
+ export declare const PR_REVIEW_RESULT_LANE_MODES: readonly ["swarm-pr-review:base", "swarm-pr-review:micro"];
29
+ export declare const PR_REVIEW_RESULT_OUTCOMES: readonly ["CLEAN", "FINDINGS", "INCOMPLETE"];
30
+ export declare const PR_REVIEW_RESULT_FINDING_SEVERITIES: readonly ["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"];
31
+ export declare const PR_REVIEW_RESULT_UNRESOLVED_REASONS: readonly ["NOT_EXECUTED", "PARTIAL_OUTPUT", "CONTRACT_FAILURE", "RESOURCE_LIMIT", "DEADLINE_EXCEEDED", "STALE_BINDING", "PARENT_CANCELLED"];
32
+ export declare const MAX_PR_REVIEW_RESULT_OWNED_LANES = 11;
33
+ export declare const MAX_PR_REVIEW_RESULT_FINDINGS = 256;
34
+ export declare const MAX_PR_REVIEW_RESULT_RECEIPT_BYTES: number;
35
+ export type PrReviewResultLaneMode = (typeof PR_REVIEW_RESULT_LANE_MODES)[number];
36
+ export type PrReviewResultOutcome = (typeof PR_REVIEW_RESULT_OUTCOMES)[number];
37
+ export type PrReviewResultFindingSeverity = (typeof PR_REVIEW_RESULT_FINDING_SEVERITIES)[number];
38
+ export type PrReviewResultUnresolvedReason = (typeof PR_REVIEW_RESULT_UNRESOLVED_REASONS)[number];
39
+ export declare function prReviewLegacyTranscriptCompatibilityEnabled(value: boolean | undefined): boolean;
40
+ export declare const PrReviewResultLocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
41
+ kind: z.ZodLiteral<"local">;
42
+ file: z.ZodString;
43
+ line: z.ZodOptional<z.ZodNumber>;
44
+ endLine: z.ZodOptional<z.ZodNumber>;
45
+ column: z.ZodOptional<z.ZodNumber>;
46
+ endColumn: z.ZodOptional<z.ZodNumber>;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ kind: z.ZodLiteral<"non_local">;
49
+ label: z.ZodString;
50
+ detail: z.ZodString;
51
+ }, z.core.$strict>], "kind">;
52
+ export type PrReviewResultLocation = z.infer<typeof PrReviewResultLocationSchema>;
53
+ export declare const PrReviewResultFindingSchema: z.ZodObject<{
54
+ id: z.ZodString;
55
+ workflowLane: z.ZodString;
56
+ severity: z.ZodEnum<{
57
+ CRITICAL: "CRITICAL";
58
+ HIGH: "HIGH";
59
+ MEDIUM: "MEDIUM";
60
+ LOW: "LOW";
61
+ INFO: "INFO";
62
+ }>;
63
+ riskImpact: z.ZodEnum<{
64
+ ORDINARY: "ORDINARY";
65
+ HIGH_IMPACT: "HIGH_IMPACT";
66
+ UNKNOWN: "UNKNOWN";
67
+ }>;
68
+ riskTags: z.ZodArray<z.ZodEnum<{
69
+ SECURITY: "SECURITY";
70
+ AUTH_PERMISSIONS: "AUTH_PERMISSIONS";
71
+ STATE_INTEGRITY: "STATE_INTEGRITY";
72
+ WRITE_PATH: "WRITE_PATH";
73
+ EVIDENCE_INTEGRITY: "EVIDENCE_INTEGRITY";
74
+ GIT: "GIT";
75
+ CONFIGURATION: "CONFIGURATION";
76
+ }>>;
77
+ title: z.ZodString;
78
+ body: z.ZodString;
79
+ evidence: z.ZodString;
80
+ location: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
+ kind: z.ZodLiteral<"local">;
82
+ file: z.ZodString;
83
+ line: z.ZodOptional<z.ZodNumber>;
84
+ endLine: z.ZodOptional<z.ZodNumber>;
85
+ column: z.ZodOptional<z.ZodNumber>;
86
+ endColumn: z.ZodOptional<z.ZodNumber>;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ kind: z.ZodLiteral<"non_local">;
89
+ label: z.ZodString;
90
+ detail: z.ZodString;
91
+ }, z.core.$strict>], "kind">;
92
+ }, z.core.$strict>;
93
+ export type PrReviewResultFinding = z.infer<typeof PrReviewResultFindingSchema>;
94
+ export declare const PrReviewCleanAttestationSchema: z.ZodObject<{
95
+ workflowLane: z.ZodString;
96
+ coverageScope: z.ZodString;
97
+ evidence: z.ZodString;
98
+ }, z.core.$strict>;
99
+ export type PrReviewCleanAttestation = z.infer<typeof PrReviewCleanAttestationSchema>;
100
+ export declare const PrReviewUnresolvedLaneSchema: z.ZodObject<{
101
+ workflowLane: z.ZodString;
102
+ reason: z.ZodEnum<{
103
+ NOT_EXECUTED: "NOT_EXECUTED";
104
+ PARTIAL_OUTPUT: "PARTIAL_OUTPUT";
105
+ CONTRACT_FAILURE: "CONTRACT_FAILURE";
106
+ RESOURCE_LIMIT: "RESOURCE_LIMIT";
107
+ DEADLINE_EXCEEDED: "DEADLINE_EXCEEDED";
108
+ STALE_BINDING: "STALE_BINDING";
109
+ PARENT_CANCELLED: "PARENT_CANCELLED";
110
+ }>;
111
+ detail: z.ZodString;
112
+ }, z.core.$strict>;
113
+ export type PrReviewUnresolvedLane = z.infer<typeof PrReviewUnresolvedLaneSchema>;
114
+ export declare const PrReviewLaneResultEnvelopeSchema: z.ZodObject<{
115
+ schemaVersion: z.ZodLiteral<1>;
116
+ outcome: z.ZodEnum<{
117
+ CLEAN: "CLEAN";
118
+ FINDINGS: "FINDINGS";
119
+ INCOMPLETE: "INCOMPLETE";
120
+ }>;
121
+ creditedLanes: z.ZodArray<z.ZodString>;
122
+ findings: z.ZodArray<z.ZodObject<{
123
+ id: z.ZodString;
124
+ workflowLane: z.ZodString;
125
+ severity: z.ZodEnum<{
126
+ CRITICAL: "CRITICAL";
127
+ HIGH: "HIGH";
128
+ MEDIUM: "MEDIUM";
129
+ LOW: "LOW";
130
+ INFO: "INFO";
131
+ }>;
132
+ riskImpact: z.ZodEnum<{
133
+ ORDINARY: "ORDINARY";
134
+ HIGH_IMPACT: "HIGH_IMPACT";
135
+ UNKNOWN: "UNKNOWN";
136
+ }>;
137
+ riskTags: z.ZodArray<z.ZodEnum<{
138
+ SECURITY: "SECURITY";
139
+ AUTH_PERMISSIONS: "AUTH_PERMISSIONS";
140
+ STATE_INTEGRITY: "STATE_INTEGRITY";
141
+ WRITE_PATH: "WRITE_PATH";
142
+ EVIDENCE_INTEGRITY: "EVIDENCE_INTEGRITY";
143
+ GIT: "GIT";
144
+ CONFIGURATION: "CONFIGURATION";
145
+ }>>;
146
+ title: z.ZodString;
147
+ body: z.ZodString;
148
+ evidence: z.ZodString;
149
+ location: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
+ kind: z.ZodLiteral<"local">;
151
+ file: z.ZodString;
152
+ line: z.ZodOptional<z.ZodNumber>;
153
+ endLine: z.ZodOptional<z.ZodNumber>;
154
+ column: z.ZodOptional<z.ZodNumber>;
155
+ endColumn: z.ZodOptional<z.ZodNumber>;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ kind: z.ZodLiteral<"non_local">;
158
+ label: z.ZodString;
159
+ detail: z.ZodString;
160
+ }, z.core.$strict>], "kind">;
161
+ }, z.core.$strict>>;
162
+ cleanAttestations: z.ZodArray<z.ZodObject<{
163
+ workflowLane: z.ZodString;
164
+ coverageScope: z.ZodString;
165
+ evidence: z.ZodString;
166
+ }, z.core.$strict>>;
167
+ unresolved: z.ZodArray<z.ZodObject<{
168
+ workflowLane: z.ZodString;
169
+ reason: z.ZodEnum<{
170
+ NOT_EXECUTED: "NOT_EXECUTED";
171
+ PARTIAL_OUTPUT: "PARTIAL_OUTPUT";
172
+ CONTRACT_FAILURE: "CONTRACT_FAILURE";
173
+ RESOURCE_LIMIT: "RESOURCE_LIMIT";
174
+ DEADLINE_EXCEEDED: "DEADLINE_EXCEEDED";
175
+ STALE_BINDING: "STALE_BINDING";
176
+ PARENT_CANCELLED: "PARENT_CANCELLED";
177
+ }>;
178
+ detail: z.ZodString;
179
+ }, z.core.$strict>>;
180
+ }, z.core.$strict>;
181
+ export type PrReviewLaneResultEnvelope = z.infer<typeof PrReviewLaneResultEnvelopeSchema>;
182
+ export declare function serializedPrReviewResultReceiptBytes(value: unknown): number;
183
+ export declare function prReviewLaneResultEnvelopeDigest(value: PrReviewLaneResultEnvelope): string;
184
+ export declare const PrReviewResultReceiptSchema: z.ZodObject<{
185
+ schemaVersion: z.ZodLiteral<1>;
186
+ mode: z.ZodEnum<{
187
+ "swarm-pr-review:base": "swarm-pr-review:base";
188
+ "swarm-pr-review:micro": "swarm-pr-review:micro";
189
+ }>;
190
+ workflowInstanceId: z.ZodString;
191
+ workflowRevision: z.ZodNumber;
192
+ batchId: z.ZodString;
193
+ laneId: z.ZodString;
194
+ workflowLane: z.ZodString;
195
+ ownedWorkflowLanes: z.ZodArray<z.ZodString>;
196
+ baseSha: z.ZodString;
197
+ headSha: z.ZodString;
198
+ dispatchRevisionDigest: z.ZodString;
199
+ childSessionId: z.ZodString;
200
+ generation: z.ZodNumber;
201
+ semanticEnvelopeDigest: z.ZodString;
202
+ envelope: z.ZodObject<{
203
+ schemaVersion: z.ZodLiteral<1>;
204
+ outcome: z.ZodEnum<{
205
+ CLEAN: "CLEAN";
206
+ FINDINGS: "FINDINGS";
207
+ INCOMPLETE: "INCOMPLETE";
208
+ }>;
209
+ creditedLanes: z.ZodArray<z.ZodString>;
210
+ findings: z.ZodArray<z.ZodObject<{
211
+ id: z.ZodString;
212
+ workflowLane: z.ZodString;
213
+ severity: z.ZodEnum<{
214
+ CRITICAL: "CRITICAL";
215
+ HIGH: "HIGH";
216
+ MEDIUM: "MEDIUM";
217
+ LOW: "LOW";
218
+ INFO: "INFO";
219
+ }>;
220
+ riskImpact: z.ZodEnum<{
221
+ ORDINARY: "ORDINARY";
222
+ HIGH_IMPACT: "HIGH_IMPACT";
223
+ UNKNOWN: "UNKNOWN";
224
+ }>;
225
+ riskTags: z.ZodArray<z.ZodEnum<{
226
+ SECURITY: "SECURITY";
227
+ AUTH_PERMISSIONS: "AUTH_PERMISSIONS";
228
+ STATE_INTEGRITY: "STATE_INTEGRITY";
229
+ WRITE_PATH: "WRITE_PATH";
230
+ EVIDENCE_INTEGRITY: "EVIDENCE_INTEGRITY";
231
+ GIT: "GIT";
232
+ CONFIGURATION: "CONFIGURATION";
233
+ }>>;
234
+ title: z.ZodString;
235
+ body: z.ZodString;
236
+ evidence: z.ZodString;
237
+ location: z.ZodDiscriminatedUnion<[z.ZodObject<{
238
+ kind: z.ZodLiteral<"local">;
239
+ file: z.ZodString;
240
+ line: z.ZodOptional<z.ZodNumber>;
241
+ endLine: z.ZodOptional<z.ZodNumber>;
242
+ column: z.ZodOptional<z.ZodNumber>;
243
+ endColumn: z.ZodOptional<z.ZodNumber>;
244
+ }, z.core.$strict>, z.ZodObject<{
245
+ kind: z.ZodLiteral<"non_local">;
246
+ label: z.ZodString;
247
+ detail: z.ZodString;
248
+ }, z.core.$strict>], "kind">;
249
+ }, z.core.$strict>>;
250
+ cleanAttestations: z.ZodArray<z.ZodObject<{
251
+ workflowLane: z.ZodString;
252
+ coverageScope: z.ZodString;
253
+ evidence: z.ZodString;
254
+ }, z.core.$strict>>;
255
+ unresolved: z.ZodArray<z.ZodObject<{
256
+ workflowLane: z.ZodString;
257
+ reason: z.ZodEnum<{
258
+ NOT_EXECUTED: "NOT_EXECUTED";
259
+ PARTIAL_OUTPUT: "PARTIAL_OUTPUT";
260
+ CONTRACT_FAILURE: "CONTRACT_FAILURE";
261
+ RESOURCE_LIMIT: "RESOURCE_LIMIT";
262
+ DEADLINE_EXCEEDED: "DEADLINE_EXCEEDED";
263
+ STALE_BINDING: "STALE_BINDING";
264
+ PARENT_CANCELLED: "PARENT_CANCELLED";
265
+ }>;
266
+ detail: z.ZodString;
267
+ }, z.core.$strict>>;
268
+ }, z.core.$strict>;
269
+ }, z.core.$strict>;
270
+ export type PrReviewResultReceipt = z.infer<typeof PrReviewResultReceiptSchema>;
28
271
  export declare const PR_REVIEW_CONTRACT_CARD_HEADER = "[PR-REVIEW CONTRACT CARD]";
29
272
  export declare const PR_REVIEW_FINDINGS_MAX_BYTES: number;
30
273
  export declare const PR_REVIEW_FINDINGS_WRITE_MAX_BYTES: number;
@@ -36,10 +279,10 @@ export declare const PrReviewRunIdSchema: z.ZodString;
36
279
  export declare const PrReviewFindingSchema: z.ZodObject<{
37
280
  finding_id: z.ZodString;
38
281
  status: z.ZodEnum<{
39
- PENDING: "PENDING";
40
282
  CONFIRMED: "CONFIRMED";
41
283
  DISPROVED: "DISPROVED";
42
284
  PRE_EXISTING: "PRE_EXISTING";
285
+ PENDING: "PENDING";
43
286
  }>;
44
287
  file_line: z.ZodString;
45
288
  evidence: z.ZodString;
@@ -135,10 +378,10 @@ export declare const WritePrReviewArtifactArgsSchema: z.ZodDiscriminatedUnion<[z
135
378
  records: z.ZodArray<z.ZodObject<{
136
379
  finding_id: z.ZodString;
137
380
  status: z.ZodEnum<{
138
- PENDING: "PENDING";
139
381
  CONFIRMED: "CONFIRMED";
140
382
  DISPROVED: "DISPROVED";
141
383
  PRE_EXISTING: "PRE_EXISTING";
384
+ PENDING: "PENDING";
142
385
  }>;
143
386
  file_line: z.ZodString;
144
387
  evidence: z.ZodString;
@@ -13,25 +13,25 @@ import {
13
13
  releaseCoderDispatchOwnership,
14
14
  settleCoderDispatch,
15
15
  transferCoderSettlementToBackground
16
- } from "./index-7qv869f0.js";
16
+ } from "./index-dq93ar40.js";
17
17
  import"./index-3f7hqtgg.js";
18
- import"./index-cn233hsy.js";
19
- import"./index-w699ekk9.js";
20
- import"./index-fzkx24q5.js";
18
+ import"./index-awjx0wgk.js";
19
+ import"./index-z0bxbb9g.js";
20
+ import"./index-qc53dfzh.js";
21
21
  import"./index-ddszzne4.js";
22
- import"./index-4mm22fzj.js";
22
+ import"./index-7h2armwf.js";
23
23
  import"./index-556ja8an.js";
24
24
  import"./index-dtn0pne5.js";
25
25
  import"./index-z6xqpmqg.js";
26
26
  import"./index-r3mvsbtq.js";
27
27
  import"./index-9e6fdz2h.js";
28
28
  import"./index-4rhhvd1a.js";
29
- import"./index-e75bzfgd.js";
30
- import"./index-h3re5c78.js";
29
+ import"./index-mmr96pwr.js";
30
+ import"./index-c9zp4xwc.js";
31
31
  import"./index-zjygnfay.js";
32
- import"./index-rq7k03rk.js";
32
+ import"./index-7ezv5j23.js";
33
33
  import"./index-b5adxpy6.js";
34
- import"./index-p39xem8b.js";
34
+ import"./index-dh5q6z7y.js";
35
35
  import"./index-ed5ykebp.js";
36
36
  import"./index-dke4wzkn.js";
37
37
  import"./index-7g4c7s5r.js";
@@ -12,10 +12,10 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-py6bqwnb.js";
15
+ } from "./index-f72612zc.js";
16
16
  import"./index-z6xqpmqg.js";
17
- import"./index-1f4n43yz.js";
18
- import"./index-h3re5c78.js";
17
+ import"./index-7npz9n4s.js";
18
+ import"./index-c9zp4xwc.js";
19
19
  import"./index-zjygnfay.js";
20
20
  import"./index-bk5tah7q.js";
21
21
  import"./index-bpmtbmy9.js";
@@ -14,12 +14,12 @@ import {
14
14
  resolveWorktreeBaseDir,
15
15
  shortenWorktreePath,
16
16
  writeLaneProfileToDiskReal
17
- } from "./index-fzkx24q5.js";
17
+ } from "./index-qc53dfzh.js";
18
18
  import"./index-z6xqpmqg.js";
19
19
  import"./index-r3mvsbtq.js";
20
20
  import"./index-9e6fdz2h.js";
21
21
  import"./index-4rhhvd1a.js";
22
- import"./index-h3re5c78.js";
22
+ import"./index-c9zp4xwc.js";
23
23
  import"./index-zjygnfay.js";
24
24
  import"./index-zgwm4ryv.js";
25
25
  import"./index-a76rekgs.js";
@@ -4,12 +4,12 @@ import {
4
4
  authorizeCuration,
5
5
  buildConfigFingerprintInput,
6
6
  readCohortConfigFingerprint
7
- } from "./index-s7w428r3.js";
7
+ } from "./index-znf683sm.js";
8
8
  import"./index-rtry5xyf.js";
9
- import"./index-9fspg1xw.js";
10
- import"./index-rq7k03rk.js";
9
+ import"./index-prv20xq6.js";
10
+ import"./index-7ezv5j23.js";
11
11
  import"./index-b5adxpy6.js";
12
- import"./index-p39xem8b.js";
12
+ import"./index-dh5q6z7y.js";
13
13
  import"./index-ed5ykebp.js";
14
14
  import"./index-dke4wzkn.js";
15
15
  import"./index-7g4c7s5r.js";