Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(migrations): renumber Wave B PR 2 migrations v251-v255 to v252-v256
garrytan4bd7a84124f4
diff --git a/docs/architecture/key-files/core-services-2-continued.md b/docs/architecture/key-files/core-services-2-continued.mdindex 8ee56f11e9..cdd4ac3d51 100644--- a/docs/architecture/key-files/core-services-2-continued.md+++ b/docs/architecture/key-files/core-services-2-continued.md@@ -22,7 +22,7 @@ The page-state concurrency foundation under `src/core/page-state/` and the share- `src/core/progressive-batch/` — shared ramp-up + cost-cap + verification primitive (trial 10 → ramp 100 → ramp 500 → full, with verification at each stage), with verifier+policy injection (callers describe HOW TO MEASURE SUCCESS, not WHEN TO WAIT FOR CTRL-C). Modules: `types.ts` (Stage, StageVerdict, AbortReason, discriminated `Verifier` union `OutputCountVerifier | IdempotentMutationVerifier | NoopVerifier`, Policy, StageReport), `orchestrator.ts` (`runProgressiveBatch(items, verifier, policy, runner)` — reads `getCurrentBudgetTracker()` ahead of `Policy.maxCostUsd` fail-closed; null both ways triggers `abort_cost_cap reason='no_budget_safety_net'`), `audit.ts` (ISO-week JSONL at `~/.gbrain/audit/progressive-batch-YYYY-Www.jsonl` via the shared `audit-writer` primitive), `stage-report.ts` (ASCII formatter for the default `Policy.onStageReport`). Env knobs: `GBRAIN_PROGRESSIVE_BATCH_DISABLED=1`, `GBRAIN_PROGRESSIVE_BATCH_AUTO=1` (skip Ctrl-C grace), `GBRAIN_PROGRESSIVE_BATCH_STAGES=10,100,500`. Sites that "jump straight to full" stay that way by default; ramp is opt-in per-site via `Policy.interactiveAbortMs > 0`. Pinned by `test/progressive-batch/orchestrator.test.ts` (35 cases, every verdict path).- `src/core/page-body/page-shape.ts` — Wave B PR 1 (spec 1.5): segmented page bodies are unreachable as strings. `guardSegmentedBody` (called by `rowToPage` for a row with `body_storage = 'segmented'`, so by every snapshot and `getPage` read) replaces `compiled_truth` / `timeline` with enumerable getters and setters that throw `page_body_segmented`, so property reads, spread, `JSON.stringify`, `structuredClone` and assignment all fail loud instead of seeing an empty body. `isSegmentedPage`, `assertInlineBody(page, site)` (explicit refusal where a writer would otherwise act before a getter fires, e.g. SQL-only writers; every `page_body_segmented` refusal's fix reads the page with `get_page body: 'auto'`), `pageBodyBytes(page)` (`body_bytes` for segmented pages), `pageBodySegmentedError` and `pageBodyOverCeilingError` (the refusal of a fence or timeline write through the put path on a page over 24 MiB; `wholeBodySnapshot` in `persistence/segmented-apply.ts` reads a page within it back as strings and refuses above it: semantic timeline writes, `takes-prepare.ts`, `facts-prepare.ts`, `reconcile-state.ts`, `gbrain core`). Tag writes on a segmented page never read the body: `prepareSegmentedTagMutation` (`persistence/page-prepare.ts`) flips them in metadata over the live manifest (`test/large-pages/segmented-semantic-writes.test.ts`). `bodyUnread(page)` says a segmented page's body was not read back as strings (over the single-string ceiling, see `materializedPage`); such a body was written by the streamed import, which holds fenced files, so `fenceBody(page)` reads it as empty for the fence merges and `withoutBody(page)` copies the page's other fields for a render whose body comes from the incoming write (a shrunk file rewrites such a page: `test/large-pages/segmented-shrink-below-ceiling.test.ts`). `Page` stays one shape (`body_storage?`, `body_bytes?`); the static half is `scripts/check-page-body-readers.ts` with `scripts/page-body-readers-baseline.tsv` (docs/TESTING.md#page-body-readers). Pinned by `test/large-pages/segmented-body-unreachable.test.ts`.-- `src/core/page-body/limits.ts` — Wave B size classes, ceilings, retention numbers and config keys in one place. `readPageBodyPolicy` is the single question every write asks: `segmented` is the effective `pages.segmented_storage` (unset means `SEGMENTED_STORAGE_DEFAULT`, `off` in this release; `off` or an unrecognized value is off; held off while `segmentedWriterBlockers` finds a recent writer that blocks, and an unreadable gate counts as blocked), `maxBytes` the engine ceiling (256 MiB Postgres, 128 MiB PGLite, lowered by `pages.max_bytes`) while on and `PAGE_MAX_BYTES` while off. Config is read per call; only the writer gate is cached (`SEGMENTED_WRITER_GATE_TTL_MS`, `_resetSegmentedWriterGateForTests`). `chooseBodyStorage` applies the 1 MiB / 512 KiB hysteresis. The writer gate (`segmentedGateWriters` in `persistence/writer-versions.ts`) reads seven days of admitted requests in any state, committed publications, `ingest_log` rows and, on Postgres, `persistence_consumers` heartbeats; a row blocks when its version is below `SEGMENTED_WRITER_FLOOR` or unparsable, or when it lacks the segment-reader mark (migration v253: `admitter_segment_reader`, `consumer_segment_reader`, `persistence_consumers.segment_reader`, `ingest_log.writer_segment_reader`), because releases 0.60.252.0-0.60.262.0 have no segment readers and a version string cannot tell them apart. Not seen: an older binary's unmanaged single-page write, a run that dies before it logs, and read-only or export use. `pageRecoveryBytes` is the default `persistence.limits.worktree_recovery_bytes` (read by `persistence/limits.ts` `readJournalLimits` in its one config statement): twice the body the configured switch admits (`segmentedMaxBytes`, or `PAGE_MAX_BYTES` while off) plus `RECOVERY_FILE_HEADROOM_BYTES` per copy, never below 256 MiB, because a restore reserves its file twice; it ignores the writer gate so a page admitted while the switch was effective stays restorable. Tests: `test/large-pages/segmented-switch.test.ts`, `test/large-pages/recovery-budget-default.test.ts`.+- `src/core/page-body/limits.ts` — Wave B size classes, ceilings, retention numbers and config keys in one place. `readPageBodyPolicy` is the single question every write asks: `segmented` is the effective `pages.segmented_storage` (unset means `SEGMENTED_STORAGE_DEFAULT`, `off` in this release; `off` or an unrecognized value is off; held off while `segmentedWriterBlockers` finds a recent writer that blocks, and an unreadable gate counts as blocked), `maxBytes` the engine ceiling (256 MiB Postgres, 128 MiB PGLite, lowered by `pages.max_bytes`) while on and `PAGE_MAX_BYTES` while off. Config is read per call; only the writer gate is cached (`SEGMENTED_WRITER_GATE_TTL_MS`, `_resetSegmentedWriterGateForTests`). `chooseBodyStorage` applies the 1 MiB / 512 KiB hysteresis. The writer gate (`segmentedGateWriters` in `persistence/writer-versions.ts`) reads seven days of admitted requests in any state, committed publications, `ingest_log` rows and, on Postgres, `persistence_consumers` heartbeats; a row blocks when its version is below `SEGMENTED_WRITER_FLOOR` or unparsable, or when it lacks the segment-reader mark (migration v254: `admitter_segment_reader`, `consumer_segment_reader`, `persistence_consumers.segment_reader`, `ingest_log.writer_segment_reader`), because releases 0.60.252.0-0.60.262.0 have no segment readers and a version string cannot tell them apart. Not seen: an older binary's unmanaged single-page write, a run that dies before it logs, and read-only or export use. `pageRecoveryBytes` is the default `persistence.limits.worktree_recovery_bytes` (read by `persistence/limits.ts` `readJournalLimits` in its one config statement): twice the body the configured switch admits (`segmentedMaxBytes`, or `PAGE_MAX_BYTES` while off) plus `RECOVERY_FILE_HEADROOM_BYTES` per copy, never below 256 MiB, because a restore reserves its file twice; it ignores the writer gate so a page admitted while the switch was effective stays restorable. Tests: `test/large-pages/segmented-switch.test.ts`, `test/large-pages/recovery-budget-default.test.ts`.- `src/core/page-body/read-range.ts` + `segment-projection.ts` + `segment-ledger.ts` — Wave B PR 2 (spec 7.1, 7.3): the segment reader. `openSegmentedBody` reads a page's live manifest rows and its withdrawal ledger (`readBodyLedger`); `readBodyRange(engine, { pageId, space, start, end, audience, region?, body? })` streams pieces one segment text at a time, never the whole body. Remote reads and every projected-space read serve the read projection: `projectSegment` projects whole segments from their stored protected regions (takes, truncated tail and markers out, keys as the projection token, facts regions rendered world-only and credential-projected), after the withdrawal overlay (`overlaySegmentText`; a fence split by a forced cut is omitted for reads and refuses a trusted read) and the fence overlay (held and purged rows out, rows below the page tier in the low-tier block after the truth). A transform or stale metadata recomputes the regions from the segment's entry state; with none usable the read refuses `page_projection_stale`, never raw text. Trusted stored-space reads give the overlaid stored stream. `projectedLayout` (cached on the handle), `projectedUnits` (rows and fixed text in projected order, for `page-window/segmented.ts`), `projectedTotals`, `projectedLineStart` and `projectedOutline` (outline from stored metadata, no segment text) locate projected bytes; the concatenation equals `projectPageText` of the joined body byte for byte except where a facts fence is longer than a segment (shows less). The chunker (`segment-chunks.ts`) chunks the same projection, so sealed segmented pages carry `MARKDOWN_CHUNKER_VERSION`; `sealSegmentedPage` indexes the overlaid, sanitized timeline lead. Pinned by `test/large-pages/projection-parity.test.ts`, `remote-window-privacy.test.ts` and `sealed-segmented-search.test.ts` (fixture `test/helpers/segmented-privacy-fixture.ts`).- `src/core/page-body/segment-rewrite.ts` — fence rewrites of a segmented body without holding it as one string (forget strikes, purge drops). Only stored `facts`/`takes` protected regions are decoded and passed, in body order with their region, to a `FenceTransform` (a region crossing forced cuts is joined with its neighbours, refused above `PAGE_MAX_BYTES`). `rewriteLiveSegmentedFences` re-stages the live body through `prepareSegmentedBody` from the segment stream with the changed units replaced and flips it in the caller's transaction (trust tier and soft delete kept; null when nothing changed); `rewriteSegmentedGeneration` rebuilds one retained generation under its own number and updates its versions' hash and size; `rewrittenContentHash` streams the hash of a rewritten generation; `segmentedBodyContains` searches a body segment by segment with the previous segment's tail carried over. Tests: `test/large-pages/purge-segments.test.ts`, `forget-scope.test.ts`, `page-purge-segments.test.ts`.- `src/core/page-body/segment-blocks.ts` + `segment-links.ts` + `segment-takes.ts` — Wave B PR 2 (spec 8, full-pass mode): the derived passes over a segmented body, O(page) work and O(segment) memory, not yet incremental. `bodyBlocks(engine, page, { regions?, separator?, want? })` yields the trusted, withdrawal-overlaid joined body one block at a time (a segment, or a run joined across forced cuts, refused above `BLOCK_MAX_BYTES` with `page_body_segmented`; `want` skips a run unread), so each block starts where the parsers start fresh; `truthLead` reads a bounded lead; `readGarbageCollector` forces a collection every 4 MiB read; `detachedValue` copies a result kept past its block so it pins no segment text; `segmentedPassWork` counts the passes' work for the linearity test. `extractSegmentedPageLinks` runs `extractBodyLinks` over each block in a window (`bodyWindows`: the whole blocks before it, 4096 chars after, the headings still open), with the role phrases a first pass found (`segmentedRoleText`), and merges candidates in `extractPageLinks` order, plus the temporal inputs (`TemporalBody`). `parseTakesFenceBlocks` gives `parseTakesFence` of the joined body. Consumers: link preparation and the links effect, stale-links maintenance, source reconciliation, the sweep, `extract links|timeline|takes --source db`, `extract --stale` (the stale list includes segmented pages since PR 2 fix lane J1; test `test/large-pages/segmented-extraction-stale.test.ts`), the mention pass (`pageMentions`), the canonical prior view (`segmentedPriorView`), `segmentedTimelineText`, the chronicle judge and the facts planner (`planSegmentedExtraction`). Tests: `test/large-pages/segmented-derived-parity.test.ts`, `segmented-derived-passes.test.ts`, `segmented-derived-linear.test.ts`, `segmented-derived-memory.slow.test.ts`, `segmented-derived-work.test.ts`. `segment-lines.ts` serves the line-local maintenance scans: `bodyLines` yields the joined text's complete lines a block at a time (a line cut by a block boundary is carried, counted in `segmentedPassWork.carry`), consumed by `gbrain integrity` and `reconcile-links`; `segmentedRegionContains` searches one region for literal markers across block boundaries (repair `connector-fences`). Test: `test/large-pages/segmented-maintenance-commands.test.ts`.@@ -32,4 +32,4 @@ The page-state concurrency foundation under `src/core/page-state/` and the share- `src/core/page-window/bounded-lead.ts` — leads, snippets and synopses read a bounded prefix, never the whole body: fan-out SQL selects `boundedBodyPrefixSql(alias)` (`left(coalesce(alias.compiled_truth, alias.truth_lead), 65536)`: a segmented page's NULL body falls back to its stored lead; the one COALESCE of body and lead the page body reader ratchet allows by name), `boundedRawPrefix` cuts a body at 64 KiB on a code point, and `overlaidBoundedRows` / `overlaidBoundedPrefix` replace a prefix holding a `gbrain:facts:begin` marker with the prefix of the withdrawal-overlaid body (one batched `readPageSnapshotsBatch` read; a page it no longer returns, or a failed read, gets an empty lead). A segmented page's row carries its stored `truth_lead`; when that lead holds a facts fence it is overlaid alone with the withdrawal ledger the snapshot read returns (`overlayCanonicalBodies`, then the same 64 KiB cut), never by reading segments. `pageLeadSource` gives getPage callers (exact-slug and alias snippets) a page's compiled truth, or a segmented page's `truth_lead` without touching its throwing body getters. `projectedLead` is that prefix through `boundedProjectedPrefix` (`document.ts`). Consumers: the exact-slug tier (`exact-lookup.ts`) and alias injection (`alias-hop.ts`) snippets, relational hydrate, the reflex pointer synopsis (`retrieval-reflex.ts` `safeSynopsis`: world-only reads take the projected prefix, the trusted entity-card widening the raw prefix through its own fence strip), the entity card's hit row and `entity names` leads, and think's anchor and window-floor rows (`think/gather.ts`: the raw overlaid prefix for the trusted local CLI, the projected prefix otherwise). Small pages render as before. Pinned by `test/bounded-lead.test.ts` and `test/large-pages/segmented-leads.test.ts`.- `src/core/page-window/document.ts` — the one read projection every remote window, outline and lead slices: `projectPageText` (fence overlay split, `sanitizeRemoteBody` + `credentialSafeProjection`, timeline after `TIMELINE_SEPARATOR`), `pageDocument` / `readPageDocument` (UTF-8 bytes + timeline byte offset, with the page's fence overlay), `chunkDocumentSpan` + `spanHoldsChunk` (a chunk's stored `projected_byte_*` span mapped into the document and verified), `boundedProjectedPrefix`, `locateChunksByStoredSpans` (byte spans to string offsets in one pass), `DEFAULT_INLINE_BODY_BYTES` (256 KB).- `src/core/page-window/window.ts` — byte/line window arithmetic on a UTF-8 buffer: windows snap to code points and line starts (`windowFrom`, `windowForLines`, `windowForBytes`, `windowAround`; a lone line longer than the window is cut on a code point as `forced_cut`), `pageOutline` (single pass: ATX headings outside code fences, or 64 KiB blocks for pages with fewer than two headings, with date ranges, paged by `from`/`limit`), and the opaque revision-bound cursor (`gpw1.`). `DocumentSlab` / `slabWindow` run the same arithmetic on a slice of a larger document and shift the result back to document coordinates.-- `src/core/page-window/segmented.ts` — Wave B PR 2 (spec 7.2, 7.4): get_page over a segmented page in projected bytes, the same coordinates as an inline page. `SegmentedDocument` places units (segments from `projectedUnits` plus fixed text) by stored sums and reads only the units a window, line lookup or `around_chunk_id` touches (`slab` adds `EDGE` bytes so code-point and line snapping match the inline arithmetic). `segmentedReadDocument` is the read projection; `segmentedMarkdownDocument` the markdown view (`markdownHead`, then the projection for a remote caller, the overlaid stored body and `TIMELINE_SEPARATOR` for a trusted one). `page_view_digests` (migration v252) caches per page revision, view and audience the read view's line count and the markdown view's size and sha256, checked against the current total. `tailDigest` hashes the last `TAIL_BYTES` raw bytes of the last region, withheld from a remote caller when those rows hold a protected or facts region. `segmentedOutline` pages headings from stored metadata, reading at most `OUTLINE_READ_BYTES` of segments per page and carrying line counts forward between entries. `segmentedReadWork` (@internal) counts the units and segment bytes a read visits, for the read-cost bounds. `cli/page-render.ts` uses it for the local `gbrain get` stream (`streamSegmentedGet`); the thin client pages and verifies the markdown view (`printPagedPage`), and `--json` above `PAGE_MAX_BYTES` is refused on both paths. Pinned by `test/large-pages/segmented-get-page-parity.test.ts`, `read-cost.test.ts`, `remote-get-page-privacy.test.ts`, `segmented-get-cli.test.ts` and `segmented-get-over-ceiling.test.ts`.+- `src/core/page-window/segmented.ts` — Wave B PR 2 (spec 7.2, 7.4): get_page over a segmented page in projected bytes, the same coordinates as an inline page. `SegmentedDocument` places units (segments from `projectedUnits` plus fixed text) by stored sums and reads only the units a window, line lookup or `around_chunk_id` touches (`slab` adds `EDGE` bytes so code-point and line snapping match the inline arithmetic). `segmentedReadDocument` is the read projection; `segmentedMarkdownDocument` the markdown view (`markdownHead`, then the projection for a remote caller, the overlaid stored body and `TIMELINE_SEPARATOR` for a trusted one). `page_view_digests` (migration v253) caches per page revision, view and audience the read view's line count and the markdown view's size and sha256, checked against the current total. `tailDigest` hashes the last `TAIL_BYTES` raw bytes of the last region, withheld from a remote caller when those rows hold a protected or facts region. `segmentedOutline` pages headings from stored metadata, reading at most `OUTLINE_READ_BYTES` of segments per page and carrying line counts forward between entries. `segmentedReadWork` (@internal) counts the units and segment bytes a read visits, for the read-cost bounds. `cli/page-render.ts` uses it for the local `gbrain get` stream (`streamSegmentedGet`); the thin client pages and verifies the markdown view (`printPagedPage`), and `--json` above `PAGE_MAX_BYTES` is refused on both paths. Pinned by `test/large-pages/segmented-get-page-parity.test.ts`, `read-cost.test.ts`, `remote-get-page-privacy.test.ts`, `segmented-get-cli.test.ts` and `segmented-get-over-ceiling.test.ts`.diff --git a/scripts/postgres-arm-weights.json b/scripts/postgres-arm-weights.jsonindex aeb449f366..d1fdeed08b 100644--- a/scripts/postgres-arm-weights.json+++ b/scripts/postgres-arm-weights.json@@ -155,7 +155,7 @@"test/large-pages/segmented-versions.test.ts": 6439,"test/large-pages/segmented-withdrawn-fence-delete.test.ts": 49155,"test/large-pages/streamed-import-drift.test.ts": 31552,- "test/large-pages/v251-master-reader-compat.test.ts": 6029,+ "test/large-pages/v252-master-reader-compat.test.ts": 6029,"test/link-cross-source.test.ts": 11815,"test/link-preparation-shared-index.test.ts": 8386,"test/links-attendance-blocked.test.ts": 5638,diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex 6cd56a97e3..e05b21cd47 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -740,7 +740,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }{ since: 'TBD', text: '`remember` whose entity page (named, or inferred from the fact) is stored in segments over 24 MiB refuses with code `page_body_segmented` (wire error `invalid_params`, not retryable) and a fix that saves the claim without an entity, instead of `unavailable` / `storage_error`, or of silently saving an inferred subject without its entity. A segmented entity up to 24 MiB now links when it is inferred, as it does when named.' },{ since: 'TBD', text: '`get_page` with `body: "full"` (or `include_content`) on a page stored in segments refuses with `page_body_segmented` for local and MCP callers alike (MCP callers got `invalid_params` / `page_too_large_for_inline`; gbrain\'s thin client keeps paging on that one), and every `page_body_segmented` fix now reads the page with `body: "auto"` instead of `body: "none"`. `grammar_diagnostics` on such a page returns `line_grammar: {state: "skipped", reason: "page_body_segmented"}` instead of failing the read, and the `entity` card is built from the page\'s first 64 KiB.' },{ since: 'TBD', text: '`gbrain import` of a Markdown file over 24 MiB from outside its source root now says in the error itself to move the file into the source root and import it there, naming the target path.' },- { since: 'TBD', text: 'Upgrading builds the index `content_chunks_occurrence_generation_idx` (migration v255): on Postgres online (`CREATE INDEX CONCURRENTLY`; reads and writes go on while it builds), on PGLite as a plain build that holds writes until it ends. It took 0.8 s for 1M chunk rows on Postgres and 0.35 s on a PGLite brain holding a 100 MB page. With it, rebuilding the search projection of a page stored in segments (after a crash, for embedding readiness, by the projection job or `gbrain projections drain`) reads in proportion to the chunk rows it retires and the page\'s segments instead of every chunk row times its newer rows: a 26 MB page half rewritten by a replace read 2.2M buffers to select its stale rows, now 1.8k.' },+ { since: 'TBD', text: 'Upgrading builds the index `content_chunks_occurrence_generation_idx` (migration v256): on Postgres online (`CREATE INDEX CONCURRENTLY`; reads and writes go on while it builds), on PGLite as a plain build that holds writes until it ends. It took 0.8 s for 1M chunk rows on Postgres and 0.35 s on a PGLite brain holding a 100 MB page. With it, rebuilding the search projection of a page stored in segments (after a crash, for embedding readiness, by the projection job or `gbrain projections drain`) reads in proportion to the chunk rows it retires and the page\'s segments instead of every chunk row times its newer rows: a 26 MB page half rewritten by a replace read 2.2M buffers to select its stale rows, now 1.8k.' },{ since: 'TBD', text: 'Maintenance on pages stored in segments: `gbrain repair timeline` (and `repair --all`) no longer crashes on one; it repairs inline pages and reports segmented pages carrying timeline rows as `segmented_pages` / `segmented_rows` with their slugs, and doctor `timeline_history` counts them separately without recommending a repair for them. `repair timeline-comments`, `connector-fences`, `split-facts` and `conversation-labels` report the segmented pages they do not handle instead of skipping them silently, and a repair item refused with `page_body_segmented` is listed in `failed[]` while the run goes on. `gbrain integrity check` / `integrity auto` and `gbrain reconcile-links` read a segmented page block by block and give the results its text gives inline; `gbrain reindex --aliases` derives its aliases as its import did; `gbrain quarantine scan` lists it under `skipped` (not re-checked). A page one of these commands cannot read is listed under `skipped` and the run goes on.' },{ since: 'TBD', text: '`delete_page` (soft and `purge: true`), `restore_page`, `gbrain delete` and `gbrain restore` now work on a page over 24 MiB on a source backed by files: the file is compared with the page by digest, streamed, and a file edited on disk still refuses as before. Restoring such a page clears its deletion without re-importing it and writes its file back from the database. Its chunks and keyword index come back with it: a page whose chunks were complete is searchable when the restore commits, and one whose chunks were never built (or whose old chunks still wait to be removed) is queued, built right after the commit, and built by `gbrain projections drain` if that build dies. The restore adds no text, so it does not rescan the body with the write gate, stamp a new trust tier or fold the timeline again; the 25 MiB pre-push scan cap on written files still applies, and a core page or an external_untrusted writer still refuses.' },{ since: 'TBD', text: 'A write that stores a page in segments says in its receipt whether search sees it: `searchable: true` when it commits (every new page up to 4 MiB and every rewrite), or `searchable: "pending"` for a larger new page while its chunks are built after commit, with `searchable_retry_after_ms` and a `searchable_fix` that reads the receipt again (`get_write_request`) until it says `searchable: true`. A new page up to 4 MiB was previously searchable only once a post-commit build finished.' },diff --git a/src/core/page-body/projection.ts b/src/core/page-body/projection.tsindex b2595ece3a..3bdf632831 100644--- a/src/core/page-body/projection.ts+++ b/src/core/page-body/projection.ts@@ -51,7 +51,7 @@ async function readProjectionPage(engine: Pick<BrainEngine, 'executeRaw'>, ref:/*** Chunk rows of page $1 that generation $2 (live occurrences $3) does not hold: inline rows, rows of other occurrences,* and older duplicates of a live occurrence (any row of it below its newest generation at or below $2). Walks the page's- * occurrences on content_chunks_occurrence_generation_idx (v255), one index probe per occurrence plus the stale rows it+ * occurrences on content_chunks_occurrence_generation_idx (v256), one index probe per occurrence plus the stale rows it* returns, so the work is the page's occurrence count and the rows it retires, never its chunk count times anything: the* earlier form tested each row for a newer duplicate with a per-row subquery, which scanned every newer row of the page.*/diff --git a/src/core/page-body/schema.ts b/src/core/page-body/schema.tsindex d0c8c95d88..bb676f2e57 100644--- a/src/core/page-body/schema.ts+++ b/src/core/page-body/schema.ts@@ -47,7 +47,7 @@ END;$func$ LANGUAGE plpgsql;`;/**- * The segment texts each staging staged or deduped onto (migration v254). A create keeps its manifest rows in memory+ * The segment texts each staging staged or deduped onto (migration v255). A create keeps its manifest rows in memory* until it publishes and a replace stages its texts before its manifest rows, so this is the only durable record of* which texts a live staging still needs: a page purge keeps exactly those of the texts no manifest row references.* Rows go with their staging; they hold hashes, never text.diff --git a/src/core/persistence/writer-versions.ts b/src/core/persistence/writer-versions.tsindex cd9ccb788d..27f8853d5f 100644--- a/src/core/persistence/writer-versions.ts+++ b/src/core/persistence/writer-versions.ts@@ -14,7 +14,7 @@ export const UNSTAMPED_WRITER = 'unstamped (binary older than this release)';* switch on (the `since` of its BEHAVIOR_CHANGES row, pinned by test/large-pages/segmented-switch.test.ts). That* release must be above v0.60.252.0, the release that added segmented storage with the switch off. A version alone* cannot tell a build with segment readers from a release of the same version without them (every release from- * v0.60.252.0 until the stamp has none), so the gate also requires the segment-reader mark (migration v253) on+ * v0.60.252.0 until the stamp has none), so the gate also requires the segment-reader mark (migration v254) on* every write it sees: an unmarked writer blocks whatever its version, the floor included (`segmentedGateWriters`).*/export const SEGMENTED_WRITER_FLOOR = '0.60.264.0';@@ -41,7 +41,7 @@ export function writerVersionBelowFloor(version: string | null, floor = WRITER_V/*** This binary's stamp. An unavailable host identity stamps no host rather than failing the write; `mint: false` (the* ingest log, written by commands that never register a writer) reads an existing identity and never creates one.- * Every write path that stamps it also sets the segment-reader mark (migration v253), which only binaries that read+ * Every write path that stamps it also sets the segment-reader mark (migration v254), which only binaries that read* segmented pages write: a version string cannot tell a build with segment readers from a release of the same* version without them.*/@@ -107,14 +107,14 @@ export interface SegmentedGateWriter {*/role: 'admitter' | 'consumer' | 'importer' | 'resident';host_id: string | null; principal: string; version: string | null; version_label: string;- /** The rows carried the segment-reader mark (migration v253), which only binaries that read segmented pages write. */+ /** The rows carried the segment-reader mark (migration v254), which only binaries that read segmented pages write. */segment_reader: boolean;last_seen: string | null; requests: number;}/*** Writers seen in the last `days` that keep segmented storage off: evidence without the segment-reader mark (an- * older binary inserts NULL into a column it does not know; rows from before v253 count too), or a managed write+ * older binary inserts NULL into a column it does not know; rows from before v254 count too), or a managed write* stamped below `floor` (an unparsable or missing stamp counts as below). Admitters count in any state, so a* failed or still-queued request of an older binary is seen as well; ingest-log and consumer rows are read only* when unmarked (ingest_log_unmarked_idx). Not seen: an older binary that writes neither a request nor andiff --git a/src/core/pglite-engine.ts b/src/core/pglite-engine.tsindex 1787721c3b..edcbd239b4 100644--- a/src/core/pglite-engine.ts+++ b/src/core/pglite-engine.ts@@ -2758,7 +2758,7 @@ export class PGLiteEngine implements BrainEngine {// v0.31.2 (codex P1 #3): source_id threaded so multi-source brains can// scope ingest_log queries. Default 'default' matches the column DEFAULT.const sourceId = entry.source_id ?? 'default';- // v253: the writer's version, host and segment-reader mark (writer-versions.ts writerStamp).+ // v254: the writer's version, host and segment-reader mark (writer-versions.ts writerStamp).const stamp = writerStamp({ mint: false });await this.db.query(`INSERT INTO ingest_log (source_id, source_type, source_ref, pages_updated, summary, writer_version, writer_host_id, writer_segment_reader)diff --git a/src/core/postgres-engine.ts b/src/core/postgres-engine.tsindex 97f1d74cf3..2e9f84b425 100644--- a/src/core/postgres-engine.ts+++ b/src/core/postgres-engine.ts@@ -2566,7 +2566,7 @@ export class PostgresEngine implements BrainEngine {// v0.31.2 (codex P1 #3): source_id threaded so multi-source brains can// scope ingest_log queries. Default 'default' matches the column DEFAULT.const sourceId = entry.source_id ?? 'default';- // v253: the writer's version, host and segment-reader mark (writer-versions.ts writerStamp).+ // v254: the writer's version, host and segment-reader mark (writer-versions.ts writerStamp).const stamp = writerStamp({ mint: false });await sql`INSERT INTO ingest_log (source_id, source_type, source_ref, pages_updated, summary, writer_version, writer_host_id, writer_segment_reader)diff --git a/src/core/schema-embedded.generated.ts b/src/core/schema-embedded.generated.tsindex 48f343879c..ded1541645 100644--- a/src/core/schema-embedded.generated.ts+++ b/src/core/schema-embedded.generated.ts@@ -350,7 +350,7 @@ CREATE TABLE IF NOT EXISTS content_chunks (-- (segmented-page chunks; NULL for inline pages) and-- content_chunks_occurrence_idx are added the same way, and so is v248's-- retired_generation, which nothing writes or reads but released chunk readers- -- still select (v251 keeps it and adds content_chunks_generation_idx; v255+ -- still select (v252 keeps it and adds content_chunks_generation_idx; v256-- adds content_chunks_occurrence_generation_idx for chunk retirement).-- #4246 (v133): md5(chunk_text) at embed time. NULL = no embedding or-- pre-v133 row (grandfathered by invalidateContentDriftEmbeddings).@@ -683,7 +683,7 @@ CREATE TABLE IF NOT EXISTS ingest_log (pages_updated JSONB NOT NULL DEFAULT '[]',summary TEXT NOT NULL DEFAULT '',created_at TIMESTAMPTZ NOT NULL DEFAULT now(),- -- Migration v253: the writing binary's version, host and segment-reader mark (NULL from a binary older than v253).+ -- Migration v254: the writing binary's version, host and segment-reader mark (NULL from a binary older than v254).writer_version TEXT,writer_host_id UUID,writer_segment_reader BOOLEAN@@ -2015,7 +2015,7 @@ CREATE TABLE IF NOT EXISTS page_extraction_state ();CREATE INDEX IF NOT EXISTS page_extraction_state_truncated_idxON page_extraction_state (pipeline, page_id) WHERE input_truncated IS NOT NULL;--- Wave B segmented pages (migration v252): get_page view sizes and digests per+-- Wave B segmented pages (migration v253): get_page view sizes and digests per-- page revision and audience (src/core/page-window/segmented.ts).CREATE TABLE IF NOT EXISTS page_view_digests (page_id INTEGER NOT NULL REFERENCES pages(id) ON DELETE CASCADE,diff --git a/src/core/schema-migrations/latest.generated.ts b/src/core/schema-migrations/latest.generated.tsindex bfd4683ece..f656de705e 100644--- a/src/core/schema-migrations/latest.generated.ts+++ b/src/core/schema-migrations/latest.generated.ts@@ -4,4 +4,4 @@// The highest schema migration version (migrate.ts LATEST_VERSION), importable without// loading the migrations themselves.-export const LATEST_SCHEMA_VERSION = 255;+export const LATEST_SCHEMA_VERSION = 256;diff --git a/src/core/schema-migrations/registry.generated.ts b/src/core/schema-migrations/registry.generated.tsindex bd9228f81b..74baf9e9a6 100644--- a/src/core/schema-migrations/registry.generated.ts+++ b/src/core/schema-migrations/registry.generated.ts@@ -251,11 +251,11 @@ import { v247 } from './v247-page-extraction-state.ts';import { v248 } from './v248-segmented-page-storage.ts';import { v249 } from './v249-belief-ledger.ts';import { v250 } from './v250-persistence-request-id-index.ts';-import { v251 } from './v251-segmented-chunk-gc-index.ts';-import { v252 } from './v252-page-view-digests.ts';-import { v253 } from './v253-segment-reader-marks.ts';-import { v254 } from './v254-page-body-staging-texts.ts';-import { v255 } from './v255-chunk-retirement-index.ts';+import { v252 } from './v252-segmented-chunk-gc-index.ts';+import { v253 } from './v253-page-view-digests.ts';+import { v254 } from './v254-segment-reader-marks.ts';+import { v255 } from './v255-page-body-staging-texts.ts';+import { v256 } from './v256-chunk-retirement-index.ts';// Array order is historical (see HISTORICAL_ARRAY_ORDER in the generator); the// runner sorts by version before applying.@@ -505,9 +505,9 @@ export const MIGRATIONS: Migration[] = [v248,v249,v250,- v251,v252,v253,v254,v255,+ v256,];diff --git a/src/core/schema-migrations/v251-segmented-chunk-gc-index.ts b/src/core/schema-migrations/v252-segmented-chunk-gc-index.tssimilarity index 90%rename from src/core/schema-migrations/v251-segmented-chunk-gc-index.tsrename to src/core/schema-migrations/v252-segmented-chunk-gc-index.tsindex 67c39e1f2d..252f9e3512 100644--- a/src/core/schema-migrations/v251-segmented-chunk-gc-index.ts+++ b/src/core/schema-migrations/v252-segmented-chunk-gc-index.ts@@ -11,8 +11,8 @@ import { buildIndexOnline, migrationNotice } from './helpers.ts';// occurrence's closed manifest range (chunkGenerationFilter). The released// binary's chunk readers still select it, so it is dropped only once the// writer floor excludes every binary that reads it-// (test/large-pages/v251-master-reader-compat.test.ts). An earlier build of-// this migration dropped it; v254 re-adds it on those (test) brains.+// (test/large-pages/v252-master-reader-compat.test.ts). An earlier build of+// this migration dropped it; v255 re-adds it on those (test) brains.// - content_chunks_generation_idx serves segment GC's staged-chunk delete// (`c.body_generation IS NOT NULL AND c.body_generation > p.body_generation`,// engine-sql/page-body.ts sweepSegments), which the resident maintenance@@ -25,8 +25,8 @@ export const CONTENT_CHUNKS_GENERATION_INDEX = {sql: 'CREATE INDEX IF NOT EXISTS content_chunks_generation_idx ON content_chunks (page_id, body_generation) WHERE body_generation IS NOT NULL',};-export const v251: Migration = {- version: 251,+export const v252: Migration = {+ version: 252,name: 'segmented_chunk_gc_index',idempotent: true,transaction: false,diff --git a/src/core/schema-migrations/v252-page-view-digests.ts b/src/core/schema-migrations/v253-page-view-digests.tssimilarity index 96%rename from src/core/schema-migrations/v252-page-view-digests.tsrename to src/core/schema-migrations/v253-page-view-digests.tsindex 2a42818f7b..3a6e717a6f 100644--- a/src/core/schema-migrations/v252-page-view-digests.ts+++ b/src/core/schema-migrations/v253-page-view-digests.ts@@ -11,8 +11,8 @@ import type { Migration } from './types.ts';// cache: it is used only while its byte total matches the page's stored sums,// rows of older revisions are dropped when a new one is written, and rows go// with their page (ON DELETE CASCADE). DDL only, nothing to backfill.-export const v252: Migration = {- version: 252,+export const v253: Migration = {+ version: 253,name: 'page_view_digests',idempotent: true,sql: `diff --git a/src/core/schema-migrations/v253-segment-reader-marks.ts b/src/core/schema-migrations/v254-segment-reader-marks.tssimilarity index 98%rename from src/core/schema-migrations/v253-segment-reader-marks.tsrename to src/core/schema-migrations/v254-segment-reader-marks.tsindex 8054fa1e2d..2de7dc55c6 100644--- a/src/core/schema-migrations/v253-segment-reader-marks.ts+++ b/src/core/schema-migrations/v254-segment-reader-marks.ts@@ -31,8 +31,8 @@ export const INGEST_LOG_UNMARKED_INDEX = {sql: 'CREATE INDEX IF NOT EXISTS ingest_log_unmarked_idx ON ingest_log (created_at) WHERE writer_segment_reader IS NOT TRUE',};-export const v253: Migration = {- version: 253,+export const v254: Migration = {+ version: 254,name: 'segment_reader_marks',idempotent: true,transaction: false,diff --git a/src/core/schema-migrations/v254-page-body-staging-texts.ts b/src/core/schema-migrations/v255-page-body-staging-texts.tssimilarity index 87%rename from src/core/schema-migrations/v254-page-body-staging-texts.tsrename to src/core/schema-migrations/v255-page-body-staging-texts.tsindex 4d241b5a37..5c97a2501f 100644--- a/src/core/schema-migrations/v254-page-body-staging-texts.ts+++ b/src/core/schema-migrations/v255-page-body-staging-texts.ts@@ -15,10 +15,10 @@ import { PAGE_BODY_STAGING_TEXTS_SQL } from '../page-body/schema.ts';// staging opened before this migration records nothing and its write keeps// the old behavior until it ends.// - content_chunks.retired_generation is re-added where an earlier build of-// v251 dropped it (test brains of that build only): the released binary's-// chunk readers still select it (v251). A no-op everywhere else.-export const v254: Migration = {- version: 254,+// v252 dropped it (test brains of that build only): the released binary's+// chunk readers still select it (v252). A no-op everywhere else.+export const v255: Migration = {+ version: 255,name: 'page_body_staging_texts',idempotent: true,sql: `diff --git a/src/core/schema-migrations/v255-chunk-retirement-index.ts b/src/core/schema-migrations/v256-chunk-retirement-index.tssimilarity index 97%rename from src/core/schema-migrations/v255-chunk-retirement-index.tsrename to src/core/schema-migrations/v256-chunk-retirement-index.tsindex 05ff174ca0..2714679014 100644--- a/src/core/schema-migrations/v255-chunk-retirement-index.ts+++ b/src/core/schema-migrations/v256-chunk-retirement-index.ts@@ -28,8 +28,8 @@ const CONTENT_CHUNKS_OCCURRENCE_GENERATION_INDEX = {sql: 'CREATE INDEX IF NOT EXISTS content_chunks_occurrence_generation_idx ON content_chunks (page_id, occurrence_id, body_generation)',};-export const v255: Migration = {- version: 255,+export const v256: Migration = {+ version: 256,name: 'chunk_retirement_index',idempotent: true,transaction: false,diff --git a/src/schema.sql b/src/schema.sqlindex 494e3ad866..b6db8a6ca3 100644--- a/src/schema.sql+++ b/src/schema.sql@@ -346,7 +346,7 @@ CREATE TABLE IF NOT EXISTS content_chunks (-- (segmented-page chunks; NULL for inline pages) and-- content_chunks_occurrence_idx are added the same way, and so is v248's-- retired_generation, which nothing writes or reads but released chunk readers- -- still select (v251 keeps it and adds content_chunks_generation_idx; v255+ -- still select (v252 keeps it and adds content_chunks_generation_idx; v256-- adds content_chunks_occurrence_generation_idx for chunk retirement).-- #4246 (v133): md5(chunk_text) at embed time. NULL = no embedding or-- pre-v133 row (grandfathered by invalidateContentDriftEmbeddings).@@ -679,7 +679,7 @@ CREATE TABLE IF NOT EXISTS ingest_log (pages_updated JSONB NOT NULL DEFAULT '[]',summary TEXT NOT NULL DEFAULT '',created_at TIMESTAMPTZ NOT NULL DEFAULT now(),- -- Migration v253: the writing binary's version, host and segment-reader mark (NULL from a binary older than v253).+ -- Migration v254: the writing binary's version, host and segment-reader mark (NULL from a binary older than v254).writer_version TEXT,writer_host_id UUID,writer_segment_reader BOOLEAN@@ -2011,7 +2011,7 @@ CREATE TABLE IF NOT EXISTS page_extraction_state ();CREATE INDEX IF NOT EXISTS page_extraction_state_truncated_idxON page_extraction_state (pipeline, page_id) WHERE input_truncated IS NOT NULL;--- Wave B segmented pages (migration v252): get_page view sizes and digests per+-- Wave B segmented pages (migration v253): get_page view sizes and digests per-- page revision and audience (src/core/page-window/segmented.ts).CREATE TABLE IF NOT EXISTS page_view_digests (page_id INTEGER NOT NULL REFERENCES pages(id) ON DELETE CASCADE,diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.jsonindex aace788e04..e690a5b8d4 100644--- a/test/fixtures/goldens/migrations/records.json+++ b/test/fixtures/goldens/migrations/records.json@@ -5,7 +5,8 @@17,18,19,- 100+ 100,+ 251],"helpers": {"ALIAS_TABLES": "cddd37c636af42d862c08ca7754a57dfe9d12576b769fa8f74a5f02c803f67a0",@@ -65,7 +66,7 @@"tableRows": "906d2413b13d76a06d5910885e47ed5c544be4ff3a2266e83146715721b24270","verifyProjectionStatistics": "0d231b04ecfbc5a4109d6fca9567bf4e8c9e9db6c3fbbb35212e026579ed6f67"},- "latest": 255,+ "latest": 256,"records": [{"handler": {@@ -3912,7 +3913,7 @@"sqlFor": "absent","transaction": false,"verify": "absent",- "version": 251+ "version": 252},{"handler": "absent",@@ -3925,7 +3926,7 @@"sqlFor": "absent","transaction": "absent","verify": "absent",- "version": 252+ "version": 253},{"handler": {@@ -3951,7 +3952,7 @@"sqlFor": "absent","transaction": false,"verify": "absent",- "version": 253+ "version": 254},{"handler": "absent",@@ -3964,7 +3965,7 @@"sqlFor": "absent","transaction": "absent","verify": "absent",- "version": 254+ "version": 255},{"handler": {@@ -3990,7 +3991,7 @@"sqlFor": "absent","transaction": false,"verify": "absent",- "version": 255+ "version": 256}],"versions": [@@ -4239,11 +4240,11 @@248,249,250,- 251,252,253,254,- 255+ 255,+ 256]},"normalizer": "migrations-record-v1"diff --git a/test/large-pages/segmented-storage-visibility.test.ts b/test/large-pages/segmented-storage-visibility.test.tsindex 97b3c282ef..c1bc0ec22c 100644--- a/test/large-pages/segmented-storage-visibility.test.ts+++ b/test/large-pages/segmented-storage-visibility.test.ts@@ -9,7 +9,7 @@* until publication references it; a page-scoped sweep collects only the* texts its page released; chunks of a shifted occurrence keep stored* spans that hold their text in the new body; segment GC's staged-chunk- * delete reads an index, not the whole chunk table; v251 keeps+ * delete reads an index, not the whole chunk table; v252 keeps* content_chunks.retired_generation for released readers, and no reader at* this version names it.* 2. Fails when: visibility trusts body_generation alone, stageSegmentChunks@@ -17,7 +17,7 @@* deduped text unlocked and its grace unrefreshed, the text sweep ignores* live stagings, a page sweep scans its source's texts, raw spans are* absolute body offsets, content_chunks_generation_idx is missing, or- * v251 drops retired_generation or a chunk reader at this version names it.+ * v252 drops retired_generation or a chunk reader at this version names it.* 3. Runs on PGLite, and on Postgres when DATABASE_URL is set.*/import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'bun:test';@@ -36,7 +36,7 @@ import { chunk, manifestRow, publishSegmentedPage, segmentText } from '../helperimport { isolatedPersistencePostgres } from '../helpers/persistence-postgres.ts';import { segmentedPageRow } from '../helpers/segmented-page-checks.ts';import { testBackends } from '../helpers/test-backends.ts';-import { v251 } from '../../src/core/schema-migrations/v251-segmented-chunk-gc-index.ts';+import { v252 } from '../../src/core/schema-migrations/v252-segmented-chunk-gc-index.ts';/** ~1.4 MB of sections, each its own segment. */function sections(tag: string, n = 60): string {@@ -276,18 +276,18 @@ for (const kind of testBackends()) {}}, 180_000);- test('v251 keeps retired_generation on a v248 brain and builds the GC index; no chunk reader names the column', async () => {+ test('v252 keeps retired_generation on a v248 brain and builds the GC index; no chunk reader names the column', async () => {const columns = async () => (await engine.executeRaw<{ attname: string }>("SELECT attname FROM pg_attribute WHERE attrelid = 'content_chunks'::regclass AND attnum > 0 AND NOT attisdropped")).map(r => r.attname);expect(await columns()).toContain('retired_generation');await importFromContent(engine, 'notes/upgraded', page(sections('u')), { sourceId: 'default', noEmbed: true });await engine.executeRaw('DROP INDEX content_chunks_generation_idx');- if (v251.sql) await engine.executeRaw(v251.sql);- await v251.handler!(engine);+ if (v252.sql) await engine.executeRaw(v252.sql);+ await v252.handler!(engine);expect(await columns()).toContain('retired_generation');const [index] = await engine.executeRaw<{ indexdef: string }>("SELECT indexdef FROM pg_indexes WHERE indexname = 'content_chunks_generation_idx'");expect(index?.indexdef).toContain('WHERE (body_generation IS NOT NULL)');- // The column stays for released readers (v251-master-reader-compat.test.ts); head's readers must not name it.+ // The column stays for released readers (v252-master-reader-compat.test.ts); head's readers must not name it.await engine.executeRaw('ALTER TABLE content_chunks RENAME COLUMN retired_generation TO retired_generation_hidden');try {for (const excludePrivate of [false, true]) {diff --git a/test/large-pages/segmented-switch.test.ts b/test/large-pages/segmented-switch.test.tsindex 17f92f4482..b777982ee4 100644--- a/test/large-pages/segmented-switch.test.ts+++ b/test/large-pages/segmented-switch.test.ts@@ -7,7 +7,7 @@* inline, even with an explicit `on`, and doctor `segmented_storage` names it with an upgrade fix; once that* observation is gone the next write promotes; an explicit `off` keeps pages inline and reports it as a choice;* (a stored segmented page over 32 MiB exporting while the switch is off is in segmented-real-size.slow.test.ts). Every write the gate sees must carry the- * segment-reader mark (v253): a release at exactly the floor version without it, an older binary's import or sync+ * segment-reader mark (v254): a release at exactly the floor version without it, an older binary's import or sync* run (ingest_log), its resident heartbeat and its uncommitted requests all block; this build's do not. An* unreadable gate blocks, an unparsable stamp blocks, the 7-day window ends between day 6 and day 8, and the gate is* read once per TTL (work counter) while doctor reads through.@@ -117,7 +117,7 @@ for (const kind of testBackends()) {/** The gate as a write reads it, after the per-engine cache is dropped. */const segmentedNow = async (e: BrainEngine = engine) => { _resetSegmentedWriterGateForTests(); return (await readPageBodyPolicy(e)).segmented; };const blockersNow = async () => (await segmentedStorageCheck(engine)).details!.blockers as Array<{ role: string; principal: string; version: string; segment_reader: boolean }>;- /** What a binary older than v253 leaves on a request it admitted and published: its version stamp, and no segment-reader mark. */+ /** What a binary older than v254 leaves on a request it admitted and published: its version stamp, and no segment-reader mark. */const asOlderBinary = (id: string, version: string | null) =>editRequest(engine, id, 'admitter_version=$2,consumer_version=$2,admitter_segment_reader=NULL,consumer_segment_reader=NULL', [version]);diff --git a/test/large-pages/v251-master-reader-compat.test.ts b/test/large-pages/v252-master-reader-compat.test.tssimilarity index 94%rename from test/large-pages/v251-master-reader-compat.test.tsrename to test/large-pages/v252-master-reader-compat.test.tsindex 184c5d8eb2..04635b56c7 100644--- a/test/large-pages/v251-master-reader-compat.test.ts+++ b/test/large-pages/v252-master-reader-compat.test.ts@@ -2,10 +2,10 @@* The released chunk readers keep working on a schema this branch migrated (Wave B PR 2, mixed-version window).** 1. Protects: a process still running the released binary (master's chunkGenerationFilter, which names- * content_chunks.retired_generation) reads chunks of a brain whose schema this branch migrated through v251,- * with segmented storage on or off; v251 keeps the column (nothing at head writes or reads it) and still+ * content_chunks.retired_generation) reads chunks of a brain whose schema this branch migrated through v252,+ * with segmented storage on or off; v252 keeps the column (nothing at head writes or reads it) and still* builds the GC index.- * 2. Fails when: v251 drops retired_generation before the writer floor excludes every binary whose search,+ * 2. Fails when: v252 drops retired_generation before the writer floor excludes every binary whose search,* get_chunks or embed queue selects it (they fail with 42703 on ordinary search).* 3. Runs on PGLite, and on Postgres when DATABASE_URL is set. The filter text is copied verbatim from* origin/master 3ed487d2 src/core/search/safe-chunks.ts, so the probe does not move when head's filter changes.@@ -39,7 +39,7 @@ function sections(tag: string, n = 60): string {const page = (body: string) => `---\ntitle: Mixed version\ntype: note\n---\n\n${body}`;for (const kind of testBackends()) {- describe(`v251 keeps the column master's chunk readers select (${kind})`, () => {+ describe(`v252 keeps the column master's chunk readers select (${kind})`, () => {let engine: BrainEngine;let close: () => Promise<void>;@@ -73,7 +73,7 @@ for (const kind of testBackends()) {}, 120_000);}- test('v251 builds the GC index and leaves retired_generation in place', async () => {+ test('v252 builds the GC index and leaves retired_generation in place', async () => {const [column] = await engine.executeRaw<{ n: number }>(`SELECT count(*)::int AS n FROM information_schema.columnsWHERE table_name = 'content_chunks' AND column_name = 'retired_generation'`);expect(Number(column!.n)).toBe(1);diff --git a/test/postgres-unit-arms.txt b/test/postgres-unit-arms.txtindex 31bc0d91ff..55b7e72f9f 100644--- a/test/postgres-unit-arms.txt+++ b/test/postgres-unit-arms.txt@@ -171,7 +171,7 @@ test/large-pages/segmented-timeline-retract-versions.test.tstest/large-pages/segmented-versions.test.tstest/large-pages/segmented-withdrawn-fence-delete.test.tstest/large-pages/streamed-import-drift.test.ts-test/large-pages/v251-master-reader-compat.test.ts+test/large-pages/v252-master-reader-compat.test.tstest/link-cross-source.test.tstest/link-preparation-shared-index.test.tstest/links-attendance-blocked.test.tsdiff --git a/test/schema-bootstrap-coverage.test.ts b/test/schema-bootstrap-coverage.test.tsindex 0faee19399..e3a2a3a8c6 100644--- a/test/schema-bootstrap-coverage.test.ts+++ b/test/schema-bootstrap-coverage.test.ts@@ -1107,7 +1107,7 @@ const COLUMN_EXEMPTIONS = new Set<string>([// posture as v178/v198: persistence_requests is migration-created on PGLite,// no index references the column, and every reader treats NULL as "sent a UUID or nothing".'persistence_requests.client_request_id',- // Wave B fix lane B (migration v253) — segment-reader marks next to the v178+ // Wave B fix lane B (migration v254) — segment-reader marks next to the v178// stamps. Same posture as v178: persistence_requests is migration-created on// PGLite, no index references the columns, and every reader treats NULL as a// writer that does not read segmented pages.