opencode-swarm 7.198.2 → 7.199.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 (105) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +6 -6
  2. package/.opencode/skills/swarm-pr-feedback/references/followup-dispositions.md +74 -0
  3. package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +25 -0
  4. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  5. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  6. package/dist/background/pending-delegations.d.ts +1 -1
  7. package/dist/background/pr-review-contract.d.ts +10 -0
  8. package/dist/cli/{auto-checkpoint-ekp5j5v5.js → auto-checkpoint-x13d1g1t.js} +8 -8
  9. package/dist/cli/{checkpoint-30yrbqee.js → checkpoint-68nb8k3t.js} +16 -16
  10. package/dist/cli/{coder-settlement-t3zcgsd6.js → coder-settlement-kmdmdpyy.js} +12 -12
  11. package/dist/cli/{config-doctor-6w105xpy.js → config-doctor-4b0jb15n.js} +15 -15
  12. package/dist/cli/{core-6hyt1hg6.js → core-6kkm2vrz.js} +3 -3
  13. package/dist/cli/{curation-policy-m8ng2vm5.js → curation-policy-0smbd33w.js} +6 -6
  14. package/dist/cli/{curator-drift-z83e3a60.js → curator-drift-axcgdjy4.js} +8 -8
  15. package/dist/cli/curator-llm-factory-58ec737y.js +82 -0
  16. package/dist/cli/{curator-bzy7cess.js → curator-z8xzxh9f.js} +42 -42
  17. package/dist/cli/{doctor-knowledge-receipt-phase-id-8av1860z.js → doctor-knowledge-receipt-phase-id-hkjt6hv4.js} +8 -8
  18. package/dist/cli/{evidence-summary-service-ym7y7w5k.js → evidence-summary-service-981cx8wa.js} +19 -19
  19. package/dist/cli/{gate-evidence-vvhtzwry.js → gate-evidence-zyvwsp7a.js} +7 -7
  20. package/dist/cli/guardrail-explain-23b0amne.js +83 -0
  21. package/dist/cli/{guardrail-log-4f0jxq61.js → guardrail-log-s2gxszvm.js} +8 -7
  22. package/dist/cli/{guardrail-reset-cqq3yk9s.js → guardrail-reset-kt18vr45.js} +42 -42
  23. package/dist/cli/{hive-promoter-vvgdsx8s.js → hive-promoter-fz7ep8h4.js} +42 -42
  24. package/dist/cli/{index-rnjtf5kn.js → index-14vhp87b.js} +2 -2
  25. package/dist/cli/{index-yk1vnpzx.js → index-2bc7zfw3.js} +1 -1
  26. package/dist/cli/{index-d31b2zvf.js → index-2mx2gn97.js} +1 -1
  27. package/dist/cli/{index-5hbb3088.js → index-3zzxrwaf.js} +4 -4
  28. package/dist/cli/{index-bj916p5e.js → index-408tpd21.js} +261 -21
  29. package/dist/cli/{index-gc9dvmy7.js → index-4rrff8k6.js} +2 -2
  30. package/dist/cli/{index-89j5h1j9.js → index-4s6kdsfr.js} +1 -1
  31. package/dist/cli/{index-v85gn9jm.js → index-61fa8hg7.js} +5 -5
  32. package/dist/cli/{index-7e9mqse6.js → index-61m1jw7p.js} +3 -3
  33. package/dist/cli/{index-4s3770gs.js → index-6dtt0brw.js} +4 -4
  34. package/dist/cli/{index-whmby20t.js → index-795vmpe6.js} +42 -42
  35. package/dist/cli/{index-t7qgt5yk.js → index-7c432abn.js} +2 -2
  36. package/dist/cli/{index-xez06sc1.js → index-820pzqd6.js} +1 -1
  37. package/dist/cli/{index-mx74665q.js → index-8pyg2qnw.js} +4 -4
  38. package/dist/cli/{index-v30zmakk.js → index-9ztsfved.js} +2 -2
  39. package/dist/cli/{index-tnnxvq2f.js → index-bb2rx8k2.js} +6 -6
  40. package/dist/cli/{index-qg6qn99c.js → index-bkscmz4z.js} +7 -7
  41. package/dist/cli/{index-vjwmcxz4.js → index-f900029m.js} +7 -7
  42. package/dist/cli/{index-drf91t9h.js → index-fmbqyqqw.js} +5 -5
  43. package/dist/cli/{index-cfs1k1eh.js → index-ge7vn1vz.js} +5 -5
  44. package/dist/cli/{index-e4hj8r57.js → index-h349p91m.js} +34 -3
  45. package/dist/cli/{index-tdpfecs3.js → index-hc6wa3yg.js} +2 -2
  46. package/dist/cli/{index-76mg98ac.js → index-jccs3fgn.js} +1 -1
  47. package/dist/cli/{index-wg1mt92h.js → index-jhk4000q.js} +9 -8
  48. package/dist/cli/{index-xxb2depv.js → index-m4s5a2sp.js} +7 -7
  49. package/dist/cli/{index-y81sw9vt.js → index-mzx33w6e.js} +11 -11
  50. package/dist/cli/{index-9keabj7d.js → index-n9ry04hw.js} +4 -4
  51. package/dist/cli/{index-bczx8jcg.js → index-nacmcvc4.js} +5 -12
  52. package/dist/cli/{index-d9jrzepr.js → index-npy15m50.js} +3 -3
  53. package/dist/cli/{index-rqxwv4q5.js → index-nr1pj3hy.js} +1 -1
  54. package/dist/cli/{index-6pc5j9rb.js → index-nreezgrd.js} +3 -3
  55. package/dist/cli/{index-ehw0s6xa.js → index-p35gw2x7.js} +1 -1
  56. package/dist/cli/{index-xt4q610f.js → index-p5pgjp7n.js} +1 -1
  57. package/dist/cli/{index-166xny29.js → index-pf0xrx9w.js} +605 -172
  58. package/dist/cli/{index-59w9zfc5.js → index-px1dnna2.js} +5 -5
  59. package/dist/cli/{index-84r9rydf.js → index-pxdc0qn1.js} +2 -2
  60. package/dist/cli/{index-5h5tj8wc.js → index-qqv9rr8k.js} +44 -44
  61. package/dist/cli/{index-hd3d7rcw.js → index-r7ayh42s.js} +3 -3
  62. package/dist/cli/{index-rfcb9f54.js → index-t1t93qm0.js} +3 -2
  63. package/dist/cli/{index-xrghsqg3.js → index-vj0zede7.js} +4 -4
  64. package/dist/cli/{index-wrn4khfb.js → index-w00dj8p5.js} +1 -1
  65. package/dist/cli/{index-0ap067j7.js → index-w4624tpw.js} +2 -2
  66. package/dist/cli/{index-mjmsq8t7.js → index-w7d8gcj0.js} +2 -2
  67. package/dist/cli/{index-h86e4jp9.js → index-w9f2jbwe.js} +2 -2
  68. package/dist/cli/{index-bd4szzja.js → index-weewx5nx.js} +1 -1
  69. package/dist/cli/{index-0y5yvag6.js → index-xj9260dh.js} +6 -6
  70. package/dist/cli/{index-p4xmq6aa.js → index-ywb5er8g.js} +1 -1
  71. package/dist/cli/index.js +43 -43
  72. package/dist/cli/{knowledge-escalator-8hrnc4bd.js → knowledge-escalator-cf6m9y0s.js} +14 -14
  73. package/dist/cli/{knowledge-events-v2abqt9z.js → knowledge-events-hn5hymam.js} +12 -12
  74. package/dist/cli/{knowledge-link-5qt3pe5v.js → knowledge-link-1f91bzcc.js} +5 -5
  75. package/dist/cli/{knowledge-store-9y17zzce.js → knowledge-store-mgqk4hvy.js} +6 -6
  76. package/dist/cli/{knowledge-validator-7red2zwb.js → knowledge-validator-x9yrte9q.js} +8 -8
  77. package/dist/cli/{mcp-gbyndb15.js → mcp-hpmh4d6d.js} +1 -1
  78. package/dist/cli/{model-preflight-1tsaksc7.js → model-preflight-ry5jjnx4.js} +42 -42
  79. package/dist/cli/{pending-delegations-yg769m4y.js → pending-delegations-j850kj5p.js} +12 -12
  80. package/dist/cli/{pr-subscriptions-mc2mvjkj.js → pr-subscriptions-mme9gb5e.js} +12 -12
  81. package/dist/cli/{pr-workflow-gate-0fb280b2.js → pr-workflow-gate-n6bj3dnn.js} +46 -42
  82. package/dist/cli/{runner-rwya5yhg.js → runner-qe3fkzx5.js} +6 -6
  83. package/dist/cli/{scan-cursor-g74j6gcr.js → scan-cursor-fdpxbx4f.js} +7 -7
  84. package/dist/cli/{schema-q2v7px9y.js → schema-amcjvk8a.js} +1 -1
  85. package/dist/cli/{scope-persistence-g88f0163.js → scope-persistence-mp4kqpk2.js} +15 -15
  86. package/dist/cli/{server-j3a7q7gg.js → server-ptdvpwyd.js} +42 -42
  87. package/dist/cli/{skill-generator-30bjrvcc.js → skill-generator-v59hhybn.js} +16 -16
  88. package/dist/cli/{snapshot-coordination-init-9ekvft16.js → snapshot-coordination-init-nv6e4svp.js} +42 -42
  89. package/dist/cli/{speckit-checkoff-sx24fz29.js → speckit-checkoff-me8kd3wd.js} +4 -4
  90. package/dist/cli/{telemetry-t3425cht.js → telemetry-6yv06xyz.js} +1 -1
  91. package/dist/cli/{workspace-snapshot-bst64vey.js → workspace-snapshot-vhvrkbbb.js} +3 -3
  92. package/dist/cli/{worktree-collision-ownership-shtk6dsk.js → worktree-collision-ownership-84qyqars.js} +13 -13
  93. package/dist/cli/{worktree-isolation-x41cgd9n.js → worktree-isolation-99qvz8ap.js} +42 -42
  94. package/dist/config/schema.d.ts +2 -0
  95. package/dist/config/skill-contract-digest.d.ts +29 -4
  96. package/dist/hooks/guardrails/file-authority.d.ts +17 -0
  97. package/dist/hooks/pr-workflow-gate.d.ts +17 -0
  98. package/dist/hooks/skill-scoring.d.ts +40 -0
  99. package/dist/index.js +129 -120
  100. package/dist/pr-review/verdict-settlement.d.ts +40 -4
  101. package/dist/state.d.ts +49 -0
  102. package/opencode-swarm.schema.json +4 -0
  103. package/package.json +1 -1
  104. package/dist/cli/curator-llm-factory-ykpty14a.js +0 -82
  105. package/dist/cli/guardrail-explain-1ethgkvp.js +0 -83
@@ -8,14 +8,14 @@ import {
8
8
  protectedRoots,
9
9
  redactDecisionLineForArchive,
10
10
  stableCanonicalStringify
11
- } from "./index-bj916p5e.js";
11
+ } from "./index-408tpd21.js";
12
12
  import {
13
13
  detectStraySwarmDirs,
14
14
  readDoctorArtifact,
15
15
  removeStraySwarmDir,
16
16
  resolvePlanParallelizationFlag,
17
17
  runConfigDoctor
18
- } from "./index-bczx8jcg.js";
18
+ } from "./index-nacmcvc4.js";
19
19
  import {
20
20
  archiveEvidence,
21
21
  checkRequirementCoverage,
@@ -27,7 +27,7 @@ import {
27
27
  sanitizeTaskId,
28
28
  saveEvidence,
29
29
  validateProjectRoot
30
- } from "./index-59w9zfc5.js";
30
+ } from "./index-px1dnna2.js";
31
31
  import {
32
32
  JAVA_SYMBOL_GRAMMAR,
33
33
  LANGUAGE_REGISTRY,
@@ -56,7 +56,7 @@ import {
56
56
  runEvaluation,
57
57
  runExternalTool,
58
58
  withDisposableWorktree
59
- } from "./index-76mg98ac.js";
59
+ } from "./index-jccs3fgn.js";
60
60
  import {
61
61
  EvaluationTaskV1Schema,
62
62
  GateAuditManifestV1Schema,
@@ -73,7 +73,7 @@ import {
73
73
  saveGateAuditResult,
74
74
  savePromotionDecision,
75
75
  saveTaskSetSnapshot
76
- } from "./index-t7qgt5yk.js";
76
+ } from "./index-7c432abn.js";
77
77
  import {
78
78
  canonicalHash,
79
79
  canonicalJson,
@@ -89,7 +89,7 @@ import {
89
89
  alreadyCuratedThisGeneration,
90
90
  claimNextScanBatch,
91
91
  resolveCohortId
92
- } from "./index-0ap067j7.js";
92
+ } from "./index-w4624tpw.js";
93
93
  import {
94
94
  CURATOR_CONSOLIDATION_PROMPT,
95
95
  CURATOR_INIT_PROMPT,
@@ -108,13 +108,13 @@ import {
108
108
  getGroupCommitWriter,
109
109
  importLegacyJsonl,
110
110
  readPriorDriftReports
111
- } from "./index-d9jrzepr.js";
111
+ } from "./index-npy15m50.js";
112
112
  import {
113
113
  assertNoUnsettledCoderDispatch,
114
114
  listCoderSettlementWalStates,
115
115
  recoverCoderSettlement,
116
116
  recoverStaleCoderSettlements
117
- } from "./index-xxb2depv.js";
117
+ } from "./index-m4s5a2sp.js";
118
118
  import {
119
119
  BUNDLED_PROJECT_SKILL_ROOT,
120
120
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -137,11 +137,11 @@ import {
137
137
  skillContractDigest,
138
138
  splitSkillFrontmatter,
139
139
  syncBundledProjectSkillsIfMissingAsync
140
- } from "./index-9keabj7d.js";
140
+ } from "./index-n9ry04hw.js";
141
141
  import {
142
142
  buildEscalationBriefing,
143
143
  readRecentEscalations
144
- } from "./index-0y5yvag6.js";
144
+ } from "./index-xj9260dh.js";
145
145
  import {
146
146
  parsePorcelainV2Snapshot,
147
147
  resolveCommitCountSince,
@@ -169,7 +169,7 @@ import {
169
169
  resolveRemoteUrlIdentity,
170
170
  resolveRemoteUrlIdentityAsync,
171
171
  switchPrFeedbackTrackingCandidateAsync
172
- } from "./index-v30zmakk.js";
172
+ } from "./index-9ztsfved.js";
173
173
  import {
174
174
  buildCorrelationId,
175
175
  buildIssueUrl,
@@ -190,13 +190,13 @@ import {
190
190
  sweepStale,
191
191
  unsubscribe,
192
192
  updateSnapshot
193
- } from "./index-qg6qn99c.js";
193
+ } from "./index-bkscmz4z.js";
194
194
  import {
195
195
  WORKTREE_LIFECYCLE_LOCK_FILE,
196
196
  recordWorktreeProvisioningOwner,
197
197
  removeWorktreeProvisioningOwner,
198
198
  scanWorktreeProvisioningOwnersForRecovery
199
- } from "./index-84r9rydf.js";
199
+ } from "./index-pxdc0qn1.js";
200
200
  import {
201
201
  getLanguageForExtension
202
202
  } from "./index-pt7h91zc.js";
@@ -225,7 +225,7 @@ import {
225
225
  swarmOverwriteCandidates,
226
226
  trackedDirtyCandidates,
227
227
  transientBackoff
228
- } from "./index-tnnxvq2f.js";
228
+ } from "./index-bb2rx8k2.js";
229
229
  import {
230
230
  EPIC_MODE_CONFIG_DISABLED_MESSAGE,
231
231
  PlanRecoverySupersededError,
@@ -257,7 +257,7 @@ import {
257
257
  updateEpicRecord,
258
258
  updateTaskStatus,
259
259
  withPlanLifecycleLock
260
- } from "./index-y81sw9vt.js";
260
+ } from "./index-mzx33w6e.js";
261
261
  import {
262
262
  containsControlChars,
263
263
  containsPathTraversal,
@@ -274,7 +274,7 @@ import {
274
274
  resolveSpeckitProjection,
275
275
  validateSpeckit,
276
276
  writeProjectedSpecSync
277
- } from "./index-6pc5j9rb.js";
277
+ } from "./index-nreezgrd.js";
278
278
  import {
279
279
  clearWorktreeMergeStatus,
280
280
  getAllWorktreeMergeFailures,
@@ -306,7 +306,7 @@ import {
306
306
  transitionTaskWorkflowEvidenceWithStatus,
307
307
  withTaskEvidenceTransaction,
308
308
  writeWorkflowWalFile
309
- } from "./index-5hbb3088.js";
309
+ } from "./index-3zzxrwaf.js";
310
310
  import {
311
311
  isPathUnderSwarmWorktreeBase,
312
312
  listLiveLaneOwners,
@@ -315,7 +315,7 @@ import {
315
315
  recordLiveLaneOwner,
316
316
  removeWorktree,
317
317
  resolveWorktreeBaseDir
318
- } from "./index-7e9mqse6.js";
318
+ } from "./index-61m1jw7p.js";
319
319
  import {
320
320
  GitBinaryMissingError,
321
321
  GitSpawnCwdError,
@@ -358,7 +358,7 @@ import {
358
358
  scanBackgroundCoderReservationsForAdmission,
359
359
  scanDelegationsForRecovery,
360
360
  sweepStaleDelegations
361
- } from "./index-wg1mt92h.js";
361
+ } from "./index-jhk4000q.js";
362
362
  import {
363
363
  MAX_EVENT_LOG_ENTRIES,
364
364
  _internals,
@@ -370,7 +370,7 @@ import {
370
370
  recordHiveKnowledgeEvent,
371
371
  recordKnowledgeEvent,
372
372
  resolveKnowledgeEventsPath
373
- } from "./index-mx74665q.js";
373
+ } from "./index-8pyg2qnw.js";
374
374
  import {
375
375
  commitDisplayedMembership,
376
376
  commitEmptyRetrieval,
@@ -383,7 +383,7 @@ import {
383
383
  queryLiveMemberships,
384
384
  reconcilePhaseClose,
385
385
  recordPhaseCloseIntent
386
- } from "./index-v85gn9jm.js";
386
+ } from "./index-61fa8hg7.js";
387
387
  import {
388
388
  sanitizeContextText
389
389
  } from "./index-m9zzj4ee.js";
@@ -394,7 +394,7 @@ import {
394
394
  readSwarmFileAsync,
395
395
  safeHook,
396
396
  validateSwarmPath
397
- } from "./index-xez06sc1.js";
397
+ } from "./index-820pzqd6.js";
398
398
  import {
399
399
  bunFile,
400
400
  bunSpawn,
@@ -414,18 +414,18 @@ import {
414
414
  validateActionableFields,
415
415
  validateLesson,
416
416
  validateSkillPath
417
- } from "./index-xrghsqg3.js";
417
+ } from "./index-vj0zede7.js";
418
418
  import {
419
419
  MAX_CURATION_PROPOSALS,
420
420
  authorizeCuration,
421
421
  buildConfigFingerprintInput
422
- } from "./index-d31b2zvf.js";
422
+ } from "./index-2mx2gn97.js";
423
423
  import {
424
424
  cohortConfigFingerprint
425
425
  } from "./index-rtry5xyf.js";
426
426
  import {
427
427
  resolveWorktreeIsolationConfig
428
- } from "./index-gc9dvmy7.js";
428
+ } from "./index-4rrff8k6.js";
429
429
  import {
430
430
  RetrospectiveEvidenceSchema
431
431
  } from "./index-g22dps7x.js";
@@ -437,7 +437,7 @@ import {
437
437
  clearScopeBindings,
438
438
  readAuthoritativeScopeBindingSet,
439
439
  readDeclaredScopeFilesFromBindings
440
- } from "./index-cfs1k1eh.js";
440
+ } from "./index-ge7vn1vz.js";
441
441
  import {
442
442
  approvedSnapshotCoversPlan,
443
443
  clearPlanLedgerForReset,
@@ -454,17 +454,18 @@ import {
454
454
  replayFromLedgerWithStatus,
455
455
  resolvePlanningProfile,
456
456
  takeSnapshotEvent
457
- } from "./index-drf91t9h.js";
457
+ } from "./index-fmbqyqqw.js";
458
458
  import {
459
459
  CORE_EVENT_LOCKED,
460
460
  appendCoreEventSync,
461
461
  appendCoreEventsSync,
462
462
  finalizeCoreEventsForClose,
463
+ getCoderRetryEscalationActions,
463
464
  getCoreEventCoverage,
464
465
  hasSpecDriftAuditEvent,
465
466
  hasTaskRepairAuditEvent,
466
467
  readCoreEvents
467
- } from "./index-e4hj8r57.js";
468
+ } from "./index-h349p91m.js";
468
469
  import {
469
470
  DEFAULT_QA_GATES,
470
471
  computeProfileHash,
@@ -472,7 +473,7 @@ import {
472
473
  getEffectiveGates,
473
474
  getProfileLookupForIdentity,
474
475
  setGatesForIdentity
475
- } from "./index-xt4q610f.js";
476
+ } from "./index-p5pgjp7n.js";
476
477
  import {
477
478
  MAX_COORDINATION_STATE_LIST_ROWS,
478
479
  deleteCoordinationImports,
@@ -483,7 +484,7 @@ import {
483
484
  listCoordinationStates,
484
485
  transitionCoordinationState,
485
486
  withCoordinationTransaction
486
- } from "./index-rqxwv4q5.js";
487
+ } from "./index-nr1pj3hy.js";
487
488
  import {
488
489
  DURABILITY_CLASSES,
489
490
  closeAllProjectDbs,
@@ -492,7 +493,7 @@ import {
492
493
  projectDbExists,
493
494
  projectDbPath,
494
495
  withImmediateTransaction
495
- } from "./index-wrn4khfb.js";
496
+ } from "./index-w00dj8p5.js";
496
497
  import {
497
498
  canonicalExistingFilesystemPath,
498
499
  canonicalPathForFutureIo,
@@ -512,7 +513,7 @@ import {
512
513
  observeModelLimitResolution,
513
514
  observeStoreHealth,
514
515
  readLearningHealth
515
- } from "./index-tdpfecs3.js";
516
+ } from "./index-hc6wa3yg.js";
516
517
  import {
517
518
  appendKnowledge,
518
519
  appendRejectedLesson,
@@ -543,7 +544,7 @@ import {
543
544
  transactFile,
544
545
  transactKnowledge,
545
546
  wordBigrams
546
- } from "./index-vjwmcxz4.js";
547
+ } from "./index-f900029m.js";
547
548
  import {
548
549
  readTailJsonl,
549
550
  readTailJsonlDetailed,
@@ -564,13 +565,13 @@ import {
564
565
  resolveLinkDir,
565
566
  sanitizeLinkId,
566
567
  writeLinkPointer
567
- } from "./index-yk1vnpzx.js";
568
+ } from "./index-2bc7zfw3.js";
568
569
  import {
569
570
  atomicWriteFile
570
- } from "./index-mjmsq8t7.js";
571
+ } from "./index-w7d8gcj0.js";
571
572
  import {
572
573
  withEvidenceLock
573
- } from "./index-89j5h1j9.js";
574
+ } from "./index-4s6kdsfr.js";
574
575
  import {
575
576
  assertProjectRoot
576
577
  } from "./index-t7hmqgjy.js";
@@ -584,7 +585,7 @@ import {
584
585
  pseudonymousRef,
585
586
  resolveLineageSalt,
586
587
  telemetry
587
- } from "./index-4s3770gs.js";
588
+ } from "./index-6dtt0brw.js";
588
589
  import {
589
590
  SESSION_KEY_SEPARATOR,
590
591
  canonicalRootKey,
@@ -610,7 +611,7 @@ import {
610
611
  matchTempGrammar,
611
612
  parseTargetBasename,
612
613
  resetSwarmArtifactCache
613
- } from "./index-p4xmq6aa.js";
614
+ } from "./index-ywb5er8g.js";
614
615
  import {
615
616
  PlanSchema,
616
617
  TaskStatusSchema,
@@ -628,7 +629,7 @@ import {
628
629
  loadPluginConfig,
629
630
  loadPluginConfigWithMeta,
630
631
  resolveEpicConfig
631
- } from "./index-bd4szzja.js";
632
+ } from "./index-weewx5nx.js";
632
633
  import {
633
634
  GIT_BINARY_ENV_VAR,
634
635
  addDeferredWarning,
@@ -661,7 +662,7 @@ import {
661
662
  resolveContextWindow,
662
663
  resolveGeneratedAgentRole,
663
664
  stripKnownSwarmPrefix
664
- } from "./index-rfcb9f54.js";
665
+ } from "./index-t1t93qm0.js";
665
666
  import {
666
667
  AGENT_TOOL_MAP,
667
668
  ALL_AGENT_NAMES,
@@ -3463,7 +3464,7 @@ async function importLegacyPrWorkflowGateStateIfNeeded(directory, sessionID, all
3463
3464
  return null;
3464
3465
  throw error2;
3465
3466
  }
3466
- const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-0fb280b2.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3467
+ const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-n6bj3dnn.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3467
3468
  if (!legacy)
3468
3469
  return null;
3469
3470
  const namespace = workflowGateStateCoordinationNamespace(sessionID);
@@ -3597,7 +3598,7 @@ async function deleteStateWhileLocked(directory, sessionID, options = {}) {
3597
3598
  let recoveryState = null;
3598
3599
  if (!currentAuthoritative) {
3599
3600
  if (options.allowSalvagedRead) {
3600
- const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-0fb280b2.js");
3601
+ const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-n6bj3dnn.js");
3601
3602
  recoveryState = (await readPrWorkflowGateStateForRecovery(directory, normalizedSessionID))?.state ?? null;
3602
3603
  }
3603
3604
  if (!recoveryState) {
@@ -4867,6 +4868,15 @@ function appendCompositionDiagnostic(diagnostics, message) {
4867
4868
  return;
4868
4869
  diagnostics.push(message.slice(0, MAX_BASE_COVERAGE_DIAGNOSTIC_CHARS));
4869
4870
  }
4871
+ var VERDICT_ROW_IDENTIFIER_CHARSET = /^[A-Za-z0-9._:-]+$/;
4872
+ function boundVerdictRowIdentifier(raw) {
4873
+ if (raw === undefined || raw === "")
4874
+ return "(missing)";
4875
+ if (!VERDICT_ROW_IDENTIFIER_CHARSET.test(raw))
4876
+ return "(invalid-id)";
4877
+ const redacted = redactSecrets(raw).slice(0, 64);
4878
+ return VERDICT_ROW_IDENTIFIER_CHARSET.test(redacted) ? redacted : "(redacted)";
4879
+ }
4870
4880
  var REVIEWER_ITEM_BINDING_KEY_PREFIX = "item:";
4871
4881
  function reviewerItemBindingKey(itemId) {
4872
4882
  return `${REVIEWER_ITEM_BINDING_KEY_PREFIX}${itemId}`;
@@ -4891,6 +4901,7 @@ function composePrReviewPhaseVerdicts(directory, state, phase, ctx, exhaustive =
4891
4901
  const claims = new Map;
4892
4902
  const contributingBatchIds = [];
4893
4903
  const diagnostics = [];
4904
+ const deferredQuarantineDiagnostics = [];
4894
4905
  const satisfiedObligations = new Set;
4895
4906
  const scannedBatches = [];
4896
4907
  const laneFailureReasons = new Map;
@@ -4945,8 +4956,8 @@ function composePrReviewPhaseVerdicts(directory, state, phase, ctx, exhaustive =
4945
4956
  const arities = [
4946
4957
  ...new Set(quarantined.map((stray) => stray.arity))
4947
4958
  ].sort((a, b) => a - b);
4948
- const ids = quarantined.map((stray) => redactSecrets(stray.itemId).slice(0, 64)).filter((value, index, all) => all.indexOf(value) === index).slice(0, 8);
4949
- appendCompositionDiagnostic(diagnostics, `${phase} lane "${qualified.expectedLane.laneId}" quarantined ${quarantined.length} illegal-arity ${quarantined[0]?.marker ?? "verdict"} row(s) (arities ${arities.join(", ")}; item ids ${ids.map((id) => `"${id}"`).join(", ")}); quarantined rows carry no verdict`);
4959
+ const ids = quarantined.map((stray) => stray.itemId).filter((value, index, all) => all.indexOf(value) === index).slice(0, 8);
4960
+ deferredQuarantineDiagnostics.push(`${phase} lane "${qualified.expectedLane.laneId}" quarantined ${quarantined.length} illegal-arity ${quarantined[0]?.marker ?? "verdict"} row(s) (arities ${arities.join(", ")}; item ids ${ids.map((id) => `"${id}"`).join(", ")}); quarantined rows carry no verdict`);
4950
4961
  }
4951
4962
  if (!verdictRowsContainOnlyAssignedIds(markerRows, declaredItems)) {
4952
4963
  appendCompositionDiagnostic(diagnostics, `${phase} lane "${qualified.expectedLane.laneId}" contains an unassigned verdict row; it contributes no claims`);
@@ -5023,6 +5034,9 @@ function composePrReviewPhaseVerdicts(directory, state, phase, ctx, exhaustive =
5023
5034
  }) : undefined;
5024
5035
  appendCompositionDiagnostic(diagnostics, `declared ${phase} lane "${obligation}" produced no successful exact artifact${journalMessage ? `; last rejected write_pr_review_artifact: ${journalMessage}` : ""}${failureReason ? `: ${failureReason}` : ""}`);
5025
5036
  }
5037
+ for (const message of deferredQuarantineDiagnostics) {
5038
+ appendCompositionDiagnostic(diagnostics, message);
5039
+ }
5026
5040
  const composition = {
5027
5041
  claims,
5028
5042
  requiredInventory,
@@ -5053,14 +5067,14 @@ function indexVerdictRows(text, marker) {
5053
5067
  if (fields.length !== legalArity) {
5054
5068
  quarantined.push({
5055
5069
  marker,
5056
- itemId: fields[1] ?? "(missing)",
5070
+ itemId: boundVerdictRowIdentifier(fields[1]),
5057
5071
  arity: fields.length
5058
5072
  });
5059
5073
  continue;
5060
5074
  }
5061
5075
  if (row.recoveredOverflow) {
5062
5076
  const recovery = row.overflowClass;
5063
- const itemId2 = fields[1] ?? "(missing)";
5077
+ const itemId2 = boundVerdictRowIdentifier(fields[1]);
5064
5078
  recoveries.push({ marker, itemId: itemId2, recovery });
5065
5079
  warn("PR_REVIEW recovered a legacy verdict row with unescaped pipe overflow", {
5066
5080
  marker,
@@ -5130,7 +5144,7 @@ function analyzePrReviewVerdictRowContract(text, itemIds, phase, reviewerClaims)
5130
5144
  const marker = phase === "reviewer" ? "[REVIEWED]" : "[CRITIC]";
5131
5145
  const assigned = new Set(itemIds);
5132
5146
  const { markerRows, parsed, recoveries, quarantined } = parsePrReviewVerdictRows(text, itemIds, phase, reviewerClaims);
5133
- const observedIds = markerRows.map((fields) => fields[1] || "(missing)");
5147
+ const observedIds = markerRows.map((fields) => assigned.has(fields[1] ?? "") ? fields[1] ?? "" : boundVerdictRowIdentifier(fields[1]));
5134
5148
  const unexpectedIds = [
5135
5149
  ...new Set(observedIds.filter((itemId) => !assigned.has(itemId)))
5136
5150
  ];
@@ -5300,8 +5314,12 @@ var PrReviewVerdictSettlementItemSchema = exports_external.object({
5300
5314
  itemId: exports_external.string().trim().min(1),
5301
5315
  sourceBatchId: exports_external.string().trim().min(1),
5302
5316
  sourceLaneId: exports_external.string().trim().min(1),
5303
- disposition: exports_external.literal("liveness_dead"),
5304
- evidenceClass: exports_external.literal("liveness"),
5317
+ disposition: exports_external.enum([
5318
+ "liveness_dead",
5319
+ "verdict_contract_dead",
5320
+ "resource_dead"
5321
+ ]),
5322
+ evidenceClass: exports_external.enum(["liveness", "verdict_contract", "resource"]),
5305
5323
  terminalStatus: exports_external.enum(["stale", "cancelled", "error"])
5306
5324
  }).strict();
5307
5325
  var PrReviewVerdictSettlementReceiptSchema = exports_external.object({
@@ -5315,11 +5333,26 @@ var PrReviewVerdictSettlementReceiptSchema = exports_external.object({
5315
5333
  function verdictSettlementRelativePath(runId, phase) {
5316
5334
  return path6.join("pr-review", runId, `verdict-settlement.${phase}.json`);
5317
5335
  }
5318
- function isLivenessTerminalLaneRecord(record) {
5336
+ function typedDeadDisclosureClassForRecord(record) {
5319
5337
  if (record.status !== "cancelled" && record.status !== "stale" && record.status !== "error") {
5320
- return false;
5338
+ return null;
5321
5339
  }
5322
- return record.terminalResult?.result.workflowLaneFailureClass === "liveness" || record.result?.workflowLaneFailureClass === "liveness";
5340
+ const terminalClass = record.terminalResult?.result.workflowLaneFailureClass ?? null;
5341
+ const resultClass = record.result?.workflowLaneFailureClass ?? null;
5342
+ for (const cls of [terminalClass, resultClass]) {
5343
+ switch (cls) {
5344
+ case "liveness":
5345
+ return "liveness";
5346
+ case "verdict_contract":
5347
+ case "contract":
5348
+ return "verdict_contract";
5349
+ case "resource":
5350
+ return "resource";
5351
+ default:
5352
+ break;
5353
+ }
5354
+ }
5355
+ return null;
5323
5356
  }
5324
5357
  function deriveVerdictSettlementAdmission(args) {
5325
5358
  const { directory, prHeadSha, phase, window, unclaimed } = args;
@@ -5361,17 +5394,30 @@ function deriveVerdictSettlementAdmission(args) {
5361
5394
  };
5362
5395
  }
5363
5396
  const record = read.value.find((candidate) => candidate.batchId === batch.batchId && candidate.laneId === lane.laneId && candidate.mode === expectedMode && candidate.workspace?.prHeadSha === prHeadSha);
5364
- if (!record || !isLivenessTerminalLaneRecord(record)) {
5397
+ if (!record) {
5398
+ return {
5399
+ admitted: false,
5400
+ reason: `item ${itemId} still has a non-admissible owner lane ${lane.laneId} (missing delegation record)`,
5401
+ items: []
5402
+ };
5403
+ }
5404
+ if (record.status === "completed") {
5405
+ continue;
5406
+ }
5407
+ const disclosure = typedDeadDisclosureClassForRecord(record);
5408
+ if (!disclosure) {
5409
+ const blockingClass = record.terminalResult?.result.workflowLaneFailureClass ?? record.result?.workflowLaneFailureClass ?? "classless";
5365
5410
  return {
5366
5411
  admitted: false,
5367
- reason: `item ${itemId} still has a non-liveness-terminal owner lane ${lane.laneId}`,
5412
+ reason: `item ${itemId} still has a non-admissible owner lane ${lane.laneId} (${blockingClass})`,
5368
5413
  items: []
5369
5414
  };
5370
5415
  }
5371
5416
  dead.push({
5372
5417
  batchId: batch.batchId,
5373
5418
  laneId: lane.laneId,
5374
- status: record.status === "cancelled" || record.status === "error" ? record.status : "stale"
5419
+ status: record.status === "cancelled" || record.status === "error" ? record.status : "stale",
5420
+ disclosure
5375
5421
  });
5376
5422
  }
5377
5423
  if (itemAttemptBatchIds.size < 1 + PR_REVIEW_VERDICT_RETRY_BUDGET) {
@@ -5381,18 +5427,43 @@ function deriveVerdictSettlementAdmission(args) {
5381
5427
  items: []
5382
5428
  };
5383
5429
  }
5430
+ if (dead.length === 0) {
5431
+ return {
5432
+ admitted: false,
5433
+ reason: `item ${itemId} has no typed-dead owner lane to cite (completed owners consume attempts but are never terminality evidence)`,
5434
+ items: []
5435
+ };
5436
+ }
5384
5437
  const first = dead[0];
5385
5438
  items.push({
5386
5439
  itemId,
5387
5440
  sourceBatchId: first.batchId,
5388
5441
  sourceLaneId: first.laneId,
5389
- disposition: "liveness_dead",
5390
- evidenceClass: "liveness",
5442
+ disposition: `${first.disclosure}_dead`,
5443
+ evidenceClass: first.disclosure,
5391
5444
  terminalStatus: first.status
5392
5445
  });
5393
5446
  }
5394
5447
  return { admitted: true, reason: "admitted", items };
5395
5448
  }
5449
+ function deriveVerdictAttemptCounts(args) {
5450
+ const attemptsRequired = 1 + PR_REVIEW_VERDICT_RETRY_BUDGET;
5451
+ return args.unclaimed.map((itemId) => {
5452
+ const batches = new Set;
5453
+ for (const batch of args.window) {
5454
+ if (batch.lanes.some((lane) => (lane.reviewItemIds ?? []).includes(itemId))) {
5455
+ batches.add(batch.batchId);
5456
+ }
5457
+ }
5458
+ const attemptsUsed = batches.size;
5459
+ return {
5460
+ itemId,
5461
+ attemptsUsed,
5462
+ attemptsRequired,
5463
+ remaining: Math.max(0, attemptsRequired - attemptsUsed)
5464
+ };
5465
+ });
5466
+ }
5396
5467
  function buildVerdictSettlementReceipt(args) {
5397
5468
  return {
5398
5469
  schemaVersion: VERDICT_SETTLEMENT_SCHEMA_VERSION,
@@ -5619,7 +5690,8 @@ var PR_REVIEW_FAILURE_CLASS_SAFE_DETAILS = {
5619
5690
  resource: "lane exhausted its resource budget before producing valid output",
5620
5691
  deadline: "lane passed its collection deadline without valid terminal output",
5621
5692
  liveness: "lane was abandoned by its host (presumed-stale sweep or unobservable host session) without an observed agent failure",
5622
- operator_cancelled: "lane was cancelled by an explicit operator action (confirmed cancel or human force abort), not by a host or provider failure"
5693
+ operator_cancelled: "lane was cancelled by an explicit operator action (confirmed cancel or human force abort), not by a host or provider failure",
5694
+ verdict_contract: "verdict lane failed its verdict-row or transport contract (issue #3311 typed terminal class)"
5623
5695
  };
5624
5696
  var PrReviewUnresolvedDimensionRecordSchema = exports_external.object({
5625
5697
  dimension: exports_external.enum(PR_REVIEW_BASE_DIMENSION_IDS),
@@ -5830,8 +5902,22 @@ function latestTypedFailureForBaseDimension(directory, state, dimension) {
5830
5902
  const eventlessFailure = !terminal && CIRCUIT_TERMINAL_DELEGATION_STATUSES.has(record.status);
5831
5903
  const result = terminal?.result ?? record.result;
5832
5904
  const failureClass = result?.workflowLaneFailureClass;
5833
- if (!terminal && !eventlessFailure || !failureClass)
5905
+ if (!terminal && !eventlessFailure || !failureClass) {
5906
+ if ((terminal?.status ?? record.status) === "error" && result?.terminalErrorClass != null) {
5907
+ const candidateResource = {
5908
+ failureClass: "resource",
5909
+ terminalEventId: terminal ? terminal.eventId : `eventless:${record.status}:${result?.digest ?? ""}`,
5910
+ recordedAt: terminal ? terminal.recordedAt : record.completedAt ?? record.updatedAt,
5911
+ batchId: batch.batchId,
5912
+ laneId: lane.laneId
5913
+ };
5914
+ if (!latest || candidateResource.recordedAt > latest.recordedAt || candidateResource.recordedAt === latest.recordedAt && candidateResource.terminalEventId > latest.terminalEventId) {
5915
+ latest = candidateResource;
5916
+ }
5917
+ continue;
5918
+ }
5834
5919
  continue;
5920
+ }
5835
5921
  if ((terminal?.status ?? record.status) === "completed")
5836
5922
  continue;
5837
5923
  const candidate = {
@@ -7194,6 +7280,7 @@ async function ensurePrWorkflowSkillContractsFresh(directory, mode, options = {}
7194
7280
  }
7195
7281
 
7196
7282
  // src/state.ts
7283
+ init_agent_names();
7197
7284
  init_constants();
7198
7285
  init_loader();
7199
7286
  import { randomUUID as randomUUID5 } from "crypto";
@@ -11390,7 +11477,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
11390
11477
  return extracted === expectedSessionId;
11391
11478
  }
11392
11479
  async function inspectStandardWorktreeCollisionOwnership(identity) {
11393
- const collisionOwnership = await import("./worktree-collision-ownership-shtk6dsk.js");
11480
+ const collisionOwnership = await import("./worktree-collision-ownership-84qyqars.js");
11394
11481
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
11395
11482
  }
11396
11483
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -11818,7 +11905,7 @@ async function precreateStandardWorktreeSession(args) {
11818
11905
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
11819
11906
  if (laneProfile) {
11820
11907
  try {
11821
- const { writeLaneProfileToDiskReal } = await import("./core-6hyt1hg6.js");
11908
+ const { writeLaneProfileToDiskReal } = await import("./core-6kkm2vrz.js");
11822
11909
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
11823
11910
  } catch {}
11824
11911
  }
@@ -12812,7 +12899,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
12812
12899
  }
12813
12900
  clearWorktreeMergeStatus(statusKey);
12814
12901
  try {
12815
- const { removeLaneProfileFromDiskReal } = await import("./core-6hyt1hg6.js");
12902
+ const { removeLaneProfileFromDiskReal } = await import("./core-6kkm2vrz.js");
12816
12903
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
12817
12904
  } catch {}
12818
12905
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -18531,6 +18618,167 @@ function collectAudienceYamlList(lines, start, end) {
18531
18618
  nextIndex: i - 1
18532
18619
  };
18533
18620
  }
18621
+ function scanFlowChar(ch, prev, state) {
18622
+ if (!state.alive)
18623
+ return;
18624
+ if (state.quote) {
18625
+ if (state.escaped) {
18626
+ state.escaped = false;
18627
+ } else if (state.quote === '"' && ch === "\\") {
18628
+ state.escaped = true;
18629
+ } else if (ch === state.quote) {
18630
+ state.quote = undefined;
18631
+ state.atValueStart = false;
18632
+ }
18633
+ return;
18634
+ }
18635
+ if ((ch === '"' || ch === "'") && state.atValueStart) {
18636
+ state.quote = ch;
18637
+ state.atValueStart = false;
18638
+ return;
18639
+ }
18640
+ if (ch === "#" && state.depth === 0 && (prev === "" || /\s/.test(prev))) {
18641
+ state.alive = false;
18642
+ return;
18643
+ }
18644
+ if (ch === "{" || ch === "[") {
18645
+ state.closers.push(ch === "{" ? "}" : "]");
18646
+ state.depth += 1;
18647
+ state.atValueStart = true;
18648
+ return;
18649
+ }
18650
+ if (ch === "}" || ch === "]") {
18651
+ const expected = state.closers[state.closers.length - 1];
18652
+ if (expected !== ch) {
18653
+ state.depth = -1;
18654
+ state.alive = false;
18655
+ return;
18656
+ }
18657
+ state.closers.pop();
18658
+ state.depth -= 1;
18659
+ state.atValueStart = false;
18660
+ return;
18661
+ }
18662
+ if (ch === ",") {
18663
+ state.atValueStart = true;
18664
+ return;
18665
+ }
18666
+ if (ch === ":") {
18667
+ state.atValueStart = true;
18668
+ return;
18669
+ }
18670
+ if (!/\s/.test(ch))
18671
+ state.atValueStart = false;
18672
+ }
18673
+ function initialFlowState() {
18674
+ return {
18675
+ depth: 0,
18676
+ closers: [],
18677
+ quote: undefined,
18678
+ escaped: false,
18679
+ atValueStart: true,
18680
+ alive: true
18681
+ };
18682
+ }
18683
+ function stripFlowTrailingComment(value) {
18684
+ const state = initialFlowState();
18685
+ let prev = "";
18686
+ for (let i = 0;i < value.length; i++) {
18687
+ const ch = value[i];
18688
+ scanFlowChar(ch, prev, state);
18689
+ if (!state.alive || state.depth < 0)
18690
+ return value.slice(0, i).trimEnd();
18691
+ prev = ch;
18692
+ }
18693
+ return value.trimEnd();
18694
+ }
18695
+ function parseMetadataFlowMap(raw) {
18696
+ const trimmed = stripFlowTrailingComment(raw.trim());
18697
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}"))
18698
+ return null;
18699
+ const inner = trimmed.slice(1, -1).trim();
18700
+ const pairs = [];
18701
+ const duplicateKeys = new Set;
18702
+ if (inner === "")
18703
+ return { pairs, duplicateKeys };
18704
+ const segments = [];
18705
+ const state = initialFlowState();
18706
+ let current = "";
18707
+ let prev = "";
18708
+ for (const ch of inner) {
18709
+ if (ch === "," && state.depth === 0 && !state.quote) {
18710
+ segments.push(current);
18711
+ current = "";
18712
+ prev = ch;
18713
+ continue;
18714
+ }
18715
+ scanFlowChar(ch, prev, state);
18716
+ if (!state.alive || state.depth < 0)
18717
+ return null;
18718
+ current += ch;
18719
+ prev = ch;
18720
+ }
18721
+ if (state.quote || state.depth !== 0 || state.closers.length > 0)
18722
+ return null;
18723
+ segments.push(current);
18724
+ const seen = new Set;
18725
+ for (const segment of segments) {
18726
+ const text = segment.trim();
18727
+ const pair = text.match(/^(?:"([^"]+)"|'([^']+)'|([A-Za-z_][A-Za-z0-9_-]*))\s*:\s*(.*)$/);
18728
+ if (!pair || pair[4].trim() === "")
18729
+ return null;
18730
+ const key = (pair[1] ?? pair[2] ?? pair[3] ?? "").toLowerCase();
18731
+ if (seen.has(key))
18732
+ duplicateKeys.add(key);
18733
+ seen.add(key);
18734
+ pairs.push([pair[1] ?? pair[2] ?? pair[3] ?? "", pair[4].trim()]);
18735
+ }
18736
+ return { pairs, duplicateKeys };
18737
+ }
18738
+ function stripInlineMetadataComment(rawValue) {
18739
+ const trimmed = rawValue.trim();
18740
+ if (trimmed.startsWith("#"))
18741
+ return "";
18742
+ return stripFlowTrailingComment(trimmed);
18743
+ }
18744
+ function flowNeedsContinuation(value) {
18745
+ const state = initialFlowState();
18746
+ let prev = "";
18747
+ for (const ch of value) {
18748
+ scanFlowChar(ch, prev, state);
18749
+ if (!state.alive || state.depth < 0)
18750
+ return false;
18751
+ prev = ch;
18752
+ }
18753
+ return state.depth > 0 || state.quote !== undefined;
18754
+ }
18755
+ function consumeFlowContinuation(firstValue, lines, start, end) {
18756
+ const state = initialFlowState();
18757
+ let prev = "";
18758
+ const advance = (chunk) => {
18759
+ for (const ch of chunk) {
18760
+ scanFlowChar(ch, prev, state);
18761
+ if (!state.alive || state.depth < 0)
18762
+ return false;
18763
+ prev = ch;
18764
+ }
18765
+ return true;
18766
+ };
18767
+ if (!advance(firstValue))
18768
+ return null;
18769
+ const parts = [firstValue.trim()];
18770
+ for (let j = start;j < end; j++) {
18771
+ const line = lines[j] ?? "";
18772
+ parts.push(line.trim());
18773
+ prev = " ";
18774
+ if (!advance(` ${line}`))
18775
+ return null;
18776
+ if (state.depth === 0 && !state.quote && state.closers.length === 0) {
18777
+ return { value: parts.join(" "), endIndex: j };
18778
+ }
18779
+ }
18780
+ return null;
18781
+ }
18534
18782
  function collectMetadataChildren(lines, start, end) {
18535
18783
  const children = new Map;
18536
18784
  const duplicateKeys = new Set;
@@ -18632,12 +18880,51 @@ function parseSkillFrontmatter(content, skillPath) {
18632
18880
  if (key === "metadata") {
18633
18881
  duplicateMetadataBlocks += 1;
18634
18882
  if (duplicateMetadataBlocks === 1) {
18635
- const collected = collectMetadataChildren(lines, i + 1, end);
18636
- metadataChildren = collected.children;
18637
- if (collected.duplicateKeys.has("audience")) {
18638
- audience = { status: "invalid", values: [] };
18883
+ const inline = stripInlineMetadataComment(rawValue);
18884
+ if (inline !== "") {
18885
+ let flowValue = inline;
18886
+ let cursorEnd = i;
18887
+ if (flowValue.startsWith("{") && flowNeedsContinuation(flowValue)) {
18888
+ const consumed = consumeFlowContinuation(flowValue, lines, i + 1, end);
18889
+ if (consumed === null) {
18890
+ audience = { status: "invalid", values: [] };
18891
+ continue;
18892
+ }
18893
+ flowValue = consumed.value;
18894
+ cursorEnd = consumed.endIndex;
18895
+ }
18896
+ if (flowValue.startsWith("{")) {
18897
+ const flow = parseMetadataFlowMap(flowValue);
18898
+ if (flow === null) {
18899
+ audience = { status: "invalid", values: [] };
18900
+ } else {
18901
+ const children = new Map;
18902
+ for (const [rawKey, rawValueOfPair] of flow.pairs) {
18903
+ const childKey = rawKey.toLowerCase();
18904
+ if (children.has(childKey))
18905
+ continue;
18906
+ children.set(childKey, {
18907
+ inline: stripQuotes(rawValueOfPair.trim()).replace(/''/g, "'"),
18908
+ listItems: []
18909
+ });
18910
+ }
18911
+ metadataChildren = children;
18912
+ if (flow.duplicateKeys.has("audience")) {
18913
+ audience = { status: "invalid", values: [] };
18914
+ }
18915
+ }
18916
+ } else {
18917
+ audience = { status: "invalid", values: [] };
18918
+ }
18919
+ i = cursorEnd;
18920
+ } else {
18921
+ const collected = collectMetadataChildren(lines, i + 1, end);
18922
+ metadataChildren = collected.children;
18923
+ if (collected.duplicateKeys.has("audience")) {
18924
+ audience = { status: "invalid", values: [] };
18925
+ }
18926
+ i = collected.nextIndex;
18639
18927
  }
18640
- i = collected.nextIndex;
18641
18928
  }
18642
18929
  continue;
18643
18930
  }
@@ -20650,9 +20937,23 @@ async function repairTaskWorkflowUnderPlanLock(options) {
20650
20937
  transitionId: existingWal.transitionId
20651
20938
  };
20652
20939
  }
20653
- if (existingWal === null && options.currentPlanStatus !== "completed" && options.currentPlanStatus !== "blocked" && options.currentPlanStatus !== "closed") {
20940
+ if (existingWal === null && options.currentPlanStatus !== "completed" && options.currentPlanStatus !== "blocked" && options.currentPlanStatus !== "closed" && options.currentPlanStatus !== "in_progress") {
20654
20941
  throw new Error(`TASK_REPAIR_NOT_BACKWARD: cannot create a repair from plan status ${options.currentPlanStatus}`);
20655
20942
  }
20943
+ if (existingWal === null && options.currentPlanStatus === "in_progress") {
20944
+ let wedgeEscalated = false;
20945
+ try {
20946
+ wedgeEscalated = getCoderRetryEscalationActions(options.directory, options.taskId, snapshot.retryEpoch).has("user_escalation") && snapshot.retryCount >= 3;
20947
+ } catch (error2) {
20948
+ if (error2 instanceof Error && error2.message === "CORE_EVENT_AUTHORITY_INDEX_UNREADABLE") {
20949
+ throw new Error("TASK_REPAIR_ESCALATION_INDEX_UNREADABLE: cannot verify the retry-escalation wedge evidence for an in_progress repair " + "(the core-event authority index is unreadable). The unreadable index is not content-restored: a later authority write rebuilds it from subsequent events only, so escalation evidence already folded out of the retained events window stays lost, and producers may refuse while the index is unreadable. " + "Recovery without discarding the events trail: re-dispatching the task re-runs the retry ladder from scratch and re-records the rungs; /swarm reset is the destructive full reset (it clears the plan, the events trail, and run state \u2014 session state is reset-session's charter and survives). Admission refuses to guess.");
20950
+ }
20951
+ throw error2;
20952
+ }
20953
+ if (!wedgeEscalated) {
20954
+ throw new Error(`TASK_REPAIR_NOT_BACKWARD: cannot create a repair from plan status ${options.currentPlanStatus} \u2014 an in_progress task is repairable only once the coder retry ladder has recorded a durable user_escalation for its current retry epoch with retryCount at the threshold; no such record is visible for this task.`);
20955
+ }
20956
+ }
20656
20957
  const wal = existingWal ?? {
20657
20958
  version: 1,
20658
20959
  state: "PREPARED",
@@ -27163,6 +27464,48 @@ var SPEC_DRIFT_BLOCKED_TOOLS = new Set([
27163
27464
  var toolCallsSinceLastWrite = new Map;
27164
27465
  var noOpWarningIssued = new Set;
27165
27466
  var noOpStrongWarningIssued = new Set;
27467
+ // src/hooks/host-boundary.ts
27468
+ init_agent_names();
27469
+ init_schema();
27470
+ init_logger();
27471
+ function resolveMessageTransformContext(output) {
27472
+ const messages = Array.isArray(output?.messages) ? output.messages : [];
27473
+ let sessionID;
27474
+ for (const m of messages) {
27475
+ const sid = m?.info?.sessionID;
27476
+ if (typeof sid === "string" && sid.length > 0) {
27477
+ sessionID = sid;
27478
+ break;
27479
+ }
27480
+ }
27481
+ let agent = resolveAgentOptional(sessionID);
27482
+ if (!agent) {
27483
+ for (let i = messages.length - 1;i >= 0; i--) {
27484
+ const info = messages[i]?.info;
27485
+ if (info?.role === "user" && typeof info.agent === "string" && info.agent) {
27486
+ agent = info.agent;
27487
+ break;
27488
+ }
27489
+ }
27490
+ }
27491
+ const callerRole = agent ? stripKnownSwarmPrefix(agent).toLowerCase() : undefined;
27492
+ return {
27493
+ sessionID,
27494
+ agent,
27495
+ callerRole,
27496
+ isArchitect: callerRole === ORCHESTRATOR_NAME,
27497
+ isDelegate: !!agent && !!callerRole && callerRole !== ORCHESTRATOR_NAME
27498
+ };
27499
+ }
27500
+ function resolveAgentOptional(sessionID) {
27501
+ if (typeof sessionID === "string" && sessionID.length > 0) {
27502
+ const mapped = swarmState.activeAgent.get(sessionID);
27503
+ if (mapped && mapped !== "unknown")
27504
+ return mapped;
27505
+ }
27506
+ return;
27507
+ }
27508
+
27166
27509
  // src/hooks/delegation-gate.ts
27167
27510
  var EvidenceTaskIdPlanSchema = exports_external.object({
27168
27511
  phases: exports_external.array(exports_external.object({
@@ -28042,6 +28385,7 @@ var swarmState = {
28042
28385
  activeToolCalls: defaultRunContext.activeToolCalls,
28043
28386
  toolAggregates: defaultRunContext.toolAggregates,
28044
28387
  activeAgent: defaultRunContext.activeAgent,
28388
+ primaryOwnerBySession: new Map,
28045
28389
  delegationChains: defaultRunContext.delegationChains,
28046
28390
  pendingEvents: 0,
28047
28391
  opencodeClient: null,
@@ -28070,6 +28414,7 @@ function resetSwarmState() {
28070
28414
  swarmState.activeToolCalls.clear();
28071
28415
  swarmState.toolAggregates.clear();
28072
28416
  swarmState.activeAgent.clear();
28417
+ swarmState.primaryOwnerBySession.clear();
28073
28418
  swarmState.delegationChains.clear();
28074
28419
  swarmState.pendingEvents = 0;
28075
28420
  swarmState.lastBudgetBySession.clear();
@@ -28296,6 +28641,7 @@ function sweepStaleSessions(staleDurationMs = STALE_SESSION_TTL_MS, now = Date.n
28296
28641
  swarmState.delegationChains.delete(id);
28297
28642
  clearDispatchLineageForSession(id);
28298
28643
  swarmState.activeAgent.delete(id);
28644
+ swarmState.primaryOwnerBySession.delete(id);
28299
28645
  }
28300
28646
  return staleIds;
28301
28647
  }
@@ -28467,6 +28813,7 @@ function endAgentSession(sessionId, directory) {
28467
28813
  swarmState.agentSessions.delete(sessionId);
28468
28814
  swarmState.activeAgent.delete(sessionId);
28469
28815
  swarmState.delegationChains.delete(sessionId);
28816
+ swarmState.primaryOwnerBySession.delete(sessionId);
28470
28817
  clearDispatchLineageForSession(sessionId);
28471
28818
  clearRealtimeLearningNudgeSession(sessionId);
28472
28819
  resetSessionQueue(sessionId);
@@ -28698,6 +29045,14 @@ function ensureAgentSession(sessionId, agentName, directory) {
28698
29045
  }
28699
29046
  return session;
28700
29047
  }
29048
+ var SWARM_AGENT_NAME_SET = new Set(ALL_AGENT_NAMES);
29049
+ var SWARM_SUBAGENT_NAME_SET = new Set(ALL_SUBAGENT_NAMES);
29050
+ var NON_OWNABLE_AGENT_NAMES = new Set([
29051
+ "compaction",
29052
+ "title",
29053
+ "summary",
29054
+ "explore"
29055
+ ]);
28701
29056
  function recordSessionWorkspaceRoot(sessionId, laneRoot) {
28702
29057
  const trimmed = laneRoot.trim();
28703
29058
  if (!trimmed)
@@ -29246,7 +29601,7 @@ function clearCriticalShownIds(sessionID) {
29246
29601
  async function rehydratePrSubscriptions(sessionID, directory) {
29247
29602
  const map = new Map;
29248
29603
  try {
29249
- const { listActive: listActive2 } = await import("./pr-subscriptions-mc2mvjkj.js");
29604
+ const { listActive: listActive2 } = await import("./pr-subscriptions-mme9gb5e.js");
29250
29605
  const records = await listActive2(directory);
29251
29606
  for (const record of records) {
29252
29607
  if (record.sessionID !== sessionID)
@@ -29852,7 +30207,7 @@ async function readPrWorkflowGateState(directory, sessionID) {
29852
30207
  }
29853
30208
  return state;
29854
30209
  }
29855
- function isLivenessTerminalLaneRecord2(record) {
30210
+ function isLivenessTerminalLaneRecord(record) {
29856
30211
  if (record.status !== "cancelled" && record.status !== "stale" && record.status !== "error") {
29857
30212
  return false;
29858
30213
  }
@@ -29997,7 +30352,7 @@ async function submitPrReviewResultCore(directory, childSessionId, input) {
29997
30352
  const preliminary = childRead.records.filter((record2) => record2.subagentSessionId === child && record2.correlationId === child && (record2.mode === "swarm-pr-review:base" || record2.mode === "swarm-pr-review:micro"));
29998
30353
  let repairRecord = null;
29999
30354
  if (preliminary.length !== 1) {
30000
- const repairCandidates = childRead.records.filter((candidate) => candidate.parentSessionId === child && (candidate.mode === "swarm-pr-review:base" || candidate.mode === "swarm-pr-review:micro") && (input.batchId === undefined || input.batchId === candidate.batchId) && (input.laneId === undefined || input.laneId === candidate.laneId) && isLivenessTerminalLaneRecord2(candidate));
30355
+ const repairCandidates = childRead.records.filter((candidate) => candidate.parentSessionId === child && (candidate.mode === "swarm-pr-review:base" || candidate.mode === "swarm-pr-review:micro") && (input.batchId === undefined || input.batchId === candidate.batchId) && (input.laneId === undefined || input.laneId === candidate.laneId) && isLivenessTerminalLaneRecord(candidate));
30001
30356
  if (repairCandidates.length !== 1) {
30002
30357
  return {
30003
30358
  status: "rejected",
@@ -31923,6 +32278,34 @@ async function rollbackPrReviewBaseAdmissionIfUnlaunched(directory, sessionID, b
31923
32278
  return true;
31924
32279
  }));
31925
32280
  }
32281
+ async function rollbackPrReviewValidationBatchIfUnlaunched(directory, sessionID, batchId) {
32282
+ const normalizedSessionID = normalizeSessionID(sessionID);
32283
+ const normalizedBatchId = normalizeBatchId(batchId);
32284
+ return withPrWorkflowCheckoutMutationLock(directory, async () => withSessionStateMutation(directory, normalizedSessionID, async () => {
32285
+ const state = await readPrWorkflowGateState(directory, normalizedSessionID);
32286
+ if (!state || state.mode !== "PR_REVIEW")
32287
+ return false;
32288
+ const previous = state.prReviewValidationBatches ?? [];
32289
+ if (!previous.some((batch) => batch.batchId === normalizedBatchId)) {
32290
+ return false;
32291
+ }
32292
+ const batchRead = findByBatchIdDetailed(directory, normalizedBatchId, {
32293
+ parentSessionId: normalizedSessionID
32294
+ });
32295
+ if (batchRead.status === "uncertain") {
32296
+ warnDelegationReadUncertainOnce("validation batch rollback existence guard", batchRead);
32297
+ return false;
32298
+ }
32299
+ if (batchRead.value.length > 0)
32300
+ return false;
32301
+ await writeStateWhileLocked(directory, {
32302
+ ...state,
32303
+ updatedAt: isoNow(),
32304
+ prReviewValidationBatches: previous.filter((batch) => batch.batchId !== normalizedBatchId)
32305
+ });
32306
+ return true;
32307
+ }));
32308
+ }
31926
32309
  var TERMINAL_FAILED_DELEGATION_STATUSES2 = CIRCUIT_TERMINAL_DELEGATION_STATUSES;
31927
32310
  var MAX_COVER_UNIVERSE_BITS = 12;
31928
32311
  function encodeConsolidatedLaneKey(owned) {
@@ -32331,7 +32714,12 @@ async function assertPrReviewValidationSettled(directory, sessionID, phase, gate
32331
32714
  if (!admission.admitted) {
32332
32715
  const named = composed.unclaimed.slice(0, MAX_UNCLAIMED_ITEMS_IN_MESSAGE);
32333
32716
  const overflow = composed.unclaimed.length - named.length;
32334
- throw new Error(`BLOCKED: PR_REVIEW ${requiredPhase} items lack an authenticated verdict from any successful lane: ${named.join(", ")}` + (overflow > 0 ? ` (+${overflow} more)` : "") + (composed.diagnostics.length > 0 ? `; diagnostics: ${composed.diagnostics.join(" | ")}` : "") + `; N-of-M settlement not admissible (${admission.reason}); re-dispatch the unclaimed items to exhaust the retry budget with controller-observed liveness evidence, or complete downgrade-only once admissible`);
32717
+ const attemptCounts = deriveVerdictAttemptCounts({
32718
+ window: prReviewPhaseWindow2(state, requiredPhase),
32719
+ unclaimed: composed.unclaimed
32720
+ });
32721
+ const attemptText = attemptCounts.map((count2) => `${count2.itemId}: attempts: ${count2.attemptsUsed} of ${count2.attemptsRequired} (remaining: ${count2.remaining})`).join("; ");
32722
+ throw new Error(`BLOCKED: PR_REVIEW ${requiredPhase} items lack an authenticated verdict from any successful lane: ${named.join(", ")}` + (overflow > 0 ? ` (+${overflow} more)` : "") + (composed.diagnostics.length > 0 ? `; diagnostics: ${composed.diagnostics.join(" | ")}` : "") + `; N-of-M settlement not admissible (${admission.reason}); per-item attempts: ${attemptText}; settle or re-dispatch the unclaimed items to exhaust the retry budget, or complete downgrade-only once admissible`);
32335
32723
  }
32336
32724
  const runId = state.prReviewArtifactRunId ?? state.prReviewReservedRunId;
32337
32725
  if (!runId) {
@@ -36600,6 +36988,9 @@ function prReviewPhaseWindow2(state, phase) {
36600
36988
  }
36601
36989
  return (latestCouncilIndex >= 0 ? all.slice(latestCouncilIndex + 1) : all).filter((batch) => batch.phase === "reviewer");
36602
36990
  }
36991
+ function prReviewPhaseWindowForStatus(state, phase) {
36992
+ return prReviewPhaseWindow2(state, phase);
36993
+ }
36603
36994
  function reviewerSubagentSessionIds2(directory, state) {
36604
36995
  const forbidden = new Set(state.prReviewRetiredReviewerSessionIds ?? []);
36605
36996
  for (const reviewerBatch of (state.prReviewValidationBatches ?? []).filter((batch) => batch.phase === "reviewer")) {
@@ -46282,9 +46673,9 @@ function hashContent(content) {
46282
46673
  return createHash29("sha1").update(content).digest("hex");
46283
46674
  }
46284
46675
  async function loadConfigForPolicyCurator(directory) {
46285
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-q2v7px9y.js");
46676
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-amcjvk8a.js");
46286
46677
  try {
46287
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-hd3d7rcw.js");
46678
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-r7ayh42s.js");
46288
46679
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
46289
46680
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
46290
46681
  } catch {
@@ -49342,7 +49733,7 @@ async function resolveCuratorLLMDelegate(directory, mode, sessionId) {
49342
49733
  const seam = _internals50.createCuratorLLMDelegate;
49343
49734
  if (seam)
49344
49735
  return seam(directory, mode, sessionId);
49345
- const { createCuratorLLMDelegate } = await import("./curator-llm-factory-ykpty14a.js");
49736
+ const { createCuratorLLMDelegate } = await import("./curator-llm-factory-58ec737y.js");
49346
49737
  return createCuratorLLMDelegate(directory, mode, sessionId);
49347
49738
  }
49348
49739
  async function reconcileCloseTerminalStateForPlan(directory, targetPlan, options) {
@@ -49737,7 +50128,7 @@ async function runFinalizeStage(ctx) {
49737
50128
  }
49738
50129
  }
49739
50130
  try {
49740
- const { CuratorConfigSchema: CCS } = await import("./schema-q2v7px9y.js");
50131
+ const { CuratorConfigSchema: CCS } = await import("./schema-amcjvk8a.js");
49741
50132
  const { config: pmLoadedConfig } = _internals50.loadPluginConfigWithMeta(ctx.directory);
49742
50133
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
49743
50134
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -53770,7 +54161,7 @@ function serializeAgentSession(s) {
53770
54161
  }
53771
54162
  async function writeSnapshot(directory, state) {
53772
54163
  try {
53773
- const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-9ekvft16.js");
54164
+ const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-nv6e4svp.js");
53774
54165
  await ensureSnapshotCoordinationReady(directory);
53775
54166
  const snapshot = {
53776
54167
  version: 3,
@@ -56177,15 +56568,92 @@ async function getSkillVersion(skillPath) {
56177
56568
  return 1;
56178
56569
  }
56179
56570
  }
56571
+ var BLOCK_CHILD_NON_STRING_SCALAR = /^(?:-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?|-?\.[0-9]+|true|false|null|yes|no|on|off|~|\d{4}-\d{2}-\d{2}(?:[T ].*)?)$/i;
56572
+ function quoteBlockChildValue(value) {
56573
+ const t = value.trim();
56574
+ const quoted = t.startsWith('"') && t.endsWith('"') && t.length >= 2 || t.startsWith("'") && t.endsWith("'") && t.length >= 2;
56575
+ if (quoted)
56576
+ return t;
56577
+ if (/^\[.*\]$/.test(t) || /^\{.*\}$/.test(t)) {
56578
+ return `'${t.replace(/'/g, "''")}'`;
56579
+ }
56580
+ if (BLOCK_CHILD_NON_STRING_SCALAR.test(t)) {
56581
+ return `'${t.replace(/'/g, "''")}'`;
56582
+ }
56583
+ return t;
56584
+ }
56180
56585
  function buildDeterministicRevision(currentContent, currentVersion, violationContexts) {
56181
56586
  const nextVersion = currentVersion + 1;
56182
56587
  const isoDate = new Date().toISOString().slice(0, 10);
56183
56588
  const violationLines = violationContexts.map((v) => `- ${v.agent} (${v.taskId}): ${v.reviewerNotes ?? v.verdict}`).join(`
56184
56589
  `);
56590
+ const split = splitSkillFrontmatter(currentContent);
56591
+ const fmLines = split.frontmatter.split(`
56592
+ `);
56593
+ const inlineLineIndex = fmLines.findIndex((line) => /^metadata[ \t]*:[ \t]*\S/i.test(line));
56594
+ const inlineRawValue = inlineLineIndex === -1 ? "" : stripInlineMetadataComment((/^[^:]*:[ \t]*(.*)$/.exec(fmLines[inlineLineIndex] ?? "") ?? [
56595
+ "",
56596
+ ""
56597
+ ])[1] ?? "");
56598
+ const hasInlineMetadata = inlineLineIndex !== -1 && inlineRawValue !== "";
56599
+ let skipSurgery = false;
56600
+ if (hasInlineMetadata && inlineLineIndex >= 0) {
56601
+ let flowValue = inlineRawValue;
56602
+ let lastInlineLine = inlineLineIndex;
56603
+ if (flowValue.startsWith("{") && flowNeedsContinuation(flowValue)) {
56604
+ const consumed = consumeFlowContinuation(flowValue, fmLines, inlineLineIndex + 1, fmLines.length);
56605
+ if (consumed === null) {
56606
+ skipSurgery = true;
56607
+ } else {
56608
+ flowValue = consumed.value;
56609
+ lastInlineLine = consumed.endIndex;
56610
+ }
56611
+ }
56612
+ if (!skipSurgery) {
56613
+ if (flowValue.startsWith("{")) {
56614
+ const flow = parseMetadataFlowMap(flowValue);
56615
+ if (flow === null) {
56616
+ skipSurgery = true;
56617
+ } else {
56618
+ const childLines = ["metadata:"];
56619
+ let versionHandled = false;
56620
+ for (const [rawKey, rawValue] of flow.pairs) {
56621
+ const key = rawKey.toLowerCase();
56622
+ if (key === "version") {
56623
+ if (versionHandled)
56624
+ continue;
56625
+ childLines.push(` version: "${nextVersion}"`);
56626
+ versionHandled = true;
56627
+ continue;
56628
+ }
56629
+ childLines.push(` ${rawKey}: ${quoteBlockChildValue(rawValue)}`);
56630
+ }
56631
+ if (!versionHandled) {
56632
+ childLines.push(` version: "${nextVersion}"`);
56633
+ }
56634
+ fmLines.splice(inlineLineIndex, lastInlineLine - inlineLineIndex + 1, ...childLines);
56635
+ for (let li = 0;li < fmLines.length; li++) {
56636
+ const column0 = /^version:\s*"?(\d+)"?\s*$/.exec(fmLines[li] ?? "");
56637
+ if (column0) {
56638
+ fmLines[li] = `version: ${nextVersion}`;
56639
+ break;
56640
+ }
56641
+ }
56642
+ }
56643
+ } else {
56644
+ const childLines = [
56645
+ "metadata:",
56646
+ ` legacy_inline: '${flowValue.replace(/'/g, "''")}'`,
56647
+ ` version: "${nextVersion}"`
56648
+ ];
56649
+ fmLines.splice(inlineLineIndex, 1, ...childLines);
56650
+ }
56651
+ }
56652
+ }
56185
56653
  const revisionSection = [
56186
56654
  "## Revision Notes",
56187
56655
  "",
56188
- `### Version ${nextVersion} (${isoDate})`,
56656
+ skipSurgery ? `### Not revised (${isoDate}) \u2014 unparseable inline metadata; fix the metadata: line` : `### Version ${nextVersion} (${isoDate})`,
56189
56657
  "",
56190
56658
  `Revised due to ${violationContexts.length} violation(s):`,
56191
56659
  violationLines,
@@ -56194,31 +56662,38 @@ function buildDeterministicRevision(currentContent, currentVersion, violationCon
56194
56662
  ""
56195
56663
  ].join(`
56196
56664
  `);
56197
- let result = currentContent;
56198
- const split = splitSkillFrontmatter(result);
56199
- let fm = split.frontmatter;
56200
- const nestedVersion = /^(\s+)version:\s*"?(\d+)"?\s*[ \t]*$/m.exec(fm);
56201
- if (nestedVersion?.[1]) {
56202
- fm = fm.replace(/^(\s+)version:\s*"?(\d+)"?\s*[ \t]*$/m, `${nestedVersion[1]}version: "${nextVersion}"`);
56203
- } else if (/^version:\s*"?(\d+)"?\s*[ \t]*$/m.test(fm)) {
56204
- fm = fm.replace(/^version:\s*"?(\d+)"?\s*[ \t]*$/m, `version: ${nextVersion}`);
56205
- } else if (/^(\s+)confidence:\s*/m.test(fm)) {
56206
- const indent = /^(\s+)confidence:/m.exec(fm)?.[1] ?? "";
56207
- fm = fm.replace(/^(\s+)(confidence:[^\n]*)$/m, `$1$2
56665
+ let result;
56666
+ if (skipSurgery) {
56667
+ result = split.frontmatter + split.body;
56668
+ } else {
56669
+ let fm = fmLines.join(`
56670
+ `);
56671
+ if (!hasInlineMetadata) {
56672
+ const nestedVersion = /^(\s+)version:\s*"?(\d+)"?\s*[ \t]*$/m.exec(fm);
56673
+ if (nestedVersion?.[1]) {
56674
+ fm = fm.replace(/^(\s+)version:\s*"?(\d+)"?\s*[ \t]*$/m, `${nestedVersion[1]}version: "${nextVersion}"`);
56675
+ } else if (/^version:\s*"?(\d+)"?\s*[ \t]*$/m.test(fm)) {
56676
+ fm = fm.replace(/^version:\s*"?(\d+)"?\s*[ \t]*$/m, `version: ${nextVersion}`);
56677
+ } else if (/^(\s+)confidence:\s*/m.test(fm)) {
56678
+ const indent = /^(\s+)confidence:/m.exec(fm)?.[1] ?? "";
56679
+ fm = fm.replace(/^(\s+)(confidence:[^\n]*)$/m, `$1$2
56208
56680
  ${indent}version: "${nextVersion}"`);
56209
- } else if (/^confidence:[^\n]*$/m.test(fm) && !/^metadata:[ \t]*$/m.test(fm)) {
56210
- fm = fm.replace(/^(confidence:[^\n]*)$/m, `$1
56681
+ } else if (/^confidence:[^\n]*$/m.test(fm) && !/^metadata:(?:[ \t]*#[^\n]*)?[ \t]*$/im.test(fm)) {
56682
+ fm = fm.replace(/^(confidence:[^\n]*)$/m, `$1
56211
56683
  version: ${nextVersion}`);
56212
- } else if (/^metadata:[ \t]*$/m.test(fm)) {
56213
- fm = fm.replace(/^(metadata:[ \t]*\n)/m, `$1 version: "${nextVersion}"
56214
- `);
56215
- } else {
56216
- fm = fm.replace(/\n(---[ \t]*(?:\r?\n|$))/, `
56684
+ } else if (/^metadata:(?:[ \t]*#[^\n]*)?[ \t]*$/im.test(fm)) {
56685
+ fm = fm.replace(/^metadata:(?:[ \t]*(#[^\n]*))?[ \t]*$/im, (_matched, comment) => comment ? `metadata: ${comment.trim()}
56686
+ version: "${nextVersion}"` : `metadata:
56687
+ version: "${nextVersion}"`);
56688
+ } else {
56689
+ fm = fm.replace(/\n(---[ \t]*(?:\r?\n|$))/, `
56217
56690
  metadata:
56218
56691
  version: "${nextVersion}"
56219
56692
  $1`);
56693
+ }
56694
+ }
56695
+ result = fm + split.body;
56220
56696
  }
56221
- result = fm + split.body;
56222
56697
  const revisionNotesPattern = /## Revision Notes\n[\s\S]*?(?=\n## Source Knowledge IDs|$)/;
56223
56698
  if (revisionNotesPattern.test(result)) {
56224
56699
  result = result.replace(revisionNotesPattern, "");
@@ -56826,7 +57301,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
56826
57301
  };
56827
57302
  }
56828
57303
  async function sweepActiveNearDuplicates(directory, options = {}) {
56829
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-hd3d7rcw.js");
57304
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-r7ayh42s.js");
56830
57305
  const { config } = loadPluginConfigWithMeta2(directory);
56831
57306
  const sweepConfig = config.learning?.dedup_sweep;
56832
57307
  if (sweepConfig?.enabled === false)
@@ -57950,7 +58425,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
57950
58425
  }
57951
58426
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
57952
58427
  try {
57953
- const skillModule = await import("./skill-generator-30bjrvcc.js");
58428
+ const skillModule = await import("./skill-generator-v59hhybn.js");
57954
58429
  for (const cand of skillCandidates) {
57955
58430
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
57956
58431
  continue;
@@ -58422,7 +58897,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
58422
58897
  } catch {}
58423
58898
  }
58424
58899
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
58425
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-8hrnc4bd.js");
58900
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-cf6m9y0s.js");
58426
58901
  for (const { id } of contradictedEntries) {
58427
58902
  try {
58428
58903
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -59254,7 +59729,7 @@ async function runCuratorPostMortem(directory, options = {}) {
59254
59729
  warnings.push("Failed to collect knowledge summary.");
59255
59730
  }
59256
59731
  try {
59257
- const { getScanStatus } = await import("./scan-cursor-g74j6gcr.js");
59732
+ const { getScanStatus } = await import("./scan-cursor-fdpxbx4f.js");
59258
59733
  const scanStatus = await getScanStatus(directory);
59259
59734
  if (scanStatus.remaining_estimate > 0) {
59260
59735
  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.`);
@@ -59426,9 +59901,9 @@ var _internals72 = {
59426
59901
  verifyPostMortemKnowledgeActions,
59427
59902
  repairPostMortemActions,
59428
59903
  loadDefaultKnowledgeConfig: async (directory) => {
59429
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-q2v7px9y.js");
59904
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-amcjvk8a.js");
59430
59905
  try {
59431
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-hd3d7rcw.js");
59906
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-r7ayh42s.js");
59432
59907
  const loaded = loadPluginConfigWithMeta2(directory);
59433
59908
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
59434
59909
  } catch {
@@ -59436,11 +59911,11 @@ var _internals72 = {
59436
59911
  }
59437
59912
  },
59438
59913
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
59439
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-bzy7cess.js");
59914
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-z8xzxh9f.js");
59440
59915
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
59441
59916
  },
59442
59917
  checkHivePromotions: async (entries2, knowledgeConfig, directory) => {
59443
- const { checkHivePromotions } = await import("./hive-promoter-vvgdsx8s.js");
59918
+ const { checkHivePromotions } = await import("./hive-promoter-fz7ep8h4.js");
59444
59919
  return checkHivePromotions(entries2, knowledgeConfig, directory);
59445
59920
  },
59446
59921
  applyProposalTriage: async (directory, triage) => {
@@ -59449,7 +59924,7 @@ var _internals72 = {
59449
59924
  activateProposal,
59450
59925
  listSkills: listSkills2,
59451
59926
  sanitizeSlug
59452
- } = await import("./skill-generator-30bjrvcc.js");
59927
+ } = await import("./skill-generator-v59hhybn.js");
59453
59928
  const result = {
59454
59929
  approved: [],
59455
59930
  rejected: [],
@@ -59491,7 +59966,7 @@ var _internals72 = {
59491
59966
  return result;
59492
59967
  },
59493
59968
  readPriorDriftReports: async (directory) => {
59494
- const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-z83e3a60.js");
59969
+ const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-axcgdjy4.js");
59495
59970
  return readPriorDriftReports2(directory);
59496
59971
  },
59497
59972
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -67935,7 +68410,7 @@ function wireCloseInternals() {
67935
68410
  archiveEvidence,
67936
68411
  endAgentSession,
67937
68412
  flushAndDrainTelemetry: async () => {
67938
- const { flushAndDrainTelemetry } = await import("./telemetry-t3425cht.js");
68413
+ const { flushAndDrainTelemetry } = await import("./telemetry-6yv06xyz.js");
67939
68414
  return flushAndDrainTelemetry();
67940
68415
  },
67941
68416
  finalizeContextTelemetry,
@@ -69761,9 +70236,9 @@ var _internals80 = {
69761
70236
  loadPluginConfigWithMeta,
69762
70237
  loadCuratorDeps: async () => {
69763
70238
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate }] = await Promise.all([
69764
- import("./schema-q2v7px9y.js"),
69765
- import("./curator-bzy7cess.js"),
69766
- import("./curator-llm-factory-ykpty14a.js")
70239
+ import("./schema-amcjvk8a.js"),
70240
+ import("./curator-z8xzxh9f.js"),
70241
+ import("./curator-llm-factory-58ec737y.js")
69767
70242
  ]);
69768
70243
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate };
69769
70244
  }
@@ -72213,7 +72688,7 @@ async function computeCurationDiagnostics(directory, entries2) {
72213
72688
  let scanCompleted = false;
72214
72689
  let scanRemaining = 0;
72215
72690
  try {
72216
- const { getScanStatus } = await import("./scan-cursor-g74j6gcr.js");
72691
+ const { getScanStatus } = await import("./scan-cursor-fdpxbx4f.js");
72217
72692
  const status = await getScanStatus(directory);
72218
72693
  scanGeneration = status.generation;
72219
72694
  scanCompleted = status.completed;
@@ -72221,19 +72696,19 @@ async function computeCurationDiagnostics(directory, entries2) {
72221
72696
  } catch {}
72222
72697
  let configMatch = null;
72223
72698
  try {
72224
- const { isLinked: isLinked2 } = await import("./knowledge-link-5qt3pe5v.js");
72699
+ const { isLinked: isLinked2 } = await import("./knowledge-link-1f91bzcc.js");
72225
72700
  if (isLinked2(directory)) {
72226
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-q2v7px9y.js");
72701
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-amcjvk8a.js");
72227
72702
  let config;
72228
72703
  try {
72229
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-hd3d7rcw.js");
72704
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-r7ayh42s.js");
72230
72705
  const loaded = loadPluginConfigWithMeta2(directory);
72231
72706
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
72232
72707
  } catch {
72233
72708
  config = KnowledgeConfigSchema2.parse({});
72234
72709
  }
72235
72710
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
72236
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-m8ng2vm5.js");
72711
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-0smbd33w.js");
72237
72712
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
72238
72713
  const cohortFp = await readCohortConfigFingerprint(directory);
72239
72714
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -73682,7 +74157,7 @@ async function handleDoctorCommand(directory, args) {
73682
74157
  const result = runConfigDoctor(config, directory, planParallelizationEnabled);
73683
74158
  let output;
73684
74159
  if (enableAutoFix && result.hasAutoFixableIssues) {
73685
- const { runConfigDoctorWithFixes } = await import("./config-doctor-6w105xpy.js");
74160
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-4b0jb15n.js");
73686
74161
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
73687
74162
  applyLossy: true
73688
74163
  });
@@ -73720,7 +74195,7 @@ async function handleDoctorCommand(directory, args) {
73720
74195
  `;
73721
74196
  }
73722
74197
  try {
73723
- const { runModelPreflight } = await import("./model-preflight-1tsaksc7.js");
74198
+ const { runModelPreflight } = await import("./model-preflight-ry5jjnx4.js");
73724
74199
  const preflight = await runModelPreflight(config, swarmState.opencodeClient, { generatedAgentNames: swarmState.generatedAgentNames });
73725
74200
  const missingSelection = preflight.resolutions.filter((resolution) => resolution.status === "missing-selection");
73726
74201
  const unresolved = preflight.catalogAvailable ? preflight.resolutions.filter((resolution) => resolution.status === "unresolved") : [];
@@ -73754,7 +74229,7 @@ async function handleDoctorCommand(directory, args) {
73754
74229
  }
73755
74230
  } catch {}
73756
74231
  try {
73757
- const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-8av1860z.js");
74232
+ const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-hkjt6hv4.js");
73758
74233
  output += await renderKnowledgeReceiptPhaseIdSection(directory, enableAutoFix);
73759
74234
  } catch {}
73760
74235
  const strayDirs = detectStraySwarmDirs(directory);
@@ -75771,7 +76246,7 @@ async function handleEvidenceCommand(directory, args) {
75771
76246
  return formatTaskEvidenceMarkdown(evidenceData);
75772
76247
  }
75773
76248
  async function handleEvidenceSummaryCommand(directory) {
75774
- const { buildEvidenceSummary } = await import("./evidence-summary-service-ym7y7w5k.js");
76249
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-981cx8wa.js");
75775
76250
  const artifact = await buildEvidenceSummary(directory);
75776
76251
  if (!artifact) {
75777
76252
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -91556,48 +92031,6 @@ function parseDirectivesToVerifyBlock(text) {
91556
92031
  init_schema();
91557
92032
  init_logger();
91558
92033
 
91559
- // src/hooks/host-boundary.ts
91560
- init_agent_names();
91561
- init_schema();
91562
- init_logger();
91563
- function resolveMessageTransformContext(output) {
91564
- const messages = Array.isArray(output?.messages) ? output.messages : [];
91565
- let sessionID;
91566
- for (const m of messages) {
91567
- const sid = m?.info?.sessionID;
91568
- if (typeof sid === "string" && sid.length > 0) {
91569
- sessionID = sid;
91570
- break;
91571
- }
91572
- }
91573
- let agent = resolveAgentOptional(sessionID);
91574
- if (!agent) {
91575
- for (let i = messages.length - 1;i >= 0; i--) {
91576
- const info = messages[i]?.info;
91577
- if (info?.role === "user" && typeof info.agent === "string" && info.agent) {
91578
- agent = info.agent;
91579
- break;
91580
- }
91581
- }
91582
- }
91583
- const callerRole = agent ? stripKnownSwarmPrefix(agent).toLowerCase() : undefined;
91584
- return {
91585
- sessionID,
91586
- agent,
91587
- callerRole,
91588
- isArchitect: callerRole === ORCHESTRATOR_NAME,
91589
- isDelegate: !!agent && !!callerRole && callerRole !== ORCHESTRATOR_NAME
91590
- };
91591
- }
91592
- function resolveAgentOptional(sessionID) {
91593
- if (typeof sessionID === "string" && sessionID.length > 0) {
91594
- const mapped = swarmState.activeAgent.get(sessionID);
91595
- if (mapped)
91596
- return mapped;
91597
- }
91598
- return;
91599
- }
91600
-
91601
92034
  // src/hooks/knowledge-application.ts
91602
92035
  var import_proper_lockfile10 = __toESM(require_proper_lockfile(), 1);
91603
92036
  import { existsSync as existsSync59 } from "fs";
@@ -100240,7 +100673,7 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
100240
100673
  }
100241
100674
  const sdkOpts = signal ? { signal } : {};
100242
100675
  try {
100243
- const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-whmby20t.js");
100676
+ const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-795vmpe6.js");
100244
100677
  const createResult = await client.session.create({
100245
100678
  ...sessionId ? {
100246
100679
  body: {
@@ -102338,7 +102771,7 @@ async function cancelPrFeedbackLoopUnlocked(directory, sessionID, reason) {
102338
102771
  clearedEvents: []
102339
102772
  };
102340
102773
  try {
102341
- const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-0fb280b2.js");
102774
+ const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-n6bj3dnn.js");
102342
102775
  await cancelPrFeedbackPublication2(directory, sessionID, reason);
102343
102776
  } catch (err) {
102344
102777
  warn(`[pr-feedback-loop] cancelPrFeedbackPublication failed (fail-open): ${err instanceof Error ? err.message : String(err)}`);
@@ -112294,7 +112727,7 @@ async function handleResetSessionCommand(directory, args, sessionID) {
112294
112727
  "",
112295
112728
  "Session state cleared. Plan, evidence, and knowledge preserved.",
112296
112729
  "",
112297
- "In-memory circuit breakers and revision limits have been cleared. Durable per-task retry gates (the coder retry circuit breaker, bound to commit settlement in the events audit log and .swarm/evidence/) intentionally survive this reset. If a task is blocked with TASK_RETRY_CRITIC_REQUIRED waiting for a critic_sounding_board APPROVED verdict that was already obtained, have the architect record it with the approve_retry_sounding_board tool. A task left at rework_required also survives this reset; when the Stage B verdict did not require a code change, the architect can exit it with the recover_rework_task tool (issue #2755)."
112730
+ "In-memory circuit breakers and revision limits have been cleared. Durable per-task retry gates (the coder retry circuit breaker, bound to commit settlement in the events audit log and .swarm/evidence/) intentionally survive this reset. If a task is blocked with TASK_RETRY_CRITIC_REQUIRED waiting for a critic_sounding_board APPROVED verdict that was already obtained, have the architect record it with the approve_retry_sounding_board tool. A task left at rework_required also survives this reset; when the Stage B verdict did not require a code change, the architect can exit it with the recover_rework_task tool (issue #2755). A task wedged at TASK_RETRY_USER_ESCALATION_REQUIRED is exited with the audited update_task_status force repair (issue #3389; see docs/troubleshooting/recovery-runbook.md), which reopens the task " + "and clears the retry circuit \u2014 the task's plan status must " + "already be in_progress; a task still pending in the plan takes one ordinary in_progress status update first."
112298
112731
  ].join(`
112299
112732
  `);
112300
112733
  }
@@ -116230,7 +116663,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
116230
116663
  if (!input.dispatcher) {
116231
116664
  throw new Error("no evaluation dispatcher available (cannot run validation)");
116232
116665
  }
116233
- const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-rwya5yhg.js");
116666
+ const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-qe3fkzx5.js");
116234
116667
  const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
116235
116668
  const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals144.evaluateCandidateV1({
116236
116669
  projectRoot: input.directory,
@@ -118823,7 +119256,7 @@ function buildDetailedHelp(commandName, entry) {
118823
119256
  async function handleHelpCommand(ctx) {
118824
119257
  const targetCommand = ctx.args.join(" ");
118825
119258
  if (!targetCommand) {
118826
- const { buildHelpText } = await import("./index-5h5tj8wc.js");
119259
+ const { buildHelpText } = await import("./index-qqv9rr8k.js");
118827
119260
  return buildHelpText();
118828
119261
  }
118829
119262
  const tokens = targetCommand.split(/\s+/);
@@ -118837,7 +119270,7 @@ async function handleHelpCommand(ctx) {
118837
119270
  > Note: \`/swarm ${resolved.key}\` is a deprecated alias for \`/swarm ${aliasTarget}\`.` : detailed;
118838
119271
  }
118839
119272
  const similar = _internals39.findSimilarCommands(targetCommand);
118840
- const { buildHelpText: fullHelp } = await import("./index-5h5tj8wc.js");
119273
+ const { buildHelpText: fullHelp } = await import("./index-qqv9rr8k.js");
118841
119274
  if (similar.length > 0) {
118842
119275
  return `Command '/swarm ${targetCommand}' not found.
118843
119276
 
@@ -119165,7 +119598,7 @@ var COMMAND_REGISTRY = {
119165
119598
  },
119166
119599
  "guardrail explain": {
119167
119600
  handler: async (ctx) => {
119168
- const { handleGuardrailExplain } = await import("./guardrail-explain-1ethgkvp.js");
119601
+ const { handleGuardrailExplain } = await import("./guardrail-explain-23b0amne.js");
119169
119602
  return handleGuardrailExplain(ctx.directory, ctx.args);
119170
119603
  },
119171
119604
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -119175,7 +119608,7 @@ var COMMAND_REGISTRY = {
119175
119608
  },
119176
119609
  "guardrail reset": {
119177
119610
  handler: async (ctx) => {
119178
- const { handleGuardrailReset } = await import("./guardrail-reset-cqq3yk9s.js");
119611
+ const { handleGuardrailReset } = await import("./guardrail-reset-kt18vr45.js");
119179
119612
  return handleGuardrailReset(ctx.args, ctx.sessionID);
119180
119613
  },
119181
119614
  description: "Reset one exact active invocation/action circuit after repair",
@@ -119196,7 +119629,7 @@ var COMMAND_REGISTRY = {
119196
119629
  },
119197
119630
  "guardrail-log": {
119198
119631
  handler: async (ctx) => {
119199
- const { handleGuardrailLog } = await import("./guardrail-log-4f0jxq61.js");
119632
+ const { handleGuardrailLog } = await import("./guardrail-log-s2gxszvm.js");
119200
119633
  return handleGuardrailLog(ctx.directory, ctx.args);
119201
119634
  },
119202
119635
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -124520,4 +124953,4 @@ function getAgentConfigs(config, directory, sessionId, projectContext) {
124520
124953
  return result;
124521
124954
  }
124522
124955
 
124523
- export { resetActionCircuitExternally, getBlockingActionCircuit, resolveConfiguredAgentModel, resolveRegisteredAgentModel, resolveEffectiveAgentOverride, MAX_PARALLEL_VERDICT_TASKS, computeParallelVerdict, declaresWindowsWrapperLoose, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, getSharedClassifierGuardrailBlock, classifyCommand, resetArchitectPromptBudgetAdvisories, createArchitectAgent, createCoderAgent, GENERALIST_COUNCIL_PROMPT, SKEPTIC_COUNCIL_PROMPT, DOMAIN_EXPERT_COUNCIL_PROMPT, createCriticAgent, createCuratorAgent, createDesignerAgent, createDocsAgent, createResearcherAgent, SECURITY_CATEGORIES, createReviewerAgent, createSMEAgent, createTestEngineerAgent, _internals147 as _internals, stripSwarmPrefix, extractSwarmIdFromAgentName, resolveFallbackModel, getSwarmAgents, createAgents, resolvePrimaryAgentNames, getAgentConfigs, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, mergeWriteAnalyses, isPowerShellShaped, isPowerShellReadOnlyPipeline, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, resolveWindowsWriteAuthority, getAgentSession, parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, laneChildSessionAgents, recordLaneChildSession, assertTaskIdNotForeignLaneSession, getStandardWorktreeDegradationReason, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, runSerializedWithMergeBacks, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals24 as _internals1, redactSecrets, prWorkflowSessionFileStem, ensurePrWorkflowSafeParentDirectory, writePrWorkflowAtomicJson, PrWorkflowCheckoutMutationTimeoutError, withPrWorkflowCheckoutMutationLock, PR_REVIEW_REPORT_VERDICTS, allowedPrReviewReportVerdicts, normalizePrReviewPartialBaseCoverageRecord, rollbackPrReviewPartialBaseCoverageAdmission, readPrReviewTerminalCoverageForReport, PR_REVIEW_REQUIRED_MICRO_LANE_IDS, PR_REVIEW_DEPTH_TIER_THRESHOLDS, PR_REVIEW_BASE_LANE_FLOORS, PR_REVIEW_TIER_L_CONSOLIDATED_LANE_FLOOR, PR_REVIEW_MICRO_LANE_FLOORS, computePrReviewDepthTier, MAX_PR_REVIEW_SUBMIT_REJECTIONS, MAX_PR_REVIEW_VERDICT_REJECTIONS, MAX_PR_FEEDBACK_INVENTORY_AMENDMENTS, activatePrWorkflow, appendPrWorkflowSkillContractAdvisories, readPrWorkflowGateState, recordPrReviewSubmitRejection, latestPrReviewSubmitRejectionMessage, recordPrReviewVerdictRejection, latestPrReviewVerdictRejectionForLane, submitPrReviewResult, withPrWorkflowCheckoutPreparationLock, withInactivePrWorkflowCheckoutRestoreLock, clearPrWorkflowGateState, terminalizePrWorkflowGateForSession2 as terminalizePrWorkflowGateForSession, PR_WORKFLOW_PROBE_SKIPPED_NO_BUDGET_REASON, collectPrWorkflowPendingLaneLiveness, settlePresumedStalePrWorkflowLanes, abortPrWorkflow, recoverArmedPrWorkflow, bindPrWorkflowHead, rebindPrFeedbackHead, bindPrReviewBase, assertCurrentCheckoutHead, assertPrReviewCleanCheckout, enforcePrWorkflowDispatchLanesAsync, PrReviewResilienceCircuitOpenError, PrReviewResilienceRetryExhaustedError, enforcePrReviewBaseDimensions, rollbackPrReviewBaseAdmissionIfUnlaunched, admitPrReviewPartialBaseCoverage2 as admitPrReviewPartialBaseCoverage, assertPrReviewBaseCoverageSettled2 as assertPrReviewBaseCoverageSettled, recordPrReviewMicroFamilyDispatch, recordPrReviewValidationBatch, assertPrReviewValidationSettled, declarePrFeedbackInventory, enforcePrFeedbackVerificationOwnership, assertPrFeedbackVerificationSettled, recordPrFeedbackStageA, recordPrFeedbackGateBatch, assertPrFeedbackGatePhaseSettled, assertPrFeedbackReadyToPublish, invalidatePrFeedbackPublication, describePrWorkflowPublicationSection, findDanglingLivePublicationGeneration, recordPrFeedbackPushAttemptResult, cancelPrFeedbackPublication, resolvePrReviewWriterRunId, markPrReviewTriggerEvaluationComplete, bindPrReviewTriggerLedger, assertPrReviewArtifactBoundary, assertPrReviewArtifactRecordsMatchAuthoritativeVerdicts, markPrReviewArtifactBoundary, markPrReviewHandoffComplete, readAuthoritativeFindingPolicy, readPrReviewFinalFindingPolicyForReport, transitionPrReviewToFeedback, declarePrFeedbackScope, resolvePrFeedbackScopeDeclaration, consumePrFeedbackScopeDeclaration, validatePrFeedbackScopeBinding, enforcePrWorkflowToolBefore, readPrReviewReentryBindingContext, hasActivePrReviewReentryAuthorization, reserveActivePrReviewReentryAuthorization, completePrWorkflow, _test_exports2 as _test_exports, normalizePrWorkflowShellCommand, describePrWorkflowRevisionDigestFailure, derivePrReviewCandidateInventoryForStatus, readPrReviewVerdictSettlementReceiptItems, readPrReviewVerdictSettlementEffectiveIds, readAuthoritativePrReviewCriticSettlements, readAuthoritativePrReviewCriticVerdicts, derivePrReviewPresentationOrder, derivePrReviewOrderUnstableItems, derivePrReviewReviewerSeverities, readAuthoritativePrReviewOrderAgreement, formatPrReviewLaneValidationFailure, validateExactStructuredReceiptCoverage2 as validateExactStructuredReceiptCoverage, validatePrReviewDiscoveryLaneCompletion2 as validatePrReviewDiscoveryLaneCompletion, validatePrWorkflowTransportRecovery, prReviewDiscoveryArtifactCoversLane, MAX_SALVAGED_SCHEMA_ERROR_CHARS, readPrWorkflowGateStateForRecovery, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleApproveWriteCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, DEFAULT_CI_DEADLINE_MS2 as DEFAULT_CI_DEADLINE_MS, createSignalCancellation, handleCiCommand, handleCiSimulateCommand, handleClarifyCommand, safeRealpathSync, createCuratorLLMDelegate, getCoChangePairs, startSnapshotCoordinationInitialization, ensureSnapshotCoordinationReady, retrySnapshotCoordinationInitialization, getSnapshotCoordinationStatus, beginSnapshotCoordinationReset, closeSnapshotCoordinationInitialization, markSnapshotCoordinationClosing, _snapshotCoordinationInternals, handleCloseCommand, _internals71 as _internals2, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals75 as _internals3, createHivePromoterHook, promoteToHive, promoteFromSwarm, createMemoryGateway, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getHostConfigDir, getPluginCachePaths, getPluginLockFilePaths, VERSION_PINNED_LEAF, discoverVersionPinnedCachePaths, readCachePackageVersion, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, computeQualityBudget, computeSastScan, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleBlueprintValidateCommand, handleBlueprintCurrentCommand, handleBlueprintHistoryCommand, handleBlueprintDiffCommand, handleBlueprintExportCommand, handleHarnessCandidateValidateCommand, handleHarnessCandidateShowCommand, handleHarnessCandidateDiffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, searchKnowledge, symbols, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleRecoverCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, isCommandFailure, COMMAND_REGISTRY, VALID_COMMANDS, _internals39 as _internals4, resolveCommand, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand };
124956
+ export { resetActionCircuitExternally, getBlockingActionCircuit, resolveConfiguredAgentModel, resolveRegisteredAgentModel, resolveEffectiveAgentOverride, MAX_PARALLEL_VERDICT_TASKS, computeParallelVerdict, declaresWindowsWrapperLoose, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, getSharedClassifierGuardrailBlock, classifyCommand, resetArchitectPromptBudgetAdvisories, createArchitectAgent, createCoderAgent, GENERALIST_COUNCIL_PROMPT, SKEPTIC_COUNCIL_PROMPT, DOMAIN_EXPERT_COUNCIL_PROMPT, createCriticAgent, createCuratorAgent, createDesignerAgent, createDocsAgent, createResearcherAgent, SECURITY_CATEGORIES, createReviewerAgent, createSMEAgent, createTestEngineerAgent, _internals147 as _internals, stripSwarmPrefix, extractSwarmIdFromAgentName, resolveFallbackModel, getSwarmAgents, createAgents, resolvePrimaryAgentNames, getAgentConfigs, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, mergeWriteAnalyses, isPowerShellShaped, isPowerShellReadOnlyPipeline, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, resolveWindowsWriteAuthority, getAgentSession, parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, laneChildSessionAgents, recordLaneChildSession, assertTaskIdNotForeignLaneSession, getStandardWorktreeDegradationReason, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, runSerializedWithMergeBacks, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals24 as _internals1, redactSecrets, prWorkflowSessionFileStem, ensurePrWorkflowSafeParentDirectory, writePrWorkflowAtomicJson, PrWorkflowCheckoutMutationTimeoutError, withPrWorkflowCheckoutMutationLock, PR_REVIEW_REPORT_VERDICTS, allowedPrReviewReportVerdicts, normalizePrReviewPartialBaseCoverageRecord, rollbackPrReviewPartialBaseCoverageAdmission, readPrReviewTerminalCoverageForReport, PR_REVIEW_REQUIRED_MICRO_LANE_IDS, PR_REVIEW_DEPTH_TIER_THRESHOLDS, PR_REVIEW_BASE_LANE_FLOORS, PR_REVIEW_TIER_L_CONSOLIDATED_LANE_FLOOR, PR_REVIEW_MICRO_LANE_FLOORS, computePrReviewDepthTier, MAX_PR_REVIEW_SUBMIT_REJECTIONS, MAX_PR_REVIEW_VERDICT_REJECTIONS, MAX_PR_FEEDBACK_INVENTORY_AMENDMENTS, activatePrWorkflow, appendPrWorkflowSkillContractAdvisories, readPrWorkflowGateState, recordPrReviewSubmitRejection, latestPrReviewSubmitRejectionMessage, recordPrReviewVerdictRejection, latestPrReviewVerdictRejectionForLane, submitPrReviewResult, withPrWorkflowCheckoutPreparationLock, withInactivePrWorkflowCheckoutRestoreLock, clearPrWorkflowGateState, terminalizePrWorkflowGateForSession2 as terminalizePrWorkflowGateForSession, PR_WORKFLOW_PROBE_SKIPPED_NO_BUDGET_REASON, collectPrWorkflowPendingLaneLiveness, settlePresumedStalePrWorkflowLanes, abortPrWorkflow, recoverArmedPrWorkflow, bindPrWorkflowHead, rebindPrFeedbackHead, bindPrReviewBase, assertCurrentCheckoutHead, assertPrReviewCleanCheckout, enforcePrWorkflowDispatchLanesAsync, PrReviewResilienceCircuitOpenError, PrReviewResilienceRetryExhaustedError, enforcePrReviewBaseDimensions, rollbackPrReviewBaseAdmissionIfUnlaunched, rollbackPrReviewValidationBatchIfUnlaunched, admitPrReviewPartialBaseCoverage2 as admitPrReviewPartialBaseCoverage, assertPrReviewBaseCoverageSettled2 as assertPrReviewBaseCoverageSettled, recordPrReviewMicroFamilyDispatch, recordPrReviewValidationBatch, assertPrReviewValidationSettled, declarePrFeedbackInventory, enforcePrFeedbackVerificationOwnership, assertPrFeedbackVerificationSettled, recordPrFeedbackStageA, recordPrFeedbackGateBatch, assertPrFeedbackGatePhaseSettled, assertPrFeedbackReadyToPublish, invalidatePrFeedbackPublication, describePrWorkflowPublicationSection, findDanglingLivePublicationGeneration, recordPrFeedbackPushAttemptResult, cancelPrFeedbackPublication, resolvePrReviewWriterRunId, markPrReviewTriggerEvaluationComplete, bindPrReviewTriggerLedger, assertPrReviewArtifactBoundary, assertPrReviewArtifactRecordsMatchAuthoritativeVerdicts, markPrReviewArtifactBoundary, markPrReviewHandoffComplete, readAuthoritativeFindingPolicy, readPrReviewFinalFindingPolicyForReport, transitionPrReviewToFeedback, declarePrFeedbackScope, resolvePrFeedbackScopeDeclaration, consumePrFeedbackScopeDeclaration, validatePrFeedbackScopeBinding, enforcePrWorkflowToolBefore, readPrReviewReentryBindingContext, hasActivePrReviewReentryAuthorization, reserveActivePrReviewReentryAuthorization, completePrWorkflow, _test_exports2 as _test_exports, normalizePrWorkflowShellCommand, describePrWorkflowRevisionDigestFailure, derivePrReviewCandidateInventoryForStatus, prReviewPhaseWindowForStatus, readPrReviewVerdictSettlementReceiptItems, readPrReviewVerdictSettlementEffectiveIds, readAuthoritativePrReviewCriticSettlements, readAuthoritativePrReviewCriticVerdicts, derivePrReviewPresentationOrder, derivePrReviewOrderUnstableItems, derivePrReviewReviewerSeverities, readAuthoritativePrReviewOrderAgreement, formatPrReviewLaneValidationFailure, validateExactStructuredReceiptCoverage2 as validateExactStructuredReceiptCoverage, validatePrReviewDiscoveryLaneCompletion2 as validatePrReviewDiscoveryLaneCompletion, validatePrWorkflowTransportRecovery, prReviewDiscoveryArtifactCoversLane, MAX_SALVAGED_SCHEMA_ERROR_CHARS, readPrWorkflowGateStateForRecovery, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleApproveWriteCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, DEFAULT_CI_DEADLINE_MS2 as DEFAULT_CI_DEADLINE_MS, createSignalCancellation, handleCiCommand, handleCiSimulateCommand, handleClarifyCommand, safeRealpathSync, createCuratorLLMDelegate, getCoChangePairs, startSnapshotCoordinationInitialization, ensureSnapshotCoordinationReady, retrySnapshotCoordinationInitialization, getSnapshotCoordinationStatus, beginSnapshotCoordinationReset, closeSnapshotCoordinationInitialization, markSnapshotCoordinationClosing, _snapshotCoordinationInternals, handleCloseCommand, _internals71 as _internals2, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals75 as _internals3, createHivePromoterHook, promoteToHive, promoteFromSwarm, createMemoryGateway, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getHostConfigDir, getPluginCachePaths, getPluginLockFilePaths, VERSION_PINNED_LEAF, discoverVersionPinnedCachePaths, readCachePackageVersion, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, computeQualityBudget, computeSastScan, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleBlueprintValidateCommand, handleBlueprintCurrentCommand, handleBlueprintHistoryCommand, handleBlueprintDiffCommand, handleBlueprintExportCommand, handleHarnessCandidateValidateCommand, handleHarnessCandidateShowCommand, handleHarnessCandidateDiffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, searchKnowledge, symbols, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleRecoverCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, isCommandFailure, COMMAND_REGISTRY, VALID_COMMANDS, _internals39 as _internals4, resolveCommand, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand };