@gate-forge/core 0.13.10 → 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.
Files changed (49) hide show
  1. package/dist/config/index.d.ts +58 -6
  2. package/dist/config/index.d.ts.map +1 -1
  3. package/dist/config/index.js +44 -0
  4. package/dist/config/index.js.map +1 -1
  5. package/dist/index.d.ts +13 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +13 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/policy/evaluate.d.ts +16 -0
  10. package/dist/policy/evaluate.d.ts.map +1 -1
  11. package/dist/policy/evaluate.js +21 -2
  12. package/dist/policy/evaluate.js.map +1 -1
  13. package/dist/report/index.d.ts +21 -1
  14. package/dist/report/index.d.ts.map +1 -1
  15. package/dist/report/index.js +20 -0
  16. package/dist/report/index.js.map +1 -1
  17. package/dist/schemas/behavior-evidence.d.ts +2 -2
  18. package/dist/schemas/behavior-policy.d.ts +7 -0
  19. package/dist/schemas/behavior-policy.d.ts.map +1 -1
  20. package/dist/schemas/behavior-policy.js +7 -0
  21. package/dist/schemas/behavior-policy.js.map +1 -1
  22. package/dist/schemas/business-rules.d.ts +3 -3
  23. package/dist/schemas/classification-policy.d.ts +1 -1
  24. package/dist/schemas/gate-receipt.d.ts +2 -2
  25. package/dist/schemas/queue-observer.d.ts +4 -4
  26. package/dist/schemas/test-catalog.d.ts +12 -12
  27. package/dist/schemas/test-map.d.ts +4 -4
  28. package/dist/schemas/verdict.d.ts +5 -0
  29. package/dist/schemas/verdict.d.ts.map +1 -1
  30. package/dist/schemas/verdict.js +22 -0
  31. package/dist/schemas/verdict.js.map +1 -1
  32. package/dist/strictness.d.ts +1 -1
  33. package/dist/verdict/http-coverage.d.ts +155 -0
  34. package/dist/verdict/http-coverage.d.ts.map +1 -0
  35. package/dist/verdict/http-coverage.js +351 -0
  36. package/dist/verdict/http-coverage.js.map +1 -0
  37. package/dist/verdict/http-ledger.d.ts +67 -0
  38. package/dist/verdict/http-ledger.d.ts.map +1 -0
  39. package/dist/verdict/http-ledger.js +168 -0
  40. package/dist/verdict/http-ledger.js.map +1 -0
  41. package/dist/verdict/index.d.ts +15 -1
  42. package/dist/verdict/index.d.ts.map +1 -1
  43. package/dist/verdict/index.js +15 -1
  44. package/dist/verdict/index.js.map +1 -1
  45. package/dist/verdict/pack-verifiers.d.ts +66 -11
  46. package/dist/verdict/pack-verifiers.d.ts.map +1 -1
  47. package/dist/verdict/pack-verifiers.js +131 -28
  48. package/dist/verdict/pack-verifiers.js.map +1 -1
  49. package/package.json +1 -1
@@ -49,11 +49,11 @@ export declare const QueueJobObservationSchema: z.ZodObject<{
49
49
  deliveryId: z.ZodNullable<z.ZodString>;
50
50
  idempotencyKey: z.ZodNullable<z.ZodString>;
51
51
  state: z.ZodEnum<{
52
- active: "active";
53
52
  failed: "failed";
54
53
  waiting: "waiting";
55
54
  delayed: "delayed";
56
55
  prioritized: "prioritized";
56
+ active: "active";
57
57
  completed: "completed";
58
58
  paused: "paused";
59
59
  }>;
@@ -74,11 +74,11 @@ export type QueueJobObservation = z.infer<typeof QueueJobObservationSchema>;
74
74
  export declare const QueueJobSampleSchema: z.ZodObject<{
75
75
  jobId: z.ZodString;
76
76
  state: z.ZodEnum<{
77
- active: "active";
78
77
  failed: "failed";
79
78
  waiting: "waiting";
80
79
  delayed: "delayed";
81
80
  prioritized: "prioritized";
81
+ active: "active";
82
82
  completed: "completed";
83
83
  paused: "paused";
84
84
  }>;
@@ -103,11 +103,11 @@ export declare const QueueObservationSchema: z.ZodObject<{
103
103
  deliveryId: z.ZodNullable<z.ZodString>;
104
104
  idempotencyKey: z.ZodNullable<z.ZodString>;
105
105
  state: z.ZodEnum<{
106
- active: "active";
107
106
  failed: "failed";
108
107
  waiting: "waiting";
109
108
  delayed: "delayed";
110
109
  prioritized: "prioritized";
110
+ active: "active";
111
111
  completed: "completed";
112
112
  paused: "paused";
113
113
  }>;
@@ -119,11 +119,11 @@ export declare const QueueObservationSchema: z.ZodObject<{
119
119
  samples: z.ZodArray<z.ZodObject<{
120
120
  jobId: z.ZodString;
121
121
  state: z.ZodEnum<{
122
- active: "active";
123
122
  failed: "failed";
124
123
  waiting: "waiting";
125
124
  delayed: "delayed";
126
125
  prioritized: "prioritized";
126
+ active: "active";
127
127
  completed: "completed";
128
128
  paused: "paused";
129
129
  }>;
@@ -55,10 +55,10 @@ export declare const TestKindSchema: z.ZodEnum<{
55
55
  unknown: "unknown";
56
56
  "browser-e2e": "browser-e2e";
57
57
  "observed-e2e": "observed-e2e";
58
- unit: "unit";
59
- integration: "integration";
60
58
  "server-e2e": "server-e2e";
61
59
  "api-e2e": "api-e2e";
60
+ unit: "unit";
61
+ integration: "integration";
62
62
  component: "component";
63
63
  }>;
64
64
  /** Inferred test-kind type. */
@@ -109,10 +109,10 @@ export declare const KindSignalSchema: z.ZodObject<{
109
109
  unknown: "unknown";
110
110
  "browser-e2e": "browser-e2e";
111
111
  "observed-e2e": "observed-e2e";
112
- unit: "unit";
113
- integration: "integration";
114
112
  "server-e2e": "server-e2e";
115
113
  "api-e2e": "api-e2e";
114
+ unit: "unit";
115
+ integration: "integration";
116
116
  component: "component";
117
117
  }>;
118
118
  }, z.core.$strict>;
@@ -218,10 +218,10 @@ export declare const TestCatalogEntrySchema: z.ZodObject<{
218
218
  unknown: "unknown";
219
219
  "browser-e2e": "browser-e2e";
220
220
  "observed-e2e": "observed-e2e";
221
- unit: "unit";
222
- integration: "integration";
223
221
  "server-e2e": "server-e2e";
224
222
  "api-e2e": "api-e2e";
223
+ unit: "unit";
224
+ integration: "integration";
225
225
  component: "component";
226
226
  }>;
227
227
  kindSignals: z.ZodArray<z.ZodObject<{
@@ -236,10 +236,10 @@ export declare const TestCatalogEntrySchema: z.ZodObject<{
236
236
  unknown: "unknown";
237
237
  "browser-e2e": "browser-e2e";
238
238
  "observed-e2e": "observed-e2e";
239
- unit: "unit";
240
- integration: "integration";
241
239
  "server-e2e": "server-e2e";
242
240
  "api-e2e": "api-e2e";
241
+ unit: "unit";
242
+ integration: "integration";
243
243
  component: "component";
244
244
  }>;
245
245
  }, z.core.$strict>>;
@@ -360,10 +360,10 @@ export declare const TestCatalogSchema: z.ZodObject<{
360
360
  unknown: "unknown";
361
361
  "browser-e2e": "browser-e2e";
362
362
  "observed-e2e": "observed-e2e";
363
- unit: "unit";
364
- integration: "integration";
365
363
  "server-e2e": "server-e2e";
366
364
  "api-e2e": "api-e2e";
365
+ unit: "unit";
366
+ integration: "integration";
367
367
  component: "component";
368
368
  }>;
369
369
  kindSignals: z.ZodArray<z.ZodObject<{
@@ -378,10 +378,10 @@ export declare const TestCatalogSchema: z.ZodObject<{
378
378
  unknown: "unknown";
379
379
  "browser-e2e": "browser-e2e";
380
380
  "observed-e2e": "observed-e2e";
381
- unit: "unit";
382
- integration: "integration";
383
381
  "server-e2e": "server-e2e";
384
382
  "api-e2e": "api-e2e";
383
+ unit: "unit";
384
+ integration: "integration";
385
385
  component: "component";
386
386
  }>;
387
387
  }, z.core.$strict>>;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmD1B,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,CA8FjE,CAAC"}
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"}
@@ -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,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa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AC7H,eAAe,EAAE,2EAA2E;IAC5F,0BAA0B,EACxB,6HAA6H;IAC/H,mBAAmB,EAAE,6EAA6E;IAClG,kBAAkB,EAAE,uFAAuF;IAC3G,wBAAwB,EACtB,kIAAkI;IACpI,sBAAsB,EACpB,sJAAsJ;IACxJ,8BAA8B,EAC5B,sKAAsK;IACxK,6BAA6B,EAC3B,6FAA6F;QAC7F,yEAAyE;QACzE,sDAAsD;IACxD,iCAAiC,EAC/B,2FAA2F;QAC3F,8FAA8F;QAC9F,iBAAiB;IACnB,mBAAmB,EACjB,iIAAiI;IACnI,0BAA0B,EACxB,6FAA6F;QAC7F,gGAAgG;QAChG,kDAAkD;IACpD,gCAAgC,EAC9B,gGAAgG;QAChG,wDAAwD;IAC1D,2BAA2B,EACzB,kGAAkG;QAClG,gEAAgE;IAClE,0BAA0B,EACxB,iGAAiG;QACjG,oCAAoC;IACtC,mBAAmB,EACjB,4FAA4F;QAC5F,gEAAgE;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"}
@@ -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":["../../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