nexus-agents 8.55.6 → 8.55.8
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-JAFFZUMA.js → chunk-4XRGCSFR.js} +3 -3
- package/dist/{chunk-NIAQBK7X.js → chunk-DZHGR5UO.js} +181 -44
- package/dist/{chunk-NIAQBK7X.js.map → chunk-DZHGR5UO.js.map} +1 -1
- package/dist/{chunk-ZUZWHGTB.js → chunk-IEF3YTEH.js} +3 -3
- package/dist/{chunk-ADYNKL6V.js → chunk-MUSPT4J4.js} +15 -11
- package/dist/chunk-MUSPT4J4.js.map +1 -0
- package/dist/{chunk-RLJ6SDFZ.js → chunk-WL336Y4R.js} +2 -2
- package/dist/{chunk-WCTONUCK.js → chunk-ZBZSSNRB.js} +2 -2
- package/dist/cli.js +7 -7
- package/dist/{consensus-vote-FGGOXR3Y.js → consensus-vote-CJKMBM47.js} +4 -4
- package/dist/{improvement-review-F43XUKSC.js → improvement-review-JIKJHIBZ.js} +4 -4
- package/dist/index.d.ts +28 -2
- package/dist/index.js +6 -6
- package/dist/{setup-data-dir-QLTGCM3W.js → setup-data-dir-YKEJYHAI.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-ADYNKL6V.js.map +0 -1
- /package/dist/{chunk-JAFFZUMA.js.map → chunk-4XRGCSFR.js.map} +0 -0
- /package/dist/{chunk-ZUZWHGTB.js.map → chunk-IEF3YTEH.js.map} +0 -0
- /package/dist/{chunk-RLJ6SDFZ.js.map → chunk-WL336Y4R.js.map} +0 -0
- /package/dist/{chunk-WCTONUCK.js.map → chunk-ZBZSSNRB.js.map} +0 -0
- /package/dist/{consensus-vote-FGGOXR3Y.js.map → consensus-vote-CJKMBM47.js.map} +0 -0
- /package/dist/{improvement-review-F43XUKSC.js.map → improvement-review-JIKJHIBZ.js.map} +0 -0
- /package/dist/{setup-data-dir-QLTGCM3W.js.map → setup-data-dir-YKEJYHAI.js.map} +0 -0
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
toolSuccessStructured,
|
|
26
26
|
withProgressHeartbeat,
|
|
27
27
|
wrapToolWithTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MUSPT4J4.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZBZSSNRB.js";
|
|
32
32
|
import {
|
|
33
33
|
UNRESOLVED_MODEL_ID,
|
|
34
34
|
assessPanelIndependence,
|
|
@@ -8630,4 +8630,4 @@ export {
|
|
|
8630
8630
|
CONSENSUS_VOTE_TOOL_SCHEMA,
|
|
8631
8631
|
registerConsensusVoteTool
|
|
8632
8632
|
};
|
|
8633
|
-
//# sourceMappingURL=chunk-
|
|
8633
|
+
//# sourceMappingURL=chunk-4XRGCSFR.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
clampTaskTtl
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IEF3YTEH.js";
|
|
25
25
|
import {
|
|
26
26
|
executeExpert
|
|
27
27
|
} from "./chunk-QMGMD6JB.js";
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
toJobSummary,
|
|
63
63
|
updateStage,
|
|
64
64
|
writeJobCancelled
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-4XRGCSFR.js";
|
|
66
66
|
import {
|
|
67
67
|
allOf,
|
|
68
68
|
anyOf
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
} from "./chunk-RNWUIQTZ.js";
|
|
83
83
|
import {
|
|
84
84
|
withPrerequisite
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-WL336Y4R.js";
|
|
86
86
|
import {
|
|
87
87
|
NOOP_NOTIFIER,
|
|
88
88
|
RateLimiter,
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
withAuditTrail,
|
|
108
108
|
withProgressHeartbeat,
|
|
109
109
|
wrapToolWithTimeout
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-MUSPT4J4.js";
|
|
111
111
|
import {
|
|
112
112
|
createAuditTrail,
|
|
113
113
|
createGraphAuditBridge,
|
|
@@ -46182,7 +46182,7 @@ function buildVotingInput(plan, config) {
|
|
|
46182
46182
|
}
|
|
46183
46183
|
async function executeSingleVote(plan, config, log) {
|
|
46184
46184
|
try {
|
|
46185
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
46185
|
+
const { executeVoting } = await import("./consensus-vote-CJKMBM47.js");
|
|
46186
46186
|
const input = buildVotingInput(plan, config);
|
|
46187
46187
|
const result = await executeVoting(input, log);
|
|
46188
46188
|
return parseVotingResult(result);
|
|
@@ -47980,7 +47980,7 @@ ${contextBlock}`;
|
|
|
47980
47980
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47981
47981
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47982
47982
|
try {
|
|
47983
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47983
|
+
const { executeVoting } = await import("./consensus-vote-CJKMBM47.js");
|
|
47984
47984
|
const votingResult = await executeVoting(
|
|
47985
47985
|
{
|
|
47986
47986
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -48759,8 +48759,9 @@ var PrReviewSanitizationSchema = z103.object({
|
|
|
48759
48759
|
* #4140 an over-budget diff is packed to a security-prioritized SUBSET
|
|
48760
48760
|
* before the panel prompt is built, so on that path the voters read less
|
|
48761
48761
|
* than this hash covers. That reduction is a DIFFERENT one, disclosed
|
|
48762
|
-
* separately in the hash-covered `
|
|
48763
|
-
*
|
|
48762
|
+
* separately in the hash-covered `coverage` record field (#6190; and,
|
|
48763
|
+
* human-readably, the `[partial coverage: …]` summary stamp) and enforced
|
|
48764
|
+
* by `applyPartialCoverageGate`.
|
|
48764
48765
|
*
|
|
48765
48766
|
* Keeping them apart is the point: one hash covering both reductions could
|
|
48766
48767
|
* not tell an auditor WHICH one moved it. This field isolates the
|
|
@@ -48801,6 +48802,35 @@ var PrReviewSanitizationSchema = z103.object({
|
|
|
48801
48802
|
*/
|
|
48802
48803
|
tagsRemoved: z103.number().int().nonnegative()
|
|
48803
48804
|
}).strict();
|
|
48805
|
+
var PrReviewBudgetSourceSchema = z103.enum(["registry", "binding-cap-fallback"]);
|
|
48806
|
+
var PrReviewPanelCoverageSchema = z103.object({
|
|
48807
|
+
/** `'full'` — the panel was sent the whole diff; `'partial'` — a packed subset. */
|
|
48808
|
+
panelRead: z103.enum(["full", "partial"]),
|
|
48809
|
+
/** Files whose full diff the panel actually reviewed. */
|
|
48810
|
+
reviewedFiles: z103.number().int().nonnegative(),
|
|
48811
|
+
/** Files in the original diff. */
|
|
48812
|
+
totalFiles: z103.number().int().nonnegative(),
|
|
48813
|
+
/**
|
|
48814
|
+
* EVERY path the panel did not fully review — the complete list, never a
|
|
48815
|
+
* prefix of it. The summary stamp lists at most a few of these and says
|
|
48816
|
+
* `N dropped (k listed)`; this field is where the rest live.
|
|
48817
|
+
*/
|
|
48818
|
+
droppedFiles: z103.array(z103.string()),
|
|
48819
|
+
/** UTF-8 bytes of the diff text the panel actually read. */
|
|
48820
|
+
reviewedBytes: z103.number().int().nonnegative(),
|
|
48821
|
+
/** UTF-8 bytes of the input diff. */
|
|
48822
|
+
totalBytes: z103.number().int().nonnegative(),
|
|
48823
|
+
/** Where the panel-read budget came from. */
|
|
48824
|
+
budgetSource: PrReviewBudgetSourceSchema,
|
|
48825
|
+
/** The budget derivation (registry) or the fallback reason, verbatim. */
|
|
48826
|
+
budgetDetail: z103.string()
|
|
48827
|
+
}).strict();
|
|
48828
|
+
var PrReviewBindingBoundsSchema = z103.object({
|
|
48829
|
+
/** `'full'` — the hash covers every byte; `'prefix'` — only the first `boundBytes`. */
|
|
48830
|
+
kind: z103.enum(["full", "prefix"]),
|
|
48831
|
+
/** UTF-8 bytes the hash binds: `min(totalBytes, MAX_REVIEWED_DIFF_BYTES)`. */
|
|
48832
|
+
boundBytes: z103.number().int().nonnegative()
|
|
48833
|
+
}).strict();
|
|
48804
48834
|
var PrReviewRecordSchema = z103.object({
|
|
48805
48835
|
/**
|
|
48806
48836
|
* Schema version. '1.1' was the Option-C binding (#3831): the record binds to
|
|
@@ -48819,8 +48849,17 @@ var PrReviewRecordSchema = z103.object({
|
|
|
48819
48849
|
* at this bump), so no record exists whose hash a version literal would
|
|
48820
48850
|
* invalidate. Reading a '1.2' record as if it were '1.3' would be the unsafe
|
|
48821
48851
|
* move — its hash may bind SANITIZED bytes the gate can never reproduce.
|
|
48822
|
-
|
|
48823
|
-
|
|
48852
|
+
* '1.4' (#6190) marks the boundary at which records began carrying
|
|
48853
|
+
* {@link coverage} and {@link bindingBounds} as structured fields. NOT a clean
|
|
48854
|
+
* break this time: a '1.3' record is still accepted and — because both new
|
|
48855
|
+
* fields are folded into the hash ONLY when present, like `diffProvenance`
|
|
48856
|
+
* and `sanitization` — re-hashes byte-identically (the pinned 1.3 golden in
|
|
48857
|
+
* pr-review-record.test.ts is the guard). This is the vote-record tier
|
|
48858
|
+
* model (`vote-record.ts`, #6179): a 1.3 record differs from a 1.4 one only
|
|
48859
|
+
* in which fields it CAN carry, and reading it as 1.4 is safe because its
|
|
48860
|
+
* hash binds the same raw bytes. Tiers are labels; nothing orders them.
|
|
48861
|
+
*/
|
|
48862
|
+
version: z103.enum(["1.3", "1.4"]),
|
|
48824
48863
|
/**
|
|
48825
48864
|
* Monotonic sequence number (integer ≥ 0). Assigned as (max existing
|
|
48826
48865
|
* sequence)+1 at write time. Sorted, the set of sequences must cover
|
|
@@ -48876,6 +48915,20 @@ var PrReviewRecordSchema = z103.object({
|
|
|
48876
48915
|
* consumer must NOT read that as "nothing was removed".
|
|
48877
48916
|
*/
|
|
48878
48917
|
sanitization: PrReviewSanitizationSchema.optional(),
|
|
48918
|
+
/**
|
|
48919
|
+
* What the panel READ (#6190). OPTIONAL for the same reason the two above
|
|
48920
|
+
* are: the schema is `.strict()`, a '1.3' record has no such field, and a
|
|
48921
|
+
* producer that does not measure coverage (the local-ledger script) must be
|
|
48922
|
+
* able to decline to say. Absent ⇒ nothing stated; NOT "read everything".
|
|
48923
|
+
*/
|
|
48924
|
+
coverage: PrReviewPanelCoverageSchema.optional(),
|
|
48925
|
+
/**
|
|
48926
|
+
* How far the hash BINDS (#6190). Same optionality rule. Written together
|
|
48927
|
+
* with {@link coverage} by the pr_review producer; absent ⇒ nothing stated,
|
|
48928
|
+
* and a consumer that needs the answer recomputes it from the diff length
|
|
48929
|
+
* against `MAX_REVIEWED_DIFF_BYTES` (which the governor gate does).
|
|
48930
|
+
*/
|
|
48931
|
+
bindingBounds: PrReviewBindingBoundsSchema.optional(),
|
|
48879
48932
|
/**
|
|
48880
48933
|
* ADVISORY hash of the tip record at write time (absent for the first).
|
|
48881
48934
|
* Retained for audit texture but NOT covered by `hash` and NOT verified —
|
|
@@ -48885,6 +48938,21 @@ var PrReviewRecordSchema = z103.object({
|
|
|
48885
48938
|
/** SHA-256 over every field above EXCEPT `previousHash` (and except `hash`). */
|
|
48886
48939
|
hash: z103.string().length(64)
|
|
48887
48940
|
}).strict();
|
|
48941
|
+
function projectPanelCoverage(c) {
|
|
48942
|
+
return {
|
|
48943
|
+
panelRead: c.panelRead,
|
|
48944
|
+
reviewedFiles: c.reviewedFiles,
|
|
48945
|
+
totalFiles: c.totalFiles,
|
|
48946
|
+
droppedFiles: [...c.droppedFiles],
|
|
48947
|
+
reviewedBytes: c.reviewedBytes,
|
|
48948
|
+
totalBytes: c.totalBytes,
|
|
48949
|
+
budgetSource: c.budgetSource,
|
|
48950
|
+
budgetDetail: c.budgetDetail
|
|
48951
|
+
};
|
|
48952
|
+
}
|
|
48953
|
+
function projectBindingBounds(b) {
|
|
48954
|
+
return { kind: b.kind, boundBytes: b.boundBytes };
|
|
48955
|
+
}
|
|
48888
48956
|
function computePrReviewRecordHash(payload) {
|
|
48889
48957
|
const canonical = JSON.stringify({
|
|
48890
48958
|
version: payload.version,
|
|
@@ -48937,7 +49005,12 @@ function computePrReviewRecordHash(payload) {
|
|
|
48937
49005
|
fieldsModified: payload.sanitization.fieldsModified,
|
|
48938
49006
|
tagsRemoved: payload.sanitization.tagsRemoved
|
|
48939
49007
|
}
|
|
48940
|
-
} : {}
|
|
49008
|
+
} : {},
|
|
49009
|
+
// #6190 panel coverage and binding bounds, INSIDE the hash. Present-only on the
|
|
49010
|
+
// same rule as the two blocks above, so a 1.3 record projects
|
|
49011
|
+
// byte-identically (the pinned golden is the guard).
|
|
49012
|
+
...payload.coverage !== void 0 ? { coverage: projectPanelCoverage(payload.coverage) } : {},
|
|
49013
|
+
...payload.bindingBounds !== void 0 ? { bindingBounds: projectBindingBounds(payload.bindingBounds) } : {}
|
|
48941
49014
|
});
|
|
48942
49015
|
return crypto3.createHash("sha256").update(canonical).digest("hex");
|
|
48943
49016
|
}
|
|
@@ -48949,7 +49022,7 @@ var MAX_SUMMARY_RECORD_CHARS = 500;
|
|
|
48949
49022
|
function buildPrReviewRecord(input) {
|
|
48950
49023
|
const summaryTruncated = input.summary.length > MAX_SUMMARY_RECORD_CHARS ? input.summary.slice(0, MAX_SUMMARY_RECORD_CHARS) + "..." : input.summary;
|
|
48951
49024
|
const payload = {
|
|
48952
|
-
version: "1.
|
|
49025
|
+
version: "1.4",
|
|
48953
49026
|
sequence: input.sequence ?? 0,
|
|
48954
49027
|
prNumber: input.prNumber,
|
|
48955
49028
|
baseSha: input.baseSha,
|
|
@@ -48967,6 +49040,8 @@ function buildPrReviewRecord(input) {
|
|
|
48967
49040
|
summary: summaryTruncated,
|
|
48968
49041
|
...input.diffProvenance !== void 0 ? { diffProvenance: input.diffProvenance } : {},
|
|
48969
49042
|
...input.sanitization !== void 0 ? { sanitization: input.sanitization } : {},
|
|
49043
|
+
...input.coverage !== void 0 ? { coverage: input.coverage } : {},
|
|
49044
|
+
...input.bindingBounds !== void 0 ? { bindingBounds: input.bindingBounds } : {},
|
|
48970
49045
|
...input.correlationId !== void 0 ? { correlationId: input.correlationId } : {},
|
|
48971
49046
|
...input.previousHash !== void 0 ? { previousHash: input.previousHash } : {}
|
|
48972
49047
|
};
|
|
@@ -49197,20 +49272,21 @@ function wholeDiffFileCoverage(prDiff) {
|
|
|
49197
49272
|
strategy: "budget"
|
|
49198
49273
|
};
|
|
49199
49274
|
}
|
|
49200
|
-
function packDiffForPanelAndBinding(prDiff, budgets) {
|
|
49275
|
+
function packDiffForPanelAndBinding(prDiff, budgets, binding) {
|
|
49201
49276
|
const totalBytes = byteLen(prDiff);
|
|
49202
|
-
const
|
|
49203
|
-
const boundBytes = Math.min(totalBytes, budgets.bindingCapBytes);
|
|
49277
|
+
const bindingKind = binding.totalBytes > budgets.bindingCapBytes ? "prefix" : "full";
|
|
49278
|
+
const boundBytes = Math.min(binding.totalBytes, budgets.bindingCapBytes);
|
|
49204
49279
|
const panel = packDiffForReview(prDiff, budgets.panelReadBudgetBytes);
|
|
49205
49280
|
const panelRead = panel.coverage?.partial === true ? "partial" : "full";
|
|
49206
|
-
if (panelRead === "full" &&
|
|
49281
|
+
if (panelRead === "full" && bindingKind === "full") {
|
|
49207
49282
|
return { coverage: void 0, packedDiff: prDiff, note: "" };
|
|
49208
49283
|
}
|
|
49209
49284
|
const fileCoverage = panel.coverage ?? wholeDiffFileCoverage(prDiff);
|
|
49210
49285
|
const coverage = {
|
|
49211
49286
|
...fileCoverage,
|
|
49212
49287
|
panelRead,
|
|
49213
|
-
binding,
|
|
49288
|
+
binding: bindingKind,
|
|
49289
|
+
bindingSource: binding.source,
|
|
49214
49290
|
reviewedBytes: byteLen(panel.packedDiff),
|
|
49215
49291
|
boundBytes,
|
|
49216
49292
|
totalBytes,
|
|
@@ -49231,24 +49307,96 @@ function applyPartialCoverageGate(aggregate, coverage) {
|
|
|
49231
49307
|
return aggregate;
|
|
49232
49308
|
}
|
|
49233
49309
|
|
|
49310
|
+
// src/mcp/tools/pr-review-sanitization-view.ts
|
|
49311
|
+
function sanitizationViewOf(ctx) {
|
|
49312
|
+
const rawDiffBytes = ctx.sanitization.rawFieldBytes["prDiff"];
|
|
49313
|
+
return {
|
|
49314
|
+
rawDiffHash: ctx.sanitization.rawFieldHashes["prDiff"],
|
|
49315
|
+
rawDiffBytes,
|
|
49316
|
+
// #6177: the same UTF-8 test `reviewedDiffWasTruncated` applies to the raw
|
|
49317
|
+
// string, over the length the middleware measured beside the hash — the
|
|
49318
|
+
// raw text itself never reaches the handler (sanitize-before-dispatch).
|
|
49319
|
+
// `undefined` when the length is: a missing number is not "not truncated".
|
|
49320
|
+
rawTruncated: rawDiffBytes === void 0 ? void 0 : rawDiffBytes > MAX_REVIEWED_DIFF_BYTES,
|
|
49321
|
+
commentsRemoved: ctx.sanitization.commentsRemoved,
|
|
49322
|
+
fieldsModified: ctx.sanitization.fieldsModified,
|
|
49323
|
+
tagsRemoved: ctx.sanitization.tagsRemoved
|
|
49324
|
+
};
|
|
49325
|
+
}
|
|
49326
|
+
function measuredAsHanded(prDiff, source) {
|
|
49327
|
+
return {
|
|
49328
|
+
totalBytes: Buffer.byteLength(prDiff, "utf-8"),
|
|
49329
|
+
truncated: reviewedDiffWasTruncated(prDiff),
|
|
49330
|
+
source
|
|
49331
|
+
};
|
|
49332
|
+
}
|
|
49333
|
+
function resolveBindingMeasurement(prDiff, sanitization) {
|
|
49334
|
+
if (sanitization === void 0) return measuredAsHanded(prDiff, "input");
|
|
49335
|
+
const { rawDiffBytes, rawTruncated } = sanitization;
|
|
49336
|
+
if (rawDiffBytes === void 0 || rawTruncated === void 0) {
|
|
49337
|
+
return measuredAsHanded(prDiff, "sanitized-fallback");
|
|
49338
|
+
}
|
|
49339
|
+
return { totalBytes: rawDiffBytes, truncated: rawTruncated, source: "raw" };
|
|
49340
|
+
}
|
|
49341
|
+
function removalsBefore(sanitization) {
|
|
49342
|
+
return {
|
|
49343
|
+
comments: sanitization?.commentsRemoved ?? 0,
|
|
49344
|
+
fields: sanitization?.fieldsModified ?? 0,
|
|
49345
|
+
tags: sanitization?.tagsRemoved ?? 0
|
|
49346
|
+
};
|
|
49347
|
+
}
|
|
49348
|
+
|
|
49234
49349
|
// src/mcp/tools/pr-review-record-producer.ts
|
|
49235
49350
|
function bytes(n) {
|
|
49236
49351
|
return n.toLocaleString("en-US");
|
|
49237
49352
|
}
|
|
49353
|
+
function bindingSourceClause(source) {
|
|
49354
|
+
if (source === "raw") return " (raw)";
|
|
49355
|
+
if (source === "sanitized-fallback") return " (sanitized; raw length not supplied)";
|
|
49356
|
+
return "";
|
|
49357
|
+
}
|
|
49238
49358
|
function bindingStamp(coverage) {
|
|
49239
|
-
const binding = coverage.binding === "prefix" ? `binding covers first ${bytes(coverage.boundBytes)} bytes` : `binding covers all ${bytes(coverage.boundBytes)} bytes
|
|
49359
|
+
const binding = (coverage.binding === "prefix" ? `binding covers first ${bytes(coverage.boundBytes)} bytes` : `binding covers all ${bytes(coverage.boundBytes)} bytes`) + bindingSourceClause(coverage.bindingSource);
|
|
49240
49360
|
return `[panel read ${bytes(coverage.reviewedBytes)}/${bytes(coverage.totalBytes)} bytes; ${binding}; budget: ${coverage.budgetSource} (${coverage.budgetDetail})]`;
|
|
49241
49361
|
}
|
|
49362
|
+
var SUMMARY_DROPPED_FILES_LISTED = 3;
|
|
49363
|
+
function droppedFilesClause(dropped) {
|
|
49364
|
+
const listed = dropped.slice(0, SUMMARY_DROPPED_FILES_LISTED);
|
|
49365
|
+
const qualifier = listed.length < dropped.length ? ` (${String(listed.length)} listed)` : "";
|
|
49366
|
+
return `${String(dropped.length)} dropped${qualifier}: ${listed.join(", ")}`;
|
|
49367
|
+
}
|
|
49242
49368
|
function coverageStamps(coverage) {
|
|
49243
49369
|
if (coverage === void 0) return "";
|
|
49244
|
-
const files = coverage.partial ? `[partial coverage: ${String(coverage.reviewedFiles)}/${String(coverage.totalFiles)} files reviewed,
|
|
49370
|
+
const files = coverage.partial ? `[partial coverage: ${String(coverage.reviewedFiles)}/${String(coverage.totalFiles)} files reviewed, ${droppedFilesClause(coverage.droppedFiles)}] ` : "";
|
|
49245
49371
|
return ` ${files}${bindingStamp(coverage)}`;
|
|
49246
49372
|
}
|
|
49247
|
-
function
|
|
49248
|
-
if (
|
|
49373
|
+
function coverageFieldsOf(coverage) {
|
|
49374
|
+
if (coverage === void 0) return void 0;
|
|
49375
|
+
return {
|
|
49376
|
+
coverage: {
|
|
49377
|
+
panelRead: coverage.panelRead,
|
|
49378
|
+
reviewedFiles: coverage.reviewedFiles,
|
|
49379
|
+
totalFiles: coverage.totalFiles,
|
|
49380
|
+
droppedFiles: [...coverage.droppedFiles],
|
|
49381
|
+
reviewedBytes: coverage.reviewedBytes,
|
|
49382
|
+
totalBytes: coverage.totalBytes,
|
|
49383
|
+
budgetSource: coverage.budgetSource,
|
|
49384
|
+
budgetDetail: coverage.budgetDetail
|
|
49385
|
+
},
|
|
49386
|
+
bindingBounds: { kind: coverage.binding, boundBytes: coverage.boundBytes }
|
|
49387
|
+
};
|
|
49388
|
+
}
|
|
49389
|
+
function warnIfDiffTruncated(binding, prNumber, logger57) {
|
|
49390
|
+
if (binding.source === "sanitized-fallback") {
|
|
49391
|
+
logger57.warn(
|
|
49392
|
+
"Binding bounds measured over the SANITIZED diff: the sanitizer supplied no raw byte length, so a prefix binding can be under-stated (#6177)",
|
|
49393
|
+
{ prNumber, sanitizedBytes: binding.totalBytes }
|
|
49394
|
+
);
|
|
49395
|
+
}
|
|
49396
|
+
if (!binding.truncated) return;
|
|
49249
49397
|
logger57.warn(
|
|
49250
49398
|
"Reviewed diff exceeds the hash byte cap; content past it is unbound in reviewedDiffHash",
|
|
49251
|
-
{ prNumber }
|
|
49399
|
+
{ prNumber, measuredOver: binding.source, totalBytes: binding.totalBytes }
|
|
49252
49400
|
);
|
|
49253
49401
|
}
|
|
49254
49402
|
function diffProvenanceOf(source, diff) {
|
|
@@ -49274,14 +49422,16 @@ function buildAndPersist(prNumber, baseSha, args) {
|
|
|
49274
49422
|
const { input, aggregate, counts, reviewCount, logger: logger57, coverage, diffSource, sanitization } = args;
|
|
49275
49423
|
const reviewedDiffHash = sanitization?.rawDiffHash ?? computeReviewedDiffHash(input.prDiff);
|
|
49276
49424
|
const stamps = coverageStamps(coverage);
|
|
49425
|
+
const coverageFields = coverageFieldsOf(coverage);
|
|
49277
49426
|
const disclosure = sanitizationDisclosureOf(sanitization, input.prDiff);
|
|
49278
|
-
warnIfDiffTruncated(input.prDiff, prNumber, logger57);
|
|
49427
|
+
warnIfDiffTruncated(resolveBindingMeasurement(input.prDiff, sanitization), prNumber, logger57);
|
|
49279
49428
|
const record = persistPrReviewRecord({
|
|
49280
49429
|
prNumber,
|
|
49281
49430
|
baseSha,
|
|
49282
49431
|
reviewedDiffHash,
|
|
49283
49432
|
diffProvenance: diffProvenanceOf(diffSource, input.prDiff),
|
|
49284
49433
|
...disclosure !== void 0 ? { sanitization: disclosure } : {},
|
|
49434
|
+
...coverageFields ?? {},
|
|
49285
49435
|
verdict: aggregate.decision,
|
|
49286
49436
|
verified: aggregate.verified,
|
|
49287
49437
|
voteCounts: {
|
|
@@ -49364,23 +49514,6 @@ function persistReviewRecord(args) {
|
|
|
49364
49514
|
}
|
|
49365
49515
|
}
|
|
49366
49516
|
|
|
49367
|
-
// src/mcp/tools/pr-review-sanitization-view.ts
|
|
49368
|
-
function sanitizationViewOf(ctx) {
|
|
49369
|
-
return {
|
|
49370
|
-
rawDiffHash: ctx.sanitization.rawFieldHashes["prDiff"],
|
|
49371
|
-
commentsRemoved: ctx.sanitization.commentsRemoved,
|
|
49372
|
-
fieldsModified: ctx.sanitization.fieldsModified,
|
|
49373
|
-
tagsRemoved: ctx.sanitization.tagsRemoved
|
|
49374
|
-
};
|
|
49375
|
-
}
|
|
49376
|
-
function removalsBefore(sanitization) {
|
|
49377
|
-
return {
|
|
49378
|
-
comments: sanitization?.commentsRemoved ?? 0,
|
|
49379
|
-
fields: sanitization?.fieldsModified ?? 0,
|
|
49380
|
-
tags: sanitization?.tagsRemoved ?? 0
|
|
49381
|
-
};
|
|
49382
|
-
}
|
|
49383
|
-
|
|
49384
49517
|
// src/mcp/tools/pr-review-panel-budget.ts
|
|
49385
49518
|
var PANEL_PROMPT_OVERHEAD_TOKENS = 16e3;
|
|
49386
49519
|
function conservativeBytesPerToken() {
|
|
@@ -49472,9 +49605,11 @@ function resolvePrReviewPanelBudget(panel, logger57, registry = getDefaultRegist
|
|
|
49472
49605
|
}
|
|
49473
49606
|
return budget;
|
|
49474
49607
|
}
|
|
49475
|
-
function preparePanelProposal(input, panel,
|
|
49608
|
+
function preparePanelProposal(input, panel, sanitization, logger57, registry = getDefaultRegistry()) {
|
|
49476
49609
|
const budgets = resolvePrReviewPanelBudget(panel, logger57, registry);
|
|
49477
|
-
const
|
|
49610
|
+
const binding = resolveBindingMeasurement(input.prDiff, sanitization);
|
|
49611
|
+
const { coverage, packedDiff, note } = packDiffForPanelAndBinding(input.prDiff, budgets, binding);
|
|
49612
|
+
const removedBefore = removalsBefore(sanitization);
|
|
49478
49613
|
const body = coverage === void 0 ? input : { ...input, prDiff: packedDiff };
|
|
49479
49614
|
if (coverage?.partial === true) {
|
|
49480
49615
|
logger57.warn(
|
|
@@ -49484,6 +49619,8 @@ function preparePanelProposal(input, panel, removedBefore, logger57, registry =
|
|
|
49484
49619
|
logger57.info("pr_review panel read the whole diff; the audit hash binds a prefix (#6003)", {
|
|
49485
49620
|
totalBytes: coverage.totalBytes,
|
|
49486
49621
|
boundBytes: coverage.boundBytes,
|
|
49622
|
+
bindingSource: coverage.bindingSource,
|
|
49623
|
+
bindingTotalBytes: binding.totalBytes,
|
|
49487
49624
|
budgetSource: coverage.budgetSource
|
|
49488
49625
|
});
|
|
49489
49626
|
}
|
|
@@ -49492,7 +49629,7 @@ function preparePanelProposal(input, panel, removedBefore, logger57, registry =
|
|
|
49492
49629
|
async function preparePanelForReview(input, roles, opts, logger57) {
|
|
49493
49630
|
const seats = input.simulate ? void 0 : await resolvePanelSeats(roles, opts.gatewayAdapters, logger57);
|
|
49494
49631
|
const panel = { seats, simulate: input.simulate };
|
|
49495
|
-
const packed = preparePanelProposal(input, panel,
|
|
49632
|
+
const packed = preparePanelProposal(input, panel, opts.sanitization, logger57);
|
|
49496
49633
|
return { ...packed, seats };
|
|
49497
49634
|
}
|
|
49498
49635
|
|
|
@@ -57042,4 +57179,4 @@ export {
|
|
|
57042
57179
|
startPipelineEventBridge,
|
|
57043
57180
|
shutdownPipelineEventBridge
|
|
57044
57181
|
};
|
|
57045
|
-
//# sourceMappingURL=chunk-
|
|
57182
|
+
//# sourceMappingURL=chunk-DZHGR5UO.js.map
|