opencode-swarm 7.146.3 → 7.146.5

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-28e6h9ex.js} +2 -2
  11. package/dist/cli/{core-nc9a9g5m.js → core-n57ssze0.js} +1 -1
  12. package/dist/cli/{curation-policy-9vv7v5rf.js → curation-policy-g353f457.js} +4 -4
  13. package/dist/cli/{curator-acp80hpc.js → curator-e6p9vysv.js} +24 -24
  14. package/dist/cli/{curator-llm-factory-ewffa8r1.js → curator-llm-factory-bzvv3grb.js} +24 -24
  15. package/dist/cli/{evidence-summary-service-8gw74j8g.js → evidence-summary-service-b2xp0m26.js} +9 -9
  16. package/dist/cli/{gate-evidence-jj3zt2x1.js → gate-evidence-fmbx6hp1.js} +4 -4
  17. package/dist/cli/{guardrail-explain-50cp8k3r.js → guardrail-explain-g1nqbz0j.js} +25 -25
  18. package/dist/cli/{guardrail-log-jazq10gt.js → guardrail-log-1bbg0vx4.js} +3 -3
  19. package/dist/cli/{hive-promoter-qhrngsvb.js → hive-promoter-trew6apr.js} +24 -24
  20. package/dist/cli/{index-0a4s2803.js → index-0pya01vw.js} +4 -4
  21. package/dist/cli/{index-gwt7ceh7.js → index-52460nma.js} +2 -2
  22. package/dist/cli/{index-cgcs823z.js → index-53asfj0j.js} +4 -4
  23. package/dist/cli/{index-pgsvn005.js → index-55g08cg2.js} +5 -5
  24. package/dist/cli/{index-ypwwchs0.js → index-7pggq9ys.js} +1 -1
  25. package/dist/cli/{index-1kq3x5q6.js → index-8py21zn6.js} +1 -1
  26. package/dist/cli/{index-4zevsvaa.js → index-aybph866.js} +3 -3
  27. package/dist/cli/{index-a7cnyp5e.js → index-cp8jp4cv.js} +5 -5
  28. package/dist/cli/{index-bxk21f2w.js → index-cpzra8my.js} +1 -1
  29. package/dist/cli/{index-bydybrke.js → index-cyxdm0v3.js} +2 -2
  30. package/dist/cli/{index-gayh8tmh.js → index-d3t7q4b8.js} +1 -1
  31. package/dist/cli/{index-j2ckvbx7.js → index-f75qjtn5.js} +1 -1
  32. package/dist/cli/{index-3377n9qp.js → index-fjhc8mk2.js} +1 -1
  33. package/dist/cli/{index-v2eevdbj.js → index-fymrwjak.js} +4 -4
  34. package/dist/cli/{index-fypq68yn.js → index-gqx0rq53.js} +1 -1
  35. package/dist/cli/{index-qjgg9qzs.js → index-hcb25p12.js} +1 -1
  36. package/dist/cli/{index-3gagma8p.js → index-hn0hvgtt.js} +1 -1
  37. package/dist/cli/{index-xz9w7sa9.js → index-hw1yghpg.js} +4 -4
  38. package/dist/cli/{index-eybamsqg.js → index-ktpj357z.js} +2 -2
  39. package/dist/cli/{index-n96nt4gb.js → index-npw2xm46.js} +247 -102
  40. package/dist/cli/{index-pc4423w8.js → index-p3k155dv.js} +1 -1
  41. package/dist/cli/{index-yr1aabxa.js → index-p4ar0k0n.js} +3 -3
  42. package/dist/cli/{index-bxs4wkjf.js → index-rpy0bent.js} +177 -17
  43. package/dist/cli/{index-7ph5pz77.js → index-rqgnad5w.js} +2 -1
  44. package/dist/cli/{index-463msy1e.js → index-tp5ytzzg.js} +1 -1
  45. package/dist/cli/{index-262kyrk3.js → index-vjkfhqef.js} +2 -2
  46. package/dist/cli/{index-qqawmxe7.js → index-ymyv4d36.js} +26 -26
  47. package/dist/cli/{index-923phxsp.js → index-zqmzn9hk.js} +6 -6
  48. package/dist/cli/index.js +24 -24
  49. package/dist/cli/{knowledge-escalator-7zpg79dx.js → knowledge-escalator-dyrrftth.js} +9 -9
  50. package/dist/cli/{knowledge-events-8abttcnt.js → knowledge-events-hqrwgn29.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-fn7whe2j.js} +4 -4
  53. package/dist/cli/{knowledge-validator-fn2myc73.js → knowledge-validator-6zb1j8c4.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-m04qgx82.js} +5 -5
  57. package/dist/cli/{schema-jhz9hme9.js → schema-40w13gdv.js} +1 -1
  58. package/dist/cli/{scope-persistence-ykswenxj.js → scope-persistence-fz2r889v.js} +5 -5
  59. package/dist/cli/{skill-generator-k5pxb3w2.js → skill-generator-413k36q9.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-50afhbga.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
@@ -6,16 +6,16 @@ import {
6
6
  resolveExecutableFromPath,
7
7
  runEvaluation,
8
8
  runExternalTool
9
- } from "./index-qjgg9qzs.js";
9
+ } from "./index-hcb25p12.js";
10
10
  import {
11
11
  stableCanonicalStringify
12
- } from "./index-3377n9qp.js";
12
+ } from "./index-fjhc8mk2.js";
13
13
  import {
14
14
  detectStraySwarmDirs,
15
15
  readDoctorArtifact,
16
16
  removeStraySwarmDir,
17
17
  runConfigDoctor
18
- } from "./index-gayh8tmh.js";
18
+ } from "./index-d3t7q4b8.js";
19
19
  import {
20
20
  MAX_TRANSIENT_RETRIES,
21
21
  archiveEvidence,
@@ -61,7 +61,7 @@ import {
61
61
  updateTaskStatus,
62
62
  validateProjectRoot,
63
63
  validateSymlinkBoundary
64
- } from "./index-0a4s2803.js";
64
+ } from "./index-0pya01vw.js";
65
65
  import {
66
66
  EvaluationTaskV1Schema,
67
67
  GateAuditManifestV1Schema,
@@ -78,7 +78,7 @@ import {
78
78
  saveGateAuditResult,
79
79
  savePromotionDecision,
80
80
  saveTaskSetSnapshot
81
- } from "./index-pc4423w8.js";
81
+ } from "./index-p3k155dv.js";
82
82
  import {
83
83
  loadDatabaseCtor
84
84
  } from "./index-134d35c1.js";
@@ -104,12 +104,12 @@ import {
104
104
  } from "./index-y8552snf.js";
105
105
  import {
106
106
  readRecentEscalations
107
- } from "./index-pgsvn005.js";
107
+ } from "./index-55g08cg2.js";
108
108
  import {
109
109
  alreadyCuratedThisGeneration,
110
110
  claimNextScanBatch,
111
111
  resolveCohortId
112
- } from "./index-eybamsqg.js";
112
+ } from "./index-ktpj357z.js";
113
113
  import {
114
114
  CURATOR_INIT_PROMPT,
115
115
  CURATOR_PHASE_PROMPT,
@@ -179,7 +179,7 @@ import {
179
179
  retireSkill,
180
180
  selectCandidateEntries,
181
181
  syncBundledProjectSkillsIfMissingAsync
182
- } from "./index-v2eevdbj.js";
182
+ } from "./index-fymrwjak.js";
183
183
  import {
184
184
  appendUnactionable,
185
185
  quarantineEntry,
@@ -190,11 +190,11 @@ import {
190
190
  validateActionableFields,
191
191
  validateLesson,
192
192
  validateSkillPath
193
- } from "./index-cgcs823z.js";
193
+ } from "./index-53asfj0j.js";
194
194
  import {
195
195
  authorizeCuration,
196
196
  buildConfigFingerprintInput
197
- } from "./index-463msy1e.js";
197
+ } from "./index-tp5ytzzg.js";
198
198
  import {
199
199
  cohortConfigFingerprint
200
200
  } from "./index-rtry5xyf.js";
@@ -208,12 +208,13 @@ import {
208
208
  DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
209
209
  DELEGATION_COMPACTION_HIGH_WATER_BYTES,
210
210
  DELEGATION_COMPACTION_LOW_WATER_BYTES,
211
+ MAX_PR_REVIEW_COLLECTION_RECEIPT_ITEM_IDS,
211
212
  MAX_RECOVERY_LEDGER_BYTES,
212
213
  collectDelegationLedgerHealth,
213
214
  findByBatchId,
214
215
  readDelegations,
215
216
  sweepStaleDelegations
216
- } from "./index-bxs4wkjf.js";
217
+ } from "./index-rpy0bent.js";
217
218
  import {
218
219
  WORKTREE_LIFECYCLE_LOCK_FILE,
219
220
  recordWorktreeProvisioningOwner,
@@ -246,18 +247,18 @@ import {
246
247
  transitionTaskWorkflowEvidence,
247
248
  withTaskEvidenceTransaction,
248
249
  writeWorkflowWalFile
249
- } from "./index-262kyrk3.js";
250
+ } from "./index-vjkfhqef.js";
250
251
  import {
251
252
  provisionWorktree,
252
253
  removeWorktree
253
- } from "./index-bxk21f2w.js";
254
+ } from "./index-cpzra8my.js";
254
255
  import {
255
256
  MAX_PENDING_SCOPE_BINDINGS,
256
257
  canonicalWorkspaceIdentity,
257
258
  clearAllScopes,
258
259
  clearScopeBindingFromDisk,
259
260
  clearScopeBindings
260
- } from "./index-yr1aabxa.js";
261
+ } from "./index-p4ar0k0n.js";
261
262
  import {
262
263
  appendLedgerEvent,
263
264
  computePlanHash,
@@ -272,7 +273,7 @@ import {
272
273
  readPlanEpochIdentity,
273
274
  replayFromLedgerWithStatus,
274
275
  takeSnapshotEvent
275
- } from "./index-3gagma8p.js";
276
+ } from "./index-hn0hvgtt.js";
276
277
  import {
277
278
  isPathWithinDeclaredScope,
278
279
  sanitizeDiagnosticText
@@ -323,7 +324,7 @@ import {
323
324
  transactFile,
324
325
  transactKnowledge,
325
326
  wordBigrams
326
- } from "./index-923phxsp.js";
327
+ } from "./index-zqmzn9hk.js";
327
328
  import {
328
329
  MAX_EVENT_LOG_ENTRIES,
329
330
  _internals as _internals2,
@@ -337,10 +338,10 @@ import {
337
338
  recordKnowledgeEvent,
338
339
  recordPhaseCloseIntent,
339
340
  resolveKnowledgeEventsPath
340
- } from "./index-a7cnyp5e.js";
341
+ } from "./index-cp8jp4cv.js";
341
342
  import {
342
343
  resolveWorktreeIsolationConfig
343
- } from "./index-bydybrke.js";
344
+ } from "./index-cyxdm0v3.js";
344
345
  import {
345
346
  RetrospectiveEvidenceSchema
346
347
  } from "./index-gprxjmm7.js";
@@ -350,7 +351,7 @@ import {
350
351
  init_loader,
351
352
  loadPluginConfig,
352
353
  loadPluginConfigWithMeta
353
- } from "./index-fypq68yn.js";
354
+ } from "./index-gqx0rq53.js";
354
355
  import {
355
356
  DEFAULT_SKILL_OPT_CONFIG,
356
357
  FALLBACK_MODELS_MAX,
@@ -364,7 +365,7 @@ import {
364
365
  package_default,
365
366
  resolveAutoReviewConfig,
366
367
  stripKnownSwarmPrefix
367
- } from "./index-7ph5pz77.js";
368
+ } from "./index-rqgnad5w.js";
368
369
  import {
369
370
  AGENT_TOOL_MAP,
370
371
  ALL_AGENT_NAMES,
@@ -415,10 +416,10 @@ import {
415
416
  resolveLinkDir,
416
417
  sanitizeLinkId,
417
418
  writeLinkPointer
418
- } from "./index-j2ckvbx7.js";
419
+ } from "./index-f75qjtn5.js";
419
420
  import {
420
421
  atomicWriteFile
421
- } from "./index-1kq3x5q6.js";
422
+ } from "./index-8py21zn6.js";
422
423
  import {
423
424
  KNOWLEDGE_SCHEMA_VERSION,
424
425
  OUTCOME_BLOCK_THRESHOLD,
@@ -430,7 +431,7 @@ import {
430
431
  atomicWriteSwarmFileSync,
431
432
  matchTempGrammar,
432
433
  parseTargetBasename
433
- } from "./index-xz9w7sa9.js";
434
+ } from "./index-hw1yghpg.js";
434
435
  import {
435
436
  assertProjectRoot,
436
437
  hasExplicitProjectBoundary,
@@ -4285,7 +4286,7 @@ async function cleanupRecoveredWorktree(directory, descriptor) {
4285
4286
  awaitingMergeByCallID,
4286
4287
  cleanupStandardWorktreeForCallId,
4287
4288
  standardWorktreeByCallID
4288
- } = await import("./worktree-isolation-443q0pah.js");
4289
+ } = await import("./worktree-isolation-50afhbga.js");
4289
4290
  standardWorktreeByCallID.delete(descriptor.callID);
4290
4291
  if (hasResidue)
4291
4292
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -4387,7 +4388,7 @@ async function recoverCoderSettlement(directory, taskId) {
4387
4388
  awaitingMergeByCallID,
4388
4389
  finishStandardWorktreeDispatch,
4389
4390
  standardWorktreeByCallID
4390
- } = await import("./worktree-isolation-443q0pah.js");
4391
+ } = await import("./worktree-isolation-50afhbga.js");
4391
4392
  const descriptor = wal.worktree;
4392
4393
  const reconstructedDispatch = {
4393
4394
  callID: descriptor.callID,
@@ -5063,6 +5064,7 @@ var CANDIDATE_SEVERITIES = [
5063
5064
  "HIGH",
5064
5065
  "CRITICAL"
5065
5066
  ];
5067
+ var FINDINGS_SEVERITIES = [...CANDIDATE_SEVERITIES, "NONE"];
5066
5068
  var CANDIDATE_CONFIDENCES = ["HIGH", "MEDIUM", "LOW"];
5067
5069
  var CANDIDATE_FIELD_COUNT = 9;
5068
5070
  var CLEAN_FIELD_COUNT = 4;
@@ -5231,6 +5233,38 @@ function repairRedundantCleanConfidence(text, family) {
5231
5233
  `), repaired };
5232
5234
  }
5233
5235
  var NON_CONTRACT_MARKER_LINE = /^\[(?!(?:CANDIDATE|CLEAN)\])[A-Z][A-Z0-9_-]*\]/;
5236
+ function canonicalHeaderShape(line) {
5237
+ const fields = splitPipeFields(line.trim()).map((field) => field.trim());
5238
+ if (fields.length === 0)
5239
+ return null;
5240
+ if (candidateHeaderFamily(fields))
5241
+ return { markerBearing: true };
5242
+ for (const family of ["base_explorer", "micro_lane"]) {
5243
+ const canonical = CANDIDATE_FIELDS[family].map((name) => name === "file_line" ? "file:line" : name);
5244
+ if (fields.length === canonical.length && canonical.every((name, index) => fields[index] === name)) {
5245
+ return { markerBearing: false };
5246
+ }
5247
+ }
5248
+ return null;
5249
+ }
5250
+ function dropDuplicateHeaderRows(text) {
5251
+ const lines = text.split(/\r?\n/);
5252
+ const shapes = lines.map((line) => line.includes("|") ? canonicalHeaderShape(line) : null);
5253
+ const keepIndex = (() => {
5254
+ const markerBearing = shapes.findIndex((shape) => shape?.markerBearing);
5255
+ if (markerBearing !== -1)
5256
+ return markerBearing;
5257
+ return shapes.findIndex((shape) => shape !== null);
5258
+ })();
5259
+ if (keepIndex === -1)
5260
+ return { text, dropped: false };
5261
+ const kept = lines.filter((_line, index) => shapes[index] === null || index === keepIndex);
5262
+ return {
5263
+ text: kept.join(`
5264
+ `),
5265
+ dropped: kept.length !== lines.length
5266
+ };
5267
+ }
5234
5268
  function dropNonContractMarkerRows(text) {
5235
5269
  const lines = text.split(/\r?\n/);
5236
5270
  const kept = lines.filter((line) => {
@@ -5345,7 +5379,11 @@ function normalizeCandidateArtifact(rawText, fallbackFamily) {
5345
5379
  const pipeRepair = repairCleanEvidencePipes(cleanRepair.text);
5346
5380
  if (pipeRepair.repaired)
5347
5381
  repairKinds.push("clean-evidence-pipe-tail-merge");
5348
- const text = pipeRepair.text;
5382
+ const duplicateHeaderDrop = dropDuplicateHeaderRows(pipeRepair.text);
5383
+ if (duplicateHeaderDrop.dropped) {
5384
+ repairKinds.push("duplicate-header-row-dropped");
5385
+ }
5386
+ const text = duplicateHeaderDrop.text;
5349
5387
  const header = selectCandidateHeader(text.split(/\r?\n/));
5350
5388
  if (header?.markerBearing && header.family !== null) {
5351
5389
  return { text, synthesizedHeader: false, repairKinds };
@@ -5923,6 +5961,7 @@ function parseText(input, flags) {
5923
5961
  let pendingClean;
5924
5962
  let cleanErrorCode;
5925
5963
  let cleanErrorMessage;
5964
+ let cleanSalvageReason;
5926
5965
  for (let i = headerIndex + 1;i < lines.length; i++) {
5927
5966
  const rawLine = lines[i];
5928
5967
  const trimmed = rawLine.trim();
@@ -6170,19 +6209,13 @@ ${trimmed}`;
6170
6209
  }
6171
6210
  }
6172
6211
  const pendingCleanLane = pendingClean ? pendingClean.row_format_family === "base_explorer" ? pendingClean.lane : pendingClean.micro_lane : null;
6173
- if (pendingClean && pendingCleanLane !== null) {
6212
+ if (pendingClean && pendingCleanLane !== null && !cleanErrorCode) {
6174
6213
  const conflictingCandidate = candidates.find((candidate) => (candidate.lane ?? candidate.micro_lane) === pendingCleanLane);
6175
6214
  if (conflictingCandidate) {
6176
- cleanErrorCode = "conflicting-clean-attestation";
6177
- cleanErrorMessage = `CLEAN attestation cannot appear with candidate rows for the same lane (${pendingCleanLane})`;
6178
- parseErrorDetails.push({
6179
- row_index: headerIndex,
6180
- field: "clean_attestation",
6181
- message: cleanErrorMessage
6182
- });
6215
+ cleanSalvageReason = `CLEAN attestation discredited: it cannot appear with candidate rows for the same lane (${pendingCleanLane}); the candidate rows were retained`;
6183
6216
  }
6184
6217
  }
6185
- if (pendingClean && !cleanErrorCode && (malformedRows > 0 || parseErrorDetails.length > 0)) {
6218
+ if (pendingClean && !cleanErrorCode && !cleanSalvageReason && (malformedRows > 0 || parseErrorDetails.length > 0)) {
6186
6219
  cleanErrorCode = "untrusted-clean-attestation";
6187
6220
  cleanErrorMessage = "CLEAN attestation requires zero malformed rows and zero parse errors";
6188
6221
  parseErrorDetails.push({
@@ -6191,7 +6224,7 @@ ${trimmed}`;
6191
6224
  message: cleanErrorMessage
6192
6225
  });
6193
6226
  }
6194
- const cleanAttestation = pendingClean && !cleanErrorCode ? pendingClean : undefined;
6227
+ const cleanAttestation = pendingClean && !cleanErrorCode && !cleanSalvageReason ? pendingClean : undefined;
6195
6228
  if (cleanAttestation) {
6196
6229
  formatFamiliesDetected.add(cleanAttestation.row_format_family);
6197
6230
  }
@@ -6221,6 +6254,10 @@ ${trimmed}`;
6221
6254
  error: cleanErrorMessage ?? "Invalid CLEAN attestation",
6222
6255
  error_code: cleanErrorCode
6223
6256
  } : {},
6257
+ ...cleanSalvageReason ? {
6258
+ clean_attestation_salvaged: true,
6259
+ clean_attestation_salvage_reason: cleanSalvageReason
6260
+ } : {},
6224
6261
  candidates: acceptedCandidates,
6225
6262
  ...cleanAttestation ? { clean_attestation: cleanAttestation } : {},
6226
6263
  invocation_envelope: envelope,
@@ -7057,13 +7094,14 @@ var PrReviewValidationBatchRecordSchema = exports_external.object({
7057
7094
  lanes: exports_external.array(exports_external.object({
7058
7095
  laneId: exports_external.string().min(1),
7059
7096
  workflowLane: exports_external.string().min(1),
7060
- reviewItemIds: exports_external.array(exports_external.string().min(1)).min(1).optional()
7097
+ reviewItemIds: exports_external.array(exports_external.string().min(1)).min(1).max(MAX_PR_REVIEW_COLLECTION_RECEIPT_ITEM_IDS).optional()
7061
7098
  }).strict()).min(1),
7062
7099
  validatedAt: exports_external.string().min(1)
7063
7100
  }).strict();
7064
7101
  var PrReviewBatchCoherenceRecordSchema = exports_external.object({
7065
7102
  validatedInventory: exports_external.array(exports_external.string().min(1)),
7066
- reviewerItemBindings: exports_external.record(exports_external.string().min(1), exports_external.string().regex(/^[0-9a-f]{64}$/)).optional()
7103
+ reviewerItemBindings: exports_external.record(exports_external.string().min(1), exports_external.string().regex(/^[0-9a-f]{64}$/)).optional(),
7104
+ reviewerItemBindingKeyEncoding: exports_external.literal("prefixed-v1").optional()
7067
7105
  }).passthrough();
7068
7106
  var PrFeedbackScopeDeclarationRecordSchema = exports_external.object({
7069
7107
  taskId: exports_external.string().regex(/^\d+\.\d+(?:\.\d+)*$/),
@@ -8155,6 +8193,8 @@ var _test_exports = {
8155
8193
  resolveRemoteRefsContainingHead,
8156
8194
  resolveRemoteRefsContainingHeadAsync,
8157
8195
  parseCriticVerdict,
8196
+ analyzePrReviewVerdictRowContract,
8197
+ parseLaneItemVerdicts,
8158
8198
  composePrReviewPhaseVerdicts: async (directory, sessionID, phase) => {
8159
8199
  const state = await requireBoundState(directory, sessionID, "PR_REVIEW");
8160
8200
  const ctx = await createPrReviewGateContext(directory, state);
@@ -8431,6 +8471,7 @@ function sameStringSet(left, right) {
8431
8471
  const rightSet = new Set(right);
8432
8472
  return leftSet.size === rightSet.size && [...leftSet].every((v) => rightSet.has(v));
8433
8473
  }
8474
+ var PR_REVIEW_CLEAN_SENTINEL_ID = "CLEAN-REVIEW";
8434
8475
  function derivePrReviewCandidateInventory(directory, state, ctx) {
8435
8476
  if (ctx.candidateInventory)
8436
8477
  return ctx.candidateInventory;
@@ -8533,6 +8574,7 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
8533
8574
  }
8534
8575
  }
8535
8576
  const candidateIds = [];
8577
+ const candidateSeverities = new Map;
8536
8578
  const extractedLaneKeys = new Set;
8537
8579
  for (const source of sources) {
8538
8580
  let resolvedArtifact = false;
@@ -8552,7 +8594,13 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
8552
8594
  const laneKey = `${source.batchId}\x00${source.laneId}`;
8553
8595
  if (!extractedLaneKeys.has(laneKey)) {
8554
8596
  extractedLaneKeys.add(laneKey);
8555
- candidateIds.push(...extractCandidateIds(artifact.text, resolvePrReviewRowFamily(source.workflowLane, source.mode), source.creditedLanes));
8597
+ const extracted = extractCandidateRows(artifact.text, resolvePrReviewRowFamily(source.workflowLane, source.mode), source.creditedLanes);
8598
+ for (const row of extracted) {
8599
+ candidateIds.push(row.candidateId);
8600
+ if (row.severity && !candidateSeverities.has(row.candidateId)) {
8601
+ candidateSeverities.set(row.candidateId, row.severity);
8602
+ }
8603
+ }
8556
8604
  }
8557
8605
  }
8558
8606
  if (source.mode === "swarm-pr-review:micro" && !resolvedArtifact) {
@@ -8563,7 +8611,8 @@ function derivePrReviewCandidateInventory(directory, state, ctx) {
8563
8611
  }
8564
8612
  }
8565
8613
  assertNoDuplicates(candidateIds, "PR_REVIEW discovery candidate ids");
8566
- ctx.candidateInventory = candidateIds.length > 0 ? candidateIds.sort() : ["CLEAN-REVIEW"];
8614
+ ctx.candidateSeverities = candidateSeverities;
8615
+ ctx.candidateInventory = candidateIds.length > 0 ? candidateIds.sort() : [PR_REVIEW_CLEAN_SENTINEL_ID];
8567
8616
  return ctx.candidateInventory;
8568
8617
  }
8569
8618
  function appendBoundedCandidateIssue(issues, message) {
@@ -8616,15 +8665,19 @@ function parseCanonicalCandidateRows(text, fallbackFamily) {
8616
8665
  rows.push({
8617
8666
  candidateId: analysis.candidateId,
8618
8667
  workflowLane: analysis.workflowLane,
8668
+ severity: isCandidateSeverity(analysis.values.severity) ? analysis.values.severity : null,
8619
8669
  evidence: candidateFields.slice(2).join("\x00"),
8620
8670
  lineNumber: index + 1
8621
8671
  });
8622
8672
  }
8623
8673
  return { rows, issues };
8624
8674
  }
8625
- function extractCandidateIds(text, fallbackFamily, scopeToLanes) {
8675
+ function extractCandidateRows(text, fallbackFamily, scopeToLanes) {
8626
8676
  const inScope = (lane) => !scopeToLanes || lane !== undefined && scopeToLanes.includes(lane);
8627
- return parseCanonicalCandidateRows(text, fallbackFamily).rows.filter((row) => inScope(row.workflowLane)).map((row) => row.candidateId);
8677
+ return parseCanonicalCandidateRows(text, fallbackFamily).rows.filter((row) => inScope(row.workflowLane));
8678
+ }
8679
+ function extractCandidateIds(text, fallbackFamily, scopeToLanes) {
8680
+ return extractCandidateRows(text, fallbackFamily, scopeToLanes).map((row) => row.candidateId);
8628
8681
  }
8629
8682
  var MAX_COMPOSITION_DIAGNOSTICS = 16;
8630
8683
  var MAX_UNCLAIMED_ITEMS_IN_MESSAGE = 50;
@@ -8697,7 +8750,11 @@ function composePrReviewPhaseVerdicts(directory, state, phase, ctx, exhaustive =
8697
8750
  if (!artifact)
8698
8751
  continue;
8699
8752
  const declaredItems = qualified.expectedLane.reviewItemIds ?? [];
8700
- const parsed = parseLaneItemVerdicts(artifact.text, declaredItems, phase, reviewerClaims);
8753
+ const { markerRows, parsed } = parsePrReviewVerdictRows(artifact.text, declaredItems, phase, reviewerClaims);
8754
+ if (!verdictRowsContainOnlyAssignedIds(markerRows, declaredItems)) {
8755
+ appendCompositionDiagnostic(diagnostics, `${phase} lane "${qualified.expectedLane.laneId}" contains an unassigned verdict row; it contributes no claims`);
8756
+ continue;
8757
+ }
8701
8758
  if (declaredItems.length > 0 && parsed.size === declaredItems.length) {
8702
8759
  satisfiedObligations.add(qualified.expectedWorkflowLane);
8703
8760
  }
@@ -8745,10 +8802,16 @@ function composePrReviewPhaseVerdicts(directory, state, phase, ctx, exhaustive =
8745
8802
  return composition;
8746
8803
  }
8747
8804
  function criticClaimIsBoundToCurrentReviewerRow(coherence, itemId, reviewerClaims) {
8748
- const bound = coherence.reviewerItemBindings?.[itemId];
8805
+ const bindings = coherence.reviewerItemBindings;
8806
+ const bindingKey = coherence.reviewerItemBindingKeyEncoding === "prefixed-v1" ? reviewerItemBindingKey(itemId) : itemId;
8807
+ const bound = bindings && Object.hasOwn(bindings, bindingKey) ? bindings[bindingKey] : undefined;
8749
8808
  const current = reviewerClaims?.get(itemId)?.rowDigest;
8750
8809
  return Boolean(bound && current && bound === current);
8751
8810
  }
8811
+ var REVIEWER_ITEM_BINDING_KEY_PREFIX = "item:";
8812
+ function reviewerItemBindingKey(itemId) {
8813
+ return `${REVIEWER_ITEM_BINDING_KEY_PREFIX}${itemId}`;
8814
+ }
8752
8815
  function authoritativeReviewerClaims(directory, state, ctx) {
8753
8816
  const composed = composePrReviewPhaseVerdicts(directory, state, "reviewer", ctx);
8754
8817
  return composed.unclaimed.length === 0 ? composed.claims : new Map;
@@ -9074,8 +9137,7 @@ function workflowArtifactHasContractMarker(directory, state, record, expectedMod
9074
9137
  return false;
9075
9138
  if (expectedMode === "swarm-pr-review:reviewer" || expectedMode === "swarm-pr-review:critic") {
9076
9139
  const phase = expectedMode === "swarm-pr-review:reviewer" ? "reviewer" : "critic";
9077
- const parsed = parseLaneItemVerdicts(artifact.text, reviewItemIds ?? [], phase, reviewerClaims);
9078
- return Boolean(reviewItemIds?.length && reviewItemIds.every((itemId) => parsed.has(itemId)));
9140
+ return analyzePrReviewVerdictRowContract(artifact.text, reviewItemIds ?? [], phase, reviewerClaims).ok;
9079
9141
  }
9080
9142
  if (expectedMode === "swarm-pr-feedback:verification") {
9081
9143
  return /^\[FEEDBACK-VERIFIED\]\s*\|/m.test(artifact.text);
@@ -9149,7 +9211,8 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9149
9211
  const normalized = normalizeCandidateArtifact(text, fallbackFamily);
9150
9212
  const canonicalText = normalized.text;
9151
9213
  const repairKinds = normalized.repairKinds;
9152
- const salvaged = repairKinds.length > 0;
9214
+ let salvaged = repairKinds.length > 0;
9215
+ let cleanAttestationSalvaged = false;
9153
9216
  const header = selectCandidateHeader(canonicalText.split(/\r?\n/));
9154
9217
  if (header === null || !header.markerBearing || header.family !== fallbackFamily) {
9155
9218
  appendBoundedCandidateIssue(issues, `field header: expected one exact canonical ${fallbackFamily} [CANDIDATE] header before discovery rows`);
@@ -9160,6 +9223,7 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9160
9223
  coverageKind: null,
9161
9224
  salvaged,
9162
9225
  repairKinds,
9226
+ cleanAttestationSalvaged,
9163
9227
  failurePredicate: "discovery.header"
9164
9228
  };
9165
9229
  }
@@ -9191,10 +9255,15 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9191
9255
  });
9192
9256
  if (parsed.error)
9193
9257
  appendBoundedCandidateIssue(issues, parsed.error);
9258
+ if (parsed.clean_attestation_salvaged) {
9259
+ cleanAttestationSalvaged = true;
9260
+ salvaged = true;
9261
+ appendBoundedCandidateIssue(issues, parsed.clean_attestation_salvage_reason ?? "CLEAN attestation discredited; candidate rows retained");
9262
+ }
9194
9263
  for (const detail of parsed.diagnostics.parse_error_details) {
9195
9264
  appendBoundedCandidateIssue(issues, `row ${detail.row_index + 1} field ${detail.field}: ${detail.message}`);
9196
9265
  }
9197
- const hasParseFailure = Boolean(parsed.error) || parsed.diagnostics.parse_error_details.length > 0;
9266
+ const hasParseFailure = Boolean(parsed.error) || Boolean(parsed.clean_attestation_salvaged) || parsed.diagnostics.parse_error_details.length > 0;
9198
9267
  const extractedCandidateIds = parseCanonicalCandidateRows(canonicalText, fallbackFamily).rows.map((row) => row.candidateId);
9199
9268
  const hasDuplicateCandidateId = new Set(extractedCandidateIds).size !== extractedCandidateIds.length;
9200
9269
  if (hasDuplicateCandidateId) {
@@ -9205,6 +9274,7 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9205
9274
  coverageKind: null,
9206
9275
  salvaged,
9207
9276
  repairKinds,
9277
+ cleanAttestationSalvaged,
9208
9278
  failurePredicate: "discovery.row"
9209
9279
  };
9210
9280
  }
@@ -9224,7 +9294,8 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9224
9294
  issues,
9225
9295
  coverageKind: "candidate",
9226
9296
  salvaged,
9227
- repairKinds
9297
+ repairKinds,
9298
+ cleanAttestationSalvaged
9228
9299
  };
9229
9300
  }
9230
9301
  const clean = parsed.clean_attestation;
@@ -9235,7 +9306,8 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9235
9306
  issues,
9236
9307
  coverageKind: "clean",
9237
9308
  salvaged,
9238
- repairKinds
9309
+ repairKinds,
9310
+ cleanAttestationSalvaged
9239
9311
  };
9240
9312
  }
9241
9313
  return {
@@ -9245,6 +9317,7 @@ function analyzePrReviewDiscoveryArtifact(text, expectedWorkflowLane, ownedWorkf
9245
9317
  coverageKind: null,
9246
9318
  salvaged,
9247
9319
  repairKinds,
9320
+ cleanAttestationSalvaged,
9248
9321
  failurePredicate: hasParseFailure ? "discovery.row" : "discovery.coverage"
9249
9322
  };
9250
9323
  }
@@ -9323,6 +9396,13 @@ function validatePrReviewDiscoveryLaneCompletion(input) {
9323
9396
  reason: `structural repairs applied: ${analysis.repairKinds.join(", ")}`
9324
9397
  });
9325
9398
  }
9399
+ if (analysis.cleanAttestationSalvaged) {
9400
+ laneRecoveries.push({
9401
+ workflowLane,
9402
+ kind: "clean-attestation-salvaged",
9403
+ reason: "a conflicting [CLEAN] attestation was discredited while the independently validated candidate rows were retained"
9404
+ });
9405
+ }
9326
9406
  if (analysis.issues.length > 0) {
9327
9407
  laneRecoveries.push({
9328
9408
  workflowLane,
@@ -9378,6 +9458,14 @@ var REVIEW_SEVERITIES = new Set([
9378
9458
  "INFO",
9379
9459
  "NONE"
9380
9460
  ]);
9461
+ var REVIEW_SEVERITY_RANK = new Map([
9462
+ ["NONE", 0],
9463
+ ["INFO", 1],
9464
+ ["LOW", 2],
9465
+ ["MEDIUM", 3],
9466
+ ["HIGH", 4],
9467
+ ["CRITICAL", 5]
9468
+ ]);
9381
9469
  var CRITIC_STATUSES = new Set([
9382
9470
  "UPHELD",
9383
9471
  "DOWNGRADED",
@@ -9398,16 +9486,31 @@ var FEEDBACK_NO_CHANGE_CLASSIFICATIONS = new Set([
9398
9486
  "NEEDS_MORE_EVIDENCE",
9399
9487
  "NEEDS_USER_DECISION"
9400
9488
  ]);
9401
- function parseReviewerVerdictFields(text, itemId) {
9402
- const rows = text.split(/\r?\n/).map((line) => pipeFieldsCapped(line, 10)).filter((fields2) => fields2[0] === "[REVIEWED]" && fields2[1] === itemId);
9403
- if (rows.length !== 1)
9404
- return null;
9405
- const fields = rows[0];
9489
+ function indexVerdictRows(text, marker, fieldCount) {
9490
+ const markerRows = [];
9491
+ const rowsByItemId = new Map;
9492
+ for (const line of text.split(/\r?\n/)) {
9493
+ const fields = pipeFieldsCapped(line, fieldCount);
9494
+ if (fields[0] !== marker)
9495
+ continue;
9496
+ markerRows.push(fields);
9497
+ const itemId = fields[1] ?? "";
9498
+ const rows = rowsByItemId.get(itemId);
9499
+ if (rows)
9500
+ rows.push(fields);
9501
+ else
9502
+ rowsByItemId.set(itemId, [fields]);
9503
+ }
9504
+ return { markerRows, rowsByItemId };
9505
+ }
9506
+ function validateReviewerVerdictFields(fields) {
9406
9507
  if (fields.length !== 10 || !fields.slice(1).every(Boolean))
9407
9508
  return null;
9408
9509
  const introduced = fields[5].replace(/^introduced_by_pr\s*:\s*/i, "").toUpperCase();
9409
9510
  if (!REVIEWER_CLASSIFICATIONS.has(fields[2]) || !REVIEWER_EVIDENCE_TYPES.has(fields[3]) || !REVIEW_SEVERITIES.has(fields[4]) || !["YES", "NO", "UNKNOWN"].includes(introduced))
9410
9511
  return null;
9512
+ if (fields[2] === "DISPROVED" && fields[4] !== "NONE")
9513
+ return null;
9411
9514
  if (fields[7].length < 8 || fields[8].length < 5 || fields[9].length < 3)
9412
9515
  return null;
9413
9516
  return fields;
@@ -9416,10 +9519,16 @@ function reviewerVerdictRowDigest(fields) {
9416
9519
  return createHash5("sha256").update(fields.join("\x00")).digest("hex");
9417
9520
  }
9418
9521
  function parseLaneItemVerdicts(text, itemIds, phase, reviewerClaims) {
9522
+ return parsePrReviewVerdictRows(text, itemIds, phase, reviewerClaims).parsed;
9523
+ }
9524
+ function parsePrReviewVerdictRows(text, itemIds, phase, reviewerClaims) {
9419
9525
  const parsed = new Map;
9526
+ const marker = phase === "reviewer" ? "[REVIEWED]" : "[CRITIC]";
9527
+ const { markerRows, rowsByItemId } = indexVerdictRows(text, marker, phase === "reviewer" ? 10 : 6);
9420
9528
  for (const itemId of itemIds) {
9421
9529
  if (phase === "reviewer") {
9422
- const fields = parseReviewerVerdictFields(text, itemId);
9530
+ const rows2 = rowsByItemId.get(itemId);
9531
+ const fields = rows2?.length === 1 ? validateReviewerVerdictFields(rows2[0]) : null;
9423
9532
  if (!fields)
9424
9533
  continue;
9425
9534
  parsed.set(itemId, {
@@ -9429,7 +9538,8 @@ function parseLaneItemVerdicts(text, itemIds, phase, reviewerClaims) {
9429
9538
  });
9430
9539
  continue;
9431
9540
  }
9432
- const verdict = parseCriticVerdict(text, itemId, reviewerClaims?.get(itemId)?.severity);
9541
+ const rows = rowsByItemId.get(itemId);
9542
+ const verdict = rows?.length === 1 ? validateCriticVerdictFields(rows[0], reviewerClaims?.get(itemId)?.severity) : null;
9433
9543
  if (!verdict)
9434
9544
  continue;
9435
9545
  parsed.set(itemId, {
@@ -9437,13 +9547,56 @@ function parseLaneItemVerdicts(text, itemIds, phase, reviewerClaims) {
9437
9547
  severity: verdict.severity
9438
9548
  });
9439
9549
  }
9440
- return parsed;
9550
+ return { markerRows, parsed };
9551
+ }
9552
+ function analyzePrReviewVerdictRowContract(text, itemIds, phase, reviewerClaims) {
9553
+ const marker = phase === "reviewer" ? "[REVIEWED]" : "[CRITIC]";
9554
+ const assigned = new Set(itemIds);
9555
+ const { markerRows, parsed } = parsePrReviewVerdictRows(text, itemIds, phase, reviewerClaims);
9556
+ const observedIds = markerRows.map((fields) => fields[1] || "(missing)");
9557
+ const unexpectedIds = [
9558
+ ...new Set(observedIds.filter((itemId) => !assigned.has(itemId)))
9559
+ ];
9560
+ const invalidOrMissingIds = itemIds.filter((itemId) => !parsed.has(itemId));
9561
+ return {
9562
+ ok: verdictRowIdsMatchExactly(markerRows, itemIds) && invalidOrMissingIds.length === 0,
9563
+ expected: `exactly one parseable ${marker} row for assigned IDs ${JSON.stringify(itemIds)} and no other ${marker} IDs`,
9564
+ actual: JSON.stringify({
9565
+ rowCount: markerRows.length,
9566
+ observedIds,
9567
+ invalidOrMissingIds,
9568
+ unexpectedIds
9569
+ })
9570
+ };
9571
+ }
9572
+ function verdictRowIdsMatchExactly(markerRows, itemIds) {
9573
+ if (itemIds.length === 0 || markerRows.length !== itemIds.length)
9574
+ return false;
9575
+ const assigned = new Set(itemIds);
9576
+ if (assigned.size !== itemIds.length)
9577
+ return false;
9578
+ const observed = new Set;
9579
+ for (const fields of markerRows) {
9580
+ const itemId = fields[1] ?? "";
9581
+ if (!assigned.has(itemId) || observed.has(itemId))
9582
+ return false;
9583
+ observed.add(itemId);
9584
+ }
9585
+ return observed.size === assigned.size;
9586
+ }
9587
+ function verdictRowsContainOnlyAssignedIds(markerRows, itemIds) {
9588
+ if (itemIds.length === 0)
9589
+ return false;
9590
+ const assigned = new Set(itemIds);
9591
+ return markerRows.every((fields) => assigned.has(fields[1] ?? ""));
9441
9592
  }
9442
9593
  function parseCriticVerdict(text, itemId, reviewerSeverity) {
9443
- const rows = text.split(/\r?\n/).map((line) => pipeFieldsCapped(line, 6)).filter((fields2) => fields2[0] === "[CRITIC]" && fields2[1] === itemId);
9444
- if (rows.length !== 1)
9594
+ const rows = indexVerdictRows(text, "[CRITIC]", 6).rowsByItemId.get(itemId);
9595
+ if (!rows || rows.length !== 1)
9445
9596
  return null;
9446
- const fields = rows[0];
9597
+ return validateCriticVerdictFields(rows[0], reviewerSeverity);
9598
+ }
9599
+ function validateCriticVerdictFields(fields, reviewerSeverity) {
9447
9600
  if (fields.length !== 6 || !fields.slice(1).every(Boolean) || !CRITIC_STATUSES.has(fields[2]) || !REVIEW_SEVERITIES.has(fields[3]))
9448
9601
  return null;
9449
9602
  if (fields[2] === "NEEDS_MORE_EVIDENCE")
@@ -9455,16 +9608,8 @@ function parseCriticVerdict(text, itemId, reviewerSeverity) {
9455
9608
  if (fields[2] === "DOWNGRADED" && fields[3] === "CRITICAL")
9456
9609
  return null;
9457
9610
  if (reviewerSeverity) {
9458
- const severityRank = new Map([
9459
- ["NONE", 0],
9460
- ["INFO", 1],
9461
- ["LOW", 2],
9462
- ["MEDIUM", 3],
9463
- ["HIGH", 4],
9464
- ["CRITICAL", 5]
9465
- ]);
9466
- const reviewerRank = severityRank.get(reviewerSeverity);
9467
- const criticRank = severityRank.get(fields[3]);
9611
+ const reviewerRank = REVIEW_SEVERITY_RANK.get(reviewerSeverity);
9612
+ const criticRank = REVIEW_SEVERITY_RANK.get(fields[3]);
9468
9613
  if (reviewerRank === undefined || criticRank === undefined)
9469
9614
  return null;
9470
9615
  if (fields[2] === "UPHELD" && criticRank !== reviewerRank)
@@ -15686,7 +15831,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
15686
15831
  };
15687
15832
  }
15688
15833
  async function sweepActiveNearDuplicates(directory, options = {}) {
15689
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4zevsvaa.js");
15834
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
15690
15835
  const { config } = loadPluginConfigWithMeta2(directory);
15691
15836
  const sweepConfig = config.learning?.dedup_sweep;
15692
15837
  if (sweepConfig?.enabled === false)
@@ -16770,7 +16915,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
16770
16915
  }
16771
16916
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
16772
16917
  try {
16773
- const skillModule = await import("./skill-generator-k5pxb3w2.js");
16918
+ const skillModule = await import("./skill-generator-413k36q9.js");
16774
16919
  for (const cand of skillCandidates) {
16775
16920
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
16776
16921
  continue;
@@ -17230,7 +17375,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
17230
17375
  } catch {}
17231
17376
  }
17232
17377
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
17233
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-7zpg79dx.js");
17378
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-dyrrftth.js");
17234
17379
  for (const { id } of contradictedEntries) {
17235
17380
  try {
17236
17381
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -18049,7 +18194,7 @@ async function runCuratorPostMortem(directory, options = {}) {
18049
18194
  warnings.push("Failed to collect knowledge summary.");
18050
18195
  }
18051
18196
  try {
18052
- const { getScanStatus } = await import("./scan-cursor-4jv70zwb.js");
18197
+ const { getScanStatus } = await import("./scan-cursor-m04qgx82.js");
18053
18198
  const scanStatus = await getScanStatus(directory);
18054
18199
  if (scanStatus.remaining_estimate > 0) {
18055
18200
  warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
@@ -18221,9 +18366,9 @@ var _internals24 = {
18221
18366
  verifyPostMortemKnowledgeActions,
18222
18367
  repairPostMortemActions,
18223
18368
  loadDefaultKnowledgeConfig: async (directory) => {
18224
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jhz9hme9.js");
18369
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-40w13gdv.js");
18225
18370
  try {
18226
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4zevsvaa.js");
18371
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
18227
18372
  const loaded = loadPluginConfigWithMeta2(directory);
18228
18373
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
18229
18374
  } catch {
@@ -18231,11 +18376,11 @@ var _internals24 = {
18231
18376
  }
18232
18377
  },
18233
18378
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
18234
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-acp80hpc.js");
18379
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-e6p9vysv.js");
18235
18380
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
18236
18381
  },
18237
18382
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
18238
- const { checkHivePromotions } = await import("./hive-promoter-qhrngsvb.js");
18383
+ const { checkHivePromotions } = await import("./hive-promoter-trew6apr.js");
18239
18384
  return checkHivePromotions(entries, knowledgeConfig, directory);
18240
18385
  },
18241
18386
  applyProposalTriage: async (directory, triage) => {
@@ -18244,7 +18389,7 @@ var _internals24 = {
18244
18389
  activateProposal,
18245
18390
  listSkills: listSkills2,
18246
18391
  sanitizeSlug
18247
- } = await import("./skill-generator-k5pxb3w2.js");
18392
+ } = await import("./skill-generator-413k36q9.js");
18248
18393
  const result = {
18249
18394
  approved: [],
18250
18395
  rejected: [],
@@ -19580,9 +19725,9 @@ function hashContent(content) {
19580
19725
  return createHash8("sha1").update(content).digest("hex");
19581
19726
  }
19582
19727
  async function loadConfigForPolicyCurator(directory) {
19583
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jhz9hme9.js");
19728
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-40w13gdv.js");
19584
19729
  try {
19585
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4zevsvaa.js");
19730
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
19586
19731
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
19587
19732
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
19588
19733
  } catch {
@@ -30770,7 +30915,7 @@ async function runFinalizeStage(ctx) {
30770
30915
  }
30771
30916
  }
30772
30917
  try {
30773
- const { CuratorConfigSchema: CCS } = await import("./schema-jhz9hme9.js");
30918
+ const { CuratorConfigSchema: CCS } = await import("./schema-40w13gdv.js");
30774
30919
  const { config: pmLoadedConfig } = _internals39.loadPluginConfigWithMeta(ctx.directory);
30775
30920
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
30776
30921
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -32963,9 +33108,9 @@ var _internals43 = {
32963
33108
  loadPluginConfigWithMeta,
32964
33109
  loadCuratorDeps: async () => {
32965
33110
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
32966
- import("./schema-jhz9hme9.js"),
32967
- import("./curator-acp80hpc.js"),
32968
- import("./curator-llm-factory-ewffa8r1.js")
33111
+ import("./schema-40w13gdv.js"),
33112
+ import("./curator-e6p9vysv.js"),
33113
+ import("./curator-llm-factory-bzvv3grb.js")
32969
33114
  ]);
32970
33115
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
32971
33116
  }
@@ -33919,7 +34064,7 @@ async function computeCurationDiagnostics(directory, entries) {
33919
34064
  let scanCompleted = false;
33920
34065
  let scanRemaining = 0;
33921
34066
  try {
33922
- const { getScanStatus } = await import("./scan-cursor-4jv70zwb.js");
34067
+ const { getScanStatus } = await import("./scan-cursor-m04qgx82.js");
33923
34068
  const status = await getScanStatus(directory);
33924
34069
  scanGeneration = status.generation;
33925
34070
  scanCompleted = status.completed;
@@ -33927,19 +34072,19 @@ async function computeCurationDiagnostics(directory, entries) {
33927
34072
  } catch {}
33928
34073
  let configMatch = null;
33929
34074
  try {
33930
- const { isLinked: isLinked2 } = await import("./knowledge-link-mgg482z6.js");
34075
+ const { isLinked: isLinked2 } = await import("./knowledge-link-jkx8xjxp.js");
33931
34076
  if (isLinked2(directory)) {
33932
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jhz9hme9.js");
34077
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-40w13gdv.js");
33933
34078
  let config;
33934
34079
  try {
33935
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4zevsvaa.js");
34080
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
33936
34081
  const loaded = loadPluginConfigWithMeta2(directory);
33937
34082
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
33938
34083
  } catch {
33939
34084
  config = KnowledgeConfigSchema2.parse({});
33940
34085
  }
33941
34086
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
33942
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-9vv7v5rf.js");
34087
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-g353f457.js");
33943
34088
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
33944
34089
  const cohortFp = await readCohortConfigFingerprint(directory);
33945
34090
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -35215,7 +35360,7 @@ async function handleDoctorCommand(directory, args) {
35215
35360
  const result = runConfigDoctor(config, directory);
35216
35361
  let output;
35217
35362
  if (enableAutoFix && result.hasAutoFixableIssues) {
35218
- const { runConfigDoctorWithFixes } = await import("./config-doctor-yd866pd5.js");
35363
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-28e6h9ex.js");
35219
35364
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
35220
35365
  applyLossy: true
35221
35366
  });
@@ -36155,7 +36300,7 @@ async function handleEvidenceCommand(directory, args) {
36155
36300
  return formatTaskEvidenceMarkdown(evidenceData);
36156
36301
  }
36157
36302
  async function handleEvidenceSummaryCommand(directory) {
36158
- const { buildEvidenceSummary } = await import("./evidence-summary-service-8gw74j8g.js");
36303
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-b2xp0m26.js");
36159
36304
  const artifact = await buildEvidenceSummary(directory);
36160
36305
  if (!artifact) {
36161
36306
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -64040,7 +64185,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
64040
64185
  if (!input.dispatcher) {
64041
64186
  throw new Error("no evaluation dispatcher available (cannot run validation)");
64042
64187
  }
64043
- const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-rcnpm510.js");
64188
+ const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-q7d22d1w.js");
64044
64189
  const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
64045
64190
  const result = await _internals91.evaluateCandidateV1({
64046
64191
  projectRoot: input.directory,
@@ -65946,7 +66091,7 @@ function buildDetailedHelp(commandName, entry) {
65946
66091
  async function handleHelpCommand(ctx) {
65947
66092
  const targetCommand = ctx.args.join(" ");
65948
66093
  if (!targetCommand) {
65949
- const { buildHelpText } = await import("./index-qqawmxe7.js");
66094
+ const { buildHelpText } = await import("./index-ymyv4d36.js");
65950
66095
  return buildHelpText();
65951
66096
  }
65952
66097
  const tokens = targetCommand.split(/\s+/);
@@ -65955,7 +66100,7 @@ async function handleHelpCommand(ctx) {
65955
66100
  return _internals94.buildDetailedHelp(resolved.key, resolved.entry);
65956
66101
  }
65957
66102
  const similar = _internals94.findSimilarCommands(targetCommand);
65958
- const { buildHelpText: fullHelp } = await import("./index-qqawmxe7.js");
66103
+ const { buildHelpText: fullHelp } = await import("./index-ymyv4d36.js");
65959
66104
  if (similar.length > 0) {
65960
66105
  return `Command '/swarm ${targetCommand}' not found.
65961
66106
 
@@ -66132,7 +66277,7 @@ var COMMAND_REGISTRY = {
66132
66277
  },
66133
66278
  "guardrail explain": {
66134
66279
  handler: async (ctx) => {
66135
- const { handleGuardrailExplain } = await import("./guardrail-explain-50cp8k3r.js");
66280
+ const { handleGuardrailExplain } = await import("./guardrail-explain-g1nqbz0j.js");
66136
66281
  return handleGuardrailExplain(ctx.directory, ctx.args);
66137
66282
  },
66138
66283
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -66142,7 +66287,7 @@ var COMMAND_REGISTRY = {
66142
66287
  },
66143
66288
  "guardrail-explain": {
66144
66289
  handler: async (ctx) => {
66145
- const { handleGuardrailExplain } = await import("./guardrail-explain-50cp8k3r.js");
66290
+ const { handleGuardrailExplain } = await import("./guardrail-explain-g1nqbz0j.js");
66146
66291
  return handleGuardrailExplain(ctx.directory, ctx.args);
66147
66292
  },
66148
66293
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -66152,7 +66297,7 @@ var COMMAND_REGISTRY = {
66152
66297
  },
66153
66298
  "guardrail-log": {
66154
66299
  handler: async (ctx) => {
66155
- const { handleGuardrailLog } = await import("./guardrail-log-jazq10gt.js");
66300
+ const { handleGuardrailLog } = await import("./guardrail-log-1bbg0vx4.js");
66156
66301
  return handleGuardrailLog(ctx.directory, ctx.args);
66157
66302
  },
66158
66303
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -73610,7 +73755,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
73610
73755
  return extracted === expectedSessionId;
73611
73756
  }
73612
73757
  async function inspectStandardWorktreeCollisionOwnership(identity) {
73613
- const collisionOwnership = await import("./worktree-collision-ownership-vt0jzmdt.js");
73758
+ const collisionOwnership = await import("./worktree-collision-ownership-xj0bsg92.js");
73614
73759
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
73615
73760
  }
73616
73761
  async function precreateStandardWorktreeSession(args) {
@@ -73758,7 +73903,7 @@ async function precreateStandardWorktreeSession(args) {
73758
73903
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, provisionResult.worktreePath);
73759
73904
  if (laneProfile) {
73760
73905
  try {
73761
- const { writeLaneProfileToDiskReal } = await import("./core-nc9a9g5m.js");
73906
+ const { writeLaneProfileToDiskReal } = await import("./core-n57ssze0.js");
73762
73907
  await writeLaneProfileToDiskReal(provisionResult.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
73763
73908
  } catch {}
73764
73909
  }
@@ -74416,7 +74561,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
74416
74561
  }
74417
74562
  clearWorktreeMergeStatus(statusKey);
74418
74563
  try {
74419
- const { removeLaneProfileFromDiskReal } = await import("./core-nc9a9g5m.js");
74564
+ const { removeLaneProfileFromDiskReal } = await import("./core-n57ssze0.js");
74420
74565
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
74421
74566
  } catch {}
74422
74567
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);