@descryy/mcp 0.6.0 → 0.7.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/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 +59 -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 +4 -16
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +6 -20
- 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 +40 -194
- 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-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 +10 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -90
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +42 -11
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +74 -10
- 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 +37 -17
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +67 -259
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +69 -250
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +24 -118
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +44 -166
- 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 +15 -74
- 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 +33 -55
- 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 +257 -435
- 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 +24 -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 +68 -16
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +98 -35
- 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 +14 -57
- 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 +14 -69
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +23 -74
- 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 +30 -21
package/dist/tools/cross-pr.js
CHANGED
|
@@ -11,22 +11,20 @@
|
|
|
11
11
|
* | hidden dependency | 14.8 | `CHANGES_WITH` edges, already in the graph | **runs** |
|
|
12
12
|
* | overlap scoring | 14.3 | stored PR scopes | **runs, over whatever is stored** |
|
|
13
13
|
* | superseded | 14.5 | git blob ids at head and at base's tip | **runs** |
|
|
14
|
-
* | migration heads | 14.6 |
|
|
14
|
+
* | migration heads | 14.6 | base's and head's migration files, read directly from git | **runs** |
|
|
15
15
|
*
|
|
16
16
|
* §14.8 is first because it is the one that costs nothing: the edges already
|
|
17
17
|
* exist, it needs no per-PR storage, and it works at R0 in any language with no
|
|
18
18
|
* adapter beyond file paths. For a repository whose language has no adapter at
|
|
19
19
|
* all, this is the check that still fires.
|
|
20
20
|
*
|
|
21
|
-
* **Migration heads
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* input exists — the same "declared, never silently omitted" contract stays,
|
|
29
|
-
* it just stops applying to this check.
|
|
21
|
+
* **Migration heads answers the diff-precise question this section once said
|
|
22
|
+
* was out of scope for an MCP tool call** — `readMigrationsAcrossChange`
|
|
23
|
+
* (`sources/migrations/across-change.ts`) reads base's and head's migration
|
|
24
|
+
* files directly with `git ls-tree`/`git show`, so it needs no language
|
|
25
|
+
* adapter and no re-resolution of the graph against two commits. `ran` is
|
|
26
|
+
* false only when neither side has a migration format this producer
|
|
27
|
+
* recognises — never because a producer has not run yet.
|
|
30
28
|
*
|
|
31
29
|
* ## Why a check that still cannot run is declared rather than omitted
|
|
32
30
|
*
|
|
@@ -48,7 +46,7 @@
|
|
|
48
46
|
* actual conflict — that distinction is left to the migration-integrity
|
|
49
47
|
* checks in `validate`, which are provable from the graph alone.
|
|
50
48
|
*/
|
|
51
|
-
import { changedFiles,
|
|
49
|
+
import { changedFiles, findHiddenDependencies, findOverlaps, findSuperseded, nodesInFiles, readMigrationsAcrossChange, ScopeStore, supersededCandidates, } from "@descryy/core";
|
|
52
50
|
import { answer, briefNode, optionalInteger, optionalString, requiredString, } from "./kit.js";
|
|
53
51
|
import { capped } from "../capped.js";
|
|
54
52
|
const SCHEMA = {
|
|
@@ -71,16 +69,7 @@ const SCHEMA = {
|
|
|
71
69
|
* Named here rather than in prose so the reply carries them as data a caller
|
|
72
70
|
* can act on. Each says what would have to exist, not merely that it does not.
|
|
73
71
|
*/
|
|
74
|
-
const BLOCKED = [
|
|
75
|
-
{
|
|
76
|
-
check: "migration-heads",
|
|
77
|
-
section: "14.6",
|
|
78
|
-
question: "Would merging these changes leave more than one migration head?",
|
|
79
|
-
needs: "a producer emitting each migration's revision and declared parents. The check is " +
|
|
80
|
-
"framework-agnostic by design — a revision, its parents and which change adds it is the " +
|
|
81
|
-
"shape every migration tool has — so this is one adapter, not one per framework.",
|
|
82
|
-
},
|
|
83
|
-
];
|
|
72
|
+
const BLOCKED = [];
|
|
84
73
|
async function run(args, ctx) {
|
|
85
74
|
const base = requiredString(args, "base");
|
|
86
75
|
const head = optionalString(args, "head") ?? "HEAD";
|
|
@@ -98,33 +87,60 @@ async function run(args, ctx) {
|
|
|
98
87
|
// carve-out that lifts a name-level fact to A begins at R2.
|
|
99
88
|
nameLevel: true,
|
|
100
89
|
};
|
|
101
|
-
// §14.6 — independent of whether the diff
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
// this
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
// §14.6 — independent of whether the main diff below succeeds: it reads
|
|
91
|
+
// base's and head's migration files directly from git (`ls-tree`/`show`),
|
|
92
|
+
// not a comparison that needs the graph or the changed-file list. Computed
|
|
93
|
+
// once, up front, so both early-return paths below — a rejected range and a
|
|
94
|
+
// genuinely empty diff — still get a real answer rather than one about a
|
|
95
|
+
// question this check never asked.
|
|
96
|
+
ctx.progress("Reading migrations on both sides");
|
|
97
|
+
let migrations = null;
|
|
98
|
+
let migrationFailure = null;
|
|
99
|
+
try {
|
|
100
|
+
migrations = await readMigrationsAcrossChange(session.repoPath, base, head);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
// One check failing is not four checks failing. Recorded rather than
|
|
104
|
+
// thrown, and `ran: false` with a reason is what the caller reads.
|
|
105
|
+
migrationFailure = error.message.trim();
|
|
106
|
+
}
|
|
110
107
|
const migrationHeads = {
|
|
111
|
-
ran:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
ran: migrations?.report.analysed === true,
|
|
109
|
+
baseHead: migrations?.baseHead ?? null,
|
|
110
|
+
conflict: migrations?.report.conflict ?? null,
|
|
111
|
+
dependencies: migrations?.report.dependencies ?? [],
|
|
112
|
+
duplicateRevisions: migrations?.report.duplicateRevisions ?? [],
|
|
113
|
+
complete: migrations?.report.complete ?? false,
|
|
114
|
+
checked: migrations?.report.checked ?? {
|
|
115
|
+
changes: 0,
|
|
116
|
+
migrations: 0,
|
|
117
|
+
withUnknownParents: 0,
|
|
118
|
+
heads: 0,
|
|
119
|
+
},
|
|
120
|
+
refused: [
|
|
121
|
+
...(migrations?.base.refusals ?? []),
|
|
122
|
+
...(migrations?.change.refusals ?? []),
|
|
123
|
+
].map((r) => ({ file: r.file, reason: r.reason })),
|
|
124
|
+
misplaced: migrations?.misplaced ?? [],
|
|
122
125
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
const migrationHeadsNotes = [];
|
|
127
|
+
if (migrationFailure !== null) {
|
|
128
|
+
migrationHeadsNotes.push(`The migration head check could not read one of the two revisions: ${migrationFailure}. ` +
|
|
129
|
+
"That is a failure of this check, not a finding that the merge leaves one head.");
|
|
130
|
+
}
|
|
131
|
+
else if (migrations !== null) {
|
|
132
|
+
migrationHeadsNotes.push(...migrations.notes);
|
|
133
|
+
if (migrationHeads.misplaced.length > 0) {
|
|
134
|
+
migrationHeadsNotes.push(`${migrationHeads.misplaced.length} well-formed migration(s) are in a location no ` +
|
|
135
|
+
"migration tool looks at, so nothing will run them and they are not in the head " +
|
|
136
|
+
`computation: ${migrationHeads.misplaced.map((m) => m.file).join(", ")}.`);
|
|
137
|
+
}
|
|
138
|
+
if (!migrationHeads.ran) {
|
|
139
|
+
migrationHeadsNotes.push("No migration format this producer recognises was found on either side, so no head " +
|
|
140
|
+
"computation ran. Two of the four common families declare no DAG at all and cannot " +
|
|
141
|
+
"have this failure; a repository using one of them is not being told it is clean.");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
128
144
|
ctx.progress(`Diffing ${base}...${head}`, 1, 3);
|
|
129
145
|
let files;
|
|
130
146
|
try {
|
|
@@ -135,7 +151,7 @@ async function run(args, ctx) {
|
|
|
135
151
|
...envelope,
|
|
136
152
|
headline: `Could not diff ${base}...${head}.`,
|
|
137
153
|
state: "refused",
|
|
138
|
-
data: { blocked, migrationHeads },
|
|
154
|
+
data: { blocked: BLOCKED, migrationHeads },
|
|
139
155
|
notes: [
|
|
140
156
|
`git rejected the range: ${error.message.trim()}.`,
|
|
141
157
|
"No check ran, which is not a finding that this change collides with nothing.",
|
|
@@ -147,7 +163,7 @@ async function run(args, ctx) {
|
|
|
147
163
|
return answer({
|
|
148
164
|
...envelope,
|
|
149
165
|
headline: "The diff is empty.",
|
|
150
|
-
data: { changedFiles: 0, blocked, migrationHeads },
|
|
166
|
+
data: { changedFiles: 0, blocked: BLOCKED, migrationHeads },
|
|
151
167
|
notes: ["An empty diff is a real answer: there is nothing to collide with.", ...migrationHeadsNotes],
|
|
152
168
|
});
|
|
153
169
|
}
|
|
@@ -194,15 +210,15 @@ async function run(args, ctx) {
|
|
|
194
210
|
notes.push(`${remainingCap.detail.total - remainingCap.detail.shown} further file(s) not yet matched to ` +
|
|
195
211
|
`base are not listed — the reply is capped at ${limit}. Raise "limit" to see them.`);
|
|
196
212
|
}
|
|
197
|
-
if (
|
|
198
|
-
notes.push(`${
|
|
199
|
-
`input yet: ${
|
|
213
|
+
if (BLOCKED.length > 0) {
|
|
214
|
+
notes.push(`${BLOCKED.length} of the four multi-PR checks did not run because nothing produces their ` +
|
|
215
|
+
`input yet: ${BLOCKED.map((b) => b.check).join(", ")}. Each is listed in "blocked" with ` +
|
|
200
216
|
"what it is waiting for. Their absence is not a clean result.");
|
|
201
217
|
}
|
|
202
218
|
// `refused` only when NOTHING looked at anything. One check producing a
|
|
203
219
|
// real answer is a real answer, and burying it behind a caveat about a
|
|
204
220
|
// different question is what `contracts.ts` refuses for the same reason.
|
|
205
|
-
const anythingRan = hidden.data.analysed || scopes.length >= 2 || superseded.analysed ||
|
|
221
|
+
const anythingRan = hidden.data.analysed || scopes.length >= 2 || superseded.analysed || migrationHeads.ran;
|
|
206
222
|
// B8 (part 2) — `truncated` used to forward only `hidden.truncated`, so
|
|
207
223
|
// capping in `overlaps` or in `remaining` (above) went undisclosed on the
|
|
208
224
|
// wire even when the prose said so. Three checks can each independently
|
|
@@ -257,8 +273,8 @@ async function run(args, ctx) {
|
|
|
257
273
|
disclosure: superseded.disclosure,
|
|
258
274
|
remaining: remainingCap.shown,
|
|
259
275
|
},
|
|
260
|
-
blocked,
|
|
261
276
|
migrationHeads,
|
|
277
|
+
blocked: BLOCKED,
|
|
262
278
|
},
|
|
263
279
|
stamp: hidden.stamp,
|
|
264
280
|
truncated: anyCheckTruncated,
|
|
@@ -273,8 +289,11 @@ async function run(args, ctx) {
|
|
|
273
289
|
? `${verdict}. ${hidden.data.findings.length} historically coupled file(s) were not touched; ` +
|
|
274
290
|
`${overlaps.findings.length} overlapping change pair(s) scored above the conflict ` +
|
|
275
291
|
`threshold; ${superseded.superseded ? "this change's work is already on base" : `${superseded.counts.alreadyInBase} of ${superseded.counts.total} touched file(s) already match base`}; ` +
|
|
276
|
-
`${
|
|
277
|
-
|
|
292
|
+
`${!migrationHeads.ran
|
|
293
|
+
? "no migration DAG was read"
|
|
294
|
+
: migrationHeads.conflict === null
|
|
295
|
+
? `the merge leaves ${migrationHeads.checked.heads} migration head`
|
|
296
|
+
: "the merge would leave more than one migration head"}; ${BLOCKED.length} of four checks could not run.`
|
|
278
297
|
: "No multi-PR check was able to run on this change. That is a statement about the " +
|
|
279
298
|
"evidence available, not about the change.",
|
|
280
299
|
};
|
|
@@ -288,13 +307,13 @@ export const crossPrTool = {
|
|
|
288
307
|
description: "What this change collides with that reading its diff alone would not show: files it " +
|
|
289
308
|
"historically moves with and did not touch this time (§14.8), other in-flight changes " +
|
|
290
309
|
"editing the same important nodes (§14.3), whether the work is already on base by another " +
|
|
291
|
-
"route (§14.5), and whether
|
|
292
|
-
"(§14.6,
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"
|
|
296
|
-
"
|
|
297
|
-
"silently omitted.",
|
|
310
|
+
"route (§14.5), and whether merging it would leave the migration runner with more than one " +
|
|
311
|
+
"head (§14.6, computed over base's migrations and this change's together, read directly from " +
|
|
312
|
+
"git — no language adapter needed). Findings are Class C hints about how people edit this " +
|
|
313
|
+
"repository, never claims about what breaks; a migration-head fork is reported the same way, " +
|
|
314
|
+
"because this check cannot yet tell a legitimate merge-in-progress from a real conflict. Any " +
|
|
315
|
+
"check whose input no producer writes is declared in \"blocked\" with what it is waiting for " +
|
|
316
|
+
"rather than silently omitted.",
|
|
298
317
|
inputSchema: SCHEMA,
|
|
299
318
|
run,
|
|
300
319
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-pr.js","sourceRoot":"","sources":["../../src/tools/cross-pr.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cross-pr.js","sourceRoot":"","sources":["../../src/tools/cross-pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,0BAA0B,EAC1B,UAAU,EACV,oBAAoB,GACrB,MAAM,eAAe,CAAC;A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AAS,EAAE,IAAI;QACf,QAAQ,EAAE,WAAW;YACnB,CAAC,CAAC,GAAG,OAAO,KAAK,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,kDAAkD;gBAC5F,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,wDAAwD;gBACnF,cAAc,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,aAAa,OAAO,UAAU,CAAC,MAAM,CAAC,KAAK,qCAAqC,IAAI;gBACzL,GACE,CAAC,cAAc,CAAC,GAAG;oBACjB,CAAC,CAAC,2BAA2B;oBAC7B,CAAC,CAAC,cAAc,CAAC,QAAQ,KAAK,IAAI;wBAChC,CAAC,CAAC,oBAAoB,cAAc,CAAC,OAAO,CAAC,KAAK,iBAAiB;wBACnE,CAAC,CAAC,oDACR,KAAK,OAAO,CAAC,MAAM,gCAAgC;YACrD,CAAC,CAAC,kFAAkF;gBAClF,2CAA2C;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,sFAAsF;QACtF,uFAAuF;QACvF,2FAA2F;QAC3F,4FAA4F;QAC5F,8FAA8F;QAC9F,2FAA2F;QAC3F,8FAA8F;QAC9F,8FAA8F;QAC9F,8FAA8F;QAC9F,+BAA+B;IACjC,WAAW,EAAE,MAAM;IACnB,GAAG;CACJ,CAAC"}
|
package/dist/tools/git-diff.d.ts
CHANGED
|
@@ -19,8 +19,24 @@ export type GitDiffEntry = GitDiffFile;
|
|
|
19
19
|
* `disclosures` are what tell them apart, not the payload's shape.
|
|
20
20
|
*/
|
|
21
21
|
export interface GitDiffData {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Which question was answered — declared by the caller, never inferred.
|
|
24
|
+
*
|
|
25
|
+
* `range` compares two refs. `working-tree` reports what is uncommitted right
|
|
26
|
+
* now. They are different questions and a reply that did not say which one it
|
|
27
|
+
* answered would be readable as either.
|
|
28
|
+
*/
|
|
29
|
+
readonly mode: "range" | "working-tree";
|
|
30
|
+
/** Null in working-tree mode: there is no second ref to compare against. */
|
|
31
|
+
readonly base: string | null;
|
|
32
|
+
readonly head: string | null;
|
|
33
|
+
/** Present in working-tree mode only. */
|
|
34
|
+
readonly workingTree?: {
|
|
35
|
+
readonly scope: "unstaged" | "staged" | "all";
|
|
36
|
+
readonly includeUntracked: boolean;
|
|
37
|
+
readonly untrackedTotal: number;
|
|
38
|
+
readonly untrackedTruncated: boolean;
|
|
39
|
+
};
|
|
24
40
|
/** Capped by `limit`; `filesTotal` is the uncapped count. Empty on a git failure. */
|
|
25
41
|
readonly files: readonly GitDiffEntry[];
|
|
26
42
|
readonly filesTotal: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../src/tools/git-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../src/tools/git-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AA4FlB,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC;IACxC,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;QAC9C,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;QAChC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;KACtC,CAAC;IACF,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAgRD,eAAO,MAAM,WAAW,EAAE,cAsBzB,CAAC"}
|
package/dist/tools/git-diff.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* plus the unified-diff patch text when it is cheap enough to hand to a
|
|
10
10
|
* model (§4: the client's context window is not this tool's to spend).
|
|
11
11
|
*/
|
|
12
|
-
import { applyReplySizeBudget, changedFiles, gitDiff, TOTAL_PATCH_BUDGET_REASON_PREFIX } from "@descryy/core";
|
|
13
|
-
import { answer, optionalInteger, optionalString,
|
|
12
|
+
import { applyReplySizeBudget, changedFiles, gitDiff, gitWorkingTreeChange, TOTAL_PATCH_BUDGET_REASON_PREFIX, } from "@descryy/core";
|
|
13
|
+
import { answer, optionalInteger, descryOwnState, optionalString, ToolInputError, optionalStringArray, } from "./kit.js";
|
|
14
14
|
const DEFAULT_LIMIT = 200;
|
|
15
15
|
/**
|
|
16
16
|
* The stable prefix of `patchOmittedReason` when the *reply's* size ceiling,
|
|
@@ -37,8 +37,8 @@ function fileBytes(file) {
|
|
|
37
37
|
* happened, so the caller re-requests narrowed instead of reading a short list
|
|
38
38
|
* as the whole diff.
|
|
39
39
|
*/
|
|
40
|
-
function fitDiff(
|
|
41
|
-
const scaffold = Buffer.byteLength(JSON.stringify({
|
|
40
|
+
function fitDiff(identity, shown, filesTotal, budgetBytes) {
|
|
41
|
+
const scaffold = Buffer.byteLength(JSON.stringify({ ...identity, files: [], filesTotal }), "utf8");
|
|
42
42
|
const fitted = applyReplySizeBudget(shown, {
|
|
43
43
|
maxTotalBytes: budgetBytes,
|
|
44
44
|
overheadBytes: scaffold,
|
|
@@ -68,7 +68,7 @@ function fitDiff(base, head, shown, filesTotal, budgetBytes) {
|
|
|
68
68
|
'"files" to see them.');
|
|
69
69
|
}
|
|
70
70
|
return {
|
|
71
|
-
data: {
|
|
71
|
+
data: { ...identity, files: fitted.items, filesTotal },
|
|
72
72
|
notes,
|
|
73
73
|
...(fitted.droppedCount > 0
|
|
74
74
|
? {
|
|
@@ -86,8 +86,22 @@ const SCHEMA = {
|
|
|
86
86
|
properties: {
|
|
87
87
|
base: {
|
|
88
88
|
type: "string",
|
|
89
|
-
description: "The ref to diff against. Required
|
|
90
|
-
"silently changes which diff the answer describes.",
|
|
89
|
+
description: "The ref to diff against. Required unless \"workingTree\" is given — there is no " +
|
|
90
|
+
"defensible default, and guessing one silently changes which diff the answer describes.",
|
|
91
|
+
},
|
|
92
|
+
workingTree: {
|
|
93
|
+
type: "string",
|
|
94
|
+
enum: ["unstaged", "staged", "all"],
|
|
95
|
+
description: "Diff uncommitted state instead of two refs. \"unstaged\" is the working tree against " +
|
|
96
|
+
"the index, \"staged\" the index against HEAD, \"all\" everything not yet committed. " +
|
|
97
|
+
"Mutually exclusive with \"base\", and never inferred: a working tree and a ref range " +
|
|
98
|
+
"answer different questions, so the caller declares which one they are asking.",
|
|
99
|
+
},
|
|
100
|
+
includeUntracked: {
|
|
101
|
+
type: "boolean",
|
|
102
|
+
description: "With \"workingTree\", also report files git has never seen, as new-file patches. On " +
|
|
103
|
+
"by default, because they are part of the change about to be committed. Pass false to " +
|
|
104
|
+
"restrict the answer to files git already tracks; the narrowing is stated in the reply.",
|
|
91
105
|
},
|
|
92
106
|
head: { type: "string", description: "The tip being diffed. Default HEAD." },
|
|
93
107
|
files: {
|
|
@@ -113,12 +127,32 @@ const SCHEMA = {
|
|
|
113
127
|
},
|
|
114
128
|
limit: { type: "integer", minimum: 1, description: "Cap on files in the reply. Default 200." },
|
|
115
129
|
},
|
|
116
|
-
required: ["base"],
|
|
117
130
|
additionalProperties: false,
|
|
118
131
|
};
|
|
119
132
|
async function run(args, ctx) {
|
|
120
|
-
const
|
|
121
|
-
|
|
133
|
+
const workingTree = optionalString(args, "workingTree");
|
|
134
|
+
// Defaults **on**, unlike the core primitive it calls. That one is a library
|
|
135
|
+
// function whose existing callers must not change behaviour by upgrading;
|
|
136
|
+
// this is the product surface, and a caller who asks for "the working tree"
|
|
137
|
+
// and is not shown the file they just created has been answered about
|
|
138
|
+
// something narrower than they asked for.
|
|
139
|
+
const includeUntracked = args["includeUntracked"] !== false;
|
|
140
|
+
const baseArg = optionalString(args, "base");
|
|
141
|
+
if (workingTree === undefined && baseArg === undefined) {
|
|
142
|
+
// The rule survives the new mode rather than being relaxed by it: one of
|
|
143
|
+
// the two questions has to be chosen, and neither has a defensible default.
|
|
144
|
+
throw new ToolInputError('Give either "base" (a ref range) or "workingTree" (uncommitted state). There is no ' +
|
|
145
|
+
"defensible default, and guessing one silently changes which diff the answer describes.");
|
|
146
|
+
}
|
|
147
|
+
if (workingTree !== undefined && baseArg !== undefined) {
|
|
148
|
+
throw new ToolInputError('"base" and "workingTree" are mutually exclusive — they are two different questions. ' +
|
|
149
|
+
"Ask one.");
|
|
150
|
+
}
|
|
151
|
+
if (workingTree !== undefined && !["unstaged", "staged", "all"].includes(workingTree)) {
|
|
152
|
+
throw new ToolInputError(`"workingTree" must be "unstaged", "staged" or "all" — got "${workingTree}".`);
|
|
153
|
+
}
|
|
154
|
+
const base = baseArg ?? null;
|
|
155
|
+
const head = base === null ? null : optionalString(args, "head") ?? "HEAD";
|
|
122
156
|
const files = optionalStringArray(args, "files");
|
|
123
157
|
const maxPatchBytes = optionalInteger(args, "maxPatchBytes", 1);
|
|
124
158
|
const maxTotalPatchBytes = optionalInteger(args, "maxTotalPatchBytes", 1);
|
|
@@ -135,23 +169,52 @@ async function run(args, ctx) {
|
|
|
135
169
|
// the diff, not a claim about program shape.
|
|
136
170
|
nameLevel: true,
|
|
137
171
|
};
|
|
138
|
-
|
|
172
|
+
const scope = (workingTree ?? "all");
|
|
173
|
+
const subject = base === null ? `the working tree (${scope})` : `${base}...${head}`;
|
|
174
|
+
const mode = base === null ? "working-tree" : "range";
|
|
175
|
+
ctx.progress(`Diffing ${subject}`);
|
|
139
176
|
let all;
|
|
177
|
+
let untrackedTotal = 0;
|
|
178
|
+
let untrackedTruncated = false;
|
|
140
179
|
try {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
180
|
+
if (base === null) {
|
|
181
|
+
const change = await gitWorkingTreeChange(session.repoPath, {
|
|
182
|
+
scope,
|
|
183
|
+
includeUntracked,
|
|
184
|
+
exclude: descryOwnState(session.config.graph),
|
|
185
|
+
...(files === undefined ? {} : { files }),
|
|
186
|
+
...(maxPatchBytes === undefined ? {} : { maxPatchBytes }),
|
|
187
|
+
...(maxTotalPatchBytes === undefined ? {} : { maxTotalPatchBytes }),
|
|
188
|
+
});
|
|
189
|
+
all = change.files;
|
|
190
|
+
untrackedTotal = change.untrackedTotal;
|
|
191
|
+
untrackedTruncated = change.untrackedTruncated;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
all = await gitDiff(session.repoPath, base, head, {
|
|
195
|
+
...(files === undefined ? {} : { files }),
|
|
196
|
+
...(maxPatchBytes === undefined ? {} : { maxPatchBytes }),
|
|
197
|
+
...(maxTotalPatchBytes === undefined ? {} : { maxTotalPatchBytes }),
|
|
198
|
+
});
|
|
199
|
+
}
|
|
146
200
|
}
|
|
147
201
|
catch (error) {
|
|
148
202
|
return answer({
|
|
149
203
|
...envelope,
|
|
150
|
-
headline: `Could not diff ${
|
|
204
|
+
headline: `Could not diff ${subject}.`,
|
|
151
205
|
state: "refused",
|
|
152
|
-
data: {
|
|
206
|
+
data: {
|
|
207
|
+
mode,
|
|
208
|
+
base,
|
|
209
|
+
head,
|
|
210
|
+
files: [],
|
|
211
|
+
filesTotal: 0,
|
|
212
|
+
...(base === null
|
|
213
|
+
? { workingTree: { scope, includeUntracked, untrackedTotal: 0, untrackedTruncated: false } }
|
|
214
|
+
: {}),
|
|
215
|
+
},
|
|
153
216
|
notes: [
|
|
154
|
-
`git rejected
|
|
217
|
+
`git rejected it: ${error.message.trim()}.`,
|
|
155
218
|
"No diff was read, which is not a finding that nothing changed.",
|
|
156
219
|
],
|
|
157
220
|
});
|
|
@@ -166,9 +229,11 @@ async function run(args, ctx) {
|
|
|
166
229
|
// matched nothing. Checked against the unfiltered file list — cheap,
|
|
167
230
|
// name-only, no patch content — so a real empty diff is not confused with
|
|
168
231
|
// one that has changes the named files simply do not include.
|
|
232
|
+
// Range mode only: working-tree mode has no second ref to re-diff without
|
|
233
|
+
// "files", and `changedFiles` needs both.
|
|
169
234
|
let filesMatchedNothing = false;
|
|
170
235
|
let wholeDiffCount = 0;
|
|
171
|
-
if (all.length === 0 && files !== undefined && files.length > 0) {
|
|
236
|
+
if (base !== null && all.length === 0 && files !== undefined && files.length > 0) {
|
|
172
237
|
ctx.progress(`Checking whether ${base}...${head} has any changes at all`);
|
|
173
238
|
const wholeDiff = await changedFiles(session.repoPath, base, head).catch(() => null);
|
|
174
239
|
if (wholeDiff !== null && wholeDiff.length > 0) {
|
|
@@ -179,7 +244,7 @@ async function run(args, ctx) {
|
|
|
179
244
|
const shown = all.slice(0, limit);
|
|
180
245
|
const notes = [];
|
|
181
246
|
if (filesMatchedNothing) {
|
|
182
|
-
notes.push(`0 of the ${(files ?? []).length} named file(s) have any change in ${
|
|
247
|
+
notes.push(`0 of the ${(files ?? []).length} named file(s) have any change in ${subject}, which ` +
|
|
183
248
|
`changes ${wholeDiffCount} file(s) in total when read without "files". This is not a ` +
|
|
184
249
|
"statement that the diff itself is empty.");
|
|
185
250
|
}
|
|
@@ -201,23 +266,50 @@ async function run(args, ctx) {
|
|
|
201
266
|
'own size — their stats above are complete. Re-request them with a narrowed "files" to ' +
|
|
202
267
|
"read their patches.");
|
|
203
268
|
}
|
|
269
|
+
if (base === null && !includeUntracked) {
|
|
270
|
+
// The half not looked at, named. A working-tree answer that quietly omitted
|
|
271
|
+
// every never-added file would read as "nothing new here" on exactly the
|
|
272
|
+
// change that is most often entirely new files.
|
|
273
|
+
notes.push("Untracked files were not included — no form of git diff reports them, so a file written " +
|
|
274
|
+
'and not yet added is absent from this answer. Pass "includeUntracked" to see them.');
|
|
275
|
+
}
|
|
276
|
+
if (untrackedTruncated) {
|
|
277
|
+
notes.push(`${untrackedTotal} untracked file(s) exist and only some were diffed. The rest were counted, ` +
|
|
278
|
+
"not examined.");
|
|
279
|
+
}
|
|
204
280
|
return answer({
|
|
205
281
|
...envelope,
|
|
206
282
|
headline: all.length === 0
|
|
207
283
|
? filesMatchedNothing
|
|
208
|
-
? `0 of the ${(files ?? []).length} named file(s) have any change in ${
|
|
284
|
+
? `0 of the ${(files ?? []).length} named file(s) have any change in ${subject}. ` +
|
|
209
285
|
"Not empty, not checked for those files."
|
|
210
|
-
: `${
|
|
211
|
-
: `${
|
|
286
|
+
: `${subject} has no changes.`
|
|
287
|
+
: `${subject} changes ${all.length} file(s)` +
|
|
212
288
|
(shown.length < all.length ? `, showing the first ${shown.length}.` : "."),
|
|
213
289
|
...(all.length === 0 ? { state: "empty" } : {}),
|
|
214
|
-
data: {
|
|
290
|
+
data: {
|
|
291
|
+
mode,
|
|
292
|
+
base,
|
|
293
|
+
head,
|
|
294
|
+
files: shown,
|
|
295
|
+
filesTotal: all.length,
|
|
296
|
+
...(base === null
|
|
297
|
+
? { workingTree: { scope, includeUntracked, untrackedTotal, untrackedTruncated } }
|
|
298
|
+
: {}),
|
|
299
|
+
},
|
|
215
300
|
truncated: shown.length < all.length,
|
|
216
301
|
...(shown.length < all.length
|
|
217
302
|
? { truncatedDetail: { shown: shown.length, total: all.length, more: null } }
|
|
218
303
|
: {}),
|
|
219
304
|
notes,
|
|
220
|
-
fitToBudget: (budgetBytes) => fitDiff(
|
|
305
|
+
fitToBudget: (budgetBytes) => fitDiff({
|
|
306
|
+
mode,
|
|
307
|
+
base,
|
|
308
|
+
head,
|
|
309
|
+
...(base === null
|
|
310
|
+
? { workingTree: { scope, includeUntracked, untrackedTotal, untrackedTruncated } }
|
|
311
|
+
: {}),
|
|
312
|
+
}, shown, all.length, budgetBytes),
|
|
221
313
|
});
|
|
222
314
|
}
|
|
223
315
|
export const gitDiffTool = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-diff.js","sourceRoot":"","sources":["../../src/tools/git-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"git-diff.js","sourceRoot":"","sources":["../../src/tools/git-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,OAAO,EACP,oBAAoB,EACpB,gCAAgC,GACjC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,MAAM,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GAGpB,MAAM,UAAU,CAAC;AAGlB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,0BAA0B,GAAG,kCAAkC,CAAC;AAEtE,sFAAsF;AACtF,SAAS,SAAS,CAAC,IAAkB;IACnC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,OAAO,CACd,QAAqE,EACrE,KAA8B,EAC9B,UAAkB,EAClB,WAAmB;IAEnB,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAChC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,QAAQ,EAAE,KAA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,EAAE,kBAAkB,EAAE,EAAE;gBAClF,CAAC,CAAC,EAAE,CAAC;SACR,EACD,KAAK,EACL,GAAG,CAAC,MAAM,EACV,WAAW,CACZ;KACJ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,UAAU;IAChB,wEAAwE;IACxE,2EAA2E;IAC3E,0EAA0E;IAC1E,2EAA2E;IAC3E,8DAA8D;IAC9D,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,oCAAoC;IAC3C,WAAW,EACT,uFAAuF;QACvF,8FAA8F;QAC9F,2FAA2F;QAC3F,+FAA+F;QAC/F,4FAA4F;QAC5F,8FAA8F;QAC9F,4FAA4F;QAC5F,oEAAoE;IACtE,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `history.ts`'s own `history` tool answers a different question — "which
|
|
6
|
-
* files does this one tend to change alongside", from the graph's stored
|
|
7
|
-
* `CHANGES_WITH` ledger, built once at `analyze` time. This tool answers
|
|
8
|
-
* "what commits touched this file" — a live `git log --follow`, with no
|
|
9
|
-
* graph involved and no staleness relative to the last `analyze` run.
|
|
10
|
-
*/
|
|
1
|
+
/** `get_git_history`, §18. Live `git log --follow` for one file — no graph, no staleness. Distinct
|
|
2
|
+
* from `history`'s stored `CHANGES_WITH` co-change ledger (built once at `analyze` time); this
|
|
3
|
+
* reads the working repository directly. */
|
|
11
4
|
import type { PathLogCommit } from "@descryy/core";
|
|
12
5
|
import { type ToolDefinition } from "./kit.ts";
|
|
13
6
|
export type GitHistoryCommit = PathLogCommit;
|
|
@@ -15,12 +8,8 @@ export interface GitHistoryData {
|
|
|
15
8
|
readonly file: string;
|
|
16
9
|
/** Capped by `maxCommits`, newest-first. */
|
|
17
10
|
readonly commits: readonly GitHistoryCommit[];
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* cheap `git log` count, not `commits.length`. Lets a caller tell "here
|
|
21
|
-
* are the 20 most recent" from "here are all 3 there are" without
|
|
22
|
-
* guessing from the cap.
|
|
23
|
-
*/
|
|
11
|
+
/** Every commit touching this file, independent of `maxCommits` — a separate count, not
|
|
12
|
+
* `commits.length`, so a caller can tell "20 most recent" from "all 3 there are". */
|
|
24
13
|
readonly totalTouching: number;
|
|
25
14
|
}
|
|
26
15
|
export declare const gitHistoryTool: ToolDefinition;
|