nexus-agents 2.136.0 → 2.138.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 (142) hide show
  1. package/dist/{child-mcp-config-TM6OCARU.js → child-mcp-config-LCWPKOYE.js} +4 -4
  2. package/dist/{chunk-ZLENFXL5.js → chunk-2SWMXQZF.js} +4 -4
  3. package/dist/{chunk-MTE7THMR.js → chunk-52JN2RFG.js} +6 -6
  4. package/dist/{chunk-257QMFTM.js → chunk-5MMHH5WK.js} +3 -3
  5. package/dist/{chunk-66TXNH4S.js → chunk-7KFI6R2M.js} +9 -9
  6. package/dist/{chunk-VY4FZNZA.js → chunk-7QEGSYSU.js} +2 -2
  7. package/dist/{chunk-UH3F4RZB.js → chunk-7QR2RTA4.js} +7 -7
  8. package/dist/{chunk-GWOXPCIF.js → chunk-7XCQJXN4.js} +7 -7
  9. package/dist/{chunk-3WBEEYCS.js → chunk-AL7ZYHAF.js} +4 -4
  10. package/dist/{chunk-WOE5J5M6.js → chunk-AYA7K5F5.js} +4 -4
  11. package/dist/{chunk-3QH2KWLH.js → chunk-D2XWKFZ2.js} +2 -2
  12. package/dist/{chunk-L4QFWOOQ.js → chunk-DHVMSIT5.js} +22 -3
  13. package/dist/chunk-DHVMSIT5.js.map +1 -0
  14. package/dist/{chunk-7E5UXA4U.js → chunk-DKU7O4V2.js} +2 -2
  15. package/dist/{chunk-JK4L2TQ6.js → chunk-DOCEHXLQ.js} +3 -3
  16. package/dist/{chunk-KOVTOPEQ.js → chunk-DTHMBYSV.js} +2 -2
  17. package/dist/{chunk-HMZT2SJK.js → chunk-H3B7H67H.js} +4 -4
  18. package/dist/{chunk-7G63H7ZT.js → chunk-H4ATQPGQ.js} +2 -2
  19. package/dist/{chunk-ESP6U3LW.js → chunk-J2HWO3J3.js} +6 -6
  20. package/dist/{chunk-ZHCEOIEQ.js → chunk-JFKNUEZ7.js} +2 -2
  21. package/dist/{chunk-FIQSOSQU.js → chunk-K62WRHHK.js} +2 -2
  22. package/dist/{chunk-OCJEYHUQ.js → chunk-KWZC5LFC.js} +6 -6
  23. package/dist/{chunk-FHFEC2XM.js → chunk-LMMLLGZZ.js} +2 -2
  24. package/dist/{chunk-VN3CKPEF.js → chunk-MNHNQC7R.js} +3 -3
  25. package/dist/{chunk-FSUZIIOJ.js → chunk-MNXLJ2VX.js} +2 -2
  26. package/dist/{chunk-3AAJWZCR.js → chunk-MXDMJGVG.js} +4 -4
  27. package/dist/{chunk-JVZ7FGWR.js → chunk-NJW5GQUF.js} +3 -3
  28. package/dist/{chunk-5SXGPX34.js → chunk-NL7SZQPW.js} +2 -2
  29. package/dist/{chunk-N67LHY47.js → chunk-NWW7HLRL.js} +93 -33
  30. package/dist/chunk-NWW7HLRL.js.map +1 -0
  31. package/dist/{chunk-CQDGPGTL.js → chunk-NYSOJBF5.js} +3 -3
  32. package/dist/{chunk-5546JU53.js → chunk-PLKWH53F.js} +6 -6
  33. package/dist/{chunk-LCSGGLZZ.js → chunk-Q3EZN3Z2.js} +2 -2
  34. package/dist/{chunk-6JOXXQK2.js → chunk-R5ZQCA37.js} +44 -63
  35. package/dist/{chunk-6JOXXQK2.js.map → chunk-R5ZQCA37.js.map} +1 -1
  36. package/dist/{chunk-UGAKYSDO.js → chunk-RER74KD6.js} +2 -2
  37. package/dist/{chunk-3JSDOBOA.js → chunk-RTBVZCLD.js} +2 -2
  38. package/dist/{chunk-VVBKPRLI.js → chunk-XUH2UFSG.js} +2 -2
  39. package/dist/{chunk-ZII5MDUO.js → chunk-YPGTIJEW.js} +2 -2
  40. package/dist/{chunk-4GVPON4W.js → chunk-ZJ3WGARD.js} +3 -3
  41. package/dist/cli-circuit-breaker-TNV2PBLS.js +14 -0
  42. package/dist/cli.d.ts +1 -1
  43. package/dist/cli.js +117 -66
  44. package/dist/cli.js.map +1 -1
  45. package/dist/{composite-router-PS42433A.js → composite-router-KM4BPVY4.js} +4 -4
  46. package/dist/consensus-vote-PCIFXILX.js +39 -0
  47. package/dist/{consensus-vote-types-Dx4pf3YW.d.ts → consensus-vote-types-Qx_LRxt1.d.ts} +2 -1
  48. package/dist/{context-retriever-NIFXFYPQ.js → context-retriever-MAZKHYRD.js} +11 -11
  49. package/dist/doctor-deep-XCMFGGJ3.js +13 -0
  50. package/dist/{expert-bridge-NY6FAFQH.js → expert-bridge-EA3U3GKU.js} +6 -6
  51. package/dist/factory-FACKN4IN.js +22 -0
  52. package/dist/factory-Y5WCLQDB.js +15 -0
  53. package/dist/{improvement-review-JDSRWFHM.js → improvement-review-F7TKX4LQ.js} +6 -6
  54. package/dist/index.d.ts +6 -6
  55. package/dist/index.js +32 -32
  56. package/dist/{init-opencode-C7U6ZQK3.js → init-opencode-ZYGGEUZN.js} +8 -8
  57. package/dist/issue-triage-NI2ZDVTB.js +17 -0
  58. package/dist/{learning-persistence-EHTHKWR5.js → learning-persistence-M3OTCCNI.js} +3 -3
  59. package/dist/{pr-reviewer-helpers-D47TVXFX.js → pr-reviewer-helpers-L7L6O3VQ.js} +6 -6
  60. package/dist/{registry-command-PVC47NSQ.js → registry-command-K2KWID5D.js} +4 -4
  61. package/dist/{repo-security-plan-76IXMJNC.js → repo-security-plan-PCGHBEGZ.js} +5 -5
  62. package/dist/research-helpers-synthesize-R45KXXNH.js +15 -0
  63. package/dist/{routing-memory-RAYIYIUP.js → routing-memory-TLB5EY7J.js} +4 -4
  64. package/dist/{session-memory-WZCS7WDH.js → session-memory-PUEUWVIN.js} +5 -5
  65. package/dist/{setup-command-O62DVQ2U.js → setup-command-OHM6K4FM.js} +13 -13
  66. package/dist/setup-config-SLFGQ5F2.js +11 -0
  67. package/dist/{setup-custom-api-2PQP6UOT.js → setup-custom-api-SVCRCSKY.js} +5 -5
  68. package/dist/{tool-memory-RAQWOUXV.js → tool-memory-COQWIFB6.js} +8 -8
  69. package/dist/{tool-memory-registry-adapters-Y4EGADHN.js → tool-memory-registry-adapters-DLSE4SQH.js} +3 -3
  70. package/dist/unified-registry-44DIG4XK.js +25 -0
  71. package/dist/{weather-report-TEBEALS7.js → weather-report-WK7TJPMM.js} +4 -4
  72. package/package.json +1 -1
  73. package/dist/chunk-L4QFWOOQ.js.map +0 -1
  74. package/dist/chunk-N67LHY47.js.map +0 -1
  75. package/dist/cli-circuit-breaker-HFFMCA43.js +0 -14
  76. package/dist/consensus-vote-K2SHY4TC.js +0 -39
  77. package/dist/doctor-deep-VQQNT7VN.js +0 -13
  78. package/dist/factory-6A26HIWS.js +0 -15
  79. package/dist/factory-GGSACEWN.js +0 -22
  80. package/dist/issue-triage-7RN74LBU.js +0 -17
  81. package/dist/research-helpers-synthesize-WH4IC36H.js +0 -15
  82. package/dist/setup-config-KEBEUMC3.js +0 -11
  83. package/dist/unified-registry-L5PGLSEI.js +0 -25
  84. /package/dist/{child-mcp-config-TM6OCARU.js.map → child-mcp-config-LCWPKOYE.js.map} +0 -0
  85. /package/dist/{chunk-ZLENFXL5.js.map → chunk-2SWMXQZF.js.map} +0 -0
  86. /package/dist/{chunk-MTE7THMR.js.map → chunk-52JN2RFG.js.map} +0 -0
  87. /package/dist/{chunk-257QMFTM.js.map → chunk-5MMHH5WK.js.map} +0 -0
  88. /package/dist/{chunk-66TXNH4S.js.map → chunk-7KFI6R2M.js.map} +0 -0
  89. /package/dist/{chunk-VY4FZNZA.js.map → chunk-7QEGSYSU.js.map} +0 -0
  90. /package/dist/{chunk-UH3F4RZB.js.map → chunk-7QR2RTA4.js.map} +0 -0
  91. /package/dist/{chunk-GWOXPCIF.js.map → chunk-7XCQJXN4.js.map} +0 -0
  92. /package/dist/{chunk-3WBEEYCS.js.map → chunk-AL7ZYHAF.js.map} +0 -0
  93. /package/dist/{chunk-WOE5J5M6.js.map → chunk-AYA7K5F5.js.map} +0 -0
  94. /package/dist/{chunk-3QH2KWLH.js.map → chunk-D2XWKFZ2.js.map} +0 -0
  95. /package/dist/{chunk-7E5UXA4U.js.map → chunk-DKU7O4V2.js.map} +0 -0
  96. /package/dist/{chunk-JK4L2TQ6.js.map → chunk-DOCEHXLQ.js.map} +0 -0
  97. /package/dist/{chunk-KOVTOPEQ.js.map → chunk-DTHMBYSV.js.map} +0 -0
  98. /package/dist/{chunk-HMZT2SJK.js.map → chunk-H3B7H67H.js.map} +0 -0
  99. /package/dist/{chunk-7G63H7ZT.js.map → chunk-H4ATQPGQ.js.map} +0 -0
  100. /package/dist/{chunk-ESP6U3LW.js.map → chunk-J2HWO3J3.js.map} +0 -0
  101. /package/dist/{chunk-ZHCEOIEQ.js.map → chunk-JFKNUEZ7.js.map} +0 -0
  102. /package/dist/{chunk-FIQSOSQU.js.map → chunk-K62WRHHK.js.map} +0 -0
  103. /package/dist/{chunk-OCJEYHUQ.js.map → chunk-KWZC5LFC.js.map} +0 -0
  104. /package/dist/{chunk-FHFEC2XM.js.map → chunk-LMMLLGZZ.js.map} +0 -0
  105. /package/dist/{chunk-VN3CKPEF.js.map → chunk-MNHNQC7R.js.map} +0 -0
  106. /package/dist/{chunk-FSUZIIOJ.js.map → chunk-MNXLJ2VX.js.map} +0 -0
  107. /package/dist/{chunk-3AAJWZCR.js.map → chunk-MXDMJGVG.js.map} +0 -0
  108. /package/dist/{chunk-JVZ7FGWR.js.map → chunk-NJW5GQUF.js.map} +0 -0
  109. /package/dist/{chunk-5SXGPX34.js.map → chunk-NL7SZQPW.js.map} +0 -0
  110. /package/dist/{chunk-CQDGPGTL.js.map → chunk-NYSOJBF5.js.map} +0 -0
  111. /package/dist/{chunk-5546JU53.js.map → chunk-PLKWH53F.js.map} +0 -0
  112. /package/dist/{chunk-LCSGGLZZ.js.map → chunk-Q3EZN3Z2.js.map} +0 -0
  113. /package/dist/{chunk-UGAKYSDO.js.map → chunk-RER74KD6.js.map} +0 -0
  114. /package/dist/{chunk-3JSDOBOA.js.map → chunk-RTBVZCLD.js.map} +0 -0
  115. /package/dist/{chunk-VVBKPRLI.js.map → chunk-XUH2UFSG.js.map} +0 -0
  116. /package/dist/{chunk-ZII5MDUO.js.map → chunk-YPGTIJEW.js.map} +0 -0
  117. /package/dist/{chunk-4GVPON4W.js.map → chunk-ZJ3WGARD.js.map} +0 -0
  118. /package/dist/{cli-circuit-breaker-HFFMCA43.js.map → cli-circuit-breaker-TNV2PBLS.js.map} +0 -0
  119. /package/dist/{composite-router-PS42433A.js.map → composite-router-KM4BPVY4.js.map} +0 -0
  120. /package/dist/{consensus-vote-K2SHY4TC.js.map → consensus-vote-PCIFXILX.js.map} +0 -0
  121. /package/dist/{context-retriever-NIFXFYPQ.js.map → context-retriever-MAZKHYRD.js.map} +0 -0
  122. /package/dist/{doctor-deep-VQQNT7VN.js.map → doctor-deep-XCMFGGJ3.js.map} +0 -0
  123. /package/dist/{expert-bridge-NY6FAFQH.js.map → expert-bridge-EA3U3GKU.js.map} +0 -0
  124. /package/dist/{factory-6A26HIWS.js.map → factory-FACKN4IN.js.map} +0 -0
  125. /package/dist/{factory-GGSACEWN.js.map → factory-Y5WCLQDB.js.map} +0 -0
  126. /package/dist/{improvement-review-JDSRWFHM.js.map → improvement-review-F7TKX4LQ.js.map} +0 -0
  127. /package/dist/{init-opencode-C7U6ZQK3.js.map → init-opencode-ZYGGEUZN.js.map} +0 -0
  128. /package/dist/{issue-triage-7RN74LBU.js.map → issue-triage-NI2ZDVTB.js.map} +0 -0
  129. /package/dist/{learning-persistence-EHTHKWR5.js.map → learning-persistence-M3OTCCNI.js.map} +0 -0
  130. /package/dist/{pr-reviewer-helpers-D47TVXFX.js.map → pr-reviewer-helpers-L7L6O3VQ.js.map} +0 -0
  131. /package/dist/{registry-command-PVC47NSQ.js.map → registry-command-K2KWID5D.js.map} +0 -0
  132. /package/dist/{repo-security-plan-76IXMJNC.js.map → repo-security-plan-PCGHBEGZ.js.map} +0 -0
  133. /package/dist/{research-helpers-synthesize-WH4IC36H.js.map → research-helpers-synthesize-R45KXXNH.js.map} +0 -0
  134. /package/dist/{routing-memory-RAYIYIUP.js.map → routing-memory-TLB5EY7J.js.map} +0 -0
  135. /package/dist/{session-memory-WZCS7WDH.js.map → session-memory-PUEUWVIN.js.map} +0 -0
  136. /package/dist/{setup-command-O62DVQ2U.js.map → setup-command-OHM6K4FM.js.map} +0 -0
  137. /package/dist/{setup-config-KEBEUMC3.js.map → setup-config-SLFGQ5F2.js.map} +0 -0
  138. /package/dist/{setup-custom-api-2PQP6UOT.js.map → setup-custom-api-SVCRCSKY.js.map} +0 -0
  139. /package/dist/{tool-memory-RAQWOUXV.js.map → tool-memory-COQWIFB6.js.map} +0 -0
  140. /package/dist/{tool-memory-registry-adapters-Y4EGADHN.js.map → tool-memory-registry-adapters-DLSE4SQH.js.map} +0 -0
  141. /package/dist/{unified-registry-L5PGLSEI.js.map → unified-registry-44DIG4XK.js.map} +0 -0
  142. /package/dist/{weather-report-TEBEALS7.js.map → weather-report-WK7TJPMM.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  getErrorMessage,
9
9
  ok,
10
10
  parseBoolEnv
11
- } from "./chunk-OCJEYHUQ.js";
11
+ } from "./chunk-KWZC5LFC.js";
12
12
 
13
13
  // src/cli/research-helpers-io.ts
14
14
  import * as fs2 from "fs/promises";
@@ -146,4 +146,4 @@ export {
146
146
  loadPapersRegistry,
147
147
  savePapersRegistry
148
148
  };
149
- //# sourceMappingURL=chunk-ZHCEOIEQ.js.map
149
+ //# sourceMappingURL=chunk-JFKNUEZ7.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRandomProvider,
3
3
  getTimeProvider
4
- } from "./chunk-OCJEYHUQ.js";
4
+ } from "./chunk-KWZC5LFC.js";
5
5
 
6
6
  // src/utils/id-utils.ts
7
7
  import { randomUUID } from "crypto";
@@ -24,4 +24,4 @@ export {
24
24
  generateHyphenId,
25
25
  generateUUID
26
26
  };
27
- //# sourceMappingURL=chunk-FIQSOSQU.js.map
27
+ //# sourceMappingURL=chunk-K62WRHHK.js.map
@@ -2,10 +2,10 @@ import {
2
2
  ensureLearningDir,
3
3
  getDecisionCostFile,
4
4
  isPersistenceEnabled
5
- } from "./chunk-5SXGPX34.js";
5
+ } from "./chunk-NL7SZQPW.js";
6
6
  import {
7
7
  nexusDataPath
8
- } from "./chunk-L4QFWOOQ.js";
8
+ } from "./chunk-DHVMSIT5.js";
9
9
  import {
10
10
  __require
11
11
  } from "./chunk-ZPWHCABL.js";
@@ -2341,7 +2341,7 @@ function setDefaultRegistry(registry) {
2341
2341
  }
2342
2342
  async function reloadDefaultRegistry() {
2343
2343
  globalRegistry = buildDefaultRegistry();
2344
- const { resetGlobalRegistry } = await import("./unified-registry-L5PGLSEI.js");
2344
+ const { resetGlobalRegistry } = await import("./unified-registry-44DIG4XK.js");
2345
2345
  resetGlobalRegistry();
2346
2346
  return globalRegistry;
2347
2347
  }
@@ -9319,7 +9319,7 @@ async function attachOutcomeStoreToRegistry(store) {
9319
9319
  try {
9320
9320
  const { getMemoryRegistry } = await import("./dist-KGTVHDVC.js");
9321
9321
  const { OutcomeStoreAdapter } = await import("./outcome-store-adapter-K4L3RUJE.js");
9322
- const { ensureSharedMemoryRegistry } = await import("./tool-memory-registry-adapters-Y4EGADHN.js");
9322
+ const { ensureSharedMemoryRegistry } = await import("./tool-memory-registry-adapters-DLSE4SQH.js");
9323
9323
  ensureSharedMemoryRegistry();
9324
9324
  getMemoryRegistry().attach("outcomes", new OutcomeStoreAdapter(store));
9325
9325
  } catch {
@@ -13577,7 +13577,7 @@ var CompositeRouter = class _CompositeRouter {
13577
13577
  */
13578
13578
  async consultUnifiedContext(task) {
13579
13579
  try {
13580
- const { getContextForTask, inferTaskCategory } = await import("./context-retriever-NIFXFYPQ.js");
13580
+ const { getContextForTask, inferTaskCategory } = await import("./context-retriever-MAZKHYRD.js");
13581
13581
  const ctx = await getContextForTask({
13582
13582
  task: task.content,
13583
13583
  category: inferTaskCategory(task.content),
@@ -15079,4 +15079,4 @@ export {
15079
15079
  AgentCapability,
15080
15080
  OrchestratorError
15081
15081
  };
15082
- //# sourceMappingURL=chunk-OCJEYHUQ.js.map
15082
+ //# sourceMappingURL=chunk-KWZC5LFC.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createLogger,
3
3
  err,
4
4
  ok
5
- } from "./chunk-OCJEYHUQ.js";
5
+ } from "./chunk-KWZC5LFC.js";
6
6
 
7
7
  // src/scm/token-resolver.ts
8
8
  import { execFile } from "child_process";
@@ -87,4 +87,4 @@ export {
87
87
  hasToken,
88
88
  getTokenEnvVars
89
89
  };
90
- //# sourceMappingURL=chunk-FHFEC2XM.js.map
90
+ //# sourceMappingURL=chunk-LMMLLGZZ.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  lookupInTreeCapability
3
- } from "./chunk-OCJEYHUQ.js";
3
+ } from "./chunk-KWZC5LFC.js";
4
4
  import {
5
5
  getNexusDataDir
6
- } from "./chunk-L4QFWOOQ.js";
6
+ } from "./chunk-DHVMSIT5.js";
7
7
 
8
8
  // src/learning/usage-log.ts
9
9
  import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from "fs";
@@ -123,4 +123,4 @@ export {
123
123
  loadUsageEvents,
124
124
  rollupByModel
125
125
  };
126
- //# sourceMappingURL=chunk-VN3CKPEF.js.map
126
+ //# sourceMappingURL=chunk-MNHNQC7R.js.map
@@ -2,7 +2,7 @@ import {
2
2
  CACHE_TIMEOUTS,
3
3
  createLogger,
4
4
  getTimeProvider
5
- } from "./chunk-OCJEYHUQ.js";
5
+ } from "./chunk-KWZC5LFC.js";
6
6
 
7
7
  // src/security/trust-types.ts
8
8
  import { z } from "zod";
@@ -560,4 +560,4 @@ export {
560
560
  resolveReputationGatingMode,
561
561
  gateWithReputation
562
562
  };
563
- //# sourceMappingURL=chunk-FSUZIIOJ.js.map
563
+ //# sourceMappingURL=chunk-MNXLJ2VX.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GitHubProvider,
3
3
  ScmError
4
- } from "./chunk-VVBKPRLI.js";
4
+ } from "./chunk-XUH2UFSG.js";
5
5
  import {
6
6
  ROLE_DEFAULT_TRUST,
7
7
  ReputationCache,
@@ -11,14 +11,14 @@ import {
11
11
  gateWithReputation,
12
12
  resolveReputationGatingMode,
13
13
  sanitizeInput
14
- } from "./chunk-FSUZIIOJ.js";
14
+ } from "./chunk-MNXLJ2VX.js";
15
15
  import {
16
16
  CLI_SUBPROCESS_TIMEOUTS,
17
17
  createLogger,
18
18
  err,
19
19
  getTimeProvider,
20
20
  ok
21
- } from "./chunk-OCJEYHUQ.js";
21
+ } from "./chunk-KWZC5LFC.js";
22
22
 
23
23
  // src/security/trust-classifier.ts
24
24
  function mapAuthorAssociation(association) {
@@ -1401,4 +1401,4 @@ export {
1401
1401
  IssueTriage,
1402
1402
  createIssueTriage
1403
1403
  };
1404
- //# sourceMappingURL=chunk-3AAJWZCR.js.map
1404
+ //# sourceMappingURL=chunk-MXDMJGVG.js.map
@@ -13,10 +13,10 @@ import {
13
13
  getTimeProvider,
14
14
  ok,
15
15
  resolveToolClassGuardMs
16
- } from "./chunk-OCJEYHUQ.js";
16
+ } from "./chunk-KWZC5LFC.js";
17
17
  import {
18
18
  getNexusDataDir
19
- } from "./chunk-L4QFWOOQ.js";
19
+ } from "./chunk-DHVMSIT5.js";
20
20
 
21
21
  // src/mcp/middleware/validation.ts
22
22
  function validateToolInput(schema, args) {
@@ -1990,4 +1990,4 @@ export {
1990
1990
  VOTING_THRESHOLDS,
1991
1991
  ConsensusMetricsSchema
1992
1992
  };
1993
- //# sourceMappingURL=chunk-JVZ7FGWR.js.map
1993
+ //# sourceMappingURL=chunk-NJW5GQUF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getNexusDataDir
3
- } from "./chunk-L4QFWOOQ.js";
3
+ } from "./chunk-DHVMSIT5.js";
4
4
 
5
5
  // src/config/learning-persistence.ts
6
6
  import { mkdirSync } from "fs";
@@ -41,4 +41,4 @@ export {
41
41
  isPersistenceEnabled,
42
42
  ensureLearningDir
43
43
  };
44
- //# sourceMappingURL=chunk-5SXGPX34.js.map
44
+ //# sourceMappingURL=chunk-NL7SZQPW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  computeCostUSD
3
- } from "./chunk-VN3CKPEF.js";
3
+ } from "./chunk-MNHNQC7R.js";
4
4
  import {
5
5
  DEFAULT_CONSENSUS_CONFIG,
6
6
  DEFAULT_INCREMENTAL_QUORUM_CONFIG,
@@ -18,20 +18,20 @@ import {
18
18
  toolSuccess,
19
19
  withProgressHeartbeat,
20
20
  wrapToolWithTimeout
21
- } from "./chunk-JVZ7FGWR.js";
21
+ } from "./chunk-NJW5GQUF.js";
22
22
  import {
23
23
  getToolMemory
24
- } from "./chunk-ESP6U3LW.js";
24
+ } from "./chunk-J2HWO3J3.js";
25
25
  import {
26
26
  createEvent,
27
27
  getGlobalRegistry
28
- } from "./chunk-HMZT2SJK.js";
28
+ } from "./chunk-H3B7H67H.js";
29
29
  import {
30
30
  authRemediation,
31
31
  delay,
32
32
  getAvailableClis,
33
33
  withTimeout
34
- } from "./chunk-GWOXPCIF.js";
34
+ } from "./chunk-7XCQJXN4.js";
35
35
  import {
36
36
  AgentError,
37
37
  CLI_NAMES,
@@ -58,16 +58,16 @@ import {
58
58
  registerPersistentOutcomeStoreFactory,
59
59
  resolveClassGuardMs,
60
60
  resolveVoteTimeout
61
- } from "./chunk-OCJEYHUQ.js";
61
+ } from "./chunk-KWZC5LFC.js";
62
62
  import {
63
63
  ensureLearningDir,
64
64
  getOutcomesFile
65
- } from "./chunk-5SXGPX34.js";
65
+ } from "./chunk-NL7SZQPW.js";
66
66
  import {
67
67
  getNexusDataDir,
68
68
  nexusDataPath,
69
69
  nexusDataPathEnsure
70
- } from "./chunk-L4QFWOOQ.js";
70
+ } from "./chunk-DHVMSIT5.js";
71
71
 
72
72
  // src/mcp/tools/consensus-vote.ts
73
73
  import { z as z10 } from "zod";
@@ -219,6 +219,21 @@ But your default posture is skeptical \u2014 look for what others might miss.
219
219
  High-confidence rejections with specific reasoning are your most valuable output.
220
220
  ${prReviewModeAddendum()}`;
221
221
  }
222
+ var REUSE_LADDER_CHECK = `6. **Reuse ladder (implementation altitude).** When building IS justified,
223
+ gate the SIZE of the build: stop at the first rung that holds, and say
224
+ which one.
225
+ 1. Does this need to exist at all? \u2192 no: skip it (YAGNI).
226
+ 2. Standard library / language built-in? \u2192 use it.
227
+ 3. Native platform feature or an existing nexus-agents substrate
228
+ primitive (a canonical-path module, an existing voter/pipeline/
229
+ store)? \u2192 use it.
230
+ 4. An already-installed dependency? \u2192 use it.
231
+ 5. One line? \u2192 one line.
232
+ 6. Only then: the minimum that works.
233
+ Lazy, NOT negligent \u2014 trust-boundary validation, error handling, security,
234
+ and accessibility are NEVER the thing cut. The code is small because it is
235
+ necessary, not golfed. Flag a proposal that reaches for rung 6 when an
236
+ earlier rung holds as OVER_ENGINEERING.`;
222
237
  function scopeStewardPrompt(project) {
223
238
  return `You are a Scope Steward voting on proposals for the ${project} project.
224
239
 
@@ -253,6 +268,8 @@ Your evaluation criteria \u2014 work through these mandatory checks in your reas
253
268
  anti-sprawl policy in CLAUDE.md is specifically the rule this role
254
269
  enforces.
255
270
 
271
+ ${REUSE_LADDER_CHECK}
272
+
256
273
  Default bias: REJECT proposals where an existing tool fits, even if our
257
274
  own implementation would be marginally nicer. Only approve when the
258
275
  existing-tool check fails AND the kill-the-feature option is worse AND
@@ -4177,6 +4194,18 @@ var ConsensusVoteInputSchema = z6.object({
4177
4194
  */
4178
4195
  idempotencyKey: z6.string().min(1).max(256).optional().describe(
4179
4196
  "Replay-safe key for async-mode dispatch (#3042 Stage 1c). Same (key, inputs) returns existing jobId."
4197
+ ),
4198
+ /**
4199
+ * Authority-tier ratification subject (#4004). Set ONLY when this vote
4200
+ * ratifies an authority-ladder promotion: the loop/strategy id (the
4201
+ * tier-transition `subject`) this vote authorizes. It is bound into the
4202
+ * persisted record's self-hash as `ratifies`, so the promotion gate
4203
+ * (`check-authority-tier-drift.ts`) can resolve a `ratificationVoteRef` to this
4204
+ * record and require `ratifies === transition.subject` (with decision=approved,
4205
+ * strategy=higher_order). Omit on an ordinary vote.
4206
+ */
4207
+ ratifies: z6.string().min(1).max(256).optional().describe(
4208
+ "Authority-tier ratification subject (#4004) \u2014 the loop/strategy id this vote ratifies for an authority-ladder promotion. Bound into the authentic vote record so the promotion gate can verify it. Omit for ordinary votes."
4180
4209
  )
4181
4210
  });
4182
4211
  function toAgentVoteSummary(result) {
@@ -4324,8 +4353,14 @@ var VoteRecordCountsSchema = z7.object({
4324
4353
  total: z7.number().int().nonnegative()
4325
4354
  }).strict();
4326
4355
  var VoteRecordSchema = z7.object({
4327
- /** Schema version. '1.1' marks the chain→record-set+sequence model (#3927). */
4328
- version: z7.literal("1.1"),
4356
+ /**
4357
+ * Schema version. '1.1' marked the chain→record-set+sequence model (#3927);
4358
+ * '1.2' adds the optional `ratifies` subject-binding field (#3927 item 1).
4359
+ * Both are accepted — a 1.1 record (no `ratifies`) verifies unchanged because
4360
+ * `ratifies` is folded into the self-hash ONLY when present (see
4361
+ * {@link computeVoteRecordHash}).
4362
+ */
4363
+ version: z7.enum(["1.1", "1.2"]),
4329
4364
  /** Unique record id (also usable as a `ratificationVoteRef`). */
4330
4365
  id: z7.string().min(1),
4331
4366
  /**
@@ -4365,6 +4400,16 @@ var VoteRecordSchema = z7.object({
4365
4400
  voters: z7.array(VoterSummarySchema),
4366
4401
  /** Optional correlation/decision id linking to the cost rollup / trace. */
4367
4402
  correlationId: z7.string().min(1).optional(),
4403
+ /**
4404
+ * The loop/strategy subject this vote RATIFIES (#3927 item 1). Present only on
4405
+ * a ratification vote; set at vote time and bound into the self-hash (so it is
4406
+ * tamper-evident). The authority-tier promotion gate
4407
+ * (`scripts/check-authority-tier-drift.ts`) resolves a transition's
4408
+ * `ratificationVoteRef` to a record and requires `ratifies === transition.subject`
4409
+ * (with `decision === 'approved'` and `strategy === 'higher_order'`). Absent on
4410
+ * an ordinary (non-ratification) vote; a 1.1 record never carries it.
4411
+ */
4412
+ ratifies: z7.string().min(1).optional(),
4368
4413
  /**
4369
4414
  * ADVISORY hash of the tip record at write time (absent for the first).
4370
4415
  * Retained for audit texture but NOT covered by `hash` and NOT verified —
@@ -4375,7 +4420,7 @@ var VoteRecordSchema = z7.object({
4375
4420
  hash: z7.string().length(64)
4376
4421
  }).strict();
4377
4422
  function computeVoteRecordHash(payload) {
4378
- const canonical = JSON.stringify({
4423
+ const base = {
4379
4424
  version: payload.version,
4380
4425
  id: payload.id,
4381
4426
  sequence: payload.sequence,
@@ -4399,7 +4444,10 @@ function computeVoteRecordHash(payload) {
4399
4444
  confidence: v.confidence
4400
4445
  })),
4401
4446
  correlationId: payload.correlationId ?? null
4402
- });
4447
+ };
4448
+ const canonical = JSON.stringify(
4449
+ payload.ratifies !== void 0 ? { ...base, ratifies: payload.ratifies } : base
4450
+ );
4403
4451
  return crypto.createHash("sha256").update(canonical).digest("hex");
4404
4452
  }
4405
4453
  function hashProposal(proposal) {
@@ -4431,7 +4479,7 @@ function toVoterSummaries(votes) {
4431
4479
  function buildVoteRecord(input) {
4432
4480
  const proposalTruncated = input.proposal.length > MAX_PROPOSAL_RECORD_CHARS ? input.proposal.slice(0, MAX_PROPOSAL_RECORD_CHARS) + "..." : input.proposal;
4433
4481
  const payload = {
4434
- version: "1.1",
4482
+ version: "1.2",
4435
4483
  id: input.id,
4436
4484
  sequence: input.sequence ?? 0,
4437
4485
  recordedAt: input.recordedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -4448,6 +4496,7 @@ function buildVoteRecord(input) {
4448
4496
  },
4449
4497
  voters: toVoterSummaries(input.votes),
4450
4498
  ...input.correlationId !== void 0 ? { correlationId: input.correlationId } : {},
4499
+ ...input.ratifies !== void 0 ? { ratifies: input.ratifies } : {},
4451
4500
  ...input.previousHash !== void 0 ? { previousHash: input.previousHash } : {}
4452
4501
  };
4453
4502
  return { ...payload, hash: computeVoteRecordHash(payload) };
@@ -4487,7 +4536,9 @@ function resolveVoteRecordsPath() {
4487
4536
  const resolved = nexusDataPath(VOTE_RECORDS_DATA_CATEGORY, VOTE_RECORDS_FILENAME);
4488
4537
  const expectedSuffix = `${VOTE_RECORDS_DATA_CATEGORY}${sep}${VOTE_RECORDS_FILENAME}`;
4489
4538
  const underHomedirRoot = isWithin(getNexusDataDir(), resolved);
4490
- const underRepoDataDir = resolved.includes(`.nexus-agents${sep}${VOTE_RECORDS_DATA_CATEGORY}${sep}`);
4539
+ const underRepoDataDir = resolved.includes(
4540
+ `.nexus-agents${sep}${VOTE_RECORDS_DATA_CATEGORY}${sep}`
4541
+ );
4491
4542
  if (!isAbsolute(resolved) || !resolved.endsWith(expectedSuffix) || !(underHomedirRoot || underRepoDataDir)) {
4492
4543
  return void 0;
4493
4544
  }
@@ -4524,10 +4575,13 @@ function persistVoteRecord(opts) {
4524
4575
  }
4525
4576
  }
4526
4577
  function readVoteRecords(filePath) {
4578
+ if (!existsSync2(filePath)) return { records: [], invalidLines: [] };
4579
+ return parseVoteRecordsText(readFileSync2(filePath, "utf-8"));
4580
+ }
4581
+ function parseVoteRecordsText(text) {
4527
4582
  const records = [];
4528
4583
  const invalidLines = [];
4529
- if (!existsSync2(filePath)) return { records, invalidLines };
4530
- const lines = readFileSync2(filePath, "utf-8").split("\n").filter((l) => l.trim() !== "");
4584
+ const lines = text.split("\n").filter((l) => l.trim() !== "");
4531
4585
  for (const [i, line] of lines.entries()) {
4532
4586
  try {
4533
4587
  const parsed = VoteRecordSchema.safeParse(JSON.parse(line));
@@ -4729,6 +4783,7 @@ function recordAuthenticVote(args) {
4729
4783
  result: args.result,
4730
4784
  votes: args.votes,
4731
4785
  ...args.correlationId !== void 0 ? { correlationId: args.correlationId } : {},
4786
+ ...args.ratifies !== void 0 ? { ratifies: args.ratifies } : {},
4732
4787
  logger: logger6
4733
4788
  });
4734
4789
  if (record === void 0) {
@@ -5544,7 +5599,7 @@ async function processVotesWithCascade(engineVotes, opts) {
5544
5599
  var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
5545
5600
  async function runContrarianCheck(proposal, log) {
5546
5601
  try {
5547
- const { executeExpert } = await import("./expert-bridge-NY6FAFQH.js");
5602
+ const { executeExpert } = await import("./expert-bridge-EA3U3GKU.js");
5548
5603
  const prompt = [
5549
5604
  "You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
5550
5605
  "Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
@@ -5700,14 +5755,15 @@ function finalizeVotingResult(args) {
5700
5755
  if (args.higherOrderResult !== void 0) result.higherOrderResult = args.higherOrderResult;
5701
5756
  return result;
5702
5757
  }
5703
- function recordVoteSideEffects(proposal, strategy, result, logger10) {
5758
+ function recordVoteSideEffects(proposal, strategy, result, logger10, ratifies) {
5704
5759
  const decisionId = `consensus-${String(getTimeProvider().now())}-${randomUUID2().slice(0, 8)}`;
5705
5760
  const voteRecord = recordAuthenticVote({
5706
5761
  proposal,
5707
5762
  strategy,
5708
5763
  result: result.result,
5709
5764
  votes: result.votes,
5710
- correlationId: decisionId
5765
+ correlationId: decisionId,
5766
+ ...ratifies !== void 0 ? { ratifies } : {}
5711
5767
  });
5712
5768
  let costSummary;
5713
5769
  try {
@@ -5747,7 +5803,8 @@ async function handleConsensusVote(deps, args) {
5747
5803
  args.proposal,
5748
5804
  strategy,
5749
5805
  result,
5750
- logger10
5806
+ logger10,
5807
+ args.ratifies
5751
5808
  );
5752
5809
  emitVoteRejectedSignal(result.result, getPipelineEventBus(), logger10);
5753
5810
  return { ok: true, value: buildResponse(args, result, costSummary, voteRecord) };
@@ -5887,20 +5944,23 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
5887
5944
  voteRecordPersisted: z10.boolean(),
5888
5945
  voteRecordNote: z10.string().max(500).optional()
5889
5946
  };
5947
+ var CONSENSUS_VOTE_TOOL_SCHEMA = {
5948
+ proposal: z10.string().min(1).max(MAX_PROPOSAL_LENGTH).describe("Proposal text to vote on"),
5949
+ threshold: z10.enum(["majority", "supermajority", "unanimous"]).optional().describe("Voting threshold (legacy). Use strategy instead."),
5950
+ strategy: VotingStrategySchema.optional().describe(
5951
+ "Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order"
5952
+ ),
5953
+ quickMode: z10.boolean().optional().default(false).describe("Use 3 agents instead of 7"),
5954
+ simulateVotes: z10.boolean().optional().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
5955
+ ratifies: z10.string().min(1).max(256).optional().describe(
5956
+ "Authority-tier ratification subject (#4004) \u2014 the loop/strategy id this vote ratifies for an authority-ladder promotion. Bound into the authentic vote record so the promotion gate can verify it. Omit for ordinary votes."
5957
+ )
5958
+ };
5959
+ var CONSENSUS_VOTE_DESCRIPTION = "Execute multi-model consensus voting on a proposal. Uses 7 roles by default (architect, security, devex, ai_ml, pm, catfish, scope_steward) or 3 with quickMode (architect, security, scope_steward), voting with configurable strategies. Supports higher_order strategy for Bayesian-optimal aggregation with correlation awareness (Issue #514). Supports async mode (mode: 'async') \u2014 returns a jobId to poll via get_job_result. Pass ratifies=<subject> to bind an authority-ladder ratification vote into its authentic record.";
5890
5960
  function registerConsensusVoteTool(server, deps) {
5891
5961
  const logger10 = deps.logger ?? createLogger({ tool: "consensus_vote" });
5892
5962
  const notifier = deps.notifier ?? createMcpNotifier(server);
5893
5963
  const depsWithNotifier = { ...deps, notifier };
5894
- const toolSchema = {
5895
- proposal: z10.string().min(1).max(MAX_PROPOSAL_LENGTH).describe("Proposal text to vote on"),
5896
- threshold: z10.enum(["majority", "supermajority", "unanimous"]).optional().describe("Voting threshold (legacy). Use strategy instead."),
5897
- strategy: VotingStrategySchema.optional().describe(
5898
- "Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order"
5899
- ),
5900
- quickMode: z10.boolean().optional().default(false).describe("Use 3 agents instead of 7"),
5901
- simulateVotes: z10.boolean().optional().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
5902
- };
5903
- const description = "Execute multi-model consensus voting on a proposal. Uses 7 roles by default (architect, security, devex, ai_ml, pm, catfish, scope_steward) or 3 with quickMode (architect, security, scope_steward), voting with configurable strategies. Supports higher_order strategy for Bayesian-optimal aggregation with correlation awareness (Issue #514). Supports async mode (mode: 'async') \u2014 returns a jobId to poll via get_job_result.";
5904
5964
  const secureHandler = createSecureHandler(createConsensusVoteHandler(depsWithNotifier), {
5905
5965
  toolName: "consensus_vote",
5906
5966
  rateLimiter: deps.rateLimiter,
@@ -5914,8 +5974,8 @@ function registerConsensusVoteTool(server, deps) {
5914
5974
  server.registerTool(
5915
5975
  "consensus_vote",
5916
5976
  {
5917
- description,
5918
- inputSchema: toolSchema,
5977
+ description: CONSENSUS_VOTE_DESCRIPTION,
5978
+ inputSchema: CONSENSUS_VOTE_TOOL_SCHEMA,
5919
5979
  outputSchema: CONSENSUS_VOTE_OUTPUT_SCHEMA,
5920
5980
  annotations: getToolAnnotations("consensus_vote")
5921
5981
  },
@@ -5998,4 +6058,4 @@ export {
5998
6058
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
5999
6059
  registerConsensusVoteTool
6000
6060
  };
6001
- //# sourceMappingURL=chunk-N67LHY47.js.map
6061
+ //# sourceMappingURL=chunk-NWW7HLRL.js.map