@descryy/mcp 0.6.0 → 0.7.1
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/action-handshake.d.ts +8 -75
- package/dist/action-handshake.d.ts.map +1 -1
- package/dist/action-handshake.js +9 -79
- package/dist/action-handshake.js.map +1 -1
- package/dist/bin/descry-mcp.d.ts +4 -15
- package/dist/bin/descry-mcp.d.ts.map +1 -1
- package/dist/bin/descry-mcp.js +12 -42
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +121 -224
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +9 -55
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +10 -43
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +20 -54
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +12 -19
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +31 -26
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/graph-write.d.ts +4 -45
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +8 -53
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts +7 -91
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +59 -197
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -34
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js +4 -24
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/registry.d.ts +26 -106
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +20 -77
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-provenance.d.ts +23 -0
- package/dist/browser/scenario-provenance.d.ts.map +1 -0
- package/dist/browser/scenario-provenance.js +59 -0
- package/dist/browser/scenario-provenance.js.map +1 -0
- package/dist/browser/scenario-resolve.d.ts +10 -44
- package/dist/browser/scenario-resolve.d.ts.map +1 -1
- package/dist/browser/scenario-resolve.js +10 -41
- package/dist/browser/scenario-resolve.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +12 -70
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +30 -90
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/stack-parser.d.ts +4 -28
- package/dist/browser/stack-parser.d.ts.map +1 -1
- package/dist/browser/stack-parser.js +12 -39
- package/dist/browser/stack-parser.js.map +1 -1
- package/dist/browser/tool-support.d.ts +20 -67
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +21 -65
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/url-scheme.d.ts +14 -0
- package/dist/browser/url-scheme.d.ts.map +1 -0
- package/dist/browser/url-scheme.js +38 -0
- package/dist/browser/url-scheme.js.map +1 -0
- package/dist/cancellation.d.ts +11 -46
- package/dist/cancellation.d.ts.map +1 -1
- package/dist/cancellation.js +11 -46
- package/dist/cancellation.js.map +1 -1
- package/dist/capped.d.ts +9 -33
- package/dist/capped.d.ts.map +1 -1
- package/dist/capped.js +7 -27
- package/dist/capped.js.map +1 -1
- package/dist/disclosure-ledger.d.ts +6 -30
- package/dist/disclosure-ledger.d.ts.map +1 -1
- package/dist/disclosure-ledger.js +4 -26
- package/dist/disclosure-ledger.js.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/module-trust.d.ts +24 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +60 -0
- package/dist/module-trust.js.map +1 -0
- package/dist/path-confinement.d.ts +31 -0
- package/dist/path-confinement.d.ts.map +1 -0
- package/dist/path-confinement.js +44 -0
- package/dist/path-confinement.js.map +1 -0
- package/dist/protocol.d.ts +10 -53
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -60
- package/dist/protocol.js.map +1 -1
- package/dist/registry.d.ts +37 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +88 -96
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +89 -13
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +111 -16
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +7 -66
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +39 -114
- package/dist/runtime-registry.js.map +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +1 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts +4 -18
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +14 -34
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +18 -74
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +7 -34
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/storage.d.ts +11 -41
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +57 -47
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +69 -19
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +90 -259
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +136 -250
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +32 -118
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +65 -186
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +3 -21
- package/dist/tools/browser-click.d.ts.map +1 -1
- package/dist/tools/browser-click.js +10 -31
- package/dist/tools/browser-click.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +4 -13
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +4 -13
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-fill.d.ts +5 -36
- package/dist/tools/browser-fill.d.ts.map +1 -1
- package/dist/tools/browser-fill.js +9 -44
- package/dist/tools/browser-fill.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +6 -27
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +6 -23
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts +5 -31
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +10 -46
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts +3 -28
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +47 -84
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-snapshot.d.ts +6 -39
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +4 -31
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts +4 -23
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +145 -56
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-type.d.ts +5 -35
- package/dist/tools/browser-type.d.ts.map +1 -1
- package/dist/tools/browser-type.js +10 -45
- package/dist/tools/browser-type.js.map +1 -1
- package/dist/tools/contracts.d.ts +9 -86
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +24 -80
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +42 -30
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +81 -62
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts +18 -2
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +118 -26
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts +5 -16
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +3 -10
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.d.ts +4 -33
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -31
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +7 -51
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +15 -67
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +3 -8
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +66 -113
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +60 -28
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts +7 -45
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +10 -48
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/lookup.d.ts +4 -14
- package/dist/tools/lookup.d.ts.map +1 -1
- package/dist/tools/lookup.js +4 -14
- package/dist/tools/lookup.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +7 -54
- package/dist/tools/mark-incident.d.ts.map +1 -1
- package/dist/tools/mark-incident.js +15 -68
- package/dist/tools/mark-incident.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +27 -210
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +273 -434
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -100
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +74 -152
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/pr-analysis.d.ts +18 -2
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +73 -23
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +74 -16
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +152 -51
- package/dist/tools/pre-push.js.map +1 -1
- package/dist/tools/propagation.d.ts +11 -53
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +17 -58
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts +13 -63
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +33 -105
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts +4 -40
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +4 -40
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +4 -63
- package/dist/tools/runtime-incident.d.ts.map +1 -1
- package/dist/tools/runtime-incident.js +10 -87
- package/dist/tools/runtime-incident.js.map +1 -1
- package/dist/tools/scope.d.ts +7 -25
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +10 -29
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +11 -86
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +7 -71
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/validate.d.ts +29 -70
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +141 -85
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/verification-status.d.ts +9 -64
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +9 -62
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts +5 -52
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +6 -56
- package/dist/tools/verify-claim.js.map +1 -1
- package/dist/transport.d.ts +15 -52
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -60
- package/dist/transport.js.map +1 -1
- package/package.json +40 -22
|
@@ -96,8 +96,24 @@ export declare function indexPrAnalysisNodes(affected: readonly {
|
|
|
96
96
|
}[], untested: readonly IndexableNode[], tests: readonly IndexableNode[]): PrAnalysisLists;
|
|
97
97
|
/** Shared by every branch: what was diffed, and what came out of git. */
|
|
98
98
|
export interface PrAnalysisRange {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Which change set this answer is about — declared by the caller.
|
|
101
|
+
*
|
|
102
|
+
* `range` is `base...head`. `working-tree` is the change as it stands,
|
|
103
|
+
* uncommitted. Stated because the two answer different questions and a reply
|
|
104
|
+
* that did not say which one it answered would be readable as either — which
|
|
105
|
+
* is precisely how a composite came to describe 25 committed files under a
|
|
106
|
+
* headline about the 2 uncommitted ones passed to it.
|
|
107
|
+
*/
|
|
108
|
+
readonly mode: "range" | "working-tree";
|
|
109
|
+
/** Null in working-tree mode: there is no second ref to compare against. */
|
|
110
|
+
readonly base: string | null;
|
|
111
|
+
readonly head: string | null;
|
|
112
|
+
/** Present in working-tree mode only. */
|
|
113
|
+
readonly workingTree?: {
|
|
114
|
+
readonly scope: "unstaged" | "staged" | "all";
|
|
115
|
+
readonly includeUntracked: boolean;
|
|
116
|
+
};
|
|
101
117
|
/** Paths in `base...head` — three dots, so somebody else's work on base is not folded in. */
|
|
102
118
|
readonly files: readonly string[];
|
|
103
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-analysis.d.ts","sourceRoot":"","sources":["../../src/tools/pr-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;
|
|
1
|
+
{"version":3,"file":"pr-analysis.d.ts","sourceRoot":"","sources":["../../src/tools/pr-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAWH,OAAO,EAQL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,UAAU,CAA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AAED,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GACpB,gBAAgB,CAAC;AA+NrB,eAAO,MAAM,cAAc,EAAE,cAiB5B,CAAC"}
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
* times in one reply. `indexPrAnalysisNodes` collapses that: the lists name
|
|
31
31
|
* ids, `nodes` holds each node once. Tool version 2.0.0 for it.
|
|
32
32
|
*/
|
|
33
|
-
import { changedFiles, changeRisk, NODE_BUDGETS, nodesInFiles, withProminence } from "@descryy/core";
|
|
34
|
-
import { answer, briefNode, optionalEnum, optionalInteger, optionalString,
|
|
33
|
+
import { changedFiles, changeRisk, NODE_BUDGETS, nodesInFiles, withProminence, workingTreeChangedFiles, } from "@descryy/core";
|
|
34
|
+
import { answer, briefNode, optionalEnum, optionalInteger, descryOwnState, optionalString, ToolInputError, } from "./kit.js";
|
|
35
35
|
/**
|
|
36
36
|
* Collapse three overlapping node lists into one map plus three id lists.
|
|
37
37
|
*
|
|
@@ -64,9 +64,24 @@ const SCHEMA = {
|
|
|
64
64
|
base: {
|
|
65
65
|
type: "string",
|
|
66
66
|
description: "The branch or commit this change is measured against, e.g. \"main\" or \"origin/main\". " +
|
|
67
|
-
"Required — there is no defensible default, and guessing
|
|
67
|
+
"Required unless \"workingTree\" is given — there is no defensible default, and guessing " +
|
|
68
|
+
"one silently changes the diff.",
|
|
68
69
|
},
|
|
69
70
|
head: { type: "string", description: "The tip being reviewed. Default HEAD." },
|
|
71
|
+
workingTree: {
|
|
72
|
+
type: "string",
|
|
73
|
+
enum: ["unstaged", "staged", "all"],
|
|
74
|
+
description: "Review the change as it stands in the working tree rather than between two refs — the " +
|
|
75
|
+
"change about to be committed, including files git has never seen. \"all\" is staged and " +
|
|
76
|
+
"unstaged together. Mutually exclusive with \"base\", and never inferred: the two answer " +
|
|
77
|
+
"different questions, so the caller declares which one they are asking. Which ran is " +
|
|
78
|
+
"stated in the reply.",
|
|
79
|
+
},
|
|
80
|
+
includeUntracked: {
|
|
81
|
+
type: "boolean",
|
|
82
|
+
description: "With \"workingTree\", include files git has never seen. On by default — a new file " +
|
|
83
|
+
"written and not yet added is part of the change about to be committed.",
|
|
84
|
+
},
|
|
70
85
|
trigger: {
|
|
71
86
|
type: "string",
|
|
72
87
|
enum: [...TRIGGERS],
|
|
@@ -74,26 +89,60 @@ const SCHEMA = {
|
|
|
74
89
|
},
|
|
75
90
|
limit: { type: "integer", minimum: 1, description: "Cap on nodes per list. Default 50." },
|
|
76
91
|
},
|
|
77
|
-
required: ["base"],
|
|
78
92
|
additionalProperties: false,
|
|
79
93
|
};
|
|
80
94
|
async function run(args, ctx) {
|
|
81
|
-
//
|
|
82
|
-
// guessing
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
// One of the two questions has to be chosen, and neither has a defensible
|
|
96
|
+
// default: guessing would silently change which change set the whole answer
|
|
97
|
+
// describes. This tool's own reasoning is that the diff is what defines a
|
|
98
|
+
// change to review — a working tree *is* a diff, it is simply not a
|
|
99
|
+
// ref-to-ref one, so accepting it completes that principle rather than
|
|
100
|
+
// bending it. Which one ran is stated in the reply.
|
|
101
|
+
const workingTree = optionalString(args, "workingTree");
|
|
102
|
+
const includeUntracked = args["includeUntracked"] !== false;
|
|
103
|
+
const baseArg = optionalString(args, "base");
|
|
104
|
+
if (workingTree === undefined && baseArg === undefined) {
|
|
105
|
+
throw new ToolInputError('Give either "base" (a ref range) or "workingTree" (the change as it stands, uncommitted). ' +
|
|
106
|
+
"There is no defensible default, and guessing one silently changes which change set the " +
|
|
107
|
+
"answer describes.");
|
|
108
|
+
}
|
|
109
|
+
if (workingTree !== undefined && baseArg !== undefined) {
|
|
110
|
+
throw new ToolInputError('"base" and "workingTree" are mutually exclusive — they are two different questions. Ask one.');
|
|
111
|
+
}
|
|
112
|
+
if (workingTree !== undefined && !["unstaged", "staged", "all"].includes(workingTree)) {
|
|
113
|
+
throw new ToolInputError(`"workingTree" must be "unstaged", "staged" or "all" — got "${workingTree}".`);
|
|
114
|
+
}
|
|
115
|
+
const scope = (workingTree ?? "all");
|
|
116
|
+
const mode = baseArg === undefined ? "working-tree" : "range";
|
|
117
|
+
const base = baseArg ?? null;
|
|
118
|
+
const head = base === null ? null : optionalString(args, "head") ?? "HEAD";
|
|
119
|
+
const subject = base === null ? `the working tree (${scope})` : `${base}...${head}`;
|
|
120
|
+
/** Carried into every one of the four reply shapes, so none can omit it. */
|
|
121
|
+
const identity = {
|
|
122
|
+
mode,
|
|
123
|
+
base,
|
|
124
|
+
head,
|
|
125
|
+
...(base === null ? { workingTree: { scope, includeUntracked } } : {}),
|
|
126
|
+
};
|
|
85
127
|
const trigger = optionalEnum(args, "trigger", TRIGGERS) ?? "pr";
|
|
86
128
|
const limit = optionalInteger(args, "limit", 1) ?? 50;
|
|
87
129
|
const session = ctx.session;
|
|
88
130
|
const stamp = session.provider().baseStamp();
|
|
89
|
-
ctx.progress(`Diffing ${
|
|
131
|
+
ctx.progress(`Diffing ${subject}`);
|
|
90
132
|
let files;
|
|
91
133
|
try {
|
|
92
|
-
files =
|
|
134
|
+
files =
|
|
135
|
+
base === null
|
|
136
|
+
? await workingTreeChangedFiles(session.repoPath, {
|
|
137
|
+
scope,
|
|
138
|
+
includeUntracked,
|
|
139
|
+
exclude: descryOwnState(session.config.graph),
|
|
140
|
+
})
|
|
141
|
+
: await changedFiles(session.repoPath, base, head);
|
|
93
142
|
}
|
|
94
143
|
catch (error) {
|
|
95
144
|
return answer({
|
|
96
|
-
headline: `Could not diff ${
|
|
145
|
+
headline: `Could not diff ${subject}.`,
|
|
97
146
|
state: "refused",
|
|
98
147
|
nameLevel: true,
|
|
99
148
|
resolutionFloor: 0,
|
|
@@ -102,16 +151,18 @@ async function run(args, ctx) {
|
|
|
102
151
|
irSchemaVersion: stamp.irSchemaVersion,
|
|
103
152
|
commitSpread: stamp.commitSpread,
|
|
104
153
|
notes: [
|
|
105
|
-
|
|
106
|
-
|
|
154
|
+
(base === null
|
|
155
|
+
? `git rejected the working-tree read: ${error.message.trim()}.`
|
|
156
|
+
: `git rejected the range: ${error.message.trim()}. Check that "${base}" ` +
|
|
157
|
+
"exists locally — a shallow clone or a missing fetch is the usual cause."),
|
|
107
158
|
],
|
|
108
|
-
data: {
|
|
159
|
+
data: { ...identity, files: [] },
|
|
109
160
|
});
|
|
110
161
|
}
|
|
111
162
|
const notes = [];
|
|
112
163
|
if (files.length === 0) {
|
|
113
164
|
return answer({
|
|
114
|
-
headline: `${
|
|
165
|
+
headline: `${subject} changes no files.`,
|
|
115
166
|
nameLevel: true,
|
|
116
167
|
// 0, not 4. Every other branch of this tool already stamps 0 for the same
|
|
117
168
|
// reason `get_git_diff` does — a live git read is not a graph-traversal
|
|
@@ -124,7 +175,7 @@ async function run(args, ctx) {
|
|
|
124
175
|
irSchemaVersion: stamp.irSchemaVersion,
|
|
125
176
|
commitSpread: stamp.commitSpread,
|
|
126
177
|
notes: ["An empty diff is a real answer: there is nothing to assess."],
|
|
127
|
-
data: {
|
|
178
|
+
data: { ...identity, files: [], nodes: {}, affected: [], untested: [], tests: [] },
|
|
128
179
|
});
|
|
129
180
|
}
|
|
130
181
|
ctx.progress(`Resolving ${files.length} changed file(s)`, 1, 3);
|
|
@@ -137,7 +188,7 @@ async function run(args, ctx) {
|
|
|
137
188
|
}
|
|
138
189
|
if (nodes.length === 0) {
|
|
139
190
|
return answer({
|
|
140
|
-
headline: `None of the ${files.length}
|
|
191
|
+
headline: `None of the ${files.length} file(s) changed in ${subject} are in the graph.`,
|
|
141
192
|
state: "refused",
|
|
142
193
|
nameLevel: true,
|
|
143
194
|
resolutionFloor: 0,
|
|
@@ -150,7 +201,7 @@ async function run(args, ctx) {
|
|
|
150
201
|
"No blast radius was computed. Run analyze first; if it has already run, its disclosures " +
|
|
151
202
|
"name the languages and paths it could not read.",
|
|
152
203
|
],
|
|
153
|
-
data: {
|
|
204
|
+
data: { ...identity, files, missing, nodes: {}, affected: [], untested: [], tests: [] },
|
|
154
205
|
});
|
|
155
206
|
}
|
|
156
207
|
ctx.progress(`Assessing ${nodes.length} changed symbol(s)`, 2, 3);
|
|
@@ -173,8 +224,7 @@ async function run(args, ctx) {
|
|
|
173
224
|
result: {
|
|
174
225
|
...risk,
|
|
175
226
|
data: {
|
|
176
|
-
|
|
177
|
-
head,
|
|
227
|
+
...identity,
|
|
178
228
|
files,
|
|
179
229
|
missing,
|
|
180
230
|
changedSymbols: nodes.length,
|
|
@@ -187,9 +237,9 @@ async function run(args, ctx) {
|
|
|
187
237
|
},
|
|
188
238
|
...(affected.length === 0 ? { state: "empty" } : {}),
|
|
189
239
|
nameLevel: true,
|
|
190
|
-
headline:
|
|
191
|
-
|
|
192
|
-
|
|
240
|
+
headline: `Across ${subject}: ${nodes.length} changed symbol(s) in ${files.length} file(s) affect ` +
|
|
241
|
+
`${affected.length} other node(s). ${risk.data.tests.length} test(s) cover part of that; ` +
|
|
242
|
+
`${untested.length} affected node(s) have no covering test in the graph.`,
|
|
193
243
|
};
|
|
194
244
|
}
|
|
195
245
|
export const prAnalysisTool = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-analysis.js","sourceRoot":"","sources":["../../src/tools/pr-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"pr-analysis.js","sourceRoot":"","sources":["../../src/tools/pr-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,MAAM,EACN,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,GAIf,MAAM,UAAU,CAAC;AAsDlB;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,QA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,37 +74,95 @@ export interface PrePushSection {
|
|
|
74
74
|
readonly state: string;
|
|
75
75
|
/** How many items this source found in total, before this tool took its top few. */
|
|
76
76
|
readonly total: number;
|
|
77
|
+
/** The top few, in the order that source reported them. */
|
|
78
|
+
readonly shown: readonly unknown[];
|
|
77
79
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
80
|
+
* True when this source is **the kind that claims something is wrong** —
|
|
81
|
+
* a property of the source, not of what it found this time.
|
|
82
|
+
*
|
|
83
|
+
* **It was called `blocking`, sitting beside a `blockingTotal` that means the
|
|
84
|
+
* other thing.** `contracts` can be `blocking: true` with `total: 0`, and
|
|
85
|
+
* `validate` `blocking: true` with ten leads and a `blockingTotal` of zero,
|
|
86
|
+
* so the obvious consumer arithmetic — sum `total` over the blocking
|
|
87
|
+
* sections — is wrong in both directions. This tool's own test suite made
|
|
88
|
+
* exactly that mistake and passed, because the fixture happened to produce no
|
|
89
|
+
* leads.
|
|
90
|
+
*
|
|
91
|
+
* The name now says which question it answers. The other question — *did this
|
|
92
|
+
* section find anything that blocks?* — is `defects > 0`, and there is no
|
|
93
|
+
* longer a field whose name suggests it answers both.
|
|
81
94
|
*/
|
|
95
|
+
readonly claimsFaults: boolean;
|
|
96
|
+
/** Of `total`, how many assert a fault. Zero for a source that claims none. */
|
|
82
97
|
readonly defects: number;
|
|
83
|
-
/**
|
|
84
|
-
readonly
|
|
85
|
-
/** True when this source's findings count toward `blockingTotal`. */
|
|
86
|
-
readonly blocking: boolean;
|
|
98
|
+
/** Of `total`, how many are worth a look without asserting one. */
|
|
99
|
+
readonly leads: number;
|
|
87
100
|
/** This source's own headline, kept verbatim. */
|
|
88
101
|
readonly headline: string;
|
|
89
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Which change set the coverage section actually described.
|
|
105
|
+
*
|
|
106
|
+
* `pr_analysis` derives its own file list from `base...head` and takes none,
|
|
107
|
+
* deliberately. Three constituents therefore describe the files passed and one
|
|
108
|
+
* describes the branch's committed diff, and in a real run those were 2 files
|
|
109
|
+
* and 25. Both answers were right; presented side by side under one headline
|
|
110
|
+
* they read as one answer about one change.
|
|
111
|
+
*
|
|
112
|
+
* The disclosure explaining that has always been in the reply. It sat below a
|
|
113
|
+
* headline and a section total that both read as though they described the
|
|
114
|
+
* files passed, which is the wrong order for the most common working moment:
|
|
115
|
+
* before a commit, when the git-derived half can see none of the work.
|
|
116
|
+
*/
|
|
117
|
+
export interface PrePushCoverage {
|
|
118
|
+
/**
|
|
119
|
+
* What `pr_analysis` answered about: a ref-to-ref diff (`base...head`) when
|
|
120
|
+
* `base` was given, or the working tree (with its scope) when `workingTree`
|
|
121
|
+
* was given instead. Whichever it is, it is not necessarily the file list
|
|
122
|
+
* this tool itself was called with — see `filesOutsideDiff`.
|
|
123
|
+
*/
|
|
124
|
+
readonly describes: string;
|
|
125
|
+
/** Files passed that the base diff does not contain — whatever the reason. */
|
|
126
|
+
readonly filesOutsideDiff: readonly string[];
|
|
127
|
+
/**
|
|
128
|
+
* Of those, the ones git reports as modified, staged or untracked.
|
|
129
|
+
*
|
|
130
|
+
* Separated because "not in the diff" has two causes and only one is about
|
|
131
|
+
* timing: uncommitted work the developer can commit, versus a file they named
|
|
132
|
+
* that this branch never touched.
|
|
133
|
+
*/
|
|
134
|
+
readonly uncommitted: readonly string[];
|
|
135
|
+
}
|
|
90
136
|
export interface PrePushData {
|
|
91
137
|
readonly files: readonly string[];
|
|
92
138
|
readonly sections: readonly PrePushSection[];
|
|
93
139
|
/**
|
|
94
|
-
* Contract and environment
|
|
95
|
-
*
|
|
96
|
-
*
|
|
140
|
+
* Contract and environment findings that **assert a fault**.
|
|
141
|
+
*
|
|
142
|
+
* The doctrine that keeps `scope` and `pr_analysis` out of this number is the
|
|
143
|
+
* same one that keeps a lead out of it: a change with a large blast radius is
|
|
144
|
+
* not a broken change, and neither is a route no code in this graph calls.
|
|
145
|
+
* Both constituents already knew which of their findings claimed a fault —
|
|
146
|
+
* `validate` in a field, `contracts` in the prose of the finding itself — and
|
|
147
|
+
* this composite flattened them into one count a git hook exits on.
|
|
148
|
+
*
|
|
149
|
+
* "15 blocking findings" and "1 defect, 15 leads" are different sentences and
|
|
150
|
+
* only one is worth acting on. A check that cries wolf is worse than no
|
|
151
|
+
* check, because it also discredits the real findings underneath it.
|
|
97
152
|
*/
|
|
98
153
|
readonly blockingTotal: number;
|
|
99
|
-
/**
|
|
100
|
-
* Contract and environment **leads** — worth a look, never blocking. Kept
|
|
101
|
-
* under its own key rather than folded into `blockingTotal`, per this
|
|
102
|
-
* tool's own rule that a repo-wide or non-defect count never hides inside
|
|
103
|
-
* the number a hook branches on.
|
|
104
|
-
*/
|
|
154
|
+
/** Findings worth a look that assert nothing. Reported, never exited on. */
|
|
105
155
|
readonly leadTotal: number;
|
|
106
156
|
/** The node budget actually applied to the traversing constituents. */
|
|
107
157
|
readonly nodeBudget: number;
|
|
158
|
+
/**
|
|
159
|
+
* What the coverage section was about, when one ran.
|
|
160
|
+
*
|
|
161
|
+
* `null` when neither `base` nor `workingTree` was given: `pr_analysis` is
|
|
162
|
+
* skipped entirely then, and a caveat about a section that did not run is a
|
|
163
|
+
* caveat about nothing.
|
|
164
|
+
*/
|
|
165
|
+
readonly coverage: PrePushCoverage | null;
|
|
108
166
|
}
|
|
109
167
|
export declare const prePushTool: ToolDefinition;
|
|
110
168
|
//# sourceMappingURL=pre-push.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pre-push.d.ts","sourceRoot":"","sources":["../../src/tools/pre-push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"pre-push.d.ts","sourceRoot":"","sources":["../../src/tools/pre-push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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