@descryy/mcp 0.2.0 → 0.4.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 +6 -1
- 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/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/render.d.ts +112 -10
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +79 -13
- package/dist/render.js.map +1 -1
- 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 +6 -3
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +68 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +89 -0
- 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 +81 -8
- 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/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +85 -6
- package/dist/tools/git-diff.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 +3 -3
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +27 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +10 -1
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +2 -0
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +113 -19
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +324 -53
- package/dist/tools/observe-runtime.js.map +1 -1
- 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 +11 -0
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +3 -3
- 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/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +41 -16
- package/dist/tools/questions.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 +51 -5
- package/dist/tools/verification-status.js.map +1 -1
- package/package.json +14 -13
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a stored scenario — validation, and the refusals that are the point.
|
|
3
|
+
*
|
|
4
|
+
* Everything here refuses rather than repairs. A format that quietly coerced a
|
|
5
|
+
* missing field into a default would let a scenario keep loading after it had
|
|
6
|
+
* stopped describing the application, which is the exact rot both scenario
|
|
7
|
+
* rulings exist to prevent — and it would do it at the one moment nobody is
|
|
8
|
+
* watching, a replay in CI.
|
|
9
|
+
*
|
|
10
|
+
* Problems are collected rather than thrown one at a time, so a person fixing a
|
|
11
|
+
* hand-edited file sees everything wrong with it in one pass instead of
|
|
12
|
+
* discovering the next fault on the next run.
|
|
13
|
+
*/
|
|
14
|
+
import { type Scenario } from "./scenario.ts";
|
|
15
|
+
export type ScenarioParseResult = {
|
|
16
|
+
readonly valid: true;
|
|
17
|
+
readonly scenario: Scenario;
|
|
18
|
+
} | {
|
|
19
|
+
readonly valid: false;
|
|
20
|
+
readonly problems: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Validate an already-JSON-decoded value as a scenario.
|
|
24
|
+
*
|
|
25
|
+
* The version check runs first and short-circuits: reporting field problems
|
|
26
|
+
* against a schema this reader does not understand would be noise about a
|
|
27
|
+
* shape that was never meant to satisfy it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseScenario(raw: unknown): ScenarioParseResult;
|
|
30
|
+
/** Newline-terminated and two-space indented, so a saved scenario reads as a reviewable diff rather than one long line. */
|
|
31
|
+
export declare function serializeScenario(scenario: Scenario): string;
|
|
32
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/scenarios/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAEL,KAAK,QAAQ,EAMd,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AA2HpE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAoE/D;AAED,2HAA2H;AAC3H,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a stored scenario — validation, and the refusals that are the point.
|
|
3
|
+
*
|
|
4
|
+
* Everything here refuses rather than repairs. A format that quietly coerced a
|
|
5
|
+
* missing field into a default would let a scenario keep loading after it had
|
|
6
|
+
* stopped describing the application, which is the exact rot both scenario
|
|
7
|
+
* rulings exist to prevent — and it would do it at the one moment nobody is
|
|
8
|
+
* watching, a replay in CI.
|
|
9
|
+
*
|
|
10
|
+
* Problems are collected rather than thrown one at a time, so a person fixing a
|
|
11
|
+
* hand-edited file sees everything wrong with it in one pass instead of
|
|
12
|
+
* discovering the next fault on the next run.
|
|
13
|
+
*/
|
|
14
|
+
import { SCENARIO_SCHEMA_VERSION, } from "./scenario.js";
|
|
15
|
+
const ACTIONS = ["navigate", "click", "type", "fill"];
|
|
16
|
+
const ASSERTION_KINDS = [
|
|
17
|
+
"elementVisible",
|
|
18
|
+
"textEquals",
|
|
19
|
+
"urlEquals",
|
|
20
|
+
"noConsoleErrors",
|
|
21
|
+
"noFailedRequests",
|
|
22
|
+
];
|
|
23
|
+
/** Actions that act on an element, and therefore require a target. `navigate` acts on the page. */
|
|
24
|
+
const ELEMENT_ACTIONS = ["click", "type", "fill"];
|
|
25
|
+
/** Actions that enter text, and therefore require it. */
|
|
26
|
+
const TEXT_ACTIONS = ["type", "fill"];
|
|
27
|
+
function isRecord(value) {
|
|
28
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
function readTarget(raw, where, problems) {
|
|
31
|
+
if (raw === null || raw === undefined)
|
|
32
|
+
return null;
|
|
33
|
+
if (!isRecord(raw)) {
|
|
34
|
+
problems.push(`${where}: target must be an object with role, name and selector`);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// All three, named individually in the message. A descriptor missing one is
|
|
38
|
+
// not a smaller descriptor -- it is a descriptor that would have to fall back
|
|
39
|
+
// to the others to resolve, and a fallback chain substitutes quietly.
|
|
40
|
+
const missing = ["role", "name", "selector"].filter((field) => typeof raw[field] !== "string");
|
|
41
|
+
if (missing.length > 0) {
|
|
42
|
+
problems.push(`${where}: target is missing ${missing.join(", ")} — all three of role, name and selector are required together`);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return { role: raw["role"], name: raw["name"], selector: raw["selector"] };
|
|
46
|
+
}
|
|
47
|
+
function readStep(raw, index, problems) {
|
|
48
|
+
const where = `step ${index}`;
|
|
49
|
+
if (!isRecord(raw)) {
|
|
50
|
+
problems.push(`${where}: not an object`);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
// The ref refusal, enforced rather than documented. A stored ref is scoped to
|
|
54
|
+
// a snapshot that no longer exists, so a scenario carrying one is already
|
|
55
|
+
// broken -- it just would not say so until a replay resolved it to nothing or
|
|
56
|
+
// to something else.
|
|
57
|
+
if ("ref" in raw) {
|
|
58
|
+
problems.push(`${where}: carries a ref, which cannot be stored — a ref is scoped to the snapshot that issued it and means nothing in a later session. Store role, name and selector instead.`);
|
|
59
|
+
}
|
|
60
|
+
const action = raw["action"];
|
|
61
|
+
if (typeof action !== "string" || !ACTIONS.includes(action)) {
|
|
62
|
+
problems.push(`${where}: action must be one of ${ACTIONS.join(", ")}`);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const kind = action;
|
|
66
|
+
const target = readTarget(raw["target"], where, problems);
|
|
67
|
+
if (ELEMENT_ACTIONS.includes(kind) && target === null) {
|
|
68
|
+
problems.push(`${where}: ${kind} acts on an element and needs a target to resolve`);
|
|
69
|
+
}
|
|
70
|
+
if (!ELEMENT_ACTIONS.includes(kind) && target !== null) {
|
|
71
|
+
problems.push(`${where}: ${kind} acts on the page, not on an element, so it must not carry a target`);
|
|
72
|
+
}
|
|
73
|
+
const url = raw["url"] ?? null;
|
|
74
|
+
if (kind === "navigate" && typeof url !== "string") {
|
|
75
|
+
problems.push(`${where}: navigate needs a url`);
|
|
76
|
+
}
|
|
77
|
+
if (kind !== "navigate" && url !== null) {
|
|
78
|
+
problems.push(`${where}: only navigate carries a url`);
|
|
79
|
+
}
|
|
80
|
+
const text = raw["text"] ?? null;
|
|
81
|
+
if (TEXT_ACTIONS.includes(kind) && typeof text !== "string") {
|
|
82
|
+
problems.push(`${where}: ${kind} enters text and needs it stored`);
|
|
83
|
+
}
|
|
84
|
+
if (!TEXT_ACTIONS.includes(kind) && text !== null) {
|
|
85
|
+
problems.push(`${where}: only type and fill carry text`);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
action: kind,
|
|
89
|
+
target,
|
|
90
|
+
url: typeof url === "string" ? url : null,
|
|
91
|
+
text: typeof text === "string" ? text : null,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function readAssertion(raw, index, stepCount, problems) {
|
|
95
|
+
const where = `assertion ${index}`;
|
|
96
|
+
if (!isRecord(raw)) {
|
|
97
|
+
problems.push(`${where}: not an object`);
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const kind = raw["kind"];
|
|
101
|
+
if (typeof kind !== "string" || !ASSERTION_KINDS.includes(kind)) {
|
|
102
|
+
problems.push(`${where}: kind must be one of ${ASSERTION_KINDS.join(", ")}`);
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const afterStep = raw["afterStep"] ?? null;
|
|
106
|
+
if (afterStep !== null) {
|
|
107
|
+
// An assertion anchored past the end would never run, and would never say
|
|
108
|
+
// so -- a scenario reporting green because its only check was unreachable
|
|
109
|
+
// is the same false negative the assertions field exists to prevent.
|
|
110
|
+
if (typeof afterStep !== "number" || !Number.isInteger(afterStep) || afterStep < 0 || afterStep >= stepCount) {
|
|
111
|
+
problems.push(`${where}: afterStep must be null (end of scenario) or the index of a real step (0..${stepCount - 1}), got ${String(afterStep)}`);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
kind: kind,
|
|
117
|
+
afterStep: afterStep === null ? null : afterStep,
|
|
118
|
+
target: readTarget(raw["target"], where, problems),
|
|
119
|
+
expected: typeof raw["expected"] === "string" ? raw["expected"] : null,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Validate an already-JSON-decoded value as a scenario.
|
|
124
|
+
*
|
|
125
|
+
* The version check runs first and short-circuits: reporting field problems
|
|
126
|
+
* against a schema this reader does not understand would be noise about a
|
|
127
|
+
* shape that was never meant to satisfy it.
|
|
128
|
+
*/
|
|
129
|
+
export function parseScenario(raw) {
|
|
130
|
+
const problems = [];
|
|
131
|
+
if (!isRecord(raw))
|
|
132
|
+
return { valid: false, problems: ["not an object"] };
|
|
133
|
+
const schemaVersion = raw["schemaVersion"];
|
|
134
|
+
if (typeof schemaVersion !== "number" || !Number.isInteger(schemaVersion)) {
|
|
135
|
+
problems.push(`schemaVersion is required and must be an integer (this reader understands ${SCENARIO_SCHEMA_VERSION})`);
|
|
136
|
+
return { valid: false, problems };
|
|
137
|
+
}
|
|
138
|
+
if (schemaVersion > SCENARIO_SCHEMA_VERSION) {
|
|
139
|
+
// Refused by number, never parsed optimistically. A reader that
|
|
140
|
+
// best-effort parses a future schema silently ignores the field that was
|
|
141
|
+
// added precisely because it mattered.
|
|
142
|
+
return {
|
|
143
|
+
valid: false,
|
|
144
|
+
problems: [
|
|
145
|
+
`schemaVersion ${schemaVersion} is newer than this reader understands (${SCENARIO_SCHEMA_VERSION}). Upgrade Descry rather than editing the file.`,
|
|
146
|
+
],
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (schemaVersion < SCENARIO_SCHEMA_VERSION) {
|
|
150
|
+
return {
|
|
151
|
+
valid: false,
|
|
152
|
+
problems: [`schemaVersion ${schemaVersion} is older than ${SCENARIO_SCHEMA_VERSION} and no migration exists yet — re-save the scenario.`],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
for (const field of ["name", "targetUrl", "savedAt", "savedAtCommit"]) {
|
|
156
|
+
if (typeof raw[field] !== "string")
|
|
157
|
+
problems.push(`${field} is required`);
|
|
158
|
+
}
|
|
159
|
+
const description = raw["description"];
|
|
160
|
+
if (description !== null && description !== undefined && typeof description !== "string") {
|
|
161
|
+
problems.push("description must be a string or null");
|
|
162
|
+
}
|
|
163
|
+
const rawSteps = raw["steps"];
|
|
164
|
+
if (!Array.isArray(rawSteps) || rawSteps.length === 0) {
|
|
165
|
+
problems.push("steps is required and must hold at least one step");
|
|
166
|
+
}
|
|
167
|
+
const steps = Array.isArray(rawSteps) ? rawSteps.map((step, i) => readStep(step, i, problems)) : [];
|
|
168
|
+
// Required, and may be empty -- absent is a different statement from empty.
|
|
169
|
+
// Empty says "this scenario checks nothing", which is honest and storable.
|
|
170
|
+
// Absent says nothing at all, and would let a scenario written before the
|
|
171
|
+
// field existed read as if it had been considered.
|
|
172
|
+
const rawAssertions = raw["assertions"];
|
|
173
|
+
if (!Array.isArray(rawAssertions)) {
|
|
174
|
+
problems.push("assertions is required — use [] for a scenario that asserts nothing, which replays as unverified rather than passed");
|
|
175
|
+
}
|
|
176
|
+
const assertions = Array.isArray(rawAssertions)
|
|
177
|
+
? rawAssertions.map((a, i) => readAssertion(a, i, Array.isArray(rawSteps) ? rawSteps.length : 0, problems))
|
|
178
|
+
: [];
|
|
179
|
+
if (problems.length > 0)
|
|
180
|
+
return { valid: false, problems };
|
|
181
|
+
return {
|
|
182
|
+
valid: true,
|
|
183
|
+
scenario: {
|
|
184
|
+
schemaVersion,
|
|
185
|
+
name: raw["name"],
|
|
186
|
+
description: typeof description === "string" ? description : null,
|
|
187
|
+
targetUrl: raw["targetUrl"],
|
|
188
|
+
savedAt: raw["savedAt"],
|
|
189
|
+
savedAtCommit: raw["savedAtCommit"],
|
|
190
|
+
steps: steps.filter((s) => s !== null),
|
|
191
|
+
assertions: assertions.filter((a) => a !== null),
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** Newline-terminated and two-space indented, so a saved scenario reads as a reviewable diff rather than one long line. */
|
|
196
|
+
export function serializeScenario(scenario) {
|
|
197
|
+
return `${JSON.stringify(scenario, null, 2)}\n`;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/scenarios/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,uBAAuB,GAOxB,MAAM,eAAe,CAAC;AAMvB,MAAM,OAAO,GAAkC,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACrF,MAAM,eAAe,GAAqC;IACxD,gBAAgB;IAChB,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,kBAAkB;CACnB,CAAC;AACF,mGAAmG;AACnG,MAAM,eAAe,GAAkC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACjF,yDAAyD;AACzD,MAAM,YAAY,GAAkC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,UAAU,CAAC,GAAY,EAAE,KAAa,EAAE,QAAkB;IACjE,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,yDAAyD,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,4EAA4E;IAC5E,8EAA8E;IAC9E,sEAAsE;IACtE,MAAM,OAAO,GAAI,CAAC,MAAM,EAAE,M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— the schema half of
|
|
3
|
+
* `DEC-383`.
|
|
4
|
+
*
|
|
5
|
+
* This module has no browser in it and imports nothing from the browser port
|
|
6
|
+
* deliberately. A scenario is an artifact a person authored and a reviewer
|
|
7
|
+
* reads in a diff; whether one can be *replayed* is the runner's question, and
|
|
8
|
+
* keeping the two apart is what lets the format be tested without launching
|
|
9
|
+
* anything.
|
|
10
|
+
*
|
|
11
|
+
* ## The one shape decision worth reading before the types
|
|
12
|
+
*
|
|
13
|
+
* **A step stores no `ref`.** The port's action verbs take a `ref` and that is
|
|
14
|
+
* correct — a ref ties an action to a snapshot the agent actually saw. But a
|
|
15
|
+
* ref is scoped to the snapshot that issued it, and a replay is always a later
|
|
16
|
+
* session, so a stored ref resolves to nothing or, worse, to something else. A
|
|
17
|
+
* step therefore stores a `TargetDescriptor` and the runner re-resolves it
|
|
18
|
+
* against a fresh snapshot.
|
|
19
|
+
*
|
|
20
|
+
* All three descriptor fields are required, together, always. Not one of them
|
|
21
|
+
* and not a fallback chain: `selector` alone breaks on a markup refactor and
|
|
22
|
+
* silently matches the wrong element when a class is reused; `role` + `name`
|
|
23
|
+
* alone breaks on a copy change; and "try the selector, else role+name" is the
|
|
24
|
+
* dangerous option, because it turns a real disagreement into a quiet
|
|
25
|
+
* substitution — which is how a scenario keeps reporting green against a page
|
|
26
|
+
* that changed underneath it.
|
|
27
|
+
*/
|
|
28
|
+
/** Bumped when a stored scenario's shape changes. An integer, never semver: one repository, one reader, nothing to argue about. */
|
|
29
|
+
export declare const SCENARIO_SCHEMA_VERSION = 1;
|
|
30
|
+
/**
|
|
31
|
+
* How a step names the element it acts on. Re-resolved at replay against a
|
|
32
|
+
* fresh snapshot, and required to match **exactly one** element — zero,
|
|
33
|
+
* ambiguous and partial are each a refusal that names which of these three
|
|
34
|
+
* fields disagreed and what the page holds now.
|
|
35
|
+
*/
|
|
36
|
+
export interface TargetDescriptor {
|
|
37
|
+
readonly role: string;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly selector: string;
|
|
40
|
+
}
|
|
41
|
+
/** Mirrors the port's `BrowserActionKind`, restated rather than imported: the format must be readable without a browser in the process. */
|
|
42
|
+
export type ScenarioActionKind = "navigate" | "click" | "type" | "fill";
|
|
43
|
+
export interface ScenarioStep {
|
|
44
|
+
readonly action: ScenarioActionKind;
|
|
45
|
+
/** The element to act on. Null for `navigate`, which acts on the page — and required for everything else, because a step with nothing to resolve cannot be replayed. */
|
|
46
|
+
readonly target: TargetDescriptor | null;
|
|
47
|
+
/** Where to go. Present for `navigate` alone. */
|
|
48
|
+
readonly url: string | null;
|
|
49
|
+
/** What to enter. Present for `type` and `fill` alone. `type` appends, `fill` replaces — the runtime's two text verbs, kept distinct here because the stored artifact must say which one a replay should perform. */
|
|
50
|
+
readonly text: string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* What the scenario claims about the application.
|
|
54
|
+
*
|
|
55
|
+
* Kept deliberately small and derived from what a snapshot and a run's
|
|
56
|
+
* observations already carry, rather than invented: an assertion the runner
|
|
57
|
+
* cannot evaluate from real evidence is a promise the format cannot keep.
|
|
58
|
+
*
|
|
59
|
+
* `noConsoleErrors` and `noFailedRequests` are worth one note, because they
|
|
60
|
+
* interact with `DEC-384`. An *observed* console
|
|
61
|
+
* error does not block a push — it is frequently true of a working page. An
|
|
62
|
+
* *asserted* absence of console errors that then fails does block, because the
|
|
63
|
+
* author opted in and wrote the claim down. Same evidence, different status,
|
|
64
|
+
* and the difference is entirely whether a person claimed something about it.
|
|
65
|
+
*/
|
|
66
|
+
export type ScenarioAssertionKind = "elementVisible" | "textEquals" | "urlEquals" | "noConsoleErrors" | "noFailedRequests";
|
|
67
|
+
export interface ScenarioAssertion {
|
|
68
|
+
readonly kind: ScenarioAssertionKind;
|
|
69
|
+
/** Which step this runs after, by index. `null` means after the whole scenario. An index past the end is refused: an assertion that never runs is worse than one that fails. */
|
|
70
|
+
readonly afterStep: number | null;
|
|
71
|
+
/** The element this is about, for the kinds that are about one. Null otherwise. */
|
|
72
|
+
readonly target: TargetDescriptor | null;
|
|
73
|
+
/** The expected value, for the kinds that compare one. Null otherwise. */
|
|
74
|
+
readonly expected: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface Scenario {
|
|
77
|
+
readonly schemaVersion: number;
|
|
78
|
+
readonly name: string;
|
|
79
|
+
readonly description: string | null;
|
|
80
|
+
readonly targetUrl: string;
|
|
81
|
+
/**
|
|
82
|
+
* When this was saved, and the commit it was authored against.
|
|
83
|
+
*
|
|
84
|
+
* Neither expires anything and neither is checked at replay. They exist so a
|
|
85
|
+
* failure can say *the scenario was written against a different revision of
|
|
86
|
+
* this application*, which is usually the answer to "why did this break".
|
|
87
|
+
* DEC-223 §7's disclosed-non-detection choice, repeated on purpose: building
|
|
88
|
+
* an expiry against a population of zero real scenarios would be machinery
|
|
89
|
+
* ahead of its evidence, and retrofitting one later needs no schema change
|
|
90
|
+
* because the fields are already here.
|
|
91
|
+
*/
|
|
92
|
+
readonly savedAt: string;
|
|
93
|
+
readonly savedAtCommit: string;
|
|
94
|
+
readonly steps: readonly ScenarioStep[];
|
|
95
|
+
/**
|
|
96
|
+
* **Required, and may be empty.** A replay that clicks successfully through a
|
|
97
|
+
* broken page and reports success is a false negative with a confident face
|
|
98
|
+
* on it, and the runner cannot invent assertions at replay time — it has no
|
|
99
|
+
* idea what the author meant to check. So they are stored with the steps.
|
|
100
|
+
*
|
|
101
|
+
* Empty is storable, because saving an exploration must stay possible. It is
|
|
102
|
+
* never `passed`: see `isUnverifying`.
|
|
103
|
+
*/
|
|
104
|
+
readonly assertions: readonly ScenarioAssertion[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* True when a scenario claims nothing, and so can verify nothing.
|
|
108
|
+
*
|
|
109
|
+
* A replay of one of these that meets no error has established that the steps
|
|
110
|
+
* still resolve — real information, and not the same statement as "the
|
|
111
|
+
* application is behaving." The exit rule reports it as `unverified`; this is
|
|
112
|
+
* the predicate that decides which word is honest.
|
|
113
|
+
*/
|
|
114
|
+
export declare function isUnverifying(scenario: Scenario): boolean;
|
|
115
|
+
//# sourceMappingURL=scenario.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/scenarios/scenario.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,mIAAmI;AACnI,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,2IAA2I;AAC3I,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,wKAAwK;IACxK,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,iDAAiD;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,qNAAqN;IACrN,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,gLAAgL;IAChL,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACnD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a saved scenario *is* — the schema half of
|
|
3
|
+
* `DEC-383`.
|
|
4
|
+
*
|
|
5
|
+
* This module has no browser in it and imports nothing from the browser port
|
|
6
|
+
* deliberately. A scenario is an artifact a person authored and a reviewer
|
|
7
|
+
* reads in a diff; whether one can be *replayed* is the runner's question, and
|
|
8
|
+
* keeping the two apart is what lets the format be tested without launching
|
|
9
|
+
* anything.
|
|
10
|
+
*
|
|
11
|
+
* ## The one shape decision worth reading before the types
|
|
12
|
+
*
|
|
13
|
+
* **A step stores no `ref`.** The port's action verbs take a `ref` and that is
|
|
14
|
+
* correct — a ref ties an action to a snapshot the agent actually saw. But a
|
|
15
|
+
* ref is scoped to the snapshot that issued it, and a replay is always a later
|
|
16
|
+
* session, so a stored ref resolves to nothing or, worse, to something else. A
|
|
17
|
+
* step therefore stores a `TargetDescriptor` and the runner re-resolves it
|
|
18
|
+
* against a fresh snapshot.
|
|
19
|
+
*
|
|
20
|
+
* All three descriptor fields are required, together, always. Not one of them
|
|
21
|
+
* and not a fallback chain: `selector` alone breaks on a markup refactor and
|
|
22
|
+
* silently matches the wrong element when a class is reused; `role` + `name`
|
|
23
|
+
* alone breaks on a copy change; and "try the selector, else role+name" is the
|
|
24
|
+
* dangerous option, because it turns a real disagreement into a quiet
|
|
25
|
+
* substitution — which is how a scenario keeps reporting green against a page
|
|
26
|
+
* that changed underneath it.
|
|
27
|
+
*/
|
|
28
|
+
/** Bumped when a stored scenario's shape changes. An integer, never semver: one repository, one reader, nothing to argue about. */
|
|
29
|
+
export const SCENARIO_SCHEMA_VERSION = 1;
|
|
30
|
+
/**
|
|
31
|
+
* True when a scenario claims nothing, and so can verify nothing.
|
|
32
|
+
*
|
|
33
|
+
* A replay of one of these that meets no error has established that the steps
|
|
34
|
+
* still resolve — real information, and not the same statement as "the
|
|
35
|
+
* application is behaving." The exit rule reports it as `unverified`; this is
|
|
36
|
+
* the predicate that decides which word is honest.
|
|
37
|
+
*/
|
|
38
|
+
export function isUnverifying(scenario) {
|
|
39
|
+
return scenario.assertions.length === 0;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=scenario.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.js","sourceRoot":"","sources":["../../src/scenarios/scenario.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,mIAAmI;AACnI,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAyFzC;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,QAAkB;IAC9C,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a scenario lives on disk — `DEC-383` §1.
|
|
3
|
+
*
|
|
4
|
+
* **`descry/scenarios/`, committed, and deliberately not `.descry/`.** The
|
|
5
|
+
* obvious home was beside `config.json` and `graph.db`, and it is wrong: §7's
|
|
6
|
+
* whole point is a run with no agent in it — a pre-push hook and a CI step —
|
|
7
|
+
* and CI runs on a fresh checkout. `.descry/` holds a regenerable graph and a
|
|
8
|
+
* config naming absolute adapter paths, which is why it is ignored; a scenario
|
|
9
|
+
* stored there works locally, vanishes in CI, and reports nothing rather than
|
|
10
|
+
* failing.
|
|
11
|
+
*
|
|
12
|
+
* The split is by kind, not by prefix: `.descry/` for what Descry can rebuild
|
|
13
|
+
* or what is true only on this machine, `descry/` for what a person wrote and a
|
|
14
|
+
* reviewer should see in a diff.
|
|
15
|
+
*
|
|
16
|
+
* One file per scenario, so two branches adding scenarios do not conflict and
|
|
17
|
+
* each is reviewable on its own.
|
|
18
|
+
*/
|
|
19
|
+
import { type ScenarioParseResult } from "./parse.ts";
|
|
20
|
+
import type { Scenario } from "./scenario.ts";
|
|
21
|
+
export declare function scenariosDirectory(repoPath: string): string;
|
|
22
|
+
export declare function scenarioPath(repoPath: string, name: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Every saved scenario's name.
|
|
25
|
+
*
|
|
26
|
+
* A repository with no scenarios returns `[]` — a fact about the repository,
|
|
27
|
+
* not a failure to look. Conflating "none saved" with "could not read" is the
|
|
28
|
+
* distinction the five reply states exist to keep, applied one layer down.
|
|
29
|
+
*/
|
|
30
|
+
export declare function listScenarios(repoPath: string): Promise<readonly string[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Read one scenario.
|
|
33
|
+
*
|
|
34
|
+
* Never throws: a missing file, unreadable text and a malformed document are
|
|
35
|
+
* all refusals carrying the path, because a caller replaying scenarios in CI
|
|
36
|
+
* needs to report which file was wrong rather than die on the first one. The
|
|
37
|
+
* message distinguishes *nothing is there* from *something is there and is
|
|
38
|
+
* wrong* — conflating them sends someone to debug a file that does not exist.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readScenario(repoPath: string, name: string): Promise<ScenarioParseResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Write one scenario, refusing to store anything this reader could not read
|
|
43
|
+
* back.
|
|
44
|
+
*
|
|
45
|
+
* The validation on the way out is not redundant with the one on the way in.
|
|
46
|
+
* A scenario is written once and read on every push afterwards, so a fault
|
|
47
|
+
* saved today surfaces at the worst possible moment — during a check somebody
|
|
48
|
+
* is waiting on — and by then the session that could have explained it is gone.
|
|
49
|
+
*/
|
|
50
|
+
export declare function writeScenario(repoPath: string, scenario: Scenario): Promise<void>;
|
|
51
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/scenarios/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAoC,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI9C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAQhF;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmB/F;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a scenario lives on disk — `DEC-383` §1.
|
|
3
|
+
*
|
|
4
|
+
* **`descry/scenarios/`, committed, and deliberately not `.descry/`.** The
|
|
5
|
+
* obvious home was beside `config.json` and `graph.db`, and it is wrong: §7's
|
|
6
|
+
* whole point is a run with no agent in it — a pre-push hook and a CI step —
|
|
7
|
+
* and CI runs on a fresh checkout. `.descry/` holds a regenerable graph and a
|
|
8
|
+
* config naming absolute adapter paths, which is why it is ignored; a scenario
|
|
9
|
+
* stored there works locally, vanishes in CI, and reports nothing rather than
|
|
10
|
+
* failing.
|
|
11
|
+
*
|
|
12
|
+
* The split is by kind, not by prefix: `.descry/` for what Descry can rebuild
|
|
13
|
+
* or what is true only on this machine, `descry/` for what a person wrote and a
|
|
14
|
+
* reviewer should see in a diff.
|
|
15
|
+
*
|
|
16
|
+
* One file per scenario, so two branches adding scenarios do not conflict and
|
|
17
|
+
* each is reviewable on its own.
|
|
18
|
+
*/
|
|
19
|
+
import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
import { parseScenario, serializeScenario } from "./parse.js";
|
|
22
|
+
const SCENARIO_SUFFIX = ".scenario.json";
|
|
23
|
+
export function scenariosDirectory(repoPath) {
|
|
24
|
+
return join(repoPath, "descry", "scenarios");
|
|
25
|
+
}
|
|
26
|
+
export function scenarioPath(repoPath, name) {
|
|
27
|
+
return join(scenariosDirectory(repoPath), `${name}${SCENARIO_SUFFIX}`);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Every saved scenario's name.
|
|
31
|
+
*
|
|
32
|
+
* A repository with no scenarios returns `[]` — a fact about the repository,
|
|
33
|
+
* not a failure to look. Conflating "none saved" with "could not read" is the
|
|
34
|
+
* distinction the five reply states exist to keep, applied one layer down.
|
|
35
|
+
*/
|
|
36
|
+
export async function listScenarios(repoPath) {
|
|
37
|
+
let entries;
|
|
38
|
+
try {
|
|
39
|
+
entries = await readdir(scenariosDirectory(repoPath));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
return entries.filter((e) => e.endsWith(SCENARIO_SUFFIX)).map((e) => e.slice(0, -SCENARIO_SUFFIX.length));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read one scenario.
|
|
48
|
+
*
|
|
49
|
+
* Never throws: a missing file, unreadable text and a malformed document are
|
|
50
|
+
* all refusals carrying the path, because a caller replaying scenarios in CI
|
|
51
|
+
* needs to report which file was wrong rather than die on the first one. The
|
|
52
|
+
* message distinguishes *nothing is there* from *something is there and is
|
|
53
|
+
* wrong* — conflating them sends someone to debug a file that does not exist.
|
|
54
|
+
*/
|
|
55
|
+
export async function readScenario(repoPath, name) {
|
|
56
|
+
const path = scenarioPath(repoPath, name);
|
|
57
|
+
let text;
|
|
58
|
+
try {
|
|
59
|
+
text = await readFile(path, "utf8");
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return { valid: false, problems: [`no scenario named "${name}" — nothing at ${path}`] };
|
|
63
|
+
}
|
|
64
|
+
let decoded;
|
|
65
|
+
try {
|
|
66
|
+
decoded = JSON.parse(text);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return { valid: false, problems: [`${path} is not readable as stored data: ${String(error)}`] };
|
|
70
|
+
}
|
|
71
|
+
const result = parseScenario(decoded);
|
|
72
|
+
if (result.valid)
|
|
73
|
+
return result;
|
|
74
|
+
return { valid: false, problems: result.problems.map((p) => `${path}: ${p}`) };
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Write one scenario, refusing to store anything this reader could not read
|
|
78
|
+
* back.
|
|
79
|
+
*
|
|
80
|
+
* The validation on the way out is not redundant with the one on the way in.
|
|
81
|
+
* A scenario is written once and read on every push afterwards, so a fault
|
|
82
|
+
* saved today surfaces at the worst possible moment — during a check somebody
|
|
83
|
+
* is waiting on — and by then the session that could have explained it is gone.
|
|
84
|
+
*/
|
|
85
|
+
export async function writeScenario(repoPath, scenario) {
|
|
86
|
+
const check = parseScenario(scenario);
|
|
87
|
+
if (!check.valid) {
|
|
88
|
+
throw new Error(`refusing to save scenario "${scenario.name}": ${check.problems.join("; ")}`);
|
|
89
|
+
}
|
|
90
|
+
await mkdir(scenariosDirectory(repoPath), { recursive: true });
|
|
91
|
+
await writeFile(scenarioPath(repoPath, scenario.name), serializeScenario(scenario), "utf8");
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/scenarios/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAA4B,MAAM,YAAY,CAAC;AAGxF,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAEzC,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,IAAY;IACzD,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,GAAG,eAAe,EAAE,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,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E,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,IAAI,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,MAAM,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9F,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAyBH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAYhD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,wDAAwD;IACxD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAyBH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAYhD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,wDAAwD;IACxD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AA4DD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAqNpE"}
|
package/dist/server.js
CHANGED
|
@@ -75,9 +75,12 @@ const SERVER_INSTRUCTIONS = "Descry reads the repository's source into a code gr
|
|
|
75
75
|
"reason over yourself. Every reply also carries `reportCategory` — one of `confirmed`, " +
|
|
76
76
|
"`strongly supported`, `unconfirmed`, `not analysable`, `unsupported`, or `null` where no " +
|
|
77
77
|
"claim applies. It is `null` on every `conclusion`-tier reply (the `headline` already states " +
|
|
78
|
-
"the verdict in plain words)
|
|
79
|
-
"
|
|
80
|
-
"
|
|
78
|
+
"the verdict in plain words). On an `evidence`-tier reply it follows that reply's own " +
|
|
79
|
+
"`resolutionFloor`: `unconfirmed` below R4, where nothing was observed, and `strongly " +
|
|
80
|
+
"supported` at R4, where every hop behind the answer was witnessed in a real run — " +
|
|
81
|
+
"`observe_runtime` and `observe_tests` are what write those edges. `confirmed` never appears " +
|
|
82
|
+
"here — that word is reserved for results that passed the full governance pipeline, and its " +
|
|
83
|
+
"absence is honest, not a bug. `provenance` names " +
|
|
81
84
|
"this surface explicitly (`adjudicatedBy: \"descry\"`, `presentedBy: \"host-agent\"`) so a " +
|
|
82
85
|
"reply from here is never mistaken for one the app itself adjudicated and presented.\n\n" +
|
|
83
86
|
"In agent mode, Descry gives you high-reliability facts about your code. It does not give you " +
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,EAAE,EACF,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,GAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAC;AAGvF,4FAA4F;AAC5F,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtC,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,CACL,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;QACvD,CAAC,OAAO,YAAY,KAAK,WAAW,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,CACxG,CAAC;AACJ,CAAC;AAeD,MAAM,mBAAmB,GACvB,4FAA4F;IAC5F,yFAAyF;IACzF,0CAA0C;IAC1C,qFAAqF;IACrF,6FAA6F;IAC7F,4FAA4F;IAC5F,8FAA8F;IAC9F,4FAA4F;IAC5F,8FAA8F;IAC9F,iBAAiB;IACjB,4FAA4F;I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