@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,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prominence — "show me the top few, not a flat list", without borrowing a
|
|
3
|
+
* calibration that does not apply.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this is not `tierFor`
|
|
6
|
+
*
|
|
7
|
+
* `scoping/tiers.ts` already bands a score into §12.7's tiers 1-4 on **absolute
|
|
8
|
+
* thresholds** (0.7 and 0.3). Reusing it here was the obvious move and it is
|
|
9
|
+
* the wrong one, for a reason that is invisible from the type: the two scores
|
|
10
|
+
* are different quantities that happen to share the range (0, 1].
|
|
11
|
+
*
|
|
12
|
+
* - `scope` scores through `scoping/`: designed per-edge weights, then
|
|
13
|
+
* `finalScore` applies co-change and incident boosts. `weights.ts` says in
|
|
14
|
+
* its own comment that these must "stay on the same scale as an absolute tier
|
|
15
|
+
* threshold" — the thresholds were calibrated against *this* pipeline.
|
|
16
|
+
* - `impact` and `pr_analysis` score through `weightedBfs`, whose default
|
|
17
|
+
* `weightFor` is `edge.confidence` and nothing else. No designed weights, no
|
|
18
|
+
* boosts. `pr_analysis` passes only a budget, so it takes that default.
|
|
19
|
+
*
|
|
20
|
+
* Feeding the second into thresholds calibrated for the first would produce
|
|
21
|
+
* bands that look like §12.7's and mean something else — a calibrated label on
|
|
22
|
+
* an uncalibrated number, which is worse than no band at all because it reads
|
|
23
|
+
* as more precise than it is.
|
|
24
|
+
*
|
|
25
|
+
* ## So this bands on rank, and rank is a fact about the answer
|
|
26
|
+
*
|
|
27
|
+
* "This was the highest-scoring item in this reply" is true whatever produced
|
|
28
|
+
* the score, and it is exactly what "show me the top few" asks for. It claims
|
|
29
|
+
* nothing about magnitude, nothing about a threshold, and nothing that a change
|
|
30
|
+
* of scoring pipeline could silently falsify.
|
|
31
|
+
*
|
|
32
|
+
* The cut-offs are reading-surface sizes rather than measurements — the same
|
|
33
|
+
* footing `NODE_BUDGETS`'s own comment puts its figures on. Tune from data.
|
|
34
|
+
*/
|
|
35
|
+
/** Where an item falls in its answer's own ordering. */
|
|
36
|
+
export type Prominence = "top" | "notable" | "rest";
|
|
37
|
+
/**
|
|
38
|
+
* Rank cut-offs, inclusive upper bounds.
|
|
39
|
+
*
|
|
40
|
+
* `top` is three because that is what a developer reads before acting; the
|
|
41
|
+
* same figure `FINDING_CAPS["pre-push"]` reaches independently, from the same
|
|
42
|
+
* reasoning about a blocked developer's attention. It is **not** imported from
|
|
43
|
+
* there: that cap governs findings through the governance funnel, this governs
|
|
44
|
+
* presentation ordering, and coupling them would make a change to either mean
|
|
45
|
+
* a change to both.
|
|
46
|
+
*/
|
|
47
|
+
export declare const PROMINENCE_CUTOFFS: {
|
|
48
|
+
readonly top: 3;
|
|
49
|
+
readonly notable: 10;
|
|
50
|
+
};
|
|
51
|
+
/** `rank` is 1-based: the highest-scoring item in an answer is rank 1. */
|
|
52
|
+
export declare function prominenceOf(rank: number): Prominence;
|
|
53
|
+
export interface Ranked {
|
|
54
|
+
/** 1-based position in this answer, highest score first. */
|
|
55
|
+
readonly rank: number;
|
|
56
|
+
readonly prominence: Prominence;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Attach `rank` and `prominence` to items already ordered highest-first.
|
|
60
|
+
*
|
|
61
|
+
* Deliberately does **not** sort. Every caller here already orders its own
|
|
62
|
+
* list, and re-sorting would either be a no-op or silently disagree with the
|
|
63
|
+
* order the caller reported elsewhere in the same reply. Ranking a list that
|
|
64
|
+
* is not in score order is a caller bug this function cannot detect, which is
|
|
65
|
+
* why it says so here rather than pretending to be total over any input.
|
|
66
|
+
*/
|
|
67
|
+
export declare function withProminence<T>(ordered: readonly T[]): readonly (T & Ranked)[];
|
|
68
|
+
/**
|
|
69
|
+
* How many of each band a list holds — the counts a reply shows so a reader
|
|
70
|
+
* knows what the shown items were selected from.
|
|
71
|
+
*/
|
|
72
|
+
export declare function prominenceCounts(total: number): Readonly<Record<Prominence, number>>;
|
|
73
|
+
//# sourceMappingURL=prominence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prominence.d.ts","sourceRoot":"","sources":["../../src/query/prominence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;CAAmC,CAAC;AAEnE,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAIrD;AAED,MAAM,WAAW,MAAM;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAMhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAIpF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prominence — "show me the top few, not a flat list", without borrowing a
|
|
3
|
+
* calibration that does not apply.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this is not `tierFor`
|
|
6
|
+
*
|
|
7
|
+
* `scoping/tiers.ts` already bands a score into §12.7's tiers 1-4 on **absolute
|
|
8
|
+
* thresholds** (0.7 and 0.3). Reusing it here was the obvious move and it is
|
|
9
|
+
* the wrong one, for a reason that is invisible from the type: the two scores
|
|
10
|
+
* are different quantities that happen to share the range (0, 1].
|
|
11
|
+
*
|
|
12
|
+
* - `scope` scores through `scoping/`: designed per-edge weights, then
|
|
13
|
+
* `finalScore` applies co-change and incident boosts. `weights.ts` says in
|
|
14
|
+
* its own comment that these must "stay on the same scale as an absolute tier
|
|
15
|
+
* threshold" — the thresholds were calibrated against *this* pipeline.
|
|
16
|
+
* - `impact` and `pr_analysis` score through `weightedBfs`, whose default
|
|
17
|
+
* `weightFor` is `edge.confidence` and nothing else. No designed weights, no
|
|
18
|
+
* boosts. `pr_analysis` passes only a budget, so it takes that default.
|
|
19
|
+
*
|
|
20
|
+
* Feeding the second into thresholds calibrated for the first would produce
|
|
21
|
+
* bands that look like §12.7's and mean something else — a calibrated label on
|
|
22
|
+
* an uncalibrated number, which is worse than no band at all because it reads
|
|
23
|
+
* as more precise than it is.
|
|
24
|
+
*
|
|
25
|
+
* ## So this bands on rank, and rank is a fact about the answer
|
|
26
|
+
*
|
|
27
|
+
* "This was the highest-scoring item in this reply" is true whatever produced
|
|
28
|
+
* the score, and it is exactly what "show me the top few" asks for. It claims
|
|
29
|
+
* nothing about magnitude, nothing about a threshold, and nothing that a change
|
|
30
|
+
* of scoring pipeline could silently falsify.
|
|
31
|
+
*
|
|
32
|
+
* The cut-offs are reading-surface sizes rather than measurements — the same
|
|
33
|
+
* footing `NODE_BUDGETS`'s own comment puts its figures on. Tune from data.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Rank cut-offs, inclusive upper bounds.
|
|
37
|
+
*
|
|
38
|
+
* `top` is three because that is what a developer reads before acting; the
|
|
39
|
+
* same figure `FINDING_CAPS["pre-push"]` reaches independently, from the same
|
|
40
|
+
* reasoning about a blocked developer's attention. It is **not** imported from
|
|
41
|
+
* there: that cap governs findings through the governance funnel, this governs
|
|
42
|
+
* presentation ordering, and coupling them would make a change to either mean
|
|
43
|
+
* a change to both.
|
|
44
|
+
*/
|
|
45
|
+
export const PROMINENCE_CUTOFFS = { top: 3, notable: 10 };
|
|
46
|
+
/** `rank` is 1-based: the highest-scoring item in an answer is rank 1. */
|
|
47
|
+
export function prominenceOf(rank) {
|
|
48
|
+
if (rank <= PROMINENCE_CUTOFFS.top)
|
|
49
|
+
return "top";
|
|
50
|
+
if (rank <= PROMINENCE_CUTOFFS.notable)
|
|
51
|
+
return "notable";
|
|
52
|
+
return "rest";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Attach `rank` and `prominence` to items already ordered highest-first.
|
|
56
|
+
*
|
|
57
|
+
* Deliberately does **not** sort. Every caller here already orders its own
|
|
58
|
+
* list, and re-sorting would either be a no-op or silently disagree with the
|
|
59
|
+
* order the caller reported elsewhere in the same reply. Ranking a list that
|
|
60
|
+
* is not in score order is a caller bug this function cannot detect, which is
|
|
61
|
+
* why it says so here rather than pretending to be total over any input.
|
|
62
|
+
*/
|
|
63
|
+
export function withProminence(ordered) {
|
|
64
|
+
return ordered.map((item, index) => ({
|
|
65
|
+
...item,
|
|
66
|
+
rank: index + 1,
|
|
67
|
+
prominence: prominenceOf(index + 1),
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* How many of each band a list holds — the counts a reply shows so a reader
|
|
72
|
+
* knows what the shown items were selected from.
|
|
73
|
+
*/
|
|
74
|
+
export function prominenceCounts(total) {
|
|
75
|
+
const top = Math.min(total, PROMINENCE_CUTOFFS.top);
|
|
76
|
+
const notable = Math.max(0, Math.min(total, PROMINENCE_CUTOFFS.notable) - top);
|
|
77
|
+
return { top, notable, rest: Math.max(0, total - top - notable) };
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=prominence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prominence.js","sourceRoot":"","sources":["../../src/query/prominence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAW,CAAC;AAEnE,0EAA0E;AAC1E,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,IAAI,kBAAkB,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,IAAI,IAAI,kBAAkB,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACzD,OAAO,MAAM,CAAC;AAChB,CAAC;AAQD;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAI,OAAqB;IACrD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,GAAG,IAAI;QACP,IAAI,EAAE,KAAK,GAAG,CAAC;QACf,UAAU,EAAE,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC;KACpC,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;IAC/E,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC;AACpE,CAAC"}
|
package/dist/query/provider.d.ts
CHANGED
|
@@ -45,6 +45,13 @@ export interface GraphStamp {
|
|
|
45
45
|
/** Epoch ms of the most recent write. Null on an empty graph. */
|
|
46
46
|
readonly graphBuiltAt: number | null;
|
|
47
47
|
readonly irSchemaVersion: number;
|
|
48
|
+
/**
|
|
49
|
+
* How many distinct commits the stored graph spans. One is healthy (and so
|
|
50
|
+
* is zero, on an empty graph); more than one is a real staleness signal — it
|
|
51
|
+
* means part of the graph describes code that is no longer what the other
|
|
52
|
+
* part describes. Surfaced as a disclosure note rather than averaged away.
|
|
53
|
+
*/
|
|
54
|
+
readonly commitSpread: number;
|
|
48
55
|
/**
|
|
49
56
|
* The lowest resolution anything in *this answer* rests on.
|
|
50
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/query/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEtG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;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AAC9D,eAAO,MAAM,sBAAsB,OAAQ,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAM5D;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,GAAE,gBAAqB,GAC7B,MAAM,EAAE,CAYV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/query/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/query/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAyGH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,KAAwB;IAChD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9B,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;YAAE,OAAO,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;QACtE,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;YAAE,OAAO,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;QACtE,OAAO,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,qBAAqB,CACnC,KAAwB,EACxB,UAA4B,EAAE;IAE9B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,IAAI,QAAQ,GACV,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QACvC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QACZ,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;QACpC,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/query/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAmB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/query/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAmB,MAAM,aAAa,CAAC;AAGrE,OAAO,KAAK,EAAE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auseSearch`. Reporting a partial answer as a whole one is the
|
|
16
16
|
* exact failure the honest-degradation rule exists to prevent.
|
|
17
17
|
*/
|
|
18
|
+
import { createResolutionFloor } from "./resolution-floor.js";
|
|
18
19
|
import { bfs, findPath, weightedBfs } from "./traverse.js";
|
|
19
20
|
function stampFor(provider, resolutionFloor) {
|
|
20
21
|
return { ...provider.baseStamp(), resolutionFloor };
|
|
@@ -71,7 +72,9 @@ export function impactOf(provider, seeds, options = {}) {
|
|
|
71
72
|
export function rootCauseSearch(provider, nodeId) {
|
|
72
73
|
const types = ["INCIDENT_CORRELATED", "FIXED_BY"];
|
|
73
74
|
const matches = [];
|
|
74
|
-
|
|
75
|
+
// R0 when no incident edge matched — a search that examined nothing must not
|
|
76
|
+
// stamp itself R4. See `createResolutionFloor`.
|
|
77
|
+
const floor = createResolutionFloor();
|
|
75
78
|
for (const edge of [...provider.incoming(nodeId, { types }), ...provider.outgoing(nodeId, { types })]) {
|
|
76
79
|
const otherId = edge.from === nodeId ? edge.to : edge.from;
|
|
77
80
|
const node = provider.node(otherId);
|
|
@@ -79,11 +82,10 @@ export function rootCauseSearch(provider, nodeId) {
|
|
|
79
82
|
continue;
|
|
80
83
|
if (node.type !== "INCIDENT" && node.type !== "FIX_PATTERN")
|
|
81
84
|
continue;
|
|
82
|
-
|
|
83
|
-
floor = edge.resolution;
|
|
85
|
+
floor.observe(edge.resolution);
|
|
84
86
|
matches.push({ incident: node, via: edge.type });
|
|
85
87
|
}
|
|
86
|
-
return result(provider, matches, floor, false, [
|
|
88
|
+
return result(provider, matches, floor.value(), false, [
|
|
87
89
|
"Structural incident links only. Embedding similarity was not run — this build has no " +
|
|
88
90
|
"vector store (§8.2), so a similar past incident with no graph edge to this node will " +
|
|
89
91
|
"not appear here. Absence is not evidence.",
|
|
@@ -168,15 +170,17 @@ export function traceApi(provider, fromNodeId, toNodeId, options = {}) {
|
|
|
168
170
|
if (node !== undefined)
|
|
169
171
|
path.push(node);
|
|
170
172
|
}
|
|
171
|
-
|
|
173
|
+
// R0 when no path was found. The note below already says nothing was
|
|
174
|
+
// traversed; stamping R4 beside it said the opposite in the field the
|
|
175
|
+
// reliability cap is actually derived from.
|
|
176
|
+
const floor = createResolutionFloor();
|
|
172
177
|
for (const edge of edges)
|
|
173
|
-
|
|
174
|
-
floor = edge.resolution;
|
|
178
|
+
floor.observe(edge.resolution);
|
|
175
179
|
const notes = edges.length === 0
|
|
176
180
|
? ["No path found. The two nodes may be genuinely unconnected, or connected only by " +
|
|
177
181
|
"edges this resolution level cannot resolve."]
|
|
178
182
|
: [];
|
|
179
|
-
return result(provider, { path, hops: edges.length }, floor, false, notes);
|
|
183
|
+
return result(provider, { path, hops: edges.length }, floor.value(), false, notes);
|
|
180
184
|
}
|
|
181
185
|
/**
|
|
182
186
|
* The scoped subgraph, ranked, intersected with `TESTS` edges.
|
|
@@ -242,7 +246,7 @@ export function changesWith(provider, nodeId) {
|
|
|
242
246
|
...provider.incoming(nodeId, { types: ["CHANGES_WITH"] }),
|
|
243
247
|
];
|
|
244
248
|
const byOther = new Map();
|
|
245
|
-
|
|
249
|
+
const floor = createResolutionFloor();
|
|
246
250
|
for (const edge of edges) {
|
|
247
251
|
const otherId = edge.from === nodeId ? edge.to : edge.from;
|
|
248
252
|
if (otherId === nodeId)
|
|
@@ -250,18 +254,38 @@ export function changesWith(provider, nodeId) {
|
|
|
250
254
|
const node = provider.node(otherId);
|
|
251
255
|
if (node === undefined)
|
|
252
256
|
continue;
|
|
253
|
-
|
|
254
|
-
floor = edge.resolution;
|
|
257
|
+
floor.observe(edge.resolution);
|
|
255
258
|
const support = typeof edge.attrs?.["support"] === "number" ? edge.attrs["support"] : 0;
|
|
256
259
|
byOther.set(otherId, { node, support, confidence: edge.confidence });
|
|
257
260
|
}
|
|
258
261
|
const data = [...byOther.values()].sort((a, b) => b.support - a.support || a.node.id.localeCompare(b.node.id));
|
|
259
262
|
const notes = [];
|
|
260
263
|
if (data.length === 0) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
// This note used to claim an ambiguity the graph does not actually have.
|
|
265
|
+
// It said the query "cannot tell apart" a file below the thresholds from a
|
|
266
|
+
// graph built without git history — but the `FILE` node's own
|
|
267
|
+
// `changeCount` is written by the git-history source and by nothing else,
|
|
268
|
+
// so its presence *is* the evidence that history ran for this file. UAT
|
|
269
|
+
// Phase 3 item 6: a 21-commit file came back empty here and the caller was
|
|
270
|
+
// told the reason was unknowable, when half of it was already on the node.
|
|
271
|
+
const changeCount = provider.node(nodeId)?.attrs?.["changeCount"];
|
|
272
|
+
if (typeof changeCount === "number" && changeCount > 0) {
|
|
273
|
+
notes.push(`No CHANGES_WITH edge touches this node, and git history did run for it: the graph records ` +
|
|
274
|
+
`${changeCount} commit(s) touching this file. So this is a threshold result, not a missing ` +
|
|
275
|
+
"source — no single partner co-changed with it often enough, relative to how often it " +
|
|
276
|
+
"changes, to clear the support and confidence floors recorded when the graph was built. " +
|
|
277
|
+
"Note that the confidence floor divides by the more-frequently-changed file's own total, " +
|
|
278
|
+
"so a file that changes very often needs proportionally more co-changes with any one " +
|
|
279
|
+
"partner to couple to it at all — which is deliberate (it stops a busy config file " +
|
|
280
|
+
"coupling to everything) and does mean the busiest files report the fewest partners.");
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
notes.push("No CHANGES_WITH edge touches this node, and the node carries no recorded change count " +
|
|
284
|
+
"either. That may mean the file has no co-change history above the recorded " +
|
|
285
|
+
"support/confidence thresholds, or that git history was skipped when the graph was " +
|
|
286
|
+
"built — with no change count on the node, this query cannot tell the two apart.");
|
|
287
|
+
}
|
|
264
288
|
}
|
|
265
|
-
return result(provider, data,
|
|
289
|
+
return result(provider, data, floor.value(), false, notes);
|
|
266
290
|
}
|
|
267
291
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/query/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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AuF;gBACvF,yFAAyF;gBACzF,0FAA0F;gBAC1F,sFAAsF;gBACtF,oFAAoF;gBACpF,qFAAqF,CACxF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CACR,wFAAwF;gBACtF,6EAA6E;gBAC7E,oFAAoF;gBACpF,iFAAiF,CACpF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A running minimum over resolution levels that knows the difference between
|
|
3
|
+
* "the weakest evidence was R4" and "there was no evidence."
|
|
4
|
+
*
|
|
5
|
+
* The bug it removes, found in UAT: `propagation` refused an answer — no edge
|
|
6
|
+
* of any walked type touched the node, so the traversal followed nothing — and
|
|
7
|
+
* stamped that reply `resolutionFloor: 4`, `reliabilityCap: "A"`. The strongest
|
|
8
|
+
* tier in the system, on a walk that examined zero edges. Nothing computed it;
|
|
9
|
+
* it was the identity value of a `let floor = 4` running minimum, surviving
|
|
10
|
+
* untouched because the loop that would have lowered it never ran.
|
|
11
|
+
*
|
|
12
|
+
* That is the empty-denominator failure this project catches everywhere else,
|
|
13
|
+
* appearing in the resolution axis: a reply that found nothing and a reply
|
|
14
|
+
* resting on runtime-witnessed evidence produced the same number, and the
|
|
15
|
+
* number is the one that reliability class is derived from — so the reply that
|
|
16
|
+
* knew least was labelled most trustworthy.
|
|
17
|
+
*
|
|
18
|
+
* R0 is the answer for the empty case, and it is not a new convention:
|
|
19
|
+
* `minimumResolution` in `@descryy/ir` already returns R0 over an empty graph
|
|
20
|
+
* path, ratified by DEC-NEXT-empty-graph-path-resolution-floor (option A —
|
|
21
|
+
* "no hop resolved anything, so nothing above R0 has been established"), and
|
|
22
|
+
* `coChanges`/`similarIncidents` already special-case their own empty sets to
|
|
23
|
+
* 0 by hand. This makes the same rule the default rather than something each
|
|
24
|
+
* call site has to remember.
|
|
25
|
+
*/
|
|
26
|
+
import type { ResolutionLevel } from "@descryy/ir";
|
|
27
|
+
export interface ResolutionFloor {
|
|
28
|
+
/** Fold one edge's (or hop's) resolution into the running minimum. */
|
|
29
|
+
observe(resolution: ResolutionLevel): void;
|
|
30
|
+
/** The minimum observed, or **R0** when nothing was observed at all. */
|
|
31
|
+
value(): ResolutionLevel;
|
|
32
|
+
/** Whether anything was observed. For a caller that discloses the difference. */
|
|
33
|
+
observed(): boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function createResolutionFloor(): ResolutionFloor;
|
|
36
|
+
//# sourceMappingURL=resolution-floor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution-floor.d.ts","sourceRoot":"","sources":["../../src/query/resolution-floor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,OAAO,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C,wEAAwE;IACxE,KAAK,IAAI,eAAe,CAAC;IACzB,iFAAiF;IACjF,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAWvD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A running minimum over resolution levels that knows the difference between
|
|
3
|
+
* "the weakest evidence was R4" and "there was no evidence."
|
|
4
|
+
*
|
|
5
|
+
* The bug it removes, found in UAT: `propagation` refused an answer — no edge
|
|
6
|
+
* of any walked type touched the node, so the traversal followed nothing — and
|
|
7
|
+
* stamped that reply `resolutionFloor: 4`, `reliabilityCap: "A"`. The strongest
|
|
8
|
+
* tier in the system, on a walk that examined zero edges. Nothing computed it;
|
|
9
|
+
* it was the identity value of a `let floor = 4` running minimum, surviving
|
|
10
|
+
* untouched because the loop that would have lowered it never ran.
|
|
11
|
+
*
|
|
12
|
+
* That is the empty-denominator failure this project catches everywhere else,
|
|
13
|
+
* appearing in the resolution axis: a reply that found nothing and a reply
|
|
14
|
+
* resting on runtime-witnessed evidence produced the same number, and the
|
|
15
|
+
* number is the one that reliability class is derived from — so the reply that
|
|
16
|
+
* knew least was labelled most trustworthy.
|
|
17
|
+
*
|
|
18
|
+
* R0 is the answer for the empty case, and it is not a new convention:
|
|
19
|
+
* `minimumResolution` in `@descryy/ir` already returns R0 over an empty graph
|
|
20
|
+
* path, ratified by DEC-NEXT-empty-graph-path-resolution-floor (option A —
|
|
21
|
+
* "no hop resolved anything, so nothing above R0 has been established"), and
|
|
22
|
+
* `coChanges`/`similarIncidents` already special-case their own empty sets to
|
|
23
|
+
* 0 by hand. This makes the same rule the default rather than something each
|
|
24
|
+
* call site has to remember.
|
|
25
|
+
*/
|
|
26
|
+
export function createResolutionFloor() {
|
|
27
|
+
let lowest = 4;
|
|
28
|
+
let seen = false;
|
|
29
|
+
return {
|
|
30
|
+
observe(resolution) {
|
|
31
|
+
if (!seen || resolution < lowest)
|
|
32
|
+
lowest = resolution;
|
|
33
|
+
seen = true;
|
|
34
|
+
},
|
|
35
|
+
value: () => (seen ? lowest : 0),
|
|
36
|
+
observed: () => seen,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=resolution-floor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution-floor.js","sourceRoot":"","sources":["../../src/query/resolution-floor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAaH,MAAM,UAAU,qBAAqB;IACnC,IAAI,MAAM,GAAoB,CAAC,CAAC;IAChC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,OAAO;QACL,OAAO,CAAC,UAAU;YAChB,IAAI,CAAC,IAAI,IAAI,UAAU,GAAG,MAAM;gBAAE,MAAM,GAAG,UAAU,CAAC;YACtD,IAAI,GAAG,IAAI,CAAC;QACd,CAAC;QACD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/query/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/query/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,CA6BxE;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAMtD"}
|
package/dist/query/sqlite.js
CHANGED
package/dist/query/sqlite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../src/query/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,sBAAsB,GAIvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,M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EAAE,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAClB,KAAmB,EACnB,UAA4B,EAAE;IAE9B,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS;QAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;IACpC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import type { ObservedTestOutcome } from "../graph/observed-tests.ts";
|
|
36
|
+
import type { SqlDriver } from "../store/driver/driver.ts";
|
|
37
|
+
export interface ObservedTestFor {
|
|
38
|
+
/** The `TEST_CASE` node that ran. */
|
|
39
|
+
readonly nodeId: string;
|
|
40
|
+
/** The name the run itself printed. */
|
|
41
|
+
readonly qualifiedName: string;
|
|
42
|
+
readonly outcome: ObservedTestOutcome;
|
|
43
|
+
readonly runId: string;
|
|
44
|
+
readonly observedAt: number;
|
|
45
|
+
/**
|
|
46
|
+
* `true` when the caller asked about this very test case, witnessed end to
|
|
47
|
+
* end. `false` when the answer was reached across a static `TESTS` edge,
|
|
48
|
+
* which no run confirmed. See the module header.
|
|
49
|
+
*/
|
|
50
|
+
readonly direct: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface TestCoverageForRef {
|
|
53
|
+
readonly ref: string;
|
|
54
|
+
readonly tests: readonly ObservedTestFor[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* For each requested node id, the observed tests that bear on it.
|
|
58
|
+
*
|
|
59
|
+
* One test contributes at most one entry per ref: a test re-run across several
|
|
60
|
+
* runs is still one test, and the **most recent** observation is what the code
|
|
61
|
+
* stands verified against now. Reporting every historical run instead would
|
|
62
|
+
* make a flaky test look like broad coverage.
|
|
63
|
+
*/
|
|
64
|
+
export declare function observedTestCoverage(driver: SqlDriver, refs: readonly string[]): ReadonlyMap<string, TestCoverageForRef>;
|
|
65
|
+
//# sourceMappingURL=test-coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-coverage.d.ts","sourceRoot":"","sources":["../../src/query/test-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CAC5C;AAaD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAwDzC"}
|