@descryy/mcp 0.1.2 → 0.3.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/bin/descry-mcp.js +30 -2
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +236 -0
- package/dist/browser/driver.d.ts.map +1 -0
- package/dist/browser/driver.js +70 -0
- package/dist/browser/driver.js.map +1 -0
- package/dist/browser/evidence.d.ts +47 -0
- package/dist/browser/evidence.d.ts.map +1 -0
- package/dist/browser/evidence.js +55 -0
- package/dist/browser/evidence.js.map +1 -0
- package/dist/browser/fake-driver.d.ts +58 -0
- package/dist/browser/fake-driver.d.ts.map +1 -0
- package/dist/browser/fake-driver.js +161 -0
- package/dist/browser/fake-driver.js.map +1 -0
- package/dist/browser/graph-write.d.ts +86 -0
- package/dist/browser/graph-write.d.ts.map +1 -0
- package/dist/browser/graph-write.js +135 -0
- package/dist/browser/graph-write.js.map +1 -0
- package/dist/browser/playwright-driver.d.ts +65 -0
- package/dist/browser/playwright-driver.d.ts.map +1 -0
- package/dist/browser/playwright-driver.js +359 -0
- package/dist/browser/playwright-driver.js.map +1 -0
- package/dist/browser/provider.d.ts +49 -0
- package/dist/browser/provider.d.ts.map +1 -0
- package/dist/browser/provider.js +28 -0
- package/dist/browser/provider.js.map +1 -0
- package/dist/browser/registry.d.ts +182 -0
- package/dist/browser/registry.d.ts.map +1 -0
- package/dist/browser/registry.js +215 -0
- package/dist/browser/registry.js.map +1 -0
- package/dist/browser/scenario-resolve.d.ts +62 -0
- package/dist/browser/scenario-resolve.d.ts.map +1 -0
- package/dist/browser/scenario-resolve.js +127 -0
- package/dist/browser/scenario-resolve.js.map +1 -0
- package/dist/browser/scenario-runner.d.ts +113 -0
- package/dist/browser/scenario-runner.d.ts.map +1 -0
- package/dist/browser/scenario-runner.js +315 -0
- package/dist/browser/scenario-runner.js.map +1 -0
- package/dist/browser/stack-parser.d.ts +43 -0
- package/dist/browser/stack-parser.d.ts.map +1 -0
- package/dist/browser/stack-parser.js +112 -0
- package/dist/browser/stack-parser.js.map +1 -0
- package/dist/browser/tool-support.d.ts +113 -0
- package/dist/browser/tool-support.d.ts.map +1 -0
- package/dist/browser/tool-support.js +181 -0
- package/dist/browser/tool-support.js.map +1 -0
- package/dist/disclosure-ledger.d.ts +38 -0
- package/dist/disclosure-ledger.d.ts.map +1 -0
- package/dist/disclosure-ledger.js +40 -0
- package/dist/disclosure-ledger.js.map +1 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +12 -3
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +12 -3
- package/dist/protocol.js.map +1 -1
- package/dist/render.d.ts +121 -10
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +96 -15
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +63 -0
- package/dist/runtime-registry.d.ts.map +1 -0
- package/dist/runtime-registry.js +131 -0
- package/dist/runtime-registry.js.map +1 -0
- package/dist/scenarios/index.d.ts +4 -0
- package/dist/scenarios/index.d.ts.map +1 -0
- package/dist/scenarios/index.js +4 -0
- package/dist/scenarios/index.js.map +1 -0
- package/dist/scenarios/parse.d.ts +32 -0
- package/dist/scenarios/parse.d.ts.map +1 -0
- package/dist/scenarios/parse.js +199 -0
- package/dist/scenarios/parse.js.map +1 -0
- package/dist/scenarios/scenario.d.ts +115 -0
- package/dist/scenarios/scenario.d.ts.map +1 -0
- package/dist/scenarios/scenario.js +41 -0
- package/dist/scenarios/scenario.js.map +1 -0
- package/dist/scenarios/storage.d.ts +51 -0
- package/dist/scenarios/storage.d.ts.map +1 -0
- package/dist/scenarios/storage.js +93 -0
- package/dist/scenarios/storage.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +11 -3
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +142 -2
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +266 -4
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +41 -1
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +111 -9
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +36 -0
- package/dist/tools/browser-click.d.ts.map +1 -0
- package/dist/tools/browser-click.js +117 -0
- package/dist/tools/browser-click.js.map +1 -0
- package/dist/tools/browser-close-session.d.ts +24 -0
- package/dist/tools/browser-close-session.d.ts.map +1 -0
- package/dist/tools/browser-close-session.js +63 -0
- package/dist/tools/browser-close-session.js.map +1 -0
- package/dist/tools/browser-fill.d.ts +49 -0
- package/dist/tools/browser-fill.d.ts.map +1 -0
- package/dist/tools/browser-fill.js +138 -0
- package/dist/tools/browser-fill.js.map +1 -0
- package/dist/tools/browser-navigate.d.ts +32 -0
- package/dist/tools/browser-navigate.d.ts.map +1 -0
- package/dist/tools/browser-navigate.js +103 -0
- package/dist/tools/browser-navigate.js.map +1 -0
- package/dist/tools/browser-run-scenario.d.ts +54 -0
- package/dist/tools/browser-run-scenario.d.ts.map +1 -0
- package/dist/tools/browser-run-scenario.js +228 -0
- package/dist/tools/browser-run-scenario.js.map +1 -0
- package/dist/tools/browser-save-scenario.d.ts +44 -0
- package/dist/tools/browser-save-scenario.d.ts.map +1 -0
- package/dist/tools/browser-save-scenario.js +298 -0
- package/dist/tools/browser-save-scenario.js.map +1 -0
- package/dist/tools/browser-snapshot.d.ts +60 -0
- package/dist/tools/browser-snapshot.d.ts.map +1 -0
- package/dist/tools/browser-snapshot.js +139 -0
- package/dist/tools/browser-snapshot.js.map +1 -0
- package/dist/tools/browser-start-session.d.ts +43 -0
- package/dist/tools/browser-start-session.d.ts.map +1 -0
- package/dist/tools/browser-start-session.js +272 -0
- package/dist/tools/browser-start-session.js.map +1 -0
- package/dist/tools/browser-type.d.ts +48 -0
- package/dist/tools/browser-type.d.ts.map +1 -0
- package/dist/tools/browser-type.js +136 -0
- package/dist/tools/browser-type.js.map +1 -0
- package/dist/tools/contracts.d.ts +15 -0
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +14 -3
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +1 -0
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +104 -4
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +1 -0
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.js +1 -1
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +9 -0
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +4 -4
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +12 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +11 -1
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +3 -0
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +13 -1
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +69 -0
- package/dist/tools/mark-incident.d.ts.map +1 -0
- package/dist/tools/mark-incident.js +212 -0
- package/dist/tools/mark-incident.js.map +1 -0
- package/dist/tools/observe-runtime.d.ts +292 -0
- package/dist/tools/observe-runtime.d.ts.map +1 -0
- package/dist/tools/observe-runtime.js +1192 -0
- package/dist/tools/observe-runtime.js.map +1 -0
- package/dist/tools/observe-tests.d.ts +125 -0
- package/dist/tools/observe-tests.d.ts.map +1 -0
- package/dist/tools/observe-tests.js +313 -0
- package/dist/tools/observe-tests.js.map +1 -0
- package/dist/tools/pr-analysis.d.ts +71 -13
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +55 -12
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +77 -0
- package/dist/tools/pre-push.d.ts.map +1 -0
- package/dist/tools/pre-push.js +250 -0
- package/dist/tools/pre-push.js.map +1 -0
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +1 -0
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +101 -14
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +1 -0
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +92 -0
- package/dist/tools/runtime-incident.d.ts.map +1 -0
- package/dist/tools/runtime-incident.js +144 -0
- package/dist/tools/runtime-incident.js.map +1 -0
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +1 -0
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +13 -0
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +22 -8
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/verification-status.d.ts +22 -0
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +52 -5
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +5 -0
- package/dist/tools/verify-claim.js.map +1 -1
- package/package.json +16 -4
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `browser_start_session` — open a real browser against the developer's app.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this one is the gate
|
|
5
|
+
*
|
|
6
|
+
* `DEC-380` puts consent here and nowhere
|
|
7
|
+
* else. This is the call where a target URL is named, so it is the only call
|
|
8
|
+
* where the fact a developer actually approves — *Descry may drive a browser
|
|
9
|
+
* against this application* — can be stated. A per-click confirmation would
|
|
10
|
+
* describe "click ref-14", which is a string the caller supplied one call
|
|
11
|
+
* earlier and can neither evaluate nor be surprised by, and it would train
|
|
12
|
+
* callers to confirm reflexively.
|
|
13
|
+
*
|
|
14
|
+
* The grant is bound to this URL's **origin**. `browser_navigate` refuses to
|
|
15
|
+
* leave it. Without that bound, "drive my local app" would silently become
|
|
16
|
+
* "drive anything".
|
|
17
|
+
*
|
|
18
|
+
* ## Class
|
|
19
|
+
*
|
|
20
|
+
* `action`, unambiguously: this launches a process and points it at a running
|
|
21
|
+
* application. It is the only browser tool that mints a token; the verbs it
|
|
22
|
+
* consents for redeem nothing, because the session they run in has already
|
|
23
|
+
* been confirmed.
|
|
24
|
+
*/
|
|
25
|
+
import { browserAnswer, emptyEvidence, observeAndCorrelate } from "../browser/tool-support.js";
|
|
26
|
+
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
27
|
+
import { isAbsolute, join } from "node:path";
|
|
28
|
+
import { loadStackParser, StackParserLoadError } from "../browser/stack-parser.js";
|
|
29
|
+
import { optionalBoolean, optionalEnum, optionalString, requiredString, ToolInputError } from "./kit.js";
|
|
30
|
+
const SCHEMA = {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
targetUrl: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "REQUIRED. The URL to open, including scheme and port — \"http://localhost:3000/invoices\". " +
|
|
36
|
+
"This is also what consent is granted for: the browser may be driven anywhere on this URL's " +
|
|
37
|
+
"origin for the life of the session, and navigating off it refuses rather than asking again.",
|
|
38
|
+
},
|
|
39
|
+
headless: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
description: "Run without a visible window. Defaults to true; pass false to watch it happen.",
|
|
42
|
+
},
|
|
43
|
+
stackParser: {
|
|
44
|
+
type: "object",
|
|
45
|
+
description: "The module that can parse this application's stack traces, named the way observe_runtime names a " +
|
|
46
|
+
"runtime adapter. Without one, requests are still observed and the endpoints they reached are still " +
|
|
47
|
+
"named, but NO frontend→backend caller edge is written — a parsed call site is what the confirmation " +
|
|
48
|
+
"needs, and there is no way to guess one. The reply says so rather than reporting a run that found " +
|
|
49
|
+
"nothing.",
|
|
50
|
+
properties: {
|
|
51
|
+
module: { type: "string", description: "Module specifier to import, e.g. a runtime adapter package for the language your frontend is written in." },
|
|
52
|
+
export: { type: "string", description: "Named export to call. Defaults to the module's single create*StackTraceParser factory; two matches is an error rather than a guess." },
|
|
53
|
+
},
|
|
54
|
+
required: ["module"],
|
|
55
|
+
additionalProperties: false,
|
|
56
|
+
},
|
|
57
|
+
documentRoot: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "The directory on disk that the target URL's origin serves files from, if it is not the repository " +
|
|
60
|
+
"root. Absolute, or relative to the repository. THIS IS THE ONE THAT SILENTLY BREAKS THE ARROW: a " +
|
|
61
|
+
"server that serves scripts out of \"public/\" makes public/ the document root while the repo root is " +
|
|
62
|
+
"one level above it, and getting it wrong resolves a script URL to a path that does not exist, which " +
|
|
63
|
+
"degrades the call-site stack to nothing and produces a run that looks clean and confirmed no edges. " +
|
|
64
|
+
"Defaults to the repository root.",
|
|
65
|
+
},
|
|
66
|
+
environment: {
|
|
67
|
+
type: "object",
|
|
68
|
+
description: "The environment profile this session runs against, if you have one. Its safetyLevel governs " +
|
|
69
|
+
"whether the session may change the application: \"readOnly\" refuses browser_click, browser_type " +
|
|
70
|
+
"and browser_fill while still permitting browser_navigate and browser_snapshot. Declared once here " +
|
|
71
|
+
"rather than per call, and it is the same profile observe_runtime takes — a browser run and a " +
|
|
72
|
+
"runtime run must not hold two different opinions about the same environment (DEC-270). Omit it and " +
|
|
73
|
+
"the session's own consent is the only authorization, which still means this call had to be confirmed.",
|
|
74
|
+
properties: {
|
|
75
|
+
name: { type: "string", description: "The profile's name, free-form. Named back to you in any refusal it causes." },
|
|
76
|
+
safetyLevel: {
|
|
77
|
+
type: "string",
|
|
78
|
+
enum: ["readOnly", "write", "destructiveWithApproval"],
|
|
79
|
+
description: "\"readOnly\" refuses every action that could change the application, whatever the profile is " +
|
|
80
|
+
"called — a profile named \"local\" with safetyLevel \"readOnly\" is read-only too.",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
required: ["name", "safetyLevel"],
|
|
84
|
+
additionalProperties: true,
|
|
85
|
+
},
|
|
86
|
+
confirmToken: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "The token returned by a previous call. Starting a browser session takes two calls: the first " +
|
|
89
|
+
"returns a token and launches nothing, the second redeems it. A token is single-use, expires, " +
|
|
90
|
+
"and is only valid for this tool. Consent is granted once here — the click, type and fill tools " +
|
|
91
|
+
"need no token of their own.",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
required: ["targetUrl"],
|
|
95
|
+
additionalProperties: false,
|
|
96
|
+
};
|
|
97
|
+
const SAFETY_LEVELS = ["readOnly", "write", "destructiveWithApproval"];
|
|
98
|
+
/**
|
|
99
|
+
* Read the profile, do not re-derive it.
|
|
100
|
+
*
|
|
101
|
+
* Only the two fields this surface actually consults are read; everything
|
|
102
|
+
* else a caller sends is carried by the profile it came from and is none of
|
|
103
|
+
* this tool's business. `additionalProperties: true` on the schema is what
|
|
104
|
+
* lets a caller pass the same object it passes `observe_runtime` rather than
|
|
105
|
+
* trimming a second copy of it.
|
|
106
|
+
*/
|
|
107
|
+
function readProfile(args) {
|
|
108
|
+
const raw = args["environment"];
|
|
109
|
+
if (raw === undefined || raw === null)
|
|
110
|
+
return null;
|
|
111
|
+
if (typeof raw !== "object" || Array.isArray(raw))
|
|
112
|
+
throw new ToolInputError('"environment" must be an object');
|
|
113
|
+
const fields = raw;
|
|
114
|
+
const name = requiredString(fields, "name");
|
|
115
|
+
const safetyLevel = optionalEnum(fields, "safetyLevel", SAFETY_LEVELS);
|
|
116
|
+
if (safetyLevel === undefined) {
|
|
117
|
+
throw new ToolInputError('"environment.safetyLevel" is required when an environment is given — a profile with no declared ' +
|
|
118
|
+
"safety level would be read as permitting everything, which is the one reading it must never get by default");
|
|
119
|
+
}
|
|
120
|
+
return { name, safetyLevel };
|
|
121
|
+
}
|
|
122
|
+
function readStackParserSpec(args) {
|
|
123
|
+
const raw = args["stackParser"];
|
|
124
|
+
if (raw === undefined || raw === null)
|
|
125
|
+
return null;
|
|
126
|
+
if (typeof raw !== "object" || Array.isArray(raw))
|
|
127
|
+
throw new ToolInputError('"stackParser" must be an object');
|
|
128
|
+
const fields = raw;
|
|
129
|
+
const module = requiredString(fields, "module");
|
|
130
|
+
const named = optionalString(fields, "export");
|
|
131
|
+
return named === undefined ? { module } : { module, export: named };
|
|
132
|
+
}
|
|
133
|
+
function parseTarget(args) {
|
|
134
|
+
const raw = requiredString(args, "targetUrl");
|
|
135
|
+
try {
|
|
136
|
+
return new URL(raw);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
throw new ToolInputError(`"targetUrl" must be an absolute URL including scheme — got "${raw}". A bare host or path cannot be ` +
|
|
140
|
+
"opened, and cannot be turned into the origin this session's consent is bound to.");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async function run(args, ctx) {
|
|
144
|
+
const target = parseTarget(args);
|
|
145
|
+
const headless = optionalBoolean(args, "headless") ?? true;
|
|
146
|
+
const profile = readProfile(args);
|
|
147
|
+
const parserSpec = readStackParserSpec(args);
|
|
148
|
+
const documentRoot = optionalString(args, "documentRoot");
|
|
149
|
+
const backend = ctx.session.browserBackend();
|
|
150
|
+
if (!backend.available) {
|
|
151
|
+
return browserAnswer({
|
|
152
|
+
ctx,
|
|
153
|
+
state: "refused",
|
|
154
|
+
headline: "This build cannot open a browser.",
|
|
155
|
+
notes: [backend.reason, `Remedy: ${backend.remedy}`],
|
|
156
|
+
data: { sessionId: "", url: target.href, title: "", consentedOrigin: target.origin, safetyLevel: null, totalElements: 0, evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// The parser is loaded before anything launches. A parser that will not
|
|
160
|
+
// import is a refusal the caller can fix, and finding that out after a
|
|
161
|
+
// browser is open would mean either tearing it down again or running a
|
|
162
|
+
// session that quietly cannot write the edge it was opened for.
|
|
163
|
+
let parser;
|
|
164
|
+
try {
|
|
165
|
+
parser = parserSpec === null ? undefined : await loadStackParser(parserSpec);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
if (!(error instanceof StackParserLoadError))
|
|
169
|
+
throw error;
|
|
170
|
+
return browserAnswer({
|
|
171
|
+
ctx,
|
|
172
|
+
state: "refused",
|
|
173
|
+
headline: `Could not load the stack-trace parser "${error.specifier}".`,
|
|
174
|
+
notes: [error.message],
|
|
175
|
+
data: { sessionId: "", url: target.href, title: "", consentedOrigin: target.origin, safetyLevel: null, totalElements: 0, evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// Trap A, closed here rather than left to a caller to get right silently.
|
|
179
|
+
// The origin being driven maps to the directory that actually serves its
|
|
180
|
+
// scripts; `documentRoot` overrides the repository root for exactly the
|
|
181
|
+
// `public/` case the schema describes.
|
|
182
|
+
const servedFrom = documentRoot === undefined
|
|
183
|
+
? ctx.session.repoPath
|
|
184
|
+
: isAbsolute(documentRoot)
|
|
185
|
+
? documentRoot
|
|
186
|
+
: join(ctx.session.repoPath, documentRoot);
|
|
187
|
+
const resolveSourceRoot = (origin) => origin === target.origin
|
|
188
|
+
? { found: true, root: { serviceName: ctx.session.config.repo, declaredCwd: servedFrom } }
|
|
189
|
+
: { found: false, refusal: "noProcessOnPort", message: `${origin} is not the origin this session was opened against` };
|
|
190
|
+
ctx.progress(`Opening a browser at ${target.href}`);
|
|
191
|
+
const driver = await backend.createDriver({
|
|
192
|
+
...(parser === undefined ? {} : { stackParser: parser }),
|
|
193
|
+
resolveSourceRoot,
|
|
194
|
+
service: ctx.session.config.repo,
|
|
195
|
+
});
|
|
196
|
+
const opened = await ctx.session.browserSessions().open(driver, { targetUrl: target.href, headless, profile });
|
|
197
|
+
if (!opened.opened) {
|
|
198
|
+
const notes = opened.kind === "atCapacity"
|
|
199
|
+
? [opened.reason]
|
|
200
|
+
: // The remedy travels verbatim. A refusal that says "could not launch"
|
|
201
|
+
// and stops is one the developer has to go and research.
|
|
202
|
+
[opened.message, `Remedy: ${opened.remedy}`, `Expected the browser at ${opened.expectedExecutablePath}.`];
|
|
203
|
+
return browserAnswer({
|
|
204
|
+
ctx,
|
|
205
|
+
state: "refused",
|
|
206
|
+
headline: opened.kind === "atCapacity" ? "Too many browser sessions are already open." : "No browser is installed.",
|
|
207
|
+
notes,
|
|
208
|
+
data: { sessionId: "", url: target.href, title: "", consentedOrigin: target.origin, safetyLevel: profile?.safetyLevel ?? null, totalElements: 0, evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
const { entry } = opened;
|
|
212
|
+
const snapshot = await entry.page.snapshot();
|
|
213
|
+
const observed = await observeAndCorrelate(ctx, entry);
|
|
214
|
+
const evidence = observed.evidence;
|
|
215
|
+
return browserAnswer({
|
|
216
|
+
ctx,
|
|
217
|
+
headline: `Browser session ${entry.sessionId} open at ${snapshot.url} (${snapshot.totalElements} elements).`,
|
|
218
|
+
notes: [
|
|
219
|
+
`Consent covers ${entry.consentedOrigin} for the life of this session — click, type and fill need no ` +
|
|
220
|
+
"further confirmation, and navigating to another origin will refuse. The session is torn down after " +
|
|
221
|
+
"five idle minutes, when the client disconnects, or when browser_close_session is called.",
|
|
222
|
+
...(parserSpec === null
|
|
223
|
+
? [
|
|
224
|
+
"No stackParser was named, so requests will be observed and the endpoints they reach will be " +
|
|
225
|
+
"named, but no frontend→backend caller edge can be written from this session. That is a gap " +
|
|
226
|
+
"in what this run can confirm, not a finding about your application.",
|
|
227
|
+
]
|
|
228
|
+
: []),
|
|
229
|
+
...(entry.profile === null
|
|
230
|
+
? []
|
|
231
|
+
: [
|
|
232
|
+
`Running under environment profile "${entry.profile.name}" (safetyLevel ` +
|
|
233
|
+
`"${entry.profile.safetyLevel}").` +
|
|
234
|
+
(entry.profile.safetyLevel === "readOnly"
|
|
235
|
+
? " Clicking, typing and filling will be refused; navigate and snapshot remain available."
|
|
236
|
+
: ""),
|
|
237
|
+
]),
|
|
238
|
+
...observed.notes,
|
|
239
|
+
],
|
|
240
|
+
data: {
|
|
241
|
+
sessionId: entry.sessionId,
|
|
242
|
+
url: snapshot.url,
|
|
243
|
+
title: snapshot.title,
|
|
244
|
+
consentedOrigin: entry.consentedOrigin,
|
|
245
|
+
safetyLevel: entry.profile?.safetyLevel ?? null,
|
|
246
|
+
totalElements: snapshot.totalElements,
|
|
247
|
+
evidence,
|
|
248
|
+
graph: observed.graph,
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
export const browserStartSessionTool = {
|
|
253
|
+
name: "browser_start_session",
|
|
254
|
+
title: "Open a browser session",
|
|
255
|
+
description: "Open a real browser at a URL in your running application and return a session id the other browser " +
|
|
256
|
+
"tools take. This is where consent is granted: confirming it allows Descry to drive a browser anywhere " +
|
|
257
|
+
"on that URL's origin until the session ends, so the click, type and fill tools do not ask again. " +
|
|
258
|
+
"Reports what the page produced — console errors, failed requests — raw and untriaged; deciding which " +
|
|
259
|
+
"of them matter is yours.",
|
|
260
|
+
class: "action",
|
|
261
|
+
tier: "evidence",
|
|
262
|
+
version: "1.0.0",
|
|
263
|
+
inputSchema: SCHEMA,
|
|
264
|
+
run,
|
|
265
|
+
describeAction(args) {
|
|
266
|
+
const target = parseTarget(args);
|
|
267
|
+
return (`Launch a browser and open ${target.href}. For as long as the session lives, Descry may navigate, ` +
|
|
268
|
+
`click, type and fill anywhere on ${target.origin} without asking again — including actions that ` +
|
|
269
|
+
"change data in that application. It may not leave that origin.");
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
//# sourceMappingURL=browser-start-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,qGAAqG;QACrG,wGAAwG;QACxG,mGAAmG;QACnG,uGAAuG;QACvG,0BAA0B;IAC5B,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,cAAc,CAAC,IAA6B;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,CACL,6BAA6B,MAAM,CAAC,IAAI,2DAA2D;YACnG,oCAAoC,MAAM,CAAC,MAAM,iDAAiD;YAClG,gEAAgE,CACjE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `browser_type` — type into a field with real keystrokes.
|
|
3
|
+
*
|
|
4
|
+
* ## Consent, and why this tool asks for none
|
|
5
|
+
*
|
|
6
|
+
* `DEC-380` grants consent once, at
|
|
7
|
+
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
+
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
+
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
+
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
+
* `questions` uses when asked to read rather than write.
|
|
12
|
+
*
|
|
13
|
+
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
+
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
+
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
+
*
|
|
17
|
+
* ## A ref, never a selector
|
|
18
|
+
*
|
|
19
|
+
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
+
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
+
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
+
* against whatever now matches — that is the same mistake, arriving later.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* ## Why this is not the same tool as `browser_fill`
|
|
26
|
+
*
|
|
27
|
+
* The visible difference is that this appends and `fill` replaces. The
|
|
28
|
+
* difference that decides which one is correct for a real page is that **this
|
|
29
|
+
* one fires key events and `fill` fires none.** A field that opens an
|
|
30
|
+
* autocomplete on keydown, validates per character, or debounces a search as
|
|
31
|
+
* you type sees nothing at all from a `fill`. An agent that reaches for
|
|
32
|
+
* `fill` on a search box gets a page that was never typed into — a wrong
|
|
33
|
+
* answer produced by entirely correct tool code, which is why the schema
|
|
34
|
+
* prose below says so rather than describing only the tidy half.
|
|
35
|
+
*/
|
|
36
|
+
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
37
|
+
import { type BrowserGraphWrite } from "../browser/graph-write.ts";
|
|
38
|
+
import { type ToolDefinition } from "./kit.ts";
|
|
39
|
+
export interface BrowserTypeData {
|
|
40
|
+
readonly sessionId: string;
|
|
41
|
+
readonly ref: string;
|
|
42
|
+
readonly url: string;
|
|
43
|
+
readonly evidence: BrowserEvidenceReport;
|
|
44
|
+
/** Graph nodes this action's own requests reached, and any R4 edges it witnessed. */
|
|
45
|
+
readonly graph: BrowserGraphWrite;
|
|
46
|
+
}
|
|
47
|
+
export declare const browserTypeTool: ToolDefinition;
|
|
48
|
+
//# sourceMappingURL=browser-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-type.d.ts","sourceRoot":"","sources":["../../src/tools/browser-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnF,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;CACnC;AAyFD,eAAO,MAAM,eAAe,EAAE,cAiB7B,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `browser_type` — type into a field with real keystrokes.
|
|
3
|
+
*
|
|
4
|
+
* ## Consent, and why this tool asks for none
|
|
5
|
+
*
|
|
6
|
+
* `DEC-380` grants consent once, at
|
|
7
|
+
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
+
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
+
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
+
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
+
* `questions` uses when asked to read rather than write.
|
|
12
|
+
*
|
|
13
|
+
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
+
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
+
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
+
*
|
|
17
|
+
* ## A ref, never a selector
|
|
18
|
+
*
|
|
19
|
+
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
+
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
+
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
+
* against whatever now matches — that is the same mistake, arriving later.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* ## Why this is not the same tool as `browser_fill`
|
|
26
|
+
*
|
|
27
|
+
* The visible difference is that this appends and `fill` replaces. The
|
|
28
|
+
* difference that decides which one is correct for a real page is that **this
|
|
29
|
+
* one fires key events and `fill` fires none.** A field that opens an
|
|
30
|
+
* autocomplete on keydown, validates per character, or debounces a search as
|
|
31
|
+
* you type sees nothing at all from a `fill`. An agent that reaches for
|
|
32
|
+
* `fill` on a search box gets a page that was never typed into — a wrong
|
|
33
|
+
* answer produced by entirely correct tool code, which is why the schema
|
|
34
|
+
* prose below says so rather than describing only the tidy half.
|
|
35
|
+
*/
|
|
36
|
+
import { browserAnswer, emptyEvidence, mutationRefusal, observeAndCorrelate, useSession } from "../browser/tool-support.js";
|
|
37
|
+
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
38
|
+
import { UnknownElementRefError } from "../browser/driver.js";
|
|
39
|
+
import { requiredString } from "./kit.js";
|
|
40
|
+
const SCHEMA = {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
sessionId: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "REQUIRED. The id returned by browser_start_session.",
|
|
46
|
+
},
|
|
47
|
+
ref: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: "REQUIRED. An element ref from a browser_snapshot reply. Refs are issued per snapshot and are " +
|
|
50
|
+
"invalidated by navigation — a stale ref is refused rather than resolved against whatever now " +
|
|
51
|
+
"matches it, so take a fresh snapshot after the page changes.",
|
|
52
|
+
},
|
|
53
|
+
text: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "REQUIRED. The text to type. It is entered as real keystrokes and APPENDS to whatever the field " +
|
|
56
|
+
"already contains — use browser_fill to replace the contents instead.",
|
|
57
|
+
},
|
|
58
|
+
confirmToken: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Not normally needed. Consent is granted once, for the whole session, by browser_start_session, " +
|
|
61
|
+
"so this call performs its action directly. The field is declared because the handshake reads it " +
|
|
62
|
+
"for every action-class tool.",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: ["sessionId", "ref", "text"],
|
|
66
|
+
additionalProperties: false,
|
|
67
|
+
};
|
|
68
|
+
async function run(args, ctx) {
|
|
69
|
+
const sessionId = requiredString(args, "sessionId");
|
|
70
|
+
const ref = requiredString(args, "ref");
|
|
71
|
+
const text = requiredString(args, "text");
|
|
72
|
+
const found = await useSession(ctx.session.browserSessions(), sessionId);
|
|
73
|
+
if (!found.ok) {
|
|
74
|
+
return browserAnswer({
|
|
75
|
+
ctx,
|
|
76
|
+
state: found.dead.state,
|
|
77
|
+
headline: found.dead.headline,
|
|
78
|
+
notes: found.dead.notes,
|
|
79
|
+
data: { sessionId, ref, url: "", evidence: found.dead.evidence, graph: NO_GRAPH_WRITE },
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const { entry } = found;
|
|
83
|
+
// Consent and safetyLevel are independent and both must pass. Consent was
|
|
84
|
+
// granted at session start; this is the other half.
|
|
85
|
+
const refused = mutationRefusal(entry);
|
|
86
|
+
if (refused !== null) {
|
|
87
|
+
return browserAnswer({
|
|
88
|
+
ctx,
|
|
89
|
+
state: "refused",
|
|
90
|
+
headline: `${entry.profile?.name ?? "This environment"} is read-only.`,
|
|
91
|
+
notes: [refused],
|
|
92
|
+
data: { sessionId, ref, url: entry.page.currentUrl(), evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
ctx.progress(`Typing`);
|
|
97
|
+
await entry.page.type(ref, text);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (!(error instanceof UnknownElementRefError))
|
|
101
|
+
throw error;
|
|
102
|
+
return browserAnswer({
|
|
103
|
+
ctx,
|
|
104
|
+
state: "refused",
|
|
105
|
+
headline: `"${ref}" is not an element in this session's current snapshot.`,
|
|
106
|
+
notes: [error.message],
|
|
107
|
+
data: { sessionId, ref, url: entry.page.currentUrl(), evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
const observed = await observeAndCorrelate(ctx, entry);
|
|
111
|
+
return browserAnswer({
|
|
112
|
+
ctx,
|
|
113
|
+
headline: `Typing on ${entry.page.currentUrl()}.`,
|
|
114
|
+
notes: observed.notes,
|
|
115
|
+
data: { sessionId, ref, url: entry.page.currentUrl(), evidence: observed.evidence, graph: observed.graph },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
export const browserTypeTool = {
|
|
119
|
+
name: "browser_type",
|
|
120
|
+
title: "type into a field with real keystrokes",
|
|
121
|
+
description: "Type text into a field in an open browser session, as real keystrokes — every keydown, keypress and " +
|
|
122
|
+
"keyup the page would see from a person typing. Use this, not browser_fill, whenever the field reacts " +
|
|
123
|
+
"to typing: autocomplete, per-character validation, or a debounced search. Appends to what the field " +
|
|
124
|
+
"already holds. Refused when the session's environment profile declares safetyLevel \"readOnly\".",
|
|
125
|
+
class: "action",
|
|
126
|
+
tier: "evidence",
|
|
127
|
+
version: "1.0.0",
|
|
128
|
+
inputSchema: SCHEMA,
|
|
129
|
+
run,
|
|
130
|
+
// Undefined, always: the session this runs in was confirmed at
|
|
131
|
+
// browser_start_session, and a verb that could describe — and therefore
|
|
132
|
+
// mint — its own consent would be a gate that exists only for callers who
|
|
133
|
+
// were not going to abuse it.
|
|
134
|
+
describeAction: () => undefined,
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=browser-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-type.js","sourceRoot":"","sources":["../../src/tools/browser-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC5H,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAYjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,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,aAAa,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG;QACjD,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE;KAC3G,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,wCAAwC;IAC/C,WAAW,EAAE,sGAAsG;QACjH,uGAAuG;QACvG,sGAAsG;QACtG,kGAAkG;IACpG,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,+DAA+D;IAC/D,wEAAwE;IACxE,0EAA0E;IAC1E,8BAA8B;IAC9B,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;CAChC,CAAC"}
|
|
@@ -27,6 +27,21 @@ import { type BriefNode, type ToolDefinition } from "./kit.ts";
|
|
|
27
27
|
/** A call that reaches no route, or a route nothing calls. */
|
|
28
28
|
export interface ContractPathFinding {
|
|
29
29
|
readonly kind: ContractFindingKind;
|
|
30
|
+
/** 1-based position in this answer. See {@link ContractPathFinding.prominence} for what orders it. */
|
|
31
|
+
readonly rank: number;
|
|
32
|
+
/**
|
|
33
|
+
* `top` / `notable` / `rest`, ordered by **evidence strength** — the
|
|
34
|
+
* finding's own `resolution`, strongest first — and not by severity.
|
|
35
|
+
*
|
|
36
|
+
* Descry has no severity model for a contract finding and inventing one here
|
|
37
|
+
* would be a judgement dressed as a measurement: a call reaching no route and
|
|
38
|
+
* a route nothing calls are different problems, and which matters more is a
|
|
39
|
+
* fact about the codebase, not about the graph. What the graph does know is
|
|
40
|
+
* how well-resolved each finding is, and a reader triaging a list is better
|
|
41
|
+
* served by "this one rests on the strongest evidence" than by an invented
|
|
42
|
+
* ranking. The tool's own notes say this rather than leaving it inferred.
|
|
43
|
+
*/
|
|
44
|
+
readonly prominence: "top" | "notable" | "rest";
|
|
30
45
|
readonly method: string;
|
|
31
46
|
/** The normalised path template, not the raw literal. */
|
|
32
47
|
readonly path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAGlB,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC;IACnF,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;CACvC;AAED,wEAAwE;AACxE,MAAM,WAAW,2BAA2B;IAC1C,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,UAAU,EAAE,eAAe,CAAC;CACtC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,eAAe,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACjE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;CAC3C;AAwID,eAAO,MAAM,aAAa,EAAE,cAe3B,CAAC"}
|
package/dist/tools/contracts.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* The one case that *is* `refused` outright: no endpoints in the graph.
|
|
22
22
|
* Then neither half looked at anything.
|
|
23
23
|
*/
|
|
24
|
-
import { checkContracts } from "@descryy/core";
|
|
24
|
+
import { checkContracts, withProminence } from "@descryy/core";
|
|
25
25
|
import { briefNode, optionalInteger, optionalStringArray, } from "./kit.js";
|
|
26
26
|
const SCHEMA = {
|
|
27
27
|
type: "object",
|
|
@@ -68,6 +68,11 @@ async function run(args, ctx) {
|
|
|
68
68
|
"below describe the whole graph; the lists describe the filter.");
|
|
69
69
|
}
|
|
70
70
|
const total = findings.length + mismatches.length;
|
|
71
|
+
if (findings.length > 0) {
|
|
72
|
+
notes.push("findings are ranked by evidence strength — their own resolution, strongest first — not by " +
|
|
73
|
+
"severity. Descry has no severity model for a contract finding: which of a missing route " +
|
|
74
|
+
"and an uncalled route matters more is a fact about your codebase, not about the graph.");
|
|
75
|
+
}
|
|
71
76
|
const nothingToCheck = paths.checked.endpoints === 0;
|
|
72
77
|
// MK-7: the leading clause. Every path finding and shape mismatch here is a
|
|
73
78
|
// real defect — `contracts.ts`'s own header on `nearMiss` is what keeps a
|
|
@@ -78,7 +83,13 @@ async function run(args, ctx) {
|
|
|
78
83
|
result: {
|
|
79
84
|
...checked,
|
|
80
85
|
data: {
|
|
81
|
-
findings:
|
|
86
|
+
findings: withProminence(
|
|
87
|
+
// Sorted before ranking, because `withProminence` deliberately does
|
|
88
|
+
// not sort: rank must follow the order the reply actually reports.
|
|
89
|
+
// Ties keep the checker's own order, which is stable.
|
|
90
|
+
[...findings]
|
|
91
|
+
.sort((a, b) => b.resolution - a.resolution)
|
|
92
|
+
.map((f) => ({
|
|
82
93
|
kind: f.kind,
|
|
83
94
|
method: f.method,
|
|
84
95
|
path: f.pathTemplate,
|
|
@@ -89,7 +100,7 @@ async function run(args, ctx) {
|
|
|
89
100
|
: { nearMiss: { kind: f.nearMiss.kind, against: f.nearMiss.against } }),
|
|
90
101
|
callers: f.callers.slice(0, 5).map(briefNode),
|
|
91
102
|
routes: f.routes.slice(0, 5).map(briefNode),
|
|
92
|
-
})),
|
|
103
|
+
}))),
|
|
93
104
|
shapeMismatches: mismatches.map((m) => ({
|
|
94
105
|
endpoint: m.endpoint.name,
|
|
95
106
|
direction: m.direction,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAW/
|
|
1
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AQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAiM/E,eAAO,MAAM,WAAW,EAAE,cAezB,CAAC"}
|
package/dist/tools/cross-pr.js
CHANGED
|
@@ -77,6 +77,7 @@ async function run(args, ctx) {
|
|
|
77
77
|
commitSha: stamp.commitSha,
|
|
78
78
|
graphBuiltAt: stamp.graphBuiltAt,
|
|
79
79
|
irSchemaVersion: stamp.irSchemaVersion,
|
|
80
|
+
commitSpread: stamp.commitSpread,
|
|
80
81
|
// A file's presence or absence in a diff, and which symbols two changes both
|
|
81
82
|
// name, are name-level facts. Both still cap at C on R0 evidence — the
|
|
82
83
|
// carve-out that lifts a name-level fact to A begins at R2.
|