@gate-forge/core 0.13.9 → 0.14.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/config/index.d.ts +58 -6
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +44 -0
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/mapping/resolve.d.ts.map +1 -1
- package/dist/mapping/resolve.js +47 -6
- package/dist/mapping/resolve.js.map +1 -1
- package/dist/policy/evaluate.d.ts +16 -0
- package/dist/policy/evaluate.d.ts.map +1 -1
- package/dist/policy/evaluate.js +21 -2
- package/dist/policy/evaluate.js.map +1 -1
- package/dist/report/index.d.ts +21 -1
- package/dist/report/index.d.ts.map +1 -1
- package/dist/report/index.js +20 -0
- package/dist/report/index.js.map +1 -1
- package/dist/schemas/behavior-evidence.d.ts +2 -2
- package/dist/schemas/behavior-policy.d.ts +7 -0
- package/dist/schemas/behavior-policy.d.ts.map +1 -1
- package/dist/schemas/behavior-policy.js +7 -0
- package/dist/schemas/behavior-policy.js.map +1 -1
- package/dist/schemas/business-rules.d.ts +3 -3
- package/dist/schemas/classification-policy.d.ts +1 -1
- package/dist/schemas/gate-receipt.d.ts +2 -2
- package/dist/schemas/queue-observer.d.ts +4 -4
- package/dist/schemas/test-catalog.d.ts +14 -12
- package/dist/schemas/test-catalog.d.ts.map +1 -1
- package/dist/schemas/test-catalog.js +2 -0
- package/dist/schemas/test-catalog.js.map +1 -1
- package/dist/schemas/test-map.d.ts +4 -4
- package/dist/schemas/verdict.d.ts +5 -0
- package/dist/schemas/verdict.d.ts.map +1 -1
- package/dist/schemas/verdict.js +22 -0
- package/dist/schemas/verdict.js.map +1 -1
- package/dist/strictness.d.ts +1 -1
- package/dist/verdict/http-coverage.d.ts +155 -0
- package/dist/verdict/http-coverage.d.ts.map +1 -0
- package/dist/verdict/http-coverage.js +351 -0
- package/dist/verdict/http-coverage.js.map +1 -0
- package/dist/verdict/http-ledger.d.ts +67 -0
- package/dist/verdict/http-ledger.d.ts.map +1 -0
- package/dist/verdict/http-ledger.js +168 -0
- package/dist/verdict/http-ledger.js.map +1 -0
- package/dist/verdict/index.d.ts +15 -1
- package/dist/verdict/index.d.ts.map +1 -1
- package/dist/verdict/index.js +15 -1
- package/dist/verdict/index.js.map +1 -1
- package/dist/verdict/pack-verifiers.d.ts +66 -11
- package/dist/verdict/pack-verifiers.d.ts.map +1 -1
- package/dist/verdict/pack-verifiers.js +131 -28
- package/dist/verdict/pack-verifiers.js.map +1 -1
- package/package.json +1 -1
|
@@ -54,10 +54,10 @@ export declare const TestMapEntrySchema: z.ZodObject<{
|
|
|
54
54
|
unknown: "unknown";
|
|
55
55
|
"browser-e2e": "browser-e2e";
|
|
56
56
|
"observed-e2e": "observed-e2e";
|
|
57
|
-
unit: "unit";
|
|
58
|
-
integration: "integration";
|
|
59
57
|
"server-e2e": "server-e2e";
|
|
60
58
|
"api-e2e": "api-e2e";
|
|
59
|
+
unit: "unit";
|
|
60
|
+
integration: "integration";
|
|
61
61
|
component: "component";
|
|
62
62
|
}>>;
|
|
63
63
|
source: z.ZodOptional<z.ZodLiteral<"annotation">>;
|
|
@@ -88,10 +88,10 @@ export declare const TestMapSchema: z.ZodObject<{
|
|
|
88
88
|
unknown: "unknown";
|
|
89
89
|
"browser-e2e": "browser-e2e";
|
|
90
90
|
"observed-e2e": "observed-e2e";
|
|
91
|
-
unit: "unit";
|
|
92
|
-
integration: "integration";
|
|
93
91
|
"server-e2e": "server-e2e";
|
|
94
92
|
"api-e2e": "api-e2e";
|
|
93
|
+
unit: "unit";
|
|
94
|
+
integration: "integration";
|
|
95
95
|
component: "component";
|
|
96
96
|
}>>;
|
|
97
97
|
source: z.ZodOptional<z.ZodLiteral<"annotation">>;
|
|
@@ -91,6 +91,11 @@ export declare const CauseCodeSchema: z.ZodEnum<{
|
|
|
91
91
|
BUSINESS_RULE_TEST_TYPE_MISMATCH: "BUSINESS_RULE_TEST_TYPE_MISMATCH";
|
|
92
92
|
BUSINESS_RULE_TEST_UNPROVEN: "BUSINESS_RULE_TEST_UNPROVEN";
|
|
93
93
|
BUSINESS_RULE_TEST_FAILING: "BUSINESS_RULE_TEST_FAILING";
|
|
94
|
+
HTTP_CALL_UNMATCHED: "HTTP_CALL_UNMATCHED";
|
|
95
|
+
HTTP_CALL_AMBIGUOUS: "HTTP_CALL_AMBIGUOUS";
|
|
96
|
+
HTTP_CALL_UNRESOLVED: "HTTP_CALL_UNRESOLVED";
|
|
97
|
+
HTTP_RESPONSE_SHAPE_MISMATCH: "HTTP_RESPONSE_SHAPE_MISMATCH";
|
|
98
|
+
HTTP_BODY_TOO_LARGE: "HTTP_BODY_TOO_LARGE";
|
|
94
99
|
}>;
|
|
95
100
|
/** Inferred cause-code union. */
|
|
96
101
|
export type CauseCode = z.infer<typeof CauseCodeSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../src/schemas/verdict.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;EAQxB,CAAC;AAEH,8BAA8B;AAC9B,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,iEAAiE;AACjE,eAAO,MAAM,sBAAsB;;;;;;;;kBASxB,CAAC;AAEZ,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../src/schemas/verdict.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;EAQxB,CAAC;AAEH,8BAA8B;AAC9B,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,iEAAiE;AACjE,eAAO,MAAM,sBAAsB;;;;;;;;kBASxB,CAAC;AAEZ,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+D1B,CAAC;AAEH,iCAAiC;AACjC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CA6GjE,CAAC"}
|
package/dist/schemas/verdict.js
CHANGED
|
@@ -89,6 +89,18 @@ export const CauseCodeSchema = z.enum([
|
|
|
89
89
|
'BUSINESS_RULE_TEST_TYPE_MISMATCH',
|
|
90
90
|
'BUSINESS_RULE_TEST_UNPROVEN',
|
|
91
91
|
'BUSINESS_RULE_TEST_FAILING',
|
|
92
|
+
// The HTTP call rules (0.14 WP3, plan §4.3 R2-R4): a call the
|
|
93
|
+
// product makes that no route serves, several routes serve equally,
|
|
94
|
+
// or no static join could resolve. Report-only by default
|
|
95
|
+
// (`http.callFindings`); blocking only when the owner declares it.
|
|
96
|
+
'HTTP_CALL_UNMATCHED',
|
|
97
|
+
'HTTP_CALL_AMBIGUOUS',
|
|
98
|
+
'HTTP_CALL_UNRESOLVED',
|
|
99
|
+
// 0.14 WP4: the witness's body-vs-model check. A mismatch is a finding
|
|
100
|
+
// (report-only under `http.responseShape: report`); an over-cap body is
|
|
101
|
+
// refused, never silently passed.
|
|
102
|
+
'HTTP_RESPONSE_SHAPE_MISMATCH',
|
|
103
|
+
'HTTP_BODY_TOO_LARGE',
|
|
92
104
|
]);
|
|
93
105
|
/**
|
|
94
106
|
* The plan §5.4 next action per cause code. Text, JSON, and SARIF
|
|
@@ -165,5 +177,15 @@ export const CAUSE_NEXT_ACTIONS = Object.freeze({
|
|
|
165
177
|
'with no passing, witnessed run is `unproven`, never satisfied.',
|
|
166
178
|
BUSINESS_RULE_TEST_FAILING: 'Fix the mapped test or the behaviour it proves: every mapped test of a case must pass (a green ' +
|
|
167
179
|
'sibling never forgives a red one).',
|
|
180
|
+
HTTP_CALL_UNMATCHED: 'A witnessed call matches no served route: fix the caller URL or serve the route it means; ' +
|
|
181
|
+
'an unresolvable call is an application bug, not a missing test',
|
|
182
|
+
HTTP_CALL_AMBIGUOUS: 'A witnessed call matches several routes equally: make the routes distinguishable ' +
|
|
183
|
+
'(or record the router\'s registration order) so exactly one can answer the call',
|
|
184
|
+
HTTP_CALL_UNRESOLVED: 'The static join cannot compute this call\'s URL: declare the wrapper/base URL in the ' +
|
|
185
|
+
'endpoint scan configuration so the call site resolves instead of staying invisible',
|
|
186
|
+
HTTP_RESPONSE_SHAPE_MISMATCH: 'A witnessed response body does not match the response schema the app declares in its OpenAPI ' +
|
|
187
|
+
'document: fix the handler so the body matches the declared model, or fix the declared schema if it is wrong',
|
|
188
|
+
HTTP_BODY_TOO_LARGE: 'A witnessed response body exceeds the 1 MiB check cap, so its shape cannot be verified: ' +
|
|
189
|
+
'return a smaller body for this route or exclude it from the body check',
|
|
168
190
|
});
|
|
169
191
|
//# sourceMappingURL=verdict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.js","sourceRoot":"","sources":["../../src/schemas/verdict.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,O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gE;IAClE,mBAAmB,EACjB,mFAAmF;QACnF,iFAAiF;IACnF,oBAAoB,EAClB,uFAAuF;QACvF,oFAAoF;IACtF,4BAA4B,EAC1B,+FAA+F;QAC/F,6GAA6G;IAC/G,mBAAmB,EACjB,0FAA0F;QAC1F,wEAAwE;CAC3E,CAAC,CAAC"}
|
package/dist/strictness.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ import { z } from 'zod';
|
|
|
23
23
|
* - `warn` — evaluate fully, report everything, exit 0.
|
|
24
24
|
*/
|
|
25
25
|
export declare const StrictnessModeSchema: z.ZodEnum<{
|
|
26
|
-
strict: "strict";
|
|
27
26
|
changed: "changed";
|
|
27
|
+
strict: "strict";
|
|
28
28
|
warn: "warn";
|
|
29
29
|
}>;
|
|
30
30
|
/** Inferred strictness-mode union. */
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { Location } from '../schemas/common.js';
|
|
2
|
+
import type { BlockingEntry } from '../policy/evaluate.js';
|
|
3
|
+
import type { HttpLedger, HttpLedgerRow } from './http-ledger.js';
|
|
4
|
+
/** A witnessed call that matches no route in the run's inventory. */
|
|
5
|
+
export declare const HTTP_CALL_UNMATCHED = "HTTP_CALL_UNMATCHED";
|
|
6
|
+
/** A witnessed response proves the app answered, but not that inventory is complete. */
|
|
7
|
+
export declare const HTTP_ROUTE_NOT_INVENTORIED = "HTTP_ROUTE_NOT_INVENTORIED";
|
|
8
|
+
/** A witnessed call that matches several routes at equal specificity. */
|
|
9
|
+
export declare const HTTP_CALL_AMBIGUOUS = "HTTP_CALL_AMBIGUOUS";
|
|
10
|
+
/** A static call site whose URL the join could not compute. */
|
|
11
|
+
export declare const HTTP_CALL_UNRESOLVED = "HTTP_CALL_UNRESOLVED";
|
|
12
|
+
/** Every typed call-finding code this module mints. */
|
|
13
|
+
export type HttpCallFindingCode = typeof HTTP_CALL_UNMATCHED | typeof HTTP_CALL_AMBIGUOUS | typeof HTTP_CALL_UNRESOLVED | typeof HTTP_ROUTE_NOT_INVENTORIED;
|
|
14
|
+
/** Which channel the call findings block on (owner-declared). */
|
|
15
|
+
export type HttpCallFindingsMode = 'report' | 'block';
|
|
16
|
+
/** One route of the served/used denominator, as the graph states it. */
|
|
17
|
+
export interface HttpCoverageRoute {
|
|
18
|
+
/** The `http.endpoint` graph resource id. */
|
|
19
|
+
resourceId: string;
|
|
20
|
+
/** The static join: a frontend call resolved onto this route. */
|
|
21
|
+
consumed: boolean;
|
|
22
|
+
/** The joined static call sites, `file:line:col`. */
|
|
23
|
+
callSites: readonly string[];
|
|
24
|
+
/**
|
|
25
|
+
* Proofs that this route's router is mounted on the scanned app (plan
|
|
26
|
+
* finding 13). Empty means "no mount proof"; it is read as "proven
|
|
27
|
+
* unmounted" only when {@link HttpCoverageInput.mountProvenanceEmitted}
|
|
28
|
+
* says the detector emitted the fact at all.
|
|
29
|
+
*/
|
|
30
|
+
mountProvenances: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
/** The minimum a verdict must say for the proven/missing counts. */
|
|
33
|
+
export interface HttpCoverageVerdict {
|
|
34
|
+
resourceId: string;
|
|
35
|
+
contract: string;
|
|
36
|
+
verdict: string;
|
|
37
|
+
}
|
|
38
|
+
/** One unresolved static entry, as the graph carries it. */
|
|
39
|
+
export interface HttpCoverageUnresolved {
|
|
40
|
+
code: string;
|
|
41
|
+
detail: string;
|
|
42
|
+
location: Location;
|
|
43
|
+
}
|
|
44
|
+
/** Everything the rules read. */
|
|
45
|
+
export interface HttpCoverageInput {
|
|
46
|
+
/** The run's route table, one entry per `http.endpoint` resource. */
|
|
47
|
+
routes: readonly HttpCoverageRoute[];
|
|
48
|
+
/**
|
|
49
|
+
* Whether this run's detector emitted mount provenance anywhere. Until
|
|
50
|
+
* a detector proves it (plan finding 13), NO route is subtracted from
|
|
51
|
+
* `served`: an absent proof is unknown served-ness, never proof of an
|
|
52
|
+
* unmounted router, and a summary line reading "0 served" would be a
|
|
53
|
+
* wrong report, not a conservative one.
|
|
54
|
+
*/
|
|
55
|
+
mountProvenanceEmitted?: boolean;
|
|
56
|
+
/** The run's exchange ledger; null/absent for a run without exchanges. */
|
|
57
|
+
ledger?: HttpLedger | null;
|
|
58
|
+
/** The run's graded obligations (this run's scoped verdicts). */
|
|
59
|
+
verdicts?: readonly HttpCoverageVerdict[];
|
|
60
|
+
/** The graph's unresolved entries (R4's only source). */
|
|
61
|
+
unresolvedCallSites?: readonly HttpCoverageUnresolved[];
|
|
62
|
+
/** The owner's channel declaration; it never changes WHAT is found. */
|
|
63
|
+
mode?: HttpCallFindingsMode;
|
|
64
|
+
}
|
|
65
|
+
/** One typed finding about a call the product makes. */
|
|
66
|
+
export interface HttpCallFinding {
|
|
67
|
+
code: HttpCallFindingCode;
|
|
68
|
+
/** The route the call belongs to, when it belongs to one. */
|
|
69
|
+
resourceId: string | null;
|
|
70
|
+
/** The source location, when the call has one (R4 always does). */
|
|
71
|
+
location: Location | null;
|
|
72
|
+
/** A readable name for the call. It is not the identity; see `fingerprint`. */
|
|
73
|
+
key: string;
|
|
74
|
+
/**
|
|
75
|
+
* The identity the adoption receipt records (0.14 WP5 D1): a sha256 over
|
|
76
|
+
* the call's identity, never its status or line. Equal fingerprints are
|
|
77
|
+
* one debt.
|
|
78
|
+
*/
|
|
79
|
+
fingerprint: string;
|
|
80
|
+
detail: string;
|
|
81
|
+
}
|
|
82
|
+
/** One used route whose two transport obligations are not both satisfied. */
|
|
83
|
+
export interface HttpMissingRoute {
|
|
84
|
+
resourceId: string;
|
|
85
|
+
/** The witnessing tests whose exchange matched this route. */
|
|
86
|
+
ledgerCallers: readonly string[];
|
|
87
|
+
/** The static call sites joined onto this route. */
|
|
88
|
+
callSites: readonly string[];
|
|
89
|
+
}
|
|
90
|
+
/** The one summary line's numbers (plan §4.5). */
|
|
91
|
+
export interface HttpCoverageSummary {
|
|
92
|
+
/** Route-table size excluding endpoints with empty `mountProvenances`. */
|
|
93
|
+
served: number;
|
|
94
|
+
/** Served routes a witnessed exchange matched OR a static call joined. */
|
|
95
|
+
used: number;
|
|
96
|
+
/** Used routes whose two transport obligations are both satisfied. */
|
|
97
|
+
proven: number;
|
|
98
|
+
/** Used routes that are not proven. */
|
|
99
|
+
missing: number;
|
|
100
|
+
/** Ledger rows the one resolver could not place on any route. */
|
|
101
|
+
unmatched: number;
|
|
102
|
+
/** Ledger rows the one resolver placed on several equal candidates. */
|
|
103
|
+
ambiguous: number;
|
|
104
|
+
/** Route inventory availability for safe unmatched-call adjudication. */
|
|
105
|
+
inventory?: 'complete' | 'incomplete' | 'unavailable';
|
|
106
|
+
}
|
|
107
|
+
/** What R1-R5 produced. */
|
|
108
|
+
export interface HttpCoverageResult {
|
|
109
|
+
summary: HttpCoverageSummary;
|
|
110
|
+
findings: HttpCallFinding[];
|
|
111
|
+
missingRoutes: HttpMissingRoute[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Applies R1-R5 to one run.
|
|
115
|
+
*
|
|
116
|
+
* Args:
|
|
117
|
+
* input: the route table, the ledger, the graded obligations, the
|
|
118
|
+
* graph's unresolved entries and the owner's channel declaration.
|
|
119
|
+
*
|
|
120
|
+
* Returns:
|
|
121
|
+
* HttpCoverageResult: the summary line's numbers, the typed findings
|
|
122
|
+
* (identical in both modes) and the used-but-unproven routes with
|
|
123
|
+
* their callers.
|
|
124
|
+
*/
|
|
125
|
+
export declare function evaluateHttpCoverage(input: HttpCoverageInput): HttpCoverageResult;
|
|
126
|
+
/**
|
|
127
|
+
* Projects the call findings onto the report's existing finding channel
|
|
128
|
+
* (`kind: 'finding'`, typed cause, the shared next action), so text, json
|
|
129
|
+
* and SARIF render them like every other finding.
|
|
130
|
+
*
|
|
131
|
+
* The CHANNEL is the caller's decision (the owner's `http.callFindings`):
|
|
132
|
+
* this function only shapes the entries.
|
|
133
|
+
*
|
|
134
|
+
* Args:
|
|
135
|
+
* findings: the run's call findings.
|
|
136
|
+
*
|
|
137
|
+
* Returns:
|
|
138
|
+
* BlockingEntry[]: one entry per finding, deterministically ordered.
|
|
139
|
+
*/
|
|
140
|
+
export declare function httpCallFindingEntries(findings: readonly HttpCallFinding[]): BlockingEntry[];
|
|
141
|
+
/**
|
|
142
|
+
* Projects the witness's body-shape findings (0.14 WP4) onto the finding
|
|
143
|
+
* channel: one entry per mismatched or refused exchange, in ledger order.
|
|
144
|
+
* `ok` and `unchecked` rows are not findings. The CHANNEL is the caller's
|
|
145
|
+
* decision (`http.responseShape: report` surfaces them as advisories; the
|
|
146
|
+
* `block` setting fails through the body obligation instead).
|
|
147
|
+
*
|
|
148
|
+
* Args:
|
|
149
|
+
* rows: the run's ledger rows.
|
|
150
|
+
*
|
|
151
|
+
* Returns:
|
|
152
|
+
* BlockingEntry[]: one entry per mismatch or refusal.
|
|
153
|
+
*/
|
|
154
|
+
export declare function httpResponseShapeEntries(rows: readonly HttpLedgerRow[]): BlockingEntry[];
|
|
155
|
+
//# sourceMappingURL=http-coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-coverage.d.ts","sourceRoot":"","sources":["../../src/verdict/http-coverage.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGlE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAW3D,uDAAuD;AACvD,MAAM,MAAM,mBAAmB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,GAC3B,OAAO,0BAA0B,CAAC;AAEt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, plan §4.3) over the exchange
|
|
3
|
+
* ledger.
|
|
4
|
+
*
|
|
5
|
+
* One primitive, three questions the gate could not answer before:
|
|
6
|
+
* - R1 USED: a route a witnessed exchange matched OR a static call site
|
|
7
|
+
* joined. Used routes already owe `http:request-observed` +
|
|
8
|
+
* `http:response-status-ok`: those obligations are generated PRE-RUN by
|
|
9
|
+
* the policy engine from the same `frontendConsumed` join
|
|
10
|
+
* (`policy/evaluate.ts`), so this module never invents an obligation —
|
|
11
|
+
* it reports who is used and who has not been proven yet.
|
|
12
|
+
* - R2: a `nomatch` call is an app defect only with status 404/405
|
|
13
|
+
* (`HTTP_CALL_UNMATCHED`); any other status becomes the report-only
|
|
14
|
+
* `HTTP_ROUTE_NOT_INVENTORIED` advisory because the app answered.
|
|
15
|
+
* - R3: a witnessed call matching several routes equally is
|
|
16
|
+
* `HTTP_CALL_AMBIGUOUS`.
|
|
17
|
+
* - R4: a static call site the join could not resolve, with its
|
|
18
|
+
* `file:line` — `HTTP_CALL_UNRESOLVED`. It reads the unresolved
|
|
19
|
+
* call-site facts the graph ALREADY carries (`FRONTEND_CALL_TARGET_UNRESOLVED`);
|
|
20
|
+
* it never scans anything itself.
|
|
21
|
+
* - R5: served-but-never-used is a COUNT, never a finding: the visible
|
|
22
|
+
* denominator, so an untested route cannot hide behind a green gate.
|
|
23
|
+
*
|
|
24
|
+
* `served` excludes endpoints whose router is never proven mounted
|
|
25
|
+
* (plan finding 13: an unmounted router is not a served route).
|
|
26
|
+
*
|
|
27
|
+
* NOTHING here changes a verdict: the rules add findings and one
|
|
28
|
+
* summary, and the channel those findings block on is the owner's
|
|
29
|
+
* declaration (`http.callFindings`), never this module's judgement.
|
|
30
|
+
*/
|
|
31
|
+
import { compareStrings } from '../graph/util.js';
|
|
32
|
+
import { sha256Canonical } from '../canonical-json.js';
|
|
33
|
+
import { CAUSE_NEXT_ACTIONS } from '../schemas/verdict.js';
|
|
34
|
+
import { HTTP_REQUEST_OBSERVED, HTTP_RESPONSE_STATUS_OK } from '../schemas/behavior-policy.js';
|
|
35
|
+
/** A witnessed call that matches no route in the run's inventory. */
|
|
36
|
+
export const HTTP_CALL_UNMATCHED = 'HTTP_CALL_UNMATCHED';
|
|
37
|
+
/** A witnessed response proves the app answered, but not that inventory is complete. */
|
|
38
|
+
export const HTTP_ROUTE_NOT_INVENTORIED = 'HTTP_ROUTE_NOT_INVENTORIED';
|
|
39
|
+
/** A witnessed call that matches several routes at equal specificity. */
|
|
40
|
+
export const HTTP_CALL_AMBIGUOUS = 'HTTP_CALL_AMBIGUOUS';
|
|
41
|
+
/** A static call site whose URL the join could not compute. */
|
|
42
|
+
export const HTTP_CALL_UNRESOLVED = 'HTTP_CALL_UNRESOLVED';
|
|
43
|
+
/**
|
|
44
|
+
* The static-scanner code for exactly "a frontend call whose target
|
|
45
|
+
* cannot be resolved statically". Read from the graph's unresolved
|
|
46
|
+
* entries; the constant is restated here because core cannot depend on
|
|
47
|
+
* `@gate-forge/http-contract` (same lockstep rule as
|
|
48
|
+
* `HTTP_OBSERVATION_UNTRUSTED` in pack-verifiers).
|
|
49
|
+
*/
|
|
50
|
+
const FRONTEND_CALL_TARGET_UNRESOLVED = 'FRONTEND_CALL_TARGET_UNRESOLVED';
|
|
51
|
+
/** The two contracts R1's routes owe; both satisfied ⇒ proven. */
|
|
52
|
+
const TRANSPORT_CONTRACTS = [HTTP_REQUEST_OBSERVED, HTTP_RESPONSE_STATUS_OK];
|
|
53
|
+
/**
|
|
54
|
+
* Whether one route counts as served. An endpoint is only subtracted
|
|
55
|
+
* from the denominator when the detector emitted mount provenance at all
|
|
56
|
+
* and THIS route carries none of it (plan finding 13's `unmounted`).
|
|
57
|
+
*
|
|
58
|
+
* Args:
|
|
59
|
+
* route: one route of the table.
|
|
60
|
+
* mountProvenanceEmitted: whether the run carries mount proofs.
|
|
61
|
+
*
|
|
62
|
+
* Returns:
|
|
63
|
+
* boolean: true when the route is in the served denominator.
|
|
64
|
+
*/
|
|
65
|
+
function isServed(route, mountProvenanceEmitted) {
|
|
66
|
+
return !mountProvenanceEmitted || route.mountProvenances.length > 0;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Collects the callers of every used route: the witnessing tests whose
|
|
70
|
+
* ledger row matched it, plus its joined static call sites.
|
|
71
|
+
*
|
|
72
|
+
* Args:
|
|
73
|
+
* routes: the run's route table.
|
|
74
|
+
* ledger: the run's exchange ledger (null when there is none).
|
|
75
|
+
* mountProvenanceEmitted: whether the run carries mount proofs.
|
|
76
|
+
*
|
|
77
|
+
* Returns:
|
|
78
|
+
* Map<string, HttpMissingRoute>: one entry per served route with at
|
|
79
|
+
* least one caller (a matched ledger row or a static join).
|
|
80
|
+
*/
|
|
81
|
+
function usedRoutes(routes, ledger, mountProvenanceEmitted) {
|
|
82
|
+
const used = new Map();
|
|
83
|
+
const serve = (route, callers) => {
|
|
84
|
+
const entry = used.get(route.resourceId);
|
|
85
|
+
const ledgerCallers = [...new Set([...(entry?.ledgerCallers ?? []), ...callers])].sort(compareStrings);
|
|
86
|
+
const callSites = [...new Set([...(entry?.callSites ?? []), ...route.callSites])].sort(compareStrings);
|
|
87
|
+
used.set(route.resourceId, { resourceId: route.resourceId, ledgerCallers, callSites });
|
|
88
|
+
};
|
|
89
|
+
for (const route of routes) {
|
|
90
|
+
if (!isServed(route, mountProvenanceEmitted))
|
|
91
|
+
continue;
|
|
92
|
+
if (route.consumed)
|
|
93
|
+
serve(route, []);
|
|
94
|
+
}
|
|
95
|
+
for (const entry of ledger?.rows ?? []) {
|
|
96
|
+
if (entry.kind !== 'api' || entry.resolution !== 'match' || entry.route === null)
|
|
97
|
+
continue;
|
|
98
|
+
const route = routes.find((candidate) => candidate.resourceId === entry.route);
|
|
99
|
+
// A row matched by the resolver can only name a route of the same
|
|
100
|
+
// inventory; an id the table does not carry is never invented here.
|
|
101
|
+
if (route === undefined || !isServed(route, mountProvenanceEmitted))
|
|
102
|
+
continue;
|
|
103
|
+
serve(route, [entry.testId]);
|
|
104
|
+
}
|
|
105
|
+
return used;
|
|
106
|
+
}
|
|
107
|
+
/** The domain tag separating call-finding identities from every other hash. */
|
|
108
|
+
const HTTP_CALL_FINGERPRINT_DOMAIN = 'gateforge.http-call-finding.v1';
|
|
109
|
+
/** A path segment that is an id: all digits, a UUID, or a 16+ char hex run. */
|
|
110
|
+
const ID_SEGMENT = /^(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})$/i;
|
|
111
|
+
/**
|
|
112
|
+
* The shape of a call's path (0.14 WP5 D1): the query and fragment are
|
|
113
|
+
* dropped and every id segment collapses to `:id`, so `/items/42` and
|
|
114
|
+
* `/items/97` are one call shape.
|
|
115
|
+
*
|
|
116
|
+
* Args:
|
|
117
|
+
* path: the raw path the witness recorded.
|
|
118
|
+
*
|
|
119
|
+
* Returns:
|
|
120
|
+
* string: the path shape.
|
|
121
|
+
*/
|
|
122
|
+
function pathShape(path) {
|
|
123
|
+
const bare = path.split(/[?#]/)[0] ?? '';
|
|
124
|
+
return bare.split('/').map((segment) => (ID_SEGMENT.test(segment) ? ':id' : segment)).join('/');
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Reads one ledger row's placement into a finding, or null when the
|
|
128
|
+
* placement is not a defect (a match, or an inventory that could not be
|
|
129
|
+
* attributed — `incomplete` stays unknown, never a finding).
|
|
130
|
+
*
|
|
131
|
+
* Repeated identical calls collapse into ONE finding listing every
|
|
132
|
+
* observed status: one bug is one finding, not a wall of duplicates.
|
|
133
|
+
*
|
|
134
|
+
* Args:
|
|
135
|
+
* rows: the ledger rows sharing one (test, method, path).
|
|
136
|
+
* code: the finding code to mint.
|
|
137
|
+
*
|
|
138
|
+
* Returns:
|
|
139
|
+
* HttpCallFinding | null: the finding, or null when nothing is wrong.
|
|
140
|
+
*/
|
|
141
|
+
function rowFinding(rows, code) {
|
|
142
|
+
const first = rows[0];
|
|
143
|
+
if (first === undefined)
|
|
144
|
+
return null;
|
|
145
|
+
const statuses = [...new Set(rows.map((entry) => String(entry.status)))].sort(compareStrings);
|
|
146
|
+
const call = `'${first.method} ${first.path}'`;
|
|
147
|
+
const shape = pathShape(first.path);
|
|
148
|
+
const identity = {
|
|
149
|
+
domain: HTTP_CALL_FINGERPRINT_DOMAIN,
|
|
150
|
+
code,
|
|
151
|
+
method: first.method,
|
|
152
|
+
pathShape: shape,
|
|
153
|
+
testId: first.testId,
|
|
154
|
+
};
|
|
155
|
+
const named = {
|
|
156
|
+
key: `${code} ${first.method} ${shape} (test ${first.testId})`,
|
|
157
|
+
fingerprint: sha256Canonical(identity),
|
|
158
|
+
};
|
|
159
|
+
if (code === HTTP_CALL_UNMATCHED || code === HTTP_ROUTE_NOT_INVENTORIED) {
|
|
160
|
+
return {
|
|
161
|
+
code,
|
|
162
|
+
resourceId: null,
|
|
163
|
+
location: null,
|
|
164
|
+
...named,
|
|
165
|
+
detail: code === HTTP_CALL_UNMATCHED
|
|
166
|
+
? `test '${first.testId}' called ${call} which matched no route in the run's inventory (HTTP ${statuses.join(', ')})`
|
|
167
|
+
: `the app served ${first.method} ${first.path} (HTTP ${statuses.join(', ')}) but the route inventory has no such route — the inventory is incomplete; check the detector for this framework`,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const candidates = [
|
|
171
|
+
...new Set(rows.flatMap((entry) => entry.candidates ?? [])),
|
|
172
|
+
].sort(compareStrings);
|
|
173
|
+
return {
|
|
174
|
+
code,
|
|
175
|
+
resourceId: null,
|
|
176
|
+
location: null,
|
|
177
|
+
...named,
|
|
178
|
+
detail: `test '${first.testId}' called ${call} which matches ${String(candidates.length)} routes at ` +
|
|
179
|
+
`equal specificity (${candidates.join('; ')})`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The call findings, in a deterministic order: by code, then resource,
|
|
184
|
+
* then detail.
|
|
185
|
+
*
|
|
186
|
+
* Args:
|
|
187
|
+
* ledger: the run's exchange ledger.
|
|
188
|
+
* unresolved: the graph's unresolved entries.
|
|
189
|
+
*
|
|
190
|
+
* Returns:
|
|
191
|
+
* HttpCallFinding[]: the run's call findings.
|
|
192
|
+
*/
|
|
193
|
+
function callFindings(ledger, unresolved) {
|
|
194
|
+
const findings = [];
|
|
195
|
+
const grouped = new Map();
|
|
196
|
+
for (const entry of ledger?.rows ?? []) {
|
|
197
|
+
if (entry.kind !== 'api' || (entry.resolution !== 'nomatch' && entry.resolution !== 'ambiguous'))
|
|
198
|
+
continue;
|
|
199
|
+
const code = entry.resolution === 'ambiguous'
|
|
200
|
+
? HTTP_CALL_AMBIGUOUS
|
|
201
|
+
: entry.status === 404 || entry.status === 405
|
|
202
|
+
? HTTP_CALL_UNMATCHED
|
|
203
|
+
: HTTP_ROUTE_NOT_INVENTORIED;
|
|
204
|
+
const key = `${code}\u0000${entry.testId}\u0000${entry.method}\u0000${pathShape(entry.path)}`;
|
|
205
|
+
const bucket = grouped.get(key);
|
|
206
|
+
if (bucket === undefined)
|
|
207
|
+
grouped.set(key, [entry]);
|
|
208
|
+
else
|
|
209
|
+
bucket.push(entry);
|
|
210
|
+
}
|
|
211
|
+
for (const [key, rows] of grouped) {
|
|
212
|
+
const code = key.slice(0, key.indexOf('\u0000'));
|
|
213
|
+
const finding = rowFinding(rows, code);
|
|
214
|
+
if (finding !== null)
|
|
215
|
+
findings.push(finding);
|
|
216
|
+
}
|
|
217
|
+
for (const entry of unresolved) {
|
|
218
|
+
if (entry.code !== FRONTEND_CALL_TARGET_UNRESOLVED)
|
|
219
|
+
continue;
|
|
220
|
+
const identity = {
|
|
221
|
+
domain: HTTP_CALL_FINGERPRINT_DOMAIN,
|
|
222
|
+
code: HTTP_CALL_UNRESOLVED,
|
|
223
|
+
file: entry.location.file,
|
|
224
|
+
detail: entry.detail,
|
|
225
|
+
};
|
|
226
|
+
findings.push({
|
|
227
|
+
code: HTTP_CALL_UNRESOLVED,
|
|
228
|
+
resourceId: null,
|
|
229
|
+
location: entry.location,
|
|
230
|
+
key: `${HTTP_CALL_UNRESOLVED} ${entry.location.file}: ${entry.detail}`,
|
|
231
|
+
fingerprint: sha256Canonical(identity),
|
|
232
|
+
detail: `${entry.code}: ${entry.detail} — ${entry.location.file}:${String(entry.location.line)}`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
findings.sort((left, right) => compareStrings(left.code, right.code) ||
|
|
236
|
+
compareStrings(left.resourceId ?? '', right.resourceId ?? '') ||
|
|
237
|
+
compareStrings(left.detail, right.detail));
|
|
238
|
+
// Equal identities are one debt: a repeated call counts once.
|
|
239
|
+
const unique = new Map();
|
|
240
|
+
for (const finding of findings) {
|
|
241
|
+
if (!unique.has(finding.fingerprint))
|
|
242
|
+
unique.set(finding.fingerprint, finding);
|
|
243
|
+
}
|
|
244
|
+
return [...unique.values()];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Applies R1-R5 to one run.
|
|
248
|
+
*
|
|
249
|
+
* Args:
|
|
250
|
+
* input: the route table, the ledger, the graded obligations, the
|
|
251
|
+
* graph's unresolved entries and the owner's channel declaration.
|
|
252
|
+
*
|
|
253
|
+
* Returns:
|
|
254
|
+
* HttpCoverageResult: the summary line's numbers, the typed findings
|
|
255
|
+
* (identical in both modes) and the used-but-unproven routes with
|
|
256
|
+
* their callers.
|
|
257
|
+
*/
|
|
258
|
+
export function evaluateHttpCoverage(input) {
|
|
259
|
+
const routes = [...input.routes].sort((left, right) => compareStrings(left.resourceId, right.resourceId));
|
|
260
|
+
const ledger = input.ledger ?? null;
|
|
261
|
+
const mountProvenanceEmitted = input.mountProvenanceEmitted === true;
|
|
262
|
+
const used = usedRoutes(routes, ledger, mountProvenanceEmitted);
|
|
263
|
+
const verdicts = input.verdicts ?? [];
|
|
264
|
+
const proven = new Set();
|
|
265
|
+
for (const [resourceId] of used) {
|
|
266
|
+
const states = TRANSPORT_CONTRACTS.map((contract) => verdicts.find((entry) => entry.resourceId === resourceId && entry.contract === contract)?.verdict);
|
|
267
|
+
// A waiver is a recorded forgiveness, not proof: only two
|
|
268
|
+
// `satisfied` verdicts prove the route.
|
|
269
|
+
if (states.every((state) => state === 'satisfied'))
|
|
270
|
+
proven.add(resourceId);
|
|
271
|
+
}
|
|
272
|
+
const missingRoutes = [...used.values()]
|
|
273
|
+
.filter((entry) => !proven.has(entry.resourceId))
|
|
274
|
+
.sort((left, right) => compareStrings(left.resourceId, right.resourceId));
|
|
275
|
+
const rows = ledger?.rows ?? [];
|
|
276
|
+
return {
|
|
277
|
+
summary: {
|
|
278
|
+
served: routes.filter((route) => isServed(route, mountProvenanceEmitted)).length,
|
|
279
|
+
used: used.size,
|
|
280
|
+
proven: proven.size,
|
|
281
|
+
missing: missingRoutes.length,
|
|
282
|
+
unmatched: rows.filter((entry) => entry.kind === 'api' &&
|
|
283
|
+
entry.resolution === 'nomatch' &&
|
|
284
|
+
(entry.status === 404 || entry.status === 405)).length,
|
|
285
|
+
ambiguous: rows.filter((entry) => entry.kind === 'api' && entry.resolution === 'ambiguous').length,
|
|
286
|
+
...((ledger?.summary.inventory ?? (routes.length === 0 ? 'unavailable' : 'complete')) === 'complete'
|
|
287
|
+
? {}
|
|
288
|
+
: { inventory: ledger?.summary.inventory ?? 'unavailable' }),
|
|
289
|
+
},
|
|
290
|
+
findings: callFindings(ledger, input.unresolvedCallSites ?? []),
|
|
291
|
+
missingRoutes,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Projects the call findings onto the report's existing finding channel
|
|
296
|
+
* (`kind: 'finding'`, typed cause, the shared next action), so text, json
|
|
297
|
+
* and SARIF render them like every other finding.
|
|
298
|
+
*
|
|
299
|
+
* The CHANNEL is the caller's decision (the owner's `http.callFindings`):
|
|
300
|
+
* this function only shapes the entries.
|
|
301
|
+
*
|
|
302
|
+
* Args:
|
|
303
|
+
* findings: the run's call findings.
|
|
304
|
+
*
|
|
305
|
+
* Returns:
|
|
306
|
+
* BlockingEntry[]: one entry per finding, deterministically ordered.
|
|
307
|
+
*/
|
|
308
|
+
export function httpCallFindingEntries(findings) {
|
|
309
|
+
return findings.map((finding) => {
|
|
310
|
+
const inventoryGap = finding.code === HTTP_ROUTE_NOT_INVENTORIED;
|
|
311
|
+
return {
|
|
312
|
+
kind: 'finding',
|
|
313
|
+
resourceId: finding.resourceId,
|
|
314
|
+
name: null,
|
|
315
|
+
detail: `${finding.code}: ${finding.detail}`,
|
|
316
|
+
location: finding.location,
|
|
317
|
+
cause: inventoryGap ? null : finding.code,
|
|
318
|
+
nextAction: inventoryGap ? null : CAUSE_NEXT_ACTIONS[finding.code],
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Projects the witness's body-shape findings (0.14 WP4) onto the finding
|
|
324
|
+
* channel: one entry per mismatched or refused exchange, in ledger order.
|
|
325
|
+
* `ok` and `unchecked` rows are not findings. The CHANNEL is the caller's
|
|
326
|
+
* decision (`http.responseShape: report` surfaces them as advisories; the
|
|
327
|
+
* `block` setting fails through the body obligation instead).
|
|
328
|
+
*
|
|
329
|
+
* Args:
|
|
330
|
+
* rows: the run's ledger rows.
|
|
331
|
+
*
|
|
332
|
+
* Returns:
|
|
333
|
+
* BlockingEntry[]: one entry per mismatch or refusal.
|
|
334
|
+
*/
|
|
335
|
+
export function httpResponseShapeEntries(rows) {
|
|
336
|
+
return rows
|
|
337
|
+
.filter((row) => row.kind === 'api' && (row.shape === 'mismatch' || row.shape === 'refused'))
|
|
338
|
+
.map((row) => {
|
|
339
|
+
const cause = row.shape === 'mismatch' ? 'HTTP_RESPONSE_SHAPE_MISMATCH' : 'HTTP_BODY_TOO_LARGE';
|
|
340
|
+
return {
|
|
341
|
+
kind: 'finding',
|
|
342
|
+
resourceId: row.route,
|
|
343
|
+
name: null,
|
|
344
|
+
detail: `${cause}: ${row.testId} ${row.method} ${row.path} (status ${row.status}): ${row.shapeDetail ?? ''}`,
|
|
345
|
+
location: null,
|
|
346
|
+
cause,
|
|
347
|
+
nextAction: CAUSE_NEXT_ACTIONS[cause],
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=http-coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-coverage.js","sourceRoot":"","sources":["../../src/verdict/http-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAkB,MAAM,uBAAuB,CAAC;AAI3E,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,+BAA+B,GAAG,iCAAiC,CAAC;AAqH1E,kEAAkE;AAClE,MAAM,mBAAmB,GAAsB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC;AAEhG;;;;;;;;;;;GAWG;AACH,SAAS,QAAQ,CAAC,KAAwB,EAAE,sBAA+B;IACzE,OAAO,CAAC,sBAAsB,IAAI,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,UAAU,CACjB,MAAoC,EACpC,MAAyB,EACzB,sBAA+B;IAE/B,MAAM,IAAI,GAAG,IAAI,GAAG,EAA4B,CAAC;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