nexus-agents 8.70.0 → 8.72.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-X73OWKTZ.js → chunk-2EKSJV5C.js} +396 -385
- package/dist/chunk-2EKSJV5C.js.map +1 -0
- package/dist/{chunk-QDS27NG3.js → chunk-6E5JEBH2.js} +3 -3
- package/dist/{chunk-RAU744MW.js → chunk-FL5R2KR7.js} +2 -2
- package/dist/{chunk-5RT3G7RG.js → chunk-GSSWMHEI.js} +2 -2
- package/dist/{chunk-O2CVUCUG.js → chunk-NZ2E25SC.js} +13 -8
- package/dist/{chunk-O2CVUCUG.js.map → chunk-NZ2E25SC.js.map} +1 -1
- package/dist/{chunk-V3RG6QMQ.js → chunk-UNDHFITF.js} +2 -2
- package/dist/cli.js +7 -7
- package/dist/{consensus-vote-I3HEHLDM.js → consensus-vote-QUWKYCYU.js} +4 -4
- package/dist/{improvement-review-NW2NOSK7.js → improvement-review-FQJ6PZP6.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{setup-data-dir-CRCT7CLG.js → setup-data-dir-NHCKHBWP.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-X73OWKTZ.js.map +0 -1
- /package/dist/{chunk-QDS27NG3.js.map → chunk-6E5JEBH2.js.map} +0 -0
- /package/dist/{chunk-RAU744MW.js.map → chunk-FL5R2KR7.js.map} +0 -0
- /package/dist/{chunk-5RT3G7RG.js.map → chunk-GSSWMHEI.js.map} +0 -0
- /package/dist/{chunk-V3RG6QMQ.js.map → chunk-UNDHFITF.js.map} +0 -0
- /package/dist/{consensus-vote-I3HEHLDM.js.map → consensus-vote-QUWKYCYU.js.map} +0 -0
- /package/dist/{improvement-review-NW2NOSK7.js.map → improvement-review-FQJ6PZP6.js.map} +0 -0
- /package/dist/{setup-data-dir-CRCT7CLG.js.map → setup-data-dir-NHCKHBWP.js.map} +0 -0
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
toolSuccessStructured,
|
|
26
26
|
withProgressHeartbeat,
|
|
27
27
|
wrapToolWithTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-UNDHFITF.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FL5R2KR7.js";
|
|
32
32
|
import {
|
|
33
33
|
UNRESOLVED_MODEL_ID,
|
|
34
34
|
assessPanelIndependence,
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
} from "./chunk-RNDHNRSX.js";
|
|
93
93
|
|
|
94
94
|
// src/mcp/tools/consensus-vote.ts
|
|
95
|
-
import { z as
|
|
95
|
+
import { z as z15 } from "zod";
|
|
96
96
|
|
|
97
97
|
// src/mcp/tools/async-dispatch-input.ts
|
|
98
98
|
import { z } from "zod";
|
|
@@ -284,7 +284,7 @@ function reportPanelModelIndependence(modelIds, roleCount, phase, logger11) {
|
|
|
284
284
|
|
|
285
285
|
// src/audit/vote-record.ts
|
|
286
286
|
import * as crypto2 from "node:crypto";
|
|
287
|
-
import { z as
|
|
287
|
+
import { z as z4 } from "zod";
|
|
288
288
|
|
|
289
289
|
// src/audit/reasoning-commitment.ts
|
|
290
290
|
import * as crypto from "node:crypto";
|
|
@@ -327,72 +327,91 @@ function reasoningCommitmentShapeDefect(digestTier, v) {
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
// src/audit/redaction-record.ts
|
|
330
|
+
import { z as z3 } from "zod";
|
|
331
|
+
|
|
332
|
+
// src/audit/record-signature-schema.ts
|
|
330
333
|
import { z as z2 } from "zod";
|
|
331
|
-
var
|
|
332
|
-
|
|
334
|
+
var VOTE_RECORD_SIGNATURE_NAMESPACE = "nexus-vote-record";
|
|
335
|
+
var VoteRecordSignatureSchema = z2.object({
|
|
336
|
+
/** The allowed_signers principal, e.g. `williamzujkowski@nexus-agents`. */
|
|
337
|
+
keyId: z2.string().min(1).max(200),
|
|
338
|
+
namespace: z2.literal(VOTE_RECORD_SIGNATURE_NAMESPACE),
|
|
339
|
+
/** The armored SSH signature block, verbatim. */
|
|
340
|
+
sig: z2.string().min(1).max(8192)
|
|
341
|
+
}).strict();
|
|
342
|
+
|
|
343
|
+
// src/audit/redaction-record.ts
|
|
344
|
+
var RedactionRecordSchema = z3.object({
|
|
345
|
+
kind: z3.literal("redaction"),
|
|
333
346
|
/** Unique record id, on the vote-record rule. */
|
|
334
|
-
id:
|
|
347
|
+
id: z3.string().min(1),
|
|
335
348
|
/** Monotonic sequence number, shared with the vote records of the same ledger. */
|
|
336
|
-
sequence:
|
|
349
|
+
sequence: z3.number().int().nonnegative(),
|
|
337
350
|
/** The `id` of the vote record whose entries were redacted. */
|
|
338
|
-
targetId:
|
|
351
|
+
targetId: z3.string().min(1),
|
|
339
352
|
/** The voter roles on the target whose openings were dropped; never empty. */
|
|
340
|
-
targetVoterRoles:
|
|
353
|
+
targetVoterRoles: z3.array(z3.string().min(1).max(100)).min(1),
|
|
341
354
|
/** ISO-8601 timestamp of the redaction. */
|
|
342
|
-
at:
|
|
355
|
+
at: z3.string().min(1),
|
|
343
356
|
/** Who sanctioned it — author-typed, on the residual-trust boundary of every record. */
|
|
344
|
-
by:
|
|
357
|
+
by: z3.string().min(1).max(200),
|
|
345
358
|
/** Why. Bounded so the reason cannot itself become the thing that needs redacting. */
|
|
346
|
-
reason:
|
|
359
|
+
reason: z3.string().min(1).max(2e3),
|
|
347
360
|
/** SHA-256 over every field above. */
|
|
348
|
-
hash:
|
|
361
|
+
hash: z3.string().length(64),
|
|
362
|
+
/**
|
|
363
|
+
* Optional SSH signature over `hash`, OUTSIDE the hash (#6372) — the same
|
|
364
|
+
* envelope a vote record carries, verified by `vote-record-signature.ts`
|
|
365
|
+
* at the record's `at`. A signed and an unsigned redaction hash the same.
|
|
366
|
+
*/
|
|
367
|
+
signature: VoteRecordSignatureSchema.optional()
|
|
349
368
|
}).strict();
|
|
350
369
|
|
|
351
370
|
// src/audit/vote-record.ts
|
|
352
|
-
var VoteRecordDecisionSchema =
|
|
353
|
-
var VoteRecordOptionCoverageSchema =
|
|
371
|
+
var VoteRecordDecisionSchema = z4.enum(["approved", "rejected", "no_quorum"]);
|
|
372
|
+
var VoteRecordOptionCoverageSchema = z4.object({
|
|
354
373
|
/** Every approving voter, selecting or not — the tally's denominator. */
|
|
355
|
-
approverCount:
|
|
374
|
+
approverCount: z4.number().int().nonnegative(),
|
|
356
375
|
/** Approvers whose selection matched a declared option. */
|
|
357
|
-
selectedCount:
|
|
376
|
+
selectedCount: z4.number().int().nonnegative(),
|
|
358
377
|
/** Approvers with no usable selection; their choice is unmeasured. */
|
|
359
|
-
unattributedApprovals:
|
|
378
|
+
unattributedApprovals: z4.number().int().nonnegative()
|
|
360
379
|
}).strict();
|
|
361
|
-
var VoteRecordPanelCoverageSchema =
|
|
380
|
+
var VoteRecordPanelCoverageSchema = z4.object({
|
|
362
381
|
/** Voters the panel asked for. */
|
|
363
|
-
requested:
|
|
382
|
+
requested: z4.number().int().nonnegative(),
|
|
364
383
|
/** Voters that returned a usable vote — the denominator of `voteCounts`. */
|
|
365
|
-
responded:
|
|
384
|
+
responded: z4.number().int().nonnegative(),
|
|
366
385
|
/** Voters that errored or timed out. */
|
|
367
|
-
errored:
|
|
386
|
+
errored: z4.number().int().nonnegative(),
|
|
368
387
|
/** The roles behind `errored`, in panel order. */
|
|
369
|
-
erroredRoles:
|
|
388
|
+
erroredRoles: z4.array(z4.string().min(1).max(100))
|
|
370
389
|
}).strict();
|
|
371
390
|
var MAX_VOTER_REASONING_CHARS = 2e4;
|
|
372
391
|
function clipForRecord(text) {
|
|
373
392
|
if (text.length <= MAX_VOTER_REASONING_CHARS) return { text };
|
|
374
393
|
return { text: text.slice(0, MAX_VOTER_REASONING_CHARS), truncated: true };
|
|
375
394
|
}
|
|
376
|
-
var RetriedFromRecordSchema =
|
|
395
|
+
var RetriedFromRecordSchema = z4.object({
|
|
377
396
|
/** The first pass's `source`: errored, or answered without reading. */
|
|
378
|
-
source:
|
|
397
|
+
source: z4.enum(["error", "unverifiable"]),
|
|
379
398
|
/** The first pass's `error` string, when it had one; already clipped. */
|
|
380
|
-
error:
|
|
399
|
+
error: z4.string().max(MAX_VOTER_REASONING_CHARS).optional(),
|
|
381
400
|
/** True when `error` was clipped to {@link MAX_VOTER_REASONING_CHARS}. */
|
|
382
|
-
errorTruncated:
|
|
401
|
+
errorTruncated: z4.literal(true).optional()
|
|
383
402
|
}).strict();
|
|
384
|
-
var SeatFallbackRecordSchema =
|
|
403
|
+
var SeatFallbackRecordSchema = z4.object({
|
|
385
404
|
/** The CLI the seat was assigned to, bare (`claude`, not `cli-claude`). */
|
|
386
|
-
fromCli:
|
|
405
|
+
fromCli: z4.string().min(1).max(100),
|
|
387
406
|
/** The model the assigned adapter had detected, when it had one. */
|
|
388
|
-
fromModel:
|
|
407
|
+
fromModel: z4.string().min(1).max(200).optional(),
|
|
389
408
|
/** The adapter-layer class of the error that moved the seat. */
|
|
390
|
-
reason:
|
|
409
|
+
reason: z4.enum(["rate-limit", "capacity", "auth", "timeout", "sandbox", "unknown"])
|
|
391
410
|
}).strict();
|
|
392
|
-
var VoterSummarySchema =
|
|
393
|
-
role:
|
|
394
|
-
decision:
|
|
395
|
-
confidence:
|
|
411
|
+
var VoterSummarySchema = z4.object({
|
|
412
|
+
role: z4.string().min(1).max(100),
|
|
413
|
+
decision: z4.enum(["approve", "reject", "abstain"]),
|
|
414
|
+
confidence: z4.number().min(0).max(1),
|
|
396
415
|
/**
|
|
397
416
|
* The voter's stated grounds (#5373, schema 1.6).
|
|
398
417
|
*
|
|
@@ -412,9 +431,9 @@ var VoterSummarySchema = z3.object({
|
|
|
412
431
|
* `voters` at all (see `panelCoverage`), so `reasoning: ''` means a live
|
|
413
432
|
* voter returned nothing, which is itself a signal.
|
|
414
433
|
*/
|
|
415
|
-
reasoning:
|
|
434
|
+
reasoning: z4.string().max(MAX_VOTER_REASONING_CHARS).optional(),
|
|
416
435
|
/** True when `reasoning` was clipped to {@link MAX_VOTER_REASONING_CHARS}. */
|
|
417
|
-
reasoningTruncated:
|
|
436
|
+
reasoningTruncated: z4.literal(true).optional(),
|
|
418
437
|
/**
|
|
419
438
|
* True when this seat was recovered by the per-role retry (#6050, schema 1.7).
|
|
420
439
|
*
|
|
@@ -435,7 +454,7 @@ var VoterSummarySchema = z3.object({
|
|
|
435
454
|
* seat carries no key, so its entry re-hashes byte-identical and every
|
|
436
455
|
* historical record still verifies.
|
|
437
456
|
*/
|
|
438
|
-
retried:
|
|
457
|
+
retried: z4.literal(true).optional(),
|
|
439
458
|
/**
|
|
440
459
|
* Registry model id the seat ran on (#6091, schema 1.8).
|
|
441
460
|
*
|
|
@@ -448,7 +467,7 @@ var VoterSummarySchema = z3.object({
|
|
|
448
467
|
* Present-only, on the `retried` rule; absent when the result carried no
|
|
449
468
|
* model or only the pending-detection placeholder.
|
|
450
469
|
*/
|
|
451
|
-
model:
|
|
470
|
+
model: z4.string().min(1).max(200).optional(),
|
|
452
471
|
/**
|
|
453
472
|
* True when the seat could not read the artifact (#6094, schema 1.8).
|
|
454
473
|
*
|
|
@@ -458,7 +477,7 @@ var VoterSummarySchema = z3.object({
|
|
|
458
477
|
* on the proposal text after failing to read. `literal(true)` and
|
|
459
478
|
* present-only, so every pre-1.8 entry re-hashes byte-identical.
|
|
460
479
|
*/
|
|
461
|
-
unverifiable:
|
|
480
|
+
unverifiable: z4.literal(true).optional(),
|
|
462
481
|
/**
|
|
463
482
|
* The CLI the round-robin or `NEXUS_VOTER_MODEL_<ROLE>` pin chose for the
|
|
464
483
|
* seat, as a bare name (#6115, schema 1.9). `model` says where a seat
|
|
@@ -469,7 +488,7 @@ var VoterSummarySchema = z3.object({
|
|
|
469
488
|
* that said five of them were substitutes. Present-only, on the `model`
|
|
470
489
|
* rule; absent on a result built outside the panel launcher.
|
|
471
490
|
*/
|
|
472
|
-
assignedCli:
|
|
491
|
+
assignedCli: z4.string().min(1).max(100).optional(),
|
|
473
492
|
/**
|
|
474
493
|
* Present only when the seat answered on a different CLI or model than
|
|
475
494
|
* assigned (#6115, schema 1.9): the exact `SeatFallback` shape the live
|
|
@@ -515,7 +534,7 @@ var VoterSummarySchema = z3.object({
|
|
|
515
534
|
* carries the digest; on every older tier it carries neither key (there
|
|
516
535
|
* they would be unhashed decoration).
|
|
517
536
|
*/
|
|
518
|
-
reasoningNonce:
|
|
537
|
+
reasoningNonce: z4.string().regex(HEX_256_PATTERN).optional(),
|
|
519
538
|
/**
|
|
520
539
|
* `sha256(reasoningNonce ‖ reasoning)` as lowercase hex (#6263, schema
|
|
521
540
|
* 1.13) — see `computeReasoningDigest` in reasoning-commitment.ts. The
|
|
@@ -525,7 +544,7 @@ var VoterSummarySchema = z3.object({
|
|
|
525
544
|
* itself was folded. A digest nobody re-opens would be a check that
|
|
526
545
|
* cannot fail.
|
|
527
546
|
*/
|
|
528
|
-
reasoningDigest:
|
|
547
|
+
reasoningDigest: z4.string().regex(HEX_256_PATTERN).optional()
|
|
529
548
|
}).strict();
|
|
530
549
|
function defineVoterKeys(keys) {
|
|
531
550
|
return keys;
|
|
@@ -608,41 +627,33 @@ function projectVoterSummary(v, digestTier) {
|
|
|
608
627
|
}
|
|
609
628
|
return out;
|
|
610
629
|
}
|
|
611
|
-
var VoteRecordCountsSchema =
|
|
612
|
-
approve:
|
|
613
|
-
reject:
|
|
614
|
-
abstain:
|
|
615
|
-
total:
|
|
630
|
+
var VoteRecordCountsSchema = z4.object({
|
|
631
|
+
approve: z4.number().int().nonnegative(),
|
|
632
|
+
reject: z4.number().int().nonnegative(),
|
|
633
|
+
abstain: z4.number().int().nonnegative(),
|
|
634
|
+
total: z4.number().int().nonnegative()
|
|
616
635
|
}).strict();
|
|
617
|
-
var VoteRecordOptionCountSchema =
|
|
636
|
+
var VoteRecordOptionCountSchema = z4.object({
|
|
618
637
|
/** The option label as declared in the proposal (e.g. 'A'). */
|
|
619
|
-
option:
|
|
638
|
+
option: z4.string().min(1),
|
|
620
639
|
/** How many voters selected it. */
|
|
621
|
-
count:
|
|
640
|
+
count: z4.number().int().nonnegative()
|
|
622
641
|
}).strict();
|
|
623
642
|
var GIT_SHA_PATTERN = /^[0-9a-f]{40}$/;
|
|
624
|
-
var VoteRecordPrBindingSchema =
|
|
625
|
-
pr:
|
|
626
|
-
headSha:
|
|
643
|
+
var VoteRecordPrBindingSchema = z4.object({
|
|
644
|
+
pr: z4.number().int().positive(),
|
|
645
|
+
headSha: z4.string().regex(GIT_SHA_PATTERN, "expected a full 40-hex lowercase commit sha")
|
|
627
646
|
}).strict();
|
|
628
647
|
function projectPrBinding(b) {
|
|
629
648
|
return { pr: b.pr, headSha: b.headSha };
|
|
630
649
|
}
|
|
631
|
-
var VoteRecordErrorPolicySchema =
|
|
650
|
+
var VoteRecordErrorPolicySchema = z4.enum([
|
|
632
651
|
"reduce_denominator",
|
|
633
652
|
"count_as_abstain",
|
|
634
653
|
"fail_closed",
|
|
635
654
|
"absolute_quorum"
|
|
636
655
|
]);
|
|
637
|
-
var
|
|
638
|
-
var VoteRecordSignatureSchema = z3.object({
|
|
639
|
-
/** The allowed_signers principal, e.g. `williamzujkowski@nexus-agents`. */
|
|
640
|
-
keyId: z3.string().min(1).max(200),
|
|
641
|
-
namespace: z3.literal(VOTE_RECORD_SIGNATURE_NAMESPACE),
|
|
642
|
-
/** The armored SSH signature block, verbatim. */
|
|
643
|
-
sig: z3.string().min(1).max(8192)
|
|
644
|
-
}).strict();
|
|
645
|
-
var VoteRecordSchema = z3.object({
|
|
656
|
+
var VoteRecordSchema = z4.object({
|
|
646
657
|
/**
|
|
647
658
|
* Schema version. '1.1' marked the chain→record-set+sequence model (#3927);
|
|
648
659
|
* '1.2' adds the optional `ratifies` subject-binding field (#3927 item 1);
|
|
@@ -657,7 +668,7 @@ var VoteRecordSchema = z3.object({
|
|
|
657
668
|
* Tiers are labels, not ordered numbers: '1.10' follows '1.9' by
|
|
658
669
|
* convention only and nothing compares them.
|
|
659
670
|
*/
|
|
660
|
-
version:
|
|
671
|
+
version: z4.enum([
|
|
661
672
|
"1.1",
|
|
662
673
|
"1.2",
|
|
663
674
|
"1.3",
|
|
@@ -673,27 +684,27 @@ var VoteRecordSchema = z3.object({
|
|
|
673
684
|
"1.13"
|
|
674
685
|
]),
|
|
675
686
|
/** Unique record id (also usable as a `ratificationVoteRef`). */
|
|
676
|
-
id:
|
|
687
|
+
id: z4.string().min(1),
|
|
677
688
|
/**
|
|
678
689
|
* Monotonic sequence number (integer ≥ 0). Assigned as (max existing
|
|
679
690
|
* sequence)+1 at write time. Sorted, the set of sequences must cover
|
|
680
691
|
* 0..maxSeq with no gap (omission detection); DUPLICATE sequences are a
|
|
681
692
|
* benign concurrent-fork signal, not tampering.
|
|
682
693
|
*/
|
|
683
|
-
sequence:
|
|
694
|
+
sequence: z4.number().int().nonnegative(),
|
|
684
695
|
/** ISO-8601 timestamp the vote was recorded. */
|
|
685
|
-
recordedAt:
|
|
696
|
+
recordedAt: z4.string().min(1),
|
|
686
697
|
/**
|
|
687
698
|
* SHA-256 of the FULL proposal text. The proposal itself is truncated for
|
|
688
699
|
* the human record (`proposal`), but the hash binds the record to the exact
|
|
689
700
|
* proposal voted on — a later edit of `proposal` that changes meaning is
|
|
690
701
|
* detectable by recomputing this hash from the original.
|
|
691
702
|
*/
|
|
692
|
-
proposalHash:
|
|
703
|
+
proposalHash: z4.string().length(64),
|
|
693
704
|
/** Truncated proposal text for the human/reviewer record. */
|
|
694
|
-
proposal:
|
|
705
|
+
proposal: z4.string(),
|
|
695
706
|
/** The voting strategy used. */
|
|
696
|
-
strategy:
|
|
707
|
+
strategy: z4.enum([
|
|
697
708
|
"simple_majority",
|
|
698
709
|
"supermajority",
|
|
699
710
|
"unanimous",
|
|
@@ -704,13 +715,13 @@ var VoteRecordSchema = z3.object({
|
|
|
704
715
|
/** The resolved decision. */
|
|
705
716
|
decision: VoteRecordDecisionSchema,
|
|
706
717
|
/** Approval fraction as a percentage (0-100). */
|
|
707
|
-
approvalPercentage:
|
|
718
|
+
approvalPercentage: z4.number().min(0).max(100),
|
|
708
719
|
/** Vote-count breakdown. */
|
|
709
720
|
voteCounts: VoteRecordCountsSchema,
|
|
710
721
|
/** Per-voter {role, decision, confidence} summary. */
|
|
711
|
-
voters:
|
|
722
|
+
voters: z4.array(VoterSummarySchema),
|
|
712
723
|
/** Optional correlation/decision id linking to the cost rollup / trace. */
|
|
713
|
-
correlationId:
|
|
724
|
+
correlationId: z4.string().min(1).optional(),
|
|
714
725
|
/**
|
|
715
726
|
* Per-option distribution for a multi-option proposal (#4452, schema 1.3).
|
|
716
727
|
*
|
|
@@ -735,7 +746,7 @@ var VoteRecordSchema = z3.object({
|
|
|
735
746
|
//
|
|
736
747
|
// Relaxing is a pure widening: no previously-valid record changes meaning
|
|
737
748
|
// or hash, and no persisted record can currently hold an empty tally.
|
|
738
|
-
optionTally:
|
|
749
|
+
optionTally: z4.array(VoteRecordOptionCountSchema).optional(),
|
|
739
750
|
/**
|
|
740
751
|
* Selection coverage for a multi-option vote (#4472, schema 1.4).
|
|
741
752
|
*
|
|
@@ -761,7 +772,7 @@ var VoteRecordSchema = z3.object({
|
|
|
761
772
|
* (with `decision === 'approved'` and `strategy === 'higher_order'`). Absent on
|
|
762
773
|
* an ordinary (non-ratification) vote; a 1.1 record never carries it.
|
|
763
774
|
*/
|
|
764
|
-
ratifies:
|
|
775
|
+
ratifies: z4.string().min(1).optional(),
|
|
765
776
|
/**
|
|
766
777
|
* The PR this vote RATIFIES, bound to the head the panel saw (#5130 step 1,
|
|
767
778
|
* schema 1.10; panel decision Q1 option A, 5 of 6). Present only on a
|
|
@@ -802,7 +813,7 @@ var VoteRecordSchema = z3.object({
|
|
|
802
813
|
* Retained for audit texture but NOT covered by `hash` and NOT verified —
|
|
803
814
|
* the record-set model is position-independent (#3927).
|
|
804
815
|
*/
|
|
805
|
-
previousHash:
|
|
816
|
+
previousHash: z4.string().length(64).optional(),
|
|
806
817
|
/**
|
|
807
818
|
* Detached SSH signature over the committed `hash` (#3927 item 4, phase
|
|
808
819
|
* 1). The SECOND field outside the self-hash, on `previousHash`'s rule
|
|
@@ -824,7 +835,7 @@ var VoteRecordSchema = z3.object({
|
|
|
824
835
|
* SHA-256 over every field above EXCEPT `previousHash` and `signature`
|
|
825
836
|
* (and except `hash`).
|
|
826
837
|
*/
|
|
827
|
-
hash:
|
|
838
|
+
hash: z4.string().length(64)
|
|
828
839
|
}).strict().superRefine((record, ctx) => {
|
|
829
840
|
const digestTier = isReasoningDigestTier(record.version);
|
|
830
841
|
for (const [i, v] of record.voters.entries()) {
|
|
@@ -1300,7 +1311,7 @@ var SIMULATED_VOTE_REASONING = {
|
|
|
1300
1311
|
};
|
|
1301
1312
|
|
|
1302
1313
|
// src/cli/voter-response.ts
|
|
1303
|
-
import { z as
|
|
1314
|
+
import { z as z5 } from "zod";
|
|
1304
1315
|
|
|
1305
1316
|
// src/consensus/option-tally.ts
|
|
1306
1317
|
var SUPERMAJORITY_SHARE = 2 / 3;
|
|
@@ -1360,26 +1371,26 @@ var SyntheticVoteError = class extends Error {
|
|
|
1360
1371
|
}
|
|
1361
1372
|
rawOutput;
|
|
1362
1373
|
};
|
|
1363
|
-
var RawFindingSchema =
|
|
1364
|
-
summary:
|
|
1365
|
-
location:
|
|
1366
|
-
severity:
|
|
1367
|
-
gate:
|
|
1368
|
-
reread_cited_line:
|
|
1369
|
-
traced_call_path:
|
|
1370
|
-
named_assertion:
|
|
1371
|
-
ruled_out_language_non_issue:
|
|
1374
|
+
var RawFindingSchema = z5.object({
|
|
1375
|
+
summary: z5.string().min(1).max(500).describe("One-line summary of the issue"),
|
|
1376
|
+
location: z5.string().min(1).max(200).describe("path/file.ext:line"),
|
|
1377
|
+
severity: z5.enum(["critical", "high", "medium", "low"]).default("medium"),
|
|
1378
|
+
gate: z5.object({
|
|
1379
|
+
reread_cited_line: z5.enum(["passed", "failed", "skipped"]).default("skipped"),
|
|
1380
|
+
traced_call_path: z5.enum(["passed", "failed", "skipped"]).default("skipped"),
|
|
1381
|
+
named_assertion: z5.string().default("").describe("Concrete failing assertion \u2014 substantive, not a rubber-stamp word"),
|
|
1382
|
+
ruled_out_language_non_issue: z5.enum(["passed", "failed", "skipped"]).default("skipped")
|
|
1372
1383
|
}),
|
|
1373
|
-
claim:
|
|
1384
|
+
claim: z5.string().min(1).max(2e3).describe("What is wrong and why it justifies blocking")
|
|
1374
1385
|
});
|
|
1375
|
-
var VoteResponseSchema =
|
|
1376
|
-
decision:
|
|
1377
|
-
reasoning:
|
|
1378
|
-
confidence:
|
|
1379
|
-
conditions:
|
|
1386
|
+
var VoteResponseSchema = z5.object({
|
|
1387
|
+
decision: z5.enum(["approve", "reject", "abstain"]).describe("Your vote decision"),
|
|
1388
|
+
reasoning: z5.string().min(10).max(4e3).describe("Explanation for your vote (10-4000 chars)"),
|
|
1389
|
+
confidence: z5.number().min(0).max(1).describe("Confidence level 0-1"),
|
|
1390
|
+
conditions: z5.array(z5.string()).optional().describe("Optional conditions for approval"),
|
|
1380
1391
|
/** Structured rejection categories for reject→refine→re-vote loops (Issue #1213). */
|
|
1381
|
-
rejectionCategories:
|
|
1382
|
-
|
|
1392
|
+
rejectionCategories: z5.array(
|
|
1393
|
+
z5.enum([
|
|
1383
1394
|
"YAGNI",
|
|
1384
1395
|
"DRY_VIOLATION",
|
|
1385
1396
|
"OVER_ENGINEERING",
|
|
@@ -1391,11 +1402,11 @@ var VoteResponseSchema = z4.object({
|
|
|
1391
1402
|
).optional().describe("Rejection reason categories when decision is reject"),
|
|
1392
1403
|
/** Top-level structured findings for PR-review mode (#2245 v4 follow-up).
|
|
1393
1404
|
* Replaces the YAML-in-reasoning encoding that proved lossy. */
|
|
1394
|
-
findings:
|
|
1405
|
+
findings: z5.array(RawFindingSchema).optional().describe("Structured findings (PR review only)"),
|
|
1395
1406
|
/** Chosen option when the proposal declared `options` (#4472). Validated
|
|
1396
1407
|
* against the declared list by the caller; an unmatched value is dropped
|
|
1397
1408
|
* rather than recorded, so a parse miss surfaces as absent. */
|
|
1398
|
-
selectedOption:
|
|
1409
|
+
selectedOption: z5.string().optional().describe("Which declared option you choose")
|
|
1399
1410
|
});
|
|
1400
1411
|
var VOTE_JSON_SCHEMA = {
|
|
1401
1412
|
type: "object",
|
|
@@ -2330,9 +2341,9 @@ async function collectRealVotes(options) {
|
|
|
2330
2341
|
// src/cli/voter-project.ts
|
|
2331
2342
|
import { readFileSync, statSync } from "node:fs";
|
|
2332
2343
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
2333
|
-
import { z as
|
|
2344
|
+
import { z as z6 } from "zod";
|
|
2334
2345
|
var VOTER_PROJECT_PATTERN = /^[A-Za-z0-9._/@-]{1,200}$/;
|
|
2335
|
-
var VoterProjectInputSchema =
|
|
2346
|
+
var VoterProjectInputSchema = z6.string().regex(VOTER_PROJECT_PATTERN).optional().describe(
|
|
2336
2347
|
"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."
|
|
2337
2348
|
);
|
|
2338
2349
|
var MAX_ANCESTOR_DEPTH = 64;
|
|
@@ -2498,40 +2509,40 @@ function describeVeto(verdict) {
|
|
|
2498
2509
|
}
|
|
2499
2510
|
|
|
2500
2511
|
// src/consensus/types-voting-protocol.ts
|
|
2501
|
-
import { z as
|
|
2512
|
+
import { z as z7 } from "zod";
|
|
2502
2513
|
var VOTING_ROUND_DEFAULT_TIMEOUT_MS = OPERATION_CLASSES["multi-llm-panel"].guardMs;
|
|
2503
|
-
var VotingRoundPhaseSchema =
|
|
2504
|
-
var VotingRoundStatusSchema =
|
|
2514
|
+
var VotingRoundPhaseSchema = z7.enum(["analysis", "deliberation", "consensus"]);
|
|
2515
|
+
var VotingRoundStatusSchema = z7.enum([
|
|
2505
2516
|
"pending",
|
|
2506
2517
|
"in_progress",
|
|
2507
2518
|
"awaiting_votes",
|
|
2508
2519
|
"completed",
|
|
2509
2520
|
"aborted"
|
|
2510
2521
|
]);
|
|
2511
|
-
var AgentFindingSchema =
|
|
2512
|
-
agentId:
|
|
2513
|
-
category:
|
|
2514
|
-
severity:
|
|
2515
|
-
description:
|
|
2516
|
-
location:
|
|
2517
|
-
suggestion:
|
|
2518
|
-
confidence:
|
|
2519
|
-
timestamp:
|
|
2522
|
+
var AgentFindingSchema = z7.object({
|
|
2523
|
+
agentId: z7.string(),
|
|
2524
|
+
category: z7.enum(["bug", "security", "performance", "style", "design", "documentation", "other"]),
|
|
2525
|
+
severity: z7.enum(["critical", "major", "minor", "suggestion"]),
|
|
2526
|
+
description: z7.string().min(1),
|
|
2527
|
+
location: z7.string().optional().describe("File path and line range if applicable"),
|
|
2528
|
+
suggestion: z7.string().optional().describe("Recommended fix"),
|
|
2529
|
+
confidence: z7.number().min(0).max(1),
|
|
2530
|
+
timestamp: z7.iso.datetime().optional()
|
|
2520
2531
|
});
|
|
2521
|
-
var FindingVoteSchema =
|
|
2522
|
-
agentId:
|
|
2523
|
-
findingId:
|
|
2524
|
-
agree:
|
|
2525
|
-
reasoning:
|
|
2526
|
-
amendedSeverity:
|
|
2532
|
+
var FindingVoteSchema = z7.object({
|
|
2533
|
+
agentId: z7.string(),
|
|
2534
|
+
findingId: z7.string(),
|
|
2535
|
+
agree: z7.boolean(),
|
|
2536
|
+
reasoning: z7.string().optional(),
|
|
2537
|
+
amendedSeverity: z7.enum(["critical", "major", "minor", "suggestion"]).optional()
|
|
2527
2538
|
});
|
|
2528
|
-
var VotingProtocolConfigSchema =
|
|
2529
|
-
committeeSize:
|
|
2530
|
-
maxRounds:
|
|
2531
|
-
roundTimeoutMs:
|
|
2532
|
-
agreementThreshold:
|
|
2533
|
-
enableAntiSycophancy:
|
|
2534
|
-
sycophancyThreshold:
|
|
2539
|
+
var VotingProtocolConfigSchema = z7.object({
|
|
2540
|
+
committeeSize: z7.number().int().min(2).max(7).default(3),
|
|
2541
|
+
maxRounds: z7.number().int().min(1).max(5).default(3),
|
|
2542
|
+
roundTimeoutMs: z7.number().int().positive().default(VOTING_ROUND_DEFAULT_TIMEOUT_MS),
|
|
2543
|
+
agreementThreshold: z7.number().min(0.5).max(1).default(SUPERMAJORITY_THRESHOLD),
|
|
2544
|
+
enableAntiSycophancy: z7.boolean().default(true),
|
|
2545
|
+
sycophancyThreshold: z7.number().min(0).max(1).default(0.8)
|
|
2535
2546
|
});
|
|
2536
2547
|
var DEFAULT_VOTING_PROTOCOL_CONFIG = {
|
|
2537
2548
|
committeeSize: 3,
|
|
@@ -2544,30 +2555,30 @@ var DEFAULT_VOTING_PROTOCOL_CONFIG = {
|
|
|
2544
2555
|
};
|
|
2545
2556
|
|
|
2546
2557
|
// src/consensus/types-weighted-voting.ts
|
|
2547
|
-
import { z as
|
|
2548
|
-
var TaskOutcomeStatusSchema =
|
|
2549
|
-
var WeightedAgentRecordSchema =
|
|
2550
|
-
agentId:
|
|
2551
|
-
totalTasks:
|
|
2552
|
-
successfulTasks:
|
|
2553
|
-
failedTasks:
|
|
2554
|
-
partialTasks:
|
|
2555
|
-
successRate:
|
|
2556
|
-
weight:
|
|
2557
|
-
trustScore:
|
|
2558
|
-
byzantineFlags:
|
|
2559
|
-
lastActive:
|
|
2560
|
-
createdAt:
|
|
2558
|
+
import { z as z8 } from "zod";
|
|
2559
|
+
var TaskOutcomeStatusSchema = z8.enum(["success", "failure", "partial", "unknown"]);
|
|
2560
|
+
var WeightedAgentRecordSchema = z8.object({
|
|
2561
|
+
agentId: z8.string().min(1),
|
|
2562
|
+
totalTasks: z8.number().int().nonnegative(),
|
|
2563
|
+
successfulTasks: z8.number().int().nonnegative(),
|
|
2564
|
+
failedTasks: z8.number().int().nonnegative(),
|
|
2565
|
+
partialTasks: z8.number().int().nonnegative(),
|
|
2566
|
+
successRate: z8.number().min(0).max(1),
|
|
2567
|
+
weight: z8.number().min(0).max(1),
|
|
2568
|
+
trustScore: z8.number().min(0).max(1),
|
|
2569
|
+
byzantineFlags: z8.number().int().nonnegative(),
|
|
2570
|
+
lastActive: z8.date(),
|
|
2571
|
+
createdAt: z8.date()
|
|
2561
2572
|
});
|
|
2562
|
-
var WeightedVotingConfigSchema =
|
|
2563
|
-
minWeight:
|
|
2564
|
-
maxByzantineFraction:
|
|
2565
|
-
weightDecayFactor:
|
|
2566
|
-
weightRecoveryFactor:
|
|
2567
|
-
minTrustScore:
|
|
2568
|
-
byzantineFlagThreshold:
|
|
2569
|
-
initialWeight:
|
|
2570
|
-
quorumThreshold:
|
|
2573
|
+
var WeightedVotingConfigSchema = z8.object({
|
|
2574
|
+
minWeight: z8.number().min(0).max(1).default(0.1),
|
|
2575
|
+
maxByzantineFraction: z8.number().min(0).max(0.5).default(0.33),
|
|
2576
|
+
weightDecayFactor: z8.number().min(0.5).max(1).default(0.9),
|
|
2577
|
+
weightRecoveryFactor: z8.number().min(1).max(2).default(1.05),
|
|
2578
|
+
minTrustScore: z8.number().min(0).max(1).default(0.3),
|
|
2579
|
+
byzantineFlagThreshold: z8.number().int().positive().default(3),
|
|
2580
|
+
initialWeight: z8.number().min(0).max(1).default(0.5),
|
|
2581
|
+
quorumThreshold: z8.number().min(0.5).max(1).default(SUPERMAJORITY_THRESHOLD)
|
|
2571
2582
|
});
|
|
2572
2583
|
var DEFAULT_WEIGHTED_VOTING_CONFIG = {
|
|
2573
2584
|
minWeight: 0.1,
|
|
@@ -2582,7 +2593,7 @@ var DEFAULT_WEIGHTED_VOTING_CONFIG = {
|
|
|
2582
2593
|
};
|
|
2583
2594
|
|
|
2584
2595
|
// src/consensus/higher-order-types.ts
|
|
2585
|
-
import { z as
|
|
2596
|
+
import { z as z9 } from "zod";
|
|
2586
2597
|
function createAgentPairKey(agentA, agentB) {
|
|
2587
2598
|
return agentA < agentB ? `${agentA}:${agentB}` : `${agentB}:${agentA}`;
|
|
2588
2599
|
}
|
|
@@ -2593,52 +2604,52 @@ function parseAgentPairKey(key) {
|
|
|
2593
2604
|
}
|
|
2594
2605
|
return [parts[0], parts[1]];
|
|
2595
2606
|
}
|
|
2596
|
-
var CorrelationCoefficientSchema =
|
|
2597
|
-
var IndependentSubsetSchema =
|
|
2598
|
-
id:
|
|
2599
|
-
agentIds:
|
|
2600
|
-
independenceScore:
|
|
2601
|
-
pairCoverage:
|
|
2602
|
-
observed:
|
|
2603
|
-
total:
|
|
2607
|
+
var CorrelationCoefficientSchema = z9.number().min(-1).max(1);
|
|
2608
|
+
var IndependentSubsetSchema = z9.object({
|
|
2609
|
+
id: z9.string(),
|
|
2610
|
+
agentIds: z9.array(z9.string()),
|
|
2611
|
+
independenceScore: z9.number().min(0).max(1),
|
|
2612
|
+
pairCoverage: z9.object({
|
|
2613
|
+
observed: z9.number().int().nonnegative(),
|
|
2614
|
+
total: z9.number().int().nonnegative()
|
|
2604
2615
|
}),
|
|
2605
|
-
observationCount:
|
|
2616
|
+
observationCount: z9.number().int().nonnegative()
|
|
2606
2617
|
});
|
|
2607
|
-
var VotingObservationSchema =
|
|
2608
|
-
proposalId:
|
|
2609
|
-
agentId:
|
|
2610
|
-
decision:
|
|
2611
|
-
confidence:
|
|
2612
|
-
alignedWithOutcome:
|
|
2613
|
-
timestamp:
|
|
2614
|
-
modelKey:
|
|
2615
|
-
observedModel:
|
|
2618
|
+
var VotingObservationSchema = z9.object({
|
|
2619
|
+
proposalId: z9.string(),
|
|
2620
|
+
agentId: z9.string(),
|
|
2621
|
+
decision: z9.enum(["approve", "reject", "abstain"]),
|
|
2622
|
+
confidence: z9.number().min(0).max(1),
|
|
2623
|
+
alignedWithOutcome: z9.boolean(),
|
|
2624
|
+
timestamp: z9.date(),
|
|
2625
|
+
modelKey: z9.string().optional(),
|
|
2626
|
+
observedModel: z9.string().optional()
|
|
2616
2627
|
});
|
|
2617
|
-
var PairwiseVotingHistorySchema =
|
|
2618
|
-
pairKey:
|
|
2619
|
-
jointObservations:
|
|
2620
|
-
agreements:
|
|
2621
|
-
disagreements:
|
|
2628
|
+
var PairwiseVotingHistorySchema = z9.object({
|
|
2629
|
+
pairKey: z9.string(),
|
|
2630
|
+
jointObservations: z9.number().int().nonnegative(),
|
|
2631
|
+
agreements: z9.number().int().nonnegative(),
|
|
2632
|
+
disagreements: z9.number().int().nonnegative(),
|
|
2622
2633
|
correlation: CorrelationCoefficientSchema,
|
|
2623
|
-
lastUpdated:
|
|
2634
|
+
lastUpdated: z9.date()
|
|
2624
2635
|
});
|
|
2625
|
-
var HigherOrderVotingConfigSchema =
|
|
2626
|
-
minObservationsForCorrelation:
|
|
2627
|
-
correlationThreshold:
|
|
2636
|
+
var HigherOrderVotingConfigSchema = z9.object({
|
|
2637
|
+
minObservationsForCorrelation: z9.number().int().positive().default(10),
|
|
2638
|
+
correlationThreshold: z9.number().min(0).max(1).default(0.3),
|
|
2628
2639
|
/**
|
|
2629
2640
|
* @deprecated Ignored since 8.x: correlation evidence is lifetime and partitioned by the role's pinned model (#5555); nothing reads this value. Removed in the next major (#5564).
|
|
2630
2641
|
*/
|
|
2631
|
-
correlationMaxAgeMs:
|
|
2642
|
+
correlationMaxAgeMs: z9.number().int().positive().default(864e5),
|
|
2632
2643
|
// 24 hours
|
|
2633
|
-
independenceThreshold:
|
|
2634
|
-
fallbackToSimpleVoting:
|
|
2644
|
+
independenceThreshold: z9.number().min(0).max(1).default(0.2),
|
|
2645
|
+
fallbackToSimpleVoting: z9.boolean().default(true),
|
|
2635
2646
|
/**
|
|
2636
2647
|
* @deprecated Ignored since 8.x: correlation evidence is lifetime and partitioned by the role's pinned model (#5555); nothing reads this value. Removed in the next major (#5564).
|
|
2637
2648
|
*/
|
|
2638
|
-
observationDecayFactor:
|
|
2639
|
-
maxObservationsPerAgent:
|
|
2640
|
-
maxProposals:
|
|
2641
|
-
maxTrackedPairs:
|
|
2649
|
+
observationDecayFactor: z9.number().min(0).max(1).default(0.95),
|
|
2650
|
+
maxObservationsPerAgent: z9.number().int().positive().default(1e3),
|
|
2651
|
+
maxProposals: z9.number().int().positive().default(5e3),
|
|
2652
|
+
maxTrackedPairs: z9.number().int().positive().default(100)
|
|
2642
2653
|
});
|
|
2643
2654
|
var DEFAULT_HIGHER_ORDER_CONFIG = {
|
|
2644
2655
|
minObservationsForCorrelation: 10,
|
|
@@ -2652,25 +2663,25 @@ var DEFAULT_HIGHER_ORDER_CONFIG = {
|
|
|
2652
2663
|
maxProposals: 5e3,
|
|
2653
2664
|
maxTrackedPairs: 100
|
|
2654
2665
|
};
|
|
2655
|
-
var HigherOrderVotingResultSchema =
|
|
2656
|
-
decision:
|
|
2657
|
-
posteriorApproval:
|
|
2658
|
-
posteriorRejection:
|
|
2659
|
-
effectiveVoteCount:
|
|
2660
|
-
usedCorrelationData:
|
|
2661
|
-
method:
|
|
2662
|
-
improvementOverBaseline:
|
|
2663
|
-
independentSubsets:
|
|
2664
|
-
downweightedAgents:
|
|
2665
|
-
reasoning:
|
|
2666
|
+
var HigherOrderVotingResultSchema = z9.object({
|
|
2667
|
+
decision: z9.enum(["approve", "reject", "no_consensus"]),
|
|
2668
|
+
posteriorApproval: z9.number().min(0).max(1),
|
|
2669
|
+
posteriorRejection: z9.number().min(0).max(1),
|
|
2670
|
+
effectiveVoteCount: z9.number().nonnegative(),
|
|
2671
|
+
usedCorrelationData: z9.boolean(),
|
|
2672
|
+
method: z9.enum(["ow", "isp", "simple"]),
|
|
2673
|
+
improvementOverBaseline: z9.number(),
|
|
2674
|
+
independentSubsets: z9.array(IndependentSubsetSchema).optional(),
|
|
2675
|
+
downweightedAgents: z9.array(z9.string()),
|
|
2676
|
+
reasoning: z9.string()
|
|
2666
2677
|
});
|
|
2667
|
-
var CorrelationTrackerStatsSchema =
|
|
2668
|
-
totalAgents:
|
|
2669
|
-
trackedPairs:
|
|
2670
|
-
totalObservations:
|
|
2671
|
-
averageCorrelation:
|
|
2672
|
-
independentSubsetCount:
|
|
2673
|
-
pairsWithSufficientData:
|
|
2678
|
+
var CorrelationTrackerStatsSchema = z9.object({
|
|
2679
|
+
totalAgents: z9.number().int().nonnegative(),
|
|
2680
|
+
trackedPairs: z9.number().int().nonnegative(),
|
|
2681
|
+
totalObservations: z9.number().int().nonnegative(),
|
|
2682
|
+
averageCorrelation: z9.number(),
|
|
2683
|
+
independentSubsetCount: z9.number().int().nonnegative(),
|
|
2684
|
+
pairsWithSufficientData: z9.number().int().nonnegative()
|
|
2674
2685
|
});
|
|
2675
2686
|
|
|
2676
2687
|
// src/consensus/higher-order-helpers.ts
|
|
@@ -5682,24 +5693,24 @@ function createCorrelationTracker(config) {
|
|
|
5682
5693
|
import * as fs from "node:fs";
|
|
5683
5694
|
|
|
5684
5695
|
// src/consensus/correlation-persistence-records.ts
|
|
5685
|
-
import { z as
|
|
5686
|
-
var PersistedVoteSchema =
|
|
5687
|
-
agentId:
|
|
5688
|
-
decision:
|
|
5689
|
-
confidence:
|
|
5690
|
-
modelKey:
|
|
5691
|
-
observedModel:
|
|
5696
|
+
import { z as z10 } from "zod";
|
|
5697
|
+
var PersistedVoteSchema = z10.object({
|
|
5698
|
+
agentId: z10.string(),
|
|
5699
|
+
decision: z10.enum(["approve", "reject", "abstain"]),
|
|
5700
|
+
confidence: z10.number().min(0).max(1),
|
|
5701
|
+
modelKey: z10.string().optional(),
|
|
5702
|
+
observedModel: z10.string().optional()
|
|
5692
5703
|
});
|
|
5693
|
-
var PersistedProposalSchema =
|
|
5694
|
-
proposalId:
|
|
5695
|
-
votes:
|
|
5696
|
-
outcome:
|
|
5697
|
-
timestamp:
|
|
5704
|
+
var PersistedProposalSchema = z10.object({
|
|
5705
|
+
proposalId: z10.string(),
|
|
5706
|
+
votes: z10.array(PersistedVoteSchema),
|
|
5707
|
+
outcome: z10.enum(["approved", "rejected"]),
|
|
5708
|
+
timestamp: z10.iso.datetime()
|
|
5698
5709
|
});
|
|
5699
|
-
var PersistedCorrelationDataSchema =
|
|
5700
|
-
version:
|
|
5701
|
-
proposals:
|
|
5702
|
-
savedAt:
|
|
5710
|
+
var PersistedCorrelationDataSchema = z10.object({
|
|
5711
|
+
version: z10.number().int().positive(),
|
|
5712
|
+
proposals: z10.array(PersistedProposalSchema),
|
|
5713
|
+
savedAt: z10.iso.datetime()
|
|
5703
5714
|
});
|
|
5704
5715
|
function createPersistedProposal(proposalId, votes, outcome, context) {
|
|
5705
5716
|
const persistedVotes = [];
|
|
@@ -5941,7 +5952,7 @@ function createPersistentCorrelationTracker(config) {
|
|
|
5941
5952
|
}
|
|
5942
5953
|
|
|
5943
5954
|
// src/mcp/tools/consensus-vote-types.ts
|
|
5944
|
-
import { z as
|
|
5955
|
+
import { z as z11 } from "zod";
|
|
5945
5956
|
|
|
5946
5957
|
// src/cli/vote-diversity.ts
|
|
5947
5958
|
function answeringSeats(votes) {
|
|
@@ -6008,7 +6019,7 @@ function checkUndeclaredOptions(proposal, declaredOptions, allEngagedApproved) {
|
|
|
6008
6019
|
|
|
6009
6020
|
// src/mcp/tools/consensus-vote-types.ts
|
|
6010
6021
|
var MAX_PROPOSAL_LENGTH = 4e3;
|
|
6011
|
-
var VotingStrategySchema =
|
|
6022
|
+
var VotingStrategySchema = z11.enum([
|
|
6012
6023
|
"simple_majority",
|
|
6013
6024
|
"supermajority",
|
|
6014
6025
|
"unanimous",
|
|
@@ -6023,18 +6034,18 @@ var HIGHER_ORDER_ESCALATION_POSTERIOR_FLOOR = 0.65;
|
|
|
6023
6034
|
function shouldEscalateLowPosterior(strategy, outcome, quickMode, posteriorApproval) {
|
|
6024
6035
|
return quickMode && outcome === "approved" && isHigherOrderStrategy(strategy) && posteriorApproval !== void 0 && posteriorApproval < HIGHER_ORDER_ESCALATION_POSTERIOR_FLOOR;
|
|
6025
6036
|
}
|
|
6026
|
-
var ErrorPolicySchema =
|
|
6037
|
+
var ErrorPolicySchema = z11.enum([
|
|
6027
6038
|
"reduce_denominator",
|
|
6028
6039
|
"count_as_abstain",
|
|
6029
6040
|
"fail_closed",
|
|
6030
6041
|
"absolute_quorum"
|
|
6031
6042
|
]);
|
|
6032
|
-
var VoteThresholdSchema =
|
|
6033
|
-
var ConsensusVoteInputSchema =
|
|
6034
|
-
proposal:
|
|
6043
|
+
var VoteThresholdSchema = z11.enum(["majority", "supermajority", "unanimous"]);
|
|
6044
|
+
var ConsensusVoteInputSchema = z11.object({
|
|
6045
|
+
proposal: z11.string().min(1).max(MAX_PROPOSAL_LENGTH).describe(
|
|
6035
6046
|
'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.'
|
|
6036
6047
|
),
|
|
6037
|
-
options:
|
|
6048
|
+
options: z11.array(z11.string().min(1).max(200)).min(2).max(10).optional().describe(
|
|
6038
6049
|
"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."
|
|
6039
6050
|
),
|
|
6040
6051
|
project: VoterProjectInputSchema,
|
|
@@ -6047,8 +6058,8 @@ var ConsensusVoteInputSchema = z10.object({
|
|
|
6047
6058
|
errorPolicy: ErrorPolicySchema.optional().describe(
|
|
6048
6059
|
"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."
|
|
6049
6060
|
),
|
|
6050
|
-
quickMode:
|
|
6051
|
-
simulateVotes:
|
|
6061
|
+
quickMode: z11.boolean().optional().default(false).describe("Use 3 agents instead of the full 7-role panel for faster execution"),
|
|
6062
|
+
simulateVotes: z11.boolean().optional().default(false).describe(
|
|
6052
6063
|
"TESTS ONLY \u2014 when true, voters return random decisions. Output must not be used for real decisions. (#2319)"
|
|
6053
6064
|
),
|
|
6054
6065
|
/**
|
|
@@ -6078,7 +6089,7 @@ var ConsensusVoteInputSchema = z10.object({
|
|
|
6078
6089
|
* same key with different inputs fails closed with
|
|
6079
6090
|
* `idempotency_key_collision`. Sync mode ignores this.
|
|
6080
6091
|
*/
|
|
6081
|
-
idempotencyKey:
|
|
6092
|
+
idempotencyKey: z11.string().min(1).max(256).optional().describe(
|
|
6082
6093
|
"Replay-safe key for async-mode dispatch (#3042 Stage 1c). Same (key, inputs) returns existing jobId."
|
|
6083
6094
|
),
|
|
6084
6095
|
/**
|
|
@@ -6090,7 +6101,7 @@ var ConsensusVoteInputSchema = z10.object({
|
|
|
6090
6101
|
* record and require `ratifies === transition.subject` (with decision=approved,
|
|
6091
6102
|
* strategy=higher_order). Omit on an ordinary vote.
|
|
6092
6103
|
*/
|
|
6093
|
-
ratifies:
|
|
6104
|
+
ratifies: z11.string().min(1).max(256).optional().describe(
|
|
6094
6105
|
"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."
|
|
6095
6106
|
),
|
|
6096
6107
|
/**
|
|
@@ -6108,14 +6119,14 @@ var ConsensusVoteInputSchema = z10.object({
|
|
|
6108
6119
|
)
|
|
6109
6120
|
// #4968: `dispatch` and the deprecated `mode` alias must agree when both are sent.
|
|
6110
6121
|
}).superRefine(refineDispatchModeAgreement);
|
|
6111
|
-
var VoteDecisionStatusSchema =
|
|
6122
|
+
var VoteDecisionStatusSchema = z11.enum([
|
|
6112
6123
|
"approved",
|
|
6113
6124
|
"rejected",
|
|
6114
6125
|
"pending",
|
|
6115
6126
|
"timeout",
|
|
6116
6127
|
"no_quorum"
|
|
6117
6128
|
]);
|
|
6118
|
-
var ContrarianCheckStatusSchema =
|
|
6129
|
+
var ContrarianCheckStatusSchema = z11.enum(["ok", "errored", "skipped"]);
|
|
6119
6130
|
function toRecordDecision(status) {
|
|
6120
6131
|
switch (status) {
|
|
6121
6132
|
case "approved":
|
|
@@ -7143,25 +7154,25 @@ import {
|
|
|
7143
7154
|
writeFileSync as writeFileSync4,
|
|
7144
7155
|
chmodSync
|
|
7145
7156
|
} from "node:fs";
|
|
7146
|
-
import { z as
|
|
7157
|
+
import { z as z13 } from "zod";
|
|
7147
7158
|
|
|
7148
7159
|
// src/mcp/jobs/job-idempotency.ts
|
|
7149
7160
|
import { createHash as createHash3, randomUUID } from "node:crypto";
|
|
7150
7161
|
import { existsSync as existsSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "node:fs";
|
|
7151
|
-
import { z as
|
|
7162
|
+
import { z as z12 } from "zod";
|
|
7152
7163
|
var logger7 = createLogger({ component: "job-idempotency" });
|
|
7153
|
-
var IdempotencyIndexEntrySchema =
|
|
7154
|
-
v:
|
|
7164
|
+
var IdempotencyIndexEntrySchema = z12.object({
|
|
7165
|
+
v: z12.literal(1),
|
|
7155
7166
|
/** MCP tool name (e.g. `orchestrate`, `run_workflow`, `consensus_vote`). */
|
|
7156
|
-
tool:
|
|
7167
|
+
tool: z12.string().min(1),
|
|
7157
7168
|
/** Caller-supplied idempotency key. */
|
|
7158
|
-
key:
|
|
7169
|
+
key: z12.string().min(1),
|
|
7159
7170
|
/** sha256 of the canonical input JSON. */
|
|
7160
|
-
inputsHash:
|
|
7171
|
+
inputsHash: z12.string().length(64),
|
|
7161
7172
|
/** Existing jobId for this (tool, key, inputs) tuple. */
|
|
7162
|
-
jobId:
|
|
7173
|
+
jobId: z12.string().min(1),
|
|
7163
7174
|
/** ISO timestamp of first dispatch. */
|
|
7164
|
-
createdAt:
|
|
7175
|
+
createdAt: z12.iso.datetime()
|
|
7165
7176
|
});
|
|
7166
7177
|
function sha256Hex(input) {
|
|
7167
7178
|
return createHash3("sha256").update(input).digest("hex");
|
|
@@ -7262,28 +7273,28 @@ function readIndexEntry(path2) {
|
|
|
7262
7273
|
|
|
7263
7274
|
// src/mcp/jobs/job-result-store.ts
|
|
7264
7275
|
var logger8 = createLogger({ component: "job-result-store" });
|
|
7265
|
-
var JobStatusSchema =
|
|
7266
|
-
var JobResultSchema =
|
|
7276
|
+
var JobStatusSchema = z13.enum(["pending", "complete", "failed", "cancelled"]);
|
|
7277
|
+
var JobResultSchema = z13.object({
|
|
7267
7278
|
/** Format version. Currently `1` — bump if the shape changes. */
|
|
7268
|
-
v:
|
|
7269
|
-
jobId:
|
|
7279
|
+
v: z13.literal(1),
|
|
7280
|
+
jobId: z13.string().min(1),
|
|
7270
7281
|
/** Tool that was invoked (e.g. `orchestrate`). */
|
|
7271
|
-
toolName:
|
|
7282
|
+
toolName: z13.string().min(1),
|
|
7272
7283
|
status: JobStatusSchema,
|
|
7273
|
-
createdAt:
|
|
7284
|
+
createdAt: z13.iso.datetime(),
|
|
7274
7285
|
/** Set when the job leaves `pending` — either via `complete` or `failed` or `cancelled`. */
|
|
7275
|
-
completedAt:
|
|
7286
|
+
completedAt: z13.iso.datetime().optional(),
|
|
7276
7287
|
/**
|
|
7277
7288
|
* Structured payload the synchronous mode would have returned. Present
|
|
7278
7289
|
* only when `status === 'complete'`. Shape is tool-specific — readers
|
|
7279
7290
|
* cast to the tool's known output type after status check.
|
|
7280
7291
|
*/
|
|
7281
|
-
result:
|
|
7292
|
+
result: z13.unknown().optional(),
|
|
7282
7293
|
/**
|
|
7283
7294
|
* Failure message when `status === 'failed'`. Cannot be paired with
|
|
7284
7295
|
* `result` — the discriminator is `status`.
|
|
7285
7296
|
*/
|
|
7286
|
-
error:
|
|
7297
|
+
error: z13.string().optional(),
|
|
7287
7298
|
/**
|
|
7288
7299
|
* Machine-readable reason for a `failed` record that was NOT settled by the
|
|
7289
7300
|
* process that ran the job (#6224). `abandoned` is written only by
|
|
@@ -7292,7 +7303,7 @@ var JobResultSchema = z12.object({
|
|
|
7292
7303
|
* the sweep rewrote it rather than deleting it. Absent on every record the
|
|
7293
7304
|
* job's own process wrote — `error` alone carries those failures.
|
|
7294
7305
|
*/
|
|
7295
|
-
errorKind:
|
|
7306
|
+
errorKind: z13.literal("abandoned").optional(),
|
|
7296
7307
|
/**
|
|
7297
7308
|
* Whether the tool's `run` callback accepts `runAsJob`'s `AbortSignal`
|
|
7298
7309
|
* (#4972).
|
|
@@ -7308,7 +7319,7 @@ var JobResultSchema = z12.object({
|
|
|
7308
7319
|
* "cancellation can reach this tool", not "the work stopped". Absent means
|
|
7309
7320
|
* the writer did not report it, which is not the same as `false`.
|
|
7310
7321
|
*/
|
|
7311
|
-
signalAccepted:
|
|
7322
|
+
signalAccepted: z13.boolean().optional(),
|
|
7312
7323
|
/**
|
|
7313
7324
|
* `VERSION` of the nexus-agents process that WROTE this record (#5008) —
|
|
7314
7325
|
* i.e. the build that ran the job, not the build that reads it back.
|
|
@@ -7329,7 +7340,7 @@ var JobResultSchema = z12.object({
|
|
|
7329
7340
|
* `'dev'` — readers MUST run it through {@link isMeasuredBuildVersion}
|
|
7330
7341
|
* before treating two stamps as comparable.
|
|
7331
7342
|
*/
|
|
7332
|
-
producerVersion:
|
|
7343
|
+
producerVersion: z13.string().optional()
|
|
7333
7344
|
});
|
|
7334
7345
|
var UNMEASURED_BUILD_VERSION = "dev";
|
|
7335
7346
|
function isMeasuredBuildVersion(version) {
|
|
@@ -7702,8 +7713,8 @@ import * as path from "node:path";
|
|
|
7702
7713
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7703
7714
|
|
|
7704
7715
|
// src/context/structured-task-state-types.ts
|
|
7705
|
-
import { z as
|
|
7706
|
-
var TaskStageSchema =
|
|
7716
|
+
import { z as z14 } from "zod";
|
|
7717
|
+
var TaskStageSchema = z14.enum([
|
|
7707
7718
|
"planning",
|
|
7708
7719
|
"executing",
|
|
7709
7720
|
"verifying",
|
|
@@ -7715,64 +7726,64 @@ var TaskStageSchema = z13.enum([
|
|
|
7715
7726
|
// failed run in StructuredTaskState instead of the Stage-1 sidecar.
|
|
7716
7727
|
"failed"
|
|
7717
7728
|
]);
|
|
7718
|
-
var TaskDecisionSchema =
|
|
7719
|
-
ts:
|
|
7720
|
-
decision:
|
|
7721
|
-
rationale:
|
|
7729
|
+
var TaskDecisionSchema = z14.object({
|
|
7730
|
+
ts: z14.iso.datetime(),
|
|
7731
|
+
decision: z14.string().min(1),
|
|
7732
|
+
rationale: z14.string().min(1)
|
|
7722
7733
|
});
|
|
7723
|
-
var TaskBlockerSchema =
|
|
7724
|
-
ts:
|
|
7725
|
-
blocker:
|
|
7726
|
-
resolved:
|
|
7734
|
+
var TaskBlockerSchema = z14.object({
|
|
7735
|
+
ts: z14.iso.datetime(),
|
|
7736
|
+
blocker: z14.string().min(1),
|
|
7737
|
+
resolved: z14.iso.datetime().optional()
|
|
7727
7738
|
});
|
|
7728
|
-
var TaskPositionSchema =
|
|
7729
|
-
currentStep:
|
|
7730
|
-
nextStep:
|
|
7739
|
+
var TaskPositionSchema = z14.object({
|
|
7740
|
+
currentStep: z14.string().min(1),
|
|
7741
|
+
nextStep: z14.string().optional()
|
|
7731
7742
|
});
|
|
7732
|
-
var TaskLedgerSchema =
|
|
7743
|
+
var TaskLedgerSchema = z14.object({
|
|
7733
7744
|
/** Verifiable observations: what we have observed/measured/confirmed. */
|
|
7734
|
-
facts:
|
|
7745
|
+
facts: z14.array(z14.string()),
|
|
7735
7746
|
/** Working assumptions: useful guesses we proceed under, marked separately. */
|
|
7736
|
-
guesses:
|
|
7747
|
+
guesses: z14.array(z14.string()),
|
|
7737
7748
|
/** Things we still need to figure out before the plan is sound. */
|
|
7738
|
-
openQuestions:
|
|
7739
|
-
updatedAt:
|
|
7749
|
+
openQuestions: z14.array(z14.string()),
|
|
7750
|
+
updatedAt: z14.iso.datetime()
|
|
7740
7751
|
});
|
|
7741
|
-
var ReflectActionSchema =
|
|
7752
|
+
var ReflectActionSchema = z14.enum([
|
|
7742
7753
|
"continue",
|
|
7743
7754
|
"revise_plan",
|
|
7744
7755
|
"escalate_to_human",
|
|
7745
7756
|
"abort"
|
|
7746
7757
|
]);
|
|
7747
|
-
var ProgressLedgerEntrySchema =
|
|
7748
|
-
ts:
|
|
7758
|
+
var ProgressLedgerEntrySchema = z14.object({
|
|
7759
|
+
ts: z14.iso.datetime(),
|
|
7749
7760
|
/** What just happened (the step we are reflecting on). */
|
|
7750
|
-
step:
|
|
7761
|
+
step: z14.string().min(1),
|
|
7751
7762
|
/** Is the outer Task Ledger plan still right after this step? */
|
|
7752
|
-
planStillValid:
|
|
7763
|
+
planStillValid: z14.boolean(),
|
|
7753
7764
|
/** Are we making progress, or have we stalled? */
|
|
7754
|
-
stuck:
|
|
7765
|
+
stuck: z14.boolean(),
|
|
7755
7766
|
/** What the orchestrator should do next based on this reflection. */
|
|
7756
7767
|
suggestedAction: ReflectActionSchema,
|
|
7757
7768
|
/** Why this action was chosen — required so future readers can audit the call. */
|
|
7758
|
-
rationale:
|
|
7769
|
+
rationale: z14.string().min(1)
|
|
7759
7770
|
});
|
|
7760
|
-
var TaskCancellationSchema =
|
|
7761
|
-
requestedAt:
|
|
7771
|
+
var TaskCancellationSchema = z14.object({
|
|
7772
|
+
requestedAt: z14.iso.datetime(),
|
|
7762
7773
|
/** Optional human-readable note carried back to the caller. */
|
|
7763
|
-
reason:
|
|
7774
|
+
reason: z14.string().max(1e3).optional()
|
|
7764
7775
|
});
|
|
7765
7776
|
var TASK_RESULT_MAX_BYTES = 1048576;
|
|
7766
|
-
var StructuredTaskStateSchema =
|
|
7767
|
-
taskId:
|
|
7777
|
+
var StructuredTaskStateSchema = z14.object({
|
|
7778
|
+
taskId: z14.string().min(1),
|
|
7768
7779
|
/**
|
|
7769
7780
|
* Marks state created by the shared async-job dispatcher (#5622).
|
|
7770
7781
|
* Optional for backward compatibility; absence does not prove async dispatch.
|
|
7771
7782
|
*/
|
|
7772
|
-
dispatch:
|
|
7783
|
+
dispatch: z14.literal("async").optional(),
|
|
7773
7784
|
stage: TaskStageSchema,
|
|
7774
|
-
decisions:
|
|
7775
|
-
blockers:
|
|
7785
|
+
decisions: z14.array(TaskDecisionSchema),
|
|
7786
|
+
blockers: z14.array(TaskBlockerSchema),
|
|
7776
7787
|
position: TaskPositionSchema,
|
|
7777
7788
|
/**
|
|
7778
7789
|
* Magentic-One Task Ledger (#2278). Mutable single-object outer-loop state:
|
|
@@ -7785,7 +7796,7 @@ var StructuredTaskStateSchema = z13.object({
|
|
|
7785
7796
|
* Most recent entry's `suggestedAction` is what `reflect()` returns. Optional
|
|
7786
7797
|
* for the same backward-compat reason as `taskLedger`.
|
|
7787
7798
|
*/
|
|
7788
|
-
progressLedger:
|
|
7799
|
+
progressLedger: z14.array(ProgressLedgerEntrySchema).optional(),
|
|
7789
7800
|
/**
|
|
7790
7801
|
* Monotonic version counter (#3043 / epic #2631 Stage 2). Increments by
|
|
7791
7802
|
* 1 on every write; polling clients use this to detect "I missed a
|
|
@@ -7795,7 +7806,7 @@ var StructuredTaskStateSchema = z13.object({
|
|
|
7795
7806
|
* state logs (pre-Stage-2) don't carry it; the reducer treats their
|
|
7796
7807
|
* baseline as v0 and starts counting from there.
|
|
7797
7808
|
*/
|
|
7798
|
-
version:
|
|
7809
|
+
version: z14.number().int().nonnegative().optional(),
|
|
7799
7810
|
/**
|
|
7800
7811
|
* Tool result payload (#3043 / epic #2631 Stage 2). Set atomically
|
|
7801
7812
|
* via the `result` log event when `stage === 'complete'`. Carries the
|
|
@@ -7811,7 +7822,7 @@ var StructuredTaskStateSchema = z13.object({
|
|
|
7811
7822
|
* field, then the sidecar files become legacy that the next cleanup
|
|
7812
7823
|
* sweep can remove.
|
|
7813
7824
|
*/
|
|
7814
|
-
result:
|
|
7825
|
+
result: z14.unknown().optional(),
|
|
7815
7826
|
/**
|
|
7816
7827
|
* Cancellation marker (#3043 / epic #2631 Stage 2). Set by `cancel_job`
|
|
7817
7828
|
* — the running tool checks for this at safe-point boundaries (between
|
|
@@ -7828,70 +7839,70 @@ var StructuredTaskStateSchema = z13.object({
|
|
|
7828
7839
|
* transition has been recorded. Optional for backward-compat with
|
|
7829
7840
|
* pre-#3090 logs (the reducer backfills it from the init entry).
|
|
7830
7841
|
*/
|
|
7831
|
-
createdAt:
|
|
7832
|
-
updatedAt:
|
|
7842
|
+
createdAt: z14.iso.datetime().optional(),
|
|
7843
|
+
updatedAt: z14.iso.datetime()
|
|
7833
7844
|
});
|
|
7834
|
-
var StructuredTaskLogEntrySchema =
|
|
7835
|
-
|
|
7836
|
-
event:
|
|
7837
|
-
ts:
|
|
7845
|
+
var StructuredTaskLogEntrySchema = z14.discriminatedUnion("event", [
|
|
7846
|
+
z14.object({
|
|
7847
|
+
event: z14.literal("init"),
|
|
7848
|
+
ts: z14.iso.datetime(),
|
|
7838
7849
|
state: StructuredTaskStateSchema
|
|
7839
7850
|
}),
|
|
7840
|
-
|
|
7841
|
-
event:
|
|
7842
|
-
ts:
|
|
7851
|
+
z14.object({
|
|
7852
|
+
event: z14.literal("decision"),
|
|
7853
|
+
ts: z14.iso.datetime(),
|
|
7843
7854
|
decision: TaskDecisionSchema
|
|
7844
7855
|
}),
|
|
7845
|
-
|
|
7846
|
-
event:
|
|
7847
|
-
ts:
|
|
7856
|
+
z14.object({
|
|
7857
|
+
event: z14.literal("blocker"),
|
|
7858
|
+
ts: z14.iso.datetime(),
|
|
7848
7859
|
blocker: TaskBlockerSchema
|
|
7849
7860
|
}),
|
|
7850
|
-
|
|
7851
|
-
event:
|
|
7852
|
-
ts:
|
|
7861
|
+
z14.object({
|
|
7862
|
+
event: z14.literal("blocker_resolved"),
|
|
7863
|
+
ts: z14.iso.datetime(),
|
|
7853
7864
|
/** Index of the blocker in the state's blockers[] array. */
|
|
7854
|
-
blockerIndex:
|
|
7855
|
-
resolvedAt:
|
|
7865
|
+
blockerIndex: z14.number().int().nonnegative(),
|
|
7866
|
+
resolvedAt: z14.iso.datetime()
|
|
7856
7867
|
}),
|
|
7857
|
-
|
|
7858
|
-
event:
|
|
7859
|
-
ts:
|
|
7868
|
+
z14.object({
|
|
7869
|
+
event: z14.literal("stage"),
|
|
7870
|
+
ts: z14.iso.datetime(),
|
|
7860
7871
|
stage: TaskStageSchema
|
|
7861
7872
|
}),
|
|
7862
|
-
|
|
7863
|
-
event:
|
|
7864
|
-
ts:
|
|
7873
|
+
z14.object({
|
|
7874
|
+
event: z14.literal("position"),
|
|
7875
|
+
ts: z14.iso.datetime(),
|
|
7865
7876
|
position: TaskPositionSchema
|
|
7866
7877
|
}),
|
|
7867
7878
|
// Magentic-One Task Ledger replacement event — the outer loop revises the
|
|
7868
7879
|
// entire ledger atomically when replanning. Always replaces, never partial.
|
|
7869
|
-
|
|
7870
|
-
event:
|
|
7871
|
-
ts:
|
|
7880
|
+
z14.object({
|
|
7881
|
+
event: z14.literal("task_ledger"),
|
|
7882
|
+
ts: z14.iso.datetime(),
|
|
7872
7883
|
ledger: TaskLedgerSchema
|
|
7873
7884
|
}),
|
|
7874
7885
|
// Magentic-One Progress Ledger append event — one self-reflection per step.
|
|
7875
|
-
|
|
7876
|
-
event:
|
|
7877
|
-
ts:
|
|
7886
|
+
z14.object({
|
|
7887
|
+
event: z14.literal("progress_ledger"),
|
|
7888
|
+
ts: z14.iso.datetime(),
|
|
7878
7889
|
entry: ProgressLedgerEntrySchema
|
|
7879
7890
|
}),
|
|
7880
7891
|
// #3043 / epic #2631 Stage 2 — tool result payload set when stage flips
|
|
7881
7892
|
// to 'complete'. Written by appendResult; replayed into state.result.
|
|
7882
7893
|
// The payload itself is `unknown` because each tool's result shape is
|
|
7883
7894
|
// its own; readers cast after a status check.
|
|
7884
|
-
|
|
7885
|
-
event:
|
|
7886
|
-
ts:
|
|
7887
|
-
result:
|
|
7895
|
+
z14.object({
|
|
7896
|
+
event: z14.literal("result"),
|
|
7897
|
+
ts: z14.iso.datetime(),
|
|
7898
|
+
result: z14.unknown()
|
|
7888
7899
|
}),
|
|
7889
7900
|
// #3043 / epic #2631 Stage 2 — cancellation marker. Append-only: the
|
|
7890
7901
|
// reducer ignores a second cancellation event so a malicious or buggy
|
|
7891
7902
|
// double-cancel can't rewrite the requestedAt timestamp.
|
|
7892
|
-
|
|
7893
|
-
event:
|
|
7894
|
-
ts:
|
|
7903
|
+
z14.object({
|
|
7904
|
+
event: z14.literal("cancellation"),
|
|
7905
|
+
ts: z14.iso.datetime(),
|
|
7895
7906
|
cancellation: TaskCancellationSchema
|
|
7896
7907
|
})
|
|
7897
7908
|
]);
|
|
@@ -8873,49 +8884,49 @@ var ASYNC_ENVELOPES = {
|
|
|
8873
8884
|
};
|
|
8874
8885
|
var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
|
|
8875
8886
|
/** Async-dispatch envelope discriminator — absent on a completed vote. */
|
|
8876
|
-
status:
|
|
8877
|
-
jobId:
|
|
8878
|
-
pollTool:
|
|
8879
|
-
note:
|
|
8880
|
-
retryAfterMs:
|
|
8881
|
-
proposal:
|
|
8887
|
+
status: z15.enum(["pending", "busy", "replay"]).optional(),
|
|
8888
|
+
jobId: z15.string().max(200).optional(),
|
|
8889
|
+
pollTool: z15.literal("get_job_result").optional(),
|
|
8890
|
+
note: z15.string().max(500).optional(),
|
|
8891
|
+
retryAfterMs: z15.number().optional(),
|
|
8892
|
+
proposal: z15.string().optional(),
|
|
8882
8893
|
strategy: VotingStrategySchema.optional(),
|
|
8883
8894
|
// Reuses the canonical VoteDecisionStatusSchema (single source) — a hand-listed
|
|
8884
8895
|
// subset here (was ['approved','rejected','no_quorum']) omitted the reachable
|
|
8885
8896
|
// 'timeout'/'pending' outcomes and made strict clients reject those votes (#4032).
|
|
8886
8897
|
decision: VoteDecisionStatusSchema.optional(),
|
|
8887
|
-
approvalPercentage:
|
|
8888
|
-
voteCounts:
|
|
8889
|
-
approve:
|
|
8890
|
-
reject:
|
|
8891
|
-
abstain:
|
|
8892
|
-
error:
|
|
8898
|
+
approvalPercentage: z15.number().optional(),
|
|
8899
|
+
voteCounts: z15.object({
|
|
8900
|
+
approve: z15.number(),
|
|
8901
|
+
reject: z15.number(),
|
|
8902
|
+
abstain: z15.number(),
|
|
8903
|
+
error: z15.number(),
|
|
8893
8904
|
/** #6094: seats that could not read the artifact; always present. */
|
|
8894
|
-
unverifiable:
|
|
8905
|
+
unverifiable: z15.number()
|
|
8895
8906
|
}).optional(),
|
|
8896
8907
|
// #6111: the quick-mode contrarian check is not a seat, so `voteCounts.error`
|
|
8897
8908
|
// cannot count it. Present on every completed vote (`skipped` when it did not
|
|
8898
8909
|
// run); optional here only because the async envelope shares this schema.
|
|
8899
8910
|
contrarianCheck: ContrarianCheckStatusSchema.optional(),
|
|
8900
|
-
votes:
|
|
8901
|
-
|
|
8902
|
-
role:
|
|
8903
|
-
decision:
|
|
8904
|
-
confidence:
|
|
8905
|
-
reasoning:
|
|
8906
|
-
simulated:
|
|
8907
|
-
error:
|
|
8911
|
+
votes: z15.array(
|
|
8912
|
+
z15.object({
|
|
8913
|
+
role: z15.string().max(100),
|
|
8914
|
+
decision: z15.enum(["approve", "reject", "abstain"]),
|
|
8915
|
+
confidence: z15.number(),
|
|
8916
|
+
reasoning: z15.string().max(4e3),
|
|
8917
|
+
simulated: z15.boolean(),
|
|
8918
|
+
error: z15.boolean(),
|
|
8908
8919
|
/** #6094: present only when the seat could not read the artifact. */
|
|
8909
|
-
unverifiable:
|
|
8920
|
+
unverifiable: z15.literal(true).optional(),
|
|
8910
8921
|
/** #6115: present only when the seat answered elsewhere than assigned. */
|
|
8911
|
-
fallback:
|
|
8912
|
-
fromCli:
|
|
8913
|
-
fromModel:
|
|
8914
|
-
reason:
|
|
8922
|
+
fallback: z15.object({
|
|
8923
|
+
fromCli: z15.string().max(100),
|
|
8924
|
+
fromModel: z15.string().max(100).optional(),
|
|
8925
|
+
reason: z15.enum(["rate-limit", "capacity", "auth", "timeout", "sandbox", "unknown"])
|
|
8915
8926
|
}).optional(),
|
|
8916
|
-
modelUsed:
|
|
8917
|
-
rejectionCategories:
|
|
8918
|
-
|
|
8927
|
+
modelUsed: z15.string().max(100).optional(),
|
|
8928
|
+
rejectionCategories: z15.array(
|
|
8929
|
+
z15.enum([
|
|
8919
8930
|
"YAGNI",
|
|
8920
8931
|
"DRY_VIOLATION",
|
|
8921
8932
|
"OVER_ENGINEERING",
|
|
@@ -8928,48 +8939,48 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
|
|
|
8928
8939
|
})
|
|
8929
8940
|
).optional(),
|
|
8930
8941
|
threshold: VoteThresholdSchema.optional(),
|
|
8931
|
-
durationMs:
|
|
8932
|
-
simulateVotes:
|
|
8942
|
+
durationMs: z15.number().optional(),
|
|
8943
|
+
simulateVotes: z15.boolean().optional(),
|
|
8933
8944
|
// #6110: the project the panel judged and how the name was decided. Always
|
|
8934
8945
|
// on the response; optional here like every field, because the async
|
|
8935
8946
|
// `pending` envelope shares this schema.
|
|
8936
|
-
project:
|
|
8937
|
-
name:
|
|
8938
|
-
source:
|
|
8947
|
+
project: z15.object({
|
|
8948
|
+
name: z15.string().max(200),
|
|
8949
|
+
source: z15.enum(["input", "derived", "default"])
|
|
8939
8950
|
}).optional(),
|
|
8940
|
-
higherOrderMetadata:
|
|
8941
|
-
posteriorApproval:
|
|
8942
|
-
posteriorRejection:
|
|
8943
|
-
effectiveVoteCount:
|
|
8944
|
-
method:
|
|
8945
|
-
usedCorrelationData:
|
|
8946
|
-
improvementOverBaseline:
|
|
8947
|
-
downweightedAgents:
|
|
8948
|
-
reasoning:
|
|
8951
|
+
higherOrderMetadata: z15.object({
|
|
8952
|
+
posteriorApproval: z15.number(),
|
|
8953
|
+
posteriorRejection: z15.number(),
|
|
8954
|
+
effectiveVoteCount: z15.number(),
|
|
8955
|
+
method: z15.enum(["ow", "isp", "simple"]),
|
|
8956
|
+
usedCorrelationData: z15.boolean(),
|
|
8957
|
+
improvementOverBaseline: z15.number(),
|
|
8958
|
+
downweightedAgents: z15.array(z15.string().max(100)).max(10),
|
|
8959
|
+
reasoning: z15.string().max(2e3)
|
|
8949
8960
|
}).optional(),
|
|
8950
8961
|
// #3124: explains a `rejected` decision that coexists with a high
|
|
8951
8962
|
// approvalPercentage (an error-policy short-circuit, e.g. fail_closed).
|
|
8952
|
-
policyReason:
|
|
8963
|
+
policyReason: z15.string().max(200).optional(),
|
|
8953
8964
|
// #3991: whether the authentic vote record was persisted at vote time. Post-
|
|
8954
8965
|
// #3991 it routes through nexusDataPath under governance/, so true is the
|
|
8955
8966
|
// normal case; false means all-simulated (skipped by design) or write-failed
|
|
8956
8967
|
// (data dir unwritable) — voteRecordNote carries the actionable reason. Makes
|
|
8957
8968
|
// a previously WARN-only skip visible to MCP callers.
|
|
8958
|
-
voteRecordPersisted:
|
|
8959
|
-
voteRecordNote:
|
|
8969
|
+
voteRecordPersisted: z15.boolean().optional(),
|
|
8970
|
+
voteRecordNote: z15.string().max(500).optional(),
|
|
8960
8971
|
// #5130: the persisted record's id, so the caller-commits script can name it.
|
|
8961
|
-
voteRecordId:
|
|
8972
|
+
voteRecordId: z15.string().max(200).optional(),
|
|
8962
8973
|
// #3587: set when the panel DEGRADED (some voters errored), so the decision
|
|
8963
8974
|
// rests on fewer voters than requested. Part of the response since #3587 but
|
|
8964
8975
|
// omitted from this schema until #4032 — its absence made a strict MCP client
|
|
8965
8976
|
// reject any degraded-panel vote (`-32602 additional properties`).
|
|
8966
|
-
panelWarning:
|
|
8977
|
+
panelWarning: z15.string().optional(),
|
|
8967
8978
|
// #6115: distinct answering models and seats that answered elsewhere than
|
|
8968
8979
|
// assigned. Always on the response (explicit zeros); optional here only
|
|
8969
8980
|
// because the async `pending` envelope shares this schema.
|
|
8970
|
-
panelDiversity:
|
|
8971
|
-
distinctModels:
|
|
8972
|
-
fallbacks:
|
|
8981
|
+
panelDiversity: z15.object({
|
|
8982
|
+
distinctModels: z15.number().int().nonnegative(),
|
|
8983
|
+
fallbacks: z15.number().int().nonnegative()
|
|
8973
8984
|
}).optional(),
|
|
8974
8985
|
// #3855: per-decision cost rollup. Same omission as panelWarning (#4032) — it
|
|
8975
8986
|
// is present on the response whenever cost recording succeeds (common in `api`
|
|
@@ -8978,18 +8989,18 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
|
|
|
8978
8989
|
// #4472: declared-option outcome. Present whenever the proposal declared
|
|
8979
8990
|
// `options`. `unattributedApprovals` is part of the contract, not telemetry:
|
|
8980
8991
|
// without it a caller cannot tell a real split from unreadable responses.
|
|
8981
|
-
optionOutcome:
|
|
8982
|
-
tally:
|
|
8983
|
-
leadingOption:
|
|
8984
|
-
leadingShare:
|
|
8985
|
-
approverCount:
|
|
8986
|
-
selectedCount:
|
|
8987
|
-
unattributedApprovals:
|
|
8988
|
-
thresholdMet:
|
|
8992
|
+
optionOutcome: z15.object({
|
|
8993
|
+
tally: z15.array(z15.object({ option: z15.string(), count: z15.number().int().nonnegative() })),
|
|
8994
|
+
leadingOption: z15.string().optional(),
|
|
8995
|
+
leadingShare: z15.number().min(0).max(1),
|
|
8996
|
+
approverCount: z15.number().int().nonnegative(),
|
|
8997
|
+
selectedCount: z15.number().int().nonnegative(),
|
|
8998
|
+
unattributedApprovals: z15.number().int().nonnegative(),
|
|
8999
|
+
thresholdMet: z15.boolean(),
|
|
8989
9000
|
// #4529: present only on a veto. Declared here because a strict MCP
|
|
8990
9001
|
// client rejects any property the advertised schema omits — the same
|
|
8991
9002
|
// drift that made degraded-panel votes unusable before #4032.
|
|
8992
|
-
vetoReason:
|
|
9003
|
+
vetoReason: z15.string().max(400).optional()
|
|
8993
9004
|
}).optional()
|
|
8994
9005
|
};
|
|
8995
9006
|
var CONSENSUS_VOTE_TOOL_SCHEMA = ConsensusVoteInputSchema.shape;
|
|
@@ -9133,4 +9144,4 @@ export {
|
|
|
9133
9144
|
CONSENSUS_VOTE_TOOL_SCHEMA,
|
|
9134
9145
|
registerConsensusVoteTool
|
|
9135
9146
|
};
|
|
9136
|
-
//# sourceMappingURL=chunk-
|
|
9147
|
+
//# sourceMappingURL=chunk-2EKSJV5C.js.map
|