Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/qa/dogfood/test/authz-conformance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,8 @@ describe('#9084 — the rest-server.ts transport tripwire keys off mechanics', (
// re-read. The control is that both probes really READ the list — their
// text is every file on it, in order — so the zero is not a list ignored.
// [#23050 slice 4] Length 4 → 5 (`sharing-routes.ts`), still 0 over it.
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(5);
// [#23050 slice 5] Length 5 → 6 (`analytics-routes.ts`), still 0 over it.
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(6);
expect(REST_SERVER_REGISTRAR_PATHS[0]).toBe(REST_SERVER);
const listed = REST_SERVER_REGISTRAR_PATHS.map((file) => readFileSync(join(REPO_ROOT, file), 'utf8'));
for (const probe of [MECHANICS, ROUTES]) {
Expand Down
23 changes: 18 additions & 5 deletions packages/qa/dogfood/test/authz-probe-blind-spot.census.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,10 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
'indentation and the subtrahend is pinned at 1 by the `forwarder slice:` control, never inferred from a ' +
'terminator spelling), PLUS `registerPerItemRoute(` call sites; counted over this file AND every ' +
'module on the registrar list (`packages/rest/src/rest-server-registrar-files.ts`) — ' +
'`data-action-routes.ts`, `batch-routes.ts`, `approvals-routes.ts` and `sharing-routes.ts`, the modules the ' +
'bodies of `registerDataActionEndpoints`, `registerBatchEndpoints`, `registerApprovalsEndpoints`, ' +
'`registerSharingEndpoints` and `registerSharingRuleEndpoints` moved to; ' +
'`data-action-routes.ts`, `batch-routes.ts`, `approvals-routes.ts`, `sharing-routes.ts` and ' +
'`analytics-routes.ts`, the modules the bodies of `registerDataActionEndpoints`, `registerBatchEndpoints`, ' +
'`registerApprovalsEndpoints`, `registerSharingEndpoints`, `registerSharingRuleEndpoints` and ' +
'`registerAnalyticsEndpoints` moved to; ' +
'reachable = those inside registerMetadataEndpoints',
// [#15542 / #15854] ⭐ THE POPULATION RULE LEARNED A SECOND SPELLING, and
// the numbers it produces did NOT move: 80 / 19 / 61, exactly as before.
Expand Down Expand Up @@ -691,22 +692,34 @@ export const PROBE_FILE_CENSUS: readonly ProbeFileReading[] = [
// slice's seam, the same two spellings TWICE, because the module carries
// two registrars (two host literals' forwarders, four; two host
// interfaces' members, four). No call site was added.
// [#23050 slice 5] 70 / 19 / 51 UNCHANGED, the same measurement again:
// `registerAnalyticsEndpoints`' body (one registration site, outside
// `registerMetadataEndpoints`, so in the blind spot) moved to
// `analytics-routes.ts`, which joins the list (length 5 -> 6) with its own
// control. `this.routeManager.register(` stays 63 over the six files
// (33 here + 9 + 5 + 7 + 8 + 1), `private register*Endpoints(` stays 16
// (the registrar is still declared here), and `enforceAuth` 80 -> 84 is
// RE-ANCHORED, not relaxed: the one call site moved with its route and is
// counted in both readings; the four new occurrences are this slice's
// seam, the same two spellings once (the host literal's forwarder, two;
// the host interface's member, two). No call site was added.
controls: {
'private register*Endpoints(': 16,
'this.routeManager.register(': 63,
'registrar list length': 5,
'registrar list length': 6,
'data-action-routes.ts: this.routeManager.register(': 9,
'batch-routes.ts: this.routeManager.register(': 5,
'approvals-routes.ts: this.routeManager.register(': 7,
'sharing-routes.ts: this.routeManager.register(': 8,
'analytics-routes.ts: this.routeManager.register(': 1,
// Both halves of the new rule carry their own control, so neither can go
// silently to zero: a helper deleted and its routes inlined back would
// still read population 80, and only these two controls would notice the
// shape moved and force this provenance to be re-read.
'registerPerItemRoute(': 8,
'const registerPerItemRoute =': 1,
'forwarder slice: this.routeManager.register(': 1,
enforceAuth: 80,
enforceAuth: 84,
},
note:
'The single non-tripwire probe names ONE registrar of 16. The other 15 can never mint a key: ' +
Expand Down
3 changes: 2 additions & 1 deletion packages/rest/src/analytics-dataset-refusal-envelope.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ describe('[#5367] a dataset refusal answers 400 DATASET_INVALID from its own env
*
* The route replaces every parse failure's `message` with a generic
* "Invalid dataset definition." and puts the real one in `detail`, capped at
* 1000 characters (`rest-server.ts`). The prescription's zod-wrapped message
* 1000 characters (`analytics-routes.ts` since #23050 slice 5,
* `rest-server.ts` before). The prescription's zod-wrapped message
* is 1076 chars for `array_agg` and 1304 for `string_agg`, so the two clauses
* an author must act on — "was removed" (~index 192) and the imperative
* "Delete the aggregation" (690 / 918) — arrive, and the closing
Expand Down
3 changes: 2 additions & 1 deletion packages/rest/src/analytics-fault-user-message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
* ```text
* throw { code: 'INVALID_FILTER', status: 400, userMessage: 'Check the filter…' }
* ① analytics (rest-server.ts, the `{ code, message }` it builds by hand)
* ① analytics (analytics-routes.ts since #23050 slice 5, rest-server.ts
* before; the `{ code, message }` it builds by hand)
* → 400 {"code":"INVALID_FILTER","message":"…"} ⛔ no mark
* /data door → 400 {"error":"…","code":"INVALID_FILTER",
* "userMessage":"Check the filter…"}
Expand Down
Loading
Loading