Skip to content

Commit c8809d8

Browse files
committed
test(dogfood): move the authz census and matrix row to the retired /docs viewer page
The blind-spot census reads one fewer registration site and ledger row, and the API-description matrix row covers the one route left. The execctx census keeps its 46-row floor, which still holds. Claude-Session: https://claude.ai/code/session_01LmjU2x1faLZ39DVTFyVca6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 940400b commit c8809d8

3 files changed

Lines changed: 39 additions & 18 deletions

File tree

‎packages/qa/dogfood/test/authz-conformance.matrix.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,16 @@ export const AUTHZ_CONFORMANCE: AuthzPrimitive[] = [
294294
note: 'Ungated, an unauthenticated caller — carried to the domain as the guest envelope — was answered 200 on every analytics face on a stock boot, with aggregates over arbitrary objects, while the record doors and the dataset door on the same boot answered it 401. Gating the DOMAIN rather than each face keeps a newly added analytics face from arriving ungated. This row is the door half only: a non-system caller who resolves NO permission set being granted object admission and an unscoped read by that absence is a security-layer question for every door at once, deliberately not copied into service-analytics; it is tracked on its own card. The per-face unit pins (anonymous 401 with the service never consulted, malformed body and empty slot still 401, signed-in control unchanged) live in runtime/domains/analytics-anonymous-deny.test.ts.' },
295295
// #22430 — the API-description endpoints, under the ruling recorded on #22146
296296
// (the API-description endpoints refuse an anonymous caller with 401).
297-
{ id: 'anonymous-deny-api-description', summary: 'anonymous-deny on the API-description endpoints (the document and its viewer)', state: 'enforced',
298-
enforcement: 'rest/discovery-routes.ts registerOpenApiEndpoints — BOTH handlers (the document and its viewer page, on every base the server mounts) open with enforceAuth (→ shouldDenyAnonymous) as their first act, ahead of the bundled-artifact load and the protocol resolution, so a refused request does no work and does not reveal whether a document is bundled; an anonymous caller gets the REST seam\'s flat 401 UNAUTHENTICATED, a signed-in caller is served as before, and a session held by the ADR-0069 auth-policy gate gets that gate\'s 403',
297+
// #25104 — the document's `/docs` viewer page, the family's second route,
298+
// was retired with its handler; the row now covers the one route left.
299+
{ id: 'anonymous-deny-api-description', summary: 'anonymous-deny on the API-description endpoint (the OpenAPI document)', state: 'enforced',
300+
enforcement: 'rest/discovery-routes.ts registerOpenApiEndpoints — the document handler (on every base the server mounts) opens with enforceAuth (→ shouldDenyAnonymous) as its first act, ahead of the bundled-artifact load and the protocol resolution, so a refused request does no work and does not reveal whether a document is bundled; an anonymous caller gets the REST seam\'s flat 401 UNAUTHENTICATED, a signed-in caller is served as before, and a session held by the ADR-0069 auth-policy gate gets that gate\'s 403',
299301
proof: 'showcase-anonymous-deny-surfaces.dogfood.test.ts',
300-
// The REST family at ledger granularity. The family is exactly these two
301-
// routes and both handlers open with the floor, which is the property a
302+
// The REST family at ledger granularity. The family is exactly this one
303+
// route and its handler opens with the floor, which is the property a
302304
// family key needs.
303305
covers: ['rest-family:rest-route-ledger.ts:openapi'],
304-
note: 'Measured on a booted showcase before the change: an unauthenticated caller was served the document and the viewer page with 200, just as a signed-in caller was, while the record doors on the same boot answered it 401 — ADR-0056 D2 is default-deny and no ADR-0138 D2 door class names these endpoints. The cited proof drives both endpoints anonymously (401, the REST flat envelope, nothing of either served) and with a signed-in member (200, the document / the viewer page) on one boot. The environment-scoped twin mounts only under project scoping, which the showcase does not enable; it is the same handler closure, pinned per base in rest/src/rest-api-description-anonymous-deny.test.ts beside the gated-session 403 and the permission-store-outage 503. The viewer page fetches the document from the browser, and that request carries the browser\'s session (measured with the real viewer in a browser), so a signed-in browser is served on both endpoints; a deployment that publishes its API description to readers without an account publishes a static copy of the document instead.' },
306+
note: 'Measured on a booted showcase before the change: an unauthenticated caller was served the document (and its viewer page, since retired) with 200, just as a signed-in caller was, while the record doors on the same boot answered it 401 — ADR-0056 D2 is default-deny and no ADR-0138 D2 door class names this endpoint. The cited proof drives the document anonymously (401, the REST flat envelope, nothing of it served) and with a signed-in member (200, the document) on one boot. The environment-scoped twin mounts only under project scoping, which the showcase does not enable; it is the same handler closure, pinned per base in rest/src/rest-api-description-anonymous-deny.test.ts beside the gated-session 403 and the permission-store-outage 503. A deployment that publishes its API description to readers without an account publishes a static copy of the document instead.' },
305307
// #22432 — the `/i18n` dispatcher domain, under the ruling recorded on #22146
306308
// (the domain gains the domain-level anonymous refusal every other dispatcher
307309
// domain has, with an objectui companion for the Console's sign-in page).

‎packages/qa/dogfood/test/authz-probe-blind-spot.census.ts‎

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,15 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
382382
// permission-set overlay-discard row left with its route. It carried
383383
// `family: 'security'`, which the surviving security rows still carry, so
384384
// `reachable` moves with `population` and `keys` stays 18.
385-
population: 81,
386-
reachable: 81,
385+
// [#25104] 81 / 81 / 0 -> 80 / 80 / 0: the OpenAPI document's `/docs`
386+
// viewer page row (`GET /api/v1/docs`) left the ledger with its route. It
387+
// carried `family: 'openapi'`, which the surviving document row still
388+
// carries, so `reachable` moves with `population` and `keys` stays 18.
389+
population: 80,
390+
reachable: 80,
387391
blindSpot: 0,
388392
populationRule: 'ledger rows inside REST_ROUTE_LEDGER; reachable = rows carrying a `family` (each distinct value mints a key)',
389-
controls: { "route: '": 81, "family: '": 81, RestRouteLedgerEntry: 2 },
393+
controls: { "route: '": 80, "family: '": 80, RestRouteLedgerEntry: 2 },
390394
// [#22430] The `openapi` family is the second classified one, by the
391395
// `anonymous-deny-api-description` row; the note's 2 / 16 counts it.
392396
// [ADR-0138 E2] The `forms` family is the third, by the D2 class 1 row
@@ -397,7 +401,9 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
397401
'That guard is why this file can be a population source and a regex table cannot: a mounted route with no ' +
398402
'row here is already RED in another package, so a new family cannot be silently absent from this file, ' +
399403
'and therefore cannot be silently absent from the authz ratchet either. 18 families; 3 classified by ' +
400-
'matrix rows (metadata, openapi and forms), 15 enumerated in the shrink-only baseline. Re-measured 82 -> 81 when the permission-set ' +
404+
'matrix rows (metadata, openapi and forms), 15 enumerated in the shrink-only baseline. Re-measured 81 -> 80 when the ' +
405+
'OpenAPI document viewer page row left with its route; it carried `family: openapi`, which the surviving document row ' +
406+
'still carries. Earlier re-measured 82 -> 81 when the permission-set ' +
401407
'overlay-discard row left with its route; it carried `family: security`, which the surviving security rows still carry. ' +
402408
'Earlier re-measured 83 -> 82 when the anonymous ' +
403409
'public-form lookup-picker row left with its route; it carried `family: forms`, which the surviving form rows ' +
@@ -529,9 +535,9 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
529535
kinds: ['ROUTE_ENUMERATION', 'TRIPWIRE'],
530536
probes: 3,
531537
keys: 1,
532-
population: 70,
538+
population: 69,
533539
reachable: 19,
534-
blindSpot: 51,
540+
blindSpot: 50,
535541
populationRule:
536542
'route registration sites — `this.routeManager.register(` call sites, LESS the one inside ' +
537543
'`registerPerItemRoute` (the shared forwarder, not a route; its extent is bounded by the declaration\'s own ' +
@@ -931,17 +937,24 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
931937
// `private register*Endpoints(` stays 16, `const registerPerItemRoute =`
932938
// stays 1, `forwarder slice:` stays 1 and `enforceAuth` stays 112: the moved
933939
// groups spell none of the last four, and neither does the seam.
940+
// [#25104] 70 / 19 / 51 -> 69 / 19 / 50, and `enforceAuth` 112 -> 111: the
941+
// OpenAPI document's `/docs` viewer page was deleted with its handler, one
942+
// direct `this.routeManager.register(` site (63 -> 62; 4 -> 3 in
943+
// `discovery-routes.ts`) inside `registerOpenApiEndpoints`, NOT inside
944+
// `registerMetadataEndpoints`, so it was a blind spot; its handler opened
945+
// with `enforceAuth`, so that control drops by one. The registrar survives
946+
// for the document, so `private register*Endpoints(` stays 16.
934947
controls: {
935948
'private register*Endpoints(': 16,
936-
'this.routeManager.register(': 63,
949+
'this.routeManager.register(': 62,
937950
'registrar list length': 18,
938951
'data-action-routes.ts: this.routeManager.register(': 9,
939952
'batch-routes.ts: this.routeManager.register(': 5,
940953
'approvals-routes.ts: this.routeManager.register(': 7,
941954
'sharing-routes.ts: this.routeManager.register(': 8,
942955
'analytics-routes.ts: this.routeManager.register(': 1,
943956
'security-routes.ts: this.routeManager.register(': 6,
944-
'discovery-routes.ts: this.routeManager.register(': 4,
957+
'discovery-routes.ts: this.routeManager.register(': 3,
945958
'email-routes.ts: this.routeManager.register(': 1,
946959
'search-routes.ts: this.routeManager.register(': 1,
947960
'ui-routes.ts: this.routeManager.register(': 1,
@@ -970,7 +983,7 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
970983
'registerPerItemRoute(': 8,
971984
'const registerPerItemRoute =': 1,
972985
'forwarder slice: this.routeManager.register(': 1,
973-
enforceAuth: 112,
986+
enforceAuth: 111,
974987
},
975988
note:
976989
'The single non-tripwire probe names ONE registrar of 16. The other 15 can never mint a key: ' +
@@ -1247,7 +1260,7 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
12471260
/**
12481261
* Entry points inside the probe table's OWN files that no mintable key can
12491262
* reach, counting only the route/handler surfaces the ratchet's completeness
1250-
* claim is about: rest-server.ts (51 static / 56 runtime), http-dispatcher.ts
1263+
* claim is about: rest-server.ts (50 static / 55 runtime), http-dispatcher.ts
12511264
* (13) and domains/mcp.ts (1).
12521265
*
12531266
* hono-plugin.ts's 6 mounts are deliberately EXCLUDED from this total and
@@ -1262,8 +1275,11 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
12621275
// [ADR-0131 cutover, stage 7-pre] 66 / 71 -> 65 / 70: the retired permission-set
12631276
// overlay-discard route left rest-server.ts as one blind-spot call site and
12641277
// one runtime mount.
1265-
export const BLIND_SPOT_TOTAL_STATIC = 65;
1266-
export const BLIND_SPOT_TOTAL_RUNTIME = 70;
1278+
// [#25104] 65 / 70 -> 64 / 69: the retired `/docs` viewer page left
1279+
// `discovery-routes.ts` (on rest-server.ts's registrar list) as one blind-spot
1280+
// call site and one runtime mount.
1281+
export const BLIND_SPOT_TOTAL_STATIC = 64;
1282+
export const BLIND_SPOT_TOTAL_RUNTIME = 69;
12671283

12681284
/**
12691285
* Re-measure every row above from the same sources the probes read.

‎packages/rest/src/execctx-consumer-census.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,10 @@ describe('[#13160] §3 the 45 bare sites — driven, every one of them', () => {
899899
const controlByRoute = new Map(control.map((r) => [r.route, r]));
900900

901901
const rows = fault.filter((r) => r.sites.some((l) => bareLines.has(l)));
902-
expect(rows.length).toBeGreaterThanOrEqual(45);
902+
// [#25104] The floor stays 46 although the bare sites fell to 45: 51 rows
903+
// reach a bare line after the `/docs` viewer page retired, so the old
904+
// floor still holds, and a floor that holds is not lowered.
905+
expect(rows.length).toBeGreaterThanOrEqual(46);
903906

904907
for (const row of rows) {
905908
expect(row.status, `${row.route} under an absent context`).toBe(ANONYMOUS_DENY_STATUS);

0 commit comments

Comments
 (0)