@gate-forge/core 0.13.10 → 0.15.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 +62 -6
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +79 -0
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.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 +54 -1
- package/dist/report/index.d.ts.map +1 -1
- package/dist/report/index.js +25 -20
- 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/execution-result.d.ts +2 -0
- package/dist/schemas/execution-result.d.ts.map +1 -1
- package/dist/schemas/execution-result.js +4 -0
- package/dist/schemas/execution-result.js.map +1 -1
- package/dist/schemas/gate-receipt.d.ts +2 -2
- package/dist/schemas/queue-observer.d.ts +4 -4
- package/dist/schemas/runner-adapter.d.ts +7 -0
- package/dist/schemas/runner-adapter.d.ts.map +1 -1
- package/dist/schemas/test-catalog.d.ts +12 -12
- 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/test-identity.d.ts +21 -0
- package/dist/test-identity.d.ts.map +1 -0
- package/dist/test-identity.js +57 -0
- package/dist/test-identity.js.map +1 -0
- package/dist/verdict/http-coverage.d.ts +183 -0
- package/dist/verdict/http-coverage.d.ts.map +1 -0
- package/dist/verdict/http-coverage.js +400 -0
- package/dist/verdict/http-coverage.js.map +1 -0
- package/dist/verdict/http-ledger.d.ts +71 -0
- package/dist/verdict/http-ledger.d.ts.map +1 -0
- package/dist/verdict/http-ledger.js +172 -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 +137 -29
- package/dist/verdict/pack-verifiers.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { HttpRouteCandidate } from './registry.js';
|
|
2
|
+
/** How the one resolver placed one witnessed exchange. */
|
|
3
|
+
export type HttpLedgerResolution = 'match' | 'nomatch' | 'ambiguous' | 'incomplete';
|
|
4
|
+
/** Whether the observed request represents API, page, asset or unknown traffic. */
|
|
5
|
+
export type HttpLedgerKind = 'api' | 'page' | 'asset' | 'unknown';
|
|
6
|
+
/** The shared Sec-Fetch-Dest convention for ledger rows and transport snapshots. */
|
|
7
|
+
export declare function httpExchangeKind(fetchDest: unknown): HttpLedgerKind;
|
|
8
|
+
/** The witness's body-vs-model verdict as the ledger shows it (0.14 WP4). */
|
|
9
|
+
export type HttpLedgerShape = 'ok' | 'mismatch' | 'unchecked' | 'refused';
|
|
10
|
+
/** One ledger row: one witnessed exchange, attributed. */
|
|
11
|
+
export interface HttpLedgerRow {
|
|
12
|
+
/** The test the exchange belongs to (`page-sweep` for sweep sessions). */
|
|
13
|
+
testId: string;
|
|
14
|
+
/** Uppercase request method. */
|
|
15
|
+
method: string;
|
|
16
|
+
/** The observed path, query stripped (the interpreted path). */
|
|
17
|
+
path: string;
|
|
18
|
+
/** The observed response status. */
|
|
19
|
+
status: number;
|
|
20
|
+
/** Test-code transport is measurable, but never UI claim evidence. */
|
|
21
|
+
initiator?: 'test-code';
|
|
22
|
+
/** Sec-Fetch-Dest classification; only `api` may produce R2/R3 findings. */
|
|
23
|
+
kind: HttpLedgerKind;
|
|
24
|
+
/** The serving route's resource id, or null when unresolved. */
|
|
25
|
+
route: string | null;
|
|
26
|
+
/** The ONE resolver's placement of the exchange. */
|
|
27
|
+
resolution: HttpLedgerResolution;
|
|
28
|
+
/** The equal candidates' identity texts, when the placement is ambiguous. */
|
|
29
|
+
candidates?: string[];
|
|
30
|
+
/** The witness's body-vs-model verdict, when the exchange carried one (0.14 WP4). */
|
|
31
|
+
shape?: HttpLedgerShape;
|
|
32
|
+
/** The first mismatch pointer and message, or the refusal cause. */
|
|
33
|
+
shapeDetail?: string;
|
|
34
|
+
}
|
|
35
|
+
/** Row counts by resolution (exchanges equals the row count). */
|
|
36
|
+
export interface HttpLedgerSummary {
|
|
37
|
+
exchanges: number;
|
|
38
|
+
matched: number;
|
|
39
|
+
unmatched: number;
|
|
40
|
+
ambiguous: number;
|
|
41
|
+
incomplete: number;
|
|
42
|
+
inventory?: 'complete' | 'incomplete' | 'unavailable';
|
|
43
|
+
}
|
|
44
|
+
/** The whole-run ledger embedded report-only in the run report JSON. */
|
|
45
|
+
export interface HttpLedger {
|
|
46
|
+
rows: HttpLedgerRow[];
|
|
47
|
+
summary: HttpLedgerSummary;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Builds the run's exchange ledger from the run's records (the same
|
|
51
|
+
* authorized set the verdict engine grades) and the complete route
|
|
52
|
+
* inventory.
|
|
53
|
+
*
|
|
54
|
+
* Only WITNESSED `http.exchanges` records count (`witnessed` tier with
|
|
55
|
+
* verifying provenance — the same rule `trustOf` applies elsewhere);
|
|
56
|
+
* every well-formed exchange entry of theirs becomes one row, resolved
|
|
57
|
+
* by `matchHttpRoute`. Malformed entries and non-ledger records are
|
|
58
|
+
* skipped, never guessed.
|
|
59
|
+
*
|
|
60
|
+
* Args:
|
|
61
|
+
* records: the run's records (untrusted, lenient).
|
|
62
|
+
* httpRoutes: the complete host-derived route inventory (the same
|
|
63
|
+
* input core passes to `resolveHttpRoute`); null/undefined resolves
|
|
64
|
+
* every row `nomatch` — an empty inventory matches nothing.
|
|
65
|
+
*
|
|
66
|
+
* Returns:
|
|
67
|
+
* HttpLedger: rows sorted by (testId, method, path, status) and the
|
|
68
|
+
* resolution summary.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildHttpLedger(records: readonly unknown[], httpRoutes: readonly HttpRouteCandidate[] | null | undefined): HttpLedger;
|
|
71
|
+
//# sourceMappingURL=http-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-ledger.d.ts","sourceRoot":"","sources":["../../src/verdict/http-ledger.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,0DAA0D;AAC1D,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,YAAY,CAAC;AAEpF,mFAAmF;AACnF,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAElE,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,CAKnE;AAED,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAE1E,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,4EAA4E;IAC5E,IAAI,EAAE,cAAc,CAAC;IACrB,gEAAgE;IAChE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oDAAoD;IACpD,UAAU,EAAE,oBAAoB,CAAC;IACjC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,qFAAqF;IACrF,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;CACvD;AAED,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAgDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,UAAU,EAAE,SAAS,kBAAkB,EAAE,GAAG,IAAI,GAAG,SAAS,GAC3D,UAAU,CA2EZ"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The verdict-time exchange ledger (0.14 WP2, plan §4.1): every
|
|
3
|
+
* witnessed `http.exchanges` record becomes rows
|
|
4
|
+
* `{testId, method, path (query stripped), status, route, resolution}`
|
|
5
|
+
* resolved through the ONE resolver (`matchHttpRoute`) over the run's
|
|
6
|
+
* complete route inventory — the same inventory
|
|
7
|
+
* `resolveHttpRoute`/the transport verifiers grade against. The ledger
|
|
8
|
+
* is REPORT-ONLY: it never changes a verdict (the satisfaction path
|
|
9
|
+
* never reads `http.exchanges`), and this module is the only consumer
|
|
10
|
+
* of the session-wide kind.
|
|
11
|
+
*/
|
|
12
|
+
import { compareStrings } from '../graph/util.js';
|
|
13
|
+
import { isProvenancedRecord } from '../provenance.js';
|
|
14
|
+
import { HTTP_EXCHANGES_KIND, interpretObservedPath, matchHttpRoute } from './pack-verifiers.js';
|
|
15
|
+
/** The shared Sec-Fetch-Dest convention for ledger rows and transport snapshots. */
|
|
16
|
+
export function httpExchangeKind(fetchDest) {
|
|
17
|
+
if (fetchDest === 'empty')
|
|
18
|
+
return 'api';
|
|
19
|
+
if (fetchDest === 'document' || fetchDest === 'iframe')
|
|
20
|
+
return 'page';
|
|
21
|
+
if (fetchDest === null || fetchDest === undefined)
|
|
22
|
+
return 'unknown';
|
|
23
|
+
return 'asset';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reads one entry into the lenient view; non-objects are ignored (a
|
|
27
|
+
* hostile reporter may emit anything).
|
|
28
|
+
*/
|
|
29
|
+
function asLedgerRecord(value) {
|
|
30
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
31
|
+
return null;
|
|
32
|
+
const record = value;
|
|
33
|
+
return {
|
|
34
|
+
trust: record['trust'],
|
|
35
|
+
testId: record['testId'],
|
|
36
|
+
kind: record['kind'],
|
|
37
|
+
payload: record['payload'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Reads the witness's body verdict for one exchange (0.14 WP4) into the
|
|
42
|
+
* ledger's display fields. Absent or unrecognized input yields null, so
|
|
43
|
+
* rows for exchanges without a body check keep their existing shape.
|
|
44
|
+
*/
|
|
45
|
+
function ledgerShapeOf(value) {
|
|
46
|
+
if (typeof value !== 'object' || value === null || !('verdict' in value))
|
|
47
|
+
return null;
|
|
48
|
+
const verdict = value.verdict;
|
|
49
|
+
if (verdict === 'ok')
|
|
50
|
+
return { shape: 'ok' };
|
|
51
|
+
if (verdict === 'unchecked')
|
|
52
|
+
return { shape: 'unchecked' };
|
|
53
|
+
if (verdict === 'refused')
|
|
54
|
+
return { shape: 'refused', shapeDetail: 'HTTP_BODY_TOO_LARGE' };
|
|
55
|
+
if (verdict !== 'mismatch')
|
|
56
|
+
return null;
|
|
57
|
+
const errors = 'errors' in value ? value.errors : undefined;
|
|
58
|
+
const first = Array.isArray(errors) ? errors[0] : undefined;
|
|
59
|
+
const pointer = typeof first === 'object' && first !== null && 'pointer' in first ? first.pointer : undefined;
|
|
60
|
+
const message = typeof first === 'object' && first !== null && 'message' in first ? first.message : undefined;
|
|
61
|
+
const where = typeof pointer === 'string' && pointer !== '' ? pointer : '(document root)';
|
|
62
|
+
const what = typeof message === 'string' ? message : 'does not match the declared schema';
|
|
63
|
+
return { shape: 'mismatch', shapeDetail: `${where} ${what}` };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Builds the run's exchange ledger from the run's records (the same
|
|
67
|
+
* authorized set the verdict engine grades) and the complete route
|
|
68
|
+
* inventory.
|
|
69
|
+
*
|
|
70
|
+
* Only WITNESSED `http.exchanges` records count (`witnessed` tier with
|
|
71
|
+
* verifying provenance — the same rule `trustOf` applies elsewhere);
|
|
72
|
+
* every well-formed exchange entry of theirs becomes one row, resolved
|
|
73
|
+
* by `matchHttpRoute`. Malformed entries and non-ledger records are
|
|
74
|
+
* skipped, never guessed.
|
|
75
|
+
*
|
|
76
|
+
* Args:
|
|
77
|
+
* records: the run's records (untrusted, lenient).
|
|
78
|
+
* httpRoutes: the complete host-derived route inventory (the same
|
|
79
|
+
* input core passes to `resolveHttpRoute`); null/undefined resolves
|
|
80
|
+
* every row `nomatch` — an empty inventory matches nothing.
|
|
81
|
+
*
|
|
82
|
+
* Returns:
|
|
83
|
+
* HttpLedger: rows sorted by (testId, method, path, status) and the
|
|
84
|
+
* resolution summary.
|
|
85
|
+
*/
|
|
86
|
+
export function buildHttpLedger(records, httpRoutes) {
|
|
87
|
+
const rows = [];
|
|
88
|
+
for (const raw of Array.isArray(records) ? records : []) {
|
|
89
|
+
const record = asLedgerRecord(raw);
|
|
90
|
+
if (record === null)
|
|
91
|
+
continue;
|
|
92
|
+
if (record.kind !== HTTP_EXCHANGES_KIND)
|
|
93
|
+
continue;
|
|
94
|
+
if (typeof record.testId !== 'string' || record.testId.length === 0)
|
|
95
|
+
continue;
|
|
96
|
+
// Ledger evidence is witness-issued only: the same provenance rule
|
|
97
|
+
// the verdict engine applies before it trusts a record's tier.
|
|
98
|
+
if (!(record.trust === 'witnessed' && isProvenancedRecord(raw)))
|
|
99
|
+
continue;
|
|
100
|
+
if (typeof record.payload !== 'object' || record.payload === null)
|
|
101
|
+
continue;
|
|
102
|
+
const exchanges = record.payload['exchanges'];
|
|
103
|
+
if (!Array.isArray(exchanges))
|
|
104
|
+
continue;
|
|
105
|
+
for (const entry of exchanges) {
|
|
106
|
+
if (typeof entry !== 'object' || entry === null || Array.isArray(entry))
|
|
107
|
+
continue;
|
|
108
|
+
const exchange = entry;
|
|
109
|
+
const method = exchange['method'];
|
|
110
|
+
const url = exchange['url'];
|
|
111
|
+
const status = exchange['status'];
|
|
112
|
+
if (typeof method !== 'string' || method.length === 0)
|
|
113
|
+
continue;
|
|
114
|
+
if (typeof url !== 'string' || url.length === 0)
|
|
115
|
+
continue;
|
|
116
|
+
if (typeof status !== 'number' || !Number.isInteger(status))
|
|
117
|
+
continue;
|
|
118
|
+
// The same path interpretation the transport verifiers run;
|
|
119
|
+
// an uninterpretable URL degrades to its query-stripped text.
|
|
120
|
+
const interpreted = interpretObservedPath(url);
|
|
121
|
+
const path = interpreted.ok ? interpreted.path : (url.split(/[?#]/, 1)[0] ?? url);
|
|
122
|
+
const shape = ledgerShapeOf(exchange['shape']);
|
|
123
|
+
const kind = httpExchangeKind(exchange['fetchDest']);
|
|
124
|
+
const resolution = httpRoutes === null || httpRoutes === undefined || httpRoutes.length === 0
|
|
125
|
+
? { status: 'incomplete', reason: 'route inventory unavailable' }
|
|
126
|
+
: matchHttpRoute(method, path, httpRoutes);
|
|
127
|
+
rows.push({
|
|
128
|
+
testId: record.testId,
|
|
129
|
+
method: method.toUpperCase(),
|
|
130
|
+
path,
|
|
131
|
+
status,
|
|
132
|
+
...(exchange['initiator'] === 'test-code' ? { initiator: 'test-code' } : {}),
|
|
133
|
+
kind,
|
|
134
|
+
route: resolution.status === 'match' ? resolution.matched.resourceId : null,
|
|
135
|
+
resolution: resolution.status,
|
|
136
|
+
...(resolution.status === 'ambiguous' ? { candidates: [...resolution.candidates] } : {}),
|
|
137
|
+
...(shape === null ? {} : shape),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
rows.sort((left, right) => compareStrings(left.testId, right.testId) ||
|
|
142
|
+
compareStrings(left.method, right.method) ||
|
|
143
|
+
compareStrings(left.path, right.path) ||
|
|
144
|
+
compareStrings(String(left.status), String(right.status)));
|
|
145
|
+
const inventory = httpRoutes === null || httpRoutes === undefined || httpRoutes.length === 0
|
|
146
|
+
? 'unavailable'
|
|
147
|
+
: rows.some((row) => row.resolution === 'incomplete')
|
|
148
|
+
? 'incomplete'
|
|
149
|
+
: 'complete';
|
|
150
|
+
const summary = {
|
|
151
|
+
exchanges: rows.length,
|
|
152
|
+
matched: 0,
|
|
153
|
+
unmatched: 0,
|
|
154
|
+
ambiguous: 0,
|
|
155
|
+
incomplete: 0,
|
|
156
|
+
...(inventory === 'complete' ? {} : { inventory }),
|
|
157
|
+
};
|
|
158
|
+
for (const row of rows) {
|
|
159
|
+
if (row.kind !== 'api')
|
|
160
|
+
continue;
|
|
161
|
+
if (row.resolution === 'match')
|
|
162
|
+
summary.matched += 1;
|
|
163
|
+
else if (row.resolution === 'nomatch')
|
|
164
|
+
summary.unmatched += 1;
|
|
165
|
+
else if (row.resolution === 'ambiguous')
|
|
166
|
+
summary.ambiguous += 1;
|
|
167
|
+
else
|
|
168
|
+
summary.incomplete += 1;
|
|
169
|
+
}
|
|
170
|
+
return { rows, summary };
|
|
171
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AsB;QACjC,SAAS,EAAE,IAAI,CAAC,MAAM;QACtB,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,CAAC;QACb,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;KACnD,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK;YAAE,SAAS;QACjC,IAAI,GAAG,CAAC,UAAU,KAAK,OAAO;YAAE,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC;aAChD,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS;YAAE,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;aACzD,IAAI,GAAG,CAAC,UAAU,KAAK,WAAW;YAAE,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;;YAC3D,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
package/dist/verdict/index.d.ts
CHANGED
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
export { BLOCKING_VERDICTS, GateforgeVerdictError, evaluateObligation, evaluateObligations, parseInstant, volatileEchoSkips, volatileFieldsOf, } from './evaluate.js';
|
|
6
6
|
export type { ObligationVerdict, VerdictContext, VerdictOutcome, WaiverRef, } from './evaluate.js';
|
|
7
7
|
export { registerContractVerifier, verifierFor, registeredNamespaces, registerContractCapabilities, capabilityFor, setContractAvailability, allCapabilities, type ClaimEvidenceInput, type ClaimOutcome, type ContractVerifier, type ContractCapability, type ContractAvailability, type HttpRouteCandidate, } from './registry.js';
|
|
8
|
+
/**
|
|
9
|
+
* The verdict-time exchange ledger (0.14 WP2): witnessed `http.exchanges`
|
|
10
|
+
* rows resolved by the ONE route matcher — report-only input for the run
|
|
11
|
+
* report's `httpLedger`, never a verdict input.
|
|
12
|
+
*/
|
|
13
|
+
export { buildHttpLedger, httpExchangeKind, type HttpLedgerKind, type HttpLedger, type HttpLedgerResolution, type HttpLedgerRow, type HttpLedgerSummary, } from './http-ledger.js';
|
|
14
|
+
/**
|
|
15
|
+
* The HTTP call rules R1-R5 (0.14 WP3): used/proven/missing counts over
|
|
16
|
+
* the exchange ledger plus the static join, and the typed call findings
|
|
17
|
+
* (`HTTP_CALL_UNMATCHED` / `HTTP_CALL_AMBIGUOUS` /
|
|
18
|
+
* `HTTP_CALL_UNRESOLVED`). Never a verdict input.
|
|
19
|
+
*/
|
|
20
|
+
export { channelHttpCallFindings, evaluateHttpCoverage, httpCallFindingAdoptionForgivable, httpCallFindingEntries, httpResponseShapeEntries, HTTP_CALL_UNMATCHED, HTTP_CALL_AMBIGUOUS, HTTP_CALL_UNRESOLVED, HTTP_ROUTE_NOT_INVENTORIED, type HttpCallFinding, type HttpCallFindingCode, type HttpCallFindingsMode, type HttpCoverageInput, type HttpCoverageResult, type HttpCoverageRoute, type HttpCoverageSummary, type HttpCoverageUnresolved, type HttpCoverageVerdict, type HttpMissingRoute, } from './http-coverage.js';
|
|
21
|
+
export { HTTP_EXCHANGES_KIND } from './pack-verifiers.js';
|
|
8
22
|
/**
|
|
9
23
|
* Cause mapping for the shared report model (plan §5.4): stable cause
|
|
10
24
|
* codes + next actions for blocking verdicts, and the precise capability
|
|
@@ -19,7 +33,7 @@ export { causeForVerdict, capabilityGap, strictCapabilityGaps, type VerdictCause
|
|
|
19
33
|
* (same scope, distinct orders, no typed path convertor ahead of the
|
|
20
34
|
* field — 0.14); otherwise ambiguity blocks.
|
|
21
35
|
*/
|
|
22
|
-
export { registerPackVerifiers, bindQueueObserver, interpretObservedPath, resolveHttpRoute, pathMatchesShape, } from './pack-verifiers.js';
|
|
36
|
+
export { registerPackVerifiers, bindQueueObserver, interpretObservedPath, matchHttpRoute, resolveHttpRoute, pathMatchesShape, } from './pack-verifiers.js';
|
|
23
37
|
/**
|
|
24
38
|
* Required-case aggregation (plan 2026-09-19 §4.7, Phase 5): pure
|
|
25
39
|
* semantic grading across an obligation's required behavior cases —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verdict/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACpB,4BAA4B,EAC5B,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB;;;;;;;GAOG;AACH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B;;;;GAIG;AACH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","source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nB,MAAM,YAAY,CAAC;AACpB;;;;;;;GAOG;AACH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B;;;;GAIG;AACH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC"}
|
package/dist/verdict/index.js
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { BLOCKING_VERDICTS, GateforgeVerdictError, evaluateObligation, evaluateObligations, parseInstant, volatileEchoSkips, volatileFieldsOf, } from './evaluate.js';
|
|
6
6
|
export { registerContractVerifier, verifierFor, registeredNamespaces, registerContractCapabilities, capabilityFor, setContractAvailability, allCapabilities, } from './registry.js';
|
|
7
|
+
/**
|
|
8
|
+
* The verdict-time exchange ledger (0.14 WP2): witnessed `http.exchanges`
|
|
9
|
+
* rows resolved by the ONE route matcher — report-only input for the run
|
|
10
|
+
* report's `httpLedger`, never a verdict input.
|
|
11
|
+
*/
|
|
12
|
+
export { buildHttpLedger, httpExchangeKind, } from './http-ledger.js';
|
|
13
|
+
/**
|
|
14
|
+
* The HTTP call rules R1-R5 (0.14 WP3): used/proven/missing counts over
|
|
15
|
+
* the exchange ledger plus the static join, and the typed call findings
|
|
16
|
+
* (`HTTP_CALL_UNMATCHED` / `HTTP_CALL_AMBIGUOUS` /
|
|
17
|
+
* `HTTP_CALL_UNRESOLVED`). Never a verdict input.
|
|
18
|
+
*/
|
|
19
|
+
export { channelHttpCallFindings, evaluateHttpCoverage, httpCallFindingAdoptionForgivable, httpCallFindingEntries, httpResponseShapeEntries, HTTP_CALL_UNMATCHED, HTTP_CALL_AMBIGUOUS, HTTP_CALL_UNRESOLVED, HTTP_ROUTE_NOT_INVENTORIED, } from './http-coverage.js';
|
|
20
|
+
export { HTTP_EXCHANGES_KIND } from './pack-verifiers.js';
|
|
7
21
|
/**
|
|
8
22
|
* Cause mapping for the shared report model (plan §5.4): stable cause
|
|
9
23
|
* codes + next actions for blocking verdicts, and the precise capability
|
|
@@ -18,7 +32,7 @@ export { causeForVerdict, capabilityGap, strictCapabilityGaps, } from './cause.j
|
|
|
18
32
|
* (same scope, distinct orders, no typed path convertor ahead of the
|
|
19
33
|
* field — 0.14); otherwise ambiguity blocks.
|
|
20
34
|
*/
|
|
21
|
-
export { registerPackVerifiers, bindQueueObserver, interpretObservedPath, resolveHttpRoute, pathMatchesShape, } from './pack-verifiers.js';
|
|
35
|
+
export { registerPackVerifiers, bindQueueObserver, interpretObservedPath, matchHttpRoute, resolveHttpRoute, pathMatchesShape, } from './pack-verifiers.js';
|
|
22
36
|
/**
|
|
23
37
|
* Required-case aggregation (plan 2026-09-19 §4.7, Phase 5): pure
|
|
24
38
|
* semantic grading across an obligation's required behavior cases —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/verdict/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACpB,4BAA4B,EAC5B,aAAa,EACb,uBAAuB,EACvB,eAAe,GAOhB,MAAM,eAAe,CAAC;AACvB;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GAGrB,MAAM,YAAY,CAAC;AACpB;;;;;;;GAOG;AACH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B;;;;GAIG;AACH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GAKtB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/verdict/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACpB,4BAA4B,EAC5B,aAAa,EACb,uBAAuB,EACvB,eAAe,GAOhB,MAAM,eAAe,CAAC;AACvB;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,gBAAgB,GAMjB,MAAM,kBAAkB,CAAC;AAC1B;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,iCAAiC,EACjC,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,GAW3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GAGrB,MAAM,YAAY,CAAC;AACpB;;;;;;;GAOG;AACH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B;;;;GAIG;AACH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GAKtB,MAAM,eAAe,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { QueueObserverConfig } from '../schemas/queue-observer.js';
|
|
2
2
|
import { type HttpRouteCandidate } from './registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Session-wide transport-snapshot kind (0.14 WP2): the witness issues
|
|
5
|
+
* ONE claim-free record per PASSED test session (and per completed
|
|
6
|
+
* page-sweep session) carrying every exchange the session proxied —
|
|
7
|
+
* the input the verdict-time `httpLedger` is built from. It NEVER
|
|
8
|
+
* satisfies an obligation: claim grading reads only `http.request` and
|
|
9
|
+
* Observe-channel `http.observed` records, and the ledger itself is
|
|
10
|
+
* report-only. Mirrors `HTTP_EXCHANGES_KIND` in `@gate-forge/witness`'s
|
|
11
|
+
* `src/constants.ts` — keep in lockstep.
|
|
12
|
+
*/
|
|
13
|
+
export declare const HTTP_EXCHANGES_KIND = "http.exchanges";
|
|
3
14
|
/**
|
|
4
15
|
* Single deterministic path interpretation for runtime observations
|
|
5
16
|
* (plan §9 steps 1-3). Conservative and lockstep with the witness
|
|
@@ -37,26 +48,50 @@ export declare function interpretObservedPath(rawUrl: unknown): {
|
|
|
37
48
|
reason: string;
|
|
38
49
|
};
|
|
39
50
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
51
|
+
* The ONE obligation-free route resolution (WP2): where a concrete
|
|
52
|
+
* observed request lands in the complete route inventory, with no
|
|
53
|
+
* obligation identity involved. `resolveHttpRoute` wraps this with the
|
|
54
|
+
* resource-id mismatch check — there is no second resolver.
|
|
55
|
+
*/
|
|
56
|
+
export type HttpRouteMatch = {
|
|
57
|
+
status: 'match';
|
|
58
|
+
matched: HttpRouteCandidate;
|
|
59
|
+
} | {
|
|
60
|
+
status: 'nomatch';
|
|
61
|
+
reason: string;
|
|
62
|
+
} | {
|
|
63
|
+
status: 'ambiguous';
|
|
64
|
+
candidates: string[];
|
|
65
|
+
} | {
|
|
66
|
+
status: 'incomplete';
|
|
67
|
+
reason: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Obligation-free route attribution over the COMPLETE candidate set
|
|
71
|
+
* (plan §9 steps 4-9, D2; 0.14 registration-order precedence): the
|
|
72
|
+
* matcher both the obligation-aware {@link resolveHttpRoute} and the
|
|
73
|
+
* verdict-time `httpLedger` build on, so the product keeps exactly one
|
|
74
|
+
* route resolver.
|
|
75
|
+
*
|
|
42
76
|
* When more than one candidate matches the observation — the literal
|
|
43
77
|
* `/accounts/export` against the parameter `/accounts/{}` — attribution
|
|
44
78
|
* resolves by the framework's OWN registration order, but only when the
|
|
45
79
|
* detector proved it for the whole matched set: same scope, distinct
|
|
46
80
|
* orders, no typed path convertor on the smallest-order candidate (see
|
|
47
|
-
* {@link registrationOrderWinner}). The winner
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* attribution is ambiguous and the claim blocks, exactly as before.
|
|
81
|
+
* {@link registrationOrderWinner}). The winner is returned as the
|
|
82
|
+
* `match`. Without a proven order (other packs, unprovable constructs,
|
|
83
|
+
* mixed scopes, a missing or tied proof, a typed convertor ahead of the
|
|
84
|
+
* field) the transport status is still known but handler attribution is
|
|
85
|
+
* ambiguous.
|
|
53
86
|
*
|
|
54
87
|
* Args:
|
|
55
|
-
* observedMethod: the witnessed
|
|
88
|
+
* observedMethod: the witnessed method (any case).
|
|
56
89
|
* observedPath: the interpreted observed path (from
|
|
57
90
|
* `interpretObservedPath`).
|
|
58
91
|
* candidates: the complete host-derived route inventory.
|
|
59
|
-
*
|
|
92
|
+
* subject: optional identity named in the blocking reasons (the
|
|
93
|
+
* caller's attribution subject, e.g. an obligation resource id).
|
|
94
|
+
* Pure message text — never affects the outcome.
|
|
60
95
|
*
|
|
61
96
|
* Returns:
|
|
62
97
|
* - `{status: 'incomplete', reason}` when any candidate carries an
|
|
@@ -66,10 +101,30 @@ export declare function interpretObservedPath(rawUrl: unknown): {
|
|
|
66
101
|
* - `{status: 'ambiguous', candidates}` with the sorted identity
|
|
67
102
|
* texts when more than one distinct resource matches and no proven
|
|
68
103
|
* registration order singles one out;
|
|
104
|
+
* - `{status: 'match', matched}` when exactly one candidate matches
|
|
105
|
+
* (or the proven order winner does).
|
|
106
|
+
*/
|
|
107
|
+
export declare function matchHttpRoute(observedMethod: string, observedPath: string, candidates: readonly HttpRouteCandidate[], subject?: string): HttpRouteMatch;
|
|
108
|
+
/**
|
|
109
|
+
* Obligation-aware wrapper around {@link matchHttpRoute} (the ONE
|
|
110
|
+
* resolver): identical matcher, precedence, and messages, plus the ONE
|
|
111
|
+
* obligation-specific rule — a unique match (or proven order winner)
|
|
112
|
+
* that is a DIFFERENT endpoint than the obligation's own is a
|
|
113
|
+
* `mismatch`, never credit.
|
|
114
|
+
*
|
|
115
|
+
* Args:
|
|
116
|
+
* observedMethod: the witnessed record's method (any case).
|
|
117
|
+
* observedPath: the interpreted observed path (from
|
|
118
|
+
* `interpretObservedPath`).
|
|
119
|
+
* candidates: the complete host-derived route inventory.
|
|
120
|
+
* obligationResourceId: the obligation's own resource id.
|
|
121
|
+
*
|
|
122
|
+
* Returns:
|
|
69
123
|
* - `{status: 'mismatch', matched}` when exactly one candidate
|
|
70
124
|
* matches (or the proven order winner is) a different endpoint;
|
|
71
125
|
* - `{status: 'match', matched}` when the unique match (or the
|
|
72
|
-
* proven order winner) is the obligation's own endpoint
|
|
126
|
+
* proven order winner) is the obligation's own endpoint;
|
|
127
|
+
* - otherwise the unchanged {@link matchHttpRoute} resolution.
|
|
73
128
|
*/
|
|
74
129
|
export declare function resolveHttpRoute(observedMethod: string, observedPath: string, candidates: readonly HttpRouteCandidate[], obligationResourceId: string): {
|
|
75
130
|
status: 'match';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-verifiers.d.ts","sourceRoot":"","sources":["../../src/verdict/pack-verifiers.ts"],"names":[],"mappings":"AAwDA,O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