@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,5 @@
|
|
|
1
|
+
export { applySerializedSizeBudget } from "./size.ts";
|
|
2
|
+
export type { SerializedSizeBudgetOptions, SerializedSizeBudgetResult } from "./size.ts";
|
|
3
|
+
export { applyReplySizeBudget } from "./reply.ts";
|
|
4
|
+
export type { ReplySizeBudgetOptions, ReplySizeBudgetResult } from "./reply.ts";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/budget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,YAAY,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/budget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applyReplySizeBudget` — the same discipline as `size.ts`, applied to the
|
|
3
|
+
* *whole* serialized reply rather than to one field inside it.
|
|
4
|
+
*
|
|
5
|
+
* `applySerializedSizeBudget` bounds the sum of the payloads it is pointed at
|
|
6
|
+
* and nothing else. That is what shipped as the fix for `get_git_diff`'s
|
|
7
|
+
* missing aggregate cap, and re-running the same real 48-file branch diff
|
|
8
|
+
* against it is what showed the fix was necessary but not sufficient: the
|
|
9
|
+
* patch budget *was* enforced (13 files carried patch text where 44 had
|
|
10
|
+
* before) and the call still failed outright, at 84,516 characters, because
|
|
11
|
+
* the per-file status/additions/deletions rows for all 48 files, plus the
|
|
12
|
+
* reply's own disclosures and envelope, sit outside that budget entirely.
|
|
13
|
+
*
|
|
14
|
+
* The lesson is the same one `size.ts` records one level down, and it has now
|
|
15
|
+
* been learned twice: **a cap over one part of a reply bounds nothing about
|
|
16
|
+
* the reply.** So this budget takes everything it does not own as
|
|
17
|
+
* `overheadBytes` and shrinks in two stages, most-destructive last:
|
|
18
|
+
*
|
|
19
|
+
* 1. **Withhold payloads.** Prefix rule, exactly as `size.ts`: leading items
|
|
20
|
+
* keep theirs, later ones are withheld carrying a named reason.
|
|
21
|
+
* 2. **Drop trailing items** — only when the fully-withheld list *still* does
|
|
22
|
+
* not fit, i.e. the metadata alone is over budget. Reported as a count, so
|
|
23
|
+
* a caller re-requests narrowed rather than reading a silently short list
|
|
24
|
+
* as a complete one.
|
|
25
|
+
*
|
|
26
|
+
* **Breadth before depth**: if stage 2 had to fire, no payload is restored for
|
|
27
|
+
* the survivors even when bytes remain. Spending the last of a budget on patch
|
|
28
|
+
* text while files are being dropped from the list is the wrong trade, and a
|
|
29
|
+
* reply that is both short *and* deep is harder to act on than one that is
|
|
30
|
+
* short and says so.
|
|
31
|
+
*/
|
|
32
|
+
export interface ReplySizeBudgetOptions<T> {
|
|
33
|
+
/** The cap on `overheadBytes` plus the serialized size of every kept item. */
|
|
34
|
+
readonly maxTotalBytes: number;
|
|
35
|
+
/**
|
|
36
|
+
* What the rest of the reply costs — envelope, headline, disclosures,
|
|
37
|
+
* everything this budget does not own. Measured by the caller, not guessed:
|
|
38
|
+
* an under-stated overhead is exactly how the first fix came in over the
|
|
39
|
+
* ceiling anyway.
|
|
40
|
+
*/
|
|
41
|
+
readonly overheadBytes: number;
|
|
42
|
+
/**
|
|
43
|
+
* This item's own serialized cost in bytes, **including** whatever separator
|
|
44
|
+
* it carries in the encoded list (a comma, for JSON). Called on both the
|
|
45
|
+
* full and the withheld form of an item.
|
|
46
|
+
*/
|
|
47
|
+
readonly sizeOf: (item: T) => number;
|
|
48
|
+
/** True while this item still carries a payload the budget could withhold. */
|
|
49
|
+
readonly hasPayload: (item: T) => boolean;
|
|
50
|
+
/** Rebuild this item without its payload, carrying a reason the caller can read. */
|
|
51
|
+
readonly withhold: (item: T, spentBytes: number) => T;
|
|
52
|
+
}
|
|
53
|
+
export interface ReplySizeBudgetResult<T> {
|
|
54
|
+
/**
|
|
55
|
+
* Order preserved. Shorter than the input exactly when `droppedCount > 0` —
|
|
56
|
+
* see that field, and never without it being reported.
|
|
57
|
+
*/
|
|
58
|
+
readonly items: readonly T[];
|
|
59
|
+
/** How many kept items had a payload withheld by this budget. */
|
|
60
|
+
readonly withheldCount: number;
|
|
61
|
+
/** How many trailing items are absent from `items` entirely. */
|
|
62
|
+
readonly droppedCount: number;
|
|
63
|
+
/** `overheadBytes` plus every kept item — an upper bound, never an under-count. */
|
|
64
|
+
readonly totalBytes: number;
|
|
65
|
+
}
|
|
66
|
+
export declare function applyReplySizeBudget<T>(items: readonly T[], options: ReplySizeBudgetOptions<T>): ReplySizeBudgetResult<T>;
|
|
67
|
+
//# sourceMappingURL=reply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/budget/reply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACrC,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GACjC,qBAAqB,CAAC,CAAC,CAAC,CA+C1B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applyReplySizeBudget` — the same discipline as `size.ts`, applied to the
|
|
3
|
+
* *whole* serialized reply rather than to one field inside it.
|
|
4
|
+
*
|
|
5
|
+
* `applySerializedSizeBudget` bounds the sum of the payloads it is pointed at
|
|
6
|
+
* and nothing else. That is what shipped as the fix for `get_git_diff`'s
|
|
7
|
+
* missing aggregate cap, and re-running the same real 48-file branch diff
|
|
8
|
+
* against it is what showed the fix was necessary but not sufficient: the
|
|
9
|
+
* patch budget *was* enforced (13 files carried patch text where 44 had
|
|
10
|
+
* before) and the call still failed outright, at 84,516 characters, because
|
|
11
|
+
* the per-file status/additions/deletions rows for all 48 files, plus the
|
|
12
|
+
* reply's own disclosures and envelope, sit outside that budget entirely.
|
|
13
|
+
*
|
|
14
|
+
* The lesson is the same one `size.ts` records one level down, and it has now
|
|
15
|
+
* been learned twice: **a cap over one part of a reply bounds nothing about
|
|
16
|
+
* the reply.** So this budget takes everything it does not own as
|
|
17
|
+
* `overheadBytes` and shrinks in two stages, most-destructive last:
|
|
18
|
+
*
|
|
19
|
+
* 1. **Withhold payloads.** Prefix rule, exactly as `size.ts`: leading items
|
|
20
|
+
* keep theirs, later ones are withheld carrying a named reason.
|
|
21
|
+
* 2. **Drop trailing items** — only when the fully-withheld list *still* does
|
|
22
|
+
* not fit, i.e. the metadata alone is over budget. Reported as a count, so
|
|
23
|
+
* a caller re-requests narrowed rather than reading a silently short list
|
|
24
|
+
* as a complete one.
|
|
25
|
+
*
|
|
26
|
+
* **Breadth before depth**: if stage 2 had to fire, no payload is restored for
|
|
27
|
+
* the survivors even when bytes remain. Spending the last of a budget on patch
|
|
28
|
+
* text while files are being dropped from the list is the wrong trade, and a
|
|
29
|
+
* reply that is both short *and* deep is harder to act on than one that is
|
|
30
|
+
* short and says so.
|
|
31
|
+
*/
|
|
32
|
+
export function applyReplySizeBudget(items, options) {
|
|
33
|
+
const { maxTotalBytes, overheadBytes, sizeOf, hasPayload, withhold } = options;
|
|
34
|
+
// The withheld form's size is measured with `maxTotalBytes` as the spent
|
|
35
|
+
// figure because the reason text carries that number and no figure this
|
|
36
|
+
// budget can report is wider than the cap itself. Measuring with the widest
|
|
37
|
+
// possible number can only over-estimate, and over-estimating is the safe
|
|
38
|
+
// direction: the fitted reply lands under the ceiling, never over it.
|
|
39
|
+
const bare = items.map((item) => (hasPayload(item) ? withhold(item, maxTotalBytes) : item));
|
|
40
|
+
const bareBytes = bare.map(sizeOf);
|
|
41
|
+
let total = overheadBytes;
|
|
42
|
+
for (const bytes of bareBytes)
|
|
43
|
+
total += bytes;
|
|
44
|
+
let kept = items.length;
|
|
45
|
+
while (kept > 0 && total > maxTotalBytes) {
|
|
46
|
+
kept -= 1;
|
|
47
|
+
total -= bareBytes[kept];
|
|
48
|
+
}
|
|
49
|
+
const droppedCount = items.length - kept;
|
|
50
|
+
const out = bare.slice(0, kept);
|
|
51
|
+
let withheldCount = 0;
|
|
52
|
+
for (let i = 0; i < kept; i += 1)
|
|
53
|
+
if (hasPayload(items[i]))
|
|
54
|
+
withheldCount += 1;
|
|
55
|
+
if (droppedCount === 0) {
|
|
56
|
+
for (let i = 0; i < kept; i += 1) {
|
|
57
|
+
const item = items[i];
|
|
58
|
+
if (!hasPayload(item))
|
|
59
|
+
continue;
|
|
60
|
+
// Negative when a tiny payload costs less than the sentence explaining
|
|
61
|
+
// its absence — a real case, and restoring it is then strictly better.
|
|
62
|
+
const delta = sizeOf(item) - bareBytes[i];
|
|
63
|
+
if (total + delta > maxTotalBytes)
|
|
64
|
+
break; // prefix rule — see the header
|
|
65
|
+
total += delta;
|
|
66
|
+
out[i] = item;
|
|
67
|
+
withheldCount -= 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Every item still withheld is rebuilt with the figure actually spent rather
|
|
71
|
+
// than the cap-width estimate above. `total <= maxTotalBytes` here, so the
|
|
72
|
+
// rebuilt reason is never wider than what was measured — the bound holds.
|
|
73
|
+
const finalItems = out.map((item, i) => item === items[i] || !hasPayload(items[i]) ? item : withhold(items[i], total));
|
|
74
|
+
return { items: finalItems, withheldCount, droppedCount, totalBytes: total };
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/budget/reply.ts"],"names":[],"mappings":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AC,EAAE,CAAC;QACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBAAE,SAAS;YAChC,uEAAuE;YACvE,uEAAuE;YACvE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAE,CAAC;YAC3C,IAAI,KAAK,GAAG,KAAK,GAAG,aAAa;gBAAE,MAAM,CAAC,+BAA+B;YACzE,KAAK,IAAI,KAAK,CAAC;YACf,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YACd,aAAa,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,6EAA6E;IAC7E,2EAA2E;IAC3E,0EAA0E;IAC1E,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CACrC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,KAAK,CAAC,CAChF,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applySerializedSizeBudget` — a total-bytes cap over a list of items whose
|
|
3
|
+
* payloads dominate a reply's size.
|
|
4
|
+
*
|
|
5
|
+
* Written for `gitDiff`, which had two size controls and neither bounded the
|
|
6
|
+
* sum: a per-file `maxPatchBytes` cap and a file-count `limit`. A real 48-file
|
|
7
|
+
* branch diff, with 44 patches each *under* the 20,000-byte per-file cap,
|
|
8
|
+
* summed to 229KB and hard-failed the call outright — the reply never reached
|
|
9
|
+
* the caller at all. A per-item cap says nothing about a total, and a tool
|
|
10
|
+
* that has only the first has no bound on its reply.
|
|
11
|
+
*
|
|
12
|
+
* Two deliberate shapes:
|
|
13
|
+
*
|
|
14
|
+
* - **Withhold, never drop.** An over-budget item stays in the list with its
|
|
15
|
+
* stats and a named reason; only the payload goes. §4's empty-denominator
|
|
16
|
+
* rule: a caller must never be unable to tell "this file did not change"
|
|
17
|
+
* from "this file's patch did not fit."
|
|
18
|
+
* - **Prefix, not greedy backfill.** Once the budget is exhausted, every
|
|
19
|
+
* later item is withheld even if a small one would still fit. "The first N
|
|
20
|
+
* kept their payloads" is a rule a caller can act on — re-request the rest
|
|
21
|
+
* narrowed. A hole-filling subset is a rule no caller can predict, and it
|
|
22
|
+
* makes the reply's contents depend on the sizes of unrelated items.
|
|
23
|
+
*/
|
|
24
|
+
export interface SerializedSizeBudgetOptions<T> {
|
|
25
|
+
/** The cap on the sum of `sizeOf` across kept items. */
|
|
26
|
+
readonly maxTotalBytes: number;
|
|
27
|
+
/** This item's payload cost in bytes. Return 0 for an item carrying no payload. */
|
|
28
|
+
readonly sizeOf: (item: T) => number;
|
|
29
|
+
/** Rebuild this item without its payload, carrying a reason the caller can read. */
|
|
30
|
+
readonly withhold: (item: T, spentBytes: number) => T;
|
|
31
|
+
}
|
|
32
|
+
export interface SerializedSizeBudgetResult<T> {
|
|
33
|
+
/** Same length and order as the input — over-budget items are withheld, not removed. */
|
|
34
|
+
readonly items: readonly T[];
|
|
35
|
+
/** Bytes actually spent by the kept payloads. */
|
|
36
|
+
readonly spentBytes: number;
|
|
37
|
+
/** What every payload would have cost — the honest denominator for a disclosure. */
|
|
38
|
+
readonly requestedBytes: number;
|
|
39
|
+
/** How many items had a payload withheld by *this* budget (not ones that had none). */
|
|
40
|
+
readonly withheldCount: number;
|
|
41
|
+
}
|
|
42
|
+
export declare function applySerializedSizeBudget<T>(items: readonly T[], options: SerializedSizeBudgetOptions<T>): SerializedSizeBudgetResult<T>;
|
|
43
|
+
//# sourceMappingURL=size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/budget/size.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACrC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,wFAAwF;IACxF,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,0BAA0B,CAAC,CAAC,CAAC,CAiC/B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applySerializedSizeBudget` — a total-bytes cap over a list of items whose
|
|
3
|
+
* payloads dominate a reply's size.
|
|
4
|
+
*
|
|
5
|
+
* Written for `gitDiff`, which had two size controls and neither bounded the
|
|
6
|
+
* sum: a per-file `maxPatchBytes` cap and a file-count `limit`. A real 48-file
|
|
7
|
+
* branch diff, with 44 patches each *under* the 20,000-byte per-file cap,
|
|
8
|
+
* summed to 229KB and hard-failed the call outright — the reply never reached
|
|
9
|
+
* the caller at all. A per-item cap says nothing about a total, and a tool
|
|
10
|
+
* that has only the first has no bound on its reply.
|
|
11
|
+
*
|
|
12
|
+
* Two deliberate shapes:
|
|
13
|
+
*
|
|
14
|
+
* - **Withhold, never drop.** An over-budget item stays in the list with its
|
|
15
|
+
* stats and a named reason; only the payload goes. §4's empty-denominator
|
|
16
|
+
* rule: a caller must never be unable to tell "this file did not change"
|
|
17
|
+
* from "this file's patch did not fit."
|
|
18
|
+
* - **Prefix, not greedy backfill.** Once the budget is exhausted, every
|
|
19
|
+
* later item is withheld even if a small one would still fit. "The first N
|
|
20
|
+
* kept their payloads" is a rule a caller can act on — re-request the rest
|
|
21
|
+
* narrowed. A hole-filling subset is a rule no caller can predict, and it
|
|
22
|
+
* makes the reply's contents depend on the sizes of unrelated items.
|
|
23
|
+
*/
|
|
24
|
+
export function applySerializedSizeBudget(items, options) {
|
|
25
|
+
const { maxTotalBytes, sizeOf, withhold } = options;
|
|
26
|
+
const out = [];
|
|
27
|
+
let spentBytes = 0;
|
|
28
|
+
let requestedBytes = 0;
|
|
29
|
+
let withheldCount = 0;
|
|
30
|
+
let exhausted = false;
|
|
31
|
+
for (const item of items) {
|
|
32
|
+
const size = sizeOf(item);
|
|
33
|
+
requestedBytes += size;
|
|
34
|
+
// An item with no payload of its own costs nothing and is not this
|
|
35
|
+
// budget's doing — its existing reason (binary, over the per-item cap)
|
|
36
|
+
// must survive untouched.
|
|
37
|
+
if (size === 0) {
|
|
38
|
+
out.push(item);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (exhausted || spentBytes + size > maxTotalBytes) {
|
|
42
|
+
exhausted = true;
|
|
43
|
+
withheldCount += 1;
|
|
44
|
+
out.push(withhold(item, spentBytes));
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
spentBytes += size;
|
|
48
|
+
out.push(item);
|
|
49
|
+
}
|
|
50
|
+
return { items: out, spentBytes, requestedBytes, withheldCount };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.js","sourceRoot":"","sources":["../../src/budget/size.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAsBH,MAAM,UAAU,yBAAyB,CACvC,KAAmB,EACnB,OAAuC;IAEvC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEpD,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,cAAc,IAAI,IAAI,CAAC;QAEvB,mEAAmE;QACnE,uEAAuE;QACvE,0BAA0B;QAC1B,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,SAAS;QACX,CAAC;QAED,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,GAAG,aAAa,EAAE,CAAC;YACnD,SAAS,GAAG,IAAI,CAAC;YACjB,aAAa,IAAI,CAAC,CAAC;YACnB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;YACrC,SAAS;QACX,CAAC;QAED,UAAU,IAAI,IAAI,CAAC;QACnB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/contracts/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/contracts/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvF,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEzF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,CAAC;IACjD,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAqGD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,eAAoB,GAC5B,WAAW,CAAC,aAAa,CAAC,CAwL5B"}
|
package/dist/contracts/engine.js
CHANGED
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
* **`adapter-openapi` now supplies `attrs.roles`**, so the provider half of
|
|
43
43
|
* this is closed; the consumer half is not.
|
|
44
44
|
*/
|
|
45
|
-
import {
|
|
45
|
+
import { createResolutionFloor } from "../query/resolution-floor.js";
|
|
46
|
+
import { findContractOrphans, PATH_LEVEL_ONLY_NOTE, } from "./orphans.js";
|
|
46
47
|
import { compareShapes, readShape } from "./shapes.js";
|
|
47
48
|
/** Shapes a caller declared on its `USES_API` edge, by direction. */
|
|
48
49
|
function consumerShapes(provider, caller, edgeAttrs) {
|
|
@@ -145,17 +146,19 @@ export function checkContracts(provider, options = {}) {
|
|
|
145
146
|
let providerOnly = 0;
|
|
146
147
|
let unroledDtos = 0;
|
|
147
148
|
let ambiguousDirections = 0;
|
|
148
|
-
|
|
149
|
+
// R0 when nothing was compared at all — see `createResolutionFloor`.
|
|
150
|
+
const floor = createResolutionFloor();
|
|
149
151
|
for (const endpoint of set.nodes) {
|
|
150
152
|
const callers = [];
|
|
151
153
|
const routes = [];
|
|
152
|
-
let edgeFloor = 4;
|
|
153
154
|
for (const edge of provider.incoming(endpoint.id, { types: ["USES_API", "SERVES_API"] })) {
|
|
154
155
|
const other = provider.node(edge.from);
|
|
155
156
|
if (other === undefined)
|
|
156
157
|
continue;
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
// No per-endpoint edge floor is kept here: the shape claim's own floor is
|
|
159
|
+
// taken per comparison below, from the evidence that comparison actually
|
|
160
|
+
// rests on. A second, unread running minimum was computed here for a
|
|
161
|
+
// while and folded into nothing.
|
|
159
162
|
if (edge.type === "USES_API") {
|
|
160
163
|
callers.push({ node: other, attrs: edge.attrs ?? {}, resolution: edge.resolution });
|
|
161
164
|
}
|
|
@@ -187,8 +190,6 @@ export function checkContracts(provider, options = {}) {
|
|
|
187
190
|
// reads a response, the route reads a request body.
|
|
188
191
|
const [reader, writer] = direction === "response" ? [consumer, producer] : [producer, consumer];
|
|
189
192
|
const comparison = compareShapes(reader, writer);
|
|
190
|
-
if (comparison.differences.length === 0)
|
|
191
|
-
continue;
|
|
192
193
|
// Principle 3, at the point the claim is made rather than in the report.
|
|
193
194
|
// A shape claim is not name-level, so R2 evidence caps it at class B
|
|
194
195
|
// however confident the diff looks.
|
|
@@ -202,8 +203,14 @@ export function checkContracts(provider, options = {}) {
|
|
|
202
203
|
? declaredRes
|
|
203
204
|
: caller.resolution;
|
|
204
205
|
const resolution = Math.min(shapeEvidence, reader.detailed && writer.detailed ? 3 : 2);
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
// Folded in for **every** comparison that ran, not only the ones that
|
|
207
|
+
// found a difference. "These shapes match" is a claim resting on the
|
|
208
|
+
// same evidence as "these shapes differ", and skipping the clean ones
|
|
209
|
+
// left a wholly-matching check reporting the identity value — R4, the
|
|
210
|
+
// strongest tier — for a comparison actually made at R2.
|
|
211
|
+
floor.observe(resolution);
|
|
212
|
+
if (comparison.differences.length === 0)
|
|
213
|
+
continue;
|
|
207
214
|
mismatches.push({
|
|
208
215
|
endpoint,
|
|
209
216
|
direction,
|
|
@@ -258,11 +265,21 @@ export function checkContracts(provider, options = {}) {
|
|
|
258
265
|
"by rank would decide it by whichever row the index reached first.");
|
|
259
266
|
}
|
|
260
267
|
if (shapes.ran) {
|
|
268
|
+
// The path half disclosed that no shape was compared, because from inside
|
|
269
|
+
// that half it is true. It is false here, and a coverage disclosure that
|
|
270
|
+
// denies the comparison reported beside it is worse than a wrong summary:
|
|
271
|
+
// the disclosure list is the part a caller is told to trust about what an
|
|
272
|
+
// answer does not cover, so a correct finding arrives discounted by the
|
|
273
|
+
// tool's own footnote. Retracted by identity rather than by pattern, so a
|
|
274
|
+
// reworded note cannot silently stop being retracted.
|
|
275
|
+
const stale = notes.indexOf(PATH_LEVEL_ONLY_NOTE);
|
|
276
|
+
if (stale !== -1)
|
|
277
|
+
notes.splice(stale, 1);
|
|
261
278
|
notes.push(`${comparable} shape pair(s) were compared and ${mismatches.length} disagreed. A field the ` +
|
|
262
279
|
"reading side ignores is not reported — only one the reading side needs and the writing " +
|
|
263
280
|
"side does not supply.");
|
|
264
281
|
}
|
|
265
|
-
return assemble(provider, paths.data, shapes, paths, notes, floor);
|
|
282
|
+
return assemble(provider, paths.data, shapes, paths, notes, floor.value());
|
|
266
283
|
}
|
|
267
284
|
function skipped(reason) {
|
|
268
285
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/contracts/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAKH,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file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AAG,CAC9B,UAAU,CAAC,KAAK,CAAC,eAAe,EAChC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACT,CAAC;IACrB,MAAM,KAAK,GAAe,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC;IACvE,OAAO;QACL,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QACvB,KAAK;QACL,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -83,6 +83,23 @@ export interface ContractReport {
|
|
|
83
83
|
/** True when the R3 shape comparison did not run. Always true in this half. */
|
|
84
84
|
readonly shapesCompared: boolean;
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* The path half's own coverage disclosure, exported so the shape half can retract
|
|
88
|
+
* it rather than restate it.
|
|
89
|
+
*
|
|
90
|
+
* This function is the path half and cannot know whether a shape comparison
|
|
91
|
+
* followed, so it always says one did not. That was true for as long as the path
|
|
92
|
+
* half was the only half that ran, and it stopped being true the moment a
|
|
93
|
+
* producer attached direction to a route's DTOs — leaving `contracts` reporting
|
|
94
|
+
* a shape mismatch above a disclosure denying any shape was compared. Measured
|
|
95
|
+
* against the real binary, UAT phase 2.
|
|
96
|
+
*
|
|
97
|
+
* A caller that runs the shape half removes this note when a comparison actually
|
|
98
|
+
* happened. It is a constant rather than a regex on the caller's side because a
|
|
99
|
+
* disclosure matched by pattern is a disclosure that silently stops being
|
|
100
|
+
* retracted the day someone rewords it.
|
|
101
|
+
*/
|
|
102
|
+
export declare const PATH_LEVEL_ONLY_NOTE: string;
|
|
86
103
|
export interface OrphanOptions {
|
|
87
104
|
/** Cap on endpoints enumerated. Truncation is reported, never silent. */
|
|
88
105
|
readonly limit?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orphans.d.ts","sourceRoot":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AM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;IACF;;;;;OAKG;IACH,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,QAEuB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAYD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,aAAkB,GAC1B,WAAW,CAAC,cAAc,CAAC,CA0M7B"}
|
|
@@ -46,6 +46,24 @@
|
|
|
46
46
|
* another service, curl. It is a lead, not a defect, and the wording says so.
|
|
47
47
|
*/
|
|
48
48
|
import { nearestMiss } from "./paths.js";
|
|
49
|
+
/**
|
|
50
|
+
* The path half's own coverage disclosure, exported so the shape half can retract
|
|
51
|
+
* it rather than restate it.
|
|
52
|
+
*
|
|
53
|
+
* This function is the path half and cannot know whether a shape comparison
|
|
54
|
+
* followed, so it always says one did not. That was true for as long as the path
|
|
55
|
+
* half was the only half that ran, and it stopped being true the moment a
|
|
56
|
+
* producer attached direction to a route's DTOs — leaving `contracts` reporting
|
|
57
|
+
* a shape mismatch above a disclosure denying any shape was compared. Measured
|
|
58
|
+
* against the real binary, UAT phase 2.
|
|
59
|
+
*
|
|
60
|
+
* A caller that runs the shape half removes this note when a comparison actually
|
|
61
|
+
* happened. It is a constant rather than a regex on the caller's side because a
|
|
62
|
+
* disclosure matched by pattern is a disclosure that silently stops being
|
|
63
|
+
* retracted the day someone rewords it.
|
|
64
|
+
*/
|
|
65
|
+
export const PATH_LEVEL_ONLY_NOTE = "Path level only. Request and response shapes were not compared — that requires R3 on both " +
|
|
66
|
+
"sides, because it compares shapes rather than names.";
|
|
49
67
|
const DEFAULT_MAX_FINDINGS = 25;
|
|
50
68
|
function keyOf(endpoint) {
|
|
51
69
|
const method = endpoint.attrs["method"];
|
|
@@ -193,8 +211,7 @@ export function findContractOrphans(provider, options = {}) {
|
|
|
193
211
|
"explanation is a service outside this workspace, and the honest statement is that their " +
|
|
194
212
|
"provider was never read.");
|
|
195
213
|
}
|
|
196
|
-
notes.push(
|
|
197
|
-
"sides, because it compares shapes rather than names.");
|
|
214
|
+
notes.push(PATH_LEVEL_ONLY_NOTE);
|
|
198
215
|
let floor = 4;
|
|
199
216
|
for (const finding of kept)
|
|
200
217
|
if (finding.resolution < floor)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orphans.js","sourceRoot":"","sources":["../../src/contracts/orphans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAKH,OAAO,EAAE,WAAW,EAAmC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"orphans.js","sourceRoot":"","sources":["../../src/contracts/orphans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAKH,OAAO,EAAE,WAAW,EAAmC,MAAM,YAAY,CAAC;AAwC1E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MA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,cAAc,CAAC,MAAyB;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,kBAAkB,CAAC;IACnD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,QAAQ,MAAM,CAAC,MAAM,GAAG,CAAC,WAAW,CAAC;AAC9F,CAAC;AAED,SAAS,WAAW,CAClB,SAAiB,EACjB,WAAmB,EACnB,UAAkB,EAClB,MAAc;IAEd,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE;QACvD,wBAAwB,EAAE,CAAC;QAC3B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CACb,QAA2B,EAC3B,IAAoB,EACpB,eAAgC,EAChC,SAAkB,EAClB,KAAe;IAEf,MAAM,KAAK,GAAe,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC;IACvE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -59,12 +59,5 @@ export interface CrossLanguageResult {
|
|
|
59
59
|
readonly resolved: readonly IREdge[];
|
|
60
60
|
readonly ambiguous: readonly CrossLanguageAmbiguity[];
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
* @param batches Every batch in this build, from every adapter.
|
|
64
|
-
* @param namespaceOf A batch's `producedBy` (`adapterId@version`) to its
|
|
65
|
-
* declared namespace, if any. The caller supplies this because a
|
|
66
|
-
* `CapabilityMatrix` is a per-adapter fact, not a per-batch one, and this
|
|
67
|
-
* pass is deliberately kept ignorant of how an adapter is instantiated.
|
|
68
|
-
*/
|
|
69
62
|
export declare function resolveCrossLanguage(batches: readonly IRBatch[], namespaceOf: (producedBy: string) => NamespaceDeclaration | undefined): CrossLanguageResult;
|
|
70
63
|
//# sourceMappingURL=cross-language.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-language.d.ts","sourceRoot":"","sources":["../../src/graph/cross-language.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5E,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;4DAC4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACvD;
|
|
1
|
+
{"version":3,"file":"cross-language.d.ts","sourceRoot":"","sources":["../../src/graph/cross-language.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5E,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;4DAC4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACvD;AAgDD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,oBAAoB,GAAG,SAAS,GACpE,mBAAmB,CAsDrB"}
|
|
@@ -53,6 +53,39 @@ function isMutualPeer(a, b) {
|
|
|
53
53
|
* `CapabilityMatrix` is a per-adapter fact, not a per-batch one, and this
|
|
54
54
|
* pass is deliberately kept ignorant of how an adapter is instantiated.
|
|
55
55
|
*/
|
|
56
|
+
/**
|
|
57
|
+
* A batch's `unresolved` list, tolerating the producer that has never heard of
|
|
58
|
+
* the field.
|
|
59
|
+
*
|
|
60
|
+
* `normaliseBatch` — every batch's gatekeeper on the way to the store — treats
|
|
61
|
+
* `unresolved` as absent-means-none, and says why in its own comment: absent is
|
|
62
|
+
* what a producer not yet updated to report it sends. Adapters are versioned
|
|
63
|
+
* and released on their own cadence exactly so that can happen, so a batch this
|
|
64
|
+
* pass rejects is one the Normaliser would have accepted.
|
|
65
|
+
*
|
|
66
|
+
* This is the same unguarded `.length` that crashed a real `analyze` run
|
|
67
|
+
* (b9044b2), reported as the *adapter* failing while the adapter was returning
|
|
68
|
+
* over a thousand perfectly good nodes. This pass is not reachable from
|
|
69
|
+
* `analyze` today, so it was latent rather than live — which is a reason to
|
|
70
|
+
* close it while the reason is written down, not a reason to leave it.
|
|
71
|
+
*
|
|
72
|
+
* Absent and malformed stay different, the line the Normaliser draws too: a
|
|
73
|
+
* missing field is an older producer, a field holding a string is a broken one,
|
|
74
|
+
* and defaulting the second away would hide a real defect. The producer is
|
|
75
|
+
* named in the message because that is the one thing a reader needs and cannot
|
|
76
|
+
* recover from the stack.
|
|
77
|
+
*/
|
|
78
|
+
function referencingRefs(batch) {
|
|
79
|
+
const raw = batch.unresolved;
|
|
80
|
+
if (raw === undefined || raw === null)
|
|
81
|
+
return [];
|
|
82
|
+
if (!Array.isArray(raw)) {
|
|
83
|
+
throw new Error(`${batch.producedBy} produced a batch whose "unresolved" is not an array. Absent is ` +
|
|
84
|
+
"accepted — it is what a producer compiled before the field existed sends — but a " +
|
|
85
|
+
"present, non-array value is a defect in the producer, not an older version of it.");
|
|
86
|
+
}
|
|
87
|
+
return raw;
|
|
88
|
+
}
|
|
56
89
|
export function resolveCrossLanguage(batches, namespaceOf) {
|
|
57
90
|
// One entry per batch that actually declared a namespace. A batch with no
|
|
58
91
|
// declaration contributes nothing to either side — it is neither a source
|
|
@@ -67,9 +100,10 @@ export function resolveCrossLanguage(batches, namespaceOf) {
|
|
|
67
100
|
const resolved = [];
|
|
68
101
|
const ambiguous = [];
|
|
69
102
|
for (const referencing of declaring) {
|
|
70
|
-
|
|
103
|
+
const refs = referencingRefs(referencing.batch);
|
|
104
|
+
if (refs.length === 0)
|
|
71
105
|
continue;
|
|
72
|
-
for (const ref of
|
|
106
|
+
for (const ref of refs) {
|
|
73
107
|
const candidates = [];
|
|
74
108
|
for (const declaringSide of declaring) {
|
|
75
109
|
if (declaringSide.batch === referencing.batch)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-language.js","sourceRoot":"","sources":["../../src/graph/cross-language.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,mFAAmF;AACnF,MAAM,CAAC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SAAS,EAAE,CAAC;gBACtC,IAAI,aAAa,CAAC,KAAK,KAAK,WAAW,CAAC,KAAK;oBAAE,SAAS;gBACxD,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC;oBAAE,SAAS;gBAC5E,IAAI,aAAa,CAAC,KAAK,CAAC,yBAAyB,KAAK,SAAS;oBAAE,SAAS;gBAE1E,KAAK,MAAM,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC;oBACjE,IAAI,IAAI,CAAC,aAAa,KAAK,GAAG,CAAC,SAAS;wBAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACzE,CAAC;YACH,CAAC;YAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS,CAAC,sCAAsC;YAE7E,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,CAAC;gBAChG,SAAS;YACX,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,GAAG,CAAC,UAAU;gBACpB,EAAE,EAAE,UAAU,CAAC,CAAC,CAAE;gBAClB,IAAI,EAAE,GAAG,CAAC,QAA2B;gBACrC,UAAU,EAAE,CAAC;gBACb,UAAU,EAAE,CAAC;gBACb,UAAU,EAAE,oBAAoB;aACjC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC"}
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -8,4 +8,6 @@ export { resolveCrossLanguage, RESOLVER_PRODUCED_BY } from "./cross-language.ts"
|
|
|
8
8
|
export type { NamespaceDeclaration, CrossLanguageAmbiguity, CrossLanguageResult } from "./cross-language.ts";
|
|
9
9
|
export { applyRuntimeObservations, reapplyEarnedOverlays, observedEdges, edgeCorrections, recordEdgeCorrection, RUNTIME_ADAPTER_ID, RUNTIME_ADAPTER_VERSION, RUNTIME_PRODUCER, } from "./runtime-confirmation.ts";
|
|
10
10
|
export type { Clock, EdgeCorrectionRow, ObservedEdgeRow, RuntimeConfirmationInput, RuntimeConfirmationResult, RuntimeObservationRefusal, StaleR4Observation, } from "./runtime-confirmation.ts";
|
|
11
|
+
export { applyObservedTests, observedTests } from "./observed-tests.ts";
|
|
12
|
+
export type { ObservedTestObservation, ObservedTestOutcome, ObservedTestRefusal, ObservedTestRow, ObservedTestsInput, ObservedTestsResult, } from "./observed-tests.ts";
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|