|
10 | 10 | // deleted proof, breaks the build. |
11 | 11 | // |
12 | 12 | // #2567 Phase 2 — the anonymous-deny SURFACES are additionally pinned by the |
13 | | -// `discover()` ratchet: this test STATICALLY enumerates the data/meta/graphql |
14 | | -// HTTP entry points from source and asserts each is classified by a matrix row. |
15 | | -// A new ungated `/data` route (or a removed/stale `covers` key) then fails CI as |
16 | | -// UNCLASSIFIED / STALE — the surface can't silently regress. |
| 13 | +// `discover()` ratchet: this test STATICALLY enumerates the HTTP/transport |
| 14 | +// entry points named in the curated `PROBES` table below and asserts each is |
| 15 | +// classified by a matrix row. A new ungated route (or a removed/stale |
| 16 | +// `covers` key) then fails CI as UNCLASSIFIED / STALE — the surface can't |
| 17 | +// silently regress. |
17 | 18 |
|
18 | 19 | import { describe, expect, it } from 'vitest'; |
19 | 20 | import { fileURLToPath } from 'node:url'; |
@@ -43,13 +44,14 @@ const ATTRIBUTION = { marker: ATTRIBUTION_MARKER, scan: scanProofCandidates } as |
43 | 44 |
|
44 | 45 | // ── #2567 ratchet — static enumeration of anonymous-deny HTTP entry points ── |
45 | 46 | // |
46 | | -// A CURATED per-file probe table (not a blind repo grep): scoped to the four |
47 | | -// source files and to data/meta/graphql segments only, so control-plane routes |
48 | | -// (/health, /auth, /ready, /discovery) are never enumerated as data surfaces. |
49 | | -// But each probe is pattern-based WITHIN its file, so a genuinely new `/data` |
50 | | -// route (or a new graphql/meta handler) is auto-discovered → new key → a |
51 | | -// missing `covers` fails CI. Keys are derived from source CONTENT (route |
52 | | -// literals / handler names), never line numbers, so they don't churn on edits. |
| 47 | +// A CURATED per-file probe table (not a blind repo grep): scoped to the |
| 48 | +// source files and route families named in PROBES below, so control-plane |
| 49 | +// routes (/health, /auth, /ready, /discovery) are never enumerated as data |
| 50 | +// surfaces. But each probe is pattern-based WITHIN its file, so a genuinely |
| 51 | +// new route or handler matching an existing probe's pattern is auto-discovered |
| 52 | +// → new key → a missing `covers` fails CI. Keys are derived from source |
| 53 | +// CONTENT (route literals / handler names), never line numbers, so they don't |
| 54 | +// churn on edits. |
53 | 55 | const PROBES: ReadonlyArray<{ file: string; re: RegExp; key: (m: RegExpExecArray) => string }> = [ |
54 | 56 | // REST /meta umbrella registrar — one guarded registrar covers all ~17 routes. |
55 | 57 | { |
@@ -222,9 +224,9 @@ describe('ADR-0056 D10 — authorization conformance matrix', () => { |
222 | 224 | const problems = checkLedger(AUTHZ_CONFORMANCE, { |
223 | 225 | proofRoot: HERE, // proofs are dogfood test files alongside this one |
224 | 226 | highRisk: HIGH_RISK, |
225 | | - // The ratchet: every discovered data/meta/graphql entry point must be |
226 | | - // classified by exactly one row's `covers`, and no `covers` key may be |
227 | | - // stale (no longer in source). |
| 227 | + // The ratchet: every discovered PROBES entry point must be classified |
| 228 | + // by exactly one row's `covers`, and no `covers` key may be stale (no |
| 229 | + // longer in source). |
228 | 230 | discover: () => discoverAnonymousDenySurfaces(), |
229 | 231 | // #7976 — and the cited proofs must NAME the rows they prove. |
230 | 232 | attribution: ATTRIBUTION, |
|
0 commit comments