opencode-swarm 7.146.3 → 7.146.4

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 (65) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +27 -44
  2. package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +52 -12
  3. package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +6 -3
  4. package/.opencode/skills/swarm-pr-review/references/parser-dry-run.md +19 -1
  5. package/.opencode/skills/swarm-pr-review/references/verdict-settlement-contract.md +41 -0
  6. package/dist/background/candidate-contract.d.ts +21 -1
  7. package/dist/background/candidate-parser.d.ts +21 -1
  8. package/dist/background/pending-delegations.d.ts +8 -1
  9. package/dist/background/pr-review-collection-receipt.d.ts +70 -0
  10. package/dist/cli/{config-doctor-yd866pd5.js → config-doctor-578ebqhn.js} +2 -2
  11. package/dist/cli/{core-nc9a9g5m.js → core-2ne03a43.js} +1 -1
  12. package/dist/cli/{curation-policy-9vv7v5rf.js → curation-policy-g353f457.js} +4 -4
  13. package/dist/cli/{curator-llm-factory-ewffa8r1.js → curator-llm-factory-6hgn7p6n.js} +24 -24
  14. package/dist/cli/{curator-acp80hpc.js → curator-w52frg17.js} +24 -24
  15. package/dist/cli/{evidence-summary-service-8gw74j8g.js → evidence-summary-service-nj4p6a0d.js} +9 -9
  16. package/dist/cli/{gate-evidence-jj3zt2x1.js → gate-evidence-4vnjdh9y.js} +4 -4
  17. package/dist/cli/{guardrail-explain-50cp8k3r.js → guardrail-explain-rq01z1yz.js} +25 -25
  18. package/dist/cli/{guardrail-log-jazq10gt.js → guardrail-log-ratb651f.js} +3 -3
  19. package/dist/cli/{hive-promoter-qhrngsvb.js → hive-promoter-pbm9kee1.js} +24 -24
  20. package/dist/cli/{index-gayh8tmh.js → index-1mbdwy12.js} +1 -1
  21. package/dist/cli/{index-fypq68yn.js → index-3neh2mxk.js} +1 -1
  22. package/dist/cli/{index-4zevsvaa.js → index-5cbbtbvf.js} +3 -3
  23. package/dist/cli/{index-0a4s2803.js → index-6eycwm3v.js} +4 -4
  24. package/dist/cli/{index-1kq3x5q6.js → index-8py21zn6.js} +1 -1
  25. package/dist/cli/{index-262kyrk3.js → index-96zkay2e.js} +2 -2
  26. package/dist/cli/{index-bydybrke.js → index-bq4mvwht.js} +2 -2
  27. package/dist/cli/{index-n96nt4gb.js → index-brb64k96.js} +247 -102
  28. package/dist/cli/{index-3gagma8p.js → index-df8xj9hr.js} +1 -1
  29. package/dist/cli/{index-a7cnyp5e.js → index-dp5w9s5z.js} +5 -5
  30. package/dist/cli/{index-j2ckvbx7.js → index-f75qjtn5.js} +1 -1
  31. package/dist/cli/{index-pgsvn005.js → index-ffqdah8s.js} +5 -5
  32. package/dist/cli/{index-ypwwchs0.js → index-fp2d44f5.js} +1 -1
  33. package/dist/cli/{index-eybamsqg.js → index-g2r8nknz.js} +2 -2
  34. package/dist/cli/{index-cgcs823z.js → index-g335vrc7.js} +4 -4
  35. package/dist/cli/{index-7ph5pz77.js → index-gr3zfcsh.js} +2 -1
  36. package/dist/cli/{index-qjgg9qzs.js → index-hcb25p12.js} +1 -1
  37. package/dist/cli/{index-xz9w7sa9.js → index-hw1yghpg.js} +4 -4
  38. package/dist/cli/{index-gwt7ceh7.js → index-jgwhpza8.js} +2 -2
  39. package/dist/cli/{index-bxk21f2w.js → index-kjmcp9mf.js} +1 -1
  40. package/dist/cli/{index-923phxsp.js → index-kv2j4cnq.js} +6 -6
  41. package/dist/cli/{index-pc4423w8.js → index-p3k155dv.js} +1 -1
  42. package/dist/cli/{index-bxs4wkjf.js → index-rpy0bent.js} +177 -17
  43. package/dist/cli/{index-qqawmxe7.js → index-t798v5pq.js} +26 -26
  44. package/dist/cli/{index-463msy1e.js → index-tp5ytzzg.js} +1 -1
  45. package/dist/cli/{index-v2eevdbj.js → index-vdrwj7z0.js} +4 -4
  46. package/dist/cli/{index-yr1aabxa.js → index-wesj94x0.js} +3 -3
  47. package/dist/cli/{index-3377n9qp.js → index-xsxj4vbf.js} +1 -1
  48. package/dist/cli/index.js +24 -24
  49. package/dist/cli/{knowledge-escalator-7zpg79dx.js → knowledge-escalator-jbazxmk5.js} +9 -9
  50. package/dist/cli/{knowledge-events-8abttcnt.js → knowledge-events-jyqy3st8.js} +7 -7
  51. package/dist/cli/{knowledge-link-mgg482z6.js → knowledge-link-jkx8xjxp.js} +3 -3
  52. package/dist/cli/{knowledge-store-a5mzf986.js → knowledge-store-e2defagd.js} +4 -4
  53. package/dist/cli/{knowledge-validator-fn2myc73.js → knowledge-validator-pnmdsw2b.js} +6 -6
  54. package/dist/cli/{pending-delegations-591vme3d.js → pending-delegations-k2yqg1sj.js} +1 -1
  55. package/dist/cli/{runner-rcnpm510.js → runner-q7d22d1w.js} +4 -4
  56. package/dist/cli/{scan-cursor-4jv70zwb.js → scan-cursor-snx85enn.js} +5 -5
  57. package/dist/cli/{schema-jhz9hme9.js → schema-6rmxzg6g.js} +1 -1
  58. package/dist/cli/{scope-persistence-ykswenxj.js → scope-persistence-23cqafkx.js} +5 -5
  59. package/dist/cli/{skill-generator-k5pxb3w2.js → skill-generator-980zjk9q.js} +11 -11
  60. package/dist/cli/{worktree-collision-ownership-vt0jzmdt.js → worktree-collision-ownership-xj0bsg92.js} +1 -1
  61. package/dist/cli/{worktree-isolation-443q0pah.js → worktree-isolation-4d0nc04c.js} +24 -24
  62. package/dist/hooks/pr-workflow-gate.d.ts +58 -5
  63. package/dist/index.js +80 -77
  64. package/dist/tools/dispatch-lanes.d.ts +30 -8
  65. package/package.json +2 -1
@@ -1,6 +1,6 @@
1
1
  import * as fsp from 'node:fs/promises';
2
2
  import { z } from 'zod';
3
- import { type CandidateSeverity, type RowFormatFamily } from '../background/candidate-contract.js';
3
+ import { type CandidateSeverity, type FindingsSeverity, type RowFormatFamily } from '../background/candidate-contract.js';
4
4
  import { type LaneOutputArtifact } from '../background/lane-output-store.js';
5
5
  import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type BackgroundDelegationWorkflowLaneRecovery, findByBatchId, sweepStaleDelegations } from '../background/pending-delegations.js';
6
6
  import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-contract.js';
@@ -11,7 +11,7 @@ export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architectur
11
11
  export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: ("auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk")[];
12
12
  export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
13
13
  export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
14
- export type PrReviewLaneValidationPredicate = 'batch.validated_at' | 'batch.expected_lane_unique' | 'record.missing' | 'record.duplicate_lane' | 'record.subagent_session_id' | 'record.duplicate_subagent_session_id' | 'record.forbidden_subagent_session_id' | 'record.created_at' | 'record.workflow_lane' | 'record.owned_workflow_lanes' | 'record.mode' | 'record.pr_head_sha' | 'record.git_head' | 'record.status' | 'result.output_degraded' | 'result.transcript_incomplete' | 'result.chars' | 'result.digest' | 'result.output_ref' | 'artifact.readable' | 'artifact.ref' | 'artifact.batch_id' | 'artifact.lane_id' | 'artifact.mode' | 'artifact.session_id' | 'artifact.parent_session_id' | 'artifact.agent' | 'artifact.role' | 'artifact.source' | 'artifact.workflow_lane_record' | 'artifact.workflow_lane_expected' | 'artifact.pr_head_sha' | 'artifact.git_head' | 'artifact.revision_digest' | 'record.scope' | 'artifact.scope' | 'artifact.digest' | 'artifact.chars' | 'discovery.header' | 'discovery.row' | 'discovery.coverage' | 'discovery.duplicate_evidence';
14
+ export type PrReviewLaneValidationPredicate = 'batch.validated_at' | 'batch.expected_lane_unique' | 'record.missing' | 'record.duplicate_lane' | 'record.subagent_session_id' | 'record.duplicate_subagent_session_id' | 'record.forbidden_subagent_session_id' | 'record.created_at' | 'record.workflow_lane' | 'record.owned_workflow_lanes' | 'record.mode' | 'record.pr_head_sha' | 'record.git_head' | 'record.status' | 'result.output_degraded' | 'result.transcript_incomplete' | 'result.chars' | 'result.digest' | 'result.output_ref' | 'artifact.readable' | 'artifact.ref' | 'artifact.batch_id' | 'artifact.lane_id' | 'artifact.mode' | 'artifact.session_id' | 'artifact.parent_session_id' | 'artifact.agent' | 'artifact.role' | 'artifact.source' | 'artifact.workflow_lane_record' | 'artifact.workflow_lane_expected' | 'artifact.pr_head_sha' | 'artifact.git_head' | 'artifact.revision_digest' | 'record.scope' | 'artifact.scope' | 'artifact.digest' | 'artifact.chars' | 'discovery.header' | 'discovery.row' | 'discovery.coverage' | 'discovery.duplicate_evidence' | 'reviewer.verdict_rows' | 'critic.verdict_rows';
15
15
  export interface PrReviewLaneValidationFailure {
16
16
  predicate: PrReviewLaneValidationPredicate;
17
17
  expected: string;
@@ -54,12 +54,20 @@ export interface PrWorkflowTransportRecoveryValidationInput {
54
54
  artifact: LaneOutputArtifact | null;
55
55
  revisionDigest: string;
56
56
  }
57
+ export interface PrReviewVerdictCollectionReceipt {
58
+ assignedReviewItemIds: string[];
59
+ acceptedReviewItemIds: string[];
60
+ rejectedReviewItemIds: string[];
61
+ }
57
62
  export type PrWorkflowTransportRecoveryValidationResult = {
58
63
  ok: true;
59
64
  recoveries?: readonly BackgroundDelegationWorkflowLaneRecovery[];
65
+ receipt?: PrReviewVerdictCollectionReceipt;
60
66
  } | {
61
67
  ok: false;
62
68
  reason: string;
69
+ failure?: PrReviewLaneValidationFailure;
70
+ receipt?: PrReviewVerdictCollectionReceipt;
63
71
  };
64
72
  export interface PrWorkflowCheckoutRecoveryRecord {
65
73
  code: 'UNMERGED_INDEX' | 'GIT_OPERATION_IN_PROGRESS' | 'DIRTY_SUBMODULE' | 'SWARM_STATE_TRACKING_ERROR' | 'GIT_STATE_INDETERMINATE';
@@ -258,7 +266,14 @@ type PrReviewArtifactRecord = {
258
266
  finding_id: string;
259
267
  status: 'PENDING' | 'CONFIRMED' | 'DISPROVED' | 'PRE_EXISTING';
260
268
  next_action: 'route_to_reviewer' | 'route_to_critic' | 'report' | 'suppress_with_reason' | 'handoff_to_feedback';
261
- severity?: CandidateSeverity;
269
+ /**
270
+ * Optional in the TYPE only so a legacy findings row persisted before
271
+ * required-severity landed still loads (`readFindings` JSON-parses without
272
+ * re-validating). Presence is REQUIRED by
273
+ * `assertPrReviewArtifactRecordsMatchAuthoritativeVerdicts`, which treats an
274
+ * omitted severity as a mismatch rather than skipping the check (issue #2279).
275
+ */
276
+ severity?: FindingsSeverity;
262
277
  };
263
278
  interface PrFeedbackScopeDeclarationRecord {
264
279
  taskId: string;
@@ -292,8 +307,9 @@ interface PrReviewValidationBatchRecord {
292
307
  interface PrReviewBatchCoherenceRecord {
293
308
  /**
294
309
  * The exact candidate/critic inventory this batch's ownership was validated
295
- * against at record time (the same set `assertExactStringSet` compared the
296
- * declared lane items to).
310
+ * against at record time. A batch may own a subset of this inventory; retaining
311
+ * the full set here prevents stale partial batches from contributing after the
312
+ * mechanically derived inventory changes.
297
313
  */
298
314
  validatedInventory: string[];
299
315
  /**
@@ -305,6 +321,8 @@ interface PrReviewBatchCoherenceRecord {
305
321
  * claims it invalidated and leaves its siblings intact.
306
322
  */
307
323
  reviewerItemBindings?: Record<string, string>;
324
+ /** Key encoding for reviewerItemBindings; absent means legacy raw item IDs. */
325
+ reviewerItemBindingKeyEncoding?: 'prefixed-v1';
308
326
  }
309
327
  export interface PrWorkflowGateState {
310
328
  schemaVersion: 1;
@@ -888,6 +906,12 @@ export declare const _test_exports: {
888
906
  resolveRemoteRefsContainingHead: typeof resolveRemoteRefsContainingHead;
889
907
  resolveRemoteRefsContainingHeadAsync: typeof resolveRemoteRefsContainingHeadAsync;
890
908
  parseCriticVerdict: typeof parseCriticVerdict;
909
+ /**
910
+ * Exact production verdict-row analysis and item composition parsers. Exposed
911
+ * so the assignment-boundary regression can prove both paths remain linear.
912
+ */
913
+ analyzePrReviewVerdictRowContract: typeof analyzePrReviewVerdictRowContract;
914
+ parseLaneItemVerdicts: typeof parseLaneItemVerdicts;
891
915
  /**
892
916
  * Read-only view of the item-keyed composition for one session, including
893
917
  * the diagnostics that settlement only logs (abandoned declared lanes,
@@ -994,6 +1018,12 @@ interface PrReviewGateContext {
994
1018
  reviewer?: PrReviewPhaseComposition;
995
1019
  critic?: PrReviewPhaseComposition;
996
1020
  candidateInventory?: string[];
1021
+ /**
1022
+ * candidate_id -> the severity its `[CANDIDATE]` row declared. Populated
1023
+ * as a by-product of deriving the inventory, so it is exactly as
1024
+ * authoritative and as scoped as the inventory itself (issue #2320).
1025
+ */
1026
+ candidateSeverities?: Map<string, CandidateSeverity>;
997
1027
  }
998
1028
  /**
999
1029
  * Extract candidate ids from a discovery artifact's [CANDIDATE] rows. When
@@ -1006,6 +1036,13 @@ interface PrReviewGateContext {
1006
1036
  interface CanonicalCandidateArtifactRow {
1007
1037
  candidateId: string;
1008
1038
  workflowLane: string;
1039
+ /**
1040
+ * The row's declared severity, already validated against
1041
+ * `CANDIDATE_SEVERITIES` by `analyzeCandidateFields` (so never `NONE`).
1042
+ * Carried so the `post_explorer` findings boundary can compare a record's
1043
+ * severity against the candidate row that produced it (issue #2320).
1044
+ */
1045
+ severity: CandidateSeverity | null;
1009
1046
  evidence: string;
1010
1047
  lineNumber: number;
1011
1048
  }
@@ -1133,6 +1170,22 @@ export declare function prReviewDiscoveryArtifactCoversLane(text: string, expect
1133
1170
  * `pipeFields` can never produce, so no field boundary is forgeable.
1134
1171
  */
1135
1172
  declare function reviewerVerdictRowDigest(fields: readonly string[]): string;
1173
+ /**
1174
+ * Per-item verdicts an artifact actually carries, as a map rather than a
1175
+ * boolean. This is the granularity the composition needs: one unparseable item
1176
+ * must not discard its healthy siblings in the same lane.
1177
+ */
1178
+ declare function parseLaneItemVerdicts(text: string, itemIds: readonly string[], phase: PrReviewComposablePhase, reviewerClaims?: ReadonlyMap<string, PrReviewItemClaim>): Map<string, {
1179
+ classification: string;
1180
+ severity: string;
1181
+ rowDigest?: string;
1182
+ }>;
1183
+ /** Exact assigned-row contract used by both normal and recovered collection. */
1184
+ declare function analyzePrReviewVerdictRowContract(text: string, itemIds: readonly string[], phase: PrReviewComposablePhase, reviewerClaims?: ReadonlyMap<string, PrReviewItemClaim>): {
1185
+ ok: boolean;
1186
+ expected: string;
1187
+ actual: string;
1188
+ };
1136
1189
  declare function parseCriticVerdict(text: string, itemId: string, reviewerSeverity?: string): {
1137
1190
  status: string;
1138
1191
  severity: string;