nexus-agents 9.1.1 → 9.2.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.
- package/dist/{ast-rule-runner-GW3RRDDN.js → ast-rule-runner-DFEUIC2E.js} +3 -3
- package/dist/{child-mcp-config-AX5LNK2U.js → child-mcp-config-ALJL5I7K.js} +5 -5
- package/dist/child-mcp-config-ALJL5I7K.js.map +1 -0
- package/dist/{chunk-Z6LCG3ZM.js → chunk-3JRQWWBD.js} +2 -2
- package/dist/{chunk-Y2W44LHI.js → chunk-42TS2JOS.js} +5 -5
- package/dist/{chunk-TMCE755U.js → chunk-4ROIBRK5.js} +2 -2
- package/dist/{chunk-A2UFTOL3.js → chunk-5IMXQQQX.js} +4 -4
- package/dist/{chunk-YCDDSJ6L.js → chunk-625YPLMG.js} +2 -2
- package/dist/{chunk-SAK2PAQD.js → chunk-A5D7666X.js} +2 -2
- package/dist/{chunk-3NYZ5HZA.js → chunk-AWF35M67.js} +4 -4
- package/dist/{chunk-HK5DNXNV.js → chunk-DJ7QTY5J.js} +5 -5
- package/dist/{chunk-TQJRQ3MR.js → chunk-DYVYV7NZ.js} +5 -5
- package/dist/{chunk-ZZ63WG24.js → chunk-ETW6QNVI.js} +3 -3
- package/dist/{chunk-KSIHEDDG.js → chunk-GAJRBRED.js} +2 -2
- package/dist/{chunk-7TLUEWRK.js → chunk-GNGIZJAC.js} +3 -3
- package/dist/{chunk-POI3L46U.js → chunk-GNGKWFC3.js} +2 -2
- package/dist/{chunk-6PKIUOWP.js → chunk-GTWTVDLP.js} +13 -13
- package/dist/{chunk-QXBOILNV.js → chunk-JZSKEIQF.js} +2 -2
- package/dist/{chunk-PQWFZWDL.js → chunk-KJ46Q24G.js} +2 -2
- package/dist/{chunk-MW454P5G.js → chunk-KLDUWDNU.js} +8 -8
- package/dist/{chunk-XMXU7EA7.js → chunk-KWQ5IR2A.js} +2 -2
- package/dist/{chunk-KSZAEQAZ.js → chunk-M43A5MDJ.js} +4 -4
- package/dist/{chunk-XSNFBUX3.js → chunk-MXYKMQ53.js} +41 -41
- package/dist/{chunk-3A24GW2T.js → chunk-PDT6QYKY.js} +5 -5
- package/dist/{chunk-RDZ42Z3Q.js → chunk-PSZQ657B.js} +3 -3
- package/dist/{chunk-TVUPVQXD.js → chunk-SU47CN4Q.js} +45 -14
- package/dist/{chunk-TVUPVQXD.js.map → chunk-SU47CN4Q.js.map} +1 -1
- package/dist/{chunk-N2BSUYFL.js → chunk-TGOZLRO7.js} +2 -2
- package/dist/{chunk-Z5CLWX4M.js → chunk-TJ4VWR32.js} +5 -5
- package/dist/{chunk-XA5JF2QZ.js → chunk-UNIRQWHT.js} +2 -2
- package/dist/{chunk-2JUGZWTJ.js → chunk-VOJCSOVL.js} +2 -2
- package/dist/{chunk-JU4YPMVT.js → chunk-VS3C3L63.js} +484 -337
- package/dist/chunk-VS3C3L63.js.map +1 -0
- package/dist/{chunk-IIOXL76E.js → chunk-WDSRUC3H.js} +3 -3
- package/dist/{chunk-2OHARKQS.js → chunk-WDYK7OAI.js} +3 -3
- package/dist/{chunk-YK6MGGPV.js → chunk-XBWG4BJU.js} +2 -2
- package/dist/{chunk-NACIKSZF.js → chunk-XPQ2RDMV.js} +5 -5
- package/dist/{chunk-7TBDUW7E.js → chunk-ZC6QDPMA.js} +4 -4
- package/dist/{chunk-FJ35WCE4.js → chunk-ZNXWR6V6.js} +7 -7
- package/dist/{chunk-CYWZ7W2C.js → chunk-ZVSJPKEZ.js} +2 -2
- package/dist/{cli-circuit-breaker-QDMRHG5K.js → cli-circuit-breaker-OTFWY5A5.js} +3 -3
- package/dist/{cli-readiness-7YQ7S2AY.js → cli-readiness-WFUMPJCU.js} +7 -7
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +44 -44
- package/dist/{composite-router-KWVZJE5J.js → composite-router-LE4SNM2X.js} +2 -2
- package/dist/{consensus-vote-YDKECHPF.js → consensus-vote-2BEOCYGU.js} +17 -17
- package/dist/{consensus-vote-types-DA_y5jja.d.ts → consensus-vote-types-q8io4acj.d.ts} +5 -0
- package/dist/{context-retriever-XOT3JESN.js → context-retriever-NKP73OSE.js} +8 -8
- package/dist/{doctor-deep-L5MCQ4RP.js → doctor-deep-FQPLASUY.js} +3 -3
- package/dist/{doctor-gateway-report-4B6KE7B5.js → doctor-gateway-report-3I7KQVU3.js} +7 -7
- package/dist/{doctor-live-77X66SFV.js → doctor-live-ZAMCNQGM.js} +11 -11
- package/dist/{expert-bridge-S4LEWNOQ.js → expert-bridge-3WL6X37T.js} +4 -4
- package/dist/{factory-U35CCT3I.js → factory-IAH3XPHY.js} +5 -5
- package/dist/{factory-WHP7VBCY.js → factory-X7XECZ3D.js} +10 -10
- package/dist/{improvement-review-CYK3E2J6.js → improvement-review-4VHBKOME.js} +6 -6
- package/dist/index.d.ts +5 -4
- package/dist/index.js +32 -32
- package/dist/{init-opencode-OTTNZHKO.js → init-opencode-YLKVZJJA.js} +6 -6
- package/dist/{issue-triage-WRNKM4W7.js → issue-triage-UUD53JH3.js} +6 -6
- package/dist/{model-config-helpers-URTK3TDT.js → model-config-helpers-KRTQLJF4.js} +2 -2
- package/dist/{openai-compat-adapter-CCYSADQL.js → openai-compat-adapter-YTSKOE4F.js} +6 -6
- package/dist/{outcome-store-adapter-GAT6LFFD.js → outcome-store-adapter-PSVE6YAJ.js} +2 -2
- package/dist/{pr-reviewer-helpers-ECI3O755.js → pr-reviewer-helpers-VP4P23TI.js} +4 -4
- package/dist/{registry-command-ZNS2WFJ5.js → registry-command-S4GXEMQR.js} +2 -2
- package/dist/{repo-security-plan-FE7BKQH5.js → repo-security-plan-66VLAFUR.js} +3 -3
- package/dist/{research-helpers-synthesize-ECSX4ZO2.js → research-helpers-synthesize-RFOFNS5W.js} +4 -4
- package/dist/{routing-memory-5CW56QBY.js → routing-memory-KKBKCISC.js} +2 -2
- package/dist/{session-memory-VQB3KEOW.js → session-memory-6FGTXRCN.js} +3 -3
- package/dist/{setup-config-3WWCV7RF.js → setup-config-4NLQBTZH.js} +3 -3
- package/dist/{setup-custom-api-6QJS7YUQ.js → setup-custom-api-FLGYMLGG.js} +3 -3
- package/dist/setup-data-dir-VBMDTRCF.js +36 -0
- package/dist/{tool-memory-J7HO5C7H.js → tool-memory-5DOAHII2.js} +5 -5
- package/dist/{unified-registry-JIWD7D4S.js → unified-registry-I2BUGW6I.js} +11 -11
- package/dist/{weather-report-GSZVNNE2.js → weather-report-CTT5O7MR.js} +2 -2
- package/package.json +3 -2
- package/dist/child-mcp-config-AX5LNK2U.js.map +0 -1
- package/dist/chunk-JU4YPMVT.js.map +0 -1
- package/dist/setup-data-dir-4J6XKGDH.js +0 -36
- /package/dist/{ast-rule-runner-GW3RRDDN.js.map → ast-rule-runner-DFEUIC2E.js.map} +0 -0
- /package/dist/{chunk-Z6LCG3ZM.js.map → chunk-3JRQWWBD.js.map} +0 -0
- /package/dist/{chunk-Y2W44LHI.js.map → chunk-42TS2JOS.js.map} +0 -0
- /package/dist/{chunk-TMCE755U.js.map → chunk-4ROIBRK5.js.map} +0 -0
- /package/dist/{chunk-A2UFTOL3.js.map → chunk-5IMXQQQX.js.map} +0 -0
- /package/dist/{chunk-YCDDSJ6L.js.map → chunk-625YPLMG.js.map} +0 -0
- /package/dist/{chunk-SAK2PAQD.js.map → chunk-A5D7666X.js.map} +0 -0
- /package/dist/{chunk-3NYZ5HZA.js.map → chunk-AWF35M67.js.map} +0 -0
- /package/dist/{chunk-HK5DNXNV.js.map → chunk-DJ7QTY5J.js.map} +0 -0
- /package/dist/{chunk-TQJRQ3MR.js.map → chunk-DYVYV7NZ.js.map} +0 -0
- /package/dist/{chunk-ZZ63WG24.js.map → chunk-ETW6QNVI.js.map} +0 -0
- /package/dist/{chunk-KSIHEDDG.js.map → chunk-GAJRBRED.js.map} +0 -0
- /package/dist/{chunk-7TLUEWRK.js.map → chunk-GNGIZJAC.js.map} +0 -0
- /package/dist/{chunk-POI3L46U.js.map → chunk-GNGKWFC3.js.map} +0 -0
- /package/dist/{chunk-6PKIUOWP.js.map → chunk-GTWTVDLP.js.map} +0 -0
- /package/dist/{chunk-QXBOILNV.js.map → chunk-JZSKEIQF.js.map} +0 -0
- /package/dist/{chunk-PQWFZWDL.js.map → chunk-KJ46Q24G.js.map} +0 -0
- /package/dist/{chunk-MW454P5G.js.map → chunk-KLDUWDNU.js.map} +0 -0
- /package/dist/{chunk-XMXU7EA7.js.map → chunk-KWQ5IR2A.js.map} +0 -0
- /package/dist/{chunk-KSZAEQAZ.js.map → chunk-M43A5MDJ.js.map} +0 -0
- /package/dist/{chunk-XSNFBUX3.js.map → chunk-MXYKMQ53.js.map} +0 -0
- /package/dist/{chunk-3A24GW2T.js.map → chunk-PDT6QYKY.js.map} +0 -0
- /package/dist/{chunk-RDZ42Z3Q.js.map → chunk-PSZQ657B.js.map} +0 -0
- /package/dist/{chunk-N2BSUYFL.js.map → chunk-TGOZLRO7.js.map} +0 -0
- /package/dist/{chunk-Z5CLWX4M.js.map → chunk-TJ4VWR32.js.map} +0 -0
- /package/dist/{chunk-XA5JF2QZ.js.map → chunk-UNIRQWHT.js.map} +0 -0
- /package/dist/{chunk-2JUGZWTJ.js.map → chunk-VOJCSOVL.js.map} +0 -0
- /package/dist/{chunk-IIOXL76E.js.map → chunk-WDSRUC3H.js.map} +0 -0
- /package/dist/{chunk-2OHARKQS.js.map → chunk-WDYK7OAI.js.map} +0 -0
- /package/dist/{chunk-YK6MGGPV.js.map → chunk-XBWG4BJU.js.map} +0 -0
- /package/dist/{chunk-NACIKSZF.js.map → chunk-XPQ2RDMV.js.map} +0 -0
- /package/dist/{chunk-7TBDUW7E.js.map → chunk-ZC6QDPMA.js.map} +0 -0
- /package/dist/{chunk-FJ35WCE4.js.map → chunk-ZNXWR6V6.js.map} +0 -0
- /package/dist/{chunk-CYWZ7W2C.js.map → chunk-ZVSJPKEZ.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-QDMRHG5K.js.map → cli-circuit-breaker-OTFWY5A5.js.map} +0 -0
- /package/dist/{cli-readiness-7YQ7S2AY.js.map → cli-readiness-WFUMPJCU.js.map} +0 -0
- /package/dist/{composite-router-KWVZJE5J.js.map → composite-router-LE4SNM2X.js.map} +0 -0
- /package/dist/{consensus-vote-YDKECHPF.js.map → consensus-vote-2BEOCYGU.js.map} +0 -0
- /package/dist/{context-retriever-XOT3JESN.js.map → context-retriever-NKP73OSE.js.map} +0 -0
- /package/dist/{doctor-deep-L5MCQ4RP.js.map → doctor-deep-FQPLASUY.js.map} +0 -0
- /package/dist/{doctor-gateway-report-4B6KE7B5.js.map → doctor-gateway-report-3I7KQVU3.js.map} +0 -0
- /package/dist/{doctor-live-77X66SFV.js.map → doctor-live-ZAMCNQGM.js.map} +0 -0
- /package/dist/{expert-bridge-S4LEWNOQ.js.map → expert-bridge-3WL6X37T.js.map} +0 -0
- /package/dist/{factory-U35CCT3I.js.map → factory-IAH3XPHY.js.map} +0 -0
- /package/dist/{factory-WHP7VBCY.js.map → factory-X7XECZ3D.js.map} +0 -0
- /package/dist/{improvement-review-CYK3E2J6.js.map → improvement-review-4VHBKOME.js.map} +0 -0
- /package/dist/{init-opencode-OTTNZHKO.js.map → init-opencode-YLKVZJJA.js.map} +0 -0
- /package/dist/{issue-triage-WRNKM4W7.js.map → issue-triage-UUD53JH3.js.map} +0 -0
- /package/dist/{model-config-helpers-URTK3TDT.js.map → model-config-helpers-KRTQLJF4.js.map} +0 -0
- /package/dist/{openai-compat-adapter-CCYSADQL.js.map → openai-compat-adapter-YTSKOE4F.js.map} +0 -0
- /package/dist/{outcome-store-adapter-GAT6LFFD.js.map → outcome-store-adapter-PSVE6YAJ.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-ECI3O755.js.map → pr-reviewer-helpers-VP4P23TI.js.map} +0 -0
- /package/dist/{registry-command-ZNS2WFJ5.js.map → registry-command-S4GXEMQR.js.map} +0 -0
- /package/dist/{repo-security-plan-FE7BKQH5.js.map → repo-security-plan-66VLAFUR.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-ECSX4ZO2.js.map → research-helpers-synthesize-RFOFNS5W.js.map} +0 -0
- /package/dist/{routing-memory-5CW56QBY.js.map → routing-memory-KKBKCISC.js.map} +0 -0
- /package/dist/{session-memory-VQB3KEOW.js.map → session-memory-6FGTXRCN.js.map} +0 -0
- /package/dist/{setup-config-3WWCV7RF.js.map → setup-config-4NLQBTZH.js.map} +0 -0
- /package/dist/{setup-custom-api-6QJS7YUQ.js.map → setup-custom-api-FLGYMLGG.js.map} +0 -0
- /package/dist/{setup-data-dir-4J6XKGDH.js.map → setup-data-dir-VBMDTRCF.js.map} +0 -0
- /package/dist/{tool-memory-J7HO5C7H.js.map → tool-memory-5DOAHII2.js.map} +0 -0
- /package/dist/{unified-registry-JIWD7D4S.js.map → unified-registry-I2BUGW6I.js.map} +0 -0
- /package/dist/{weather-report-GSZVNNE2.js.map → weather-report-CTT5O7MR.js.map} +0 -0
|
@@ -21,24 +21,24 @@ import {
|
|
|
21
21
|
toolSuccess,
|
|
22
22
|
withProgressHeartbeat,
|
|
23
23
|
wrapToolWithTimeout
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5IMXQQQX.js";
|
|
25
25
|
import {
|
|
26
26
|
getToolMemory
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-M43A5MDJ.js";
|
|
28
28
|
import {
|
|
29
29
|
allOf
|
|
30
30
|
} from "./chunk-EZNIYU5T.js";
|
|
31
31
|
import {
|
|
32
32
|
VERSION
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-GNGIZJAC.js";
|
|
34
34
|
import {
|
|
35
35
|
isGatewayModelAdapter
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DJ7QTY5J.js";
|
|
37
37
|
import {
|
|
38
38
|
ModelBoundAdapter,
|
|
39
39
|
createEvent,
|
|
40
40
|
getGlobalRegistry
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-PDT6QYKY.js";
|
|
42
42
|
import {
|
|
43
43
|
UNVERIFIABLE_STDERR_RE,
|
|
44
44
|
classifyUnverifiable,
|
|
@@ -46,25 +46,25 @@ import {
|
|
|
46
46
|
getAvailableClis,
|
|
47
47
|
isAbsentSeat,
|
|
48
48
|
markUnverifiable
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-KLDUWDNU.js";
|
|
50
50
|
import {
|
|
51
51
|
ensureGatewayDiscovered
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-ETW6QNVI.js";
|
|
53
53
|
import {
|
|
54
54
|
CLI_TO_MODELSDEV_VENDOR,
|
|
55
55
|
delay,
|
|
56
56
|
getAbortObservation,
|
|
57
57
|
sleep,
|
|
58
58
|
withTimeout
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-TJ4VWR32.js";
|
|
60
60
|
import {
|
|
61
61
|
getDefaultCliCircuitBreakerRegistry
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-4ROIBRK5.js";
|
|
63
63
|
import {
|
|
64
64
|
sanitizeErrorDetails,
|
|
65
65
|
sanitizeOutput,
|
|
66
66
|
sanitizeStringLeaves
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-A5D7666X.js";
|
|
68
68
|
import {
|
|
69
69
|
AgentError,
|
|
70
70
|
DecisionCostStore,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
servedCostDetail,
|
|
122
122
|
stepBus,
|
|
123
123
|
voteRecordWriteFailedMessage
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-SU47CN4Q.js";
|
|
125
125
|
import {
|
|
126
126
|
ensureLearningDir,
|
|
127
127
|
getOutcomesFile
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
// src/mcp/tools/consensus-vote.ts
|
|
146
146
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
147
147
|
import { basename as basename2 } from "node:path";
|
|
148
|
-
import { z as
|
|
148
|
+
import { z as z16 } from "zod";
|
|
149
149
|
|
|
150
150
|
// src/cli/voter-roles.ts
|
|
151
151
|
var VOTER_ROLES = {
|
|
@@ -1793,6 +1793,123 @@ function warnIfSingleFamily(roleCount, assignedModels, logger12) {
|
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
1795
|
|
|
1796
|
+
// src/cli/voter-option-reask.ts
|
|
1797
|
+
import { z as z2 } from "zod";
|
|
1798
|
+
var SelectionSchema = z2.object({
|
|
1799
|
+
selectedOption: z2.string(),
|
|
1800
|
+
decision: z2.literal("approve").optional()
|
|
1801
|
+
});
|
|
1802
|
+
var SELECTION_JSON_SCHEMA = {
|
|
1803
|
+
type: "object",
|
|
1804
|
+
additionalProperties: false,
|
|
1805
|
+
required: ["selectedOption"],
|
|
1806
|
+
properties: { selectedOption: { type: "string" } }
|
|
1807
|
+
};
|
|
1808
|
+
function reaskRequest(seat, input) {
|
|
1809
|
+
const context = buildVotePrompt(
|
|
1810
|
+
input.proposal,
|
|
1811
|
+
input.options,
|
|
1812
|
+
input.workspace,
|
|
1813
|
+
input.workspaceSha
|
|
1814
|
+
);
|
|
1815
|
+
return {
|
|
1816
|
+
messages: [
|
|
1817
|
+
{ role: "system", content: getVoterPrompts(input.project)[seat.role] },
|
|
1818
|
+
{
|
|
1819
|
+
role: "user",
|
|
1820
|
+
content: `${context}
|
|
1821
|
+
|
|
1822
|
+
OPTION SELECTION RE-ASK (once only):
|
|
1823
|
+
Your original vote: ${JSON.stringify(seat.vote)}
|
|
1824
|
+
Your approval is final. Keep that decision and its reasoning unchanged. Only fill the missing option selection.
|
|
1825
|
+
Declared options: ${JSON.stringify(input.options)}
|
|
1826
|
+
Return only JSON: {"selectedOption": "one exact declared option"}.`
|
|
1827
|
+
}
|
|
1828
|
+
],
|
|
1829
|
+
maxTokens: 512,
|
|
1830
|
+
temperature: 0.3,
|
|
1831
|
+
timeoutMs: input.timeoutMs,
|
|
1832
|
+
accessMode: VOTER_ACCESS_MODE,
|
|
1833
|
+
signal: seatSignal(input.timeoutMs, input.signal),
|
|
1834
|
+
...input.workspace !== void 0 && input.workspace.trim() !== "" ? { workDir: input.workspace } : {},
|
|
1835
|
+
responseFormat: { type: "json_schema", schema: SELECTION_JSON_SCHEMA }
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
async function askSelection(seat, input, state) {
|
|
1839
|
+
state.collector.started();
|
|
1840
|
+
let eventId;
|
|
1841
|
+
const call = input.adapter.complete(reaskRequest(seat, input)).then((result) => {
|
|
1842
|
+
if (result.ok) {
|
|
1843
|
+
eventId = state.collector.settled(
|
|
1844
|
+
seat.role,
|
|
1845
|
+
input.adapter,
|
|
1846
|
+
result.value,
|
|
1847
|
+
"option_reask",
|
|
1848
|
+
input.withinRoleRetry
|
|
1849
|
+
);
|
|
1850
|
+
state.usage = foldCompletionUsage(void 0, readVoteUsage(result.value));
|
|
1851
|
+
}
|
|
1852
|
+
return result;
|
|
1853
|
+
});
|
|
1854
|
+
const completed = await withTimeout(
|
|
1855
|
+
unlessCancelled(trackVoterCompletion(call, input.signal), input.signal),
|
|
1856
|
+
input.timeoutMs,
|
|
1857
|
+
"Option selection re-ask timed out"
|
|
1858
|
+
);
|
|
1859
|
+
if (!completed.ok) throw new Error(completed.error);
|
|
1860
|
+
if (!completed.value.ok) throw completed.value.error;
|
|
1861
|
+
try {
|
|
1862
|
+
const text = extractTextFromResponse(completed.value.value.content);
|
|
1863
|
+
const parsed = SelectionSchema.parse(JSON.parse(extractJsonFromResponse(text)));
|
|
1864
|
+
state.collector.classified(eventId, "parsed");
|
|
1865
|
+
return matchDeclaredOption(parsed.selectedOption, input.options ?? []);
|
|
1866
|
+
} catch (error) {
|
|
1867
|
+
state.collector.classified(eventId, "parse_failed");
|
|
1868
|
+
throw error;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
function needsOptionReask(seat, input) {
|
|
1872
|
+
const declared = input.options;
|
|
1873
|
+
return declared !== void 0 && declared.length > 0 && seat.source === "llm" && seat.vote.decision === "approve" && seat.optionReask === void 0 && matchDeclaredOption(seat.selectedOption, declared) === void 0 && !isCancelled(input.signal);
|
|
1874
|
+
}
|
|
1875
|
+
async function reaskUnresolvedOption(seat, input) {
|
|
1876
|
+
if (!needsOptionReask(seat, input)) return seat;
|
|
1877
|
+
const start = getTimeProvider().now();
|
|
1878
|
+
const state = { collector: new VoterAttemptCollector() };
|
|
1879
|
+
let selection;
|
|
1880
|
+
try {
|
|
1881
|
+
selection = await askSelection(seat, input, state);
|
|
1882
|
+
} catch (error) {
|
|
1883
|
+
input.logger.warn("Option selection re-ask unresolved", {
|
|
1884
|
+
role: seat.role,
|
|
1885
|
+
error: getErrorMessage(error)
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
const resolved = selection !== void 0;
|
|
1889
|
+
input.logger.info("Option selection re-ask completed", { role: seat.role, resolved });
|
|
1890
|
+
const result = {
|
|
1891
|
+
...seat,
|
|
1892
|
+
...resolved ? { selectedOption: selection, vote: { ...seat.vote, selectedOption: selection } } : {},
|
|
1893
|
+
optionReask: { resolved },
|
|
1894
|
+
processingTimeMs: seat.processingTimeMs + getTimeProvider().now() - start,
|
|
1895
|
+
attemptUsage: mergeAttemptUsage(seat.attemptUsage, state.usage)
|
|
1896
|
+
};
|
|
1897
|
+
return withVoterAttemptTelemetry(result, () => {
|
|
1898
|
+
const prior = seat.attemptTelemetry;
|
|
1899
|
+
const next = state.collector.snapshot();
|
|
1900
|
+
return {
|
|
1901
|
+
events: [
|
|
1902
|
+
...prior?.events ?? [],
|
|
1903
|
+
...next.events.map((event) => ({
|
|
1904
|
+
...event,
|
|
1905
|
+
outcome: event.outcome === "final" ? "parsed" : event.outcome
|
|
1906
|
+
}))
|
|
1907
|
+
],
|
|
1908
|
+
observableAttempts: (prior?.observableAttempts ?? 0) + next.observableAttempts
|
|
1909
|
+
};
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1796
1913
|
// src/cli/voter-agents-deadline.ts
|
|
1797
1914
|
function computeOverallConsensusDeadlineMs(timeoutMs, maxRetries, roleCount, interDelayMs) {
|
|
1798
1915
|
const perVoteBudget = timeoutMs * (maxRetries + 1);
|
|
@@ -1914,7 +2031,24 @@ function voteBeforeDeadline(input, role, adapter, remaining) {
|
|
|
1914
2031
|
}
|
|
1915
2032
|
}
|
|
1916
2033
|
);
|
|
1917
|
-
return result.then(
|
|
2034
|
+
return result.then(
|
|
2035
|
+
(vote) => withVoterAttemptTelemetry(vote, () => vote.attemptTelemetry ?? collector.snapshot())
|
|
2036
|
+
);
|
|
2037
|
+
}
|
|
2038
|
+
function finishOptionSelection(vote, input, context) {
|
|
2039
|
+
const settings = input.voteOptions;
|
|
2040
|
+
return reaskUnresolvedOption(vote, {
|
|
2041
|
+
adapter: context.adapter,
|
|
2042
|
+
proposal: input.proposal,
|
|
2043
|
+
logger: input.logger,
|
|
2044
|
+
timeoutMs: Math.min(settings.timeoutMs, Math.max(1, context.deadlineAtMs - Date.now())),
|
|
2045
|
+
options: settings.declaredOptions,
|
|
2046
|
+
project: settings.project,
|
|
2047
|
+
workspace: settings.workspace,
|
|
2048
|
+
workspaceSha: settings.workspaceSha,
|
|
2049
|
+
signal: input.signal,
|
|
2050
|
+
withinRoleRetry: vote.retried === true || settings.withinRoleRetry === true || settings.attemptKind === "role_retry"
|
|
2051
|
+
});
|
|
1918
2052
|
}
|
|
1919
2053
|
async function launchRoleVote(role, index, input, voteOnAdapter, deadlineAtMs) {
|
|
1920
2054
|
const staggerWaitMs = Math.min(input.interDelay, Math.max(0, deadlineAtMs - Date.now()));
|
|
@@ -1946,8 +2080,7 @@ async function launchRoleVote(role, index, input, voteOnAdapter, deadlineAtMs) {
|
|
|
1946
2080
|
const fallback = crossCliFallback(adapter, assignedKey, primary.error ?? "");
|
|
1947
2081
|
return stamp(preserveVoterAttemptTelemetry(recovered, { ...recovered, fallback }));
|
|
1948
2082
|
}
|
|
1949
|
-
function createTimedVoteLauncher(input, deadlineAtMs) {
|
|
1950
|
-
const serialize = createKeyedSerializer();
|
|
2083
|
+
function createTimedVoteLauncher(input, deadlineAtMs, serialize) {
|
|
1951
2084
|
const voteOnAdapter = (role, adapter, fallback) => {
|
|
1952
2085
|
const cli = adapterCliKey(adapter);
|
|
1953
2086
|
const enqueuedAt = Date.now();
|
|
@@ -1981,10 +2114,23 @@ function createTimedVoteLauncher(input, deadlineAtMs) {
|
|
|
1981
2114
|
};
|
|
1982
2115
|
return voteOnAdapter;
|
|
1983
2116
|
}
|
|
2117
|
+
async function reaskUnresolvedOptions(votes, input, deadlineAtMs) {
|
|
2118
|
+
const serialize = createKeyedSerializer();
|
|
2119
|
+
return Promise.all(
|
|
2120
|
+
votes.map((vote) => {
|
|
2121
|
+
const adapter = vote.timing?.attempts.at(-1)?.fallback === true ? input.fallbackAdapter : input.roleAdapters.get(vote.role) ?? input.fallbackAdapter;
|
|
2122
|
+
return serialize(
|
|
2123
|
+
adapterCliKey(adapter),
|
|
2124
|
+
() => finishOptionSelection(vote, input, { adapter, deadlineAtMs })
|
|
2125
|
+
);
|
|
2126
|
+
})
|
|
2127
|
+
);
|
|
2128
|
+
}
|
|
1984
2129
|
async function launchVotesWithOverallDeadline(input) {
|
|
1985
2130
|
const { roles, logger: logger12, overallDeadlineMs } = input;
|
|
1986
2131
|
const deadlineAtMs = input.deadlineAtMs ?? Date.now() + overallDeadlineMs;
|
|
1987
|
-
const
|
|
2132
|
+
const serialize = createKeyedSerializer();
|
|
2133
|
+
const voteOnAdapter = createTimedVoteLauncher(input, deadlineAtMs, serialize);
|
|
1988
2134
|
const wrapped = roles.map(
|
|
1989
2135
|
(role, index) => launchRoleVote(role, index, input, voteOnAdapter, deadlineAtMs).then((result) => {
|
|
1990
2136
|
input.onVoteCollected?.(result);
|
|
@@ -2333,7 +2479,7 @@ async function assignPanelSeats(fallbackAdapter, options, logger12) {
|
|
|
2333
2479
|
async function collectPanelPasses(input, deadline, nonRetryableRoles, backoffMs) {
|
|
2334
2480
|
const { overallDeadlineMs, deadlineAtMs } = deadline;
|
|
2335
2481
|
const first = await launchStaggeredVotes(input, overallDeadlineMs, deadlineAtMs);
|
|
2336
|
-
|
|
2482
|
+
const final = await retryErroredRoles(
|
|
2337
2483
|
first,
|
|
2338
2484
|
(roles) => launchStaggeredVotes(
|
|
2339
2485
|
{ ...input, roles, voteOptions: { ...input.voteOptions, attemptKind: "role_retry" } },
|
|
@@ -2344,6 +2490,7 @@ async function collectPanelPasses(input, deadline, nonRetryableRoles, backoffMs)
|
|
|
2344
2490
|
backoffMs,
|
|
2345
2491
|
{ signal: input.signal, deadlineAtMs, nonRetryableRoles }
|
|
2346
2492
|
);
|
|
2493
|
+
return reaskUnresolvedOptions(final, input, deadlineAtMs);
|
|
2347
2494
|
}
|
|
2348
2495
|
async function collectRealVotes(options) {
|
|
2349
2496
|
const logger12 = options.logger ?? defaultLogger;
|
|
@@ -2442,9 +2589,9 @@ ${content}
|
|
|
2442
2589
|
// src/cli/voter-project.ts
|
|
2443
2590
|
import { readFileSync, statSync } from "node:fs";
|
|
2444
2591
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
2445
|
-
import { z as
|
|
2592
|
+
import { z as z3 } from "zod";
|
|
2446
2593
|
var VOTER_PROJECT_PATTERN = /^[A-Za-z0-9._/@-]{1,200}$/;
|
|
2447
|
-
var VoterProjectInputSchema =
|
|
2594
|
+
var VoterProjectInputSchema = z3.string().regex(VOTER_PROJECT_PATTERN).optional().describe(
|
|
2448
2595
|
"The project the panel is judging (#6110), e.g. `acme/widgets` \u2014 it replaces `nexus-agents` in every voter's system prompt, so a consuming repository is not judged against this one's mission and governance files. When omitted the name is DERIVED from the server's working directory (the `origin` remote as `owner/repo`, else the nearest `package.json` name) and falls back to `nexus-agents`; the response discloses which on `project.source`. Letters, digits and `._/@-` only, at most 200 characters."
|
|
2449
2596
|
);
|
|
2450
2597
|
var MAX_ANCESTOR_DEPTH = 64;
|
|
@@ -2609,40 +2756,40 @@ function describeVeto(verdict) {
|
|
|
2609
2756
|
}
|
|
2610
2757
|
|
|
2611
2758
|
// src/consensus/types-voting-protocol.ts
|
|
2612
|
-
import { z as
|
|
2759
|
+
import { z as z4 } from "zod";
|
|
2613
2760
|
var VOTING_ROUND_DEFAULT_TIMEOUT_MS = OPERATION_CLASSES["multi-llm-panel"].guardMs;
|
|
2614
|
-
var VotingRoundPhaseSchema =
|
|
2615
|
-
var VotingRoundStatusSchema =
|
|
2761
|
+
var VotingRoundPhaseSchema = z4.enum(["analysis", "deliberation", "consensus"]);
|
|
2762
|
+
var VotingRoundStatusSchema = z4.enum([
|
|
2616
2763
|
"pending",
|
|
2617
2764
|
"in_progress",
|
|
2618
2765
|
"awaiting_votes",
|
|
2619
2766
|
"completed",
|
|
2620
2767
|
"aborted"
|
|
2621
2768
|
]);
|
|
2622
|
-
var AgentFindingSchema =
|
|
2623
|
-
agentId:
|
|
2624
|
-
category:
|
|
2625
|
-
severity:
|
|
2626
|
-
description:
|
|
2627
|
-
location:
|
|
2628
|
-
suggestion:
|
|
2629
|
-
confidence:
|
|
2630
|
-
timestamp:
|
|
2769
|
+
var AgentFindingSchema = z4.object({
|
|
2770
|
+
agentId: z4.string(),
|
|
2771
|
+
category: z4.enum(["bug", "security", "performance", "style", "design", "documentation", "other"]),
|
|
2772
|
+
severity: z4.enum(["critical", "major", "minor", "suggestion"]),
|
|
2773
|
+
description: z4.string().min(1),
|
|
2774
|
+
location: z4.string().optional().describe("File path and line range if applicable"),
|
|
2775
|
+
suggestion: z4.string().optional().describe("Recommended fix"),
|
|
2776
|
+
confidence: z4.number().min(0).max(1),
|
|
2777
|
+
timestamp: z4.iso.datetime().optional()
|
|
2631
2778
|
});
|
|
2632
|
-
var FindingVoteSchema =
|
|
2633
|
-
agentId:
|
|
2634
|
-
findingId:
|
|
2635
|
-
agree:
|
|
2636
|
-
reasoning:
|
|
2637
|
-
amendedSeverity:
|
|
2779
|
+
var FindingVoteSchema = z4.object({
|
|
2780
|
+
agentId: z4.string(),
|
|
2781
|
+
findingId: z4.string(),
|
|
2782
|
+
agree: z4.boolean(),
|
|
2783
|
+
reasoning: z4.string().optional(),
|
|
2784
|
+
amendedSeverity: z4.enum(["critical", "major", "minor", "suggestion"]).optional()
|
|
2638
2785
|
});
|
|
2639
|
-
var VotingProtocolConfigSchema =
|
|
2640
|
-
committeeSize:
|
|
2641
|
-
maxRounds:
|
|
2642
|
-
roundTimeoutMs:
|
|
2643
|
-
agreementThreshold:
|
|
2644
|
-
enableAntiSycophancy:
|
|
2645
|
-
sycophancyThreshold:
|
|
2786
|
+
var VotingProtocolConfigSchema = z4.object({
|
|
2787
|
+
committeeSize: z4.number().int().min(2).max(7).default(3),
|
|
2788
|
+
maxRounds: z4.number().int().min(1).max(5).default(3),
|
|
2789
|
+
roundTimeoutMs: z4.number().int().positive().default(VOTING_ROUND_DEFAULT_TIMEOUT_MS),
|
|
2790
|
+
agreementThreshold: z4.number().min(0.5).max(1).default(SUPERMAJORITY_THRESHOLD),
|
|
2791
|
+
enableAntiSycophancy: z4.boolean().default(true),
|
|
2792
|
+
sycophancyThreshold: z4.number().min(0).max(1).default(0.8)
|
|
2646
2793
|
});
|
|
2647
2794
|
var DEFAULT_VOTING_PROTOCOL_CONFIG = {
|
|
2648
2795
|
committeeSize: 3,
|
|
@@ -2655,30 +2802,30 @@ var DEFAULT_VOTING_PROTOCOL_CONFIG = {
|
|
|
2655
2802
|
};
|
|
2656
2803
|
|
|
2657
2804
|
// src/consensus/types-weighted-voting.ts
|
|
2658
|
-
import { z as
|
|
2659
|
-
var TaskOutcomeStatusSchema =
|
|
2660
|
-
var WeightedAgentRecordSchema =
|
|
2661
|
-
agentId:
|
|
2662
|
-
totalTasks:
|
|
2663
|
-
successfulTasks:
|
|
2664
|
-
failedTasks:
|
|
2665
|
-
partialTasks:
|
|
2666
|
-
successRate:
|
|
2667
|
-
weight:
|
|
2668
|
-
trustScore:
|
|
2669
|
-
byzantineFlags:
|
|
2670
|
-
lastActive:
|
|
2671
|
-
createdAt:
|
|
2805
|
+
import { z as z5 } from "zod";
|
|
2806
|
+
var TaskOutcomeStatusSchema = z5.enum(["success", "failure", "partial", "unknown"]);
|
|
2807
|
+
var WeightedAgentRecordSchema = z5.object({
|
|
2808
|
+
agentId: z5.string().min(1),
|
|
2809
|
+
totalTasks: z5.number().int().nonnegative(),
|
|
2810
|
+
successfulTasks: z5.number().int().nonnegative(),
|
|
2811
|
+
failedTasks: z5.number().int().nonnegative(),
|
|
2812
|
+
partialTasks: z5.number().int().nonnegative(),
|
|
2813
|
+
successRate: z5.number().min(0).max(1),
|
|
2814
|
+
weight: z5.number().min(0).max(1),
|
|
2815
|
+
trustScore: z5.number().min(0).max(1),
|
|
2816
|
+
byzantineFlags: z5.number().int().nonnegative(),
|
|
2817
|
+
lastActive: z5.date(),
|
|
2818
|
+
createdAt: z5.date()
|
|
2672
2819
|
});
|
|
2673
|
-
var WeightedVotingConfigSchema =
|
|
2674
|
-
minWeight:
|
|
2675
|
-
maxByzantineFraction:
|
|
2676
|
-
weightDecayFactor:
|
|
2677
|
-
weightRecoveryFactor:
|
|
2678
|
-
minTrustScore:
|
|
2679
|
-
byzantineFlagThreshold:
|
|
2680
|
-
initialWeight:
|
|
2681
|
-
quorumThreshold:
|
|
2820
|
+
var WeightedVotingConfigSchema = z5.object({
|
|
2821
|
+
minWeight: z5.number().min(0).max(1).default(0.1),
|
|
2822
|
+
maxByzantineFraction: z5.number().min(0).max(0.5).default(0.33),
|
|
2823
|
+
weightDecayFactor: z5.number().min(0.5).max(1).default(0.9),
|
|
2824
|
+
weightRecoveryFactor: z5.number().min(1).max(2).default(1.05),
|
|
2825
|
+
minTrustScore: z5.number().min(0).max(1).default(0.3),
|
|
2826
|
+
byzantineFlagThreshold: z5.number().int().positive().default(3),
|
|
2827
|
+
initialWeight: z5.number().min(0).max(1).default(0.5),
|
|
2828
|
+
quorumThreshold: z5.number().min(0.5).max(1).default(SUPERMAJORITY_THRESHOLD)
|
|
2682
2829
|
});
|
|
2683
2830
|
var DEFAULT_WEIGHTED_VOTING_CONFIG = {
|
|
2684
2831
|
minWeight: 0.1,
|
|
@@ -2693,7 +2840,7 @@ var DEFAULT_WEIGHTED_VOTING_CONFIG = {
|
|
|
2693
2840
|
};
|
|
2694
2841
|
|
|
2695
2842
|
// src/consensus/higher-order-types.ts
|
|
2696
|
-
import { z as
|
|
2843
|
+
import { z as z6 } from "zod";
|
|
2697
2844
|
function createAgentPairKey(agentA, agentB) {
|
|
2698
2845
|
return agentA < agentB ? `${agentA}:${agentB}` : `${agentB}:${agentA}`;
|
|
2699
2846
|
}
|
|
@@ -2704,43 +2851,43 @@ function parseAgentPairKey(key) {
|
|
|
2704
2851
|
}
|
|
2705
2852
|
return [parts[0], parts[1]];
|
|
2706
2853
|
}
|
|
2707
|
-
var CorrelationCoefficientSchema =
|
|
2708
|
-
var IndependentSubsetSchema =
|
|
2709
|
-
id:
|
|
2710
|
-
agentIds:
|
|
2711
|
-
independenceScore:
|
|
2712
|
-
pairCoverage:
|
|
2713
|
-
observed:
|
|
2714
|
-
total:
|
|
2854
|
+
var CorrelationCoefficientSchema = z6.number().min(-1).max(1);
|
|
2855
|
+
var IndependentSubsetSchema = z6.object({
|
|
2856
|
+
id: z6.string(),
|
|
2857
|
+
agentIds: z6.array(z6.string()),
|
|
2858
|
+
independenceScore: z6.number().min(0).max(1),
|
|
2859
|
+
pairCoverage: z6.object({
|
|
2860
|
+
observed: z6.number().int().nonnegative(),
|
|
2861
|
+
total: z6.number().int().nonnegative()
|
|
2715
2862
|
}),
|
|
2716
|
-
observationCount:
|
|
2863
|
+
observationCount: z6.number().int().nonnegative()
|
|
2717
2864
|
});
|
|
2718
|
-
var VotingObservationSchema =
|
|
2719
|
-
proposalId:
|
|
2720
|
-
agentId:
|
|
2721
|
-
decision:
|
|
2722
|
-
confidence:
|
|
2723
|
-
alignedWithOutcome:
|
|
2724
|
-
timestamp:
|
|
2725
|
-
modelKey:
|
|
2726
|
-
observedModel:
|
|
2865
|
+
var VotingObservationSchema = z6.object({
|
|
2866
|
+
proposalId: z6.string(),
|
|
2867
|
+
agentId: z6.string(),
|
|
2868
|
+
decision: z6.enum(["approve", "reject", "abstain"]),
|
|
2869
|
+
confidence: z6.number().min(0).max(1),
|
|
2870
|
+
alignedWithOutcome: z6.boolean(),
|
|
2871
|
+
timestamp: z6.date(),
|
|
2872
|
+
modelKey: z6.string().optional(),
|
|
2873
|
+
observedModel: z6.string().optional()
|
|
2727
2874
|
});
|
|
2728
|
-
var PairwiseVotingHistorySchema =
|
|
2729
|
-
pairKey:
|
|
2730
|
-
jointObservations:
|
|
2731
|
-
agreements:
|
|
2732
|
-
disagreements:
|
|
2875
|
+
var PairwiseVotingHistorySchema = z6.object({
|
|
2876
|
+
pairKey: z6.string(),
|
|
2877
|
+
jointObservations: z6.number().int().nonnegative(),
|
|
2878
|
+
agreements: z6.number().int().nonnegative(),
|
|
2879
|
+
disagreements: z6.number().int().nonnegative(),
|
|
2733
2880
|
correlation: CorrelationCoefficientSchema,
|
|
2734
|
-
lastUpdated:
|
|
2881
|
+
lastUpdated: z6.date()
|
|
2735
2882
|
});
|
|
2736
|
-
var HigherOrderVotingConfigSchema =
|
|
2737
|
-
minObservationsForCorrelation:
|
|
2738
|
-
correlationThreshold:
|
|
2739
|
-
independenceThreshold:
|
|
2740
|
-
fallbackToSimpleVoting:
|
|
2741
|
-
maxObservationsPerAgent:
|
|
2742
|
-
maxProposals:
|
|
2743
|
-
maxTrackedPairs:
|
|
2883
|
+
var HigherOrderVotingConfigSchema = z6.object({
|
|
2884
|
+
minObservationsForCorrelation: z6.number().int().positive().default(10),
|
|
2885
|
+
correlationThreshold: z6.number().min(0).max(1).default(0.3),
|
|
2886
|
+
independenceThreshold: z6.number().min(0).max(1).default(0.2),
|
|
2887
|
+
fallbackToSimpleVoting: z6.boolean().default(true),
|
|
2888
|
+
maxObservationsPerAgent: z6.number().int().positive().default(1e3),
|
|
2889
|
+
maxProposals: z6.number().int().positive().default(5e3),
|
|
2890
|
+
maxTrackedPairs: z6.number().int().positive().default(100)
|
|
2744
2891
|
});
|
|
2745
2892
|
var DEFAULT_HIGHER_ORDER_CONFIG = {
|
|
2746
2893
|
minObservationsForCorrelation: 10,
|
|
@@ -2751,25 +2898,25 @@ var DEFAULT_HIGHER_ORDER_CONFIG = {
|
|
|
2751
2898
|
maxProposals: 5e3,
|
|
2752
2899
|
maxTrackedPairs: 100
|
|
2753
2900
|
};
|
|
2754
|
-
var HigherOrderVotingResultSchema =
|
|
2755
|
-
decision:
|
|
2756
|
-
posteriorApproval:
|
|
2757
|
-
posteriorRejection:
|
|
2758
|
-
effectiveVoteCount:
|
|
2759
|
-
usedCorrelationData:
|
|
2760
|
-
method:
|
|
2761
|
-
improvementOverBaseline:
|
|
2762
|
-
independentSubsets:
|
|
2763
|
-
downweightedAgents:
|
|
2764
|
-
reasoning:
|
|
2901
|
+
var HigherOrderVotingResultSchema = z6.object({
|
|
2902
|
+
decision: z6.enum(["approve", "reject", "no_consensus"]),
|
|
2903
|
+
posteriorApproval: z6.number().min(0).max(1),
|
|
2904
|
+
posteriorRejection: z6.number().min(0).max(1),
|
|
2905
|
+
effectiveVoteCount: z6.number().nonnegative(),
|
|
2906
|
+
usedCorrelationData: z6.boolean(),
|
|
2907
|
+
method: z6.enum(["ow", "isp", "simple"]),
|
|
2908
|
+
improvementOverBaseline: z6.number(),
|
|
2909
|
+
independentSubsets: z6.array(IndependentSubsetSchema).optional(),
|
|
2910
|
+
downweightedAgents: z6.array(z6.string()),
|
|
2911
|
+
reasoning: z6.string()
|
|
2765
2912
|
});
|
|
2766
|
-
var CorrelationTrackerStatsSchema =
|
|
2767
|
-
totalAgents:
|
|
2768
|
-
trackedPairs:
|
|
2769
|
-
totalObservations:
|
|
2770
|
-
averageCorrelation:
|
|
2771
|
-
independentSubsetCount:
|
|
2772
|
-
pairsWithSufficientData:
|
|
2913
|
+
var CorrelationTrackerStatsSchema = z6.object({
|
|
2914
|
+
totalAgents: z6.number().int().nonnegative(),
|
|
2915
|
+
trackedPairs: z6.number().int().nonnegative(),
|
|
2916
|
+
totalObservations: z6.number().int().nonnegative(),
|
|
2917
|
+
averageCorrelation: z6.number(),
|
|
2918
|
+
independentSubsetCount: z6.number().int().nonnegative(),
|
|
2919
|
+
pairsWithSufficientData: z6.number().int().nonnegative()
|
|
2773
2920
|
});
|
|
2774
2921
|
|
|
2775
2922
|
// src/consensus/higher-order-helpers.ts
|
|
@@ -5677,24 +5824,24 @@ function createCorrelationTracker(config) {
|
|
|
5677
5824
|
import * as fs from "node:fs";
|
|
5678
5825
|
|
|
5679
5826
|
// src/consensus/correlation-persistence-records.ts
|
|
5680
|
-
import { z as
|
|
5681
|
-
var PersistedVoteSchema =
|
|
5682
|
-
agentId:
|
|
5683
|
-
decision:
|
|
5684
|
-
confidence:
|
|
5685
|
-
modelKey:
|
|
5686
|
-
observedModel:
|
|
5827
|
+
import { z as z7 } from "zod";
|
|
5828
|
+
var PersistedVoteSchema = z7.object({
|
|
5829
|
+
agentId: z7.string(),
|
|
5830
|
+
decision: z7.enum(["approve", "reject", "abstain"]),
|
|
5831
|
+
confidence: z7.number().min(0).max(1),
|
|
5832
|
+
modelKey: z7.string().optional(),
|
|
5833
|
+
observedModel: z7.string().optional()
|
|
5687
5834
|
});
|
|
5688
|
-
var PersistedProposalSchema =
|
|
5689
|
-
proposalId:
|
|
5690
|
-
votes:
|
|
5691
|
-
outcome:
|
|
5692
|
-
timestamp:
|
|
5835
|
+
var PersistedProposalSchema = z7.object({
|
|
5836
|
+
proposalId: z7.string(),
|
|
5837
|
+
votes: z7.array(PersistedVoteSchema),
|
|
5838
|
+
outcome: z7.enum(["approved", "rejected"]),
|
|
5839
|
+
timestamp: z7.iso.datetime()
|
|
5693
5840
|
});
|
|
5694
|
-
var PersistedCorrelationDataSchema =
|
|
5695
|
-
version:
|
|
5696
|
-
proposals:
|
|
5697
|
-
savedAt:
|
|
5841
|
+
var PersistedCorrelationDataSchema = z7.object({
|
|
5842
|
+
version: z7.number().int().positive(),
|
|
5843
|
+
proposals: z7.array(PersistedProposalSchema),
|
|
5844
|
+
savedAt: z7.iso.datetime()
|
|
5698
5845
|
});
|
|
5699
5846
|
function createPersistedProposal(proposalId, votes, outcome, context) {
|
|
5700
5847
|
const persistedVotes = [];
|
|
@@ -5936,10 +6083,10 @@ function createPersistentCorrelationTracker(config) {
|
|
|
5936
6083
|
}
|
|
5937
6084
|
|
|
5938
6085
|
// src/mcp/tools/consensus-vote-types.ts
|
|
5939
|
-
import { z as
|
|
6086
|
+
import { z as z9 } from "zod";
|
|
5940
6087
|
|
|
5941
6088
|
// src/mcp/tools/async-dispatch-input.ts
|
|
5942
|
-
import { z as
|
|
6089
|
+
import { z as z8 } from "zod";
|
|
5943
6090
|
var DISPATCH_MODES = ["sync", "async"];
|
|
5944
6091
|
var DISPATCH_DESCRIPTION = "Async dispatch (#4968). 'sync' (default): run inline and return the result. 'async': return { status: 'pending', jobId } immediately and run in the background; poll get_job_result({ jobId }).";
|
|
5945
6092
|
var WRONG_KEY_MODE_MESSAGE = '`mode` is not the async switch on this tool; send `dispatch: "async"` (or "sync") instead (#4968).';
|
|
@@ -5947,12 +6094,12 @@ function describeDispatch(note) {
|
|
|
5947
6094
|
return note === void 0 ? DISPATCH_DESCRIPTION : `${DISPATCH_DESCRIPTION} ${note}`;
|
|
5948
6095
|
}
|
|
5949
6096
|
function dispatchField(note) {
|
|
5950
|
-
return
|
|
6097
|
+
return z8.enum(DISPATCH_MODES).optional().describe(describeDispatch(note));
|
|
5951
6098
|
}
|
|
5952
6099
|
function dispatchFieldDefaultSync(note) {
|
|
5953
|
-
return
|
|
6100
|
+
return z8.enum(DISPATCH_MODES).default("sync").describe(describeDispatch(note));
|
|
5954
6101
|
}
|
|
5955
|
-
var REJECTED_MODE_KEY =
|
|
6102
|
+
var REJECTED_MODE_KEY = z8.never({ error: WRONG_KEY_MODE_MESSAGE }).optional().describe(
|
|
5956
6103
|
"Not an input of this tool. The async switch is `dispatch`; `mode: 'async'` is rejected (#4968)."
|
|
5957
6104
|
);
|
|
5958
6105
|
function asyncDispatchInput(note) {
|
|
@@ -6095,7 +6242,7 @@ function checkUndeclaredOptions(proposal, declaredOptions, allEngagedApproved) {
|
|
|
6095
6242
|
|
|
6096
6243
|
// src/mcp/tools/consensus-vote-types.ts
|
|
6097
6244
|
var MAX_PROPOSAL_LENGTH = 4e3;
|
|
6098
|
-
var VotingStrategySchema =
|
|
6245
|
+
var VotingStrategySchema = z9.enum(
|
|
6099
6246
|
["simple_majority", "supermajority", "unanimous", "higher_order", "opinion_wise"],
|
|
6100
6247
|
{
|
|
6101
6248
|
error: (issue) => issue.input === "proof_of_learning" ? RETIRED_CONSENSUS_STRATEGY_MESSAGE : void 0
|
|
@@ -6108,21 +6255,21 @@ var HIGHER_ORDER_ESCALATION_POSTERIOR_FLOOR = 0.65;
|
|
|
6108
6255
|
function shouldEscalateLowPosterior(strategy, outcome, quickMode, posteriorApproval) {
|
|
6109
6256
|
return quickMode && outcome === "approved" && isHigherOrderStrategy(strategy) && posteriorApproval !== void 0 && posteriorApproval < HIGHER_ORDER_ESCALATION_POSTERIOR_FLOOR;
|
|
6110
6257
|
}
|
|
6111
|
-
var ErrorPolicySchema =
|
|
6258
|
+
var ErrorPolicySchema = z9.enum([
|
|
6112
6259
|
"reduce_denominator",
|
|
6113
6260
|
"count_as_abstain",
|
|
6114
6261
|
"fail_closed",
|
|
6115
6262
|
"absolute_quorum"
|
|
6116
6263
|
]);
|
|
6117
|
-
var VoteThresholdSchema =
|
|
6118
|
-
var ConsensusVoteInputSchema =
|
|
6119
|
-
proposal:
|
|
6264
|
+
var VoteThresholdSchema = z9.enum(["majority", "supermajority", "unanimous"]);
|
|
6265
|
+
var ConsensusVoteInputSchema = z9.object({
|
|
6266
|
+
proposal: z9.string().min(1).max(MAX_PROPOSAL_LENGTH).describe(
|
|
6120
6267
|
'Proposal text to vote on. If the proposal asks voters to choose among named alternatives, declare them in `options` (#4472) \u2014 otherwise the tally records approve/reject/abstain only, so every voter who engages returns `approve` and a 6-1 split on WHICH option persists as 7-0, 100% (#4452). This is ENFORCED AS A WARNING, not a refusal: a heuristic over the proposal text flags an apparent multi-option proposal with no `options` and says so on `panelWarning` (#5360). The wording says "declare", not "MUST", because the warning is what the code actually holds \u2014 it is tightened back only in the same change that promotes the warning to a refusal.'
|
|
6121
6268
|
),
|
|
6122
|
-
artifactPath:
|
|
6269
|
+
artifactPath: z9.string().min(1).max(4096).optional().describe(
|
|
6123
6270
|
"UTF-8 artifact file within the repository root (server cwd). Its content is inlined into every seat's proposal with a SHA-256 digest; maximum 256 KiB. Missing, empty, binary (NUL byte), oversized, and escaping paths are rejected. Seats read the inlined text, not the tree."
|
|
6124
6271
|
),
|
|
6125
|
-
options:
|
|
6272
|
+
options: z9.array(z9.string().min(1).max(200)).min(2).max(10).optional().describe(
|
|
6126
6273
|
"Named alternatives for a multi-option proposal (#4472). When present, the threshold must ALSO be cleared by the leading option, in addition to the ordinary approve/reject bar: `unanimous` requires every approver to have chosen the SAME option, and `supermajority`/`majority` measure the leading option's share of approvers. An approving voter whose selection is absent or matches no declared option stays in the denominator and credits no option, so a degraded response can only lower the leading share, never raise it. Omit for an ordinary yes/no vote \u2014 behaviour is then unchanged."
|
|
6127
6274
|
),
|
|
6128
6275
|
project: VoterProjectInputSchema,
|
|
@@ -6135,8 +6282,8 @@ var ConsensusVoteInputSchema = z8.object({
|
|
|
6135
6282
|
errorPolicy: ErrorPolicySchema.optional().describe(
|
|
6136
6283
|
"How to treat voters that errored or timed out (#2630). Default: fail_closed for unanimous only; reduce_denominator for all other strategies incl. higher_order/opinion_wise (#3138 \u2014 a single infra timeout should not void an otherwise-unanimous vote). Opt-in absolute_quorum (#4132): an errored voter \u2014 especially the contrarian (catfish) \u2014 degrades the verdict to no_quorum (recoverable re-run) instead of being dropped from the denominator; never manufactures approved/rejected from an induced error. Regardless of policy, errors > 50% always fails."
|
|
6137
6284
|
),
|
|
6138
|
-
quickMode:
|
|
6139
|
-
simulateVotes:
|
|
6285
|
+
quickMode: z9.boolean().optional().default(false).describe("Use 3 agents instead of the full 7-role panel for faster execution"),
|
|
6286
|
+
simulateVotes: z9.boolean().optional().default(false).describe(
|
|
6140
6287
|
"TESTS ONLY \u2014 when true, voters return random decisions. Output must not be used for real decisions. (#2319)"
|
|
6141
6288
|
),
|
|
6142
6289
|
/**
|
|
@@ -6178,7 +6325,7 @@ var ConsensusVoteInputSchema = z8.object({
|
|
|
6178
6325
|
* same key with different inputs fails closed with
|
|
6179
6326
|
* `idempotency_key_collision`. Sync mode ignores this.
|
|
6180
6327
|
*/
|
|
6181
|
-
idempotencyKey:
|
|
6328
|
+
idempotencyKey: z9.string().min(1).max(256).optional().describe(
|
|
6182
6329
|
"Replay-safe key for async-mode dispatch (#3042 Stage 1c). Same (key, inputs) returns existing jobId."
|
|
6183
6330
|
),
|
|
6184
6331
|
/**
|
|
@@ -6190,7 +6337,7 @@ var ConsensusVoteInputSchema = z8.object({
|
|
|
6190
6337
|
* record and require `ratifies === transition.subject` (with decision=approved,
|
|
6191
6338
|
* strategy=higher_order). Omit on an ordinary vote.
|
|
6192
6339
|
*/
|
|
6193
|
-
ratifies:
|
|
6340
|
+
ratifies: z9.string().min(1).max(256).optional().describe(
|
|
6194
6341
|
"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."
|
|
6195
6342
|
),
|
|
6196
6343
|
/**
|
|
@@ -6207,14 +6354,14 @@ var ConsensusVoteInputSchema = z8.object({
|
|
|
6207
6354
|
"Governor-path PR ratification binding (#5130): pr is the PR number and headSha the full 40-hex head sha the panel reviewed. Bound into the authentic vote record so the committed ledger and the governor gate can verify which PR, at which head, this panel ratified. Omit for ordinary votes."
|
|
6208
6355
|
)
|
|
6209
6356
|
});
|
|
6210
|
-
var VoteDecisionStatusSchema =
|
|
6357
|
+
var VoteDecisionStatusSchema = z9.enum([
|
|
6211
6358
|
"approved",
|
|
6212
6359
|
"rejected",
|
|
6213
6360
|
"pending",
|
|
6214
6361
|
"timeout",
|
|
6215
6362
|
"no_quorum"
|
|
6216
6363
|
]);
|
|
6217
|
-
var ContrarianCheckStatusSchema =
|
|
6364
|
+
var ContrarianCheckStatusSchema = z9.enum(["ok", "errored", "skipped"]);
|
|
6218
6365
|
function toRecordDecision(status) {
|
|
6219
6366
|
switch (status) {
|
|
6220
6367
|
case "approved":
|
|
@@ -6494,7 +6641,7 @@ function logPartialProposal(bounded, log) {
|
|
|
6494
6641
|
}
|
|
6495
6642
|
async function runContrarianCheck(proposal, options, log, opts) {
|
|
6496
6643
|
try {
|
|
6497
|
-
const { executeExpert } = await import("./expert-bridge-
|
|
6644
|
+
const { executeExpert } = await import("./expert-bridge-3WL6X37T.js");
|
|
6498
6645
|
const bounded = boundArtifactForReview(proposal, CONTRARIAN_PROPOSAL_BUDGET, "proposal");
|
|
6499
6646
|
logPartialProposal(bounded, log);
|
|
6500
6647
|
const result = await executeExpert(
|
|
@@ -6678,20 +6825,20 @@ async function withFileLock(lockPath, body, options = {}) {
|
|
|
6678
6825
|
}
|
|
6679
6826
|
|
|
6680
6827
|
// src/mcp/jobs/job-cancelled-partial-schema.ts
|
|
6681
|
-
import { z as
|
|
6682
|
-
var CancelledPartialSchema =
|
|
6683
|
-
partialVotes:
|
|
6684
|
-
seatsCast:
|
|
6685
|
-
panelSize:
|
|
6828
|
+
import { z as z10 } from "zod";
|
|
6829
|
+
var CancelledPartialSchema = z10.strictObject({
|
|
6830
|
+
partialVotes: z10.array(z10.unknown()),
|
|
6831
|
+
seatsCast: z10.number().int().nonnegative(),
|
|
6832
|
+
panelSize: z10.number().int().nonnegative()
|
|
6686
6833
|
});
|
|
6687
6834
|
|
|
6688
6835
|
// src/mcp/jobs/job-result-store.ts
|
|
6689
6836
|
import { existsSync as existsSync4, readdirSync, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2, chmodSync, mkdirSync as mkdirSync2 } from "node:fs";
|
|
6690
6837
|
import { dirname as dirname2 } from "node:path";
|
|
6691
|
-
import { z as
|
|
6838
|
+
import { z as z14 } from "zod";
|
|
6692
6839
|
|
|
6693
6840
|
// src/mcp/jobs/job-id.ts
|
|
6694
|
-
import { z as
|
|
6841
|
+
import { z as z11 } from "zod";
|
|
6695
6842
|
var JOB_ID_MAX_LENGTH = 128;
|
|
6696
6843
|
var JOB_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
6697
6844
|
function isValidJobId(jobId) {
|
|
@@ -6703,26 +6850,26 @@ function assertValidJobId(jobId) {
|
|
|
6703
6850
|
}
|
|
6704
6851
|
}
|
|
6705
6852
|
function jobIdSchema(description) {
|
|
6706
|
-
return
|
|
6853
|
+
return z11.string().min(1).max(JOB_ID_MAX_LENGTH).regex(JOB_ID_PATTERN, 'jobId must contain only letters, digits, "_" and "-"').describe(description);
|
|
6707
6854
|
}
|
|
6708
6855
|
|
|
6709
6856
|
// src/mcp/jobs/job-idempotency.ts
|
|
6710
6857
|
import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
|
|
6711
6858
|
import { existsSync as existsSync2, readFileSync as readFileSync4, writeFileSync } from "node:fs";
|
|
6712
|
-
import { z as
|
|
6859
|
+
import { z as z12 } from "zod";
|
|
6713
6860
|
var logger6 = createLogger({ component: "job-idempotency" });
|
|
6714
|
-
var IdempotencyIndexEntrySchema =
|
|
6715
|
-
v:
|
|
6861
|
+
var IdempotencyIndexEntrySchema = z12.object({
|
|
6862
|
+
v: z12.literal(1),
|
|
6716
6863
|
/** MCP tool name (e.g. `orchestrate`, `run_workflow`, `consensus_vote`). */
|
|
6717
|
-
tool:
|
|
6864
|
+
tool: z12.string().min(1),
|
|
6718
6865
|
/** Caller-supplied idempotency key. */
|
|
6719
|
-
key:
|
|
6866
|
+
key: z12.string().min(1),
|
|
6720
6867
|
/** sha256 of the canonical input JSON. */
|
|
6721
|
-
inputsHash:
|
|
6868
|
+
inputsHash: z12.string().length(64),
|
|
6722
6869
|
/** Existing jobId for this (tool, key, inputs) tuple. */
|
|
6723
|
-
jobId:
|
|
6870
|
+
jobId: z12.string().min(1),
|
|
6724
6871
|
/** ISO timestamp of first dispatch. */
|
|
6725
|
-
createdAt:
|
|
6872
|
+
createdAt: z12.iso.datetime()
|
|
6726
6873
|
});
|
|
6727
6874
|
function sha256Hex(input) {
|
|
6728
6875
|
return createHash2("sha256").update(input).digest("hex");
|
|
@@ -6949,14 +7096,14 @@ function syncAlternateCandidates(jobId, primaryPath, record, logger12, persistFn
|
|
|
6949
7096
|
}
|
|
6950
7097
|
|
|
6951
7098
|
// src/mcp/jobs/job-failure-detail.ts
|
|
6952
|
-
import { z as
|
|
6953
|
-
var JobFailureDetailSchema =
|
|
7099
|
+
import { z as z13 } from "zod";
|
|
7100
|
+
var JobFailureDetailSchema = z13.object({
|
|
6954
7101
|
/** Identifier of the failing adapter (e.g. 'claude', 'codex', 'api:anthropic'). */
|
|
6955
|
-
adapter:
|
|
7102
|
+
adapter: z13.string().min(1),
|
|
6956
7103
|
/** Transport mechanism where the failure occurred (e.g. 'subprocess', 'mcp', 'stdio'). */
|
|
6957
|
-
transport:
|
|
7104
|
+
transport: z13.string().min(1),
|
|
6958
7105
|
/** Normalized failure category (e.g. 'rate_limited', 'timeout', 'capacity_exhausted'). */
|
|
6959
|
-
category:
|
|
7106
|
+
category: z13.string().min(1)
|
|
6960
7107
|
});
|
|
6961
7108
|
function isRecord(value) {
|
|
6962
7109
|
return typeof value === "object" && value !== null;
|
|
@@ -7028,28 +7175,28 @@ function validateAndSanitizeFailureDetail(detail) {
|
|
|
7028
7175
|
|
|
7029
7176
|
// src/mcp/jobs/job-result-store.ts
|
|
7030
7177
|
var logger7 = createLogger({ component: "job-result-store" });
|
|
7031
|
-
var JobStatusSchema =
|
|
7032
|
-
var JobResultSchema =
|
|
7178
|
+
var JobStatusSchema = z14.enum(["pending", "complete", "failed", "cancelled"]);
|
|
7179
|
+
var JobResultSchema = z14.object({
|
|
7033
7180
|
/** Format version. Currently `1` — bump if the shape changes. */
|
|
7034
|
-
v:
|
|
7035
|
-
jobId:
|
|
7181
|
+
v: z14.literal(1),
|
|
7182
|
+
jobId: z14.string().min(1),
|
|
7036
7183
|
/** Tool that was invoked (e.g. `orchestrate`). */
|
|
7037
|
-
toolName:
|
|
7184
|
+
toolName: z14.string().min(1),
|
|
7038
7185
|
status: JobStatusSchema,
|
|
7039
|
-
createdAt:
|
|
7186
|
+
createdAt: z14.iso.datetime(),
|
|
7040
7187
|
/** Set when the job leaves `pending` — either via `complete` or `failed` or `cancelled`. */
|
|
7041
|
-
completedAt:
|
|
7188
|
+
completedAt: z14.iso.datetime().optional(),
|
|
7042
7189
|
/**
|
|
7043
7190
|
* Structured payload the synchronous mode would have returned. Present
|
|
7044
7191
|
* only when `status === 'complete'`. Shape is tool-specific — readers
|
|
7045
7192
|
* cast to the tool's known output type after status check.
|
|
7046
7193
|
*/
|
|
7047
|
-
result:
|
|
7194
|
+
result: z14.unknown().optional(),
|
|
7048
7195
|
/**
|
|
7049
7196
|
* Failure message when `status === 'failed'`. Cannot be paired with
|
|
7050
7197
|
* `result` — the discriminator is `status`.
|
|
7051
7198
|
*/
|
|
7052
|
-
error:
|
|
7199
|
+
error: z14.string().optional(),
|
|
7053
7200
|
/**
|
|
7054
7201
|
* Structured failure detail when `status === 'failed'` (#4375).
|
|
7055
7202
|
* Holds normalized adapter, transport, and category information without
|
|
@@ -7064,7 +7211,7 @@ var JobResultSchema = z13.object({
|
|
|
7064
7211
|
* the sweep rewrote it rather than deleting it. Absent on every record the
|
|
7065
7212
|
* job's own process wrote — `error` alone carries those failures.
|
|
7066
7213
|
*/
|
|
7067
|
-
errorKind:
|
|
7214
|
+
errorKind: z14.literal("abandoned").optional(),
|
|
7068
7215
|
/**
|
|
7069
7216
|
* Whether the tool's `run` callback accepts `runAsJob`'s `AbortSignal`
|
|
7070
7217
|
* (#4972).
|
|
@@ -7080,7 +7227,7 @@ var JobResultSchema = z13.object({
|
|
|
7080
7227
|
* "cancellation can reach this tool", not "the work stopped". Absent means
|
|
7081
7228
|
* the writer did not report it, which is not the same as `false`.
|
|
7082
7229
|
*/
|
|
7083
|
-
signalAccepted:
|
|
7230
|
+
signalAccepted: z14.boolean().optional(),
|
|
7084
7231
|
/**
|
|
7085
7232
|
* `VERSION` of the nexus-agents process that WROTE this record (#5008) —
|
|
7086
7233
|
* i.e. the build that ran the job, not the build that reads it back.
|
|
@@ -7101,7 +7248,7 @@ var JobResultSchema = z13.object({
|
|
|
7101
7248
|
* `'dev'` — readers MUST run it through {@link isMeasuredBuildVersion}
|
|
7102
7249
|
* before treating two stamps as comparable.
|
|
7103
7250
|
*/
|
|
7104
|
-
producerVersion:
|
|
7251
|
+
producerVersion: z14.string().optional(),
|
|
7105
7252
|
/**
|
|
7106
7253
|
* When the job body last heartbeat — `runAsJob`'s `progress()` callback,
|
|
7107
7254
|
* `heartbeatJob`, or a pipeline-bus event the body emitted (#6162). Present
|
|
@@ -7113,7 +7260,7 @@ var JobResultSchema = z13.object({
|
|
|
7113
7260
|
* `run-as-job.ts` fails a body that stops heartbeating as wedged, measuring
|
|
7114
7261
|
* silence from this stamp (or from job start when there is none).
|
|
7115
7262
|
*/
|
|
7116
|
-
lastProgressAt:
|
|
7263
|
+
lastProgressAt: z14.iso.datetime().optional(),
|
|
7117
7264
|
/**
|
|
7118
7265
|
* What a cancelled vote had collected when `cancel_job` fired (#6735).
|
|
7119
7266
|
* Present only on a `cancelled` record, and only when the body settled after
|
|
@@ -8072,8 +8219,8 @@ import * as path from "node:path";
|
|
|
8072
8219
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8073
8220
|
|
|
8074
8221
|
// src/context/structured-task-state-types.ts
|
|
8075
|
-
import { z as
|
|
8076
|
-
var TaskStageSchema =
|
|
8222
|
+
import { z as z15 } from "zod";
|
|
8223
|
+
var TaskStageSchema = z15.enum([
|
|
8077
8224
|
"planning",
|
|
8078
8225
|
"executing",
|
|
8079
8226
|
"verifying",
|
|
@@ -8085,59 +8232,59 @@ var TaskStageSchema = z14.enum([
|
|
|
8085
8232
|
// failed run in StructuredTaskState instead of the Stage-1 sidecar.
|
|
8086
8233
|
"failed"
|
|
8087
8234
|
]);
|
|
8088
|
-
var TaskDecisionSchema =
|
|
8089
|
-
ts:
|
|
8090
|
-
decision:
|
|
8091
|
-
rationale:
|
|
8235
|
+
var TaskDecisionSchema = z15.object({
|
|
8236
|
+
ts: z15.iso.datetime(),
|
|
8237
|
+
decision: z15.string().min(1),
|
|
8238
|
+
rationale: z15.string().min(1)
|
|
8092
8239
|
});
|
|
8093
|
-
var TaskBlockerSchema =
|
|
8094
|
-
ts:
|
|
8095
|
-
blocker:
|
|
8096
|
-
resolved:
|
|
8240
|
+
var TaskBlockerSchema = z15.object({
|
|
8241
|
+
ts: z15.iso.datetime(),
|
|
8242
|
+
blocker: z15.string().min(1),
|
|
8243
|
+
resolved: z15.iso.datetime().optional()
|
|
8097
8244
|
});
|
|
8098
|
-
var TaskPositionSchema =
|
|
8099
|
-
currentStep:
|
|
8100
|
-
nextStep:
|
|
8245
|
+
var TaskPositionSchema = z15.object({
|
|
8246
|
+
currentStep: z15.string().min(1),
|
|
8247
|
+
nextStep: z15.string().optional()
|
|
8101
8248
|
});
|
|
8102
|
-
var TaskLedgerSchema =
|
|
8249
|
+
var TaskLedgerSchema = z15.object({
|
|
8103
8250
|
/** Verifiable observations: what we have observed/measured/confirmed. */
|
|
8104
|
-
facts:
|
|
8251
|
+
facts: z15.array(z15.string()),
|
|
8105
8252
|
/** Working assumptions: useful guesses we proceed under, marked separately. */
|
|
8106
|
-
guesses:
|
|
8253
|
+
guesses: z15.array(z15.string()),
|
|
8107
8254
|
/** Things we still need to figure out before the plan is sound. */
|
|
8108
|
-
openQuestions:
|
|
8109
|
-
updatedAt:
|
|
8255
|
+
openQuestions: z15.array(z15.string()),
|
|
8256
|
+
updatedAt: z15.iso.datetime()
|
|
8110
8257
|
});
|
|
8111
|
-
var ReflectActionSchema =
|
|
8112
|
-
var ProgressLedgerEntrySchema =
|
|
8113
|
-
ts:
|
|
8258
|
+
var ReflectActionSchema = z15.enum(["continue", "revise_plan", "escalate_to_human", "abort"]);
|
|
8259
|
+
var ProgressLedgerEntrySchema = z15.object({
|
|
8260
|
+
ts: z15.iso.datetime(),
|
|
8114
8261
|
/** What just happened (the step we are reflecting on). */
|
|
8115
|
-
step:
|
|
8262
|
+
step: z15.string().min(1),
|
|
8116
8263
|
/** Is the outer Task Ledger plan still right after this step? */
|
|
8117
|
-
planStillValid:
|
|
8264
|
+
planStillValid: z15.boolean(),
|
|
8118
8265
|
/** Are we making progress, or have we stalled? */
|
|
8119
|
-
stuck:
|
|
8266
|
+
stuck: z15.boolean(),
|
|
8120
8267
|
/** What the orchestrator should do next based on this reflection. */
|
|
8121
8268
|
suggestedAction: ReflectActionSchema,
|
|
8122
8269
|
/** Why this action was chosen — required so future readers can audit the call. */
|
|
8123
|
-
rationale:
|
|
8270
|
+
rationale: z15.string().min(1)
|
|
8124
8271
|
});
|
|
8125
|
-
var TaskCancellationSchema =
|
|
8126
|
-
requestedAt:
|
|
8272
|
+
var TaskCancellationSchema = z15.object({
|
|
8273
|
+
requestedAt: z15.iso.datetime(),
|
|
8127
8274
|
/** Optional human-readable note carried back to the caller. */
|
|
8128
|
-
reason:
|
|
8275
|
+
reason: z15.string().max(1e3).optional()
|
|
8129
8276
|
});
|
|
8130
8277
|
var TASK_RESULT_MAX_BYTES = 1048576;
|
|
8131
|
-
var StructuredTaskStateSchema =
|
|
8132
|
-
taskId:
|
|
8278
|
+
var StructuredTaskStateSchema = z15.object({
|
|
8279
|
+
taskId: z15.string().min(1),
|
|
8133
8280
|
/**
|
|
8134
8281
|
* Marks state created by the shared async-job dispatcher (#5622).
|
|
8135
8282
|
* Optional for backward compatibility; absence does not prove async dispatch.
|
|
8136
8283
|
*/
|
|
8137
|
-
dispatch:
|
|
8284
|
+
dispatch: z15.literal("async").optional(),
|
|
8138
8285
|
stage: TaskStageSchema,
|
|
8139
|
-
decisions:
|
|
8140
|
-
blockers:
|
|
8286
|
+
decisions: z15.array(TaskDecisionSchema),
|
|
8287
|
+
blockers: z15.array(TaskBlockerSchema),
|
|
8141
8288
|
position: TaskPositionSchema,
|
|
8142
8289
|
/**
|
|
8143
8290
|
* Magentic-One Task Ledger (#2278). Mutable single-object outer-loop state:
|
|
@@ -8150,7 +8297,7 @@ var StructuredTaskStateSchema = z14.object({
|
|
|
8150
8297
|
* Most recent entry's `suggestedAction` is what `reflect()` returns. Optional
|
|
8151
8298
|
* for the same backward-compat reason as `taskLedger`.
|
|
8152
8299
|
*/
|
|
8153
|
-
progressLedger:
|
|
8300
|
+
progressLedger: z15.array(ProgressLedgerEntrySchema).optional(),
|
|
8154
8301
|
/**
|
|
8155
8302
|
* Monotonic version counter (#3043 / epic #2631 Stage 2). Increments by
|
|
8156
8303
|
* 1 on every write; polling clients use this to detect "I missed a
|
|
@@ -8160,7 +8307,7 @@ var StructuredTaskStateSchema = z14.object({
|
|
|
8160
8307
|
* state logs (pre-Stage-2) don't carry it; the reducer treats their
|
|
8161
8308
|
* baseline as v0 and starts counting from there.
|
|
8162
8309
|
*/
|
|
8163
|
-
version:
|
|
8310
|
+
version: z15.number().int().nonnegative().optional(),
|
|
8164
8311
|
/**
|
|
8165
8312
|
* Tool result payload (#3043 / epic #2631 Stage 2). Set atomically
|
|
8166
8313
|
* via the `result` log event when `stage === 'complete'`. Carries the
|
|
@@ -8176,7 +8323,7 @@ var StructuredTaskStateSchema = z14.object({
|
|
|
8176
8323
|
* field, then the sidecar files become legacy that the next cleanup
|
|
8177
8324
|
* sweep can remove.
|
|
8178
8325
|
*/
|
|
8179
|
-
result:
|
|
8326
|
+
result: z15.unknown().optional(),
|
|
8180
8327
|
/**
|
|
8181
8328
|
* Cancellation marker (#3043 / epic #2631 Stage 2). Set by `cancel_job`
|
|
8182
8329
|
* — the running tool checks for this at safe-point boundaries (between
|
|
@@ -8193,70 +8340,70 @@ var StructuredTaskStateSchema = z14.object({
|
|
|
8193
8340
|
* transition has been recorded. Optional for backward-compat with
|
|
8194
8341
|
* pre-#3090 logs (the reducer backfills it from the init entry).
|
|
8195
8342
|
*/
|
|
8196
|
-
createdAt:
|
|
8197
|
-
updatedAt:
|
|
8343
|
+
createdAt: z15.iso.datetime().optional(),
|
|
8344
|
+
updatedAt: z15.iso.datetime()
|
|
8198
8345
|
});
|
|
8199
|
-
var StructuredTaskLogEntrySchema =
|
|
8200
|
-
|
|
8201
|
-
event:
|
|
8202
|
-
ts:
|
|
8346
|
+
var StructuredTaskLogEntrySchema = z15.discriminatedUnion("event", [
|
|
8347
|
+
z15.object({
|
|
8348
|
+
event: z15.literal("init"),
|
|
8349
|
+
ts: z15.iso.datetime(),
|
|
8203
8350
|
state: StructuredTaskStateSchema
|
|
8204
8351
|
}),
|
|
8205
|
-
|
|
8206
|
-
event:
|
|
8207
|
-
ts:
|
|
8352
|
+
z15.object({
|
|
8353
|
+
event: z15.literal("decision"),
|
|
8354
|
+
ts: z15.iso.datetime(),
|
|
8208
8355
|
decision: TaskDecisionSchema
|
|
8209
8356
|
}),
|
|
8210
|
-
|
|
8211
|
-
event:
|
|
8212
|
-
ts:
|
|
8357
|
+
z15.object({
|
|
8358
|
+
event: z15.literal("blocker"),
|
|
8359
|
+
ts: z15.iso.datetime(),
|
|
8213
8360
|
blocker: TaskBlockerSchema
|
|
8214
8361
|
}),
|
|
8215
|
-
|
|
8216
|
-
event:
|
|
8217
|
-
ts:
|
|
8362
|
+
z15.object({
|
|
8363
|
+
event: z15.literal("blocker_resolved"),
|
|
8364
|
+
ts: z15.iso.datetime(),
|
|
8218
8365
|
/** Index of the blocker in the state's blockers[] array. */
|
|
8219
|
-
blockerIndex:
|
|
8220
|
-
resolvedAt:
|
|
8366
|
+
blockerIndex: z15.number().int().nonnegative(),
|
|
8367
|
+
resolvedAt: z15.iso.datetime()
|
|
8221
8368
|
}),
|
|
8222
|
-
|
|
8223
|
-
event:
|
|
8224
|
-
ts:
|
|
8369
|
+
z15.object({
|
|
8370
|
+
event: z15.literal("stage"),
|
|
8371
|
+
ts: z15.iso.datetime(),
|
|
8225
8372
|
stage: TaskStageSchema
|
|
8226
8373
|
}),
|
|
8227
|
-
|
|
8228
|
-
event:
|
|
8229
|
-
ts:
|
|
8374
|
+
z15.object({
|
|
8375
|
+
event: z15.literal("position"),
|
|
8376
|
+
ts: z15.iso.datetime(),
|
|
8230
8377
|
position: TaskPositionSchema
|
|
8231
8378
|
}),
|
|
8232
8379
|
// Magentic-One Task Ledger replacement event — the outer loop revises the
|
|
8233
8380
|
// entire ledger atomically when replanning. Always replaces, never partial.
|
|
8234
|
-
|
|
8235
|
-
event:
|
|
8236
|
-
ts:
|
|
8381
|
+
z15.object({
|
|
8382
|
+
event: z15.literal("task_ledger"),
|
|
8383
|
+
ts: z15.iso.datetime(),
|
|
8237
8384
|
ledger: TaskLedgerSchema
|
|
8238
8385
|
}),
|
|
8239
8386
|
// Magentic-One Progress Ledger append event — one self-reflection per step.
|
|
8240
|
-
|
|
8241
|
-
event:
|
|
8242
|
-
ts:
|
|
8387
|
+
z15.object({
|
|
8388
|
+
event: z15.literal("progress_ledger"),
|
|
8389
|
+
ts: z15.iso.datetime(),
|
|
8243
8390
|
entry: ProgressLedgerEntrySchema
|
|
8244
8391
|
}),
|
|
8245
8392
|
// #3043 / epic #2631 Stage 2 — tool result payload set when stage flips
|
|
8246
8393
|
// to 'complete'. Written by appendResult; replayed into state.result.
|
|
8247
8394
|
// The payload itself is `unknown` because each tool's result shape is
|
|
8248
8395
|
// its own; readers cast after a status check.
|
|
8249
|
-
|
|
8250
|
-
event:
|
|
8251
|
-
ts:
|
|
8252
|
-
result:
|
|
8396
|
+
z15.object({
|
|
8397
|
+
event: z15.literal("result"),
|
|
8398
|
+
ts: z15.iso.datetime(),
|
|
8399
|
+
result: z15.unknown()
|
|
8253
8400
|
}),
|
|
8254
8401
|
// #3043 / epic #2631 Stage 2 — cancellation marker. Append-only: the
|
|
8255
8402
|
// reducer ignores a second cancellation event so a malicious or buggy
|
|
8256
8403
|
// double-cancel can't rewrite the requestedAt timestamp.
|
|
8257
|
-
|
|
8258
|
-
event:
|
|
8259
|
-
ts:
|
|
8404
|
+
z15.object({
|
|
8405
|
+
event: z15.literal("cancellation"),
|
|
8406
|
+
ts: z15.iso.datetime(),
|
|
8260
8407
|
cancellation: TaskCancellationSchema
|
|
8261
8408
|
})
|
|
8262
8409
|
]);
|
|
@@ -9300,7 +9447,7 @@ async function runSyncConsensusVote(deps, notifier, args) {
|
|
|
9300
9447
|
approvalPercentage: result.value.approvalPercentage,
|
|
9301
9448
|
voteCount: result.value.votes.length
|
|
9302
9449
|
});
|
|
9303
|
-
return structuredToolSuccess(
|
|
9450
|
+
return structuredToolSuccess(z16.object(CONSENSUS_VOTE_OUTPUT_SCHEMA), { ...result.value });
|
|
9304
9451
|
}
|
|
9305
9452
|
async function prepareVoteArtifact(input) {
|
|
9306
9453
|
if (input.artifactPath === void 0) return { ok: true, value: input };
|
|
@@ -9370,18 +9517,18 @@ function createConsensusVoteHandler(deps) {
|
|
|
9370
9517
|
};
|
|
9371
9518
|
}
|
|
9372
9519
|
var ASYNC_ENVELOPES = {
|
|
9373
|
-
pending: (jobId) => structuredToolSuccess(
|
|
9520
|
+
pending: (jobId) => structuredToolSuccess(z16.object(CONSENSUS_VOTE_OUTPUT_SCHEMA), {
|
|
9374
9521
|
status: "pending",
|
|
9375
9522
|
jobId,
|
|
9376
9523
|
pollTool: "get_job_result",
|
|
9377
9524
|
note: 'Poll via get_job_result({ jobId }) until status !== "pending".'
|
|
9378
9525
|
}),
|
|
9379
|
-
busy: (retryAfterMs, toolName) => structuredToolSuccess(
|
|
9526
|
+
busy: (retryAfterMs, toolName) => structuredToolSuccess(z16.object(CONSENSUS_VOTE_OUTPUT_SCHEMA), {
|
|
9380
9527
|
status: "busy",
|
|
9381
9528
|
retryAfterMs,
|
|
9382
9529
|
note: `Async-mode concurrency cap reached for ${toolName}. Retry later or use dispatch: "sync".`
|
|
9383
9530
|
}),
|
|
9384
|
-
replay: (jobId) => structuredToolSuccess(
|
|
9531
|
+
replay: (jobId) => structuredToolSuccess(z16.object(CONSENSUS_VOTE_OUTPUT_SCHEMA), {
|
|
9385
9532
|
status: "replay",
|
|
9386
9533
|
jobId,
|
|
9387
9534
|
pollTool: "get_job_result",
|
|
@@ -9391,56 +9538,56 @@ var ASYNC_ENVELOPES = {
|
|
|
9391
9538
|
};
|
|
9392
9539
|
var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
|
|
9393
9540
|
/** Async-dispatch envelope discriminator — absent on a completed vote. */
|
|
9394
|
-
status:
|
|
9395
|
-
jobId:
|
|
9396
|
-
pollTool:
|
|
9397
|
-
note:
|
|
9398
|
-
retryAfterMs:
|
|
9399
|
-
proposal:
|
|
9541
|
+
status: z16.enum(["pending", "busy", "replay"]).optional(),
|
|
9542
|
+
jobId: z16.string().max(200).optional(),
|
|
9543
|
+
pollTool: z16.literal("get_job_result").optional(),
|
|
9544
|
+
note: z16.string().max(500).optional(),
|
|
9545
|
+
retryAfterMs: z16.number().optional(),
|
|
9546
|
+
proposal: z16.string().optional(),
|
|
9400
9547
|
strategy: VotingStrategySchema.optional(),
|
|
9401
9548
|
// Reuses the canonical VoteDecisionStatusSchema (single source) — a hand-listed
|
|
9402
9549
|
// subset here (was ['approved','rejected','no_quorum']) omitted the reachable
|
|
9403
9550
|
// 'timeout'/'pending' outcomes and made strict clients reject those votes (#4032).
|
|
9404
9551
|
decision: VoteDecisionStatusSchema.optional(),
|
|
9405
|
-
approvalPercentage:
|
|
9406
|
-
voteCounts:
|
|
9407
|
-
approve:
|
|
9408
|
-
reject:
|
|
9409
|
-
abstain:
|
|
9410
|
-
error:
|
|
9552
|
+
approvalPercentage: z16.number().optional(),
|
|
9553
|
+
voteCounts: z16.object({
|
|
9554
|
+
approve: z16.number(),
|
|
9555
|
+
reject: z16.number(),
|
|
9556
|
+
abstain: z16.number(),
|
|
9557
|
+
error: z16.number(),
|
|
9411
9558
|
/** #6094: seats that could not read the artifact; always present. */
|
|
9412
|
-
unverifiable:
|
|
9559
|
+
unverifiable: z16.number()
|
|
9413
9560
|
}).optional(),
|
|
9414
9561
|
// #6111: the quick-mode contrarian check is not a seat, so `voteCounts.error`
|
|
9415
9562
|
// cannot count it. Present on every completed vote (`skipped` when it did not
|
|
9416
9563
|
// run); optional here only because the async envelope shares this schema.
|
|
9417
9564
|
contrarianCheck: ContrarianCheckStatusSchema.optional(),
|
|
9418
|
-
votes:
|
|
9419
|
-
|
|
9420
|
-
role:
|
|
9421
|
-
decision:
|
|
9422
|
-
confidence:
|
|
9423
|
-
reasoning:
|
|
9424
|
-
simulated:
|
|
9425
|
-
error:
|
|
9426
|
-
retried:
|
|
9427
|
-
retriedFrom:
|
|
9428
|
-
source:
|
|
9429
|
-
error:
|
|
9430
|
-
errorTruncated:
|
|
9565
|
+
votes: z16.array(
|
|
9566
|
+
z16.object({
|
|
9567
|
+
role: z16.string().max(100),
|
|
9568
|
+
decision: z16.enum(["approve", "reject", "abstain"]),
|
|
9569
|
+
confidence: z16.number(),
|
|
9570
|
+
reasoning: z16.string().max(4e3),
|
|
9571
|
+
simulated: z16.boolean(),
|
|
9572
|
+
error: z16.boolean(),
|
|
9573
|
+
retried: z16.boolean().optional(),
|
|
9574
|
+
retriedFrom: z16.object({
|
|
9575
|
+
source: z16.enum(["error", "unverifiable"]),
|
|
9576
|
+
error: z16.string().optional(),
|
|
9577
|
+
errorTruncated: z16.literal(true).optional()
|
|
9431
9578
|
}).optional(),
|
|
9432
9579
|
/** #6094: present only when the seat could not read the artifact. */
|
|
9433
|
-
unverifiable:
|
|
9580
|
+
unverifiable: z16.literal(true).optional(),
|
|
9434
9581
|
/** #6115: present only when the seat answered elsewhere than assigned. */
|
|
9435
|
-
fallback:
|
|
9436
|
-
fromCli:
|
|
9437
|
-
fromModel:
|
|
9438
|
-
reason:
|
|
9582
|
+
fallback: z16.object({
|
|
9583
|
+
fromCli: z16.string().max(100),
|
|
9584
|
+
fromModel: z16.string().max(100).optional(),
|
|
9585
|
+
reason: z16.enum(["rate-limit", "capacity", "auth", "timeout", "sandbox", "unknown"])
|
|
9439
9586
|
}).optional(),
|
|
9440
|
-
modelUsed:
|
|
9441
|
-
assignedModel:
|
|
9442
|
-
rejectionCategories:
|
|
9443
|
-
|
|
9587
|
+
modelUsed: z16.string().max(100).optional(),
|
|
9588
|
+
assignedModel: z16.string().max(100).optional(),
|
|
9589
|
+
rejectionCategories: z16.array(
|
|
9590
|
+
z16.enum([
|
|
9444
9591
|
"YAGNI",
|
|
9445
9592
|
"DRY_VIOLATION",
|
|
9446
9593
|
"OVER_ENGINEERING",
|
|
@@ -9453,64 +9600,64 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
|
|
|
9453
9600
|
})
|
|
9454
9601
|
).optional(),
|
|
9455
9602
|
threshold: VoteThresholdSchema.optional(),
|
|
9456
|
-
durationMs:
|
|
9457
|
-
simulateVotes:
|
|
9603
|
+
durationMs: z16.number().optional(),
|
|
9604
|
+
simulateVotes: z16.boolean().optional(),
|
|
9458
9605
|
// #6110: the project the panel judged and how the name was decided. Always
|
|
9459
9606
|
// on the response; optional here like every field, because the async
|
|
9460
9607
|
// `pending` envelope shares this schema.
|
|
9461
|
-
project:
|
|
9462
|
-
name:
|
|
9463
|
-
source:
|
|
9608
|
+
project: z16.object({
|
|
9609
|
+
name: z16.string().max(200),
|
|
9610
|
+
source: z16.enum(["input", "derived", "default"])
|
|
9464
9611
|
}).optional(),
|
|
9465
9612
|
// #6258: the working directory the panel's seats were pointed at. Absent
|
|
9466
9613
|
// when no live seat ran (simulated panel) and on the async envelope.
|
|
9467
|
-
workspace:
|
|
9468
|
-
higherOrderMetadata:
|
|
9469
|
-
posteriorApproval:
|
|
9470
|
-
posteriorRejection:
|
|
9471
|
-
effectiveVoteCount:
|
|
9472
|
-
method:
|
|
9473
|
-
appliedToDecision:
|
|
9474
|
-
usedCorrelationData:
|
|
9475
|
-
improvementOverBaseline:
|
|
9476
|
-
downweightedAgents:
|
|
9477
|
-
reasoning:
|
|
9614
|
+
workspace: z16.string().max(4096).optional(),
|
|
9615
|
+
higherOrderMetadata: z16.object({
|
|
9616
|
+
posteriorApproval: z16.number(),
|
|
9617
|
+
posteriorRejection: z16.number(),
|
|
9618
|
+
effectiveVoteCount: z16.number(),
|
|
9619
|
+
method: z16.enum(["ow", "isp", "simple"]),
|
|
9620
|
+
appliedToDecision: z16.boolean(),
|
|
9621
|
+
usedCorrelationData: z16.boolean(),
|
|
9622
|
+
improvementOverBaseline: z16.number(),
|
|
9623
|
+
downweightedAgents: z16.array(z16.string().max(100)).max(10),
|
|
9624
|
+
reasoning: z16.string().max(2e3)
|
|
9478
9625
|
}).optional(),
|
|
9479
9626
|
// #3124: explains a `rejected` decision that coexists with a high
|
|
9480
9627
|
// approvalPercentage (an error-policy short-circuit, e.g. fail_closed).
|
|
9481
|
-
policyReason:
|
|
9628
|
+
policyReason: z16.string().max(200).optional(),
|
|
9482
9629
|
// #3991: whether the authentic vote record was persisted at vote time. Post-
|
|
9483
9630
|
// #3991 it routes through nexusDataPath under governance/, so true is the
|
|
9484
9631
|
// normal case; false means all-simulated (skipped by design) or write-failed
|
|
9485
9632
|
// (data dir unwritable) — voteRecordNote carries the actionable reason. Makes
|
|
9486
9633
|
// a previously WARN-only skip visible to MCP callers.
|
|
9487
|
-
voteRecordPersisted:
|
|
9488
|
-
voteRecordNote:
|
|
9634
|
+
voteRecordPersisted: z16.boolean().optional(),
|
|
9635
|
+
voteRecordNote: z16.string().max(500).optional(),
|
|
9489
9636
|
// #5130: the persisted record's id, so the caller-commits script can name it.
|
|
9490
|
-
voteRecordId:
|
|
9637
|
+
voteRecordId: z16.string().max(200).optional(),
|
|
9491
9638
|
// #3587: set when the panel DEGRADED (some voters errored), so the decision
|
|
9492
9639
|
// rests on fewer voters than requested. Part of the response since #3587 but
|
|
9493
9640
|
// omitted from this schema until #4032 — its absence made a strict MCP client
|
|
9494
9641
|
// reject any degraded-panel vote (`-32602 additional properties`).
|
|
9495
|
-
panelWarning:
|
|
9642
|
+
panelWarning: z16.string().optional(),
|
|
9496
9643
|
// #6115: distinct answering models and seats that answered elsewhere than
|
|
9497
9644
|
// assigned. Always on the response (explicit zeros); optional here only
|
|
9498
9645
|
// because the async `pending` envelope shares this schema.
|
|
9499
|
-
panelDiversity:
|
|
9500
|
-
distinctModels:
|
|
9646
|
+
panelDiversity: z16.object({
|
|
9647
|
+
distinctModels: z16.number().int().nonnegative(),
|
|
9501
9648
|
// #6606: distinct vendor families among the answering seats, and the
|
|
9502
9649
|
// answering seats whose model names no recognised vendor.
|
|
9503
|
-
distinctFamilies:
|
|
9504
|
-
unclassifiedSeats:
|
|
9650
|
+
distinctFamilies: z16.number().int().nonnegative(),
|
|
9651
|
+
unclassifiedSeats: z16.number().int().nonnegative(),
|
|
9505
9652
|
// #6660: answering seats whose model never resolved. Always set by
|
|
9506
9653
|
// panelDiversityOf; optional so the published schema widens additively.
|
|
9507
|
-
unresolvedSeats:
|
|
9508
|
-
fallbacks:
|
|
9654
|
+
unresolvedSeats: z16.number().int().nonnegative().optional(),
|
|
9655
|
+
fallbacks: z16.number().int().nonnegative()
|
|
9509
9656
|
}).optional(),
|
|
9510
9657
|
// Assigned roster includes errored and abstaining seats. Absent when no
|
|
9511
9658
|
// assignment resolved, including a zero-seat roster.
|
|
9512
|
-
assignedDistinctModels:
|
|
9513
|
-
assignedDistinctFamilies:
|
|
9659
|
+
assignedDistinctModels: z16.number().int().nonnegative().optional(),
|
|
9660
|
+
assignedDistinctFamilies: z16.number().int().nonnegative().optional(),
|
|
9514
9661
|
// #3855: per-decision cost rollup. Same omission as panelWarning (#4032) — it
|
|
9515
9662
|
// is present on the response whenever cost recording succeeds (common in `api`
|
|
9516
9663
|
// billing mode). Shared schema lives with the type (single source of truth).
|
|
@@ -9518,18 +9665,18 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
|
|
|
9518
9665
|
// #4472: declared-option outcome. Present whenever the proposal declared
|
|
9519
9666
|
// `options`. `unattributedApprovals` is part of the contract, not telemetry:
|
|
9520
9667
|
// without it a caller cannot tell a real split from unreadable responses.
|
|
9521
|
-
optionOutcome:
|
|
9522
|
-
tally:
|
|
9523
|
-
leadingOption:
|
|
9524
|
-
leadingShare:
|
|
9525
|
-
approverCount:
|
|
9526
|
-
selectedCount:
|
|
9527
|
-
unattributedApprovals:
|
|
9528
|
-
thresholdMet:
|
|
9668
|
+
optionOutcome: z16.object({
|
|
9669
|
+
tally: z16.array(z16.object({ option: z16.string(), count: z16.number().int().nonnegative() })),
|
|
9670
|
+
leadingOption: z16.string().optional(),
|
|
9671
|
+
leadingShare: z16.number().min(0).max(1),
|
|
9672
|
+
approverCount: z16.number().int().nonnegative(),
|
|
9673
|
+
selectedCount: z16.number().int().nonnegative(),
|
|
9674
|
+
unattributedApprovals: z16.number().int().nonnegative(),
|
|
9675
|
+
thresholdMet: z16.boolean(),
|
|
9529
9676
|
// #4529: present only on a veto. Declared here because a strict MCP
|
|
9530
9677
|
// client rejects any property the advertised schema omits — the same
|
|
9531
9678
|
// drift that made degraded-panel votes unusable before #4032.
|
|
9532
|
-
vetoReason:
|
|
9679
|
+
vetoReason: z16.string().max(400).optional()
|
|
9533
9680
|
}).optional()
|
|
9534
9681
|
};
|
|
9535
9682
|
var CONSENSUS_VOTE_TOOL_SCHEMA = ConsensusVoteInputSchema.shape;
|
|
@@ -9676,4 +9823,4 @@ export {
|
|
|
9676
9823
|
CONSENSUS_VOTE_TOOL_SCHEMA,
|
|
9677
9824
|
registerConsensusVoteTool
|
|
9678
9825
|
};
|
|
9679
|
-
//# sourceMappingURL=chunk-
|
|
9826
|
+
//# sourceMappingURL=chunk-VS3C3L63.js.map
|