nexus-agents 2.137.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.
- package/dist/{chunk-NRJLOBGA.js → chunk-52JN2RFG.js} +2 -2
- package/dist/{chunk-DPHEFR5X.js → chunk-7KFI6R2M.js} +3 -3
- package/dist/{chunk-HC5CUX6C.js → chunk-NWW7HLRL.js} +84 -24
- package/dist/chunk-NWW7HLRL.js.map +1 -0
- package/dist/{chunk-23J7J37D.js → chunk-R5ZQCA37.js} +11 -30
- package/dist/{chunk-23J7J37D.js.map → chunk-R5ZQCA37.js.map} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +4 -4
- package/dist/{consensus-vote-HHA73ME6.js → consensus-vote-PCIFXILX.js} +2 -2
- package/dist/{consensus-vote-types-Dx4pf3YW.d.ts → consensus-vote-types-Qx_LRxt1.d.ts} +2 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/{setup-command-TIGCMJRZ.js → setup-command-OHM6K4FM.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-HC5CUX6C.js.map +0 -1
- /package/dist/{chunk-NRJLOBGA.js.map → chunk-52JN2RFG.js.map} +0 -0
- /package/dist/{chunk-DPHEFR5X.js.map → chunk-7KFI6R2M.js.map} +0 -0
- /package/dist/{consensus-vote-HHA73ME6.js.map → consensus-vote-PCIFXILX.js.map} +0 -0
- /package/dist/{setup-command-TIGCMJRZ.js.map → setup-command-OHM6K4FM.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
checkSqlite,
|
|
9
9
|
defaultConfig,
|
|
10
10
|
initDataDirectories
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7KFI6R2M.js";
|
|
12
12
|
import {
|
|
13
13
|
BUILT_IN_EXPERTS
|
|
14
14
|
} from "./chunk-ZM4O442V.js";
|
|
@@ -2000,4 +2000,4 @@ export {
|
|
|
2000
2000
|
setupCommand,
|
|
2001
2001
|
setupCommandAsync
|
|
2002
2002
|
};
|
|
2003
|
-
//# sourceMappingURL=chunk-
|
|
2003
|
+
//# sourceMappingURL=chunk-52JN2RFG.js.map
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./chunk-DHVMSIT5.js";
|
|
43
43
|
|
|
44
44
|
// src/version.ts
|
|
45
|
-
var VERSION = true ? "2.
|
|
45
|
+
var VERSION = true ? "2.138.0" : "dev";
|
|
46
46
|
|
|
47
47
|
// src/config/schemas-core.ts
|
|
48
48
|
import { z } from "zod";
|
|
@@ -2132,7 +2132,7 @@ async function runDoctorFix(result) {
|
|
|
2132
2132
|
writeLine2("\u2500".repeat(40));
|
|
2133
2133
|
let fixCount = 0;
|
|
2134
2134
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
2135
|
-
const { runSetup } = await import("./setup-command-
|
|
2135
|
+
const { runSetup } = await import("./setup-command-OHM6K4FM.js");
|
|
2136
2136
|
const setupResult = runSetup({
|
|
2137
2137
|
skipMcp: true,
|
|
2138
2138
|
skipRules: true,
|
|
@@ -2245,4 +2245,4 @@ export {
|
|
|
2245
2245
|
startStdioServer,
|
|
2246
2246
|
closeServer
|
|
2247
2247
|
};
|
|
2248
|
-
//# sourceMappingURL=chunk-
|
|
2248
|
+
//# sourceMappingURL=chunk-7KFI6R2M.js.map
|
|
@@ -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
|
-
/**
|
|
4328
|
-
|
|
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
|
|
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.
|
|
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(
|
|
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
|
-
|
|
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) {
|
|
@@ -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:
|
|
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-
|
|
6061
|
+
//# sourceMappingURL=chunk-NWW7HLRL.js.map
|