@descryy/mcp 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-handshake.d.ts +8 -75
- package/dist/action-handshake.d.ts.map +1 -1
- package/dist/action-handshake.js +9 -79
- package/dist/action-handshake.js.map +1 -1
- package/dist/bin/descry-mcp.d.ts +4 -15
- package/dist/bin/descry-mcp.d.ts.map +1 -1
- package/dist/bin/descry-mcp.js +12 -42
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +59 -224
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +9 -55
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +10 -43
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +20 -54
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +4 -16
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +6 -20
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/graph-write.d.ts +4 -45
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +8 -53
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts +7 -91
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +40 -194
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -34
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js +4 -24
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/registry.d.ts +26 -106
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +20 -77
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-resolve.d.ts +10 -44
- package/dist/browser/scenario-resolve.d.ts.map +1 -1
- package/dist/browser/scenario-resolve.js +10 -41
- package/dist/browser/scenario-resolve.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +12 -70
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +30 -90
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/stack-parser.d.ts +4 -28
- package/dist/browser/stack-parser.d.ts.map +1 -1
- package/dist/browser/stack-parser.js +12 -39
- package/dist/browser/stack-parser.js.map +1 -1
- package/dist/browser/tool-support.d.ts +20 -67
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +21 -65
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/url-scheme.d.ts +14 -0
- package/dist/browser/url-scheme.d.ts.map +1 -0
- package/dist/browser/url-scheme.js +38 -0
- package/dist/browser/url-scheme.js.map +1 -0
- package/dist/cancellation.d.ts +11 -46
- package/dist/cancellation.d.ts.map +1 -1
- package/dist/cancellation.js +11 -46
- package/dist/cancellation.js.map +1 -1
- package/dist/capped.d.ts +9 -33
- package/dist/capped.d.ts.map +1 -1
- package/dist/capped.js +7 -27
- package/dist/capped.js.map +1 -1
- package/dist/disclosure-ledger.d.ts +6 -30
- package/dist/disclosure-ledger.d.ts.map +1 -1
- package/dist/disclosure-ledger.js +4 -26
- package/dist/disclosure-ledger.js.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/module-trust.d.ts +24 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +60 -0
- package/dist/module-trust.js.map +1 -0
- package/dist/path-confinement.d.ts +31 -0
- package/dist/path-confinement.d.ts.map +1 -0
- package/dist/path-confinement.js +44 -0
- package/dist/path-confinement.js.map +1 -0
- package/dist/protocol.d.ts +10 -53
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -60
- package/dist/protocol.js.map +1 -1
- package/dist/registry.d.ts +10 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -90
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +42 -11
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +74 -10
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +7 -66
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +39 -114
- package/dist/runtime-registry.js.map +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +1 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts +4 -18
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +14 -34
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +18 -74
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +7 -34
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/storage.d.ts +11 -41
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +57 -47
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +37 -17
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +67 -259
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +69 -250
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +24 -118
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +44 -166
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +3 -21
- package/dist/tools/browser-click.d.ts.map +1 -1
- package/dist/tools/browser-click.js +10 -31
- package/dist/tools/browser-click.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +4 -13
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +4 -13
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-fill.d.ts +5 -36
- package/dist/tools/browser-fill.d.ts.map +1 -1
- package/dist/tools/browser-fill.js +9 -44
- package/dist/tools/browser-fill.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +6 -27
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +6 -23
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts +5 -31
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +10 -46
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts +3 -28
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +15 -74
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-snapshot.d.ts +6 -39
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +4 -31
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts +4 -23
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +33 -55
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-type.d.ts +5 -35
- package/dist/tools/browser-type.d.ts.map +1 -1
- package/dist/tools/browser-type.js +10 -45
- package/dist/tools/browser-type.js.map +1 -1
- package/dist/tools/contracts.d.ts +9 -86
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +24 -80
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +42 -30
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +81 -62
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts +18 -2
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +118 -26
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts +5 -16
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +3 -10
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.d.ts +4 -33
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -31
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +7 -51
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +15 -67
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +3 -8
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +66 -113
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +60 -28
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts +7 -45
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +10 -48
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/lookup.d.ts +4 -14
- package/dist/tools/lookup.d.ts.map +1 -1
- package/dist/tools/lookup.js +4 -14
- package/dist/tools/lookup.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +7 -54
- package/dist/tools/mark-incident.d.ts.map +1 -1
- package/dist/tools/mark-incident.js +15 -68
- package/dist/tools/mark-incident.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +27 -210
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +257 -435
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -100
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +24 -152
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/pr-analysis.d.ts +18 -2
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +73 -23
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +68 -16
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +98 -35
- package/dist/tools/pre-push.js.map +1 -1
- package/dist/tools/propagation.d.ts +11 -53
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +14 -57
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts +13 -63
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +33 -105
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts +4 -40
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +4 -40
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +4 -63
- package/dist/tools/runtime-incident.d.ts.map +1 -1
- package/dist/tools/runtime-incident.js +10 -87
- package/dist/tools/runtime-incident.js.map +1 -1
- package/dist/tools/scope.d.ts +7 -25
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +10 -29
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +11 -86
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +7 -71
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/validate.d.ts +14 -69
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +23 -74
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/verification-status.d.ts +9 -64
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +9 -62
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts +5 -52
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +6 -56
- package/dist/tools/verify-claim.js.map +1 -1
- package/dist/transport.d.ts +15 -52
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -60
- package/dist/transport.js.map +1 -1
- package/package.json +30 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"similar-incidents.d.ts","sourceRoot":"","sources":["../../src/tools/similar-incidents.ts"],"names":[],"mappings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@ -1,68 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `rootCauseSearch` — the `related` list every `impact` reply carries — walks
|
|
8
|
-
* `INCIDENT_CORRELATED`/`FIXED_BY` edges out of a node that already exists.
|
|
9
|
-
* It cannot help with a failure observed a moment ago: a stack trace and a set
|
|
10
|
-
* of touched files have no node, so there is nothing to walk from. This tool
|
|
11
|
-
* is the other direction. It takes the failure as a description and ranks the
|
|
12
|
-
* `INCIDENT` nodes the graph already holds against it, using the two signals
|
|
13
|
-
* `similarIncidents` (`@descryy/core`, DEC-274 step 2) computes from data the
|
|
14
|
-
* graph already has: file-set Jaccard over `INCIDENT_CORRELATED`, and
|
|
15
|
-
* token-set Jaccard over the incident's own text. Deterministic, no vector
|
|
16
|
-
* store, no model call.
|
|
17
|
-
*
|
|
18
|
-
* ## The disclosure this tool exists to carry, and it is not optional
|
|
19
|
-
*
|
|
20
|
-
* DEC-279 makes one sentence mandatory here, and DEC-274 is why. That
|
|
21
|
-
* measurement ran the correlation machinery over `descry-core`,
|
|
22
|
-
* `descry-runtime` and `descry-adapters` — 734, 459 and 203 commits — and
|
|
23
|
-
* found **zero `INCIDENT` nodes in all three**. Not few: zero. Only an
|
|
24
|
-
* explicit `git revert` mints an `INCIDENT` today; a fix-forward commit, which
|
|
25
|
-
* is how almost every real bug is actually fixed, mints nothing at all.
|
|
26
|
-
*
|
|
27
|
-
* So this matcher's **recall is not computable — 0/0, not 0%**. It has never
|
|
28
|
-
* been handed a real incident to find, and no number describes how many it
|
|
29
|
-
* would miss. An empty result therefore means *"no linked incident in this
|
|
30
|
-
* graph, and this graph has few or no incidents"* and must never be read as
|
|
31
|
-
* *"no similar incident exists."* That is the same *absence is not evidence*
|
|
32
|
-
* obligation `impact` already carries on every reply, and `similar-incidents.test.ts`
|
|
33
|
-
* fails if it goes missing from either the empty or the non-empty branch.
|
|
34
|
-
*
|
|
35
|
-
* ## Two different absences, and they are not the same result
|
|
36
|
-
*
|
|
37
|
-
* `ai-tool-contract.md` §1.3a splits them, and the split is the whole reason
|
|
38
|
-
* this endpoint is interesting:
|
|
39
|
-
*
|
|
40
|
-
* - **Incidents exist and none matched.** The denominator is real, the tool
|
|
41
|
-
* looked completely, and the absence is a fact about the code. `state:
|
|
42
|
-
* "empty"`, per §1.1's split.
|
|
43
|
-
* - **The graph holds zero `INCIDENT` nodes.** There is no denominator.
|
|
44
|
-
* Nothing was looked at, and the reason is Descry's producer coverage
|
|
45
|
-
* rather than anything about this repository: only `git revert` mints an
|
|
46
|
-
* `INCIDENT` and fix-forward mints nothing. Answering "empty" there would
|
|
47
|
-
* say *"this code has no similar incidents"* when the true statement is
|
|
48
|
-
* *"Descry cannot see most incidents in any codebase"* — the
|
|
49
|
-
* empty-denominator defect inside the endpoint written to demonstrate the
|
|
50
|
-
* rule against it. So it is a refusal, carried as `state: "refused"` (§1.1:
|
|
51
|
-
* `refused` is a result state, and `not analysable` is a report category —
|
|
52
|
-
* different axes, never this).
|
|
53
|
-
*
|
|
54
|
-
* §1.3a generalises it past this tool: **when a query's population is itself
|
|
55
|
-
* zero, the answer is a refusal, never an empty result.** That puts this in
|
|
56
|
-
* line with its siblings rather than apart from them — `contracts` refuses on
|
|
57
|
-
* a graph with no endpoint, `propagation` when no walked edge type touches
|
|
58
|
-
* the start node.
|
|
59
|
-
*
|
|
60
|
-
* The denominator travels in the payload either way. `incidentsInGraph` is
|
|
61
|
-
* the population and `analysed` is false only when it is zero, so a caller
|
|
62
|
-
* can tell the two absences apart **from the payload alone, with no string
|
|
63
|
-
* matching on prose** — §1's distinguishability requirement, satisfied
|
|
64
|
-
* without waiting for the wider envelope.
|
|
65
|
-
*/
|
|
1
|
+
/** `similar_incidents` ranks existing `INCIDENT` nodes against a failure with no graph node yet,
|
|
2
|
+
* deterministically (file/token Jaccard, no vector store). DEC-274 found zero `INCIDENT` nodes
|
|
3
|
+
* across three repos (734/459/203 commits): recall is 0/0, not 0% — an empty result never means
|
|
4
|
+
* "no similar incident exists" (DEC-279). §1.3a: a zero-incident graph is `refused`, never `empty`
|
|
5
|
+
* — the same split `contracts` and `propagation` apply to their own zero-population case. */
|
|
66
6
|
import { similarIncidents } from "@descryy/core";
|
|
67
7
|
import { answer, briefNode, optionalInteger, optionalString, optionalStringArray, ToolInputError, } from "./kit.js";
|
|
68
8
|
const SCHEMA = {
|
|
@@ -91,12 +31,8 @@ const SCHEMA = {
|
|
|
91
31
|
},
|
|
92
32
|
additionalProperties: false,
|
|
93
33
|
};
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* Written once here rather than inline at three return sites, because the one
|
|
98
|
-
* failure mode this tool has is a branch that forgets it.
|
|
99
|
-
*/
|
|
34
|
+
/** The mandatory disclosure sentence, shaped per branch. Written once here rather than inline at
|
|
35
|
+
* three return sites, so no branch can forget it. */
|
|
100
36
|
function recallDisclosure(incidentsInGraph) {
|
|
101
37
|
return ((incidentsInGraph === 0
|
|
102
38
|
? "This graph holds no INCIDENT node at all, so nothing was compared. "
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"similar-incidents.js","sourceRoot":"","sources":["../../src/tools/similar-incidents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"similar-incidents.js","sourceRoot":"","sources":["../../src/tools/similar-incidents.ts"],"names":[],"mappings":"AAAA;;;;8FAI8F;AAE9F,OAAO,EAAE,gBAAgB,EAAkC,MAAM,eAAe,CAAC;AAEjF,OAAO,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,cAAc,GAIf,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB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;QAC3F,4FAA4F;QAC5F,2FAA2F;QAC3F,4FAA4F;QAC5F,wEAAwE;IAC1E,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
package/dist/tools/validate.d.ts
CHANGED
|
@@ -1,53 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `validate` — §15
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* code rather than a measurement of the graph.
|
|
7
|
-
*
|
|
8
|
-
* ## Two things this tool refuses to do, and both are the point
|
|
9
|
-
*
|
|
10
|
-
* 1. **It does not report a variable that is read and never declared, by
|
|
11
|
-
* default.** Measured on two real repositories, that rule produces 18 wrong
|
|
12
|
-
* findings on one and 107 on the other. A finding needs a read that asserts
|
|
13
|
-
* *requirement* — no fallback at the read site — and a declaration surface
|
|
14
|
-
* complete enough for an absence to mean something. See `validation/env.ts`.
|
|
15
|
-
*
|
|
16
|
-
* 2. **It does not return `ok` with an empty list when no adapter supplied
|
|
17
|
-
* reads.** That is `refused` with the reason and the exact `attrs` key
|
|
18
|
-
* it needs, because "no missing variables" is a false statement when the code
|
|
19
|
-
* was never read.
|
|
20
|
-
*
|
|
21
|
-
* The declaration half runs regardless: configuration files are read straight
|
|
22
|
-
* from the repository, which needs no adapter and no resolution.
|
|
23
|
-
*
|
|
24
|
-
* ## "By default" above is load-bearing: pass `files` and a second rule runs
|
|
25
|
-
*
|
|
26
|
-
* UAT round 3, Suggestion 4. Rule 1's own precondition — the accessor has to
|
|
27
|
-
* fail on absence — made this check structurally silent on real work: a
|
|
28
|
-
* Python feature read two new third-party API keys through
|
|
29
|
-
* `os.environ.get()`, declared nowhere, and this tool said "Clean" because
|
|
30
|
-
* nothing anywhere asserted requirement. Pass `files` (the diff you are
|
|
31
|
-
* about to push, exactly the same scope `contracts`' `paths` and this tool's
|
|
32
|
-
* own `files` already narrow to elsewhere) and a second rule, gated only on
|
|
33
|
-
* "new in this diff" rather than on accessor shape, reports
|
|
34
|
-
* `NEW_READ_UNDECLARED` for any such read regardless of whether it would
|
|
35
|
-
* fail on absence — see `validation/env.ts`'s own header for why that
|
|
36
|
-
* substitution keeps precision high without an extra guard.
|
|
37
|
-
*/
|
|
2
|
+
* `validate` — §15 static validation: env/config checks.
|
|
3
|
+
* Omits a var unless its read fails-on-absence AND declaration surface is complete
|
|
4
|
+
* (18/107 wrong findings measured otherwise); refuses rather than `ok` when no reads
|
|
5
|
+
* exist. Pass `files` for NEW_READ_UNDECLARED — catches accessor-shape-independent reads. */
|
|
38
6
|
import type { AttributeFinding, AttributeReport, ConfigGraph, ConfigReadSite, EnvClaim, EnvEvidence, EnvFindingKind, EnvReport, MigrationIntegrityFinding, MigrationIntegrityReport, RollbackFinding, RollbackReport } from "@descryy/core";
|
|
39
7
|
import type { ResolutionLevel } from "@descryy/ir";
|
|
40
8
|
import { type ToolDefinition } from "./kit.ts";
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* `claim` is the axis that matters: a `defect` is a statement about the code, a
|
|
45
|
-
* `lead` is something to look at. A variable read with no fallback and
|
|
46
|
-
* declared nowhere is the first; a variable set in one file and documented in
|
|
47
|
-
* no example file is the second, and reporting it as the first is how this
|
|
48
|
-
* check produced 18 and 107 wrong findings on two real repositories before the
|
|
49
|
-
* distinction existed.
|
|
50
|
-
*/
|
|
9
|
+
/** One env/config finding. `claim` distinguishes `defect` (code contradiction) from
|
|
10
|
+
* `lead` (worth a look) — conflating them caused 18/107 wrong findings on two repos. */
|
|
51
11
|
export interface EnvFindingReport {
|
|
52
12
|
readonly kind: EnvFindingKind;
|
|
53
13
|
readonly name: string;
|
|
@@ -57,13 +17,8 @@ export interface EnvFindingReport {
|
|
|
57
17
|
readonly evidence: readonly EnvEvidence[];
|
|
58
18
|
readonly resolution: ResolutionLevel;
|
|
59
19
|
}
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* Only variables whose dependent set could actually be computed appear —
|
|
64
|
-
* §15.3's third check feeding the first. An unknown count is not a zero, so it
|
|
65
|
-
* is left out rather than reported as none.
|
|
66
|
-
*/
|
|
20
|
+
/** A variable and how much of the repo depends on it (§15.3's third check feeding
|
|
21
|
+
* the first). Only variables with a computable dependent set appear — unknown ≠ zero. */
|
|
67
22
|
export interface ConfigDependencyReport {
|
|
68
23
|
readonly name: string;
|
|
69
24
|
/** A lower bound, never a total. */
|
|
@@ -85,13 +40,8 @@ export interface ValidateData {
|
|
|
85
40
|
readonly coverage: EnvReport["coverage"];
|
|
86
41
|
/** Declared and read nowhere. A dead-configuration lead, not a finding. */
|
|
87
42
|
readonly declaredNeverRead: number;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* The whole point of the field: with it false, "no missing variables" would
|
|
92
|
-
* be a statement about code that was never read, so the call is degraded
|
|
93
|
-
* rather than clean.
|
|
94
|
-
*/
|
|
43
|
+
/** False when no adapter supplied environment reads — otherwise "no missing
|
|
44
|
+
* variables" would misstate code that was never read as clean. */
|
|
95
45
|
readonly readsAvailable: boolean;
|
|
96
46
|
readonly configGraph: {
|
|
97
47
|
readonly counts: ConfigGraph["counts"];
|
|
@@ -112,11 +62,8 @@ export interface ValidateData {
|
|
|
112
62
|
/** Named in plain words when `ran` is false. */
|
|
113
63
|
readonly blockers: readonly string[];
|
|
114
64
|
};
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
* defect, never a lead: this is a contradiction between two producers that
|
|
118
|
-
* must agree, provable from the graph alone.
|
|
119
|
-
*/
|
|
65
|
+
/** §"attribute read, type doesn't declare it" — always a defect (graph-provable
|
|
66
|
+
* contradiction between two producers), never a lead. */
|
|
120
67
|
readonly attributeExistence: {
|
|
121
68
|
readonly findings: readonly AttributeFinding[];
|
|
122
69
|
readonly findingsTotal: number;
|
|
@@ -124,10 +71,8 @@ export interface ValidateData {
|
|
|
124
71
|
/** False when no READS edge onto a type-like node carried field-existence info at all. */
|
|
125
72
|
readonly ran: boolean;
|
|
126
73
|
};
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* chain" — both always defects, both provable from the graph alone.
|
|
130
|
-
*/
|
|
74
|
+
/** §"migration outside its directory, or broken revision chain" — both always
|
|
75
|
+
* defects, both graph-provable. */
|
|
131
76
|
readonly migrationIntegrity: {
|
|
132
77
|
readonly findings: readonly MigrationIntegrityFinding[];
|
|
133
78
|
readonly findingsTotal: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/tools/validate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/tools/validate.ts"],"names":[],"mappings":"AAAA;;;;6FAI6F;AAY7F,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,QAAQ,EACR,WAAW,EACX,cAAc,EACd,SAAS,EACT,yBAAyB,EACzB,wBAAwB,EACxB,eAAe,EACf,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAA0D,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvG;yFACyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED;0FAC0F;AAC1F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,UA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AAC;QAC9C,0DAA0D;QAC1D,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;QACtB,gDAAgD;QAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;KACtC,CAAC;IACF;8DAC0D;IAC1D,QAAQ,CAAC,kBAAkB,EAAE;QAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;QAC/C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;QAC/C,0FAA0F;QAC1F,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;KACvB,CAAC;IACF;wCACoC;IACpC,QAAQ,CAAC,kBAAkB,EAAE;QAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,yBAAyB,EAAE,CAAC;QACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC;QACxD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5C,0EAA0E;QAC1E,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;QACtB,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC;KACzD,CAAC;CACH;AAyPD,eAAO,MAAM,YAAY,EAAE,cAwB1B,CAAC"}
|
package/dist/tools/validate.js
CHANGED
|
@@ -1,40 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `validate` — §15
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* code rather than a measurement of the graph.
|
|
7
|
-
*
|
|
8
|
-
* ## Two things this tool refuses to do, and both are the point
|
|
9
|
-
*
|
|
10
|
-
* 1. **It does not report a variable that is read and never declared, by
|
|
11
|
-
* default.** Measured on two real repositories, that rule produces 18 wrong
|
|
12
|
-
* findings on one and 107 on the other. A finding needs a read that asserts
|
|
13
|
-
* *requirement* — no fallback at the read site — and a declaration surface
|
|
14
|
-
* complete enough for an absence to mean something. See `validation/env.ts`.
|
|
15
|
-
*
|
|
16
|
-
* 2. **It does not return `ok` with an empty list when no adapter supplied
|
|
17
|
-
* reads.** That is `refused` with the reason and the exact `attrs` key
|
|
18
|
-
* it needs, because "no missing variables" is a false statement when the code
|
|
19
|
-
* was never read.
|
|
20
|
-
*
|
|
21
|
-
* The declaration half runs regardless: configuration files are read straight
|
|
22
|
-
* from the repository, which needs no adapter and no resolution.
|
|
23
|
-
*
|
|
24
|
-
* ## "By default" above is load-bearing: pass `files` and a second rule runs
|
|
25
|
-
*
|
|
26
|
-
* UAT round 3, Suggestion 4. Rule 1's own precondition — the accessor has to
|
|
27
|
-
* fail on absence — made this check structurally silent on real work: a
|
|
28
|
-
* Python feature read two new third-party API keys through
|
|
29
|
-
* `os.environ.get()`, declared nowhere, and this tool said "Clean" because
|
|
30
|
-
* nothing anywhere asserted requirement. Pass `files` (the diff you are
|
|
31
|
-
* about to push, exactly the same scope `contracts`' `paths` and this tool's
|
|
32
|
-
* own `files` already narrow to elsewhere) and a second rule, gated only on
|
|
33
|
-
* "new in this diff" rather than on accessor shape, reports
|
|
34
|
-
* `NEW_READ_UNDECLARED` for any such read regardless of whether it would
|
|
35
|
-
* fail on absence — see `validation/env.ts`'s own header for why that
|
|
36
|
-
* substitution keeps precision high without an extra guard.
|
|
37
|
-
*/
|
|
2
|
+
* `validate` — §15 static validation: env/config checks.
|
|
3
|
+
* Omits a var unless its read fails-on-absence AND declaration surface is complete
|
|
4
|
+
* (18/107 wrong findings measured otherwise); refuses rather than `ok` when no reads
|
|
5
|
+
* exist. Pass `files` for NEW_READ_UNDECLARED — catches accessor-shape-independent reads. */
|
|
38
6
|
import { buildConfigGraph, checkAttributeExistence, checkEnvironment, checkMigrationIntegrity, checkRollbackReadiness, scanConfigSurfaces, scanMigrations, } from "@descryy/core";
|
|
39
7
|
import { optionalInteger, optionalStringArray } from "./kit.js";
|
|
40
8
|
const SCHEMA = {
|
|
@@ -101,32 +69,23 @@ async function run(args, ctx) {
|
|
|
101
69
|
attributeExistence.data.findings.length +
|
|
102
70
|
migrationIntegrity.data.findings.length;
|
|
103
71
|
const leads = report.findings.length - report.findings.filter((f) => f.claim === "defect").length;
|
|
104
|
-
// Nothing
|
|
105
|
-
// migration
|
|
106
|
-
// alone is a real answer; none of them is not.
|
|
72
|
+
// Nothing compared at all: no config files, reads, migrations, attribute reads,
|
|
73
|
+
// or migration revisions — any one alone is a real answer, none of them is not.
|
|
107
74
|
const nothingToCheck = report.surfaces.length === 0 &&
|
|
108
75
|
!report.readsAvailable &&
|
|
109
76
|
!rollback.data.ran &&
|
|
110
77
|
!attributeExistence.data.ran &&
|
|
111
78
|
!migrationIntegrity.data.ran;
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
// path, or never parsed), which is a different claim from "read them and
|
|
116
|
-
// they are fine." `filesWithReads + filesWithoutReads` is every FILE node
|
|
117
|
-
// the read side considered under the scope; zero of them existing is the
|
|
118
|
-
// same collapse `contracts(paths: [...])` had, one level down.
|
|
79
|
+
// A `files` scope matching zero FILE nodes means those files were never read into
|
|
80
|
+
// the graph (bad path, or unparsed) — not "read and clean". Same collapse as
|
|
81
|
+
// `contracts(paths)`, one level down.
|
|
119
82
|
const filesMatchedNothing = files !== undefined && report.reads.filesWithReads + report.reads.filesWithoutReads === 0;
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
// a defect is the thing this tool exists to catch. Never blur the two into
|
|
123
|
-
// one count, the exact failure `EnvFindingReport.claim`'s own doc names.
|
|
83
|
+
// Leads and rollback findings are worth a look; defects are what this tool exists
|
|
84
|
+
// to catch. Never blur the two into one count (see EnvFindingReport.claim).
|
|
124
85
|
const otherFindings = leads + rollback.data.findings.length;
|
|
125
|
-
// A "Clean" verdict
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
// Only the pure-Clean case is downgraded — real findings from the
|
|
129
|
-
// unscoped documentation-drift or rollback checks still deserve to be seen.
|
|
86
|
+
// A "Clean" verdict from a files scope matching nothing would misreport "checked,
|
|
87
|
+
// fine" when nothing was read. Only pure-Clean is downgraded — real findings from
|
|
88
|
+
// unscoped checks still surface.
|
|
130
89
|
const falseClean = filesMatchedNothing && defects === 0 && otherFindings === 0;
|
|
131
90
|
const verdict = falseClean
|
|
132
91
|
? "not checked"
|
|
@@ -143,15 +102,9 @@ async function run(args, ctx) {
|
|
|
143
102
|
"they are clean.",
|
|
144
103
|
]
|
|
145
104
|
: [];
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
// rollback findings, attribute-existence findings, migration-integrity
|
|
150
|
-
// findings, and configGraph's own dependent-variable enumeration — so no
|
|
151
|
-
// single shown/total pair can describe all of them exactly. `shown`/`total`
|
|
152
|
-
// cover the four finding lists a maxFindings cap actually acts on;
|
|
153
|
-
// configGraph's truncation has no findings list of its own and stays
|
|
154
|
-
// disclosed only in prose, as it already was.
|
|
105
|
+
// render.ts requires truncatedDetail whenever truncated=true. `truncated` folds 5
|
|
106
|
+
// independently-truncatable sources; shown/total cover only the 4 finding lists a
|
|
107
|
+
// maxFindings cap acts on — configGraph's own truncation stays prose-only.
|
|
155
108
|
const shown = report.findings.length +
|
|
156
109
|
rollback.data.findings.length +
|
|
157
110
|
attributeExistence.data.findings.length +
|
|
@@ -186,10 +139,8 @@ async function run(args, ctx) {
|
|
|
186
139
|
coverage: report.coverage,
|
|
187
140
|
declaredNeverRead: report.declaredNeverRead,
|
|
188
141
|
readsAvailable: report.readsAvailable,
|
|
189
|
-
// §15.3's third check feeds the first
|
|
190
|
-
//
|
|
191
|
-
// script. Only variables whose dependent set could be computed are
|
|
192
|
-
// carried — an unknown count is not a zero and is not worth a row.
|
|
142
|
+
// §15.3's third check feeds the first. Only variables with a computable
|
|
143
|
+
// dependent set are carried — unknown count is not a zero, not worth a row.
|
|
193
144
|
configGraph: {
|
|
194
145
|
counts: configGraph.data.counts,
|
|
195
146
|
importsAvailable: configGraph.data.importsAvailable,
|
|
@@ -227,9 +178,8 @@ async function run(args, ctx) {
|
|
|
227
178
|
withheld: migrationIntegrity.data.withheld,
|
|
228
179
|
},
|
|
229
180
|
},
|
|
230
|
-
// Every check's disclosures reach the reader
|
|
231
|
-
//
|
|
232
|
-
// failure rule 7 exists to prevent.
|
|
181
|
+
// Every check's disclosures reach the reader — dropping one half silently
|
|
182
|
+
// is the degradation rule 7 exists to prevent.
|
|
233
183
|
notes: [
|
|
234
184
|
...scopeNotes,
|
|
235
185
|
...checked.notes,
|
|
@@ -244,9 +194,8 @@ async function run(args, ctx) {
|
|
|
244
194
|
resolutionFloor: Math.min(checked.stamp.resolutionFloor, rollback.stamp.resolutionFloor, attributeExistence.stamp.resolutionFloor, migrationIntegrity.stamp.resolutionFloor, configGraph.stamp.resolutionFloor),
|
|
245
195
|
},
|
|
246
196
|
},
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
// class A. The shape of its value is never asserted here.
|
|
197
|
+
// §11A.5's canonical name-level fact (exists or not) — the one claim R2 supports
|
|
198
|
+
// at class A. Value shape is never asserted here.
|
|
250
199
|
nameLevel: true,
|
|
251
200
|
...(truncatedDetail === undefined ? {} : { truncatedDetail }),
|
|
252
201
|
...(nothingToCheck
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/tools/validate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/tools/validate.ts"],"names":[],"mappings":"AAAA;;;;6FAI6F;AAE7F,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AAkBvB,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAyC,MAAM,UAAU,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AC,QAAQ,mEAAmE;oBAC3F,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,gDAAgD;oBACpF,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,qCAAqC;oBAC1F,oBAAoB,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,gBAAgB;oBACxF,oDAAoD;KAC3D,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,QAAkD;IACvE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,sCAAsC;IAC7C,WAAW,EACT,2FAA2F;QAC3F,mFAAmF;QACnF,wFAAwF;QACxF,wFAAwF;QACxF,6FAA6F;QAC7F,sFAAsF;QACtF,0FAA0F;QAC1F,4FAA4F;QAC5F,2FAA2F;QAC3F,2FAA2F;QAC3F,yFAAyF;QACzF,6FAA6F;QAC7F,qFAAqF;QACrF,6FAA6F;QAC7F,oEAAoE;IACtE,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -1,55 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Wraps `packages/core/src/query/verification-status.ts`'s
|
|
7
|
-
* `computeVerificationStatus` — the module's own header calls itself "the
|
|
8
|
-
* static half only" and says building the `ScopeItem[]` from a caller's refs
|
|
9
|
-
* is "the caller's job, done above this boundary." This tool is that caller.
|
|
10
|
-
*
|
|
11
|
-
* ## Real capability lookup, without ever naming a language up here
|
|
12
|
-
*
|
|
13
|
-
* `computeVerificationStatus`'s `ScopeItem.capabilities`, when supplied,
|
|
14
|
-
* lets a `notExercised` reason describe a real declared gap rather than a
|
|
15
|
-
* generic absence. The first design attempted here guessed a language from
|
|
16
|
-
* a ref's file extension and matched it against a `language` tag on a
|
|
17
|
-
* configured source — and `npm run lint` caught it immediately:
|
|
18
|
-
* `descry-boundary/no-language-vocabulary` and `no-language-branch` both
|
|
19
|
-
* fired, because `packages/*\/src/**` (this file included, not just
|
|
20
|
-
* `packages/core`) is bound by architecture principle 7 — nothing above the
|
|
21
|
-
* Canonical IR may name or dispatch on a language, full stop. A hardcoded
|
|
22
|
-
* extension table and a `.get(guessedLanguage)` lookup are exactly the
|
|
23
|
-
* "lookup dispatch" shape that rule exists to catch, not a false positive.
|
|
24
|
-
*
|
|
25
|
-
* The fix moves the decision below the boundary, where it belongs:
|
|
26
|
-
* `LanguageAdapter` (`@descryy/ir`) gained an optional
|
|
27
|
-
* `ownsPath(path): boolean` — the adapter decides, using whatever
|
|
28
|
-
* language-specific logic it wants, entirely inside `descry-adapters`,
|
|
29
|
-
* which is not bound by this repo's lint. This tool never sees or compares
|
|
30
|
-
* a language string; it just asks every loaded, configured adapter "do you
|
|
31
|
-
* own this path," and attaches whichever one says yes. An unresolved ref's
|
|
32
|
-
* `language` therefore stays `null` here always — this tool does not
|
|
33
|
-
* determine one, and does not need to: `computeVerificationStatus`'s reason
|
|
34
|
-
* text already reads correctly either way (see its own module header),
|
|
35
|
-
* naming an adapter as registered without ever naming which language it is
|
|
36
|
-
* for.
|
|
37
|
-
*
|
|
38
|
-
* A configured source that fails to import cannot be asked at all — this
|
|
39
|
-
* tool's own `notes` disclose that plainly, the same register `analyze.ts`
|
|
40
|
-
* already uses for a source that will not import.
|
|
41
|
-
*
|
|
42
|
-
* ## Resolving a ref: node id first, then file
|
|
43
|
-
*
|
|
44
|
-
* A ref that is a real node id resolves directly (`getNode`). Otherwise it
|
|
45
|
-
* is tried as a file path (`findNodes({ file: ref })`, the same reader
|
|
46
|
-
* `lookup.ts`'s `resolveOneNode` already uses for symbol/file matching): the
|
|
47
|
-
* file's own `FILE`-typed node stands in when one exists, else the node
|
|
48
|
-
* with the *weakest* resolution in that file — the same "report the
|
|
49
|
-
* weakest link" convention `resolutionFloor` uses elsewhere in this
|
|
50
|
-
* package, since a file is only as verified as its least-resolved member.
|
|
51
|
-
* A ref that resolves neither way is `notExercised`.
|
|
52
|
-
*/
|
|
1
|
+
/** `verification_status`, §4 technique 6: coverage is a separate axis and call, paid once, only
|
|
2
|
+
* when asked. Wraps `computeVerificationStatus` (the static half). Never names a language (rule
|
|
3
|
+
* 1) — an earlier extension-guessing design tripped the boundary lint, so it now asks each
|
|
4
|
+
* loaded adapter's `ownsPath` instead. Resolves a ref by node id first, then file (the file's own
|
|
5
|
+
* `FILE` node, else its weakest-resolution member) — neither way found means `notExercised`. */
|
|
53
6
|
import type { ResolutionLevel } from "@descryy/ir";
|
|
54
7
|
import { type ToolDefinition } from "./kit.ts";
|
|
55
8
|
export interface VerificationStatusExercisedItem {
|
|
@@ -63,22 +16,14 @@ export interface VerificationStatusData {
|
|
|
63
16
|
readonly scope: string;
|
|
64
17
|
readonly reason: string;
|
|
65
18
|
}[];
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
* finished. Empty when no suite has been run through `observe_tests`, which
|
|
69
|
-
* is a different statement from "nothing covers this" and is why the notes
|
|
70
|
-
* say which of the two a reader is looking at.
|
|
71
|
-
*/
|
|
19
|
+
/** The runtime half: refs a real test run bore on and how those tests finished. Empty means
|
|
20
|
+
* either "nothing covers this" or "no suite run yet" — the notes disambiguate. */
|
|
72
21
|
readonly verifiedByTests: readonly VerificationStatusTestedItem[];
|
|
73
22
|
}
|
|
74
23
|
export interface VerificationStatusTestedItem {
|
|
75
24
|
readonly ref: string;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* observed itself. The run witnessed that a test executed; it did not witness
|
|
79
|
-
* the test touching this ref. Carried per item so the distinction survives
|
|
80
|
-
* into the reply instead of living only in a disclosure.
|
|
81
|
-
*/
|
|
25
|
+
/** `false` when reached via a static `TESTS` edge, not observed directly — the run witnessed the
|
|
26
|
+
* test execute, not that it touched this ref. Carried per item, not just in a disclosure. */
|
|
82
27
|
readonly direct: boolean;
|
|
83
28
|
readonly tests: readonly {
|
|
84
29
|
readonly qualifiedName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-status.d.ts","sourceRoot":"","sources":["../../src/tools/verification-status.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verification-status.d.ts","sourceRoot":"","sources":["../../src/tools/verification-status.ts"],"names":[],"mappings":"AAAA;;;;iGAIiG;AAUjG,OAAO,KAAK,EAA4B,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAqBlB,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,+BAA+B,EAAE,CAAC;IAC/D,QAAQ,CAAC,YAAY,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtF;uFACmF;IACnF,QAAQ,CAAC,eAAe,EAAE,SAAS,4BAA4B,EAAE,CAAC;CACnE;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;kGAC8F;IAC9F,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS;QACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL;AA2JD,eAAO,MAAM,sBAAsB,EAAE,cAkBpC,CAAC"}
|