@descryy/core 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/budget/index.d.ts +5 -0
- package/dist/budget/index.d.ts.map +1 -0
- package/dist/budget/index.js +3 -0
- package/dist/budget/index.js.map +1 -0
- package/dist/budget/reply.d.ts +67 -0
- package/dist/budget/reply.d.ts.map +1 -0
- package/dist/budget/reply.js +76 -0
- package/dist/budget/reply.js.map +1 -0
- package/dist/budget/size.d.ts +43 -0
- package/dist/budget/size.d.ts.map +1 -0
- package/dist/budget/size.js +52 -0
- package/dist/budget/size.js.map +1 -0
- package/dist/contracts/engine.d.ts.map +1 -1
- package/dist/contracts/engine.js +27 -10
- package/dist/contracts/engine.js.map +1 -1
- package/dist/contracts/orphans.d.ts +17 -0
- package/dist/contracts/orphans.d.ts.map +1 -1
- package/dist/contracts/orphans.js +19 -2
- package/dist/contracts/orphans.js.map +1 -1
- package/dist/graph/cross-language.d.ts +0 -7
- package/dist/graph/cross-language.d.ts.map +1 -1
- package/dist/graph/cross-language.js +36 -2
- package/dist/graph/cross-language.js.map +1 -1
- package/dist/graph/index.d.ts +2 -0
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/index.js +1 -0
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/observed-tests.d.ts +118 -0
- package/dist/graph/observed-tests.d.ts.map +1 -0
- package/dist/graph/observed-tests.js +123 -0
- package/dist/graph/observed-tests.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/multipr/mechanical.d.ts.map +1 -1
- package/dist/multipr/mechanical.js +1 -0
- package/dist/multipr/mechanical.js.map +1 -1
- package/dist/query/confirmed-facts.d.ts +21 -5
- package/dist/query/confirmed-facts.d.ts.map +1 -1
- package/dist/query/confirmed-facts.js +30 -7
- package/dist/query/confirmed-facts.js.map +1 -1
- package/dist/query/index.d.ts +7 -1
- package/dist/query/index.d.ts.map +1 -1
- package/dist/query/index.js +4 -1
- package/dist/query/index.js.map +1 -1
- package/dist/query/memory.d.ts.map +1 -1
- package/dist/query/memory.js +4 -0
- package/dist/query/memory.js.map +1 -1
- package/dist/query/prominence.d.ts +73 -0
- package/dist/query/prominence.d.ts.map +1 -0
- package/dist/query/prominence.js +79 -0
- package/dist/query/prominence.js.map +1 -0
- package/dist/query/provider.d.ts +7 -0
- package/dist/query/provider.d.ts.map +1 -1
- package/dist/query/provider.js.map +1 -1
- package/dist/query/queries.d.ts.map +1 -1
- package/dist/query/queries.js +39 -15
- package/dist/query/queries.js.map +1 -1
- package/dist/query/resolution-floor.d.ts +36 -0
- package/dist/query/resolution-floor.d.ts.map +1 -0
- package/dist/query/resolution-floor.js +39 -0
- package/dist/query/resolution-floor.js.map +1 -0
- package/dist/query/sqlite.d.ts.map +1 -1
- package/dist/query/sqlite.js +1 -0
- package/dist/query/sqlite.js.map +1 -1
- package/dist/query/test-coverage.d.ts +65 -0
- package/dist/query/test-coverage.d.ts.map +1 -0
- package/dist/query/test-coverage.js +95 -0
- package/dist/query/test-coverage.js.map +1 -0
- package/dist/query/traverse.d.ts +60 -2
- package/dist/query/traverse.d.ts.map +1 -1
- package/dist/query/traverse.js +0 -0
- package/dist/query/traverse.js.map +1 -1
- package/dist/scoping/traverse.d.ts.map +1 -1
- package/dist/scoping/traverse.js +18 -4
- package/dist/scoping/traverse.js.map +1 -1
- package/dist/sources/confirmed/incidents.d.ts +47 -0
- package/dist/sources/confirmed/incidents.d.ts.map +1 -0
- package/dist/sources/confirmed/incidents.js +173 -0
- package/dist/sources/confirmed/incidents.js.map +1 -0
- package/dist/sources/confirmed/index.d.ts +3 -0
- package/dist/sources/confirmed/index.d.ts.map +1 -0
- package/dist/sources/confirmed/index.js +2 -0
- package/dist/sources/confirmed/index.js.map +1 -0
- package/dist/sources/git/diff.d.ts +26 -0
- package/dist/sources/git/diff.d.ts.map +1 -1
- package/dist/sources/git/diff.js +60 -1
- package/dist/sources/git/diff.js.map +1 -1
- package/dist/sources/git/incidents.d.ts +109 -0
- package/dist/sources/git/incidents.d.ts.map +1 -0
- package/dist/sources/git/incidents.js +187 -0
- package/dist/sources/git/incidents.js.map +1 -0
- package/dist/sources/git/index.d.ts +3 -1
- package/dist/sources/git/index.d.ts.map +1 -1
- package/dist/sources/git/index.js +2 -1
- package/dist/sources/git/index.js.map +1 -1
- package/dist/sources/git/source.d.ts.map +1 -1
- package/dist/sources/git/source.js +0 -0
- package/dist/sources/git/source.js.map +1 -1
- package/dist/store/schema.d.ts +5 -4
- package/dist/store/schema.d.ts.map +1 -1
- package/dist/store/schema.js +42 -2
- package/dist/store/schema.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The join from `observed_tests` to the code a caller actually asked about.
|
|
3
|
+
*
|
|
4
|
+
* `observed_tests` records facts about `TEST_CASE` nodes: this test ran, and
|
|
5
|
+
* this is how it finished. Almost nobody asks about a test case. They ask about
|
|
6
|
+
* a function, a file, a scope from an earlier `impact` call, and getting from
|
|
7
|
+
* one to the other crosses a `TESTS` edge.
|
|
8
|
+
*
|
|
9
|
+
* ## What the crossing costs, and why it is disclosed rather than hidden
|
|
10
|
+
*
|
|
11
|
+
* The `TESTS` edge is **static**. An adapter inferred it, at whatever
|
|
12
|
+
* resolution that adapter reached, and nothing in a test run witnesses it: the
|
|
13
|
+
* run witnessed that a test executed, not which functions it touched. So the
|
|
14
|
+
* honest claim this query supports is *"a test that claims to cover this ran,
|
|
15
|
+
* and here is how it finished"* and **not** *"this function executed"*. The two
|
|
16
|
+
* are close enough in English to be conflated by a reader in a hurry, and far
|
|
17
|
+
* enough apart that conflating them turns an inference into a fabricated
|
|
18
|
+
* observation. {@link ObservedTestFor} carries `direct` for exactly this
|
|
19
|
+
* reason: `true` means the caller asked about the test case itself and the
|
|
20
|
+
* answer is witnessed end to end; `false` means the answer leans on an edge no
|
|
21
|
+
* run confirmed.
|
|
22
|
+
*
|
|
23
|
+
* That is also why this lives here rather than inside
|
|
24
|
+
* `computeVerificationStatus`. That module's contract is the *static* half, it
|
|
25
|
+
* says so in its own header, and it stays that way. Composing the static half
|
|
26
|
+
* with this earned one is the tool layer's job, the same place `observe_runtime`
|
|
27
|
+
* composes rather than absorbs.
|
|
28
|
+
*
|
|
29
|
+
* ## Absent, not empty
|
|
30
|
+
*
|
|
31
|
+
* A node no observed test reaches is missing from the returned map rather than
|
|
32
|
+
* present with an empty list. Inventing a key would let a caller iterate the
|
|
33
|
+
* map and believe it had asked about everything.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* For each requested node id, the observed tests that bear on it.
|
|
37
|
+
*
|
|
38
|
+
* One test contributes at most one entry per ref: a test re-run across several
|
|
39
|
+
* runs is still one test, and the **most recent** observation is what the code
|
|
40
|
+
* stands verified against now. Reporting every historical run instead would
|
|
41
|
+
* make a flaky test look like broad coverage.
|
|
42
|
+
*/
|
|
43
|
+
export function observedTestCoverage(driver, refs) {
|
|
44
|
+
const out = new Map();
|
|
45
|
+
if (refs.length === 0)
|
|
46
|
+
return out;
|
|
47
|
+
const placeholders = refs.map(() => "?").join(", ");
|
|
48
|
+
// Two arms, unioned rather than fetched separately so the de-duplication
|
|
49
|
+
// below sees both at once: a test case that both ran itself and is joined to
|
|
50
|
+
// by a TESTS edge must not be counted twice for one subject.
|
|
51
|
+
const sql = "SELECT e.target AS subject, o.node_id, o.qualified_name, o.outcome, o.run_id, o.observed_at," +
|
|
52
|
+
" 0 AS direct, o.rowid AS seq" +
|
|
53
|
+
" FROM observed_tests o" +
|
|
54
|
+
" JOIN edges e ON e.source = o.node_id AND e.type = 'TESTS'" +
|
|
55
|
+
` WHERE e.target IN (${placeholders})` +
|
|
56
|
+
" UNION ALL " +
|
|
57
|
+
"SELECT o.node_id AS subject, o.node_id, o.qualified_name, o.outcome, o.run_id, o.observed_at," +
|
|
58
|
+
" 1 AS direct, o.rowid AS seq" +
|
|
59
|
+
" FROM observed_tests o" +
|
|
60
|
+
` WHERE o.node_id IN (${placeholders})` +
|
|
61
|
+
// `seq` breaks the tie, and the tie is real rather than theoretical: two
|
|
62
|
+
// runs of one suite land in the same millisecond easily, and `observed_at`
|
|
63
|
+
// alone then leaves SQLite free to return the older run first. That made
|
|
64
|
+
// this query answer "verified against a failing run" when a later run had
|
|
65
|
+
// passed. rowid is monotonic for an ordinary (non-WITHOUT ROWID) table, so
|
|
66
|
+
// ordering by it is exactly "whichever row was written last" -- which is
|
|
67
|
+
// the semantics the timestamp was reaching for and could not express at
|
|
68
|
+
// millisecond resolution.
|
|
69
|
+
" ORDER BY observed_at DESC, seq DESC, node_id ASC";
|
|
70
|
+
const rows = driver.prepare(sql).all(...refs, ...refs);
|
|
71
|
+
// Rows arrive newest first, so the first sighting of a (subject, test) pair
|
|
72
|
+
// is the observation that stands. Later ones are older runs of the same test.
|
|
73
|
+
const seen = new Set();
|
|
74
|
+
for (const row of rows) {
|
|
75
|
+
const key = `${row.subject} ${row.node_id}`;
|
|
76
|
+
if (seen.has(key))
|
|
77
|
+
continue;
|
|
78
|
+
seen.add(key);
|
|
79
|
+
const entry = {
|
|
80
|
+
nodeId: row.node_id,
|
|
81
|
+
qualifiedName: row.qualified_name,
|
|
82
|
+
outcome: row.outcome,
|
|
83
|
+
runId: row.run_id,
|
|
84
|
+
observedAt: row.observed_at,
|
|
85
|
+
direct: row.direct === 1,
|
|
86
|
+
};
|
|
87
|
+
const existing = out.get(row.subject);
|
|
88
|
+
out.set(row.subject, {
|
|
89
|
+
ref: row.subject,
|
|
90
|
+
tests: existing === undefined ? [entry] : [...existing.tests, entry],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=test-coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-coverage.js","sourceRoot":"","sources":["../../src/query/test-coverage.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EAAE,GAAG,CAAC,OAAO;YACnB,aAAa,EAAE,GAAG,CAAC,cAAc;YACjC,OAAO,EAAE,GAAG,CAAC,OAA8B;YAC3C,KAAK,EAAE,GAAG,CAAC,MAAM;YACjB,UAAU,EAAE,GAAG,CAAC,WAAW;YAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC;SACzB,CAAC;QAEF,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE;YACnB,GAAG,EAAE,GAAG,CAAC,OAAO;YAChB,KAAK,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;SACrE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/query/traverse.d.ts
CHANGED
|
@@ -24,6 +24,43 @@
|
|
|
24
24
|
* improvement (relaxation), and any hop whose combined factor reaches 1.0 is
|
|
25
25
|
* rejected with an error naming the edge. Step 12 supplies the weights; this is
|
|
26
26
|
* the layer that refuses to run with weights that cannot terminate.
|
|
27
|
+
*
|
|
28
|
+
* ## Confidence is not the traversal weight
|
|
29
|
+
*
|
|
30
|
+
* This module's default `weightFor` used to be `edge.confidence` and nothing
|
|
31
|
+
* else, which made two shipped modules contradict each other. `runtime-
|
|
32
|
+
* confirmation.ts` writes `confidence = 1.0` on every edge it promotes or mints
|
|
33
|
+
* at R4 — correctly, because rule 3 makes R4 unconditionally class A and a
|
|
34
|
+
* witnessed edge is not 99% believed. The old default then handed that same 1.0
|
|
35
|
+
* to the guard above as a *weight*, so the strongest edge in the graph was the
|
|
36
|
+
* one edge `impact` refused to walk. Any graph that had ever had a runtime
|
|
37
|
+
* observation applied threw.
|
|
38
|
+
*
|
|
39
|
+
* The two quantities were never the same thing, and `weights.ts` has said so
|
|
40
|
+
* all along: `validateScopingConfig` asserts
|
|
41
|
+
* `0 < edgeWeight x maxFanOutMultiplier x maxConfidence < 1` and notes in its
|
|
42
|
+
* own comment that *"maxConfidence is 1.0 by definition"*. Termination is the
|
|
43
|
+
* **edge weight's** job; confidence is evidence strength and is entitled to
|
|
44
|
+
* reach 1.0. The old default was the degenerate weight table with every edge
|
|
45
|
+
* type at 1.0 — precisely the configuration `validateScopingConfig` refuses to
|
|
46
|
+
* load. The in-process path was running a config the config loader would
|
|
47
|
+
* reject, while the worker path passed a real table and did not.
|
|
48
|
+
*
|
|
49
|
+
* So the default is now {@link defaultTraversalWeight}: the per-edge-type decay
|
|
50
|
+
* of `DEFAULT_EDGE_WEIGHTS` times the edge's confidence — the same product
|
|
51
|
+
* `weightFromTable` builds for the worker. Termination survives on three
|
|
52
|
+
* independent legs, none of which is a stored confidence value:
|
|
53
|
+
*
|
|
54
|
+
* 1. every weight in `DEFAULT_EDGE_WEIGHTS` is <= 0.95, and confidence is
|
|
55
|
+
* capped at 1.0 by the IR, so the per-hop factor is <= 0.95 < 1 by
|
|
56
|
+
* construction rather than by data;
|
|
57
|
+
* 2. `validateScopingConfig` refuses, at config load, any table that would
|
|
58
|
+
* break leg 1;
|
|
59
|
+
* 3. the per-hop `RangeError` below is unchanged and still refuses any weight
|
|
60
|
+
* outside (0, 1), which is what holds a caller-supplied `weightFor` to the
|
|
61
|
+
* same rule.
|
|
62
|
+
*
|
|
63
|
+
* Ruled in `DEC-386`.
|
|
27
64
|
*/
|
|
28
65
|
import type { EdgeType, IREdge, ResolutionLevel } from "@descryy/ir";
|
|
29
66
|
import type { AdjacencyProvider } from "./provider.ts";
|
|
@@ -79,11 +116,32 @@ export interface TraversalOutcome {
|
|
|
79
116
|
* here precisely because there is no score to improve on a second visit.
|
|
80
117
|
*/
|
|
81
118
|
export declare function bfs(provider: AdjacencyProvider, seeds: readonly string[], options?: TraversalOptions): TraversalOutcome;
|
|
119
|
+
/**
|
|
120
|
+
* The default per-hop decay: §12.4's `EdgeWeight` for the edge's *type*, times
|
|
121
|
+
* the edge's own confidence.
|
|
122
|
+
*
|
|
123
|
+
* Both terms are §12.4's, and neither one alone is the weight. Confidence
|
|
124
|
+
* carries how much the producer believes the edge; the type weight carries how
|
|
125
|
+
* far a change actually travels along that kind of edge — an `IMPORTS` hop at
|
|
126
|
+
* 0.4 is a weak signal even when it is certain, and a witnessed `CALLS` hop at
|
|
127
|
+
* 0.95 x 1.0 is strong precisely because it was witnessed.
|
|
128
|
+
*
|
|
129
|
+
* Exported so a caller can compose with it rather than reconstruct it, and so
|
|
130
|
+
* the in-process and worker paths are demonstrably the same function — see the
|
|
131
|
+
* parity test in `worker.test.ts`. It is the callback form of
|
|
132
|
+
* `weightFromTable({ weights: DEFAULT_EDGE_WEIGHTS, fallback: ... })`.
|
|
133
|
+
*/
|
|
134
|
+
export declare function defaultTraversalWeight(edge: {
|
|
135
|
+
readonly type: EdgeType;
|
|
136
|
+
readonly confidence: number;
|
|
137
|
+
}): number;
|
|
82
138
|
export interface WeightedOptions extends TraversalOptions {
|
|
83
139
|
/**
|
|
84
140
|
* The per-hop decay factor for an edge. Must be strictly less than 1.0 —
|
|
85
|
-
* see the note at the top of this file. Defaults to
|
|
86
|
-
*
|
|
141
|
+
* see the note at the top of this file. Defaults to
|
|
142
|
+
* {@link defaultTraversalWeight}: the edge type's §12.4 weight times the
|
|
143
|
+
* edge's confidence. **Not confidence alone** — that conflated evidence
|
|
144
|
+
* strength with decay and made a witnessed R4 edge untraversable.
|
|
87
145
|
*/
|
|
88
146
|
readonly weightFor?: (edge: IREdge) => number;
|
|
89
147
|
/** Stop expanding below this score. The main reason traversal ends before the budget. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/query/traverse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/query/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ACtF,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC3C;AA2CD;;;;;GAKG;AACH,wBAAgB,GAAG,CACjB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,GAAE,gBAAqB,GAC7B,gBAAgB,CAqClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE7G;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAyDlB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,gBAAqB,GAC7B,SAAS,MAAM,EAAE,CA8BnB"}
|
package/dist/query/traverse.js
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/query/traverse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/query/traverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAIH,OAAO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,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,mFAAmF;IACnF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AASD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,YAAiB,GACzB,WAAW,CAAC,KAAK,CAAC,CAsKpB"}
|
package/dist/scoping/traverse.js
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* can keep a node that later scores below threshold, never drop one that would
|
|
26
26
|
* have scored above it.
|
|
27
27
|
*/
|
|
28
|
+
import { createResolutionFloor } from "../query/resolution-floor.js";
|
|
28
29
|
import { attenuationFor } from "./fanout.js";
|
|
29
30
|
import { finalScore, HistoryFactors, hopDecay, maxBoost } from "./score.js";
|
|
30
31
|
import { NODE_BUDGETS, tierFor } from "./tiers.js";
|
|
@@ -58,7 +59,10 @@ export function scopeChange(provider, changedIds, options = {}) {
|
|
|
58
59
|
const pruneAt = config.threshold / maxBoost(config);
|
|
59
60
|
const best = new Map();
|
|
60
61
|
const queue = [];
|
|
61
|
-
|
|
62
|
+
// R0, not R4, when no edge is ever traversed — see `createResolutionFloor`.
|
|
63
|
+
// An isolated node is a walk that examined nothing, and a bare `let floor = 4`
|
|
64
|
+
// would report that as the strongest evidence tier in the system.
|
|
65
|
+
const floor = createResolutionFloor();
|
|
62
66
|
for (const id of changedIds) {
|
|
63
67
|
best.set(id, { score: 1, depth: 0, via: null });
|
|
64
68
|
queue.push({ id, score: 1, depth: 0 });
|
|
@@ -104,8 +108,7 @@ export function scopeChange(provider, changedIds, options = {}) {
|
|
|
104
108
|
const existing = best.get(next);
|
|
105
109
|
if (existing !== undefined && existing.score >= score)
|
|
106
110
|
continue;
|
|
107
|
-
|
|
108
|
-
resolutionFloor = edge.resolution;
|
|
111
|
+
floor.observe(edge.resolution);
|
|
109
112
|
best.set(next, { score, depth: current.depth + 1, via: edge });
|
|
110
113
|
queue.push({ id: next, score, depth: current.depth + 1 });
|
|
111
114
|
}
|
|
@@ -146,7 +149,18 @@ export function scopeChange(provider, changedIds, options = {}) {
|
|
|
146
149
|
`node(s) were dropped, all scoring at or below ${worstKept.toFixed(3)}. They were not ` +
|
|
147
150
|
`examined and are not reported as clean.`);
|
|
148
151
|
}
|
|
149
|
-
|
|
152
|
+
const resolutionFloor = floor.value();
|
|
153
|
+
if (!floor.observed()) {
|
|
154
|
+
// R0 here means "no edge was followed", which is a different fact from "an
|
|
155
|
+
// edge was followed and resolved no better than R0" — and the sentence
|
|
156
|
+
// below would state the second. Naming the real one, rather than letting a
|
|
157
|
+
// reader infer a badly-resolved walk where no walk happened.
|
|
158
|
+
notes.push("No edge was traversed from the changed node(s) at all, so this radius rests on no edge " +
|
|
159
|
+
"evidence. That is not a finding that nothing is affected: the graph holds no traversable " +
|
|
160
|
+
"edge touching them, which a graph built without the source that would carry those edges " +
|
|
161
|
+
"produces just as readily as a genuinely isolated symbol.");
|
|
162
|
+
}
|
|
163
|
+
else if (resolutionFloor <= 1) {
|
|
150
164
|
notes.push(`This blast radius rests on edges resolved no better than R${resolutionFloor}. Cross-file ` +
|
|
151
165
|
"calls are not reliably resolved at that level, so the radius is a lower bound.");
|
|
152
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/scoping/traverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAgC,MAAM,YAAY,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,qBAA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E,OAAO,CAAC,MAAM,GAAG,CAAC;QAC7B,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `IRSource` that projects developer-confirmed incidents into the graph.
|
|
3
|
+
*
|
|
4
|
+
* ## Why a source, and not a direct write
|
|
5
|
+
*
|
|
6
|
+
* A `ConfirmedIncident` lives in `.descry/config.json` because it is testimony
|
|
7
|
+
* — a developer fixed something and said so, and no commit records that they
|
|
8
|
+
* said it (see the type's own doc). But a store is derived data: DEC-017 drops
|
|
9
|
+
* every derived table on a schema change and rebuilds from source. So a
|
|
10
|
+
* confirmed incident written *only* into the graph would survive until the next
|
|
11
|
+
* IR-version bump and then vanish, which is the failure the EARNED partition
|
|
12
|
+
* exists to prevent — arriving through a writer that simply did not think about
|
|
13
|
+
* it.
|
|
14
|
+
*
|
|
15
|
+
* Making this a source solves it by construction. The file is the record; the
|
|
16
|
+
* graph is a projection of the record; every `analyze` re-projects. There is no
|
|
17
|
+
* migration to write and no earned table to extend, and the same discipline
|
|
18
|
+
* every other producer in this system already follows applies unchanged: a
|
|
19
|
+
* batch in, `writeBatch` out, invalidation by producer id.
|
|
20
|
+
*
|
|
21
|
+
* ## Identity
|
|
22
|
+
*
|
|
23
|
+
* The `INCIDENT` node keys on `confirmed:<confirmedAt>:<summary>` — the moment
|
|
24
|
+
* the developer said it, plus what they said. Deliberately **not** the file set:
|
|
25
|
+
* node ids never contain a path (renames churn them and silently destroy
|
|
26
|
+
* incident links), and a developer correcting the file list of an incident they
|
|
27
|
+
* already recorded is editing one incident rather than creating a second.
|
|
28
|
+
*
|
|
29
|
+
* ## What it does not do
|
|
30
|
+
*
|
|
31
|
+
* It mints no `FIX_PATTERN` unless the record names a fixing commit, and it
|
|
32
|
+
* never infers one from HEAD. "The developer confirmed an incident" and "the
|
|
33
|
+
* developer confirmed which commit fixed it" are separate claims, and only the
|
|
34
|
+
* second one licenses a `FIXED_BY` edge.
|
|
35
|
+
*/
|
|
36
|
+
import { type ConfirmedIncident, type IdentityScope, type IRSource } from "@descryy/ir";
|
|
37
|
+
export declare const CONFIRMED_INCIDENT_SOURCE_ID = "confirmed-incidents";
|
|
38
|
+
export declare const CONFIRMED_INCIDENT_SOURCE_VERSION = "0.1.0";
|
|
39
|
+
export interface ConfirmedIncidentSourceOptions {
|
|
40
|
+
readonly repo: string;
|
|
41
|
+
/** Every confirmed incident on record. Entries for another repo are ignored. */
|
|
42
|
+
readonly incidents: readonly ConfirmedIncident[];
|
|
43
|
+
}
|
|
44
|
+
/** The `INCIDENT` node id for one record. Stable across re-projections. */
|
|
45
|
+
export declare function confirmedIncidentId(scope: IdentityScope, incident: ConfirmedIncident): string;
|
|
46
|
+
export declare function createConfirmedIncidentSource(options: ConfirmedIncidentSourceOptions): IRSource;
|
|
47
|
+
//# sourceMappingURL=incidents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incidents.d.ts","sourceRoot":"","sources":["../../../src/sources/confirmed/incidents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAIlB,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAClE,eAAO,MAAM,iCAAiC,UAAU,CAAC;AAGzD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAClD;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE7F;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,8BAA8B,GAAG,QAAQ,CA0I/F"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `IRSource` that projects developer-confirmed incidents into the graph.
|
|
3
|
+
*
|
|
4
|
+
* ## Why a source, and not a direct write
|
|
5
|
+
*
|
|
6
|
+
* A `ConfirmedIncident` lives in `.descry/config.json` because it is testimony
|
|
7
|
+
* — a developer fixed something and said so, and no commit records that they
|
|
8
|
+
* said it (see the type's own doc). But a store is derived data: DEC-017 drops
|
|
9
|
+
* every derived table on a schema change and rebuilds from source. So a
|
|
10
|
+
* confirmed incident written *only* into the graph would survive until the next
|
|
11
|
+
* IR-version bump and then vanish, which is the failure the EARNED partition
|
|
12
|
+
* exists to prevent — arriving through a writer that simply did not think about
|
|
13
|
+
* it.
|
|
14
|
+
*
|
|
15
|
+
* Making this a source solves it by construction. The file is the record; the
|
|
16
|
+
* graph is a projection of the record; every `analyze` re-projects. There is no
|
|
17
|
+
* migration to write and no earned table to extend, and the same discipline
|
|
18
|
+
* every other producer in this system already follows applies unchanged: a
|
|
19
|
+
* batch in, `writeBatch` out, invalidation by producer id.
|
|
20
|
+
*
|
|
21
|
+
* ## Identity
|
|
22
|
+
*
|
|
23
|
+
* The `INCIDENT` node keys on `confirmed:<confirmedAt>:<summary>` — the moment
|
|
24
|
+
* the developer said it, plus what they said. Deliberately **not** the file set:
|
|
25
|
+
* node ids never contain a path (renames churn them and silently destroy
|
|
26
|
+
* incident links), and a developer correcting the file list of an incident they
|
|
27
|
+
* already recorded is editing one incident rather than creating a second.
|
|
28
|
+
*
|
|
29
|
+
* ## What it does not do
|
|
30
|
+
*
|
|
31
|
+
* It mints no `FIX_PATTERN` unless the record names a fixing commit, and it
|
|
32
|
+
* never infers one from HEAD. "The developer confirmed an incident" and "the
|
|
33
|
+
* developer confirmed which commit fixed it" are separate claims, and only the
|
|
34
|
+
* second one licenses a `FIXED_BY` edge.
|
|
35
|
+
*/
|
|
36
|
+
import { fileQsp, nodeId, } from "@descryy/ir";
|
|
37
|
+
export const CONFIRMED_INCIDENT_SOURCE_ID = "confirmed-incidents";
|
|
38
|
+
export const CONFIRMED_INCIDENT_SOURCE_VERSION = "0.1.0";
|
|
39
|
+
const PRODUCED_BY = `${CONFIRMED_INCIDENT_SOURCE_ID}@${CONFIRMED_INCIDENT_SOURCE_VERSION}`;
|
|
40
|
+
/** The `INCIDENT` node id for one record. Stable across re-projections. */
|
|
41
|
+
export function confirmedIncidentId(scope, incident) {
|
|
42
|
+
return nodeId(scope, "INCIDENT", `confirmed:${incident.confirmedAt}:${incident.summary}`, null);
|
|
43
|
+
}
|
|
44
|
+
export function createConfirmedIncidentSource(options) {
|
|
45
|
+
return {
|
|
46
|
+
id: CONFIRMED_INCIDENT_SOURCE_ID,
|
|
47
|
+
version: CONFIRMED_INCIDENT_SOURCE_VERSION,
|
|
48
|
+
emit(ctx) {
|
|
49
|
+
const repo = options.repo || ctx.root.repo;
|
|
50
|
+
// INCIDENT and FIX_PATTERN are workspace-scoped (DEC-054), FILE is
|
|
51
|
+
// repo-scoped, and `scopeOf` picks between them per type.
|
|
52
|
+
const scope = { repo, workspace: ctx.root.workspace };
|
|
53
|
+
// A record for another repository is not this batch's business. The
|
|
54
|
+
// structural refusal `applyConfirmedFacts` makes for the same reason:
|
|
55
|
+
// never an inference about a second case.
|
|
56
|
+
const mine = options.incidents.filter((i) => i.repo === repo);
|
|
57
|
+
const nodes = [];
|
|
58
|
+
const edges = [];
|
|
59
|
+
const unresolved = [];
|
|
60
|
+
const touched = new Set();
|
|
61
|
+
for (const incident of mine)
|
|
62
|
+
for (const path of incident.files)
|
|
63
|
+
touched.add(path);
|
|
64
|
+
const sourceFiles = [...touched].sort();
|
|
65
|
+
for (const path of sourceFiles) {
|
|
66
|
+
nodes.push({
|
|
67
|
+
id: nodeId(scope, "FILE", fileQsp(path), null),
|
|
68
|
+
type: "FILE",
|
|
69
|
+
name: path.split("/").pop() ?? path,
|
|
70
|
+
file: path,
|
|
71
|
+
range: null,
|
|
72
|
+
// A developer naming a path says nothing about what language it is
|
|
73
|
+
// written in, and guessing from the extension would be a language
|
|
74
|
+
// decision made where none may be made (DEC-026).
|
|
75
|
+
language: null,
|
|
76
|
+
producedBy: PRODUCED_BY,
|
|
77
|
+
resolution: 0,
|
|
78
|
+
attrs: {},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
for (const incident of mine) {
|
|
82
|
+
const incidentId = confirmedIncidentId(scope, incident);
|
|
83
|
+
nodes.push({
|
|
84
|
+
id: incidentId,
|
|
85
|
+
type: "INCIDENT",
|
|
86
|
+
name: incident.summary.slice(0, 120),
|
|
87
|
+
file: null,
|
|
88
|
+
range: null,
|
|
89
|
+
language: null,
|
|
90
|
+
producedBy: PRODUCED_BY,
|
|
91
|
+
resolution: 0,
|
|
92
|
+
attrs: {
|
|
93
|
+
// The record's own shape decides this, never the caller: a run id
|
|
94
|
+
// is present exactly when a run witnessed the failure, and absent
|
|
95
|
+
// exactly when a person asserted it.
|
|
96
|
+
detectedVia: incident.observedInRun === undefined ? "developer-confirmed" : "runtime-observed",
|
|
97
|
+
...(incident.observedInRun === undefined ? {} : { observedInRun: incident.observedInRun }),
|
|
98
|
+
confirmedBy: incident.confirmedBy,
|
|
99
|
+
confirmedAt: incident.confirmedAt,
|
|
100
|
+
// The message-similarity signal's real input, which until now had
|
|
101
|
+
// only a commit subject line to work with.
|
|
102
|
+
...(incident.errorText === undefined ? {} : { errorText: incident.errorText }),
|
|
103
|
+
...(incident.fixedAtCommit === undefined ? {} : { fixedAtCommit: incident.fixedAtCommit }),
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
for (const path of [...new Set(incident.files)].sort()) {
|
|
107
|
+
edges.push({
|
|
108
|
+
from: incidentId,
|
|
109
|
+
to: nodeId(scope, "FILE", fileQsp(path), null),
|
|
110
|
+
type: "INCIDENT_CORRELATED",
|
|
111
|
+
resolution: 0,
|
|
112
|
+
confidence: 1,
|
|
113
|
+
producedBy: PRODUCED_BY,
|
|
114
|
+
attrs: {
|
|
115
|
+
detectedVia: incident.observedInRun === undefined ? "developer-confirmed" : "runtime-observed",
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// Only when the record names one. "A defect existed" and "this commit
|
|
120
|
+
// fixed it" are separate claims and only the second licenses this edge.
|
|
121
|
+
if (incident.fixedAtCommit === undefined)
|
|
122
|
+
continue;
|
|
123
|
+
const fixId = nodeId(scope, "FIX_PATTERN", incident.fixedAtCommit, null);
|
|
124
|
+
nodes.push({
|
|
125
|
+
id: fixId,
|
|
126
|
+
type: "FIX_PATTERN",
|
|
127
|
+
name: `fix for: ${incident.summary}`.slice(0, 120),
|
|
128
|
+
file: null,
|
|
129
|
+
range: null,
|
|
130
|
+
language: null,
|
|
131
|
+
producedBy: PRODUCED_BY,
|
|
132
|
+
resolution: 0,
|
|
133
|
+
attrs: {
|
|
134
|
+
commitSha: incident.fixedAtCommit,
|
|
135
|
+
detectedVia: incident.observedInRun === undefined ? "developer-confirmed" : "runtime-observed",
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
edges.push({
|
|
139
|
+
from: incidentId,
|
|
140
|
+
to: fixId,
|
|
141
|
+
type: "FIXED_BY",
|
|
142
|
+
resolution: 0,
|
|
143
|
+
confidence: 1,
|
|
144
|
+
producedBy: PRODUCED_BY,
|
|
145
|
+
attrs: {
|
|
146
|
+
detectedVia: incident.observedInRun === undefined ? "developer-confirmed" : "runtime-observed",
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// Deterministic: two projections of the same records must produce a
|
|
151
|
+
// byte-identical batch, or the store's content hash moves for no reason.
|
|
152
|
+
nodes.sort((a, b) => a.id.localeCompare(b.id));
|
|
153
|
+
edges.sort((a, b) => `${a.from}${a.to}${a.type}`.localeCompare(`${b.from}${b.to}${b.type}`));
|
|
154
|
+
return Promise.resolve({
|
|
155
|
+
repo,
|
|
156
|
+
...(scope.workspace === undefined ? {} : { workspace: scope.workspace }),
|
|
157
|
+
commitSha: ctx.root.commitSha,
|
|
158
|
+
producedBy: PRODUCED_BY,
|
|
159
|
+
sourceFiles,
|
|
160
|
+
skippedFiles: [],
|
|
161
|
+
// R0. A person's sentence is not a resolution level at all — the
|
|
162
|
+
// reliability consequence lives in `humanAsserted` (DEC-223), a second
|
|
163
|
+
// and independent ceiling, and slotting testimony into the R0–R4 ladder
|
|
164
|
+
// to express it would be the overclaim that ladder exists to prevent.
|
|
165
|
+
reachedResolution: 0,
|
|
166
|
+
nodes,
|
|
167
|
+
edges,
|
|
168
|
+
unresolved,
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=incidents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incidents.js","sourceRoot":"","sources":["../../../src/sources/confirmed/incidents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,OAAO,EACP,MAAM,GASP,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,4BAA4B,GAAG,qBAAqB,CAAC;AAClE,MAAM,CAAC,MAAM,iCAAiC,GAAG,OAAO,CAAC;AACzD,MAAM,WAAW,GAAG,GAAG,4BAA4B,IAAI,iCAAiC,EAAE,CAAC;AAQ3F,2EAA2E;AAC3E,MAAM,UAAU,mBAAmB,CAAC,KAAoB,EAAE,QAA2B;IACnF,OAAO,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,OAAuC;IACnF,OAAO;QACL,EAAE,EAAE,4BAA4B;QAChC,OAAO,EAAE,iCAAiC;QAE1C,IAAI,CAAC,GAAoB;YACvB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CA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C7B,mBAAmB,EACnB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sources/confirmed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,gBAAgB,CAAC"}
|
|
@@ -12,6 +12,21 @@
|
|
|
12
12
|
* rather than silently shrinking the reply — the empty-denominator rule
|
|
13
13
|
* applies to a dropped patch exactly as it does to a dropped finding.
|
|
14
14
|
*
|
|
15
|
+
* Two size caps here, because one of them bounds nothing on its own:
|
|
16
|
+
* `maxPatchBytes` per file, and `maxTotalPatchBytes` across every patch in the
|
|
17
|
+
* reply. The second exists because a real 48-file branch diff, with 44 patches
|
|
18
|
+
* each *under* the per-file cap, summed to 229KB and hard-failed the call —
|
|
19
|
+
* the reply never reached the caller at all, which is the one failure mode a
|
|
20
|
+
* disclosure cannot repair after the fact.
|
|
21
|
+
*
|
|
22
|
+
* And a third above this file, for the same reason one level out: the same
|
|
23
|
+
* diff re-run with `maxTotalPatchBytes` correctly enforced still failed, at
|
|
24
|
+
* 84,516 characters, because these two caps bound patch text and a reply is
|
|
25
|
+
* not only patch text. `MAX_REPLY_BYTES` and `ToolAnswer.fitToBudget` in the
|
|
26
|
+
* MCP layer bound the serialized reply itself. Nothing here needs to know
|
|
27
|
+
* about that; it is noted because "the aggregate cap is enforced" was once
|
|
28
|
+
* mistaken for "the call now succeeds," and they are different claims.
|
|
29
|
+
*
|
|
15
30
|
* One `git diff` invocation for every file at once, not one per file — a
|
|
16
31
|
* PR touching fifty files would otherwise spawn fifty processes. The output
|
|
17
32
|
* is a concatenation of per-file blocks, each beginning with a line
|
|
@@ -23,6 +38,12 @@
|
|
|
23
38
|
* own regex — an accepted, narrow gap, not a silent one, since every other
|
|
24
39
|
* line used here does not share it).
|
|
25
40
|
*/
|
|
41
|
+
/**
|
|
42
|
+
* The stable prefix of `patchOmittedReason` when the *total* budget, not the
|
|
43
|
+
* per-file cap, is what withheld a patch. Exported so a caller can tell the
|
|
44
|
+
* two apart without matching on prose it does not own.
|
|
45
|
+
*/
|
|
46
|
+
export declare const TOTAL_PATCH_BUDGET_REASON_PREFIX = "the reply's total patch budget";
|
|
26
47
|
export interface GitDiffFile {
|
|
27
48
|
/** Path as it is known after the change (the only path for A/M/D). */
|
|
28
49
|
readonly path: string;
|
|
@@ -43,6 +64,11 @@ export interface GitDiffOptions {
|
|
|
43
64
|
readonly files?: readonly string[];
|
|
44
65
|
/** A file's patch is omitted (stats are still reported) above this many bytes. Default 20,000. */
|
|
45
66
|
readonly maxPatchBytes?: number;
|
|
67
|
+
/**
|
|
68
|
+
* The cap on the sum of all returned patches. Files past it keep their
|
|
69
|
+
* stats and name the budget as the reason. Default 40,000.
|
|
70
|
+
*/
|
|
71
|
+
readonly maxTotalPatchBytes?: number;
|
|
46
72
|
}
|
|
47
73
|
/**
|
|
48
74
|
* `base...head` (three dots), matching `changedFiles`'s own reasoning: two
|