nexus-agents 12.2.0 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/{ast-rule-runner-TUZJYSHY.js → ast-rule-runner-6QQRHBNT.js} +5 -5
  2. package/dist/{child-mcp-config-G6ACPX64.js → child-mcp-config-XGSBBDPD.js} +4 -4
  3. package/dist/{chunk-XODHLPFS.js → chunk-2KTKBUPW.js} +3 -3
  4. package/dist/{chunk-4FSQWESM.js → chunk-2QFRLPVG.js} +7 -7
  5. package/dist/{chunk-JG6RTOEO.js → chunk-2RC6VK33.js} +4 -4
  6. package/dist/{chunk-ITUUK6GW.js → chunk-3TETLWLB.js} +4 -4
  7. package/dist/{chunk-ZQJ74T3F.js → chunk-47X2J6KX.js} +2 -2
  8. package/dist/{chunk-ETEZXSPM.js → chunk-53EH3IYI.js} +5 -5
  9. package/dist/{chunk-YVCYTNMK.js → chunk-5FBYXUO2.js} +2 -2
  10. package/dist/{chunk-KEU6X3MM.js → chunk-5KVV2YOI.js} +77 -77
  11. package/dist/chunk-5KVV2YOI.js.map +1 -0
  12. package/dist/{chunk-HTWXUN4F.js → chunk-623SVONB.js} +4 -4
  13. package/dist/{chunk-TOQ7HR2R.js → chunk-77KDH7HO.js} +382 -72
  14. package/dist/chunk-77KDH7HO.js.map +1 -0
  15. package/dist/{chunk-D23AGH2N.js → chunk-7G6I4ZFK.js} +8 -8
  16. package/dist/{chunk-YD3Y55SM.js → chunk-7GAUB763.js} +2 -2
  17. package/dist/{chunk-HFL4QVDQ.js → chunk-AYRH643O.js} +5 -5
  18. package/dist/{chunk-KU5M5VBE.js → chunk-D5CIBGPB.js} +3 -3
  19. package/dist/{chunk-4HXQJ5CA.js → chunk-DBPWDYNB.js} +2 -2
  20. package/dist/{chunk-7NCAEQWG.js → chunk-DVFIL66Y.js} +4 -4
  21. package/dist/{chunk-I2SLK5RS.js → chunk-EPQRMZ4Y.js} +4 -4
  22. package/dist/{chunk-YWIN42G5.js → chunk-F7EWO7SS.js} +2 -2
  23. package/dist/{chunk-WH4KOFGZ.js → chunk-GADIDZYS.js} +2 -2
  24. package/dist/{chunk-7H2SQVVG.js → chunk-HDPHH44Y.js} +3 -3
  25. package/dist/{chunk-P6MWAYCD.js → chunk-HYEOHMFY.js} +2 -2
  26. package/dist/{chunk-I527FJJZ.js → chunk-L2XP2P6Q.js} +2 -2
  27. package/dist/{chunk-MDLDQCYX.js → chunk-LJ2QVML4.js} +10 -10
  28. package/dist/{chunk-X3ZVXL5R.js → chunk-LLO7ZOAY.js} +2 -2
  29. package/dist/{chunk-JEGNHWW3.js → chunk-LXN76GF5.js} +4 -4
  30. package/dist/{chunk-DNBNM35J.js → chunk-MOLTWE32.js} +2 -2
  31. package/dist/{chunk-6QUSTQ57.js → chunk-OFNVIVCB.js} +5 -5
  32. package/dist/{chunk-CDIDN6YT.js → chunk-UTE2PCOS.js} +2 -2
  33. package/dist/{chunk-JZQ4XZKS.js → chunk-VBO6SHQY.js} +3 -3
  34. package/dist/{chunk-RY6ICQME.js → chunk-VF6BUZLS.js} +2 -2
  35. package/dist/{chunk-CGW57HUC.js → chunk-WPIFGEHN.js} +4 -4
  36. package/dist/{chunk-XUMJ26GK.js → chunk-XIKYDLXZ.js} +2 -2
  37. package/dist/{chunk-MQYBHIOL.js → chunk-ZKWBLGZN.js} +8 -8
  38. package/dist/{cli-circuit-breaker-2XZ5B2OD.js → cli-circuit-breaker-YMNSN2GN.js} +5 -5
  39. package/dist/{cli-readiness-FKZLN2FX.js → cli-readiness-G4JHCTUS.js} +9 -9
  40. package/dist/{cli-server-gateway-4VL4RO4G.js → cli-server-gateway-BXUM3I6Z.js} +14 -14
  41. package/dist/cli.js +45 -45
  42. package/dist/{composite-router-QYMRSNZZ.js → composite-router-AH4SEXFC.js} +4 -4
  43. package/dist/{consensus-vote-BUDINEFA.js → consensus-vote-NHMTEXE7.js} +17 -17
  44. package/dist/{context-retriever-DJQ6WK5U.js → context-retriever-TLEEMPE5.js} +10 -10
  45. package/dist/{doctor-deep-RZ47L46X.js → doctor-deep-7YFZ2DR6.js} +5 -5
  46. package/dist/{doctor-gateway-report-TPKJVFQF.js → doctor-gateway-report-M6TEEHQ6.js} +7 -7
  47. package/dist/{doctor-live-ZBGMYUWC.js → doctor-live-LQZWL5NA.js} +14 -14
  48. package/dist/{expert-bridge-ITQMWAKA.js → expert-bridge-ALRWVSSI.js} +6 -6
  49. package/dist/{factory-7KG4FG7V.js → factory-4HF6KCS2.js} +13 -13
  50. package/dist/{factory-XWEHISQV.js → factory-ERJ5N6KH.js} +7 -7
  51. package/dist/{gemini-adapter-7JM7AOP2.js → gemini-adapter-SYJ672KC.js} +8 -8
  52. package/dist/{improvement-review-DJQ3UIHM.js → improvement-review-PMTD4DVK.js} +6 -6
  53. package/dist/index.d.ts +117 -10
  54. package/dist/index.js +27 -27
  55. package/dist/{init-opencode-CTRFOKQA.js → init-opencode-AACQCIWB.js} +6 -6
  56. package/dist/{issue-triage-B2B4IYDA.js → issue-triage-L43RYWHF.js} +7 -7
  57. package/dist/{model-config-helpers-LP4LIM3Q.js → model-config-helpers-XSFPSIU4.js} +3 -3
  58. package/dist/{openai-compat-adapter-OINWDEMM.js → openai-compat-adapter-3GXAUQHR.js} +6 -6
  59. package/dist/{pr-reviewer-helpers-R5ZXXTY4.js → pr-reviewer-helpers-AGQQ4TQR.js} +5 -5
  60. package/dist/{registry-command-6DLV5SRW.js → registry-command-DX3QYFW2.js} +2 -2
  61. package/dist/{repo-security-plan-QPI4B4UQ.js → repo-security-plan-K63AG6CZ.js} +4 -4
  62. package/dist/{research-helpers-synthesize-JRWNQZR7.js → research-helpers-synthesize-IBLF6E3G.js} +6 -6
  63. package/dist/{routing-memory-XFFA6XQW.js → routing-memory-VABGC4UO.js} +4 -4
  64. package/dist/{session-memory-EDNBL5AG.js → session-memory-IOCGYRWZ.js} +5 -5
  65. package/dist/{setup-config-PKNAGTMJ.js → setup-config-NYWUM63T.js} +5 -5
  66. package/dist/{setup-custom-api-OER43IZH.js → setup-custom-api-UHKMPXR4.js} +5 -5
  67. package/dist/{tool-memory-VRJEGMA3.js → tool-memory-VY5WCDXL.js} +7 -7
  68. package/dist/{unified-registry-KETKSBQE.js → unified-registry-PMXXPV6Z.js} +13 -13
  69. package/dist/{weather-report-MJWGQNR3.js → weather-report-KFSIUHPD.js} +4 -4
  70. package/package.json +1 -1
  71. package/dist/chunk-KEU6X3MM.js.map +0 -1
  72. package/dist/chunk-TOQ7HR2R.js.map +0 -1
  73. /package/dist/{ast-rule-runner-TUZJYSHY.js.map → ast-rule-runner-6QQRHBNT.js.map} +0 -0
  74. /package/dist/{child-mcp-config-G6ACPX64.js.map → child-mcp-config-XGSBBDPD.js.map} +0 -0
  75. /package/dist/{chunk-XODHLPFS.js.map → chunk-2KTKBUPW.js.map} +0 -0
  76. /package/dist/{chunk-4FSQWESM.js.map → chunk-2QFRLPVG.js.map} +0 -0
  77. /package/dist/{chunk-JG6RTOEO.js.map → chunk-2RC6VK33.js.map} +0 -0
  78. /package/dist/{chunk-ITUUK6GW.js.map → chunk-3TETLWLB.js.map} +0 -0
  79. /package/dist/{chunk-ZQJ74T3F.js.map → chunk-47X2J6KX.js.map} +0 -0
  80. /package/dist/{chunk-ETEZXSPM.js.map → chunk-53EH3IYI.js.map} +0 -0
  81. /package/dist/{chunk-YVCYTNMK.js.map → chunk-5FBYXUO2.js.map} +0 -0
  82. /package/dist/{chunk-HTWXUN4F.js.map → chunk-623SVONB.js.map} +0 -0
  83. /package/dist/{chunk-D23AGH2N.js.map → chunk-7G6I4ZFK.js.map} +0 -0
  84. /package/dist/{chunk-YD3Y55SM.js.map → chunk-7GAUB763.js.map} +0 -0
  85. /package/dist/{chunk-HFL4QVDQ.js.map → chunk-AYRH643O.js.map} +0 -0
  86. /package/dist/{chunk-KU5M5VBE.js.map → chunk-D5CIBGPB.js.map} +0 -0
  87. /package/dist/{chunk-4HXQJ5CA.js.map → chunk-DBPWDYNB.js.map} +0 -0
  88. /package/dist/{chunk-7NCAEQWG.js.map → chunk-DVFIL66Y.js.map} +0 -0
  89. /package/dist/{chunk-I2SLK5RS.js.map → chunk-EPQRMZ4Y.js.map} +0 -0
  90. /package/dist/{chunk-YWIN42G5.js.map → chunk-F7EWO7SS.js.map} +0 -0
  91. /package/dist/{chunk-WH4KOFGZ.js.map → chunk-GADIDZYS.js.map} +0 -0
  92. /package/dist/{chunk-7H2SQVVG.js.map → chunk-HDPHH44Y.js.map} +0 -0
  93. /package/dist/{chunk-P6MWAYCD.js.map → chunk-HYEOHMFY.js.map} +0 -0
  94. /package/dist/{chunk-I527FJJZ.js.map → chunk-L2XP2P6Q.js.map} +0 -0
  95. /package/dist/{chunk-MDLDQCYX.js.map → chunk-LJ2QVML4.js.map} +0 -0
  96. /package/dist/{chunk-X3ZVXL5R.js.map → chunk-LLO7ZOAY.js.map} +0 -0
  97. /package/dist/{chunk-JEGNHWW3.js.map → chunk-LXN76GF5.js.map} +0 -0
  98. /package/dist/{chunk-DNBNM35J.js.map → chunk-MOLTWE32.js.map} +0 -0
  99. /package/dist/{chunk-6QUSTQ57.js.map → chunk-OFNVIVCB.js.map} +0 -0
  100. /package/dist/{chunk-CDIDN6YT.js.map → chunk-UTE2PCOS.js.map} +0 -0
  101. /package/dist/{chunk-JZQ4XZKS.js.map → chunk-VBO6SHQY.js.map} +0 -0
  102. /package/dist/{chunk-RY6ICQME.js.map → chunk-VF6BUZLS.js.map} +0 -0
  103. /package/dist/{chunk-CGW57HUC.js.map → chunk-WPIFGEHN.js.map} +0 -0
  104. /package/dist/{chunk-XUMJ26GK.js.map → chunk-XIKYDLXZ.js.map} +0 -0
  105. /package/dist/{chunk-MQYBHIOL.js.map → chunk-ZKWBLGZN.js.map} +0 -0
  106. /package/dist/{cli-circuit-breaker-2XZ5B2OD.js.map → cli-circuit-breaker-YMNSN2GN.js.map} +0 -0
  107. /package/dist/{cli-readiness-FKZLN2FX.js.map → cli-readiness-G4JHCTUS.js.map} +0 -0
  108. /package/dist/{cli-server-gateway-4VL4RO4G.js.map → cli-server-gateway-BXUM3I6Z.js.map} +0 -0
  109. /package/dist/{composite-router-QYMRSNZZ.js.map → composite-router-AH4SEXFC.js.map} +0 -0
  110. /package/dist/{consensus-vote-BUDINEFA.js.map → consensus-vote-NHMTEXE7.js.map} +0 -0
  111. /package/dist/{context-retriever-DJQ6WK5U.js.map → context-retriever-TLEEMPE5.js.map} +0 -0
  112. /package/dist/{doctor-deep-RZ47L46X.js.map → doctor-deep-7YFZ2DR6.js.map} +0 -0
  113. /package/dist/{doctor-gateway-report-TPKJVFQF.js.map → doctor-gateway-report-M6TEEHQ6.js.map} +0 -0
  114. /package/dist/{doctor-live-ZBGMYUWC.js.map → doctor-live-LQZWL5NA.js.map} +0 -0
  115. /package/dist/{expert-bridge-ITQMWAKA.js.map → expert-bridge-ALRWVSSI.js.map} +0 -0
  116. /package/dist/{factory-7KG4FG7V.js.map → factory-4HF6KCS2.js.map} +0 -0
  117. /package/dist/{factory-XWEHISQV.js.map → factory-ERJ5N6KH.js.map} +0 -0
  118. /package/dist/{gemini-adapter-7JM7AOP2.js.map → gemini-adapter-SYJ672KC.js.map} +0 -0
  119. /package/dist/{improvement-review-DJQ3UIHM.js.map → improvement-review-PMTD4DVK.js.map} +0 -0
  120. /package/dist/{init-opencode-CTRFOKQA.js.map → init-opencode-AACQCIWB.js.map} +0 -0
  121. /package/dist/{issue-triage-B2B4IYDA.js.map → issue-triage-L43RYWHF.js.map} +0 -0
  122. /package/dist/{model-config-helpers-LP4LIM3Q.js.map → model-config-helpers-XSFPSIU4.js.map} +0 -0
  123. /package/dist/{openai-compat-adapter-OINWDEMM.js.map → openai-compat-adapter-3GXAUQHR.js.map} +0 -0
  124. /package/dist/{pr-reviewer-helpers-R5ZXXTY4.js.map → pr-reviewer-helpers-AGQQ4TQR.js.map} +0 -0
  125. /package/dist/{registry-command-6DLV5SRW.js.map → registry-command-DX3QYFW2.js.map} +0 -0
  126. /package/dist/{repo-security-plan-QPI4B4UQ.js.map → repo-security-plan-K63AG6CZ.js.map} +0 -0
  127. /package/dist/{research-helpers-synthesize-JRWNQZR7.js.map → research-helpers-synthesize-IBLF6E3G.js.map} +0 -0
  128. /package/dist/{routing-memory-XFFA6XQW.js.map → routing-memory-VABGC4UO.js.map} +0 -0
  129. /package/dist/{session-memory-EDNBL5AG.js.map → session-memory-IOCGYRWZ.js.map} +0 -0
  130. /package/dist/{setup-config-PKNAGTMJ.js.map → setup-config-NYWUM63T.js.map} +0 -0
  131. /package/dist/{setup-custom-api-OER43IZH.js.map → setup-custom-api-UHKMPXR4.js.map} +0 -0
  132. /package/dist/{tool-memory-VRJEGMA3.js.map → tool-memory-VY5WCDXL.js.map} +0 -0
  133. /package/dist/{unified-registry-KETKSBQE.js.map → unified-registry-PMXXPV6Z.js.map} +0 -0
  134. /package/dist/{weather-report-MJWGQNR3.js.map → weather-report-KFSIUHPD.js.map} +0 -0
@@ -62,7 +62,7 @@ import {
62
62
  updateStage,
63
63
  withFileLock,
64
64
  writeJobCancelled
65
- } from "./chunk-MDLDQCYX.js";
65
+ } from "./chunk-LJ2QVML4.js";
66
66
  import {
67
67
  allOf,
68
68
  anyOf
@@ -70,7 +70,7 @@ import {
70
70
  import {
71
71
  normalizeTopicToCanonical,
72
72
  synthesizeResearch
73
- } from "./chunk-7H2SQVVG.js";
73
+ } from "./chunk-HDPHH44Y.js";
74
74
  import {
75
75
  IssueTriage,
76
76
  createAuditTrail,
@@ -79,13 +79,13 @@ import {
79
79
  createGraphAuditBridge,
80
80
  emitPipelinePolicyEvent,
81
81
  readActionRefusal
82
- } from "./chunk-7NCAEQWG.js";
82
+ } from "./chunk-DVFIL66Y.js";
83
83
  import {
84
84
  sanitizeInput
85
85
  } from "./chunk-RYDTFPVI.js";
86
86
  import {
87
87
  withPrerequisite
88
- } from "./chunk-XODHLPFS.js";
88
+ } from "./chunk-2KTKBUPW.js";
89
89
  import {
90
90
  NOOP_NOTIFIER,
91
91
  RateLimiter,
@@ -117,7 +117,7 @@ import {
117
117
  toolSuccess,
118
118
  withProgressHeartbeat,
119
119
  wrapToolWithTimeout
120
- } from "./chunk-JZQ4XZKS.js";
120
+ } from "./chunk-VBO6SHQY.js";
121
121
  import {
122
122
  generateSecurityPlan
123
123
  } from "./chunk-KMGKOF5P.js";
@@ -163,7 +163,7 @@ import {
163
163
  parseRegistry,
164
164
  sourceExistsInRegistry,
165
165
  summarizeContextForPrompt
166
- } from "./chunk-6QUSTQ57.js";
166
+ } from "./chunk-OFNVIVCB.js";
167
167
  import {
168
168
  REGISTRY_PATH,
169
169
  computeSourceQualityScore,
@@ -171,11 +171,11 @@ import {
171
171
  loadPapersRegistry,
172
172
  loadTechniquesRegistry,
173
173
  resolveRegistryRoot
174
- } from "./chunk-X3ZVXL5R.js";
174
+ } from "./chunk-LLO7ZOAY.js";
175
175
  import {
176
176
  getTokenEnvVars,
177
177
  resolveToken
178
- } from "./chunk-4HXQJ5CA.js";
178
+ } from "./chunk-DBPWDYNB.js";
179
179
  import {
180
180
  DEFAULT_RELEVANCE_CONFIG,
181
181
  MemoryImportance,
@@ -183,7 +183,7 @@ import {
183
183
  calculateTextJaccardSimilarity,
184
184
  getToolMemory,
185
185
  memoryTrustTierTag
186
- } from "./chunk-ITUUK6GW.js";
186
+ } from "./chunk-3TETLWLB.js";
187
187
  import {
188
188
  EXTERNAL_CONTENT_TRUST_TIER,
189
189
  resolveContentTrustProvenance,
@@ -192,7 +192,7 @@ import {
192
192
  } from "./chunk-RGB5OTRZ.js";
193
193
  import {
194
194
  createSessionMemory
195
- } from "./chunk-ZQJ74T3F.js";
195
+ } from "./chunk-47X2J6KX.js";
196
196
  import {
197
197
  TrustTierSchema
198
198
  } from "./chunk-BFO2NZPO.js";
@@ -207,7 +207,7 @@ import {
207
207
  } from "./chunk-MZWHXERV.js";
208
208
  import {
209
209
  executeExpert
210
- } from "./chunk-D23AGH2N.js";
210
+ } from "./chunk-7G6I4ZFK.js";
211
211
  import {
212
212
  CliDetectionCache,
213
213
  EventTopics,
@@ -218,7 +218,7 @@ import {
218
218
  getAvailableClis,
219
219
  getGlobalEventBus,
220
220
  getGlobalRegistry
221
- } from "./chunk-KEU6X3MM.js";
221
+ } from "./chunk-5KVV2YOI.js";
222
222
  import {
223
223
  DEFAULTS
224
224
  } from "./chunk-L47UF7ET.js";
@@ -235,7 +235,7 @@ import {
235
235
  getAvailabilityCache,
236
236
  getCliForModelId,
237
237
  resolveFallback
238
- } from "./chunk-HTWXUN4F.js";
238
+ } from "./chunk-623SVONB.js";
239
239
  import {
240
240
  BaseAdapter,
241
241
  createStream,
@@ -243,11 +243,11 @@ import {
243
243
  parseGatewayExtraHeaders,
244
244
  requireApiKey,
245
245
  validateApiKeyPresence
246
- } from "./chunk-HFL4QVDQ.js";
246
+ } from "./chunk-AYRH643O.js";
247
247
  import {
248
248
  BWRAP_READ_ONLY_ARGS,
249
249
  createBwrapPreflight
250
- } from "./chunk-I2SLK5RS.js";
250
+ } from "./chunk-EPQRMZ4Y.js";
251
251
  import {
252
252
  getMemoryRegistry
253
253
  } from "./chunk-ROYGBFVE.js";
@@ -255,14 +255,14 @@ import {
255
255
  SIGKILL_GRACE_MS,
256
256
  terminateProcessTree,
257
257
  trackProcessTree
258
- } from "./chunk-JG6RTOEO.js";
258
+ } from "./chunk-2RC6VK33.js";
259
259
  import {
260
260
  generateHyphenId,
261
261
  generateUUID
262
- } from "./chunk-I527FJJZ.js";
262
+ } from "./chunk-L2XP2P6Q.js";
263
263
  import {
264
264
  getDefaultCliCircuitBreakerRegistry
265
- } from "./chunk-DNBNM35J.js";
265
+ } from "./chunk-MOLTWE32.js";
266
266
  import {
267
267
  sanitizeErrorDetails,
268
268
  sanitizeOutput
@@ -312,6 +312,7 @@ import {
312
312
  canonicalModelKey,
313
313
  clamp,
314
314
  clamp01,
315
+ classifyRegisteredTool,
315
316
  classifyRequestTier,
316
317
  classifyStallTick,
317
318
  computeTokenCost,
@@ -372,7 +373,7 @@ import {
372
373
  truncateWithInfo,
373
374
  withStep,
374
375
  withTimeout
375
- } from "./chunk-MQYBHIOL.js";
376
+ } from "./chunk-ZKWBLGZN.js";
376
377
  import {
377
378
  SUPPORTED_EXTENSIONS
378
379
  } from "./chunk-XBEKMUTO.js";
@@ -387,13 +388,13 @@ import {
387
388
  lookupInTreeCapability,
388
389
  modelSupportsAll,
389
390
  resolveOwnerCli
390
- } from "./chunk-YD3Y55SM.js";
391
+ } from "./chunk-7GAUB763.js";
391
392
  import {
392
393
  deriveEntry,
393
394
  getDefaultRegistry,
394
395
  resolveModelIdentity,
395
396
  resolveModelIdentitySync
396
- } from "./chunk-RY6ICQME.js";
397
+ } from "./chunk-VF6BUZLS.js";
397
398
  import {
398
399
  ensureLearningDir,
399
400
  getMetaOutcomesFile,
@@ -31312,7 +31313,7 @@ function execIdFields(executionId) {
31312
31313
  async function populateUnifiedContextOnState(state, options) {
31313
31314
  const taskCandidate = state["task"];
31314
31315
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
31315
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-DJQ6WK5U.js");
31316
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-TLEEMPE5.js");
31316
31317
  const category = inferTaskCategory2(taskCandidate);
31317
31318
  const executionId = options?.executionId;
31318
31319
  const execFields = execIdFields(executionId);
@@ -32091,6 +32092,23 @@ function customReducer(defaultValue, merge) {
32091
32092
 
32092
32093
  // src/pipeline/task-contract.ts
32093
32094
  import { z as z60 } from "zod";
32095
+ import semver from "semver";
32096
+ var EnforcementModeSchema = z60.enum(["advisory", "enforcing"]);
32097
+ var CapabilityRequirementSchema = z60.object({
32098
+ id: z60.string().min(1),
32099
+ operation: z60.string().min(1),
32100
+ resourceRef: z60.string().min(1).optional(),
32101
+ scope: z60.string().min(1).optional(),
32102
+ mode: EnforcementModeSchema.default("enforcing")
32103
+ });
32104
+ var EvidenceObligationSchema = z60.object({
32105
+ id: z60.string().min(1),
32106
+ artifactRef: z60.string().min(1),
32107
+ claim: z60.string().min(1).optional(),
32108
+ required: z60.boolean().default(true),
32109
+ mode: EnforcementModeSchema.default("enforcing"),
32110
+ receiptIssuer: z60.string().min(1).optional()
32111
+ });
32094
32112
  var TASK_STATUSES = [
32095
32113
  "intake",
32096
32114
  "clarifying",
@@ -32176,7 +32194,10 @@ var TaskContractSchema = z60.object({
32176
32194
  createdAt: z60.number(),
32177
32195
  updatedAt: z60.number(),
32178
32196
  completedAt: z60.number().optional(),
32179
- error: z60.string().optional()
32197
+ error: z60.string().optional(),
32198
+ contractVersion: z60.string().optional(),
32199
+ capabilityRequirements: z60.array(CapabilityRequirementSchema).optional(),
32200
+ evidenceObligations: z60.array(EvidenceObligationSchema).optional()
32180
32201
  });
32181
32202
  var StageSpecSchema = z60.object({
32182
32203
  id: z60.string().min(1),
@@ -33060,11 +33081,289 @@ function extractWaveAttribution(event) {
33060
33081
  return { ...base, durationMs: event.durationMs, workerCount: event.successes + event.errors };
33061
33082
  }
33062
33083
 
33084
+ // src/pipeline/worker-readiness.ts
33085
+ import { createHash as createHash2 } from "node:crypto";
33086
+ import { isAbsolute as isAbsolute2 } from "node:path";
33087
+ var DEFAULT_PROOF_TTL_MS = 3e5;
33088
+ var DEFAULT_PROBE_TIMEOUT_MS = 3e4;
33089
+ var WRITE_TOKEN_SET = new Set(
33090
+ "write,mutate,publish,push,delete,remove,create,update,modify,edit,save,patch,commit,merge,append,overwrite,drop,alter,truncate,upload,insert,upsert,replace,rename,move,unlink,rm,mkdir,rmdir,chmod,chown,exec,execute,spawn,bash,sh,zsh,shell,powershell,cmd,terminal,send,post,put".split(
33091
+ ","
33092
+ )
33093
+ );
33094
+ function isWriteOperation(operation) {
33095
+ const trimmed = operation.trim();
33096
+ if (trimmed.length === 0) return false;
33097
+ const manifestClass = classifyRegisteredTool(trimmed);
33098
+ if (manifestClass !== "unclassified") return manifestClass === "mutation";
33099
+ const tokens = trimmed.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[^a-zA-Z0-9]+/).filter(Boolean);
33100
+ return tokens.some((t) => WRITE_TOKEN_SET.has(t.toLowerCase()));
33101
+ }
33102
+ function contextTuple(c) {
33103
+ return JSON.stringify([
33104
+ c.workerId,
33105
+ c.sessionId,
33106
+ c.adapterId,
33107
+ c.toolSchemaDigest,
33108
+ c.grantDigest,
33109
+ c.subjectRevision,
33110
+ c.policyVersion
33111
+ ]);
33112
+ }
33113
+ function reqTuple(r) {
33114
+ return JSON.stringify([r.id, r.operation, r.resourceRef ?? null, r.scope ?? null]);
33115
+ }
33116
+ function proofReqTuple(p) {
33117
+ return JSON.stringify([p.requirementId, p.operation, p.resourceRef ?? null, p.scope ?? null]);
33118
+ }
33119
+ function isSufficientProofLevel(level) {
33120
+ return level === "probed" || level === "used";
33121
+ }
33122
+ function isProofValidForContext(p, c, req, now, revokedProofIds) {
33123
+ if (!isSufficientProofLevel(p.level) || revokedProofIds?.has(p.proofId) === true) return false;
33124
+ if (now >= p.expiresAt || p.issuedAt > now) return false;
33125
+ if (isWriteOperation(req.operation) && p.probedInScratch !== true) return false;
33126
+ return contextTuple(p) === contextTuple(c) && proofReqTuple(p) === reqTuple(req);
33127
+ }
33128
+ function makeFailure(req, workerId, levelReached, errorClass, message) {
33129
+ return {
33130
+ requirementId: req.id,
33131
+ operation: req.operation,
33132
+ resourceRef: req.resourceRef,
33133
+ mode: req.mode,
33134
+ workerId,
33135
+ levelReached,
33136
+ errorClass,
33137
+ message
33138
+ };
33139
+ }
33140
+ function isSafeScratchPath(scratchDir) {
33141
+ if (scratchDir === void 0) return false;
33142
+ const trimmed = scratchDir.trim();
33143
+ return trimmed.length > 0 && isAbsolute2(trimmed) && !trimmed.split(/[\\/]+/).includes("..");
33144
+ }
33145
+ function buildProbeOptions(req, ctx, signal) {
33146
+ const sigOpt = signal !== void 0 ? { signal } : {};
33147
+ if (!isWriteOperation(req.operation)) return { isScratchProbe: false, ...sigOpt };
33148
+ if (!isSafeScratchPath(ctx.approvedScratchDir)) {
33149
+ const msg = `Write capability "${req.operation}" cannot be probed without a safe absolute approvedScratchDir on worker "${ctx.workerId}"`;
33150
+ return makeFailure(req, ctx.workerId, "bound-to-worker", "UnsafeWriteProbeRejectedError", msg);
33151
+ }
33152
+ return { isScratchProbe: true, scratchDir: ctx.approvedScratchDir.trim(), ...sigOpt };
33153
+ }
33154
+ function createVerifiedProof(req, ctx, probeOptions, issuedAt, ttlMs) {
33155
+ const tuple = JSON.stringify([ctx.workerId, ctx.sessionId, reqTuple(req), issuedAt]);
33156
+ const digest = createHash2("sha256").update(tuple).digest("hex").slice(0, 12);
33157
+ const scratch = probeOptions.isScratchProbe ? { probedInScratch: true, narrowerThanTargetWrite: true } : {};
33158
+ const { advertisedOperations: _a, authorizedOperations: _b, approvedScratchDir: _c, ...id } = ctx;
33159
+ return {
33160
+ ...id,
33161
+ proofId: `proof-${ctx.workerId}-${req.id}-${digest}-${String(issuedAt)}`,
33162
+ requirementId: req.id,
33163
+ operation: req.operation,
33164
+ resourceRef: req.resourceRef,
33165
+ scope: req.scope,
33166
+ level: "probed",
33167
+ issuedAt,
33168
+ expiresAt: issuedAt + ttlMs,
33169
+ ...scratch
33170
+ };
33171
+ }
33172
+ async function invokeProbeSafely(req, config, probeOptions, signal) {
33173
+ try {
33174
+ return await config.probe(req, config.context, { ...probeOptions, signal });
33175
+ } catch (err2) {
33176
+ const hasName = err2 instanceof Error && err2.name !== "" && err2.name !== "Error";
33177
+ const errorClass = hasName ? err2.name : "ProbeExecutionError";
33178
+ return { ok: false, errorClass, message: err2 instanceof Error ? err2.message : String(err2) };
33179
+ }
33180
+ }
33181
+ async function runBoundedProbe(req, config, probeOptions, effectiveTimeoutMs) {
33182
+ const controller = new AbortController();
33183
+ const onAbort = () => {
33184
+ controller.abort();
33185
+ };
33186
+ config.signal?.addEventListener("abort", onAbort, { once: true });
33187
+ let timer;
33188
+ const timeoutRace = new Promise((resolve16) => {
33189
+ timer = setTimeout(() => {
33190
+ controller.abort();
33191
+ const message = `Worker probe for "${req.id}" timed out after ${String(effectiveTimeoutMs)}ms`;
33192
+ resolve16({ ok: false, errorClass: "ProbeTimeoutError", message });
33193
+ }, effectiveTimeoutMs);
33194
+ });
33195
+ const abortRace = new Promise((resolve16) => {
33196
+ const onSig = () => {
33197
+ const message = `Worker probe for "${req.id}" aborted during execution`;
33198
+ resolve16({ ok: false, errorClass: "ProbeAbortedError", message });
33199
+ };
33200
+ config.signal?.addEventListener("abort", onSig, { once: true });
33201
+ });
33202
+ try {
33203
+ return await Promise.race([
33204
+ invokeProbeSafely(req, config, probeOptions, controller.signal),
33205
+ timeoutRace,
33206
+ abortRace
33207
+ ]);
33208
+ } finally {
33209
+ if (timer !== void 0) clearTimeout(timer);
33210
+ config.signal?.removeEventListener("abort", onAbort);
33211
+ }
33212
+ }
33213
+ function resolveClock(nowConfig) {
33214
+ if (typeof nowConfig === "function") return nowConfig;
33215
+ if (typeof nowConfig === "number") {
33216
+ const startWall = getTimeProvider().now();
33217
+ return () => nowConfig + Math.max(0, getTimeProvider().now() - startWall);
33218
+ }
33219
+ return () => getTimeProvider().now();
33220
+ }
33221
+ function checkPreStepBounds(req, config, stepStart, deadlineAt) {
33222
+ const { workerId, advertisedOperations, authorizedOperations } = config.context;
33223
+ if (config.signal?.aborted === true) {
33224
+ const msg = `Worker probe for "${req.id}" aborted before invocation`;
33225
+ return makeFailure(req, workerId, "bound-to-worker", "ProbeAbortedError", msg);
33226
+ }
33227
+ if (deadlineAt !== void 0 && stepStart >= deadlineAt) {
33228
+ const msg = `Worker preflight deadline exhausted before evaluating "${req.id}"`;
33229
+ return makeFailure(req, workerId, "bound-to-worker", "ProbeTimeoutError", msg);
33230
+ }
33231
+ if (!advertisedOperations.includes(req.operation)) {
33232
+ const msg = `Operation "${req.operation}" is not advertised on worker "${workerId}"`;
33233
+ return makeFailure(req, workerId, "unadvertised", "UnadvertisedOperationError", msg);
33234
+ }
33235
+ if (!authorizedOperations.includes(req.operation)) {
33236
+ const msg = `Operation "${req.operation}" is advertised but not authorized for worker "${workerId}"`;
33237
+ return makeFailure(req, workerId, "advertised", "UnauthorizedOperationError", msg);
33238
+ }
33239
+ return null;
33240
+ }
33241
+ function evaluateProbeOutcome(req, config, outcome, elapsedMs, budgetMs) {
33242
+ const wId = config.context.workerId;
33243
+ if (config.signal?.aborted === true) {
33244
+ const msg = `Worker probe for "${req.id}" aborted during execution`;
33245
+ return makeFailure(req, wId, "bound-to-worker", "ProbeAbortedError", msg);
33246
+ }
33247
+ if (elapsedMs > budgetMs) {
33248
+ const msg = `Worker probe for "${req.id}" timed out (${String(elapsedMs)}ms > ${String(budgetMs)}ms)`;
33249
+ return makeFailure(req, wId, "bound-to-worker", "ProbeTimeoutError", msg);
33250
+ }
33251
+ if (!outcome.ok) {
33252
+ return makeFailure(req, wId, "bound-to-worker", outcome.errorClass, outcome.message);
33253
+ }
33254
+ return null;
33255
+ }
33256
+ async function evaluateSingleRequirement(req, config, clock, ttlMs, deadlineAt) {
33257
+ const stepStart = clock();
33258
+ const preStepFailure = checkPreStepBounds(req, config, stepStart, deadlineAt);
33259
+ if (preStepFailure !== null) return { failure: preStepFailure };
33260
+ const cached = config.cache?.getValidProof(config.context, req, stepStart);
33261
+ if (cached !== void 0) return { proof: cached };
33262
+ const probeOptionsOrFailure = buildProbeOptions(req, config.context, config.signal);
33263
+ if ("errorClass" in probeOptionsOrFailure) return { failure: probeOptionsOrFailure };
33264
+ const perProbe = config.probeTimeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
33265
+ const budgetMs = deadlineAt !== void 0 ? Math.min(perProbe, deadlineAt - stepStart) : perProbe;
33266
+ const outcome = await runBoundedProbe(req, config, probeOptionsOrFailure, budgetMs);
33267
+ const stepEnd = clock();
33268
+ const fail = evaluateProbeOutcome(req, config, outcome, stepEnd - stepStart, budgetMs);
33269
+ if (fail !== null) return { failure: fail };
33270
+ const proof = createVerifiedProof(req, config.context, probeOptionsOrFailure, stepEnd, ttlMs);
33271
+ config.cache?.putProof(proof);
33272
+ return { proof };
33273
+ }
33274
+ function revalidateProofsAtCompletion(entries, config, completionTime, failures, advisoryWarnings) {
33275
+ const validProofs = [];
33276
+ const wId = config.context.workerId;
33277
+ for (const { req, proof } of entries) {
33278
+ const selfValid = isProofValidForContext(proof, config.context, req, completionTime);
33279
+ const cacheCurrent = config.cache?.getValidProof(config.context, req, completionTime);
33280
+ if (selfValid && (config.cache === void 0 || cacheCurrent?.proofId === proof.proofId)) {
33281
+ validProofs.push(proof);
33282
+ continue;
33283
+ }
33284
+ if (cacheCurrent !== void 0 && cacheCurrent.proofId !== proof.proofId) {
33285
+ validProofs.push(cacheCurrent);
33286
+ continue;
33287
+ }
33288
+ const msg = `Cached readiness proof "${proof.proofId}" expired before preflight completed`;
33289
+ const fail = makeFailure(req, wId, "bound-to-worker", "ProofExpiredDuringPreflightError", msg);
33290
+ (req.mode === "enforcing" ? failures : advisoryWarnings).push(fail);
33291
+ }
33292
+ return validProofs;
33293
+ }
33294
+ async function verifyWorkerReadiness(requirements, config) {
33295
+ const clock = resolveClock(config.now);
33296
+ const startTime = clock();
33297
+ const ttlMs = config.proofTtlMs ?? DEFAULT_PROOF_TTL_MS;
33298
+ const deadlineAt = config.totalTimeoutMs !== void 0 ? startTime + config.totalTimeoutMs : void 0;
33299
+ const entries = [];
33300
+ const failures = [];
33301
+ const advisoryWarnings = [];
33302
+ for (const req of requirements) {
33303
+ const evaluation = await evaluateSingleRequirement(req, config, clock, ttlMs, deadlineAt);
33304
+ if (evaluation.proof !== void 0) entries.push({ req, proof: evaluation.proof });
33305
+ else if (evaluation.failure !== void 0) {
33306
+ (req.mode === "enforcing" ? failures : advisoryWarnings).push(evaluation.failure);
33307
+ }
33308
+ }
33309
+ const proofs = revalidateProofsAtCompletion(entries, config, clock(), failures, advisoryWarnings);
33310
+ return {
33311
+ ready: failures.length === 0,
33312
+ workerId: config.context.workerId,
33313
+ proofs,
33314
+ failures,
33315
+ advisoryWarnings
33316
+ };
33317
+ }
33318
+
33063
33319
  // src/pipeline/pipeline-runner.ts
33064
33320
  var pipelineLogger = createLogger({ component: "PipelineRunner" });
33065
33321
  function getDefaultRunsDir() {
33066
33322
  return nexusDataPath("runs");
33067
33323
  }
33324
+ function resolvePreflightConfig(workerReadiness, pipelineTimeoutMs, pipelineSignal) {
33325
+ const effectiveSignal = pipelineSignal !== void 0 && workerReadiness.signal !== void 0 ? AbortSignal.any([pipelineSignal, workerReadiness.signal]) : workerReadiness.signal ?? pipelineSignal;
33326
+ const totalBudgetMs = Math.min(
33327
+ pipelineTimeoutMs,
33328
+ workerReadiness.totalTimeoutMs ?? pipelineTimeoutMs
33329
+ );
33330
+ const effectiveProbeMs = Math.min(workerReadiness.probeTimeoutMs ?? totalBudgetMs, totalBudgetMs);
33331
+ return { effectiveSignal, totalBudgetMs, effectiveProbeMs };
33332
+ }
33333
+ function formatReadinessOutcome(report, effectiveSignal, startTime, totalBudgetMs) {
33334
+ if (effectiveSignal?.aborted === true) return "Pipeline aborted during preflight readiness";
33335
+ if (!report.ready) {
33336
+ const details = report.failures.map((f) => `${f.requirementId} (${f.errorClass}: ${f.message})`).join("; ");
33337
+ return `WorkerNotReadyError [${report.workerId}]: ${details}`;
33338
+ }
33339
+ if (Date.now() - startTime >= totalBudgetMs) {
33340
+ return `PipelineTimeoutError [${report.workerId}]: Preflight readiness exhausted timeout budget (${String(totalBudgetMs)}ms)`;
33341
+ }
33342
+ return null;
33343
+ }
33344
+ async function checkPreflightReadiness(pipeline, task, options, startTime) {
33345
+ if (options?.workerReadiness === void 0) return null;
33346
+ const { effectiveSignal, totalBudgetMs, effectiveProbeMs } = resolvePreflightConfig(
33347
+ options.workerReadiness,
33348
+ options.timeout ?? pipeline.plan.timeoutMs,
33349
+ options.signal
33350
+ );
33351
+ if (effectiveSignal?.aborted === true) return "Pipeline aborted before preflight readiness";
33352
+ const report = await verifyWorkerReadiness(task.capabilityRequirements ?? [], {
33353
+ ...options.workerReadiness,
33354
+ probeTimeoutMs: effectiveProbeMs,
33355
+ totalTimeoutMs: totalBudgetMs,
33356
+ ...effectiveSignal !== void 0 ? { signal: effectiveSignal } : {}
33357
+ });
33358
+ for (const w of report.advisoryWarnings) {
33359
+ pipelineLogger.warn("Worker readiness advisory warning", { ...w });
33360
+ }
33361
+ return formatReadinessOutcome(report, effectiveSignal, startTime, totalBudgetMs);
33362
+ }
33363
+ function computeRemainingTimeout(pipeline, options, startTime) {
33364
+ const totalTimeoutMs = options?.timeout ?? pipeline.plan.timeoutMs;
33365
+ return Math.max(1, totalTimeoutMs - (Date.now() - startTime));
33366
+ }
33068
33367
  var PipelineRunner = class {
33069
33368
  /** Compiles a PlanContract into a CompiledPipeline. */
33070
33369
  compile(plan, options) {
@@ -33090,10 +33389,18 @@ var PipelineRunner = class {
33090
33389
  if (options?.signal?.aborted === true) {
33091
33390
  return okResult(failedResult(startTime, "Pipeline aborted before execution"));
33092
33391
  }
33392
+ const readinessError = await checkPreflightReadiness(pipeline, task, options, startTime);
33393
+ if (readinessError !== null) {
33394
+ return okResult(failedResult(startTime, readinessError));
33395
+ }
33396
+ const remainingTimeoutMs = computeRemainingTimeout(pipeline, options, startTime);
33093
33397
  const trace = createTraceContext(task, options);
33094
33398
  emitPipelineStarted(trace, task);
33095
33399
  try {
33096
- const graphOpts = buildGraphOptions(pipeline, options);
33400
+ const graphOpts = buildGraphOptions(pipeline, {
33401
+ ...options,
33402
+ timeout: remainingTimeoutMs
33403
+ });
33097
33404
  const graphResult = await executeGraph(pipeline.graph, { task }, graphOpts);
33098
33405
  if (!graphResult.ok) {
33099
33406
  emitPipelineCompleted(trace, task.id, false, Date.now() - startTime);
@@ -33401,7 +33708,10 @@ function buildBaseTaskContract(input) {
33401
33708
  artifacts: [],
33402
33709
  metadata: { ...input.metadata },
33403
33710
  createdAt: now,
33404
- updatedAt: now
33711
+ updatedAt: now,
33712
+ contractVersion: "1.0.0",
33713
+ capabilityRequirements: [],
33714
+ evidenceObligations: []
33405
33715
  };
33406
33716
  }
33407
33717
 
@@ -35821,7 +36131,7 @@ async function maybeRetryAfterTriage(opts) {
35821
36131
  }
35822
36132
 
35823
36133
  // src/orchestration/aorchestra/compose-worker-prompt.ts
35824
- import { createHash as createHash2 } from "node:crypto";
36134
+ import { createHash as createHash3 } from "node:crypto";
35825
36135
 
35826
36136
  // src/orchestration/aorchestra/context-distillation.ts
35827
36137
  import { z as z64 } from "zod";
@@ -36190,11 +36500,11 @@ function textEvidence(raw) {
36190
36500
  wellFormedText: raw.isWellFormed() && sanitized.isWellFormed(),
36191
36501
  ...raw.isWellFormed() ? {
36192
36502
  rawBytes: Buffer.byteLength(raw),
36193
- rawSha256: createHash2("sha256").update(raw).digest("hex")
36503
+ rawSha256: createHash3("sha256").update(raw).digest("hex")
36194
36504
  } : {},
36195
36505
  ...sanitized.isWellFormed() ? {
36196
36506
  sanitizedBytes: Buffer.byteLength(sanitized),
36197
- sanitizedSha256: createHash2("sha256").update(sanitized).digest("hex")
36507
+ sanitizedSha256: createHash3("sha256").update(sanitized).digest("hex")
36198
36508
  } : {}
36199
36509
  };
36200
36510
  }
@@ -36241,7 +36551,7 @@ function prepareWorkerPrompt(input) {
36241
36551
  evidence: {
36242
36552
  ...evidence,
36243
36553
  promptBytes,
36244
- promptSha256: createHash2("sha256").update(prompt).digest("hex")
36554
+ promptSha256: createHash3("sha256").update(prompt).digest("hex")
36245
36555
  }
36246
36556
  });
36247
36557
  }
@@ -36945,7 +37255,7 @@ async function warmModelMetadata(adapters, signal) {
36945
37255
  }
36946
37256
 
36947
37257
  // src/orchestration/aorchestra/worker-artifact.ts
36948
- import { createHash as createHash3 } from "node:crypto";
37258
+ import { createHash as createHash4 } from "node:crypto";
36949
37259
  import { statSync as statSync2, readFileSync as readFileSync5 } from "node:fs";
36950
37260
  import { basename as basename2 } from "node:path";
36951
37261
  var MAX_INLINE_ARTIFACT_BYTES = 1e5;
@@ -36987,7 +37297,7 @@ function readWorkerArtifact(filePath) {
36987
37297
  } catch {
36988
37298
  return err(`Artifact cannot be decoded as UTF-8: ${filePath}`);
36989
37299
  }
36990
- const sha256 = createHash3("sha256").update(buffer).digest("hex");
37300
+ const sha256 = createHash4("sha256").update(buffer).digest("hex");
36991
37301
  const name = basename2(filePath);
36992
37302
  return ok({
36993
37303
  name,
@@ -47794,7 +48104,7 @@ function computePrReviewRecordHash(payload) {
47794
48104
 
47795
48105
  // src/audit/pr-review-record-store.ts
47796
48106
  import { appendFileSync as appendFileSync3, existsSync as existsSync8, mkdirSync as mkdirSync5, readFileSync as readFileSync7 } from "node:fs";
47797
- import { dirname as dirname3, isAbsolute as isAbsolute3, join as join11, resolve as resolve7 } from "node:path";
48107
+ import { dirname as dirname3, isAbsolute as isAbsolute4, join as join11, resolve as resolve7 } from "node:path";
47798
48108
  var PR_REVIEW_RECORDS_REL_PATH = "governance/pr-review-records.jsonl";
47799
48109
  var PR_REVIEW_RECORDS_PATH_ENV = "NEXUS_PR_REVIEW_RECORDS_PATH";
47800
48110
  var MAX_SUMMARY_RECORD_CHARS = 500;
@@ -47832,7 +48142,7 @@ function buildPrReviewRecord(input) {
47832
48142
  function resolvePrReviewRecordsPath(repoPathOverride) {
47833
48143
  const envPath = process.env[PR_REVIEW_RECORDS_PATH_ENV];
47834
48144
  if (envPath !== void 0 && envPath.trim() !== "") {
47835
- return isAbsolute3(envPath) ? envPath : resolve7(envPath);
48145
+ return isAbsolute4(envPath) ? envPath : resolve7(envPath);
47836
48146
  }
47837
48147
  if (repoPathOverride !== void 0 && repoPathOverride.trim() !== "") {
47838
48148
  const overrideRoot = findRepoRoot(repoPathOverride);
@@ -48483,7 +48793,7 @@ async function tryIssueTriage(task) {
48483
48793
  try {
48484
48794
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
48485
48795
  if (issueMatch === null) return null;
48486
- const { createIssueTriage } = await import("./issue-triage-B2B4IYDA.js");
48796
+ const { createIssueTriage } = await import("./issue-triage-L43RYWHF.js");
48487
48797
  const triage = createIssueTriage();
48488
48798
  const owner = issueMatch[1] ?? "";
48489
48799
  const num2 = issueMatch[2] ?? "";
@@ -48511,7 +48821,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
48511
48821
  ]);
48512
48822
  async function classifyWithLLM(task) {
48513
48823
  try {
48514
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-ITQMWAKA.js");
48824
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-ALRWVSSI.js");
48515
48825
  const prompt = [
48516
48826
  "Classify this task into exactly one pipeline template.",
48517
48827
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -48880,7 +49190,7 @@ function buildVotingInput(plan, config) {
48880
49190
  }
48881
49191
  async function executeSingleVote(plan, config, log) {
48882
49192
  try {
48883
- const { executeVoting } = await import("./consensus-vote-BUDINEFA.js");
49193
+ const { executeVoting } = await import("./consensus-vote-NHMTEXE7.js");
48884
49194
  const input = buildVotingInput(plan, config);
48885
49195
  const result = await executeVoting(input, log);
48886
49196
  return parseVotingResult(result);
@@ -48914,7 +49224,7 @@ function parseVotingResult(result) {
48914
49224
 
48915
49225
  // src/pipeline/dev-pipeline.ts
48916
49226
  import { realpathSync as realpathSync7 } from "node:fs";
48917
- import { isAbsolute as isAbsolute6, relative as relative6, sep as sep5 } from "node:path";
49227
+ import { isAbsolute as isAbsolute7, relative as relative6, sep as sep5 } from "node:path";
48918
49228
 
48919
49229
  // src/orchestration/qa-loop.ts
48920
49230
  var logger40 = createLogger({ component: "qa-loop" });
@@ -49379,7 +49689,7 @@ import {
49379
49689
  } from "node:fs";
49380
49690
  import { realpath } from "node:fs/promises";
49381
49691
  import { homedir as homedir3 } from "node:os";
49382
- import { delimiter, dirname as dirname4, isAbsolute as isAbsolute4, join as join14, relative as relative3, sep as sep3 } from "node:path";
49692
+ import { delimiter, dirname as dirname4, isAbsolute as isAbsolute5, join as join14, relative as relative3, sep as sep3 } from "node:path";
49383
49693
 
49384
49694
  // src/cli-adapters/exec-file-tree.ts
49385
49695
  import { execFile } from "node:child_process";
@@ -49451,7 +49761,7 @@ function spawnTracked(command, args, options, onExit) {
49451
49761
  var bwrapPreflight = createBwrapPreflight();
49452
49762
  var bwrapCommand = (() => {
49453
49763
  for (const directory of (process.env["PATH"] ?? "").split(delimiter)) {
49454
- if (!isAbsolute4(directory)) continue;
49764
+ if (!isAbsolute5(directory)) continue;
49455
49765
  const binary = join14(directory, "bwrap");
49456
49766
  try {
49457
49767
  accessSync(binary, constants.X_OK);
@@ -49566,7 +49876,7 @@ async function createScratchSandbox(scratch, source) {
49566
49876
  const scratchPath = realpathSync4(scratch);
49567
49877
  const contains2 = (parent, child) => {
49568
49878
  const path9 = relative3(parent, child);
49569
- return path9 === "" || path9 !== ".." && !path9.startsWith(`..${sep3}`) && !isAbsolute4(path9);
49879
+ return path9 === "" || path9 !== ".." && !path9.startsWith(`..${sep3}`) && !isAbsolute5(path9);
49570
49880
  };
49571
49881
  if (contains2(protectedSource, scratchPath) || contains2(scratchPath, protectedSource)) {
49572
49882
  throw new Error("Writable scratch path overlaps protected source");
@@ -49608,10 +49918,10 @@ async function createScratchSandbox(scratch, source) {
49608
49918
  // src/pipeline/pipeline-scratch-root.ts
49609
49919
  import { existsSync as existsSync12, realpathSync as realpathSync5 } from "node:fs";
49610
49920
  import { tmpdir } from "node:os";
49611
- import { isAbsolute as isAbsolute5, relative as relative4, resolve as resolve9, sep as sep4 } from "node:path";
49921
+ import { isAbsolute as isAbsolute6, relative as relative4, resolve as resolve9, sep as sep4 } from "node:path";
49612
49922
  function contains(parent, child) {
49613
49923
  const path9 = relative4(parent, child);
49614
- return path9 === "" || path9 !== ".." && !path9.startsWith(`..${sep4}`) && !isAbsolute5(path9);
49924
+ return path9 === "" || path9 !== ".." && !path9.startsWith(`..${sep4}`) && !isAbsolute6(path9);
49615
49925
  }
49616
49926
  function overlaps(a, b) {
49617
49927
  return contains(a, b) || contains(b, a);
@@ -50246,7 +50556,7 @@ function hasIsolatedImplementWorkspace(workspace) {
50246
50556
  }
50247
50557
  function isWithin2(parent, child) {
50248
50558
  const pathFromParent = relative6(parent, child);
50249
- return pathFromParent === "" || pathFromParent !== ".." && !pathFromParent.startsWith(`..${sep5}`) && !isAbsolute6(pathFromParent);
50559
+ return pathFromParent === "" || pathFromParent !== ".." && !pathFromParent.startsWith(`..${sep5}`) && !isAbsolute7(pathFromParent);
50250
50560
  }
50251
50561
  async function runQualityGateStage(stages, mode) {
50252
50562
  if (mode === "off" || stages.qualityGate === void 0) {
@@ -50724,7 +51034,7 @@ var memoryInitPromise = null;
50724
51034
  async function initPipelineMemory() {
50725
51035
  if (cachedMemory !== null) return cachedMemory;
50726
51036
  try {
50727
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-EDNBL5AG.js");
51037
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-IOCGYRWZ.js");
50728
51038
  const { getLearningDir } = await import("./learning-persistence-NW5AE222.js");
50729
51039
  const mem = createSessionMemory2(getLearningDir());
50730
51040
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -50786,7 +51096,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
50786
51096
  callRecord(routingMemoryCache);
50787
51097
  return;
50788
51098
  }
50789
- routingMemoryInitPromise ??= import("./routing-memory-XFFA6XQW.js").then(({ createRoutingMemory }) => {
51099
+ routingMemoryInitPromise ??= import("./routing-memory-VABGC4UO.js").then(({ createRoutingMemory }) => {
50790
51100
  routingMemoryCache ??= createRoutingMemory();
50791
51101
  return routingMemoryCache;
50792
51102
  }).catch((error) => {
@@ -51356,7 +51666,7 @@ async function prepareCompletePlanVote(plan, research, config, signal) {
51356
51666
  return { proposal, roleAdapters: panel.seats };
51357
51667
  }
51358
51668
  async function executePlanVote(plan, research, config, strategy, signal) {
51359
- const { executeVoting } = await import("./consensus-vote-BUDINEFA.js");
51669
+ const { executeVoting } = await import("./consensus-vote-NHMTEXE7.js");
51360
51670
  const { proposal, roleAdapters } = await prepareCompletePlanVote(plan, research, config, signal);
51361
51671
  const votingResult = await executeVoting(
51362
51672
  {
@@ -51912,7 +52222,7 @@ function resolveConfidence(rule) {
51912
52222
  // src/mcp/tools/security-scan.ts
51913
52223
  import { access, constants as constants2 } from "node:fs/promises";
51914
52224
  import { readFile as readFile5, realpath as realpath2, writeFile as writeFile2 } from "node:fs/promises";
51915
- import { delimiter as delimiter2, isAbsolute as isAbsolute7, join as join16, parse as parse5, resolve as resolve10 } from "node:path";
52225
+ import { delimiter as delimiter2, isAbsolute as isAbsolute8, join as join16, parse as parse5, resolve as resolve10 } from "node:path";
51916
52226
  var logger48 = createLogger({ component: "security-scan" });
51917
52227
  var SCAN_TIMEOUT_MS = 3e5;
51918
52228
  async function probeSemgrepVersion(signal, env, wrapper, binary = "semgrep", cwd) {
@@ -51939,7 +52249,7 @@ async function probeSemgrepVersion(signal, env, wrapper, binary = "semgrep", cwd
51939
52249
  function probeExecutableCandidates(binary, env, cwd) {
51940
52250
  const root = cwd ?? process.cwd();
51941
52251
  const searchPath = (env ?? process.env)["PATH"];
51942
- return isAbsolute7(binary) || /[/\\]/.test(binary) ? [resolve10(root, binary)] : process.platform === "win32" ? void 0 : searchPath?.split(delimiter2).map((directory) => resolve10(root, directory, binary));
52252
+ return isAbsolute8(binary) || /[/\\]/.test(binary) ? [resolve10(root, binary)] : process.platform === "win32" ? void 0 : searchPath?.split(delimiter2).map((directory) => resolve10(root, directory, binary));
51943
52253
  }
51944
52254
  async function isSemgrepExecutableMissing(binary, env, cwd) {
51945
52255
  const candidates = probeExecutableCandidates(binary, env, cwd);
@@ -52022,7 +52332,7 @@ var COMPLETE_SCAN_FLAGS = [
52022
52332
  ];
52023
52333
  async function resolveSemgrep(env) {
52024
52334
  for (const directory of (env["PATH"] ?? "").split(delimiter2)) {
52025
- if (!isAbsolute7(directory)) continue;
52335
+ if (!isAbsolute8(directory)) continue;
52026
52336
  const binary = join16(directory, process.platform === "win32" ? "semgrep.exe" : "semgrep");
52027
52337
  try {
52028
52338
  await access(binary, constants2.X_OK);
@@ -52443,21 +52753,21 @@ function mergeOsvChecks(previous, next) {
52443
52753
  }
52444
52754
 
52445
52755
  // src/pipeline/security-baseline.ts
52446
- import { createHash as createHash8 } from "node:crypto";
52756
+ import { createHash as createHash9 } from "node:crypto";
52447
52757
  import { mkdtemp, rm, readFile as readFile7, readlink } from "node:fs/promises";
52448
- import { isAbsolute as isAbsolute9, join as join19 } from "node:path";
52758
+ import { isAbsolute as isAbsolute10, join as join19 } from "node:path";
52449
52759
 
52450
52760
  // src/pipeline/security-baseline-coverage.ts
52451
- import { createHash as createHash7 } from "node:crypto";
52761
+ import { createHash as createHash8 } from "node:crypto";
52452
52762
  import { readFile as readFile6, realpath as realpath3, lstat } from "node:fs/promises";
52453
- import { isAbsolute as isAbsolute8, join as join18, relative as relative7 } from "node:path";
52763
+ import { isAbsolute as isAbsolute9, join as join18, relative as relative7 } from "node:path";
52454
52764
  function scanErrors(scan, side) {
52455
52765
  if ("error" in scan) return [`${side}: ${scan.error}`];
52456
52766
  const errors = scan.errors.map((error) => `${side}: ${error}`);
52457
52767
  if (scan.coverageComplete !== true || scan.totalFindings !== scan.findings.length)
52458
52768
  errors.push(`${side}: scan coverage is incomplete`);
52459
52769
  for (const finding of scan.findings) {
52460
- if (isAbsolute8(finding.file) || finding.file.split("/").includes("..") || /^[a-z]+:/i.test(finding.file))
52770
+ if (isAbsolute9(finding.file) || finding.file.split("/").includes("..") || /^[a-z]+:/i.test(finding.file))
52461
52771
  errors.push(`${side}: finding path outside scanned tree: ${finding.file}`);
52462
52772
  if (ambiguousSnippet(finding))
52463
52773
  errors.push(
@@ -52472,17 +52782,17 @@ function normalizedScan(scan, directory) {
52472
52782
  ...scan,
52473
52783
  scannerDiagnostics: (scan.scannerDiagnostics ?? []).map((diagnostic) => ({
52474
52784
  ...diagnostic,
52475
- file: isAbsolute8(diagnostic.file) ? relative7(directory, diagnostic.file) : diagnostic.file.replace(/^\.\//, ""),
52785
+ file: isAbsolute9(diagnostic.file) ? relative7(directory, diagnostic.file) : diagnostic.file.replace(/^\.\//, ""),
52476
52786
  message: diagnostic.message.split(join18(directory, "/")).join("")
52477
52787
  })),
52478
52788
  parseDiagnostics: (scan.parseDiagnostics ?? []).map((diagnostic) => ({
52479
52789
  ...diagnostic,
52480
- file: isAbsolute8(diagnostic.file) ? relative7(directory, diagnostic.file) : diagnostic.file.replace(/^\.\//, ""),
52790
+ file: isAbsolute9(diagnostic.file) ? relative7(directory, diagnostic.file) : diagnostic.file.replace(/^\.\//, ""),
52481
52791
  message: diagnostic.message.split(join18(directory, "/")).join("")
52482
52792
  })),
52483
52793
  findings: scan.findings.map((finding) => ({
52484
52794
  ...finding,
52485
- file: isAbsolute8(finding.file) ? relative7(directory, finding.file) : finding.file.replace(/^\.\//, "")
52795
+ file: isAbsolute9(finding.file) ? relative7(directory, finding.file) : finding.file.replace(/^\.\//, "")
52486
52796
  }))
52487
52797
  };
52488
52798
  }
@@ -52554,7 +52864,7 @@ async function unchangedFile(input, file) {
52554
52864
  const mode = (stat5) => (stat5.mode & 73) === 0 ? "100644" : "100755";
52555
52865
  const hash = match[2];
52556
52866
  if (hash === void 0 || !oldStat.isFile() || !newStat.isFile()) return false;
52557
- const digest = (bytes2) => createHash7(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(bytes2.length)}\0`).update(bytes2).digest("hex");
52867
+ const digest = (bytes2) => createHash8(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(bytes2.length)}\0`).update(bytes2).digest("hex");
52558
52868
  return mode(oldStat) === match[1] && mode(newStat) === match[1] && digest(oldBytes) === hash && digest(newBytes) === hash;
52559
52869
  }
52560
52870
  async function confinedFile(root, file) {
@@ -52565,7 +52875,7 @@ async function confinedFile(root, file) {
52565
52875
  return path9;
52566
52876
  }
52567
52877
  function outsideTree(file) {
52568
- return file === "" || hasControlCharacter(file) || file.includes("\\") || isAbsolute8(file) || file.split("/").includes("..") || /^[a-z]+:/i.test(file);
52878
+ return file === "" || hasControlCharacter(file) || file.includes("\\") || isAbsolute9(file) || file.split("/").includes("..") || /^[a-z]+:/i.test(file);
52569
52879
  }
52570
52880
 
52571
52881
  // src/pipeline/security-baseline.ts
@@ -52589,7 +52899,7 @@ function preservedLine(finding, diff) {
52589
52899
  async function introducedFindings(base, worktree, git2, target, sha) {
52590
52900
  const diffs = /* @__PURE__ */ new Map();
52591
52901
  for (const file of new Set(base.map((finding) => finding.file))) {
52592
- if (isAbsolute9(file) || file.split("/").includes(".."))
52902
+ if (isAbsolute10(file) || file.split("/").includes(".."))
52593
52903
  throw new Error("Finding path outside scanned tree");
52594
52904
  diffs.set(
52595
52905
  file,
@@ -52681,7 +52991,7 @@ async function allocateComparisonDirectory(target, config, options) {
52681
52991
  return mkdtemp(join19(root, "security-baseline-"));
52682
52992
  }
52683
52993
  const path9 = (await execFileTree("mktemp", ["-d"], options)).stdout.trim();
52684
- if (!isAbsolute9(path9)) throw new Error("Sandbox did not allocate a comparison directory");
52994
+ if (!isAbsolute10(path9)) throw new Error("Sandbox did not allocate a comparison directory");
52685
52995
  return path9;
52686
52996
  }
52687
52997
  async function assessComparison(input) {
@@ -52728,7 +53038,7 @@ async function verifyArchive(directory, tree) {
52728
53038
  for (const entry of tree.split("\0").filter((record) => record !== "")) {
52729
53039
  const { mode, hash, file } = parseTreeEntry(entry);
52730
53040
  const contents = mode === "120000" ? Buffer.from(await readlink(join19(directory, file))) : await readFile7(join19(directory, file));
52731
- const digest = createHash8(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(contents.length)}\0`).update(contents).digest("hex");
53041
+ const digest = createHash9(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(contents.length)}\0`).update(contents).digest("hex");
52732
53042
  if (digest !== hash) throw new Error(`Pinned archive content differs: ${file}`);
52733
53043
  }
52734
53044
  }
@@ -52736,7 +53046,7 @@ function parseTreeEntry(entry) {
52736
53046
  const match = /^(\d+) (\w+) ([a-f0-9]+)\t([\s\S]+)$/.exec(entry);
52737
53047
  if (match === null) throw new Error("Unreadable pinned Git tree");
52738
53048
  const [, mode, type, hash, file] = match;
52739
- if (mode === void 0 || type !== "blob" || hash === void 0 || file === void 0 || isAbsolute9(file) || file.split("/").includes(".."))
53049
+ if (mode === void 0 || type !== "blob" || hash === void 0 || file === void 0 || isAbsolute10(file) || file.split("/").includes(".."))
52740
53050
  throw new Error("Pinned tree coverage incomplete: unsupported tree entry");
52741
53051
  return { mode, hash, file };
52742
53052
  }
@@ -52767,7 +53077,7 @@ async function archiveBaseline(input) {
52767
53077
  const { target, directory, baseline, sha, git: git2, execOptions } = input;
52768
53078
  const baseDir = join19(directory, "base");
52769
53079
  const prefix = (await git2(target, ["rev-parse", "--show-prefix"])).trim();
52770
- if (isAbsolute9(prefix) || prefix.split("/").includes(".."))
53080
+ if (isAbsolute10(prefix) || prefix.split("/").includes(".."))
52771
53081
  throw new Error("Invalid scan subtree");
52772
53082
  const { mkdir: mkdir2 } = await import("node:fs/promises");
52773
53083
  await mkdir2(baseDir);
@@ -53167,7 +53477,7 @@ ${text}` : "";
53167
53477
  }
53168
53478
  async function getWeatherContext() {
53169
53479
  try {
53170
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-MJWGQNR3.js");
53480
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-KFSIUHPD.js");
53171
53481
  const report = generateWeatherReport2({ includeAdaptive: true });
53172
53482
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
53173
53483
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -53185,7 +53495,7 @@ ${lines}
53185
53495
  }
53186
53496
  async function getMemoryContext(task) {
53187
53497
  try {
53188
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-EDNBL5AG.js");
53498
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-IOCGYRWZ.js");
53189
53499
  const { getLearningDir } = await import("./learning-persistence-NW5AE222.js");
53190
53500
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
53191
53501
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -53944,7 +54254,7 @@ async function searchCodebaseForTask(task) {
53944
54254
  }
53945
54255
  async function queryResearchRegistry(task) {
53946
54256
  try {
53947
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-JRWNQZR7.js");
54257
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-IBLF6E3G.js");
53948
54258
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
53949
54259
  if (topic === void 0) return null;
53950
54260
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -54063,7 +54373,7 @@ function createScanStageWrapper() {
54063
54373
  try {
54064
54374
  const repo = await selectAuditRepository(ctx.task);
54065
54375
  if (!repo.ok) return failOutput(PIPELINE_STATE_KEYS.FINDINGS, repo.error, getTimeProvider().now() - start);
54066
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-QPI4B4UQ.js");
54376
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-K63AG6CZ.js");
54067
54377
  const plan = await generateSecurityPlan2({ repo: repo.value, maxScanners: 10 });
54068
54378
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
54069
54379
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -57436,7 +57746,7 @@ var GitHubTaskTracker = class {
57436
57746
  cachedProvider = null;
57437
57747
  async getProvider() {
57438
57748
  if (this.cachedProvider !== null) return this.cachedProvider;
57439
- const { createScmProvider } = await import("./factory-XWEHISQV.js");
57749
+ const { createScmProvider } = await import("./factory-ERJ5N6KH.js");
57440
57750
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
57441
57751
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
57442
57752
  this.cachedProvider = result.value;
@@ -58555,7 +58865,7 @@ function withCatalogueCaveat(report) {
58555
58865
  var GATEWAY_TRANSPORT = "gateway";
58556
58866
  var GATEWAY_API_ARM = "api:custom-openai";
58557
58867
  async function gatewaySource(apiArm) {
58558
- const { discoverModels, readOpenAICompatEnv } = await import("./openai-compat-adapter-OINWDEMM.js");
58868
+ const { discoverModels, readOpenAICompatEnv } = await import("./openai-compat-adapter-3GXAUQHR.js");
58559
58869
  const config = readOpenAICompatEnv();
58560
58870
  if (config !== null) {
58561
58871
  return {
@@ -58574,7 +58884,7 @@ async function gatewaySource(apiArm) {
58574
58884
  }
58575
58885
  async function defaultSources(includeOpenRouter, adaptersFactory) {
58576
58886
  const adapters = new Map(
58577
- adaptersFactory !== void 0 ? adaptersFactory() : (await import("./factory-7KG4FG7V.js")).createAllAdapters()
58887
+ adaptersFactory !== void 0 ? adaptersFactory() : (await import("./factory-4HF6KCS2.js")).createAllAdapters()
58578
58888
  );
58579
58889
  const apiArm = adapters.get(GATEWAY_API_ARM);
58580
58890
  adapters.delete(GATEWAY_API_ARM);
@@ -61845,4 +62155,4 @@ export {
61845
62155
  initializeSandbox,
61846
62156
  getSandboxMode
61847
62157
  };
61848
- //# sourceMappingURL=chunk-TOQ7HR2R.js.map
62158
+ //# sourceMappingURL=chunk-77KDH7HO.js.map