Skip to content

Commit 83cff86

Browse files
committed
test(rest): drop the registrar-file list's length pins from six rest tests
Each reader keeps iterating REST_SERVER_REGISTRAR_FILES; the list is the authority on its own length. meta-draft-read-door-census also drops its SITES 8 pin (its first case's ledger equality holds the sum) and gains an anti-vacuity guard on the list in the case left with only a list-mirroring assertion. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nSKhKswuL33xRZZ3g
1 parent 45de8c6 commit 83cff86

6 files changed

Lines changed: 22 additions & 20 deletions

‎packages/rest/src/meta-draft-read-door-census.test.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* their own, and a door that reads a draft is no less a door there. A site's
5050
* key names its route or function, never its file, so the ledger is the same
5151
* ledger. The node helpers below read each node's OWN source file for that
52-
* reason. The census's last case pins the list's length and its sum over it.
52+
* reason. The census's first case holds its sum: the sites found are the ledgered ones.
5353
*/
5454

5555
import { describe, it, expect } from 'vitest';
@@ -236,7 +236,7 @@ describe('[#20338] census: every draft switch in rest-server.ts is ledgered', ()
236236
.toBe(`return isObjectSchemaMaskExempt(${param.name.getText(sf)});`);
237237
});
238238

239-
it('[#23050 slice 3] walks every file on the registrar list — its length and this sum are pinned', () => {
239+
it('[#23050 slice 3] walks every file on the registrar list', () => {
240240
// A module added to the list makes this re-read its number rather than
241241
// widening unnoticed. 8 switches, all in `rest-server.ts` (the `/meta`
242242
// and analytics doors); the data-action, batch and approval bodies read
@@ -285,8 +285,10 @@ describe('[#20338] census: every draft switch in rest-server.ts is ledgered', ()
285285
// `meta-item-history-routes.ts`, carrying no draft switch: neither door reads
286286
// one, so no ledger row changed:
287287
// 8 = 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 3 + 2 + 1 + 0 + 0, length 17 → 18.
288-
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18);
288+
// [#26433] Neither the list's length nor the sum is pinned here any more: the
289+
// list is the authority on the files, and the first case's ledger equality
290+
// holds the sum.
291+
expect(REST_SERVER_REGISTRAR_FILES.length).toBeGreaterThan(0);
289292
expect(SOURCE_FILES.map((file) => file.fileName)).toEqual([...REST_SERVER_REGISTRAR_FILES]);
290-
expect(SITES).toHaveLength(8);
291293
});
292294
});

‎packages/rest/src/rest-server-canonical-query-ast.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ interface CensusEntry {
123123
/**
124124
* [#23050 slice 3] Each registrar file's floor, its own measured `querySlots`
125125
* count: a file the split adds to the list needs a floor here before this
126-
* census reads it. The §1 controls pin the list's length and the census's sum
126+
* census reads it. The §1 controls pin the census's sum
127127
* over it (4 = 1 + 3 + 0 + 0; the batch and approval bodies build no `query:`
128128
* literal).
129129
*
@@ -403,7 +403,7 @@ describe('[#16638] §1 CONTROLS on the census instrument itself', () => {
403403
expect(wireKeysAnywhere('const a = { where: filter, limit: 2 };')).toEqual([]);
404404
});
405405

406-
it('[#23050 slice 3] censuses every file on the registrar list — its length and the slot sum are pinned', () => {
406+
it('[#23050 slice 3] censuses every file on the registrar list — the slot sum is pinned', () => {
407407
// A module added to the list makes this re-read its number rather than
408408
// widening unnoticed. [#23050 slice 4] Length 4 → 5, the sum unchanged.
409409
// [#23050 slice 5] Length 5 → 6, the sum unchanged.
@@ -425,7 +425,7 @@ describe('[#16638] §1 CONTROLS on the census instrument itself', () => {
425425
// carries no slot).
426426
// [#23050 slice 13e] Length 17 → 18, the sum unchanged (neither the object
427427
// state-machine read nor the published read carries a slot).
428-
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18);
428+
// [#26433] The list's length is no longer pinned: the list is the authority.
429429
expect(Object.keys(REGISTRAR_QUERY_SLOT_FLOORS).sort()).toEqual([...REST_SERVER_REGISTRAR_FILES].sort());
430430
expect(CENSUS.filter(({ file }) => REGISTRAR_SOURCES.has(file)).map(({ file }) => file))
431431
.toEqual([...REST_SERVER_REGISTRAR_FILES]);

‎packages/rest/src/rest-server-docblock-position.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe('rest-server.ts docblock position', () => {
141141
* floor is that module's own measured count — the batch and approval modules
142142
* carry three apiece (the module header, the host interface's block and the
143143
* function's) — and a module added to the list needs one here before it reads.
144-
* The case below the loop pins the list's length and the sum of the floors.
144+
* The case below the loop pins the sum of the floors.
145145
*
146146
* [#23050 slice 4] `sharing-routes.ts` carries eight: the module header, two
147147
* host interfaces' blocks and two functions' (it holds two registrars' bodies),
@@ -272,7 +272,7 @@ for (const { file, minBlocks } of MOVED_FILES) {
272272
}
273273

274274
describe('[#23050 slice 3] the registrar list this pin reads', () => {
275-
it('reads every module on it, each against its own floor — the length and the floors\' sum are pinned', () => {
275+
it('reads every module on it, each against its own floor — the floors\' sum is pinned', () => {
276276
// A module added to the list makes this re-read its numbers rather than
277277
// widening unnoticed: 4 + 3 + 3 = 10 blocks over the three modules.
278278
// [#23050 slice 4] 4 + 3 + 3 + 8 = 18 over four, length 4 → 5.
@@ -295,7 +295,7 @@ describe('[#23050 slice 3] the registrar list this pin reads', () => {
295295
// [#23050 slice 13e] 4 + 3 + 3 + 8 + 3 + 8 + 5 + 3 + 3 + 3 + 3 + 3 + 5 + 5 + 3 + 5 + 3 = 70
296296
// over seventeen, length 17 → 18 (`meta-item-history-routes.ts` 3 → 5: the
297297
// published read's host interface and function).
298-
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18);
298+
// [#26433] The list's length is no longer pinned: the list is the authority.
299299
expect(Object.keys(MOVED_FILE_FLOORS).sort())
300300
.toEqual(REST_SERVER_REGISTRAR_FILES.filter((file) => file !== FILE).sort());
301301
expect(MOVED_FILES.reduce((n, { minBlocks }) => n + minBlocks, 0)).toBe(70);

‎packages/rest/src/rest-server-query-number-census.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ const SOURCE = readFileSync(resolve(HERE, SOURCE_FILE), 'utf8');
7171
// function, never its file, so the ledger below did not change a row.
7272
// [#23050 slice 3] …and now every file on THE list of the files `RestServer`'s
7373
// registrars live in, imported rather than spelt here, so a registrar body the
74-
// split moves next stays inside this census. §2's last case pins the list's
75-
// length and the census's sum over it.
74+
// split moves next stays inside this census. §2's last case pins the census's
75+
// sum over it.
7676
const SOURCES: ReadonlyArray<readonly [string, string]> = REST_SERVER_REGISTRAR_FILES.map((file) =>
7777
[file, file === SOURCE_FILE ? SOURCE : readFileSync(resolve(HERE, file), 'utf8')] as const);
7878

@@ -303,7 +303,7 @@ describe('#20139 census — every numeric coercion in rest-server.ts is classifi
303303
}
304304
});
305305

306-
it('[#23050 slice 3] reads every file on the registrar list — its length and this sum are pinned', () => {
306+
it('[#23050 slice 3] reads every file on the registrar list — this sum is pinned', () => {
307307
// A module added to the list makes this re-read its number rather than
308308
// widening unnoticed. 9 sites = 8 in `rest-server.ts` + 1 in
309309
// `data-action-routes.ts` (the export door's `page`); the batch and
@@ -355,7 +355,7 @@ describe('#20139 census — every numeric coercion in rest-server.ts is classifi
355355
// judged as it came and its query value goes through the reader, so its
356356
// exemption row left the ledger with it:
357357
// 8 = 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0, length 18.
358-
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18);
358+
// [#26433] The list's length is no longer pinned: the list is the authority.
359359
expect(SOURCES.map(([file]) => file)).toEqual([...REST_SERVER_REGISTRAR_FILES]);
360360
expect(sites).toHaveLength(8);
361361
});

‎packages/rest/src/ui-view-route-identity.measurement.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ const SOURCE = readFileSync(resolve(HERE, 'rest-server.ts'), 'utf8');
8484
// `registerBatchEndpoints`' body moved to. [#23050 slice 3] …and every module
8585
// on THE list of the files RestServer's registrars live in, read off that list
8686
// (`rest-server-registrar-files.ts`) rather than named here, so the slice that
87-
// moves the next body widens these checks by adding its module there. The
88-
// reverse checks pin the list's length.
87+
// moves the next body widens these checks by adding its module there.
88+
// [#26433] The list's length is not pinned: the list is the authority.
8989
const REGISTRAR_SOURCES = REST_SERVER_REGISTRAR_FILES
9090
.map((file) => (file === 'rest-server.ts' ? SOURCE : readFileSync(resolve(HERE, file), 'utf8'))).join('\n');
9191
// [#23050 slice 10] `registerUiEndpoints`' BODY moved to `ui-routes.ts`; the
@@ -400,7 +400,7 @@ describe('[#13214] §1 the REST seam — absent context vs entitled context', ()
400400
// (which joined `meta-item-history-routes.ts`) calls `resolveExecCtx` or
401401
// `enforceAuth`, so neither host literal the inner method builds for them
402402
// forwards either, and no call site moved.
403-
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18);
403+
// [#26433] The list's length is no longer pinned: the list is the authority.
404404
expect(REGISTRAR_SOURCES.split('this.enforceAuth(').length - 1).toBeGreaterThan(40);
405405
expect(REGISTRAR_SOURCES.split('this.resolveExecCtx(').length - 1).toBeGreaterThan(40);
406406
});

‎packages/rest/src/ui-view-route-tenancy.measurement.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const SOURCE = readFileSync(resolve(HERE, 'rest-server.ts'), 'utf8');
105105
// `registerBatchEndpoints`' body moved to. [#23050 slice 3] …and every module
106106
// on THE list of the files RestServer's registrars live in, read off that list
107107
// (`rest-server-registrar-files.ts`) rather than named here, so the slice that
108-
// moves the next body widens these checks by adding its module there. The
109-
// reverse checks pin the list's length.
108+
// moves the next body widens these checks by adding its module there.
109+
// [#26433] The list's length is not pinned: the list is the authority.
110110
const REGISTRAR_SOURCES = REST_SERVER_REGISTRAR_FILES
111111
.map((file) => (file === 'rest-server.ts' ? SOURCE : readFileSync(resolve(HERE, file), 'utf8'))).join('\n');
112112
// [#23050 slice 10] `registerUiEndpoints`' BODY moved to `ui-routes.ts`; the
@@ -1177,7 +1177,7 @@ describe('[#13214] §4 preconditions', () => {
11771177
// `enforceAuth`, so neither host literal the inner method builds for them
11781178
// forwards either, and no call site moved. Neither calls the ownership
11791179
// guard, so it is still 1 call site and 1 forwarder.
1180-
expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18);
1180+
// [#26433] The list's length is no longer pinned: the list is the authority.
11811181
expect(REGISTRAR_SOURCES.split('this.enforceAuth(').length - 1).toBeGreaterThan(40);
11821182
expect(REGISTRAR_SOURCES.split('this.resolveExecCtx(').length - 1).toBeGreaterThan(40);
11831183
// ...and the ownership guard is NOT sprayed across the file — it is a

0 commit comments

Comments
 (0)