diff --git a/packages/rest/src/meta-draft-read-door-census.test.ts b/packages/rest/src/meta-draft-read-door-census.test.ts index a4ecbf1a23d..ee4f8054bae 100644 --- a/packages/rest/src/meta-draft-read-door-census.test.ts +++ b/packages/rest/src/meta-draft-read-door-census.test.ts @@ -49,7 +49,7 @@ * their own, and a door that reads a draft is no less a door there. A site's * key names its route or function, never its file, so the ledger is the same * ledger. The node helpers below read each node's OWN source file for that - * reason. The census's last case pins the list's length and its sum over it. + * reason. The census's first case holds its sum: the sites found are the ledgered ones. */ import { describe, it, expect } from 'vitest'; @@ -236,7 +236,7 @@ describe('[#20338] census: every draft switch in rest-server.ts is ledgered', () .toBe(`return isObjectSchemaMaskExempt(${param.name.getText(sf)});`); }); - it('[#23050 slice 3] walks every file on the registrar list — its length and this sum are pinned', () => { + it('[#23050 slice 3] walks every file on the registrar list', () => { // A module added to the list makes this re-read its number rather than // widening unnoticed. 8 switches, all in `rest-server.ts` (the `/meta` // 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', () // `meta-item-history-routes.ts`, carrying no draft switch: neither door reads // one, so no ledger row changed: // 8 = 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 3 + 2 + 1 + 0 + 0, length 17 → 18. - expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18); + // [#26433] Neither the list's length nor the sum is pinned here any more: the + // list is the authority on the files, and the first case's ledger equality + // holds the sum. + expect(REST_SERVER_REGISTRAR_FILES.length).toBeGreaterThan(0); expect(SOURCE_FILES.map((file) => file.fileName)).toEqual([...REST_SERVER_REGISTRAR_FILES]); - expect(SITES).toHaveLength(8); }); }); diff --git a/packages/rest/src/rest-server-canonical-query-ast.test.ts b/packages/rest/src/rest-server-canonical-query-ast.test.ts index d6cf5fa69bc..e77c74d7e27 100644 --- a/packages/rest/src/rest-server-canonical-query-ast.test.ts +++ b/packages/rest/src/rest-server-canonical-query-ast.test.ts @@ -123,7 +123,7 @@ interface CensusEntry { /** * [#23050 slice 3] Each registrar file's floor, its own measured `querySlots` * count: a file the split adds to the list needs a floor here before this - * census reads it. The §1 controls pin the list's length and the census's sum + * census reads it. The §1 controls pin the census's sum * over it (4 = 1 + 3 + 0 + 0; the batch and approval bodies build no `query:` * literal). * @@ -403,7 +403,7 @@ describe('[#16638] §1 CONTROLS on the census instrument itself', () => { expect(wireKeysAnywhere('const a = { where: filter, limit: 2 };')).toEqual([]); }); - it('[#23050 slice 3] censuses every file on the registrar list — its length and the slot sum are pinned', () => { + it('[#23050 slice 3] censuses every file on the registrar list — the slot sum is pinned', () => { // A module added to the list makes this re-read its number rather than // widening unnoticed. [#23050 slice 4] Length 4 → 5, the sum unchanged. // [#23050 slice 5] Length 5 → 6, the sum unchanged. @@ -425,7 +425,7 @@ describe('[#16638] §1 CONTROLS on the census instrument itself', () => { // carries no slot). // [#23050 slice 13e] Length 17 → 18, the sum unchanged (neither the object // state-machine read nor the published read carries a slot). - expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18); + // [#26433] The list's length is no longer pinned: the list is the authority. expect(Object.keys(REGISTRAR_QUERY_SLOT_FLOORS).sort()).toEqual([...REST_SERVER_REGISTRAR_FILES].sort()); expect(CENSUS.filter(({ file }) => REGISTRAR_SOURCES.has(file)).map(({ file }) => file)) .toEqual([...REST_SERVER_REGISTRAR_FILES]); diff --git a/packages/rest/src/rest-server-docblock-position.test.ts b/packages/rest/src/rest-server-docblock-position.test.ts index 83c3499b539..4fb14946df2 100644 --- a/packages/rest/src/rest-server-docblock-position.test.ts +++ b/packages/rest/src/rest-server-docblock-position.test.ts @@ -141,7 +141,7 @@ describe('rest-server.ts docblock position', () => { * floor is that module's own measured count — the batch and approval modules * carry three apiece (the module header, the host interface's block and the * function's) — and a module added to the list needs one here before it reads. - * The case below the loop pins the list's length and the sum of the floors. + * The case below the loop pins the sum of the floors. * * [#23050 slice 4] `sharing-routes.ts` carries eight: the module header, two * host interfaces' blocks and two functions' (it holds two registrars' bodies), @@ -272,7 +272,7 @@ for (const { file, minBlocks } of MOVED_FILES) { } describe('[#23050 slice 3] the registrar list this pin reads', () => { - it('reads every module on it, each against its own floor — the length and the floors\' sum are pinned', () => { + it('reads every module on it, each against its own floor — the floors\' sum is pinned', () => { // A module added to the list makes this re-read its numbers rather than // widening unnoticed: 4 + 3 + 3 = 10 blocks over the three modules. // [#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', () => { // [#23050 slice 13e] 4 + 3 + 3 + 8 + 3 + 8 + 5 + 3 + 3 + 3 + 3 + 3 + 5 + 5 + 3 + 5 + 3 = 70 // over seventeen, length 17 → 18 (`meta-item-history-routes.ts` 3 → 5: the // published read's host interface and function). - expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18); + // [#26433] The list's length is no longer pinned: the list is the authority. expect(Object.keys(MOVED_FILE_FLOORS).sort()) .toEqual(REST_SERVER_REGISTRAR_FILES.filter((file) => file !== FILE).sort()); expect(MOVED_FILES.reduce((n, { minBlocks }) => n + minBlocks, 0)).toBe(70); diff --git a/packages/rest/src/rest-server-query-number-census.test.ts b/packages/rest/src/rest-server-query-number-census.test.ts index 2e949caad89..7d016b9f57c 100644 --- a/packages/rest/src/rest-server-query-number-census.test.ts +++ b/packages/rest/src/rest-server-query-number-census.test.ts @@ -71,8 +71,8 @@ const SOURCE = readFileSync(resolve(HERE, SOURCE_FILE), 'utf8'); // function, never its file, so the ledger below did not change a row. // [#23050 slice 3] …and now every file on THE list of the files `RestServer`'s // registrars live in, imported rather than spelt here, so a registrar body the -// split moves next stays inside this census. §2's last case pins the list's -// length and the census's sum over it. +// split moves next stays inside this census. §2's last case pins the census's +// sum over it. const SOURCES: ReadonlyArray = REST_SERVER_REGISTRAR_FILES.map((file) => [file, file === SOURCE_FILE ? SOURCE : readFileSync(resolve(HERE, file), 'utf8')] as const); @@ -303,7 +303,7 @@ describe('#20139 census — every numeric coercion in rest-server.ts is classifi } }); - it('[#23050 slice 3] reads every file on the registrar list — its length and this sum are pinned', () => { + it('[#23050 slice 3] reads every file on the registrar list — this sum is pinned', () => { // A module added to the list makes this re-read its number rather than // widening unnoticed. 9 sites = 8 in `rest-server.ts` + 1 in // `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 // judged as it came and its query value goes through the reader, so its // exemption row left the ledger with it: // 8 = 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0, length 18. - expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18); + // [#26433] The list's length is no longer pinned: the list is the authority. expect(SOURCES.map(([file]) => file)).toEqual([...REST_SERVER_REGISTRAR_FILES]); expect(sites).toHaveLength(8); }); diff --git a/packages/rest/src/ui-view-route-identity.measurement.test.ts b/packages/rest/src/ui-view-route-identity.measurement.test.ts index bb2c15fda43..bf2ca5d9f43 100644 --- a/packages/rest/src/ui-view-route-identity.measurement.test.ts +++ b/packages/rest/src/ui-view-route-identity.measurement.test.ts @@ -84,8 +84,8 @@ const SOURCE = readFileSync(resolve(HERE, 'rest-server.ts'), 'utf8'); // `registerBatchEndpoints`' body moved to. [#23050 slice 3] …and every module // on THE list of the files RestServer's registrars live in, read off that list // (`rest-server-registrar-files.ts`) rather than named here, so the slice that -// moves the next body widens these checks by adding its module there. The -// reverse checks pin the list's length. +// moves the next body widens these checks by adding its module there. +// [#26433] The list's length is not pinned: the list is the authority. const REGISTRAR_SOURCES = REST_SERVER_REGISTRAR_FILES .map((file) => (file === 'rest-server.ts' ? SOURCE : readFileSync(resolve(HERE, file), 'utf8'))).join('\n'); // [#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', () // (which joined `meta-item-history-routes.ts`) calls `resolveExecCtx` or // `enforceAuth`, so neither host literal the inner method builds for them // forwards either, and no call site moved. - expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18); + // [#26433] The list's length is no longer pinned: the list is the authority. expect(REGISTRAR_SOURCES.split('this.enforceAuth(').length - 1).toBeGreaterThan(40); expect(REGISTRAR_SOURCES.split('this.resolveExecCtx(').length - 1).toBeGreaterThan(40); }); diff --git a/packages/rest/src/ui-view-route-tenancy.measurement.test.ts b/packages/rest/src/ui-view-route-tenancy.measurement.test.ts index 7c8be5bb545..336e4925268 100644 --- a/packages/rest/src/ui-view-route-tenancy.measurement.test.ts +++ b/packages/rest/src/ui-view-route-tenancy.measurement.test.ts @@ -105,8 +105,8 @@ const SOURCE = readFileSync(resolve(HERE, 'rest-server.ts'), 'utf8'); // `registerBatchEndpoints`' body moved to. [#23050 slice 3] …and every module // on THE list of the files RestServer's registrars live in, read off that list // (`rest-server-registrar-files.ts`) rather than named here, so the slice that -// moves the next body widens these checks by adding its module there. The -// reverse checks pin the list's length. +// moves the next body widens these checks by adding its module there. +// [#26433] The list's length is not pinned: the list is the authority. const REGISTRAR_SOURCES = REST_SERVER_REGISTRAR_FILES .map((file) => (file === 'rest-server.ts' ? SOURCE : readFileSync(resolve(HERE, file), 'utf8'))).join('\n'); // [#23050 slice 10] `registerUiEndpoints`' BODY moved to `ui-routes.ts`; the @@ -1177,7 +1177,7 @@ describe('[#13214] §4 preconditions', () => { // `enforceAuth`, so neither host literal the inner method builds for them // forwards either, and no call site moved. Neither calls the ownership // guard, so it is still 1 call site and 1 forwarder. - expect(REST_SERVER_REGISTRAR_FILES).toHaveLength(18); + // [#26433] The list's length is no longer pinned: the list is the authority. expect(REGISTRAR_SOURCES.split('this.enforceAuth(').length - 1).toBeGreaterThan(40); expect(REGISTRAR_SOURCES.split('this.resolveExecCtx(').length - 1).toBeGreaterThan(40); // ...and the ownership guard is NOT sprayed across the file — it is a