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
10 changes: 6 additions & 4 deletions packages/rest/src/meta-draft-read-door-census.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
});
});
6 changes: 3 additions & 3 deletions packages/rest/src/rest-server-canonical-query-ast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand Down Expand Up @@ -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.
Expand All @@ -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]);
Expand Down
6 changes: 3 additions & 3 deletions packages/rest/src/rest-server-docblock-position.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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.
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions packages/rest/src/rest-server-query-number-census.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<readonly [string, string]> = REST_SERVER_REGISTRAR_FILES.map((file) =>
[file, file === SOURCE_FILE ? SOURCE : readFileSync(resolve(HERE, file), 'utf8')] as const);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
});
Expand Down
6 changes: 3 additions & 3 deletions packages/rest/src/ui-view-route-identity.measurement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
});
Expand Down
6 changes: 3 additions & 3 deletions packages/rest/src/ui-view-route-tenancy.measurement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading