Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

gate: count a superseded-only drain batch, fit add_timeline_entry in the starter budget, cover v239 in the schema guards

garrytan27ec6ca3cf15
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.md
index c069e31b12..6a1e694cff 100644
--- a/docs/TOOL_CATALOG.md
+++ b/docs/TOOL_CATALOG.md
@@ -79,7 +79,7 @@ Every non-localOnly operation on the MCP surface: 149 tools across 25 areas. **S
| Tool | Description | Scope | Starter | Gate |
|---|---|---|---|---|
-| `get_ingest_log` | Recent ingestion log entries. | read | yes | |
+| `get_ingest_log` | Recent ingestion log entries: what was already imported. | read | yes | |
| `log_ingest` | Record one ingestion event (source type, reference, pages updated, summary) in the brain's ingest log. | write | | |
## insights
@@ -120,7 +120,7 @@ Every non-localOnly operation on the MCP surface: 149 tools across 25 areas. **S
| `find_orphans` | Find disconnected pages. | read | | |
| `get_backlinks` | Links to a page; group:"page" pages by referrer, newest first. | read | yes | |
| `get_links` | List a page's outgoing links (typed edges to other pages). | read | | |
-| `list_link_sources` | Link provenances in the brain (e.g. | read | yes | |
+| `list_link_sources` | Link provenances (e.g. | read | yes | |
| `remove_link` | Remove a link between two pages (optionally only one link_type or link_source). | write | | |
| `traverse_graph` | Walk the link graph from a page. | read | yes | |
| `wanted_pages` | Link targets that have no page yet, most-referenced first: each was written as a link but its page does not exist, so no edge exists. | read | | |
@@ -179,11 +179,11 @@ Every non-localOnly operation on the MCP surface: 149 tools across 25 areas. **S
| `get_write_request` | Read your write's receipt by request_id (after write_pending or a lost reply). | write | yes | |
| `list_page_purges` | Owner-only (`gbrain pages purges list`). | admin | | |
| `list_pages` | List pages with filters. | read | yes | |
-| `list_write_requests` | List your write receipts in one source, newest first. | write | yes | |
+| `list_write_requests` | List your write receipts in one source, newest first, for a lost request_id. | write | yes | |
| `put_page` | Complete content REPLACES the whole page: read get_page include_content:true; send its revision as expected_revision. | write | yes | |
| `put_pages` | Write up to 50 complete Markdown pages (8 MB total) in one call; use instead of put_page for more than 3 pages. | write | | |
| `put_raw_data` | Store a raw provider payload (API response JSON) alongside a page, keyed by source. | write | | |
-| `resolve_slugs` | Fuzzy-match a partial slug or title to page slugs. | read | yes | |
+| `resolve_slugs` | Fuzzy-match a partial slug or title to page slugs when a slug is uncertain. | read | yes | |
| `restore_page` | Restore a soft-deleted page (clear deleted_at) and re-create its markdown file on disk (the counterpart to delete_page removing it; the result write_through field reports the outcome). | write | | |
| `revert_version` | Restore a page to an earlier version from its history (a new revision; history is kept). | write | | |
| `unpurge_page` | Owner-only (`gbrain pages unpurge <slug>`). | admin | | |
diff --git a/docs/architecture/key-files/core-cycle.md b/docs/architecture/key-files/core-cycle.md
index cad21806bd..bdf211cdb2 100644
--- a/docs/architecture/key-files/core-cycle.md
+++ b/docs/architecture/key-files/core-cycle.md
@@ -21,7 +21,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/cycle/extract-atoms-budget-notice.ts` — #6425: `drainBudgetNotice(result)` renders the `atom_drain_budget` notice a `budget`-stopped drain carries in `gbrain dream --drain --json` (spend, per-run cap, pages left; paid fix `gbrain config set cycle.extract_atoms.budget_usd <USD>`, verify `gbrain config get`), and `usd` formats the amounts for the stderr stop line. Dynamically imported by `dream.ts` so its notice-rendering imports stay out of the CLI flag scan. Tests: `test/dream-drain-failure-summary.serial.test.ts`.
-- `src/core/cycle/extract-atoms.ts` — the extract_atoms lens phase: mines eligible pages into `atoms/<date>/<stem>-<hash>` pages. Transcript input is paste-stripped before the cut (#5812); discovery skips self-captures (#5820). Discovery and the backlog count append `connectorAtomExclusionSql` (`connector-atoms.ts`), so connector `email`/`meeting` pages stay out only when `cycle.extract_atoms.connector_pages` is false. The type allowlist is `unionExtractableTypes(packExtractable, packExcluded)`: the legacy floor (meeting, source, article, video, book, original) minus the floor types the active pack declares not extractable (`nonExtractableTypesFromPack`, #5756; a declared type without `extractable: true` is a pack decision, an undeclared type keeps the floor), plus the pack's `extractable: true` types, minus synthesis outputs; gbrain-base is unchanged, gbrain-recommended's `source: false` now holds for atoms as it did for facts. Pinned by `test/pack-extractable-floor-5756.serial.test.ts`. A drain attempt passes `opts.attempt` (`budgetTracker`, `writeWait`) so its batches share one budget and one maintenance publish wait. Eligibility reads source-incarnation/page/full-hash-keyed derived scan state; scan and failure markers do not mutate canonical frontmatter. Managed extraction checks source-wide local authority and owner readiness before provider work, admits outputs plus a completion request together, and replays retained output without another model call. A failed managed batch is retried by the next run instead (#6325, `resumeManagedAtoms` in `persistence/atom-maintenance.ts`); an origin held after `MAX_DETERMINISTIC_FAILURES` (now defined in `extract-atoms-page-state.ts`, re-exported here) is skipped with no model call and counted in `details.held_failed`, never in `failures`. Managed atom files keep provisional source hashes; only the source-incarnation/page/full-hash durable completion receipt excludes an item from discovery and backlog counts. Unmanaged atom completion flips and their cardinality check share a transaction after provenance links persist, so a partial match rolls back and stays retryable. A page-derived atom upserts at its locator-folded slug, else a compatible legacy title-only slug; when both miss, the source page's live bound atoms are loaded once per page per run and exactly one JS-lowercased title match is adopted (a case-only title change never mints a duplicate; zero or several matches mint the new slug). Response parsing lives in `extract-atoms-parse.ts`. An undated source dates its atoms by the source page's creation date (`undated` for transcripts), never the run date. After an unmanaged item completes, `retireStaleAtoms` soft-deletes that source's atoms from earlier extractions (other or provisional `source_hash`) that this extraction did not re-produce. Hard `opts.signal` (chat call, pacing, checks before each item and commit) leaves no strike, receipt or rollup; soft `opts.stopSignal` stops before the next item.
+- `src/core/cycle/extract-atoms.ts` — the extract_atoms lens phase: mines eligible pages into `atoms/<date>/<stem>-<hash>` pages. Transcript input is paste-stripped before the cut (#5812); discovery skips self-captures (#5820). Discovery and the backlog count append `connectorAtomExclusionSql` (`connector-atoms.ts`), so connector `email`/`meeting` pages stay out only when `cycle.extract_atoms.connector_pages` is false. The type allowlist is `unionExtractableTypes(packExtractable, packExcluded)`: the legacy floor (meeting, source, article, video, book, original) minus the floor types the active pack declares not extractable (`nonExtractableTypesFromPack`, #5756; a declared type without `extractable: true` is a pack decision, an undeclared type keeps the floor), plus the pack's `extractable: true` types, minus synthesis outputs; gbrain-base is unchanged, gbrain-recommended's `source: false` now holds for atoms as it did for facts. Pinned by `test/pack-extractable-floor-5756.test.ts`. A drain attempt passes `opts.attempt` (`budgetTracker`, `writeWait`) so its batches share one budget and one maintenance publish wait. Eligibility reads source-incarnation/page/full-hash-keyed derived scan state; scan and failure markers do not mutate canonical frontmatter. Managed extraction checks source-wide local authority and owner readiness before provider work, admits outputs plus a completion request together, and replays retained output without another model call. A failed managed batch is retried by the next run instead (#6325, `resumeManagedAtoms` in `persistence/atom-maintenance.ts`); an origin held after `MAX_DETERMINISTIC_FAILURES` (now defined in `extract-atoms-page-state.ts`, re-exported here) is skipped with no model call and counted in `details.held_failed`, never in `failures`. Managed atom files keep provisional source hashes; only the source-incarnation/page/full-hash durable completion receipt excludes an item from discovery and backlog counts. Unmanaged atom completion flips and their cardinality check share a transaction after provenance links persist, so a partial match rolls back and stays retryable. A page-derived atom upserts at its locator-folded slug, else a compatible legacy title-only slug; when both miss, the source page's live bound atoms are loaded once per page per run and exactly one JS-lowercased title match is adopted (a case-only title change never mints a duplicate; zero or several matches mint the new slug). Response parsing lives in `extract-atoms-parse.ts`. An undated source dates its atoms by the source page's creation date (`undated` for transcripts), never the run date. After an unmanaged item completes, `retireStaleAtoms` soft-deletes that source's atoms from earlier extractions (other or provisional `source_hash`) that this extraction did not re-produce. Hard `opts.signal` (chat call, pacing, checks before each item and commit) leaves no strike, receipt or rollup; soft `opts.stopSignal` stops before the next item.
Managed completion admits revision-pinned `managed_atom_delete` children alongside replacement pages, removes canonical files through the page deletion path, and commits its checkpoint only after every publication and retirement commits.
Both paths prevent LLM-chosen titles that drift between extractions from piling up.
Atom identity: page-derived atoms fold the source-page slug into the slug hash (8 chars, NUL-separated) so two same-date pages emitting the same title get DISTINCT slugs; the source CONTENT hash is deliberately NOT folded (a reworded source still upserts rather than duping); transcript atoms keep the legacy title-only 6-char hash. `resolvePageAtomSlug` adopts a legacy-slug atom with a compatible binding in place on re-extraction (upgrade idempotency — no migration, no duplicate), while `assertAtomImportBinding` fail-closed refuses to reuse a slug bound to a DIFFERENT source locator. Both share `isCompatibleAtomBinding(frontmatter, sourcePageSlug)` — the ONE definition of compatible: bound to THIS source page, or carrying no `source_slug`/`source_path` at all (pre-binding-era adoption, not a clobber); a `source_path`-bound legacy transcript atom or a different `source_slug` is a different origin, and a non-atom page squatting on the slug is refused. `source_quote` is verified at extraction time against the exact `truncateUtf8` prompt prefix the model saw (`locateQuote` advances by full code points): located quotes persist original characters + [start,end) offsets + `source_quote_verified`; unlocatable quotes are dropped with the atom kept. Edges write before the completion flip; per-item drain failures stay typed (bounded, sanitized, reconcilable). Transcript items carry the same failure-count/tombstone machinery as pages, in the `extract_atoms_transcript_state` table (keyed `(source_id, file_path, content_hash)`, 16-char hash prefix, so an edit is a new row): `recordItemFailureCount` counts a transcript's malformed output or prompt-level provider block (`providerContentBlockReason`; never feeds the outage halt) toward `MAX_DETERMINISTIC_FAILURES`, a zero-yield transcript tombstones immediately (as pages do), and `tombstonedTranscriptsForHashes` is the batch read-side gate mirroring `atomsExistingForHashes` (fail-open on error). Reported as `tombstoned_transcripts` (paths), separate from the page-slug `tombstoned_for_failures`. Malformed managed output requires a newly approved protected-job retry identity; publication retry reuses retained output and original/current grants.
diff --git a/scripts/serial-files.tsv b/scripts/serial-files.tsv
index 0f61b7bd2e..2f88f1daaf 100644
--- a/scripts/serial-files.tsv
+++ b/scripts/serial-files.tsv
@@ -389,3 +389,4 @@ test/write-path-zero-llm.serial.test.ts R1 R1: mutates process.env (ANTHROPIC_AP
test/writeback-nudge.serial.test.ts global-state global-state: patches process stdout/stderr/console
test/writeback-review-fixes.serial.test.ts global-state global-state: process-wide test seams __resetCheckpointHarvestForTests; patches process stdout/stderr/console
test/hook-push-banner-superseded.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)
+test/embed-stale-progress-5968.serial.test.ts R1 R1: mutates process.env (GBRAIN_MAX_CHUNK_TOKENS)
diff --git a/src/core/deletion-inventory.ts b/src/core/deletion-inventory.ts
index 11194db163..0d7ffe681c 100644
--- a/src/core/deletion-inventory.ts
+++ b/src/core/deletion-inventory.ts
@@ -70,7 +70,7 @@ const ROWS: readonly Row[] = [
['eval_takes_quality_runs', 'out_of_scope', 'probed_reported', 'receipt_sha8_corpus receipt_sha8_prompt receipt_sha8_models receipt_sha8_rubric rubric_version verdict dim_scores receipt_json receipt_disk_path', 'receipt_json'],
['extract_atoms_page_state', 'out_of_scope', 'no_memory_text', 'content_hash'],
['extract_atoms_transcript_state', 'out_of_scope', 'no_memory_text', 'source_id file_path content_hash'],
- ['extract_rollup_7d', 'out_of_scope', 'no_memory_text', 'kind source_id'],
+ ['extract_rollup_7d', 'out_of_scope', 'no_memory_text', 'kind source_id halt_reasons'],
['fact_purges', 'out_of_scope', 'text_free_ledger', 'source_id visibility subject fact_hash actor reason'],
['fact_relink_attempts', 'out_of_scope', 'probed_reported', 'source_id outcome reason tier model target_slug run_id', 'reason'],
['fact_withdrawals', 'out_of_scope', 'text_free_ledger', 'source_id visibility subject fact_hash'],
diff --git a/src/core/operation-manifest.generated.ts b/src/core/operation-manifest.generated.ts
index 2478294b34..7ee1beef8a 100644
--- a/src/core/operation-manifest.generated.ts
+++ b/src/core/operation-manifest.generated.ts
@@ -795,7 +795,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"name": "list_write_requests",
"idempotent": true,
"outputRedaction": "no_stored_text",
- "description": "List your write receipts in one source, newest first. Use when a request_id was lost.",
+ "description": "List your write receipts in one source, newest first, for a lost request_id.",
"params": {
"source_id": {
"type": "string",
@@ -1649,7 +1649,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"mutating": false,
"idempotent": true,
"outputRedaction": "no_stored_text",
- "description": "Link provenances in the brain (e.g. markdown, manual) with edge counts.",
+ "description": "Link provenances (e.g. markdown, manual) with edge counts.",
"params": {},
"scope": "read",
"cliHints": {
@@ -1662,7 +1662,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"mutating": false,
"idempotent": true,
"outputRedaction": "retrieval",
- "description": "Walk the link graph from a page. Remote callers get bidirectional paths at depth 2 by default.",
+ "description": "Walk the link graph from a page. Remote default: both directions, depth 2.",
"params": {
"slug": {
"type": "string",
@@ -1755,7 +1755,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"name": "add_timeline_entry",
"idempotent": true,
"outputRedaction": "retrieval",
- "description": "Append a dated entry to a page timeline. Replaying the same entry changes nothing. A page's Timeline section needs no call. The receipt returns the rendered bullet; to change or remove an entry, edit that bullet in the page's Timeline section with edit_page (expected_revision from get_page include_content:true): the row follows the page.",
+ "description": "Append a dated entry to a page timeline. Replays change nothing; the Timeline section needs no call. To change or remove one, edit its bullet via edit_page (expected_revision from get_page).",
"params": {
"request_id": {
"type": "string",
@@ -2792,7 +2792,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"mutating": false,
"idempotent": true,
"outputRedaction": "no_stored_text",
- "description": "Fuzzy-match a partial slug or title to page slugs. Use when a slug is uncertain. Needs read scope.",
+ "description": "Fuzzy-match a partial slug or title to page slugs when a slug is uncertain. Needs read scope.",
"params": {
"partial": {
"type": "string",
@@ -2877,7 +2877,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"mutating": false,
"idempotent": true,
"outputRedaction": "retrieval",
- "description": "Recent ingestion log entries. Use when checking what was already imported.",
+ "description": "Recent ingestion log entries: what was already imported.",
"params": {
"limit": {
"type": "number",
diff --git a/src/core/ops/chunks.ts b/src/core/ops/chunks.ts
index 43cbc80095..509a6431f3 100644
--- a/src/core/ops/chunks.ts
+++ b/src/core/ops/chunks.ts
@@ -19,7 +19,7 @@ const resolve_slugs: Operation = {
mutating: false,
idempotent: true,
outputRedaction: 'no_stored_text',
- description: 'Fuzzy-match a partial slug or title to page slugs. Use when a slug is uncertain. Needs read scope.',
+ description: 'Fuzzy-match a partial slug or title to page slugs when a slug is uncertain. Needs read scope.',
params: {
partial: { type: 'string', required: true, description: "Partial slug or title, e.g. 'alice-ex'." },
source_id: {
diff --git a/src/core/ops/ingest-log.ts b/src/core/ops/ingest-log.ts
index 2fcb686c57..93ca261b1f 100644
--- a/src/core/ops/ingest-log.ts
+++ b/src/core/ops/ingest-log.ts
@@ -47,7 +47,7 @@ const get_ingest_log: Operation = {
mutating: false,
idempotent: true,
outputRedaction: 'retrieval',
- description: 'Recent ingestion log entries. Use when checking what was already imported.',
+ description: 'Recent ingestion log entries: what was already imported.',
params: {
limit: { type: 'number', description: 'Default 20.' },
},
diff --git a/src/core/ops/links.ts b/src/core/ops/links.ts
index 17d2731a98..363c73c5a4 100644
--- a/src/core/ops/links.ts
+++ b/src/core/ops/links.ts
@@ -427,7 +427,7 @@ const list_link_sources: Operation = {
// v114 (#1941): the read-side counterpart to link-add/link-rm. Since
// link_source is now an open kebab provenance (no allowlist), this is how an
// agent discovers which provenances a brain actually carries.
- description: 'Link provenances in the brain (e.g. markdown, manual) with edge counts.',
+ description: 'Link provenances (e.g. markdown, manual) with edge counts.',
params: {},
handler: async (ctx) => {
// Route through sourceScopeOpts so the read honors both scalar ctx.sourceId
@@ -522,7 +522,7 @@ const traverse_graph: Operation = {
mutating: false,
idempotent: true,
outputRedaction: 'retrieval',
- description: `Walk the link graph from a page. Remote callers get bidirectional paths at depth ${REMOTE_BIDIRECTIONAL_DEFAULT_DEPTH} by default.`,
+ description: `Walk the link graph from a page. Remote default: both directions, depth ${REMOTE_BIDIRECTIONAL_DEFAULT_DEPTH}.`,
params: {
slug: { type: 'string', description: 'Start page slug.', required: true },
depth: { type: 'number', description: `Max depth (cap ${TRAVERSE_DEPTH_CAP}).` },
diff --git a/src/core/ops/persistence.ts b/src/core/ops/persistence.ts
index 54d4d9494f..01936d889c 100644
--- a/src/core/ops/persistence.ts
+++ b/src/core/ops/persistence.ts
@@ -155,7 +155,7 @@ export const persistenceOperations: Operation[] = [
name: 'list_write_requests',
idempotent: true,
outputRedaction: 'no_stored_text',
- description: 'List your write receipts in one source, newest first. Use when a request_id was lost.',
+ description: 'List your write receipts in one source, newest first, for a lost request_id.',
params: {
source_id: { type: 'string', description: 'Default: yours.' },
limit: { type: 'number', default: 25, description: '1-100 (default 25).' },
diff --git a/src/core/ops/timeline.ts b/src/core/ops/timeline.ts
index ca7cedcf25..5aeea9cc5a 100644
--- a/src/core/ops/timeline.ts
+++ b/src/core/ops/timeline.ts
@@ -24,7 +24,7 @@ const add_timeline_entry: Operation = {
name: 'add_timeline_entry',
idempotent: true,
outputRedaction: 'retrieval',
- description: 'Append a dated entry to a page timeline. Replaying the same entry changes nothing. A page\'s Timeline section needs no call. The receipt returns the rendered bullet; to change or remove an entry, edit that bullet in the page\'s Timeline section with edit_page (expected_revision from get_page include_content:true): the row follows the page.',
+ description: 'Append a dated entry to a page timeline. Replays change nothing; the Timeline section needs no call. To change or remove one, edit its bullet via edit_page (expected_revision from get_page).',
params: {
request_id: WRITE_REQUEST_PARAM,
...MERGE_PRECONDITION_PARAMS,
diff --git a/src/core/page-state/projections.ts b/src/core/page-state/projections.ts
index b79cf22b16..b63e3ddf59 100644
--- a/src/core/page-state/projections.ts
+++ b/src/core/page-state/projections.ts
@@ -520,10 +520,10 @@ export async function drainProjections(engine: BrainEngine, opts: { limit?: numb
const batch = await rebuildPendingPageProjections(engine, Math.min(DRAIN_BATCH, (opts.limit ?? Infinity) - tried),
{ notAfter: runStart, reasons: opts.reasons, onHeal: () => { healed++; },
onFailure: failure => { failed.push(failure); if (!failure.reason.startsWith('revision_conflict:')) failedNow++; } });
- const progressed = batch.rebuilt + healed + failedNow;
- if (progressed === 0) break;
rebuilt += batch.rebuilt;
superseded += batch.superseded;
+ const progressed = batch.rebuilt + healed + failedNow;
+ if (progressed === 0) break;
tried += progressed;
opts.progress?.tick(progressed, `${rebuilt} rebuilt, ${failed.length} failed`);
}
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index 8da9832dd5..a515ec88ae 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 231070,
- "stdoutSha256": "d28c9613d378d0cb35ea4c24191fd61efcb7cd9cf465b890e9853cf6cb8eab93",
+ "stdoutBytes": 230856,
+ "stdoutSha256": "1cfbe67abedfc85e1125062fa7f74015e75573f597c65f94262f914110cdbe6b",
"toolNames": [
"remember",
"entity",
@@ -1040,7 +1040,7 @@
"scope": "write"
},
{
- "description": "List your write receipts in one source, newest first. Use when a request_id was lost.",
+ "description": "List your write receipts in one source, newest first, for a lost request_id.",
"idempotent": true,
"local_only": false,
"mutating": false,
@@ -2014,7 +2014,7 @@
"scope": "read"
},
{
- "description": "Link provenances in the brain (e.g. markdown, manual) with edge counts.",
+ "description": "Link provenances (e.g. markdown, manual) with edge counts.",
"idempotent": true,
"local_only": false,
"mutating": false,
@@ -2029,7 +2029,7 @@
"scope": "read"
},
{
- "description": "Walk the link graph from a page. Remote callers get bidirectional paths at depth 2 by default.",
+ "description": "Walk the link graph from a page. Remote default: both directions, depth 2.",
"idempotent": true,
"local_only": false,
"mutating": false,
@@ -2138,7 +2138,7 @@
"scope": "read"
},
{
- "description": "Append a dated entry to a page timeline. Replaying the same entry changes nothing. A page's Timeline section needs no call. The receipt returns the rendered bullet; to change or remove an entry, edit that bullet in the page's Timeline section with edit_page (expected_revision from get_page include_content:true): the row follows the page.",
+ "description": "Append a dated entry to a page timeline. Replays change nothing; the Timeline section needs no call. To change or remove one, edit its bullet via edit_page (expected_revision from get_page).",
"idempotent": true,
"local_only": false,
"mutating": true,
@@ -3314,7 +3314,7 @@
"scope": "read"
},
{
- "description": "Fuzzy-match a partial slug or title to page slugs. Use when a slug is uncertain. Needs read scope.",
+ "description": "Fuzzy-match a partial slug or title to page slugs when a slug is uncertain. Needs read scope.",
"idempotent": true,
"local_only": false,
"mutating": false,
@@ -3425,7 +3425,7 @@
"scope": "write"
},
{
- "description": "Recent ingestion log entries. Use when checking what was already imported.",
+ "description": "Recent ingestion log entries: what was already imported.",
"idempotent": true,
"local_only": false,
"mutating": false,
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index dc4ca93222..6303e71c65 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -924,6 +924,7 @@
"limit?: number | undefined",
"listColumnsOnly?: boolean | undefined",
"offset?: number | undefined",
+ "slugAfter?: string | undefined",
"slugPrefix?: string | undefined",
"sort?: \"updated_desc\" | \"updated_asc\" | \"created_desc\" | \"slug\" | undefined",
"sourceId?: string | undefined",
@@ -8616,6 +8617,7 @@
"limit?: number | undefined",
"listColumnsOnly?: boolean | undefined",
"offset?: number | undefined",
+ "slugAfter?: string | undefined",
"slugPrefix?: string | undefined",
"sort?: \"updated_desc\" | \"updated_asc\" | \"created_desc\" | \"slug\" | undefined",
"sourceId?: string | undefined",
diff --git a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
index 7a98b3949a..36b7c537a1 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -1941,7 +1941,8 @@
"8 round_completed_count integer/int4 NOT NULL DEFAULT 0",
"9 rollup_write_failures integer/int4 NOT NULL DEFAULT 0",
"10 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "11 expected_limit_count integer/int4 NOT NULL DEFAULT 0"
+ "11 expected_limit_count integer/int4 NOT NULL DEFAULT 0",
+ "12 halt_reasons jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb"
],
"flags": "relkind=r rls=false force_rls=false"
},
diff --git a/test/fixtures/goldens/sql-text/pages.json b/test/fixtures/goldens/sql-text/pages.json
index 2152ac5a0f..7147010562 100644
--- a/test/fixtures/goldens/sql-text/pages.json
+++ b/test/fixtures/goldens/sql-text/pages.json
@@ -445,8 +445,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $1 OFFSET $2",
- "textSha256": "b53eedb61eb045a5e22ea5a53328ab5e14d8af00e052458389fa75c7f09b92c1"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $1 OFFSET $2",
+ "textSha256": "afebc8c006e1778b46d5f1904b8b6443c06d9fa54e7d74e405cdae5a3db9a354"
}
],
"effective_after": [
@@ -457,8 +457,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL AND p.effective_date >= $1::timestamptz ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "e300dc2ea65cbb6ec63120ab02e17948c47ce081dca436bc2dcfd72fd347d6a8"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL AND p.effective_date >= $1::timestamptz ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "ab496548df66feb6509bd94bd252bb8450ce1bacd31ce623e6f19eadbdd5be8b"
}
],
"effective_before": [
@@ -469,8 +469,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL AND p.effective_date <= $1::timestamptz ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "4b3c992ab60c2c856fbf45771893902242c5acdba7cbca9a54f05536acf7dda8"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL AND p.effective_date <= $1::timestamptz ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "4fca7c1cb5a3bf528dd3191386e43eb5ecf2f1fe368dfbba8adbb7d5b9a69679"
}
],
"excludePrivate": [
@@ -480,8 +480,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL AND ((COALESCE(p.frontmatter->>'visibility', CASE WHEN (p.type IN ('atom', 'question') OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT COALESCE(p.frontmatter ? 'pinned_question', false)) AND NOT (CASE WHEN p.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = p.source_id AND derived_origin.slug = p.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (p.type IN ('atom', 'question') OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = p.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN p.type = 'event' AND p.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = p.source_id AND chronicle_origin.slug = p.frontmatter->'event'->>'depth' AND (COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type IN ('atom', 'question') OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT COALESCE(chronicle_origin.frontmatter ? 'pinned_question', false)) AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug = ANY(ARRAY( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug)))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = p.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug = ANY(ARRAY( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') = 'array' THEN p.frontmatter->'derived_from' ELSE jsonb_build_array(p.frontmatter->'derived_from') END) AS declared(slug)))) ELSE false END)) ORDER BY p.updated_at DESC LIMIT $1 OFFSET $2",
- "textSha256": "a5050165aeb8ce5fb82143dd3c60ce06bcc7bbb8a8143f46705ceef29d728a9c"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL AND ((COALESCE(p.frontmatter->>'visibility', CASE WHEN (p.type IN ('atom', 'question') OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT COALESCE(p.frontmatter ? 'pinned_question', false)) AND NOT (CASE WHEN p.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = p.source_id AND derived_origin.slug = p.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (p.type IN ('atom', 'question') OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = p.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN p.type = 'event' AND p.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = p.source_id AND chronicle_origin.slug = p.frontmatter->'event'->>'depth' AND (COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type IN ('atom', 'question') OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT COALESCE(chronicle_origin.frontmatter ? 'pinned_question', false)) AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug = ANY(ARRAY( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug)))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = p.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug = ANY(ARRAY( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') = 'array' THEN p.frontmatter->'derived_from' ELSE jsonb_build_array(p.frontmatter->'derived_from') END) AS declared(slug)))) ELSE false END)) ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $1 OFFSET $2",
+ "textSha256": "2e26e37c8974db3e0fd9adf11d79bd868f2f5d1c0df66a8c10e7dde985f62085"
}
],
"includeDeleted": [
@@ -491,8 +491,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 ORDER BY p.updated_at DESC LIMIT $1 OFFSET $2",
- "textSha256": "88a25ae800a30123e92501a9c7fd7d569c5649352cd7b9fbb67acb2609d14c78"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $1 OFFSET $2",
+ "textSha256": "7111a5f4a6e015491a90a5a04c87c262836328dfe4cf08a563ea9bab6f6cb313"
}
],
"slugPrefix": [
@@ -503,8 +503,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.slug LIKE $1 ESCAPE '\\' AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "c3d77b145e83c4b5d27b3c2c4be1ab39dfa2de02ec0a5f6e80d89807e8b314d9"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.slug LIKE $1 ESCAPE '\\' AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "1c85149b8022246208b00e06ba72bdabcf8f3c554c73c3586c6dd36307133066"
}
],
"sort": [
@@ -515,7 +515,7 @@
"number"
],
"sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.deleted_at IS NULL ORDER BY p.slug ASC, p.source_id ASC, p.id ASC LIMIT $1 OFFSET $2",
- "textSha256": "f2142b0f2a082558ad2c58ec5b9ed6ad074c3b2566d31b7cbe580372c533d765"
+ "textSha256": "9528be19bc9bdfc8cd83599978a248425c6d756ec6fc2b1d40b6ba0bae361fce"
}
],
"sourceId": [
@@ -526,8 +526,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.source_id = $1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "af95db9a73f91d9b0e61ad64b5e86e8dd96f9002dc570d21f0768312fce390b7"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.source_id = $1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "0b7ce1d18c431b24eca0237e7a8f2cc72e08c2e6c389c73f7e16273aec8907db"
}
],
"sourceIds": [
@@ -538,8 +538,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.source_id = ANY($1::text[]) AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "11551be34c7fbe0730ac398ee6cd5adc3f3e584208fdda55910b1a977c00c638"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.source_id = ANY($1::text[]) AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "8734246416f862843af720bc788f75f733bd455b20ed4fd8f79a1e648e0d498c"
}
],
"tag": [
@@ -550,8 +550,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p JOIN tags t ON t.page_id = p.id WHERE 1=1 AND t.tag = $1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "4c16627334aff5a4ae92e92e075f56a3bab769967cc0160ae82af805be9a1683"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p JOIN tags t ON t.page_id = p.id WHERE 1=1 AND t.tag = $1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "a822dd046fae47e749537747876a845f6beab727cb54680456ff7fea723c8e79"
}
],
"type": [
@@ -562,8 +562,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.type = $1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "142cd63350c7d54827843daeca3261efbd6589ef71e31b06fafc7ff5ac25f83f"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.type = $1 AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "6f939279c2d90ecb8217ef33a923bf54328fd994a3b43c5c0d0c33dc5559a4e5"
}
],
"updatedAfterKeyset": [
@@ -576,8 +576,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND (p.updated_at > $1::text::timestamptz OR (p.updated_at = $2::text::timestamptz AND p.slug > $3)) AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $4 OFFSET $5",
- "textSha256": "e8c035bd6109b92df5e6f89080db721da06e12d57e58d3d7d7c98346d70a30af"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND (p.updated_at > $1::text::timestamptz OR (p.updated_at = $2::text::timestamptz AND p.slug > $3)) AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $4 OFFSET $5",
+ "textSha256": "5624972aa552ba952b2321663a59a0ac2e0f7f1684f9676ef317da8b3e0149b3"
}
],
"updated_after": [
@@ -588,8 +588,8 @@
"number",
"number"
],
- "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.updated_at > $1::text::timestamptz AND p.deleted_at IS NULL ORDER BY p.updated_at DESC LIMIT $2 OFFSET $3",
- "textSha256": "98825ce723c789c3a2796f00c1fa36e988d6630803577600aed5a85adb258624"
+ "sql": "SELECT p.*, to_char(p.updated_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS updated_at_iso FROM pages p WHERE 1=1 AND p.updated_at > $1::text::timestamptz AND p.deleted_at IS NULL ORDER BY p.updated_at DESC, p.slug DESC, p.source_id DESC, p.id DESC LIMIT $2 OFFSET $3",
+ "textSha256": "a1c730170025919ab78bd8bd2f5b62dc41d02fc57d374e5418f0836ae1e4978d"
}
]
},
diff --git a/test/mcp-schema-budget.test.ts b/test/mcp-schema-budget.test.ts
index 915bfb5127..c5ec91e93f 100644
--- a/test/mcp-schema-budget.test.ts
+++ b/test/mcp-schema-budget.test.ts
@@ -67,9 +67,14 @@ const PARAM_DESCRIPTION_HARD_CAP = 200;
* entity 470 -> 550: the additive `names` param (resolve up to 50 names in one
* call, Cat 40 Hard round 4), measured at 546 with the `name` example and part
* of the miss sentence trimmed so the served starter list stays under 25,000.
+ * add_timeline_entry 680 -> 740 (#5970, wave 15): the description names the
+ * correction route (edit its bullet via edit_page with expected_revision),
+ * measured at 739; paid for by trimming get_ingest_log, list_write_requests,
+ * traverse_graph, resolve_slugs and list_link_sources text (no pinned phrase
+ * touched) so the served starter list stays under 25,000.
*/
const TOOL_BUDGETS: Record<string, number> = {
- add_timeline_entry: 680, cancel_job: 270, cancel_write_request: 350, capture: 1250, context_pack: 760,
+ add_timeline_entry: 740, cancel_job: 270, cancel_write_request: 350, capture: 1250, context_pack: 760,
delete_skill: 810, delta: 830, edit_page: 1090, entity: 550, find_anomalies: 520, forget: 560, get_agent_job: 270,
get_backlinks: 770, get_ingest_log: 280, get_page: 930, get_recent_salience: 660, get_skill: 910,
get_skill_asset: 790, get_write_request: 360, join_brain: 560, leave_brain: 540, list_brain_skillpack: 230,
diff --git a/test/pack-extractable-floor-5756.serial.test.ts b/test/pack-extractable-floor-5756.test.ts
similarity index 96%
rename from test/pack-extractable-floor-5756.serial.test.ts
rename to test/pack-extractable-floor-5756.test.ts
index 4ea7a4a2b0..d034f3b114 100644
--- a/test/pack-extractable-floor-5756.serial.test.ts
+++ b/test/pack-extractable-floor-5756.test.ts
@@ -5,9 +5,8 @@
* applies only to types the active pack is silent about, so gbrain-base
* (meeting/source declared true, the rest undeclared) is unchanged, while
* gbrain-recommended's `source: extractable: false` now holds for atoms the
- * way it already did for facts (facts/eligibility.ts).
- *
- * Serial: selects the active pack through GBRAIN_SCHEMA_PACK.
+ * way it already did for facts (facts/eligibility.ts). The active pack is
+ * selected through GBRAIN_SCHEMA_PACK inside withEnv, so nothing leaks.
*/
import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
import { withEnv } from './helpers/with-env.ts';
diff --git a/test/schema-bootstrap-coverage.test.ts b/test/schema-bootstrap-coverage.test.ts
index fdaa587c44..93490f4134 100644
--- a/test/schema-bootstrap-coverage.test.ts
+++ b/test/schema-bootstrap-coverage.test.ts
@@ -1039,6 +1039,13 @@ const COLUMN_EXEMPTIONS = new Set<string>([
// statement shape, doctor's extract_health falls back to a 0-column
// query). Column-only, no bootstrap probe needed.
'extract_rollup_7d.expected_limit_count',
+ // #5495 (migration v239) — per-reason halt counter (jsonb). Same precedent
+ // as expected_limit_count: extract_rollup_7d is migration-created (v106,
+ // absent from both schema blobs), no index references the column, and both
+ // consumers handle absence explicitly (the rollup writer retries the
+ // pre-v239 UPSERT shape, the doctor read returns no reasons so every halt
+ // is `unknown`). Column-only, no bootstrap probe needed.
+ 'extract_rollup_7d.halt_reasons',
// #4069 (migration v143) — verdict TTL column. The PGLite half of this
// exemption is correct: dream_verdicts is migration-created on PGLite
// (v30, absent from PGLITE_SCHEMA_SQL), so no PGLite-blob forward