@descryy/mcp 0.9.0 → 0.11.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/browser/auth.d.ts +76 -0
- package/dist/browser/auth.d.ts.map +1 -0
- package/dist/browser/auth.js +223 -0
- package/dist/browser/auth.js.map +1 -0
- package/dist/browser/capability-probe.d.ts +109 -0
- package/dist/browser/capability-probe.d.ts.map +1 -0
- package/dist/browser/capability-probe.js +201 -0
- package/dist/browser/capability-probe.js.map +1 -0
- package/dist/browser/driver.d.ts +342 -4
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +79 -1
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +3 -0
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +6 -1
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +65 -8
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +235 -8
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/fault-attribution.d.ts +178 -0
- package/dist/browser/fault-attribution.d.ts.map +1 -0
- package/dist/browser/fault-attribution.js +266 -0
- package/dist/browser/fault-attribution.js.map +1 -0
- package/dist/browser/identity-graph-write.d.ts +55 -0
- package/dist/browser/identity-graph-write.d.ts.map +1 -0
- package/dist/browser/identity-graph-write.js +45 -0
- package/dist/browser/identity-graph-write.js.map +1 -0
- package/dist/browser/page-probe.d.ts +81 -0
- package/dist/browser/page-probe.d.ts.map +1 -0
- package/dist/browser/page-probe.js +202 -0
- package/dist/browser/page-probe.js.map +1 -0
- package/dist/browser/playwright-driver.d.ts +79 -0
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +1138 -180
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/reach-recording-session.d.ts +44 -0
- package/dist/browser/reach-recording-session.d.ts.map +1 -0
- package/dist/browser/reach-recording-session.js +143 -0
- package/dist/browser/reach-recording-session.js.map +1 -0
- package/dist/browser/reachability.d.ts +168 -0
- package/dist/browser/reachability.d.ts.map +1 -0
- package/dist/browser/reachability.js +294 -0
- package/dist/browser/reachability.js.map +1 -0
- package/dist/browser/registry.d.ts +24 -0
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +21 -2
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-provenance.d.ts +1 -1
- package/dist/browser/scenario-provenance.d.ts.map +1 -1
- package/dist/browser/scenario-provenance.js +15 -1
- package/dist/browser/scenario-provenance.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +10 -2
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +77 -9
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/tool-support.d.ts +5 -1
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +80 -4
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/wait-target.d.ts +37 -0
- package/dist/browser/wait-target.d.ts.map +1 -0
- package/dist/browser/wait-target.js +54 -0
- package/dist/browser/wait-target.js.map +1 -0
- package/dist/heap.d.ts +61 -0
- package/dist/heap.d.ts.map +1 -0
- package/dist/heap.js +82 -0
- package/dist/heap.js.map +1 -0
- package/dist/heartbeat.d.ts +46 -0
- package/dist/heartbeat.d.ts.map +1 -0
- package/dist/heartbeat.js +66 -0
- package/dist/heartbeat.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/planner/predict-then-propose.d.ts +101 -0
- package/dist/planner/predict-then-propose.d.ts.map +1 -0
- package/dist/planner/predict-then-propose.js +88 -0
- package/dist/planner/predict-then-propose.js.map +1 -0
- package/dist/planner/propose-journey.d.ts +60 -0
- package/dist/planner/propose-journey.d.ts.map +1 -0
- package/dist/planner/propose-journey.js +96 -0
- package/dist/planner/propose-journey.js.map +1 -0
- package/dist/registry.d.ts +10 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -1
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +4 -4
- package/dist/render.js +3 -3
- package/dist/scenarios/browser-run-plan-projection.d.ts +143 -0
- package/dist/scenarios/browser-run-plan-projection.d.ts.map +1 -0
- package/dist/scenarios/browser-run-plan-projection.js +228 -0
- package/dist/scenarios/browser-run-plan-projection.js.map +1 -0
- package/dist/scenarios/credential-ref.d.ts +102 -0
- package/dist/scenarios/credential-ref.d.ts.map +1 -0
- package/dist/scenarios/credential-ref.js +148 -0
- package/dist/scenarios/credential-ref.js.map +1 -0
- package/dist/scenarios/index.d.ts +4 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +4 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +42 -9
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +39 -5
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +15 -2
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/secret-ref.d.ts +86 -0
- package/dist/scenarios/secret-ref.d.ts.map +1 -0
- package/dist/scenarios/secret-ref.js +125 -0
- package/dist/scenarios/secret-ref.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -4
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +19 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +36 -0
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze-workspace.d.ts +52 -0
- package/dist/tools/analyze-workspace.d.ts.map +1 -0
- package/dist/tools/analyze-workspace.js +207 -0
- package/dist/tools/analyze-workspace.js.map +1 -0
- package/dist/tools/analyze.d.ts +50 -4
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +225 -5
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +21 -1
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +71 -7
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +1 -1
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +5 -3
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +6 -1
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +84 -4
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-select.d.ts +20 -0
- package/dist/tools/browser-select.d.ts.map +1 -0
- package/dist/tools/browser-select.js +120 -0
- package/dist/tools/browser-select.js.map +1 -0
- package/dist/tools/browser-snapshot.d.ts +17 -1
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +18 -5
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +161 -9
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-submit.d.ts +18 -0
- package/dist/tools/browser-submit.d.ts.map +1 -0
- package/dist/tools/browser-submit.js +106 -0
- package/dist/tools/browser-submit.js.map +1 -0
- package/dist/tools/browser-wait-for.d.ts +41 -0
- package/dist/tools/browser-wait-for.d.ts.map +1 -0
- package/dist/tools/browser-wait-for.js +148 -0
- package/dist/tools/browser-wait-for.js.map +1 -0
- package/dist/tools/chain.d.ts +41 -0
- package/dist/tools/chain.d.ts.map +1 -0
- package/dist/tools/chain.js +105 -0
- package/dist/tools/chain.js.map +1 -0
- package/dist/tools/draw-conclusion.d.ts +44 -0
- package/dist/tools/draw-conclusion.d.ts.map +1 -0
- package/dist/tools/draw-conclusion.js +250 -0
- package/dist/tools/draw-conclusion.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +16 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +17 -0
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +17 -0
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +174 -10
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/predict-reach.d.ts +57 -0
- package/dist/tools/predict-reach.d.ts.map +1 -0
- package/dist/tools/predict-reach.js +159 -0
- package/dist/tools/predict-reach.js.map +1 -0
- package/dist/tools/propagation.d.ts +8 -3
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +16 -9
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/propose-journey.d.ts +16 -0
- package/dist/tools/propose-journey.d.ts.map +1 -0
- package/dist/tools/propose-journey.js +121 -0
- package/dist/tools/propose-journey.js.map +1 -0
- package/dist/tools/runtime-journey-drive.d.ts +102 -0
- package/dist/tools/runtime-journey-drive.d.ts.map +1 -0
- package/dist/tools/runtime-journey-drive.js +247 -0
- package/dist/tools/runtime-journey-drive.js.map +1 -0
- package/dist/tools/scope.d.ts +3 -0
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +33 -6
- package/dist/tools/scope.js.map +1 -1
- package/dist/workspace-index.d.ts +164 -0
- package/dist/workspace-index.d.ts.map +1 -0
- package/dist/workspace-index.js +381 -0
- package/dist/workspace-index.js.map +1 -0
- package/package.json +33 -32
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P6-B2 — a periodic progress beat for the duration of one long awaited step.
|
|
3
|
+
*
|
|
4
|
+
* `analyze` on a 7,700-file repository reliably exceeded the calling client's
|
|
5
|
+
* timeout even with the heap ceiling raised, and completed only when driven
|
|
6
|
+
* over stdio with no client-side timeout at all. It was not hung; it emitted
|
|
7
|
+
* one `notifications/progress` frame per *source*, so on a repo with a single
|
|
8
|
+
* language adapter the whole multi-minute read fell between two frames. MCP
|
|
9
|
+
* clients reset a request's timeout when a progress frame arrives for it, so a
|
|
10
|
+
* correct run and a wedged one were indistinguishable from the outside, and
|
|
11
|
+
* the timeout fired on the correct one.
|
|
12
|
+
*
|
|
13
|
+
* ## What this is not
|
|
14
|
+
*
|
|
15
|
+
* It does not make anything faster, and it is not a guarantee: resetting a
|
|
16
|
+
* timeout on progress is a client behaviour, not something the protocol
|
|
17
|
+
* obliges. That is why the elapsed time goes *in* the message rather than the
|
|
18
|
+
* beat being a bare ping — a caller reading the frames can see the step
|
|
19
|
+
* advancing rather than being asserted to. Honest degradation (rule 7) cuts
|
|
20
|
+
* both ways here: this discloses that work is ongoing, it does not claim
|
|
21
|
+
* progress it cannot measure. The adapter is opaque while it runs, so the
|
|
22
|
+
* count of files done is not available to report and none is invented.
|
|
23
|
+
*/
|
|
24
|
+
/** Interval between beats while a step is running. Well inside the 60s default most clients use. */
|
|
25
|
+
export declare const HEARTBEAT_MS = 15000;
|
|
26
|
+
export declare const HEARTBEAT_ENV_VAR = "DESCRY_PROGRESS_HEARTBEAT_MS";
|
|
27
|
+
/**
|
|
28
|
+
* The interval in force, honouring `DESCRY_PROGRESS_HEARTBEAT_MS`.
|
|
29
|
+
*
|
|
30
|
+
* A zero, a negative or an unreadable value falls back to the default rather
|
|
31
|
+
* than being taken literally: zero is a busy loop and not a plausible way to
|
|
32
|
+
* ask for one, so reading it as "the operator meant to disable beats" would
|
|
33
|
+
* turn a typo into the exact silence this module removes.
|
|
34
|
+
*/
|
|
35
|
+
export declare function heartbeatMs(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Run `work`, beating `label` plus elapsed seconds every `intervalMs` until it
|
|
38
|
+
* settles.
|
|
39
|
+
*
|
|
40
|
+
* The timer is cleared in a `finally`, so a step that throws stops beating on
|
|
41
|
+
* the same tick it fails — a beat outliving its step would report a run that
|
|
42
|
+
* has already finished or died. `unref()` keeps a pending beat from holding
|
|
43
|
+
* the process open on its own.
|
|
44
|
+
*/
|
|
45
|
+
export declare function withHeartbeat<T>(label: string, beat: (message: string) => void, work: () => Promise<T>, intervalMs?: number): Promise<T>;
|
|
46
|
+
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../src/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oGAAoG;AACpG,eAAO,MAAM,YAAY,QAAS,CAAC;AAEnC,eAAO,MAAM,iBAAiB,iCAAiC,CAAC;AAEhE;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,UAAU,GAAE,MAAsB,GACjC,OAAO,CAAC,CAAC,CAAC,CAWZ"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P6-B2 — a periodic progress beat for the duration of one long awaited step.
|
|
3
|
+
*
|
|
4
|
+
* `analyze` on a 7,700-file repository reliably exceeded the calling client's
|
|
5
|
+
* timeout even with the heap ceiling raised, and completed only when driven
|
|
6
|
+
* over stdio with no client-side timeout at all. It was not hung; it emitted
|
|
7
|
+
* one `notifications/progress` frame per *source*, so on a repo with a single
|
|
8
|
+
* language adapter the whole multi-minute read fell between two frames. MCP
|
|
9
|
+
* clients reset a request's timeout when a progress frame arrives for it, so a
|
|
10
|
+
* correct run and a wedged one were indistinguishable from the outside, and
|
|
11
|
+
* the timeout fired on the correct one.
|
|
12
|
+
*
|
|
13
|
+
* ## What this is not
|
|
14
|
+
*
|
|
15
|
+
* It does not make anything faster, and it is not a guarantee: resetting a
|
|
16
|
+
* timeout on progress is a client behaviour, not something the protocol
|
|
17
|
+
* obliges. That is why the elapsed time goes *in* the message rather than the
|
|
18
|
+
* beat being a bare ping — a caller reading the frames can see the step
|
|
19
|
+
* advancing rather than being asserted to. Honest degradation (rule 7) cuts
|
|
20
|
+
* both ways here: this discloses that work is ongoing, it does not claim
|
|
21
|
+
* progress it cannot measure. The adapter is opaque while it runs, so the
|
|
22
|
+
* count of files done is not available to report and none is invented.
|
|
23
|
+
*/
|
|
24
|
+
/** Interval between beats while a step is running. Well inside the 60s default most clients use. */
|
|
25
|
+
export const HEARTBEAT_MS = 15_000;
|
|
26
|
+
export const HEARTBEAT_ENV_VAR = "DESCRY_PROGRESS_HEARTBEAT_MS";
|
|
27
|
+
/**
|
|
28
|
+
* The interval in force, honouring `DESCRY_PROGRESS_HEARTBEAT_MS`.
|
|
29
|
+
*
|
|
30
|
+
* A zero, a negative or an unreadable value falls back to the default rather
|
|
31
|
+
* than being taken literally: zero is a busy loop and not a plausible way to
|
|
32
|
+
* ask for one, so reading it as "the operator meant to disable beats" would
|
|
33
|
+
* turn a typo into the exact silence this module removes.
|
|
34
|
+
*/
|
|
35
|
+
export function heartbeatMs() {
|
|
36
|
+
const raw = process.env[HEARTBEAT_ENV_VAR];
|
|
37
|
+
if (raw === undefined)
|
|
38
|
+
return HEARTBEAT_MS;
|
|
39
|
+
const parsed = Number(raw);
|
|
40
|
+
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
41
|
+
return HEARTBEAT_MS;
|
|
42
|
+
return parsed;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Run `work`, beating `label` plus elapsed seconds every `intervalMs` until it
|
|
46
|
+
* settles.
|
|
47
|
+
*
|
|
48
|
+
* The timer is cleared in a `finally`, so a step that throws stops beating on
|
|
49
|
+
* the same tick it fails — a beat outliving its step would report a run that
|
|
50
|
+
* has already finished or died. `unref()` keeps a pending beat from holding
|
|
51
|
+
* the process open on its own.
|
|
52
|
+
*/
|
|
53
|
+
export async function withHeartbeat(label, beat, work, intervalMs = heartbeatMs()) {
|
|
54
|
+
const started = Date.now();
|
|
55
|
+
const timer = setInterval(() => {
|
|
56
|
+
beat(`${label} — still running, ${Math.round((Date.now() - started) / 1000)}s elapsed`);
|
|
57
|
+
}, intervalMs);
|
|
58
|
+
timer.unref?.();
|
|
59
|
+
try {
|
|
60
|
+
return await work();
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
clearInterval(timer);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=heartbeat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../src/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oGAAoG;AACpG,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAEnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC3C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,YAAY,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,YAAY,CAAC;IACjE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,IAA+B,EAC/B,IAAsB,EACtB,aAAqB,WAAW,EAAE;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,IAAI,CAAC,GAAG,KAAK,qBAAqB,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC,EAAE,UAAU,CAAC,CAAC;IACf,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAChB,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,6 @@ export type { RpcRequest, RpcNotification, RpcResponse, RpcMessage, RpcId } from
|
|
|
22
22
|
/** The scenario format — storage, schema, refusals. Re-exported here so `descry check`
|
|
23
23
|
* doesn't reach past the package boundary — a second reader importing the relative path
|
|
24
24
|
* could drift from this one the day the schema changes. */
|
|
25
|
-
export { SCENARIO_SCHEMA_VERSION, isUnverifying, parseScenario, serializeScenario, scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, } from "./scenarios/index.ts";
|
|
26
|
-
export type { Scenario, ScenarioStep, ScenarioAssertion, ScenarioAssertionKind, ScenarioActionKind, ScenarioParseResult, TargetDescriptor, } from "./scenarios/index.ts";
|
|
25
|
+
export { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, isSecretRef, isUnverifying, parseScenario, readSecretRef, referencedVariables, resolveSecretText, secretRefFor, serializeScenario, scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, projectScenarioToRunPlan, projectRunPlanToScenario, } from "./scenarios/index.ts";
|
|
26
|
+
export type { Scenario, SecretEnvironment, SecretRef, SecretResolution, ScenarioStep, ScenarioAssertion, ScenarioAssertionKind, ScenarioActionKind, ScenarioParseResult, TargetDescriptor, ProjectedStep, ProjectedStepKind, ProjectedBrowserRunPlan, ProjectionRefusal, ScenarioProjection, PlanProjection, RawProjectedStep, ScenarioMeta, } from "./scenarios/index.ts";
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;yDAEyD;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1E,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEjG,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxF,YAAY,EACV,SAAS,EACT,cAAc,EACd,QAAQ,EACR,WAAW,EACX,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B;;6FAE6F;AAC7F,YAAY,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,SAAS,EACT,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,UAAU,EACV,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9D,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjG;;4DAE4D;AAC5D,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;yDAE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BAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,5 +11,5 @@ export { PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, negotiateVersion, parseM
|
|
|
11
11
|
/** The scenario format — storage, schema, refusals. Re-exported here so `descry check`
|
|
12
12
|
* doesn't reach past the package boundary — a second reader importing the relative path
|
|
13
13
|
* could drift from this one the day the schema changes. */
|
|
14
|
-
export { SCENARIO_SCHEMA_VERSION, isUnverifying, parseScenario, serializeScenario, scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, } from "./scenarios/index.js";
|
|
14
|
+
export { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, isSecretRef, isUnverifying, parseScenario, readSecretRef, referencedVariables, resolveSecretText, secretRefFor, serializeScenario, scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, projectScenarioToRunPlan, projectRunPlanToScenario, } from "./scenarios/index.js";
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;yDAEyD;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG1E,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,aAAa,CAAC;AAWrB,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAA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AAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RG-10's second half, joined to its first: predict, then propose — never
|
|
3
|
+
* predict, then drive. `documents/plans/runtime-gap-closure.md`'s Lane C3.
|
|
4
|
+
*
|
|
5
|
+
* The predict half is `reachablePages` (`@descryy/core`): a one-sided
|
|
6
|
+
* forward walk from any node — typically a `DATABASE_COLUMN` a diff touches
|
|
7
|
+
* — over `PROPAGATES_TO`/`READS`/`ASSIGNS`/`RETURNS`, crossing `USES_API`
|
|
8
|
+
* backward at an `API_ENDPOINT`, to whatever `PAGE`/`COMPONENT` the data can
|
|
9
|
+
* reach. That traversal already existed (Gap 8 step 3) and is untouched
|
|
10
|
+
* here.
|
|
11
|
+
*
|
|
12
|
+
* The propose half reuses lane journey's planner (`./propose-journey.ts`)
|
|
13
|
+
* exactly as `propose_journey` itself does — same function, same "propose,
|
|
14
|
+
* never invent" discipline, same navigate-only limitation (the graph has no
|
|
15
|
+
* selector, so a `PAGE` reached through the walk becomes a navigate step
|
|
16
|
+
* only when its own qualified name looks like a route path; everything
|
|
17
|
+
* else is `reachedNotProposed`, not guessed into a click). This module
|
|
18
|
+
* builds no second planner and no second projection — it is the join, not
|
|
19
|
+
* a third implementation.
|
|
20
|
+
*
|
|
21
|
+
* **This module never drives anything and never writes to a `Finding`.**
|
|
22
|
+
* Proving or disproving what it predicts is: a human (or an agent acting on
|
|
23
|
+
* a human's behalf) reviews the proposal, drives the application for real
|
|
24
|
+
* (`browser_start_session`, the browser primitives, `browser_save_scenario`
|
|
25
|
+
* to commit what actually happened), and records the outcome against the
|
|
26
|
+
* finding that predicted it — a step this module does not take, because
|
|
27
|
+
* `packages/ir/src/finding.ts` and the finding funnel are outside this
|
|
28
|
+
* lane's owned files. See the `predict_reach` tool's own description for
|
|
29
|
+
* where that handoff is named to a caller.
|
|
30
|
+
*
|
|
31
|
+
* ## `proveOrDisprove` — the join, added by the pipeline-joins lane (RG-10, §5 Lane C3)
|
|
32
|
+
*
|
|
33
|
+
* Still never drives anything. It takes evidence a caller *already*
|
|
34
|
+
* collected by driving an accepted scenario for real — `browser_run_scenario`'s
|
|
35
|
+
* own `graph: BrowserGraphWrite` (or, in a live pipeline run, the same
|
|
36
|
+
* `graphNodeId`-correlated evidence `descry-desktop`'s runtime execution
|
|
37
|
+
* already produces) — and compares it against what {@link predictThenPropose}
|
|
38
|
+
* predicted. `ObservedReach` is declared structurally, not imported from
|
|
39
|
+
* `../browser/*`, so this module (and every caller of it, including
|
|
40
|
+
* `descry-desktop`'s pipeline) takes no dependency on the browser package;
|
|
41
|
+
* a real `BrowserGraphWrite`'s resolved node ids structurally satisfy it
|
|
42
|
+
* without a cast.
|
|
43
|
+
*
|
|
44
|
+
* **Both directions are real answers, not just the confirming one.** A
|
|
45
|
+
* predicted page absent from `observed.visitedNodeIds` after the declared
|
|
46
|
+
* journey ran to completion is a disproof — the propagation this module
|
|
47
|
+
* predicted did not show up where the graph said it would — and rule 6/7
|
|
48
|
+
* require that to be as visible as a proof, never silently dropped in favour
|
|
49
|
+
* of the cases that confirmed the prediction.
|
|
50
|
+
*/
|
|
51
|
+
import { type AdjacencyProvider } from "@descryy/core";
|
|
52
|
+
import { type JourneyCandidateNode, type ProposedJourney } from "./propose-journey.ts";
|
|
53
|
+
export interface PredictThenProposeOptions {
|
|
54
|
+
readonly targetUrl: string;
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly savedAtCommit: string;
|
|
57
|
+
}
|
|
58
|
+
export interface PredictedReach {
|
|
59
|
+
/** Every PAGE/COMPONENT node the walk reached, in the order it found them. */
|
|
60
|
+
readonly reachedPages: readonly JourneyCandidateNode[];
|
|
61
|
+
/** Null iff `reachedPages` is empty — nothing to propose a journey toward. */
|
|
62
|
+
readonly proposal: ProposedJourney | null;
|
|
63
|
+
readonly notes: readonly string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Walks from `startNodeId` to whatever pages the data can reach, and — when
|
|
67
|
+
* it reaches at least one — proposes a navigate-only journey to them via
|
|
68
|
+
* the shared planner. Pure over `provider`: no browser, no write, no I/O.
|
|
69
|
+
*/
|
|
70
|
+
export declare function predictThenPropose(provider: AdjacencyProvider, startNodeId: string, options: PredictThenProposeOptions): PredictedReach;
|
|
71
|
+
/**
|
|
72
|
+
* What a caller already observed by driving an accepted journey for real —
|
|
73
|
+
* never produced by this module. Structural: a real `BrowserGraphWrite`
|
|
74
|
+
* (`browser_run_scenario`'s own reply) or a live run's `graphNodeId`-
|
|
75
|
+
* correlated evidence both satisfy this without a cast; see this module's
|
|
76
|
+
* header.
|
|
77
|
+
*/
|
|
78
|
+
export interface ObservedReach {
|
|
79
|
+
/** Graph node ids the real, already-driven journey's evidence actually correlated to. */
|
|
80
|
+
readonly visitedNodeIds: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
/** One predicted page, resolved against what really happened. */
|
|
83
|
+
export interface ProvenReach {
|
|
84
|
+
/** Predicted pages the real drive's own evidence shows were actually reached. */
|
|
85
|
+
readonly proven: readonly JourneyCandidateNode[];
|
|
86
|
+
/**
|
|
87
|
+
* Predicted pages the declared journey ran to completion without ever
|
|
88
|
+
* reaching. A real disproof — not "not yet checked" (that's simply the
|
|
89
|
+
* absence of an `ObservedReach` at all) — see this module's header for why
|
|
90
|
+
* this is recorded with the same weight as `proven`.
|
|
91
|
+
*/
|
|
92
|
+
readonly disproven: readonly JourneyCandidateNode[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The join itself: never drives, only compares. `predicted.reachedPages`
|
|
96
|
+
* partitions cleanly into `proven`/`disproven` against `observed.visitedNodeIds`
|
|
97
|
+
* — every predicted page lands in exactly one, so a caller can never read a
|
|
98
|
+
* prediction as "not checked" once it has a real `ObservedReach` in hand.
|
|
99
|
+
*/
|
|
100
|
+
export declare function proveOrDisprove(predicted: PredictedReach, observed: ObservedReach): ProvenReach;
|
|
101
|
+
//# sourceMappingURL=predict-then-propose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict-then-propose.d.ts","sourceRoot":"","sources":["../../src/planner/predict-then-propose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvG,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,yBAAyB,GACjC,cAAc,CAgBhB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACjD;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,GAAG,WAAW,CAQ/F"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RG-10's second half, joined to its first: predict, then propose — never
|
|
3
|
+
* predict, then drive. `documents/plans/runtime-gap-closure.md`'s Lane C3.
|
|
4
|
+
*
|
|
5
|
+
* The predict half is `reachablePages` (`@descryy/core`): a one-sided
|
|
6
|
+
* forward walk from any node — typically a `DATABASE_COLUMN` a diff touches
|
|
7
|
+
* — over `PROPAGATES_TO`/`READS`/`ASSIGNS`/`RETURNS`, crossing `USES_API`
|
|
8
|
+
* backward at an `API_ENDPOINT`, to whatever `PAGE`/`COMPONENT` the data can
|
|
9
|
+
* reach. That traversal already existed (Gap 8 step 3) and is untouched
|
|
10
|
+
* here.
|
|
11
|
+
*
|
|
12
|
+
* The propose half reuses lane journey's planner (`./propose-journey.ts`)
|
|
13
|
+
* exactly as `propose_journey` itself does — same function, same "propose,
|
|
14
|
+
* never invent" discipline, same navigate-only limitation (the graph has no
|
|
15
|
+
* selector, so a `PAGE` reached through the walk becomes a navigate step
|
|
16
|
+
* only when its own qualified name looks like a route path; everything
|
|
17
|
+
* else is `reachedNotProposed`, not guessed into a click). This module
|
|
18
|
+
* builds no second planner and no second projection — it is the join, not
|
|
19
|
+
* a third implementation.
|
|
20
|
+
*
|
|
21
|
+
* **This module never drives anything and never writes to a `Finding`.**
|
|
22
|
+
* Proving or disproving what it predicts is: a human (or an agent acting on
|
|
23
|
+
* a human's behalf) reviews the proposal, drives the application for real
|
|
24
|
+
* (`browser_start_session`, the browser primitives, `browser_save_scenario`
|
|
25
|
+
* to commit what actually happened), and records the outcome against the
|
|
26
|
+
* finding that predicted it — a step this module does not take, because
|
|
27
|
+
* `packages/ir/src/finding.ts` and the finding funnel are outside this
|
|
28
|
+
* lane's owned files. See the `predict_reach` tool's own description for
|
|
29
|
+
* where that handoff is named to a caller.
|
|
30
|
+
*
|
|
31
|
+
* ## `proveOrDisprove` — the join, added by the pipeline-joins lane (RG-10, §5 Lane C3)
|
|
32
|
+
*
|
|
33
|
+
* Still never drives anything. It takes evidence a caller *already*
|
|
34
|
+
* collected by driving an accepted scenario for real — `browser_run_scenario`'s
|
|
35
|
+
* own `graph: BrowserGraphWrite` (or, in a live pipeline run, the same
|
|
36
|
+
* `graphNodeId`-correlated evidence `descry-desktop`'s runtime execution
|
|
37
|
+
* already produces) — and compares it against what {@link predictThenPropose}
|
|
38
|
+
* predicted. `ObservedReach` is declared structurally, not imported from
|
|
39
|
+
* `../browser/*`, so this module (and every caller of it, including
|
|
40
|
+
* `descry-desktop`'s pipeline) takes no dependency on the browser package;
|
|
41
|
+
* a real `BrowserGraphWrite`'s resolved node ids structurally satisfy it
|
|
42
|
+
* without a cast.
|
|
43
|
+
*
|
|
44
|
+
* **Both directions are real answers, not just the confirming one.** A
|
|
45
|
+
* predicted page absent from `observed.visitedNodeIds` after the declared
|
|
46
|
+
* journey ran to completion is a disproof — the propagation this module
|
|
47
|
+
* predicted did not show up where the graph said it would — and rule 6/7
|
|
48
|
+
* require that to be as visible as a proof, never silently dropped in favour
|
|
49
|
+
* of the cases that confirmed the prediction.
|
|
50
|
+
*/
|
|
51
|
+
import { reachablePages } from "@descryy/core";
|
|
52
|
+
import { proposeJourney } from "./propose-journey.js";
|
|
53
|
+
/**
|
|
54
|
+
* Walks from `startNodeId` to whatever pages the data can reach, and — when
|
|
55
|
+
* it reaches at least one — proposes a navigate-only journey to them via
|
|
56
|
+
* the shared planner. Pure over `provider`: no browser, no write, no I/O.
|
|
57
|
+
*/
|
|
58
|
+
export function predictThenPropose(provider, startNodeId, options) {
|
|
59
|
+
const reach = reachablePages(provider, startNodeId);
|
|
60
|
+
// `reachablePages` already restricts itself to PAGE/COMPONENT nodes (see
|
|
61
|
+
// its own doc); no re-filtering needed here.
|
|
62
|
+
const reachedPages = reach.data.map((r) => ({
|
|
63
|
+
id: r.node.id,
|
|
64
|
+
type: r.node.type,
|
|
65
|
+
name: r.node.name,
|
|
66
|
+
}));
|
|
67
|
+
if (reachedPages.length === 0) {
|
|
68
|
+
return { reachedPages: [], proposal: null, notes: reach.notes };
|
|
69
|
+
}
|
|
70
|
+
const proposal = proposeJourney(reachedPages, options);
|
|
71
|
+
return { reachedPages, proposal, notes: [...reach.notes, ...proposal.notes] };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The join itself: never drives, only compares. `predicted.reachedPages`
|
|
75
|
+
* partitions cleanly into `proven`/`disproven` against `observed.visitedNodeIds`
|
|
76
|
+
* — every predicted page lands in exactly one, so a caller can never read a
|
|
77
|
+
* prediction as "not checked" once it has a real `ObservedReach` in hand.
|
|
78
|
+
*/
|
|
79
|
+
export function proveOrDisprove(predicted, observed) {
|
|
80
|
+
const visited = new Set(observed.visitedNodeIds);
|
|
81
|
+
const proven = [];
|
|
82
|
+
const disproven = [];
|
|
83
|
+
for (const page of predicted.reachedPages) {
|
|
84
|
+
(visited.has(page.id) ? proven : disproven).push(page);
|
|
85
|
+
}
|
|
86
|
+
return { proven, disproven };
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=predict-then-propose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict-then-propose.js","sourceRoot":"","sources":["../../src/planner/predict-then-propose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,cAAc,EAA0B,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAmD,MAAM,sBAAsB,CAAC;AAgBvG;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAA2B,EAC3B,WAAmB,EACnB,OAAkC;IAElC,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACpD,yEAAy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* The planner — proposes, never invents. Lane A1, item 5 of
|
|
3
|
+
* `documents/plans/runtime-gap-closure.md`, closing the rest of RG-1.
|
|
4
|
+
*
|
|
5
|
+
* ## What this is and is not
|
|
6
|
+
*
|
|
7
|
+
* Takes the `PAGE`/`COMPONENT` nodes a diff-scope traversal already found
|
|
8
|
+
* (the same `scopeChange` the `scope` tool calls — this module receives its
|
|
9
|
+
* output, it does not recompute it) and turns them into a **proposed**
|
|
10
|
+
* `Scenario` — a value returned to the caller, never written to disk. Rule 1
|
|
11
|
+
* ("never fabricate input") is the whole shape of this module: the code
|
|
12
|
+
* graph has no DOM. It can name a route a `PAGE` node's own qualified path
|
|
13
|
+
* spells out; it has no selector, no accessible name, no evidence a button
|
|
14
|
+
* exists at all. So the proposal is **navigate-only** — one step per
|
|
15
|
+
* page-shaped route the scope touched — and every `COMPONENT` node (and
|
|
16
|
+
* every `PAGE` node with no path-shaped name to navigate to) is listed as
|
|
17
|
+
* *reached but not exercised*, disclosed rather than guessed into a `click`
|
|
18
|
+
* step this module cannot back with a real selector.
|
|
19
|
+
*
|
|
20
|
+
* ## Why this can never execute anything
|
|
21
|
+
*
|
|
22
|
+
* The only way a `Scenario` becomes replayable is `writeScenario`
|
|
23
|
+
* (`scenarios/storage.ts`), and the only caller in this codebase that calls
|
|
24
|
+
* it is `browser_save_scenario` — which requires a **live, already-driven
|
|
25
|
+
* browser session** and independently verifies every step actually
|
|
26
|
+
* resolves before it writes anything (`collectUnresolvedTargets`). This
|
|
27
|
+
* module never imports `writeScenario` and never touches a browser session.
|
|
28
|
+
* A proposal from here is data in a tool reply; nothing runs until a human
|
|
29
|
+
* (or an agent acting on a human's behalf) drives the app for real and
|
|
30
|
+
* calls `browser_save_scenario` — the acceptance act — which is what
|
|
31
|
+
* produces the one artifact (`descry/scenarios/*.scenario.json`) that
|
|
32
|
+
* `browser_run_scenario` can replay. See `propose-journey.test.ts`'s
|
|
33
|
+
* "nothing executes without an acceptance record" case.
|
|
34
|
+
*/
|
|
35
|
+
import { type Scenario } from "../scenarios/index.ts";
|
|
36
|
+
export interface JourneyCandidateNode {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly type: string;
|
|
39
|
+
readonly name: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ProposedJourney {
|
|
42
|
+
/** A `Scenario`-shaped proposal. `assertions` is always empty: this module has no evidence to assert against, and inventing one would be a confident false claim about a page it never observed. */
|
|
43
|
+
readonly scenario: Scenario;
|
|
44
|
+
/** `PAGE` nodes in scope whose name did not look like a navigable path, and every `COMPONENT` node — real graph hits, listed rather than guessed into a step. */
|
|
45
|
+
readonly reachedNotProposed: readonly JourneyCandidateNode[];
|
|
46
|
+
readonly notes: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Builds a proposed journey from the `PAGE`/`COMPONENT` nodes a diff scope
|
|
50
|
+
* already found. `nodes` is typically `[...scoped.changed, ...scoped.affected]`
|
|
51
|
+
* mapped to their graph node — the caller (the MCP tool) owns fetching that;
|
|
52
|
+
* this function is pure over the result so it is exhaustively testable
|
|
53
|
+
* without a graph.
|
|
54
|
+
*/
|
|
55
|
+
export declare function proposeJourney(nodes: readonly JourneyCandidateNode[], options: {
|
|
56
|
+
readonly targetUrl: string;
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly savedAtCommit: string;
|
|
59
|
+
}): ProposedJourney;
|
|
60
|
+
//# sourceMappingURL=propose-journey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-journey.d.ts","sourceRoot":"","sources":["../../src/planner/propose-journey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,oMAAoM;IACpM,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,iKAAiK;IACjK,QAAQ,CAAC,kBAAkB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAOD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,oBAAoB,EAAE,EACtC,OAAO,EAAE;IACP,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,GACA,eAAe,CAwDjB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The planner — proposes, never invents. Lane A1, item 5 of
|
|
3
|
+
* `documents/plans/runtime-gap-closure.md`, closing the rest of RG-1.
|
|
4
|
+
*
|
|
5
|
+
* ## What this is and is not
|
|
6
|
+
*
|
|
7
|
+
* Takes the `PAGE`/`COMPONENT` nodes a diff-scope traversal already found
|
|
8
|
+
* (the same `scopeChange` the `scope` tool calls — this module receives its
|
|
9
|
+
* output, it does not recompute it) and turns them into a **proposed**
|
|
10
|
+
* `Scenario` — a value returned to the caller, never written to disk. Rule 1
|
|
11
|
+
* ("never fabricate input") is the whole shape of this module: the code
|
|
12
|
+
* graph has no DOM. It can name a route a `PAGE` node's own qualified path
|
|
13
|
+
* spells out; it has no selector, no accessible name, no evidence a button
|
|
14
|
+
* exists at all. So the proposal is **navigate-only** — one step per
|
|
15
|
+
* page-shaped route the scope touched — and every `COMPONENT` node (and
|
|
16
|
+
* every `PAGE` node with no path-shaped name to navigate to) is listed as
|
|
17
|
+
* *reached but not exercised*, disclosed rather than guessed into a `click`
|
|
18
|
+
* step this module cannot back with a real selector.
|
|
19
|
+
*
|
|
20
|
+
* ## Why this can never execute anything
|
|
21
|
+
*
|
|
22
|
+
* The only way a `Scenario` becomes replayable is `writeScenario`
|
|
23
|
+
* (`scenarios/storage.ts`), and the only caller in this codebase that calls
|
|
24
|
+
* it is `browser_save_scenario` — which requires a **live, already-driven
|
|
25
|
+
* browser session** and independently verifies every step actually
|
|
26
|
+
* resolves before it writes anything (`collectUnresolvedTargets`). This
|
|
27
|
+
* module never imports `writeScenario` and never touches a browser session.
|
|
28
|
+
* A proposal from here is data in a tool reply; nothing runs until a human
|
|
29
|
+
* (or an agent acting on a human's behalf) drives the app for real and
|
|
30
|
+
* calls `browser_save_scenario` — the acceptance act — which is what
|
|
31
|
+
* produces the one artifact (`descry/scenarios/*.scenario.json`) that
|
|
32
|
+
* `browser_run_scenario` can replay. See `propose-journey.test.ts`'s
|
|
33
|
+
* "nothing executes without an acceptance record" case.
|
|
34
|
+
*/
|
|
35
|
+
import { SCENARIO_SCHEMA_VERSION } from "../scenarios/index.js";
|
|
36
|
+
/** A qualified symbol name that looks like a route path: starts with `/`, single line, no whitespace. Deliberately conservative — false negatives (a real route this misses) fall through to `reachedNotProposed`, which is the safe direction (rule 2: when in doubt, omit). */
|
|
37
|
+
function looksLikeRoutePath(name) {
|
|
38
|
+
return name.startsWith("/") && !/\s/.test(name) && !name.includes("\n");
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Builds a proposed journey from the `PAGE`/`COMPONENT` nodes a diff scope
|
|
42
|
+
* already found. `nodes` is typically `[...scoped.changed, ...scoped.affected]`
|
|
43
|
+
* mapped to their graph node — the caller (the MCP tool) owns fetching that;
|
|
44
|
+
* this function is pure over the result so it is exhaustively testable
|
|
45
|
+
* without a graph.
|
|
46
|
+
*/
|
|
47
|
+
export function proposeJourney(nodes, options) {
|
|
48
|
+
const pages = nodes.filter((n) => n.type === "PAGE");
|
|
49
|
+
const components = nodes.filter((n) => n.type === "COMPONENT");
|
|
50
|
+
const routable = [];
|
|
51
|
+
const unroutable = [];
|
|
52
|
+
for (const page of pages)
|
|
53
|
+
(looksLikeRoutePath(page.name) ? routable : unroutable).push(page);
|
|
54
|
+
const base = options.targetUrl.endsWith("/") ? options.targetUrl.slice(0, -1) : options.targetUrl;
|
|
55
|
+
// Deduplicated and ordered — two PAGE nodes for the same route (a layout
|
|
56
|
+
// and a leaf, say) must not become two identical navigate steps.
|
|
57
|
+
const seenPaths = new Set();
|
|
58
|
+
const steps = [];
|
|
59
|
+
for (const page of routable) {
|
|
60
|
+
if (seenPaths.has(page.name))
|
|
61
|
+
continue;
|
|
62
|
+
seenPaths.add(page.name);
|
|
63
|
+
steps.push({ action: "navigate", url: `${base}${page.name}`, target: null, text: null });
|
|
64
|
+
}
|
|
65
|
+
const notes = [];
|
|
66
|
+
if (steps.length === 0) {
|
|
67
|
+
notes.push("No node in scope named a path-shaped route, so this proposal has no steps to offer. This is not a " +
|
|
68
|
+
"claim that nothing changed — it is a claim that nothing in scope looked like a navigable page from " +
|
|
69
|
+
"the graph alone. A human exploring the application directly (browser_start_session, then " +
|
|
70
|
+
"browser_save_scenario) is how a real journey gets declared from here.");
|
|
71
|
+
}
|
|
72
|
+
notes.push("Every step here is navigate-only: the code graph has no selector, no accessible name and no evidence " +
|
|
73
|
+
"an element exists, so this proposal never invents a click, a type or a submit. A human who accepts " +
|
|
74
|
+
"this proposal drives the rest of the journey for real and saves it with browser_save_scenario — that " +
|
|
75
|
+
"save is what turns a proposal into something replayable, and this module never calls it itself.");
|
|
76
|
+
if (unroutable.length + components.length > 0) {
|
|
77
|
+
notes.push(`${unroutable.length + components.length} node(s) in scope (${unroutable.length} page(s) with no ` +
|
|
78
|
+
`path-shaped name, ${components.length} component(s)) are reached but not proposed as a step — listed ` +
|
|
79
|
+
"in reachedNotProposed rather than guessed into one.");
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
scenario: {
|
|
83
|
+
schemaVersion: SCENARIO_SCHEMA_VERSION,
|
|
84
|
+
name: options.name,
|
|
85
|
+
description: "Proposed by the planner from a diff scope's PAGE nodes — not accepted, not saved, not runnable until a human reviews it.",
|
|
86
|
+
targetUrl: steps[0]?.url ?? options.targetUrl,
|
|
87
|
+
savedAt: new Date().toISOString(),
|
|
88
|
+
savedAtCommit: options.savedAtCommit,
|
|
89
|
+
steps,
|
|
90
|
+
assertions: [],
|
|
91
|
+
},
|
|
92
|
+
reachedNotProposed: [...unroutable, ...components],
|
|
93
|
+
notes,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=propose-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-journey.js","sourceRoot":"","sources":["../../src/planner/propose-journey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,uBAAuB,EAAiB,MAAM,uBAAuB,CAAC;AAgB/E,iRAAiR;AACjR,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAsC,EACtC,OAIC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAE/D,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,CAAC,kBAAkB,CAAC,IAA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AAU,CAAC,MAAM,sBAAsB,UAAU,CAAC,MAAM,mBAAmB;YAChG,qBAAqB,UAAU,CAAC,MAAM,iEAAiE;YACvG,qDAAqD,CACxD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,aAAa,EAAE,uBAAuB;YACtC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,0HAA0H;YACvI,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,OAAO,CAAC,SAAS;YAC7C,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACjC,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,KAAK;YACL,UAAU,EAAE,EAAE;SACf;QACD,kBAAkB,EAAE,CAAC,GAAG,UAAU,EAAE,GAAG,UAAU,CAAC;QAClD,KAAK;KACN,CAAC;AACJ,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* in config and loaded at runtime via a `create*Adapter` convention (an ambiguous match
|
|
4
4
|
* errors, never guesses). A failed load is disclosed as `SourceLoadFailure`, never silently
|
|
5
5
|
* skipped (§20.2). Specifiers resolve from the repo root first (npx isolates adapters there), then this package's own closure. */
|
|
6
|
-
import type { IRSource, LanguageAdapter, RepoRoot } from "@descryy/ir";
|
|
6
|
+
import type { IRSource, LanguageAdapter, RepoRoot, StructuredSkipEntry } from "@descryy/ir";
|
|
7
7
|
/** One entry in the configured source list. A bare string is `{ module }`. */
|
|
8
8
|
export interface SourceSpec {
|
|
9
9
|
readonly module: string;
|
|
@@ -81,6 +81,14 @@ export declare function loadSources(entries: readonly (string | SourceSpec)[], r
|
|
|
81
81
|
* routinely disable to get their work done is not a security control."
|
|
82
82
|
*/
|
|
83
83
|
export declare function withSafeAlternative(reason: string, specifier: string, repoPath: string | undefined): Promise<string>;
|
|
84
|
+
/** One adapter's `detect()`-time evidence, kept alongside `applicable`/`skipped` rather than
|
|
85
|
+
* folded into either — `DetectionResult.evidence` is populated on a match as much as on a
|
|
86
|
+
* skip (a matched adapter can still report "skipped 3: a separate checkout with its own
|
|
87
|
+
* .git"), so it is collected independently of which bucket the source landed in. */
|
|
88
|
+
export interface DetectionEvidence {
|
|
89
|
+
readonly source: string;
|
|
90
|
+
readonly entries: readonly (string | StructuredSkipEntry)[];
|
|
91
|
+
}
|
|
84
92
|
/** Asks each loaded adapter whether it claims this repository. A non-`LanguageAdapter`
|
|
85
93
|
* source (the git reader) always runs. A throwing `detect` counts as "did not detect",
|
|
86
94
|
* with the reason recorded — it can't fail the whole run, and can't hide either. */
|
|
@@ -90,5 +98,6 @@ export declare function detectSources(sources: readonly LoadedSource[], root: Re
|
|
|
90
98
|
source: LoadedSource;
|
|
91
99
|
reason: string;
|
|
92
100
|
}[];
|
|
101
|
+
readonly evidence: readonly DetectionEvidence[];
|
|
93
102
|
}>;
|
|
94
103
|
//# sourceMappingURL=registry.d.ts.map
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;mIAImI;AAOnI,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;mIAImI;AAOnI,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI5F,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO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AChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,mBAAmB,CAAC,EAAE,CAAC;CAC7D;AAED;;qFAEqF;AACrF,wBAAsB,aAAa,CACjC,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC;IACT,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtE,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACjD,CAAC,CA2BD"}
|
package/dist/registry.js
CHANGED
|
@@ -291,6 +291,7 @@ async function importSource(specifier, repoPath) {
|
|
|
291
291
|
export async function detectSources(sources, root) {
|
|
292
292
|
const applicable = [];
|
|
293
293
|
const skipped = [];
|
|
294
|
+
const evidence = [];
|
|
294
295
|
for (const entry of sources) {
|
|
295
296
|
if (entry.adapter === null) {
|
|
296
297
|
applicable.push(entry);
|
|
@@ -298,6 +299,9 @@ export async function detectSources(sources, root) {
|
|
|
298
299
|
}
|
|
299
300
|
try {
|
|
300
301
|
const detection = await entry.adapter.detect(root);
|
|
302
|
+
if (detection.evidence.length > 0) {
|
|
303
|
+
evidence.push({ source: entry.source.id, entries: detection.evidence });
|
|
304
|
+
}
|
|
301
305
|
if (detection.detected)
|
|
302
306
|
applicable.push(entry);
|
|
303
307
|
else
|
|
@@ -310,6 +314,6 @@ export async function detectSources(sources, root) {
|
|
|
310
314
|
skipped.push({ source: entry, reason: `detection failed — ${describe(error)}` });
|
|
311
315
|
}
|
|
312
316
|
}
|
|
313
|
-
return { applicable, skipped };
|
|
317
|
+
return { applicable, skipped, evidence };
|
|
314
318
|
}
|
|
315
319
|
//# sourceMappingURL=registry.js.map
|