Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(wave18b): integrate lanes 1-5 — drop lane hand-off notes, regenerate llms and export golden, re-sum module ceilings, trim core-persistence key-files entry under its cap

garrytan8586f1fbfeb4
diff --git a/.gstack/pregate.json b/.gstack/pregate.json
index c240808a76..8abfc4eba7 100644
--- a/.gstack/pregate.json
+++ b/.gstack/pregate.json
@@ -1,6 +1,5 @@
{
"dependencies": {
- ".wave18b/**": [],
"test/**/*.serial.test.ts": [
"test/scripts/serial-files.test.ts"
],
diff --git a/.wave18b/lane2-manifest.md b/.wave18b/lane2-manifest.md
deleted file mode 100644
index a5d8e6f846..0000000000
--- a/.wave18b/lane2-manifest.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Wave 18b lane 2: shared-file manifest
-
-Every edit to a shared registry, golden or generated file in this lane, for the
-integrator. All are appends or regenerations; no existing assertion was weakened.
-
-| File | Edit | Why |
-|---|---|---|
-| `src/core/config.ts` | +1 `KNOWN_CONFIG_KEYS` row `search.keyword_timeout_negative_cache_seconds` | 2.2 config key |
-| `test/config-search-registry.test.ts` | +1 `DIRECTLY_READ_SINGLETONS` row for the same key | registry test requires every registered `search.*` key to name its reader |
-| `src/commands/config/keyword-timeout-value.ts` | new branch in `refuseInvalidKeywordTimeoutValue` for the new key | `config set` validator (no `src/commands/config.ts` edit; the existing `search.` hook routes to it) |
-| `src/core/error-registry.ts` | +1 `CODES` entry `keyword_skipped_after_timeout`; +1 `NOTICE_CODES` entry `facts_calibration_unmeasured` | 2.2 skip code, 2.3 notice |
-| `docs/guides/error-codes.md` | regenerated (`bun run build:error-codes`) | so this lane's `verify` passes; integrator regenerates once after merging |
-| `src/core/types.ts` | +1 `DEGRADED_REASONS` member `skipped_after_timeout`; +1 `SearchOpts.keywordTimeoutCache`; one doc line on `useCache` | 2.2 |
-| `src/core/interop-notices.ts` | `degradedRecallNotice` names `keyword_arm_failed: skipped_after_timeout` with its own why and the `doctor --only keyword_plan` fix | 2.2 reason registered with why/fix |
-| `scripts/module-size-limits.tsv` | ceilings: `postgres-engine.ts` 3060 -> 3063, `types.ts` 2315 -> 2319, `config.ts` 1979 -> 1980 (notes appended) | façade growth for 2.2 |
-| `test/postgres-unit-arms.txt` | +1 row `test/keyword-timeout-negative-cache-6495.test.ts` | its DATABASE_URL-gated arm runs in a Postgres lane (`check:postgres-lanes`) |
-| `llms-full.txt` | regenerated (`bun run build:llms`; it inlines `docs/guides/troubleshooting.md`) | so `check:regen-all` passes; integrator regenerates once after merging |
-| `.gstack/pregate.json` | +1 `dependencies` row `".wave18b/**": []` | the wave's hand-off notes have no test lane; pregate run with `--policy-from head` (the integrator drops the row with `.wave18b/`) |
-| `test/fixtures/goldens/exports/types.json` | regenerated | `DEGRADED_REASONS`/`DegradedReason`, `SearchOpts.keywordTimeoutCache`, `PostgresEngine` private `keywordTimeouts` |
-| `test/fixtures/goldens/doctor/json-postgres-fresh.json`, `test/fixtures/goldens/doctor/hot-checks-postgres-json.json` | regenerated on Postgres | `keyword_plan.details.negative_cache` (only diff) |
-
-Not touched: doctor `registry.ts`, `doctor-categories.ts` (no new check), `run-verify-parallel.sh` (the 2.1 call-site guard is a unit test, not a verify script), `registry-build-checks.json`, `llms.txt` (unchanged by the regeneration), CHANGELOG, `BEHAVIOR_CHANGES`, VERSION.
-
-Docs edited (not registries): `docs/guides/troubleshooting.md`, `docs/mcp/TOOL_REFERENCE.md`, `docs/protocol/MEMORY_VERBS_v1.md`, `docs/architecture/key-files/engines-2.md`, `docs/architecture/key-files/graph-and-facts.md`.
diff --git a/.wave18b/lane2-release-notes.md b/.wave18b/lane2-release-notes.md
deleted file mode 100644
index b4e9702324..0000000000
--- a/.wave18b/lane2-release-notes.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Wave 18b lane 2: proposed release notes (search and recall correctness)
-
-The integrator assembles these into CHANGELOG and `BEHAVIOR_CHANGES`; no version
-header or `since:` value is set here.
-
-## CHANGELOG bullets ("What you'd see" rows and itemized changes)
-
-### What you'd see
-
-| Situation | Before | Now |
-|---|---|---|
-| A brain with `embedding_query_prefix` set runs `gbrain think`, MCP `think`, `synthesize`, CRAG think escalation or dream auto-think | the question's takes vector embedded without the prefix | embedded with the brain's prefix, like hybrid search |
-| `gbrain takes search --semantic`, `gbrain search diagnose`, eval's vector baseline, `gbrain brainstorm` on a prefix brain | bare query embedding | prefixed query embedding (saved eval baselines on prefix brains move) |
-| A broad hybrid keyword search on a large Postgres brain times out, then the same search runs again in the same `gbrain serve` / MCP process | waits the full `search.keyword_statement_timeout_ms` again and times out again | answers at once from the vector arm with `keyword_arm_failed: skipped_after_timeout` for 10 minutes (`search.keyword_timeout_negative_cache_seconds`, 0 = off); a narrower or differently scoped query still runs keyword search |
-| `recall --question` on an embedding model whose fact admission floors were never measured | nothing says the floors are unmeasured | an informational `facts_calibration: {status: "unmeasured", model_key}` field on every such call, and one `facts_calibration_unmeasured` info notice per session pointing at `gbrain doctor --only fact_admission_floors` |
-
-### Itemized changes
-
-- `src/core/search/query-prefix.ts`: `embedQueryWithPrefix(engine, text, opts?)` loads the brain's `embedding_query_prefix` and embeds with the unbounded `embedQuery`, so each caller keeps its deadline behavior. Swapped in at `ops/search.ts` (CRAG), `verbs.ts` (synthesize), `commands/think.ts`, `commands/takes.ts`, `ops/takes.ts` (MCP think), `cycle/auto-think.ts`, `commands/search-diagnose.ts`, `search/eval.ts` and `brainstorm/orchestrator.ts` (a ninth site the guard found). `test/query-embed-call-sites.test.ts` walks the AST and allowlists the remaining direct `embedQuery` / `embedQueryBounded` uses with reasons (#3783).
-- `src/core/postgres-engine/keyword-timeout-cache.ts` (new): a per-engine negative cache keyed on the keyword statement text, its parameters, the RLS source scope and the statement timeout (strict and relaxed statements separately). Only a genuine statement-timeout 57014 records an entry, never a user or admin cancel; entries expire at the TTL, at most 256 per engine. Hybrid's keyword arm opts in (`SearchOpts.keywordTimeoutCache`) unless the call passed `useCache: false`; a skip reports `keyword_arm_failed` with the new degraded reason `skipped_after_timeout` and error code `keyword_skipped_after_timeout` (fix: `gbrain doctor --only keyword_plan --json`). No extra statement per search; the TTL is read on the first timeout and each timeout writes one bounded `search.keyword_timeout_stats` row, which doctor `keyword_plan` reports as `details.negative_cache`. New config key `search.keyword_timeout_negative_cache_seconds` (integer seconds, default 600, range 0-86400, 0 = off; `config set` refuses other values). Per process: `serve` and MCP benefit, one-shot CLI calls do not. Postgres only (#6495).
-- `src/core/facts/question-recall.ts`, `src/core/ops/facts.ts`, `src/core/verbs.ts`: recall's informational `facts_calibration` (declared in `RESPONSE_SCHEMAS`, `docs/protocol/MEMORY_VERBS_v1.md`, `docs/mcp/TOOL_REFERENCE.md`) and the `facts_calibration_unmeasured` info notice, deduped per brain per session through the notice ledger's `dedupe_key`. `facts_degraded` and `degraded_recall` are unchanged. `FACT_ADMISSION_FLOOR_EVIDENCE` moves to `search/fact-relevance.ts` so recall and doctor read one table (#6590).
-- Tests: `test/query-prefix-call-sites.serial.test.ts` (eight paths record the prefix through a stubbed transport), `test/query-embed-call-sites.test.ts`, `test/keyword-timeout-negative-cache-6495.test.ts` (unit arm on an injected executor plus a Postgres arm with locked tables), `test/recall-facts-calibration-6590.test.ts`. Each fails on master.
-- Docs: `docs/guides/troubleshooting.md` (keyword timeout section and symptom row: the skip, its key, its limits), `docs/mcp/TOOL_REFERENCE.md` (`search`/`query` keyword reason, recall `facts_calibration`), `docs/protocol/MEMORY_VERBS_v1.md` (field row), key-files entries.
-
-## Proposed BEHAVIOR_CHANGES rows (`since:` left to the integrator)
-
-- `think`, MCP `think`, `synthesize`, CRAG think escalation (`search.crag_think`), dream auto-think, `takes search --semantic`, `search diagnose`, `gbrain eval` vector baselines and `brainstorm` now embed their query with the brain's `embedding_query_prefix`, like hybrid search already did; on a brain with a prefix their retrieval shifts and saved eval baselines move.
-- On Postgres, a hybrid keyword statement that hit `search.keyword_statement_timeout_ms` is skipped for `search.keyword_timeout_negative_cache_seconds` (default 600 s, 0 = off) in the same serving process when the same statement and scope run again: the search answers from the vector arm with `keyword_arm_failed: skipped_after_timeout` instead of waiting for the timeout. A narrower or differently scoped query, another brain and `use_cache: false` still run it; each timeout writes one `search.keyword_timeout_stats` row that doctor `keyword_plan` reports.
-- `recall` with `question` adds an informational `facts_calibration: {status: "unmeasured", model_key}` when semantic matching ranked facts on an embedding model without measured admission floors, and shows one `facts_calibration_unmeasured` info notice per brain per session (mute with `gbrain notices mute facts_calibration_unmeasured`); `facts_degraded` is unchanged.
diff --git a/.wave18b/lane3-manifest.md b/.wave18b/lane3-manifest.md
deleted file mode 100644
index adb4a887fd..0000000000
--- a/.wave18b/lane3-manifest.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# Wave 18b lane 3: shared-file manifest
-
-Branch `capy/w18b-lane3`. These are the edits to files other lanes may also touch. The integrator merges these entries into the shared registries and regenerates the generated docs once after merging.
-
-## Registries and generated files
-
-- `src/core/error-registry.ts`: three new codes:
- - `embedding_identity_unqualified` (class `consent`, docs `troubleshooting.md#embedding-identity-unqualified`), 3.4
- - `patterns_min_interval` (class `consent`, fix `gbrain dream --phase patterns` with paid consent, docs `dream-patterns.md#cadence`), 3.2
- - `read_budget_exhausted` (class `caller`, docs `dream-patterns.md#child-read-budget`), 3.2
- - 3.3 reuses the existing `preview_changed` and `invalid_params`.
-- `docs/guides/error-codes.md`: regenerated (`bun run build:error-codes`) with the three codes above. The integrator regenerates again after merging.
-- `src/commands/doctor/registry.ts`: `embeddingIdentityEntry` registered right after `embeddingEnvOverrideEntry`.
-- `src/core/doctor-categories.ts`: category for `embedding_identity_unqualified`.
-- Doctor goldens: `test/fixtures/goldens/doctor/json-pglite-degraded.json`, `json-pglite-fresh.json`, `registry-build-checks.json`, `content-pglite-human.json`, `content-pglite-json.json`, `hot-checks-pglite-json.json`, and the Postgres E2E goldens `hot-checks-postgres-json.json`, `json-postgres-fresh.json` gain the new check (`GBRAIN_TEST_UPDATE_GOLDENS=1` on `test/doctor-registry-golden.test.ts`, `test/doctor-json-golden.test.ts`, `test/doctor-content-golden.test.ts`, `test/doctor-hot-checks-golden.test.ts`, `test/e2e/doctor-json-golden.test.ts`, `test/e2e/doctor-hot-checks-golden.test.ts`).
-- `src/core/cli-flag-registry.generated.ts` (`bun run regen:all`): `trust` gains `--expect`, `--repair-unknown-markers`, `--slug`.
-- `test/fixtures/goldens/exports/types.json` (export-surface golden): the error-code union gains the three new codes.
-- `llms.txt` / `llms-full.txt`: NOT regenerated (integrator-owned); `regen:all` adds the troubleshooting `#embedding-identity-unqualified` section to `llms-full.txt`, so `verify`'s `check:regen-all` fails on this branch until the integrator regenerates.
-- `test/fixtures/goldens/trust/help.txt`: the `--repair-unknown-markers` usage block.
-- `scripts/serial-files.tsv`: three R2 rows (mock.module): `test/cycle-patterns-timeline-appends.serial.test.ts`, `test/cycle-patterns-cadence.serial.test.ts`, `test/cycle-patterns-read-budget.serial.test.ts`.
-- `src/core/config.ts`: known config keys gain `dream.patterns.min_interval_hours` and `dream.patterns.child_read_budget_kb` (one line).
-- `scripts/module-size-limits.tsv`: ceiling bumps for `src/core/config.ts` (+1) and `src/core/cycle.ts` (+2).
-- `docs/architecture/canonical-writers.tsv`: `src/core/cycle/patterns.ts` ceiling 1 -> 2 (3.1 unmanaged-path timeline row delete for a quarantined append), rationale extended.
-- `TODOS.md`: the #6113 P2 free-relabel line now says the doctor check ships and the relabel stays parked.
-
-## Docs edits that may collide
-
-- `docs/architecture/key-files/core-cycle-continued.md` (patterns.ts entry), `core-minions-2.md` (brain-allowlist entry + new read-budget.ts entry), `security.md` (new marker-repair.ts entry), `commands-2-continued.md` (embedding-identity check entry).
-- `docs/guides/troubleshooting.md` (`#embedding-identity-unqualified`), `docs/guides/memory-trust.md` (`## Repair unknown markers`), `docs/guides/dream-patterns.md` (settings rows, `## Cadence`, `## Child read budget`, `## Timeline appends`, changelog bullets), `docs/guides/facts-relink.md` (CJK section), `docs/mcp/TOOL_REFERENCE.md` (`appended_unverified` deprecation note).
-
-## Existing-test change
-
-- `test/cycle-patterns-evidence-gate.serial.test.ts`: `beforeEach` sets `dream.patterns.min_interval_hours` to `0`, so the evidence-watermark tests keep testing only the watermark and the new 6 h cadence doesn't mask it. No assertion changed.
-
-## Related TODO the integrator may update
-
-- `TODOS.md` P3 "Transcript budget for dream patterns children (#6236)": 3.2 builds the per-job `get_page` read budget in the subagent tool wrapper (`src/core/minions/tools/read-budget.ts`). A whole-transcript budget is still not built, so lane 3 left the entry open.
diff --git a/.wave18b/lane3-release-notes.md b/.wave18b/lane3-release-notes.md
deleted file mode 100644
index 1c314885e8..0000000000
--- a/.wave18b/lane3-release-notes.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Wave 18b lane 3: release-note material for the integrator
-
-Lane 3 does not touch VERSION, CHANGELOG headers or `BEHAVIOR_CHANGES` `since:` values. The integrator folds these into the wave's CHANGELOG entry and `BEHAVIOR_CHANGES` rows (stamped with the wave's release).
-
-## CHANGELOG bullets (Itemized changes)
-
-- **Dream patterns: timeline appends are quote-verified and counted (#6302).** A patterns child mostly updates existing pattern pages with `add_timeline_entry`. The phase now selects the entries it newly published by write receipt (a committed `persistence_requests` row with outcome `ok`, deduplicated by request id and entry, so replays and skipped re-appends don't count again). It quote-verifies only those entries against this run's reflections. A failing entry moves to `unverified_claims` and its timeline row is removed; earlier verified content on the page is left alone. Those pages get provenance stamps and count in `patterns_written`. New result fields: `details.timeline_appends` and `quote_verify.timeline_appends`. `appended_unverified` is kept as a deprecated alias (TOOL_REFERENCE note) and removed two releases later. Files: `src/core/cycle/patterns.ts`, `test/cycle-patterns-timeline-appends.serial.test.ts`, `docs/guides/dream-patterns.md#timeline-appends`.
-- **Dream patterns: in-cycle cadence and a child read budget (#6297).** An in-cycle patterns run (autopilot, bare `gbrain dream`) now waits `dream.patterns.min_interval_hours` (default 6, `0` off) after the partition's last completed run. It skips with `patterns_min_interval` and reports `next_eligible_at`. A direct `gbrain dream --phase patterns` and `--once` aren't held to it. The stamp is per source incarnation, and the external-reflections partition has its own. The patterns child's `get_page` results are now budgeted at `dream.patterns.child_read_budget_kb` (default 200 KB, `0` off). Bytes are counted from the job's own tool-execution ledger, and past the budget a read returns a summary (`truncated: true`, `code: read_budget_exhausted`). Files: `src/core/cycle/patterns-plan.ts`, `src/core/cycle/phase-config-values.ts`, `src/core/minions/tools/read-budget.ts`, `src/core/minions/tools/brain-allowlist.ts`, `src/core/minions/handlers/subagent.ts`, `src/core/cycle.ts`, `src/commands/dream.ts`, `docs/guides/dream-patterns.md#cadence`, `#child-read-budget`.
-- **`gbrain trust backfill --repair-unknown-markers` (#6550).** This is a local-CLI repair for pages that an agent edit before v0.60.249.0 stamped with `trust_tier: unknown`, and that a later backfill classified higher. By default it previews: the slug, current marker, stored tier, proposed marker and tier, and the evidence (the first saved version that shows the marker, compared with when the fixed release first ran, and whether the first import had the marker). Pages are split into "consistent with #6550" and "ambiguous", and the preview ends with `Apply with: <exact command>` naming only the consistent pages. Apply needs `--slug` (repeatable) plus `--expect <preview hash>`, and rewrites only the named pages at their previewed revisions: the marker becomes the stored tier (none at owner tiers) and the tier stays. `gbrain trust review` adds a `repair` command to `lower_page` items that an unknown marker caused. Files: `src/core/trust/marker-repair.ts`, `src/core/trust/page-handlers.ts` (`trust_owner_page` mode `repair_marker`, refused for remote requests), `src/core/trust/review.ts`, `src/cli/commands/trust.ts`, `docs/guides/memory-trust.md#repair-unknown-markers`.
-- **Doctor `embedding_identity_unqualified` (#6113).** A new check warns when the brain's `embedding_model` config row has no provider prefix, which is a row from an older install that stops managed fact extraction. It prints a copy-paste `gbrain migrate embeddings --to <provider:model> --dry-run`, filled from the configured model (an `inputs` entry only when none is configured), and calls out a model switch when the configured model differs. The free relabel stays parked (TODOS P2). Files: `src/commands/doctor/checks/embedding-identity.ts`, `docs/guides/troubleshooting.md#embedding-identity-unqualified`.
-- **Docs: CJK fact subjects (#6620).** The facts guide now says that CJK fact subjects need a literal slug or a delimiter, and that inferring unspaced natural names isn't supported. The brief named `docs/guides/facts.md`, which doesn't exist, so the section is in `docs/guides/facts-relink.md`. A probe in `test/facts-subject-infer.test.ts` pins the documented behavior.
-
-## BEHAVIOR_CHANGES rows (text only; the integrator stamps `since:`)
-
-- 3.1: `Dream patterns now quote-verify the timeline entries a patterns child appends with add_timeline_entry: an entry quoting text that is not in this run's reflections moves to the page's unverified_claims, and appended pages count in patterns_written (new details.timeline_appends). appended_unverified stays as a deprecated alias.`
-- 3.2: `In-cycle dream patterns runs (autopilot, bare gbrain dream) now wait dream.patterns.min_interval_hours (default 6) after the last completed run and skip with patterns_min_interval and next_eligible_at; gbrain dream --phase patterns and --once still run at once. A patterns child's get_page results past dream.patterns.child_read_budget_kb (default 200 KB) come back as a short summary (truncated: true, read_budget_exhausted). Set either to 0 to turn it off.`
-- 3.3: `New: gbrain trust backfill --repair-unknown-markers previews pages whose trust_tier: unknown marker sits below their stored tier (stamped by agent edits before v0.60.249.0) with the evidence for each, and repairs only the pages you name with --slug and the preview hash (--expect). gbrain trust review shows a repair command on lower_page items that marker caused.`
-- 3.4: `gbrain doctor has a new embedding_identity_unqualified check: a brain whose embedding_model row has no provider prefix now warns and names the gbrain migrate embeddings --to <provider:model> --dry-run preview (applying it re-embeds facts and is paid).`
diff --git a/.wave18b/lane4-manifest.md b/.wave18b/lane4-manifest.md
deleted file mode 100644
index 2603ccf4a3..0000000000
--- a/.wave18b/lane4-manifest.md
+++ /dev/null
@@ -1,56 +0,0 @@
-# Wave 18b lane 4: shared-file manifest
-
-Every edit lane 4 made to a file another lane or the integrator also owns. Each is a minimal append or a
-one-line change; regenerate the generated files once after merging all lanes.
-
-## Registries (append-only entries)
-
-| File | Entry | Item |
-|---|---|---|
-| `src/core/error-registry.ts` | `ipc_path_too_long` (host_only) | 4.2 |
-| `src/core/error-registry.ts` | `backup_too_large` (host_only, physical-copy fix) | 4.5 |
-| `src/core/error-registry.ts` | `unmanaged_database_path` (host_only, physical-copy fix; the code was already thrown, now registered) | 4.5 |
-| `src/core/error-registry.ts` | `pending_verify` (host_only, `exit: 13`) | 4.4 |
-| `src/core/exit-codes.ts` | `HARNESS_PENDING_VERIFY_EXIT_CODE = 13` (header comment updated) | 4.4 |
-| `test/exit-codes.test.ts` | two expectations: the constant is 13, `exitCodeForCode('pending_verify')` is 13 | 4.4 |
-| `src/commands/doctor/registry.ts` | `ipcSocketPathEntry` after `pgliteDataDirEntry` | 4.2 |
-| `src/core/doctor-categories.ts` | `ipc_socket_path` → `ops` | 4.2 |
-| `test/fixtures/goldens/doctor/registry-build-checks.json` | 4 lines for the `ipc_socket_path` entry | 4.2 |
-| `scripts/serial-files.tsv` | rows for `test/resolve-ipc-rebind.serial.test.ts` (4.1), `test/windows-ipc-long-path-6573.serial.test.ts` (4.2, R1) and `test/backup-preflight-6649.serial.test.ts` (4.5, R3) | 4.1, 4.2, 4.5 |
-| `scripts/check-agent-contract.ts` | `READ_ONLY_SUBCOMMANDS` gains `bootstrap harness --status` (it takes no lock and writes nothing) | 4.4 |
-| `scripts/check-windows-hide.ts` | `NOT_YET_MIGRATED` trimmed from 84 to 13 entries (`import.ts` and `facts/purge-verify.ts` migrated after #6787 merged), each naming its owner | 4.3 |
-| `test/fixtures/guards/check-windows-hide.ts/{good,bad-stale-migration}` | fixture file moved from `src/core/tailscale.ts` to `src/core/persistence/topology-filesystem.ts` (still listed) | 4.3 |
-| `test/scripts/windows-hide-guard.test.ts` | ratchet fixture repointed from `src/core/tailscale.ts` (migrated) to `src/core/persistence/topology-filesystem.ts` | 4.3 |
-| `.github/workflows/persistence-validation.yml` | `test/e2e/transaction-cancel-held-lock.test.ts` added to the direct + pooled step (`Require canonical reconciliation through direct and pooled PostgreSQL`) so its PgBouncer arm runs in CI | 4.6 |
-| `.github/workflows/test.yml` | Windows-only step `Long Windows PGLite IPC paths use the per-user run dir (#6573)` running `test/windows-ipc-long-path-6573.serial.test.ts`, after the #4992 hidden-console step | 4.2 |
-| `test/fixtures/goldens/exports/types.json` | the registry code union gains the four codes (`regen:all --goldens`; justify in the PR body as new registered codes) | 4.2, 4.4, 4.5 |
-
-## Generated docs (committed regenerated; regenerate once after merge)
-
-- `docs/guides/error-codes.md` (`bun run build:error-codes`): the four codes above.
-- `bun run build:agent-protocol` + `regen:all` copies of the exit-13 row: `skills/conventions/agent-operator-protocol.md`,
- `plugin/skills/conventions/agent-operator-protocol.md`, `plugin-variants/gbrain-{coding,daily}/skills/conventions/agent-operator-protocol.md`,
- `skills/skills.lock.json`.
-- Not regenerated (integrator): `llms.txt` / `llms-full.txt` (`regen:all --check` reports them stale on this branch).
-
-## Shared docs (hand-edited)
-
-| File | Change | Item |
-|---|---|---|
-| `docs/guides/troubleshooting.md` | symptom rows and sections `#ipc-path-too-long`, `#backup-too-large` | 4.2, 4.5 |
-| `docs/guides/in-agent-setup.md` | §6 preflight paragraph, new `### Large or non-standard brains: quiesced physical copy`, troubleshooting row | 4.5 |
-| `docs/guides/bootstrap.md` | `#pending-verify` paragraph in the PGLite note | 4.4 |
-| `docs/guides/exit-codes.md` | row for exit 13 | 4.4 |
-| `docs/protocol/AGENT_OPERATOR_v1.md` | row for exit 13 in the exit-code table | 4.4 |
-| `docs/architecture/key-files/{engines-2,mcp,core-services-1-continued,google-and-loops,agent-bootstrap}.md` | per-file entries for the touched modules | all |
-| `vendor/README.md` | the `own()` cancel-and-discard hunk in the patch inventory | 4.6 |
-
-## Driver patch (4.6, its own commit 255e2357)
-
-`patches/[email protected]` is the source of truth; `vendor/postgres/{src,cjs/src,cf/src}/index.js` and
-`vendor/postgres/types/index.d.ts` were rebuilt with `bash vendor/update-postgres.sh` and `--check` is clean.
-
-## Not touched
-
-No `src/core/persistence/*` or `sync*` edits; VERSION, CHANGELOG headers, BEHAVIOR_CHANGES `since:` values and
-`llms*.txt` are untouched (rows are in `lane4-release-notes.md`).
diff --git a/.wave18b/lane4-release-notes.md b/.wave18b/lane4-release-notes.md
deleted file mode 100644
index cabe26db76..0000000000
--- a/.wave18b/lane4-release-notes.md
+++ /dev/null
@@ -1,56 +0,0 @@
-# Wave 18b lane 4: release notes for the integrator
-
-Version stamps, CHANGELOG headers and `since:` values are the integrator's. Rows below use `since: '<WAVE_VERSION>'`.
-
-## CHANGELOG bullets (Itemized changes)
-
-- **Transaction aborts cancel their running statement (#6598).** An aborted Postgres transaction now sends the
- driver's cancel for the statement it is running before it discards the reserved connection, so a statement blocked
- on a lock no longer keeps running on the server after the caller gave up. `vendor/postgres` (and
- `patches/[email protected]`) gain `own()` cancel-and-discard; `transaction-abort.ts` uses it with a settle window
- (`cancelSettleMs`). The abort's `cause` stays the driver error; a failed cancel is reported as `cancelFailure`.
- Contributed by @Kkkkkuro (re-land of the cancel hunk from #6790). Proven on direct Postgres and PgBouncer
- (`test/e2e/transaction-cancel-held-lock.test.ts`).
-- **A surviving `gbrain serve` takes over resolve IPC once the owner exits (#6647).** Each socket a serve could not
- bind (source and legacy) retries on an unref'd timer every 30 s plus jitter, through the single-owner probe, so
- hooks keep their per-turn context after the first serve stops.
-- **Long Windows PGLite paths keep working IPC (#6573).** On Windows, a data-dir socket path over the 107-byte
- afunix limit moves to `%USERPROFILE%\.gbrain\run\<kind>-<hash12>.sock`, still guarded by `.gbrain-ipc-secret`.
- A path still too long there is reported as `ipc_path_too_long` in the serve log and by the new doctor check
- `ipc_socket_path`, with the move-the-brain fix.
-- **Process launches hide their console window on Windows (#4992).** 71 more files now launch through
- `src/core/spawn.ts`; the `NOT_YET_MIGRATED` ratchet lists 13 files (open PRs and the persistence write path).
-- **`gbrain backup create` refuses brains its archive cannot hold, up front (#6649).** A flat or symlinked data dir
- is `unmanaged_database_path` (before: a one-line refusal, or a generic `symlink_path` for a `.gbrain` alias) and an
- estimated archive over 8 GiB is `backup_too_large` (before: the dump ran and failed late, "Out of memory"). Both
- refuse before the lock or any write and point at the new quiesced physical-copy runbook
- (`docs/guides/in-agent-setup.md`), proven by a restore drill test. Doctor's `pglite_data_dir` warns from 75% of
- the cap. #6649 stays open for native archives over 8 GiB.
-- **`bootstrap harness --token` on PGLite no longer needs the serve running to wire (#6661).** With no serve
- answering and none holding the brain, the run wires every target and ends `pending_verify` (exit 13, JSON
- `status: "pending_verify"`); its `fix` is the same `--token` re-run once the serve is up, which runs while the serve
- holds the brain. `bootstrap harness --status` stays `partial` (exit 1) until then.
-
-## BEHAVIOR_CHANGES rows (src/core/behavior-change-notice.ts)
-
-```ts
- // Wave 18b lane 4 item 4.6 (#6598).
- { since: '<WAVE_VERSION>', text: 'On Postgres, an aborted transaction (a request deadline, a cancelled job or a closed client) now cancels the statement it is running before it releases the connection, instead of leaving that statement running on the server until it finished on its own. A statement waiting on a lock is cancelled within the settle window; the abort error keeps the driver error as `cause` and reports a failed cancel as `cancelFailure`.' },
- // Wave 18b lane 4 item 4.1 (#6647).
- { since: '<WAVE_VERSION>', text: 'A second `gbrain serve` that could not bind the resolve IPC socket (another serve owned it) now retries every 30 seconds (plus up to 5 s jitter) and takes the socket over once the owner is gone, so hooks keep per-turn context without restarting the surviving serve. The single-owner rule is unchanged: a live owner is never displaced.' },
- // Wave 18b lane 4 item 4.2 (#6573).
- { since: '<WAVE_VERSION>', text: 'On Windows, a PGLite brain whose data directory makes the IPC socket path longer than 107 bytes now places its sockets at `%USERPROFILE%\\.gbrain\\run\\<kind>-<hash>.sock` (the Postgres scheme, same `.gbrain-ipc-secret` guard) instead of failing to bind them, so hooks and local commands reach `gbrain serve` again. A path still too long is logged as `ipc_path_too_long` and reported by the new doctor check `ipc_socket_path`.' },
- // Wave 18b lane 4 item 4.5 (#6649).
- { since: '<WAVE_VERSION>', text: '`gbrain backup create` on PGLite now refuses before it takes the lock or writes anything when the brain is outside what its archive holds: a data directory that is not `<root>/.gbrain/brain.pglite` or is reached through a symlink is `unmanaged_database_path` (a `.gbrain` alias used to get `symlink_path`), and an estimated archive over 8 GiB is `backup_too_large` (it used to run the dump and fail late). Under `--json` both are their own envelope with an ask-the-user physical-copy fix instead of `storage_error`; the legacy `reason` is unchanged. Doctor `pglite_data_dir` now warns on a healthy PGLite brain whose estimated archive passes 6 GiB.' },
- // Wave 18b lane 4 item 4.4 (#6661).
- { since: '<WAVE_VERSION>', text: '`gbrain bootstrap harness --token` on a PGLite brain now wires the harness when no serve answers at the serve URL and none holds the brain, and exits 13 with JSON `status: "pending_verify"` instead of exit 1 before writing anything. Re-run the same command with the same `--token` once `gbrain serve --http` runs to verify it; `gbrain bootstrap harness --status` reports `status: "partial"` and exits 1 until that run passes. A serve holding the brain at another URL, any HTTP answer, no `--token` and Postgres brains still fail as before. The harness `--json` result gains `status` (`ok`, `failed` or `pending_verify`).' },
-```
-
-## PR body notes
-
-- Partially supersedes #6790 (Kkkkkuro): this lane re-lands its `own()` cancel-and-discard hunk, the
- `types/index.d.ts` hunk and its offline cancel-order test. Design change from #6790: the abort's `cause` stays the
- driver error (callers such as `publication-deadline.ts` classify `cause.code`), and a cancel failure is a new
- enumerable `cancelFailure` field; the #6790 test is adjusted to that. Credit: `Contributed by @Kkkkkuro` plus the
- `Co-Authored-By` trailer on commit 255e2357.
-- Addresses #6647, #6573, #4992 (ratchet step), #6598, #6661; refs #6649 (stays open: archives over 8 GiB).
diff --git a/.wave18b/lane5-manifest.md b/.wave18b/lane5-manifest.md
deleted file mode 100644
index 67ba489123..0000000000
--- a/.wave18b/lane5-manifest.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Wave 18b lane 5: shared-file manifest
-
-Every edit this lane made to a shared registry, generated file or ratchet.
-Each is a minimal append; resolve merge conflicts by keeping every lane's rows.
-
-| File | Edit |
-|---|---|
-| `src/core/config.ts` | One `KNOWN_CONFIG_KEYS` row: `loops.updates_require_reciprocity` (with a one-line comment). Validator lives in `src/core/google/loops-reciprocity.ts`, wired in `src/commands/config/loops-values.ts`. |
-| `src/core/error-registry.ts` | One entry: `calendar_unreadable` (class `caller`, docs `docs/guides/google-connect.md#unreadable-calendar`, fix argv `gbrain google calendars --json`, verify `gbrain doctor --only google_calendar_readable --json`). |
-| `docs/guides/error-codes.md` | Regenerated with `bun run build:error-codes` after the registry append. Regenerate again after merging other lanes' codes. |
-| `src/core/doctor-categories.ts` | `google_calendar_readable` appended to the `ops` category. |
-| `src/commands/doctor/wave-checks.ts` | One check registration: `google_calendar_readable` (resolution `operator`, registration `wave`, hostOnly). |
-| `src/commands/doctor/checks/graph-health.ts` | `google_calendar_readable` appended to the `timelineHistoryEntry` emits list. |
-| `test/fixtures/goldens/doctor/registry-build-checks.json` | One golden row `{ category: ops, name: google_calendar_readable }`. |
-| `src/core/operation-manifest.generated.ts` | Regenerated (`bun run scripts/build-operation-manifest.ts`) for the new `loops_mute` / `loops_unmute` / `open_loops` descriptions. Regenerate after merging other lanes' op changes. |
-| `src/core/cli-flag-registry.generated.ts` | Regenerated by `bun run regen:all` (`loops` gains `--dry-run`; string-literal scan adds `--apply` to `config`, `--account` to `doctor`/`maintain`). |
-| `test/fixtures/goldens/cli/tools-json.json`, `test/fixtures/goldens/exports/types.json` | Contract goldens regenerated (`bun run regen:all --goldens`): the new `open_loops` / `loops_mute` / `loops_unmute` descriptions, and `calendar_unreadable` in the error-code union. Justify in the PR body. |
-| `test/fixtures/goldens/doctor/{json-pglite-fresh,json-pglite-degraded,hot-checks-pglite-json,json-postgres-fresh,hot-checks-postgres-json}.json` | Each gains the one `google_calendar_readable` ok row (`GBRAIN_TEST_UPDATE_GOLDENS=1`; the two Postgres ones against a local pgvector container). Regenerate after merging other lanes' doctor checks. |
-| `llms.txt`, `llms-full.txt` | NOT regenerated (integrator's job): `bun run verify` reports them stale from this lane's doc edits; `bun run regen:all` fixes it. |
-| `scripts/module-size-limits.tsv` | `src/core/config.ts` 1979 → 1981; `src/commands/config.ts` 1508 → 1509 (each note names lane 5). `src/commands/sources.ts` stays under its existing 2059 ceiling (2052 lines). |
-| `src/commands/sources.ts` | `case 'set-calendar'` dispatch and one help row; `runSetCrMode` prints the contextual-mode hint. |
-| `skills/google-loops/SKILL.md` → `skills/skills.lock.json`, `plugin/skills/google-loops/SKILL.md` | Runbook lines for mute/unmute/drop sender and `withheld_noise`; lock and plugin tree regenerated (`bun run scripts/generate-skills-manifest.ts`, `bun run scripts/generate-plugin-tree.ts --out plugin --variants-out plugin-variants`). Regenerate after merging if another lane edits skills. |
-| `docs/architecture/key-files/{open-loops-engine,google-and-loops,google-and-loops-continued,commands-1,commands-5}.md` | Bullets updated; new bullets for `loops-reciprocity.ts`, `google-calendar-status.ts`, `sources-set-calendar.ts`, `doctor/checks/google-calendar.ts`, `config/contextual-mode-hint.ts`. `google-and-loops-continued.md` is at 59,769 of its 60,000-byte cap. |
-
-Not touched: VERSION, CHANGELOG, `BEHAVIOR_CHANGES` (rows are in `lane5-release-notes.md`), `llms*.txt`, any `persistence/sync*` file.
-
-Connector state additions (no migration): `GoogleSourceState.loop_withheld_senders`, `loop_automated_backfill_done`, `calendar_unreadable`, published by `loopRecoveryState` in `google-source.ts` on partial managed runs. `open_loops.closed_by` gains the values `muted`, `mute_recheck`, `unmuted` (free text column; no schema change).
diff --git a/.wave18b/lane5-release-notes.md b/.wave18b/lane5-release-notes.md
deleted file mode 100644
index 8f78722c0d..0000000000
--- a/.wave18b/lane5-release-notes.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Wave 18b lane 5: release notes (#5012 items 8, 9, 6)
-
-The integrator merges these into CHANGELOG.md and `BEHAVIOR_CHANGES`
-(`src/core/behavior-change-notice.ts`) at stamp time. `since` is the wave's
-release; nothing here sets a version.
-
-Issue status for the PR body: `Addresses #5012` (item 8: the reporter's own
-bank alerts were not replayed, so this lane does not claim them fixed; item 9
-and item 6 are fixed by the code and probes below).
-
-## CHANGELOG bullets
-
-### What you'd see
-
-| Situation | Before | Now |
-|---|---|---|
-| A bank, payment or shipping alert sent with `Precedence: bulk`, `list` or `junk`, a `List-Id`, or a no-reply `Reply-To` | `gbrain waiting` lists it as a person waiting on you | no reply-owed loop opens; the sync log prints `[google] reply-owed loops withheld: automated_mail=N` |
-| Older reply-owed loops from those senders | stay listed with no way out but one `loops drop <id>` at a time | `gbrain waiting` counts them and prints `gbrain loops drop sender <email> --source <id> --dry-run` per sender; the dry run lists ids, the apply closes them (cannot be undone) |
-| `gbrain loops mute sender <email>` / `mute thread <id>` | stops new loops; existing loops stay open | also closes that sender's or thread's open reply-owed loops and prints the count and the `Undo:` command; `--dry-run` lists them first |
-| `gbrain loops unmute ...` | loops closed during the mute stay closed | the loops the mute closed are re-checked on the next Gmail sync; one reopens only if nothing answered its thread since; `--dry-run` lists them |
-| Gmail files a cold introduction under Updates | opens a loop | unchanged by default; `gbrain config set loops.updates_require_reciprocity true` (opt-in) requires that you wrote to the sender before Updates mail opens a loop |
-| The source's calendar id is one the account cannot read (HTTP 403/404) | the sweep looks like an empty calendar | the sync logs `calendar_unreadable` with the fix; `gbrain google status` names it (`ok: false`, exit 1); doctor `google_calendar_readable` warns |
-| Pointing a Google source at another calendar | edit `g_calendar_id` by hand | `gbrain sources set-calendar <source> <calendar-id>` |
-| `gbrain config set search.contextual_retrieval <mode>` or `gbrain sources set-cr-mode` | silent about existing pages | prints that existing pages keep their recorded mode and names `gbrain repair contextual-mode` |
-
-### Itemized changes
-
-- Loop noise (#5012 item 8). `src/core/google/google-clients.ts` captures `Precedence`, `List-Id` and `Reply-To`; `isPositivelyAutomated` (`google-render.ts`) and `detectThreadLoop` (`loop-detect.ts`) withhold the reply-owed open with a typed `withheld` reason (`automated_mail`, `updates_without_reciprocity`); closes are unaffected. The sweep records withheld senders in connector state (`loop_withheld_senders`, at most 2,000) and, once, re-checks the newest thread of up to 500 senders with open reply-owed loops (`loop-catchup.ts` `seedLoopRechecks`).
-- Mute closes, unmute re-checks. `loops-store.ts` `closeMutedLoops` / `requeueMutedLoops` / `settleMuteRecheck`; the upsert never reopens a `muted` loop for the same counterparty and reopens a `mute_recheck` loop on the re-check's verdict. `loops_mute` returns `closed` (dry run `would_close`) and `undo_command`; `loops_unmute` returns `requeued`, `unverifiable`, `stale_source` with `recheck_command`, and `undo_command` (dry run `would_requeue`). Manual closes are never touched; a loop another mute still covers stays closed.
-- `gbrain loops drop sender <email> [--source] [--note] [--dry-run]` (`src/commands/loops.ts`); `open_loops` grouped view and `gbrain waiting` add `withheld_noise`.
-- New opt-in key `loops.updates_require_reciprocity` (default `false`, boolean, off value `false`; validated at `config set`) in `src/core/google/loops-reciprocity.ts`.
-- Unreadable calendar (#5012 item 9). `GoogleForbiddenError` and `CalendarClient.probeCalendar`; the calendar sweep records `calendar_unreadable` without failing the run (`people-calendar-sweep.ts`); `gbrain google status` probes live (`--no-probe` reads the record); new doctor check `google_calendar_readable`; new error code `calendar_unreadable`; new `gbrain sources set-calendar` (`src/commands/sources-set-calendar.ts`; on a managed brain whose source also syncs Gmail or Contacts it needs `--yes`, exit 3 `confirmation_required` otherwise, because the cursor is keyed by the source's configuration).
-- Contextual retrieval hint (#5012 item 6): `src/commands/config/contextual-mode-hint.ts`, printed by `config set search.contextual_retrieval` and `sources set-cr-mode`.
-- Tests: `test/loops-noise-5012.test.ts`, `test/loops-noise-5012-store.test.ts` (+ `test/e2e/loops-noise-5012-postgres.test.ts`), `test/google-calendar-unreadable-5012.test.ts`, new cases in `test/google-loop-detect.test.ts` and `test/google-clients.test.ts`. Every case fails on master 3c16e9ba (31 failing tests) and passes on the branch.
-- Docs: `docs/guides/open-loops.md`, `docs/guides/google-connect.md` (Unreadable calendar), `docs/guides/troubleshooting.md`, `docs/guides/multi-source-brains.md`, `skills/google-loops/SKILL.md`, key-files entries.
-
-## BEHAVIOR_CHANGES rows (append; `since` = the wave's stamp)
-
-```ts
- // Wave 18b lane 5 (#5012 item 8).
- { since: '<wave release>', text: 'Gmail mail sent with `Precedence: bulk`, `list` or `junk`, a `List-Id` header, or a no-reply `Reply-To` no longer opens a reply-owed loop in `gbrain waiting`. Loops opened before this release stay open: `gbrain waiting` counts those from such senders and prints `gbrain loops drop sender <email> --source <id> --dry-run` for each (preview, then run without `--dry-run`; a drop cannot be undone).' },
- { since: '<wave release>', text: '`gbrain loops mute sender|thread` (`loops_mute`) now also closes the muted sender\'s or thread\'s open reply-owed loops (status `dropped`, `closed_by: muted`) and returns their ids in `closed`; before, existing loops stayed open. `gbrain loops unmute` (`loops_unmute`) queues those loops for a re-check on the next Gmail sync, which reopens one only when nothing answered its thread since, and returns `requeued`. Both take `--dry-run` (`dry_run`) and return an `undo_command`. Commitment and decision loops and manually closed loops are not touched.' },
- // Wave 18b lane 5 (#5012 item 9).
- { since: '<wave release>', text: '`gbrain google status` now reads each linked Google source\'s calendar once (`--no-probe` skips it) and, when the account cannot read it (HTTP 403 or 404), names it with `code: calendar_unreadable` and the fix, and reports `ok: false` with exit code 1. The sync records the same result instead of looking like an empty calendar, and doctor warns `google_calendar_readable`.' },
-```
-
-The item 6 hint and the opt-in key change nothing by default and need no row.
diff --git a/docs/architecture/key-files/core-persistence.md b/docs/architecture/key-files/core-persistence.md
index 1d1e601310..da87e6d890 100644
--- a/docs/architecture/key-files/core-persistence.md
+++ b/docs/architecture/key-files/core-persistence.md
@@ -10,7 +10,7 @@ Managed facts extraction (withdrawn-candidate skip and recovery, conversation fa
- `src/core/persistence/authority.ts` — durable write authority. `submissionAuthority` records the caller's grant ceiling on every write request (scopes, operations, slug prefixes, delegated namespace and, for a delegated job, its native `subagentId` when a positive safe integer); `authorizeWrite` re-checks it against the CURRENT principal at publication and replay. For a delegated OAuth client the current namespace is the stored `delegated_slug_prefixes` in `prefixes` mode, or only `wiki/agents/<retained subagentId>/*` for the native `job` form (prefixes NULL); anything else allows nothing, and it always intersects the original accepted prefixes, bound tools, scope and source, so a revoked, narrowed or switched grant or a foreign or invalid job id denies (`test/persistence-page-authority.test.ts`, Postgres: `test/e2e/minions-authority-parity.test.ts`). #5994: a context carrying `replayAuthority` (set only by `gbrain repair failed-writes`) gets that stored authority back from `submissionAuthority` (`replayedAuthority`): same source incarnation or refused, `databaseOnlyReason`/`takeHoldersUsed` dropped for admission to recompute, then `authorizeWrite` and page visibility against the live grant.
-- `src/core/persistence/activation.ts` — private CLI `sources writer activate --confirm-quiesced` boundary. Verifies native capability and active filesystem bindings, takes root locks before DB waits and rechecks topology under transaction guards before enabling managed writes. Live/young/foreign legacy leases refuse regardless of expiry; only explicitly requested `--cleanup-dead-local-locks` removes exact dead same-host holders, under the lease transaction lock. Dry-run reports candidates without deletion. Registration never silently claims a source. Tests: `test/persistence-activation.test.ts`, `test/persistence-onboarding.test.ts`. Unbound Google/GitHub API sources may activate as reviewed `connector_database` without fabricating a Git root, while bound sources still require canonical physical-root checks. Activation increments `persistence_brain.mode_epoch` (migration 183), which the writer admin-state hash includes. A non-connector source whose recorded `local_path` no longer exists (unclaimed, or claimed by this host) refuses `source_changed` with detail `source_path_missing`, naming the source, the path and the `sources set-path` / `sources remove` exits (the claimed checkout filled in), in `--dry-run` too (#5206, `test/activation-missing-source-path.test.ts`). The report's `warnings[]` (dry run and real run) carries one `git_durability_not_enabled` entry per filesystem source the effect runner's policy (`gitDurabilityPolicy`) would leave non-durable, with `enable_command`, a read-only `git-durability --enable --dry-run` fix and the note that enabling re-queues skipped Git effects; `persistence-admin.ts` also prints them to stderr without `--json`, and activation proceeds (#5182, `test/writer-activate-durability-warnings-5182.test.ts`).
+- `src/core/persistence/activation.ts` — private CLI `sources writer activate --confirm-quiesced` boundary. Verifies native capability and filesystem bindings, takes root locks before DB waits and rechecks topology under transaction guards. Live/young/foreign legacy leases refuse regardless of expiry; only explicitly requested `--cleanup-dead-local-locks` removes exact dead same-host holders under the lease lock. Dry-run deletes nothing. Never silently claims a source. Tests: `test/persistence-activation.test.ts`, `test/persistence-onboarding.test.ts`. Unbound Google/GitHub API sources may activate as reviewed `connector_database` without fabricating a Git root, while bound sources still need physical-root checks. Activation increments `persistence_brain.mode_epoch` (migration 183), which the writer admin-state hash includes. A non-connector source whose recorded `local_path` no longer exists (unclaimed, or claimed by this host) refuses `source_changed` with detail `source_path_missing`, naming the source, the path and the `sources set-path` / `sources remove` exits (the claimed checkout filled in), in `--dry-run` too (#5206, `test/activation-missing-source-path.test.ts`). The report's `warnings[]` (dry run and real run) carries one `git_durability_not_enabled` entry per filesystem source the effect runner's policy (`gitDurabilityPolicy`) would leave non-durable, with `enable_command`, a read-only `git-durability --enable --dry-run` fix and the note that enabling re-queues skipped Git effects; `persistence-admin.ts` also prints them to stderr without `--json`, and activation proceeds (#5182, `test/writer-activate-durability-warnings-5182.test.ts`).
- `src/core/persistence/git-durability-policy.ts` + `git-durability-administration.ts` — whether the persistence owner commits and pushes page writes through its Git effect is a per-host-binding setting (#5182): `persistence_host_bindings.git_durability` (`enabled` | `disabled` | NULL, migration v234, column SQL kept out of the replayed schema blob as `PERSISTENCE_GIT_DURABILITY_COLUMN_SQL`). `gitDurabilityPolicy(binding, root)` is tri-state and fail-closed: a recorded value wins, NULL falls back to the legacy post-commit-hook probe, a probe error fails the effect instead of skipping it; `effects.ts` takes its per-root verdict from it. `gitDurabilityState` renders `on`/`off`/`unknown` for `writer status` and `writer activate`'s `git_durability` listing. `planGitDurabilityCatchUp`/`requeueGitDurabilityCatchUp` re-queue the Git effects completed `durability_not_enabled` while the setting was off by resetting the existing rows, never inserting under `UNIQUE(request_id, kind)`. The verb `writer_git_durability` (`gbrain sources writer git-durability <source> --enable|--disable [--pat-file <path>] [--dry-run]`, administration-gated like the other writer verbs) runs a read-only `git push --dry-run` probe before enabling (codes `git_branch_unborn`, `git_checkout_required`, `git_detached_head`), wires the repo-scoped credential under `gbrain.durability.managedcredential` from a 0600 `--pat-file` (`pat_file_unreadable` otherwise) and retries the worktree's parked pushes. `sources push` (`managedPushRefusal` in `workspace-push.ts`), `bootstrap verify`'s `checkPushProbe` and the skill-pack writer guard name this route on a managed worktree (#5606). Pinned by `test/persistence-admin-git-durability.test.ts`, `test/managed-push-remedy.serial.test.ts`.
- `src/core/persistence/deactivation.ts` — private CLI `sources writer deactivate` (#5455/#5628), brain-wide and trusted-local. `deactivationBlockers` lists the admin lock, queued/running/recovering requests, recovering topology changes, uncommitted effects, held connector items (managed holds that classic mode would not read) and live `gbrain_cycle_locks` leases, each with its CLI exit; `physicalRootBlockers(engine, mode)` (#5914 [R9a]) adds `physical_root` for this host's owned checkouts, probed as the mode's real run will: strict `assertPhysicalRoot` for managed, `assertPhysicalRootReservation` for the classic pre-activation release, so each preview lists exactly what its real operation refuses on; `--dry-run` returns them plus the worktrees that would retire, the kept shared-skill settings and, when clean, `apply_command` bound to the admin state read before the preview. `deactivatePersistence` takes the local native worktree locks, then in one transaction locks `persistence_brain FOR UPDATE`, checks the expected admin state and the admin lock, locks worktrees then sources `FOR UPDATE` (admission's order), rechecks the blockers, sets `enabled=false`, increments `mode_epoch`, retires every worktree, deletes source and host bindings and records a committed `writer_deactivate` topology change (brain id, retired epoch, retired worktree ids and roots, source roots). `cleanupRetiredManagedMarkers` runs on CLI connect, after deactivate and from `writer status`: it removes this brain's registry records, `.gbrain-managed` / Git `gbrain-managed.json`, `.gbrain-owner.json` and reservations only when their `mode_epoch` is a retired one below the current epoch, or, without an epoch, their worktree id (or, for markers without one, their root outside any active binding) is recorded as retired; unknown or newer epochs are kept and reported `pending`, each file is re-read before unlinking and other brains' files are never touched. `root-registry.ts` writes `mode_epoch` into new registry records and managed markers. Tests: `test/persistence-deactivate.test.ts` (PGLite and Postgres), `test/e2e/persistence-deactivate-race.test.ts`. See [persistence stalls](persistence-stalls.md).
diff --git a/llms-full.txt b/llms-full.txt
index d6c0dcc6b9..66eea550ce 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -1242,6 +1242,44 @@ PostgreSQL 17 PGLite clusters, and at most 8 GiB of payload. `backup status` and
`backup check` report file coverage; neither creates this snapshot. Markdown
exports alone cannot recover facts that exist only in the database.
+`backup create` checks both limits before it takes the lock or writes anything.
+A data directory that is not `<root>/.gbrain/brain.pglite`, or one reached
+through a symlink (for example a `.gbrain` alias to another volume), refuses
+with `unmanaged_database_path`. A data directory whose estimated archive size
+is over 8 GiB refuses with `backup_too_large`. Doctor's `pglite_data_dir` check
+warns once the estimate passes 6 GiB, so you can plan before the refusal. Both
+refusals point at the runbook below.
+
+### Large or non-standard brains: quiesced physical copy
+
+For a brain over the cap or in a flat or symlinked layout, the supported
+recovery artifact is a physical copy of the stopped data directory. Ask the
+user before step 1: it stops their memory service.
+
+1. **Stop every writer.** Stop `gbrain serve`, autopilot and jobs workers, and
+ any agent session using this brain. Then run `gbrain doctor --json`: doctor
+ opens the brain only when no other gbrain process holds its PGLite lock, so
+ a `pglite_data_dir` warning that names a live PID means a writer is still
+ running.
+2. **Copy.** Resolve the real data directory through any alias
+ (`realpath ~/.gbrain/brain.pglite`) and copy it whole, with `config.json`,
+ into a new isolated home, laid out as `<new-home>/.gbrain/brain.pglite` and
+ `<new-home>/.gbrain/config.json`. Do not copy while anything runs against
+ the brain, and do not start writers again until the copy finishes.
+3. **Point the copy at itself.** Set `database_path` in the copied
+ `config.json` to the copied data directory.
+4. **Verify in isolation.** Run `GBRAIN_HOME=<new-home> gbrain doctor --json`
+ and an entity recall against the copy before relying on it. The copy is the
+ managed layout, so while it is under the cap, `GBRAIN_HOME=<new-home>
+ gbrain backup create --output <new archive>` also archives it.
+
+The restore drill in `test/backup-preflight-6649.serial.test.ts` runs these steps on a
+`.gbrain` alias to another directory: it copies the stopped brain, opens the
+copy in its own home with the data intact, archives the copy and restores that
+archive into a third root. Archives over 8 GiB are not supported yet; this
+runbook is the recovery route until a streaming format ships
+([#6649](https://github.com/garrytan/gbrain/issues/6649)).
+
## 7. Restore into a new root
Use an available GBrain runtime and a destination that **does not exist**:
@@ -1348,6 +1386,7 @@ hosted access, also revoke that installation's grant on the host.
| `pglite_busy` | Wait for the active command to finish and retry; stop a long-lived server through its owning process before using finite CLI mode | agent | none | retry the read-only command |
| Fresh conversation cannot recall the test | Inspect the native skill attachment and exact launcher invocation, then run explicit entity recall | user (reloads the native skill) | none | a `recall` from a fresh conversation |
| Backup says files changed | Pause the writer and create a new snapshot; do not treat the failed output as a backup | agent | none | the new snapshot's verification output |
+| `unmanaged_database_path` or `backup_too_large` from `backup create` | Ask the user, then follow the [quiesced physical copy](#large-or-non-standard-brains-quiesced-physical-copy) runbook | user stops writers; agent copies and verifies | user agrees to stop writers | `GBRAIN_HOME=<new-home> gbrain doctor --json` |
| Restore target already exists | Choose another absent root; restore never overwrites existing state | agent | none | the restore output |
| A package or host URL is blocked | Complete the app's normal approval flow; preserve the error if access is denied | user | none | retry after approval |
@@ -4325,6 +4364,7 @@ that work in this conversation.
| 3 | `confirmation_required`, nothing ran | stop, relay `user_message`, run `fix.command` only after the user agrees |
| 10 | write accepted, still pending | poll the receipt (`gbrain write-request -- <id>`) |
| 11 | partial, resumable budget stop | run `resume_command` |
+| 13 | `pending_verify`: a harness wired, verification waits for the serve | start the serve, then run `fix.command` |
| 75 | another runner holds the migration lock | wait, then retry |
| 124 | the command's deadline elapsed | inspect what is still running |
| 130 | interrupted | ask the user whether to re-run |
@@ -10427,6 +10467,7 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro
| Symptom | Next step | Who acts | Consent | Verify |
|---|---|---|---|---|
| A managed source's autopilot freshness `sync` jobs each land about one page, or `sources status` says `parked` while a sync job runs | upgrade (#6706: sync jobs drain to their deadline and count as the source's live drain), then restart `gbrain jobs work` / the supervisor so the worker loads the handler; a job result with `incomplete: true` names its follow-up (`continuation_job_id`) or the next step in `next` | agent | none | `gbrain sync status --source <id> --json` shows `live_job_id` or a cursor at `done`; `gbrain jobs get <id> --json` shows `outcome` |
+| Doctor `sync_freshness` says a source has "no successful sync recorded" or "first sync running" | follow the check's `fix`: `first sync running` (code `sync_first_run_in_progress`, warn) means wait; `no successful sync recorded` (code `sync_no_successful_sync`, fail) names the last attempt and its `reason`: wait for a queued job, inspect holds (`gbrain sync status --source <id> --json`), or retry (`gbrain sync --source <id>`) ([details](#sync-freshness-no-successful-sync)) | agent | none | `gbrain doctor --only sync_freshness --json` |
| Recall returns conversation facts like "Date said …", "Attendees said …" or "Summary said …" | `gbrain repair conversation-labels` previews them ([conversation labels](repair.md#conversation-labels)); apply the printed command with `--yes` | agent, after the user agrees | `destructive` | `gbrain doctor --only conversation_label_facts --json` is ok |
| Conversation facts are dated 1970-01-01 | same preview: `gbrain repair conversation-labels` (an undated page's pre-fix facts carry a `segment 1970-01-01` context); add a `date:` to the page frontmatter before re-extracting it | agent, after the user agrees | `destructive` | `gbrain doctor --only conversation_label_facts --json` is ok |
| `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.157.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok |
@@ -10463,6 +10504,8 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro
| [`owner_unavailable`, reason `binding_missing`, `incarnation_changed`, `local_path_missing` or `coordination_path_missing`](#owner-unavailable) | `gbrain sources writer status --source <id> --json`; the registration is missing or outdated and re-binding or re-registering the checkout is the host administrator's decision | brain host | none | the same status read shows an active binding for this host |
| [`gbrain repair fences` skipped a file `sync_in_progress` while a sync runs](repair.md#fence-repair-during-a-sync) | nothing: a write in flight or the running sync's frozen manifest still names that file; every other candidate repairs now and the next run picks this one up (`gbrain sync --source <id> --no-pull` finishes the sync) | agent | none | `gbrain doctor --only fence_integrity --json` |
| [A Google or GitHub item is held (`connector_held_items`)](#held-connector-items) | `gbrain sources status <id>`, fix the cause, then `gbrain sources retry-held <id>` and `gbrain sync --source <id>` | agent, after the user agrees | `egress` (fetches from the provider again) | `gbrain doctor --only connector_held_items --json` |
+| `gbrain google status` exits 1 naming `calendar_unreadable`, doctor warns `google_calendar_readable`, or the sync log prints `[google] calendar_unreadable` (calendar pages stop arriving) | `gbrain google calendars --account <email>` lists the calendars the account can read; then `gbrain sources set-calendar <source> <calendar-id>` and `gbrain sync --source <source>` ([unreadable calendar](google-connect.md#unreadable-calendar)) | agent, after the user agrees which calendar | none (on a managed brain whose source also syncs Gmail or Contacts, the change re-reads their history: `confirmation_required`, re-run with `--yes` after the user agrees) | `gbrain doctor --only google_calendar_readable --json` is ok |
+| `gbrain waiting` lists bank, payment or shipping alerts as people waiting on you | upgrade (#5012: mail with `Precedence: bulk/list/junk`, a `List-Id` or a no-reply `Reply-To` opens no reply-owed loop); for loops opened before the upgrade, `gbrain waiting` prints `gbrain loops drop sender <email> --source <id> --dry-run` per sender; preview, then run it without `--dry-run` (cannot be undone), or `gbrain loops mute sender <email>` for a reversible stop ([open loops](open-loops.md#the-surfaces)) | agent, after the user agrees | none to preview | `gbrain waiting --json` no longer lists the sender |
| [`gbrain migrate --to` refused with `writer_coordinator_required`](../ENGINES.md#engine-migration-refused) | follow the refusal's `fix`: relay its `user_message` (stay on PGLite and share with `gbrain mcp expose`, or leave the brain as it is) | agent, after the user agrees | `persistent_install`, `egress` (for `gbrain mcp expose`) | `gbrain doctor --no-migrate --json` |
| [A write was refused with a named reason](#write-refused) | the reason's recovery in [write refusal reasons](write-refusals.md) | as the refusal's `fix` | as the refusal's `fix` | the refusal's `verify` |
| [`gbrain sync` refused `managed_sync_flag_refused`](write-refusals.md#managed_sync_flag_refused) | rerun the same command without the flag `detail` names (`--skip-failed` or `--include-gitignored`); fix a failed file and use `--retry-failed`, or commit an ignored file | agent | none | `gbrain sources status --json` |
@@ -10484,9 +10527,15 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro
| [Fact extraction stopped at a spend cap (`facts_drain_deferred`, reason `budget_exhausted`, `daily_budget_exhausted` or `job_over_budget`)](facts-drain.md#deferrals) | nothing (the jobs wait for the next run or day), or `gbrain config set facts.drain_budget_usd <usd>` / `facts.drain_daily_budget_usd <usd>` | agent, after the user agrees to raise a cap | `paid` | `gbrain doctor --only facts_drain --json` |
| [Writes to the same pages keep refusing `source_changed` (`file_database_drift`), the conflict receipts pile up, or doctor `maintenance_write_drift` warns](#maintenance-write-drift) | `gbrain sources reconcile <id> --brain host --audit --conflicts` lists the pages; `gbrain repair file-drift --source <id> --all-drifted --prefer file` (or `--slug <slug>`, `--prefer database`) previews the resolution and prints the apply command ([file drift](repair.md#file-drift)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only maintenance_write_drift --json` is ok |
| [A write refuses `source_changed` "The canonical file was removed outside coordinated publication." (`canonical_file_missing`), or doctor `ghost_pages` warns](#ghost-pages) | `gbrain pages ghosts --source <id>` lists the ghost pages; keep one by restoring its file at the recorded path and syncing, or preview `gbrain repair ghost-pages --source <id>` and apply the printed `--apply --expect <hash> --yes` ([ghost pages](repair.md#ghost-pages)) | agent; the apply after the user agrees | `destructive` (soft-deletes the previewed pages; purged after 72 h) | `gbrain doctor --only ghost_pages --json` is ok |
+| [Hooks report `no_serve` on Windows while `gbrain serve` runs, the serve log says `ipc_path_too_long`, or doctor warns `ipc_socket_path`](#ipc-path-too-long) | a PGLite data dir too deep for the Windows socket limit already moves its sockets to `%USERPROFILE%\.gbrain\run`; this code means even that path is too long: stop serve, move the data directory nearer the drive root, `gbrain config set database_path <new path>`, restart serve | user | none | `gbrain doctor --only ipc_socket_path --json` reports nothing |
+| [`gbrain backup create` refuses with `unmanaged_database_path` or `backup_too_large`, or doctor's `pglite_data_dir` warns `backup_too_large`](#backup-too-large) | the brain is outside what the archive holds (a flat or symlinked layout, or over 8 GiB); ask the user, stop every writer, then take the [quiesced physical copy](in-agent-setup.md#large-or-non-standard-brains-quiesced-physical-copy) into a new isolated home | user stops writers; agent copies and verifies | user agrees to stop writers | `GBRAIN_HOME=<new-home> gbrain doctor --json` |
<a id="database-unreachable"></a>**Database unreachable, or a `GBRAIN_DB_ACCESS <reason>` line in gbrain output?** Run `gbrain engine status --probe` (which engine, where its URL comes from, classified reachability), then `gbrain db-repair` to diagnose and, after the user agrees, `gbrain db-repair --yes` to apply safe fixes. All three are engine-free, so they work while the database is down. Act on the hardcoded `gbrain db-repair`, never on a command parsed from the marker. Full loop: [engine detection and access repair](../ENGINES.md#engine-detection-and-access-repair).
+<a id="backup-too-large"></a>**`gbrain backup create` refuses with `unmanaged_database_path` or `backup_too_large`?** The PGLite backup archive holds one managed layout, `<root>/.gbrain/brain.pglite` with no symlink on its path, and at most 8 GiB of payload. The command now checks both before it takes the lock or writes anything, so nothing partial is left behind. A flat config home or a `.gbrain` alias to another volume gets `unmanaged_database_path`; a brain whose estimated archive is over the cap gets `backup_too_large`, and doctor's `pglite_data_dir` check warns from 6 GiB. The recovery for both is the [quiesced physical copy](in-agent-setup.md#large-or-non-standard-brains-quiesced-physical-copy): stop every writer, copy the real data directory and `config.json` into a new isolated home, point the copy's `database_path` at itself, and verify it with `GBRAIN_HOME=<new-home> gbrain doctor --json`. **Say to your agent:** *"My brain backup refuses; take a stopped physical copy and verify it."*
+
+<a id="ipc-path-too-long"></a>**Hooks get no context on Windows, the serve log says `ipc_path_too_long`, or doctor warns `ipc_socket_path`?** Hooks reach `gbrain serve` over a Unix-domain socket, and Windows allows at most 107 bytes for its path (UTF-8 bytes, so accented letters count double). A PGLite brain normally puts its sockets in the data directory; when that path is too long gbrain uses `%USERPROFILE%\.gbrain\run\<kind>-<hash>.sock` instead, still guarded by the data directory's `.gbrain-ipc-secret`, and hooks find it the same way. `ipc_path_too_long` means even the profile path is too long. The serve log and `gbrain doctor --only ipc_socket_path --json` print the path, its byte count and the limit. Fix it by moving the brain: stop serve, move the data directory to a short path such as `C:\gbrain\brain.pglite`, run `gbrain config set database_path C:\gbrain\brain.pglite`, then restart serve. **Say to your agent:** *"My hooks can't reach gbrain serve on Windows; check the IPC socket path."*
+
<a id="held-files"></a>**Sync held a file (`Held <path>: invalid_frontmatter …`, doctor `git_held_files`, `get_page` shows `file_held`)?** The sync succeeded; only that file waits, and its page (if any) keeps its last good revision and refuses `put_page` until the file is repaired. Run `gbrain sources status <id>`, preview `gbrain repair frontmatter --source <id>`, and after the user agrees run the printed apply. A source a broken file blocked before upgrading recovers on its next sync (`gbrain sync --source <id> --no-pull` does it now). See [held files](repair.md#held-files).
<a id="held-fence-files"></a>**Sync held a file because of its facts or takes fence (`Held <path>: invalid_fence …`)?** Managed sync succeeded; only that file waits. The hold names the fence, section, row numbers, columns and reason, never a cell, and most holds clear by themselves: the maintenance run's `fence_repair` phase repairs the fence on the owner host and commits the file. To see the plan or do it now, run `gbrain repair fences --source <id>` (a read-only preview with no model call), then the apply command it prints; applying needs no extra consent. Model repair spends only within `fences.repair.max_usd_per_page` and `fences.repair.max_usd_per_day`; raising them, or pausing automatic repair with `gbrain config set fences.repair.enabled false`, is the user's call. A hold whose reason is `manual` needs a person: read the page (`gbrain get --source <id> -- <slug>`), edit only that fence in the file (not the frontmatter; `gbrain repair frontmatter` does not touch fences), commit, and run `gbrain sync --source <id> --no-pull`. A `prepare_time` hold was refused against stored rows (for example a takes row number a stored take already uses): fix it as its `fence.reason` says, and after a database-side fix run `gbrain sources retry-held <id>`. A source a fence blocked before upgrading recovers on its next sync. A fence with one obvious meaning is never held: sync rewrites it losslessly, commits the file and reports `fences_normalized`; a `fence_normalized` notice on a write means re-read the page before editing it. `gbrain doctor --only fence_integrity` counts every malformed fence still waiting (held, stored or unsynced) by tier. See [fence holds](write-refusals.md#invalid_fence), [fence repair](repair.md#fences) and the [fence format](fence-format.md).
@@ -10781,6 +10830,8 @@ completes in seconds on an 80K-page PGLite brain.
<a id="maintenance-write-drift"></a>**Writes to the same pages keep refusing `source_changed` with `file_database_drift`, or doctor `maintenance_write_drift` warns?** Each of those pages has a canonical file that differs from its database copy, usually from an edit outside a coordinated write, so every coordinated write to it refuses and leaves a conflict receipt. Maintenance now checks the file first: `synthesize_concepts` skips a drifted concept before any model call (the phase warns and names the commands below) and other maintenance writes refuse before admission, so the pile stops growing. To list the pages, run `gbrain sources reconcile <id> --brain host --audit --conflicts` (read-only; receipts per slug, whether the file still differs, its drift class and producer; MCP `list_write_conflicts` gives remote readers the database-derived part). Then preview `gbrain repair file-drift --source <id> --all-drifted --prefer file` (add `--class <name>` when the preview reports mixed classes, narrow it with `--only '<path glob>'` / `--skip '<path glob>'` over the canonical file paths, or pick pages with `--slug`), show the user the per-page `exceptions`, and after they agree run the printed `--apply --expect <hash>` command exactly as printed. For derived pages under one directory, such as regenerated concepts: (6) preview `gbrain repair file-drift --source default --all-drifted --only 'concepts/**' --prefer database`, show the user the count and the exceptions, and after they agree run the apply command it prints, which applies exactly the previewed pages. To keep resolving such a directory with the database copy from now on, the user can declare it under `storage:` `keep_db:` in the source's gbrain.yml; the owner host's serve, jobs or autopilot consumer then reconciles drifted pages there at most 10 every 10 minutes, and doctor echoes the policy with its matched count and receipt cost ([keep_db](repair.md#file-drift-keep-db)). `--keep` is refused here: use `--prefer database` or `--prefer file`. See [file drift](repair.md#file-drift). **Say to your agent:** *"Which pages keep refusing source_changed? Preview resolving them and show me before you apply."*
+<a id="embedding-identity-unqualified"></a>**`facts-absorb` dies with `embedding_configuration` ("records its embedding model without a provider") while `gbrain config get embedding_model` shows a valid `provider:model`, or doctor `embedding_identity_unqualified` warns?** The brain's database `config` row `embedding_model` holds a bare model name from an older install (for example `text-embedding-3-small`), and managed fact extraction reads only that row. `gbrain config set` cannot change it. The doctor check prints the preview with the configured model filled in: run `gbrain migrate embeddings --to <provider:model> --dry-run` (read-only), show the user the cost, and only after they approve run it without `--dry-run`, with `--yes --max-cost-usd <cap>`. It re-embeds active facts even when the model is unchanged, so it is a paid step. When no model is configured outside the database, the check asks for the provider-qualified id instead. **Say to your agent:** *"Why did facts extraction stop with an embedding configuration error?"*
+
## Embedding state
**Symptom.** Doctor `embedding_state` warns, `get_brain_health` reports
@@ -10980,6 +11031,34 @@ three-step check, and the skip codes. `gbrain doctor` reports it as the
`auto_chronicle` check. To turn it off, run
`gbrain config set auto_chronicle false`.
+## Sync freshness: no successful sync recorded
+
+<a id="sync-freshness-no-successful-sync"></a>
+
+**Say to your agent:** *"Doctor says my source was never synced, but a sync keeps running. What's going on?"*
+
+A sync stamps a source's `last_sync_at` only when it succeeds, so a source whose
+syncs keep ending `partial` or failing has none, however many pages it imported.
+`gbrain doctor` keeps freshness and sync outcome apart for such a source:
+
+- **First sync running** (`warn`, code `sync_first_run_in_progress`): the source
+ holds a live sync lock inside the staleness ceiling. Running is not fresh, and
+ a second sync only contends for the lock, so the fix is to wait and re-run
+ `gbrain doctor --only sync_freshness --json`. A lock held past the ceiling
+ reads as wedged (`fail`) with its `--break-lock` command.
+- **No successful sync recorded** (`fail`, code `sync_no_successful_sync`): no
+ sync is running. The message names the last attempt, read-only from the newest
+ `sync` job and (on a managed brain) `gbrain sync status`: its time, result
+ (`failed`, `completed (partial)`, a managed error code) and held files, or
+ `no attempt recorded`. `details.no_successful_sync[]` carries each source's
+ `reason` and `fix`:
+ - `attempt_queued`: a sync job is queued or running; wait.
+ - `holds_pending`: files are held; inspect them with
+ `gbrain sync status --source <id> --json` and follow its `next`.
+ - `last_attempt_unsuccessful`: read the job (`gbrain jobs get <id> --json`)
+ or the managed failure, then retry.
+ - `no_attempt`: run `gbrain sync --source <id>` (`--no-pull` on a managed brain).
+
---
## docs/guides/exit-codes.md
@@ -11004,6 +11083,7 @@ the exit code first, then reads the JSON document (`--json`) for the details:
| 3 | `confirmation_required`: nothing ran | consent payload (`effects`, `user_message`, `fix`) | stop, relay `user_message` to the user, run `fix.command` only after they agree |
| 10 | the write was accepted and is still pending | write receipt | poll the receipt (`gbrain write-request -- <id>`); `--accept-pending` maps this to 0 |
| 11 | partial, resumable budget stop | result with `remaining_*` and `resume_command` | run `resume_command` (it is safe to re-run) |
+| 13 | `pending_verify`: `gbrain bootstrap harness --token` wired a PGLite brain while no serve answered; nothing failed, nothing verified yet | the harness result with `status: "pending_verify"` and `fix` | tell the user to start `gbrain serve --http`, then run `fix.command` with the same token; `bootstrap harness --status` stays partial until it passes ([pending verify](bootstrap.md#pending-verify)) |
| 69 | `gbrain serve` exited on its own after its persistence consumer reported `restart_required` for `GBRAIN_SERVE_RESTART_REQUIRED_EXIT_SECONDS` (`serve_unhealthy_exit`; opt-in) | `[gbrain serve] error code=serve_unhealthy_exit` line on stderr | nothing: the supervisor (the installed service restarts on failure) starts a fresh serve; if it repeats, follow [the unhealthy exit](../ENGINES.md#serve-unhealthy-exit) |
| 75 | another runner holds the migration lock, or an engine graduation owns the brain (`graduation_in_progress`) | error envelope | wait for the other runner, then retry |
| 124 | the command's own deadline elapsed | error envelope | inspect what is still running (the message names the status command) |
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsv
index b51f925e9f..6a5a438b10 100644
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@ -21,9 +21,9 @@ src/core/import-file.ts 2062 ratchet +2: pre-publication withdrawal validation;
src/core/migrate.ts 602 ratchet schema-migration runner only; migrations live in src/core/schema-migrations/ (W3); +3 #5216: resumable page revision backfill runs after every migration pass while pages.knowledge_revision is nullable
src/core/operations.ts 240 ratchet peel target: containment sprint C4-C7; grown v0.46.26.0 megawave op wiring; +chat-connectors wiring (master merge); +5 v0.47 gmail-loops: loopsOperations spread + OP_AREAS; #5105: receipt operation registry wiring; shared-skills integration on company-ingestion base; +2 security wave: withOutputRedaction applied at op registration; +1 #5616: pageEditOperations import (spread shares the pages line); +1 Foundations 1 F1b: attributionOperations import (spread shares the admin line); +1 agent operator wave A6: ops/notices.ts import (mute_notice); +2 agent operator closeout A1: registerOpRoutes import + call (routing logic in fix-routing.ts); +2 retrieval feedback: feedbackOperations import and spread (ops/feedback.ts); +1 #6007: pageBatchOperations import (spread shares the pages line); +1 P5: wanted_pages area row; lowered GBRA-75 W11 cold start: OP_AREAS + finalize step moved to operation-load.ts (shared with the CLI per-op loader); +1 C4 pinned questions: questionsOperations import and spread (ops/questions.ts; its areas live in operation-load.ts OP_AREAS)
src/core/pglite-engine.ts 3065 ratchet +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); 4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); 4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2983 measured); 4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2983 measured); +4 P7 relationalChainHop delegate; +8 contributor audit wave P0: listFactsKeyset delegate (SQL in engine-sql/facts.ts); +1 #5375: get_versions limit/include_body type import (GetVersionsOpts, PageVersionRows); +2 #5984 lane apply diet: putPage/setPageAliases write inline in the caller's page transaction (engine methods cannot move); +4 GBRA-69: replaceDerivedLinksBatch delegate (logic in derived-links.ts); +5 GBRA-67: readPageSnapshotsBatch delegate (batch logic in page-snapshot-batch.ts); +1 GBRA-75 wave 10: findDuplicatePages delegate (SQL in engine-sql/pages.ts); +2 GBRA-76: transaction/transactionDirect take TransactionOptions and refuse an already-aborted signal before BEGIN; +2 #4772 (W14 PR3): entityTypes HealthDeps delegate + import (policy in schema-pack/entity-types.ts, SQL in engine-sql/health.ts); +2 W14 P3.12 (#4772): entityTypes HealthDeps delegate + import on top of W13; +11 Cat 40 Hard fix wave F2 (#6271) on top: countKeywordPages/searchKeywordPages delegations (SQL in engine-sql/keyword-pages.ts) and the rankQuery score parameter (3023 measured); +3 W15 P1.2 (#6454): three one-line stale-frontmatter-key delegates (SQL in engine-sql/pages.ts); +6 large pages Wave A sub-a: getChunkPage delegate (SQL in engine-sql/chunks.ts); +11 #6696 B3: readEmbeddingStateCounts/listEmbeddingStateRows delegations + type import; +22 Wave B lane 1a: segmented page storage delegations (allocateBodyOccurrenceIds..sweepSegments, SQL in engine-sql/page-body.ts) and their imports
-src/core/postgres-engine.ts 3082 ratchet +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); ceiling rationale: docs/architecture/key-files/engines-2.md entry for src/core/postgres-engine.ts; evidence delivery: getChunkWindows scoped-read delegate + type import (+5; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +10 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3242 #5824: searchVector SQL moved to search/vector-statement.ts, +explainVectorSearch/runVectorAttempt (-156); +6 #5730: onpoisoned wiring on the instance/module/connection-manager pools + poisonedDiscards in getPoolDiagnostics (counter in pool-gauge.ts); +5 #5801: onCheckout observer seam (fires after reserve resolution / transaction-callback entry; listeners in pool-gauge.ts); lowered to 3119 #5889: searchTitles SQL moved to engine-sql/titles.ts (-133); lowered to 2914 F4a: getHealth SQL moved to engine-sql/health.ts (-216); +2 #5984: transactions track held page guards like PGLite (withHeldPageKeys), so repeated guards in one transaction cost no round trips; +1 #5984: traceSqlOptions import for the env-gated GBRAIN_SQL_TRACE bench hook (src/core/sql-trace.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2917 measured); +2 engine graduation (GBRA-50 G2a): initSchema sizing parameter (the source embedding layout sizes a fresh target); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2920 measured); +4 P7 relationalChainHop delegate; +8 contributor audit wave P0: listFactsKeyset delegate (SQL in engine-sql/facts.ts); +1 #5375: get_versions limit/include_body type import (GetVersionsOpts, PageVersionRows); 6 #6085: initSchema pins advisory lock 42, bootstrap, schema replay and unlock to one reserved backend when the DDL pool has more than one slot (gauge only, no long-hold permit), released in finally; wave 10 collector: lane E (#6085), lane G (#5375) and master compose at 2939; +2 #6110: search transactions pass jitOff to withScopedReadTransaction (SET LOCAL jit = off in postgres-engine/search-settings.ts); +2 #5984 lane apply diet: putPage/setPageAliases write inline in the caller's page transaction (engine methods cannot move); +1 #5984 single-write fast path composes with the lane apply diet at 2944; +2 #5984 shared parameter types: the instance pool passes shared_types and initSchema clears them after migrations (helpers in db.ts); +2 #6276: the remote alias-resolving readPageSnapshot runs with JIT off (withScopedReadTransaction jitOff); +5 #6278: executeRaw timeoutMs delegate (statement in postgres-engine/bounded-statement.ts); +23 #6278 PR 1.5: cancelSettleMs() and the settle timer in runUnsafe that discards a reserved connection whose cancel a transaction-mode pooler never completed; +3 #6317 lane 2: getPoolDiagnostics().pool from the vendored driver (postgres-engine/pool-stats.ts) and the prepare mark; +4 GBRA-69: replaceDerivedLinksBatch delegate (logic in derived-links.ts); +1 GBRA-69 extract batching: replaceDerivedLinksBatch delegate (batch logic in derived-links.ts); +9 GBRA-75: getBacklinkCounts and getHealth statements run JIT-off through the private jitOffRead transaction helper (engine methods cannot move); +3 GBRA-75 wave 7: searchKeyword and searchVector start the once-per-engine background search statistics guard (logic in search/projection-statistics.ts); +7 GBRA-67: readPageSnapshotsBatch scoped-read delegate (batch logic in page-snapshot-batch.ts); +1 GBRA-75 wave 10: findDuplicatePages scoped-read delegate (SQL in engine-sql/pages.ts); +7 #6383: poolIncidents hooks on the instance/module/connection-manager pools (counter and lines in pool-gauge.ts, budget in db.ts) and stuckDiscards/buildFailures in getPoolDiagnostics; +3 GBRA-76: transaction/transactionDirect take TransactionOptions; transactionOn attaches the begin handle to withTransactionAbort (logic in postgres-engine/transaction-abort.ts); +2 W14 P3.12 (#4772): entityTypes HealthDeps delegate + import on top of W13; +1 #5227: schema.sql replay under withSchemaLockTimeout (wave 14 PR1); +1 driver desync tripwire: desyncDiscards in getPoolDiagnostics (counter and line in pool-gauge.ts); +11 Cat 40 Hard fix wave F2 (#6271) on top: countKeywordPages/searchKeywordPages scoped-read delegations (SQL in engine-sql/keyword-pages.ts) and the rankQuery score parameter (3027 measured); +3 W15 P1.2 (#6454): three one-line stale-frontmatter-key delegates, reads scoped (SQL in engine-sql/pages.ts); +12 wave 16 G5.1 (#6495): keywordStatementTimeout memo field, its connect/disconnect resets and the keywordStatementTimeoutSetting accessor, plus one awaited setting per keyword/chunk/CJK transaction (resolver in postgres-engine/keyword-statement-timeout.ts); wave 16 G5.1 gate fix: keywordStatementTimeoutSetting resolves the knob once per connection on the first keyword statement from the saved connect config (connect issues no statement for it; 3042 measured); +7 large pages Wave A sub-a: getChunkPage scoped-read delegate (SQL in engine-sql/chunks.ts); +11 #6696 B3: readEmbeddingStateCounts/listEmbeddingStateRows delegations + type import; +22 Wave B lane 1a: segmented page storage delegations (allocateBodyOccurrenceIds..sweepSegments, SQL in engine-sql/page-body.ts) and their imports; +3 wave 18b lane 2 (#6495): keywordTimeouts negative-cache field and the searchKeyword runner wrap (logic in postgres-engine/keyword-timeout-cache.ts)
+src/core/postgres-engine.ts 3085 ratchet +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); ceiling rationale: docs/architecture/key-files/engines-2.md entry for src/core/postgres-engine.ts; evidence delivery: getChunkWindows scoped-read delegate + type import (+5; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +10 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3242 #5824: searchVector SQL moved to search/vector-statement.ts, +explainVectorSearch/runVectorAttempt (-156); +6 #5730: onpoisoned wiring on the instance/module/connection-manager pools + poisonedDiscards in getPoolDiagnostics (counter in pool-gauge.ts); +5 #5801: onCheckout observer seam (fires after reserve resolution / transaction-callback entry; listeners in pool-gauge.ts); lowered to 3119 #5889: searchTitles SQL moved to engine-sql/titles.ts (-133); lowered to 2914 F4a: getHealth SQL moved to engine-sql/health.ts (-216); +2 #5984: transactions track held page guards like PGLite (withHeldPageKeys), so repeated guards in one transaction cost no round trips; +1 #5984: traceSqlOptions import for the env-gated GBRAIN_SQL_TRACE bench hook (src/core/sql-trace.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2917 measured); +2 engine graduation (GBRA-50 G2a): initSchema sizing parameter (the source embedding layout sizes a fresh target); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2920 measured); +4 P7 relationalChainHop delegate; +8 contributor audit wave P0: listFactsKeyset delegate (SQL in engine-sql/facts.ts); +1 #5375: get_versions limit/include_body type import (GetVersionsOpts, PageVersionRows); 6 #6085: initSchema pins advisory lock 42, bootstrap, schema replay and unlock to one reserved backend when the DDL pool has more than one slot (gauge only, no long-hold permit), released in finally; wave 10 collector: lane E (#6085), lane G (#5375) and master compose at 2939; +2 #6110: search transactions pass jitOff to withScopedReadTransaction (SET LOCAL jit = off in postgres-engine/search-settings.ts); +2 #5984 lane apply diet: putPage/setPageAliases write inline in the caller's page transaction (engine methods cannot move); +1 #5984 single-write fast path composes with the lane apply diet at 2944; +2 #5984 shared parameter types: the instance pool passes shared_types and initSchema clears them after migrations (helpers in db.ts); +2 #6276: the remote alias-resolving readPageSnapshot runs with JIT off (withScopedReadTransaction jitOff); +5 #6278: executeRaw timeoutMs delegate (statement in postgres-engine/bounded-statement.ts); +23 #6278 PR 1.5: cancelSettleMs() and the settle timer in runUnsafe that discards a reserved connection whose cancel a transaction-mode pooler never completed; +3 #6317 lane 2: getPoolDiagnostics().pool from the vendored driver (postgres-engine/pool-stats.ts) and the prepare mark; +4 GBRA-69: replaceDerivedLinksBatch delegate (logic in derived-links.ts); +1 GBRA-69 extract batching: replaceDerivedLinksBatch delegate (batch logic in derived-links.ts); +9 GBRA-75: getBacklinkCounts and getHealth statements run JIT-off through the private jitOffRead transaction helper (engine methods cannot move); +3 GBRA-75 wave 7: searchKeyword and searchVector start the once-per-engine background search statistics guard (logic in search/projection-statistics.ts); +7 GBRA-67: readPageSnapshotsBatch scoped-read delegate (batch logic in page-snapshot-batch.ts); +1 GBRA-75 wave 10: findDuplicatePages scoped-read delegate (SQL in engine-sql/pages.ts); +7 #6383: poolIncidents hooks on the instance/module/connection-manager pools (counter and lines in pool-gauge.ts, budget in db.ts) and stuckDiscards/buildFailures in getPoolDiagnostics; +3 GBRA-76: transaction/transactionDirect take TransactionOptions; transactionOn attaches the begin handle to withTransactionAbort (logic in postgres-engine/transaction-abort.ts); +2 W14 P3.12 (#4772): entityTypes HealthDeps delegate + import on top of W13; +1 #5227: schema.sql replay under withSchemaLockTimeout (wave 14 PR1); +1 driver desync tripwire: desyncDiscards in getPoolDiagnostics (counter and line in pool-gauge.ts); +11 Cat 40 Hard fix wave F2 (#6271) on top: countKeywordPages/searchKeywordPages scoped-read delegations (SQL in engine-sql/keyword-pages.ts) and the rankQuery score parameter (3027 measured); +3 W15 P1.2 (#6454): three one-line stale-frontmatter-key delegates, reads scoped (SQL in engine-sql/pages.ts); +12 wave 16 G5.1 (#6495): keywordStatementTimeout memo field, its connect/disconnect resets and the keywordStatementTimeoutSetting accessor, plus one awaited setting per keyword/chunk/CJK transaction (resolver in postgres-engine/keyword-statement-timeout.ts); wave 16 G5.1 gate fix: keywordStatementTimeoutSetting resolves the knob once per connection on the first keyword statement from the saved connect config (connect issues no statement for it; 3042 measured); +7 large pages Wave A sub-a: getChunkPage scoped-read delegate (SQL in engine-sql/chunks.ts); +11 #6696 B3: readEmbeddingStateCounts/listEmbeddingStateRows delegations + type import; +22 Wave B lane 1a: segmented page storage delegations (allocateBodyOccurrenceIds..sweepSegments, SQL in engine-sql/page-body.ts) and their imports; +3 wave 18b lane 2 (#6495): keywordTimeouts negative-cache field and the searchKeyword runner wrap (logic in postgres-engine/keyword-timeout-cache.ts); integrated at wave 18b: master 3082 + 3
src/core/search/hybrid.ts 1648 ratchet +5 GBRA-81 item 5 per-stage search timings: HybridSearchOpts._timings (interface field) and the timer bindings and import in hybridSearch/hybridSearchCached (collector logic in search/stage-timings.ts); +2 W5 page-unit ranking cut: HybridSearchOpts.pageRankCut (logic in search/page-rank-cut.ts); +9 W3 confidence-gated reranking: HybridSearchOpts.rerankGate and the gate/lookup threading through rerankAndPin and sizeReturnPool (logic in search/hybrid/rerank-gate.ts, crag.ts gradePreRerank); re-summed at the W3 merge onto master v0.60.168.0 (1641 measured); +2 System One v1: HybridSearchOpts.decide (search/decide-stage.ts); refactor wave 1 split target (W4 hybrid, cut line); ceiling rationale: docs/architecture/key-files/core-search-1.md entry for src/core/search/hybrid.ts; +10 #5691: per-request embedding_query_prefix read once and threaded to the embeds and cache key; +5 green master wave (embedding opt-out): HybridSearchOpts._embeddingOptedOut (interface field) read once per request and threaded to the cache-lookup embed and the keyword-only gate; +24 P2 explain RRF attribution stamp in rrfFusionWeighted, backlink_count stamp, explain_target stage observations, explain/explainTarget opts; +14 fix wave 13 P4.8 #6400: lazyQueryEmbedDeadline (the query-embed deadline starts when the embed starts) and the _queryEmbedDeadline getter; +1 query facts arm: HybridSearchOpts.onQueryEmbedding (interface field; its one-line call is paid inside the ceiling) after the vector arms, so the facts arm reuses the query embedding without a second model call; re-summed at the master a08578ca5 merge (1591 master lines + 3 integration lines: the onQueryEmbedding hook)
-src/core/types.ts 2319 ratchet +4 Wave B PR 1 (1c): Page.body_storage/body_bytes (interface fields; guard logic in page-body/page-shape.ts); +8 W3 confidence-gated reranking: HybridSearchMeta.rerank_gate (RerankGateMeta in search/hybrid/rerank-gate.ts); re-summed at the W3 merge onto master v0.60.168.0 (2279 measured); +7 fix wave 11 W6.2/W6.3 (#5989, #6132): SearchOpts.hnswIterativeScan and cjkKeyword, the keyword_candidates_incomplete stage and HybridSearchMeta.keyword_candidates (logic in engine-sql/cjk-search.ts); +5 System One v1 retrieval lane: SearchResult injection_p/injection_suspected, HybridSearchMeta answerability, egress_denied degraded reason; +4 System One v1: SearchResult rerank_score_kind/decide_evidence, HybridSearchMeta decide/rerank; +3 wave review: PAGE_SORT_SQL.updated_asc source_id + id tiebreakers (total order under federated scopes); +5 #4881: OntologyReadOpts extends PageReadScope doc; +3 #4857: PAGE_SORT_SQL.slug total-order tiebreaker comment; grown v0.46.26.0 megawave: EvidenceOpts, pacing/usage result fields, PageFilters growth (#4352 #4218); wave-k: +9 SalienceOpts/AnomaliesOpts source scope (#3867); +20 2026-09 adversarial batch 2: keyword_relaxed_carried stage + relaxed_dropped meta field docs; +16 2026-09 fix wave: SearchResult.keyword_relaxed field + full fusion-demotion doc; (#3867); +9: #4648 rerank_passthrough degraded stage + empty_result_set/malformed_shape reasons | merged v0.48.1.0 true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); corrective release: shared internal PageReadScope and PageReadPolicy; ranker wave v0.48.4.0: HybridSearchMeta relational_rerank_pin / keyword_arm_confidence / metadata_boost_gate + SearchResult.relational_pinned (+48 over master's peel); +12: #4681 Page.updated_at_iso + keyset cursor precision docs; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: public page revision fields; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: typed vector pool and readiness metadata; merged company ingestion/schema routing changes; retired provider integration removed; +1 write-path wave: 'created' effective-date source; +3 read-path wave: rerank_failed degraded stage + budget reason (closed vocabularies) and its recall classification note; +8 fw3-search: SearchOpts.source_boosts + keyword_arm_failed/title_arm_failed stages; +2 wave-2 W4: ChunkInput.embedding_input_hash (#5553); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +2 at the merge; evidence delivery: optional SearchResult.delivered (+2; shape in search/evidence-delivery.ts); +2 eval wave N1-3: OntologyReadOpts.visibility (remote world-only ontology reads); +4 #5827: GraphNode.source_id and GraphPath from_source_id/to_source_id; +2 #5824: SearchOpts.vectorLegacyGuard rollback switch; +7 #5154: PageFilters.listColumnsOnly (interface field); +11 Foundations 1 F1b: WriteAttributionView + AttributedPageVersion (get_versions / get_write_attribution read shapes); +1 #5988: SearchResult.stale carries the held-file detail (interface field); +6 retrieval feedback: SearchResult feedback_boost/content_hash/relational_path_edges stamps and RelationalFanoutRow.path_edges (interface fields); +2 RelationalFanoutOpts.wide (interface field); 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); +1 green master wave: embedding_disabled degraded reason (closed vocabulary); +2 #5951: Chunk.source_id (get_chunks names each row's source); 1 P2 SearchResult explain fields (rrf attribution, blend_norm_rrf, score_details, backlink_count) + RrfAttribution (interface fields); +11 #5575 (L1b): PageReadScope minTrust/suppressFlagged, SearchResult trust_tier/origin/unconfirmed, TimelineOpts eligibility (interface fields cannot move); +8 #4772 (W14 PR3): BrainHealth.entity_types_status field (interface fields cannot move); +1 C4: question page type row; +6 entity anchoring: optional SearchResult.entity_anchored row stamp (logic in search/entity-anchor.ts); +4 query facts arm: optional SearchResult.fact_row and superseded_claim row fields (logic in search/facts-arm.ts); +2 query facts arm: SearchResult result_type/fact_id/page_slug/follow_up (fact rows are never page-shaped); +9 Cat 40 Hard fix wave (#6271): SearchResult matched_alias/evidence_omitted/provenance, SearchOpts.rankQuery, keyword_count_unavailable stage and rerank_failed reasons; +12 fix wave 15 P2.1 (#6500): PageFilters.slugAfter (single-source slug keyset, interface field + doc) and the updated_desc tiebreaker comment (the keyset walk lives in facts/conversation-enumeration.ts); +2 wave 16 G5.1 (#6495): EngineConfig.keyword_statement_timeout_ms (interface field + doc); +2 GBRA-92: EngineConfig.pglite_shared_buffers (interface field + doc); +11 large pages (Wave A): Chunk/ChunkInput projected_byte_start/end interface fields (span logic in chunkers/recursive.ts, page-window/document.ts); +4 wave 18b lane 2 (#6495): SearchOpts.keywordTimeoutCache, the skipped_after_timeout degraded reason and the useCache doc line
+src/core/types.ts 2323 ratchet +4 Wave B PR 1 (1c): Page.body_storage/body_bytes (interface fields; guard logic in page-body/page-shape.ts); +8 W3 confidence-gated reranking: HybridSearchMeta.rerank_gate (RerankGateMeta in search/hybrid/rerank-gate.ts); re-summed at the W3 merge onto master v0.60.168.0 (2279 measured); +7 fix wave 11 W6.2/W6.3 (#5989, #6132): SearchOpts.hnswIterativeScan and cjkKeyword, the keyword_candidates_incomplete stage and HybridSearchMeta.keyword_candidates (logic in engine-sql/cjk-search.ts); +5 System One v1 retrieval lane: SearchResult injection_p/injection_suspected, HybridSearchMeta answerability, egress_denied degraded reason; +4 System One v1: SearchResult rerank_score_kind/decide_evidence, HybridSearchMeta decide/rerank; +3 wave review: PAGE_SORT_SQL.updated_asc source_id + id tiebreakers (total order under federated scopes); +5 #4881: OntologyReadOpts extends PageReadScope doc; +3 #4857: PAGE_SORT_SQL.slug total-order tiebreaker comment; grown v0.46.26.0 megawave: EvidenceOpts, pacing/usage result fields, PageFilters growth (#4352 #4218); wave-k: +9 SalienceOpts/AnomaliesOpts source scope (#3867); +20 2026-09 adversarial batch 2: keyword_relaxed_carried stage + relaxed_dropped meta field docs; +16 2026-09 fix wave: SearchResult.keyword_relaxed field + full fusion-demotion doc; (#3867); +9: #4648 rerank_passthrough degraded stage + empty_result_set/malformed_shape reasons | merged v0.48.1.0 true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); corrective release: shared internal PageReadScope and PageReadPolicy; ranker wave v0.48.4.0: HybridSearchMeta relational_rerank_pin / keyword_arm_confidence / metadata_boost_gate + SearchResult.relational_pinned (+48 over master's peel); +12: #4681 Page.updated_at_iso + keyset cursor precision docs; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: public page revision fields; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: typed vector pool and readiness metadata; merged company ingestion/schema routing changes; retired provider integration removed; +1 write-path wave: 'created' effective-date source; +3 read-path wave: rerank_failed degraded stage + budget reason (closed vocabularies) and its recall classification note; +8 fw3-search: SearchOpts.source_boosts + keyword_arm_failed/title_arm_failed stages; +2 wave-2 W4: ChunkInput.embedding_input_hash (#5553); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +2 at the merge; evidence delivery: optional SearchResult.delivered (+2; shape in search/evidence-delivery.ts); +2 eval wave N1-3: OntologyReadOpts.visibility (remote world-only ontology reads); +4 #5827: GraphNode.source_id and GraphPath from_source_id/to_source_id; +2 #5824: SearchOpts.vectorLegacyGuard rollback switch; +7 #5154: PageFilters.listColumnsOnly (interface field); +11 Foundations 1 F1b: WriteAttributionView + AttributedPageVersion (get_versions / get_write_attribution read shapes); +1 #5988: SearchResult.stale carries the held-file detail (interface field); +6 retrieval feedback: SearchResult feedback_boost/content_hash/relational_path_edges stamps and RelationalFanoutRow.path_edges (interface fields); +2 RelationalFanoutOpts.wide (interface field); 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); +1 green master wave: embedding_disabled degraded reason (closed vocabulary); +2 #5951: Chunk.source_id (get_chunks names each row's source); 1 P2 SearchResult explain fields (rrf attribution, blend_norm_rrf, score_details, backlink_count) + RrfAttribution (interface fields); +11 #5575 (L1b): PageReadScope minTrust/suppressFlagged, SearchResult trust_tier/origin/unconfirmed, TimelineOpts eligibility (interface fields cannot move); +8 #4772 (W14 PR3): BrainHealth.entity_types_status field (interface fields cannot move); +1 C4: question page type row; +6 entity anchoring: optional SearchResult.entity_anchored row stamp (logic in search/entity-anchor.ts); +4 query facts arm: optional SearchResult.fact_row and superseded_claim row fields (logic in search/facts-arm.ts); +2 query facts arm: SearchResult result_type/fact_id/page_slug/follow_up (fact rows are never page-shaped); +9 Cat 40 Hard fix wave (#6271): SearchResult matched_alias/evidence_omitted/provenance, SearchOpts.rankQuery, keyword_count_unavailable stage and rerank_failed reasons; +12 fix wave 15 P2.1 (#6500): PageFilters.slugAfter (single-source slug keyset, interface field + doc) and the updated_desc tiebreaker comment (the keyset walk lives in facts/conversation-enumeration.ts); +2 wave 16 G5.1 (#6495): EngineConfig.keyword_statement_timeout_ms (interface field + doc); +2 GBRA-92: EngineConfig.pglite_shared_buffers (interface field + doc); +11 large pages (Wave A): Chunk/ChunkInput projected_byte_start/end interface fields (span logic in chunkers/recursive.ts, page-window/document.ts); +4 wave 18b lane 2 (#6495): SearchOpts.keywordTimeoutCache, the skipped_after_timeout degraded reason and the useCache doc line; integrated at wave 18b: master 2319 + 4
src/core/minions/queue.ts 2528 ratchet grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; security: durable queued authority and confined filesystem dispatch; master integration: grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; merged v0.49: durable authority and delegated admission both enforced; typed readiness, configuration-blocked lifecycle and bounded release; +9: prune archives completed dream synthesis keys; +18 Lane D: deferJob (a deferral returns a job to delayed with no attempt counted and no stacktrace growth); the ceiling had 17 lines of slack; +5 agent operator follow-up Item 5 merged over master: claim-time spend fence token and legacy_default stamp (logic in minions/spend-authorization.ts)
src/commands/init.ts 1884 ratchet +2 fix wave 9 lane F #5253: leaving deferred setup also clears the DB-plane embedding_disabled row (both init branches); grown v0.46.x keyless capability notices; grown db-availability loop: initPostgresCore typed-failure extraction + --prefer-postgres ladder hook + pgvector rethrow fix; +1 at megawave/wave-k merge; +master-merge true-up; wave-k: merge; #3753 --force re-init engine-preservation guard; +1 wave-k merge-union brace (--prefer-postgres close); +10 ambient-writeback WP8: runWritebackNudge consent ask in both engine epilogues (logic lives in core/onboard/writeback-nudge.ts); +4: v0.48.2 reranker readiness at init + test seam; +1: v0.48.2 provider normalization; +3: v0.48.2 review fixes; master integration: +2: preserve typed PGLite busy errors in schema-only init; shared-skills integration on company-ingestion base; retired provider integration removed; retain stored-vector identity on re-init; -14: first-run bundle + quickstart registration helpers live in init-first-run.ts (writeback/skills asks folded into the bundle); +5 agent operator follow-up Item 2: --surface flag (value flag, parse, help line, module-level registration surface, type import) for the printed harness registration; +2 fix wave lane B3: both engine paths stamp a database init created as a fresh install for the behavior_changes notice (core/behavior-change-notice.ts); +4 GBRA-81 item 1: --search-mode value flag, its parse line, module-level choice, help line (picker logic lives in init-mode-picker.ts); +2 D8 funnel: a fresh init counts one clean_install when the opt-in funnel is on (core/funnel.ts)
src/commands/integrations.ts 1739 ratchet grown v0.46.26.0 megawave (#4039 connector compat) + 1 nosemgrep dataflow annotation (path-traversal audit); wave-k: exported heartbeatPath seam (#3900)
@@ -36,7 +36,7 @@ src/core/embedding-migration.ts 1587 ratchet new row: crossed 1500 in v0.46.25.0
src/core/github-source.ts 1530 ratchet new row: crossed the 1500 unlisted cap in v0.46.23.0 review fix wave (scope-state gating, client hardening, symlink containment); merged reliability/shared-skills source integration; managed sweep lease wrapper; fix wave 3 lane A: config parser peeled to github-source-config.ts (-47), +account pin wiring and pinned-installation refresh
src/commands/hook.ts 1932 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read; +1 #5371: the stop-hook dirty probe ignores physical-root ownership metadata (root-metadata.ts, engine-free); 2 core memory: user-prompt context-pressure notice wiring (logic in core/context/pressure.ts; session-start composition in core/context/session-start-output.ts); +3 fix wave 11 W2.1 #6091: PreCompact/SessionEnd capture-time consent record calls (logic in core/context/capture-consent.ts); +5 fix wave 11 W2.9 #6083: the three detached-push call sites skip a managed canonical worktree (push_managed_coordinator) + import; +2 fix wave 11 integration: W1 router help guard import beside the W2 managed-root import; +2 fix wave 13 P4.9 #6399: a header-only Codex rollout ends empty_session, not parser_drift; +3 W14 P4.16 (#5799): banner and SessionStart note read livePushStatuses (predicate in core/workspace-push.ts); +1 W15 P5.7 (#4992): gitChildEnv import for the hook git probes (launches moved onto core/spawn.ts)
src/core/chunkers/code.ts 1602 ratchet new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (decorated-python defs #3821, version-gate + timeout chunker fixes); grown wave-g (#4511): named defs never folded into merged chunks; grown #4669: skip WASM parse for languages without TOP_LEVEL_TYPES; +6 N13-1: CodeChunkMetadata.definesFunction field + merge-guard stamp (predicate lives in def-types.ts); +10 Lua grammar swap: GRAMMAR_REVISIONS + chunkerStamp() (per-language re-chunk gate); +4: CodeChunkOptions.timeoutMs (per-call parse cap; markdown fences parse under a short cap) and the "Parsing failed" → ChunkerTimeoutError mapping in parseWithTimeout
-src/core/config.ts 1981 ratchet +2 W5: search.page_rank_cut / page_rank_cut_factor KNOWN_CONFIG_KEYS rows (read in search/page-rank-cut.ts); +3 W3 confidence-gated reranking: search.reranker.gate / gate_min_gap KNOWN_CONFIG_KEYS rows (values parsed in search/crag.ts); re-summed at the W3 merge onto master v0.60.169.0 (1951 measured); +1 budgeted delivery PR 1: the search.auto_packing KNOWN_CONFIG_KEYS row (values validated in search/evidence-packing.ts); +1 #6278: persistence.sync_preparation_ms/maintenance_preparation_ms/preparation_ceiling_ms/max_preparation_attempts/preparation_deadlines key row (logic in persistence/preparation-budget.ts, switches.ts); +22 fix wave 11 W6.2/W6.3 (#5989, #6132): search.cjk_keyword_deadline_ms and search.hnsw_iterative_scan type fields, KNOWN_CONFIG_KEYS rows and the mergeSearchScanKnobs helper that keeps loadConfigWithEngine under its function-size baseline (logic in search/cjk-keyword-deadline.ts, search/hnsw-iterative-scan.ts); +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +2 fix wave 10 lane L1 #4907: cycle.synthesize_concepts.budget_usd registered (validation in cycle/phase-config-values.ts); +2 #5958: dream.propose_takes.call_timeout_ms registered; 3 core memory: memory.core.* and memory.pressure.* known keys; +15 P5: wanted_pages.enabled/remote, line_grammar.enabled/allow_undeclared_types/effective_ranges and put_page.similar_pages key rows (logic in wanted-links.ts, line-grammar.ts, similar-pages.ts); +1 P2 extraction.date_grounding / facts.attribution keys; +1 #6188: fences.normalize registered in KNOWN_CONFIG_KEYS; +2 #6188: fences.repair.max_usd_per_page/per_day key rows; +1 fix wave 12 W2.3 #6231: facts.page_write_notability_filter key row (resolver in facts/notability-filter.ts); +1 #6317: persistence.single_consumer key row (logic in persistence/switches.ts, consumer-election.ts); +2 newer mentions on context_pack cards: mentions.newer_on_cards key row (logic in mentions/newer-mentions.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +1 #5329 (W14 PR3): chronicle.max_events_per_page registered in KNOWN_CONFIG_KEYS (validation in chronicle/config.ts); +2 C1/C2 memory proof wave: search.evidence_date_header + facts.candidate_fusion registry rows; +1 facts.supersession_thresholds registry row (per-model supersession calibration); +1 C4: models.standing_questions key row; +1 search.entity_anchoring key registration (default off; search/entity-anchor.ts); +1 search.query_facts_arm key registration (default off; search/facts-arm.ts); re-summed at the master 6ccf30c3e merge (1871 integration + 1868 master - 1865 base); +1 search.temporal_fact_reserve key registration (default off; search/facts-arm.ts); +1 fix wave 13 PR2: persistence.publication_ceiling_ms (P2.1/P2.3); v0.60.165.0 merge: W14 PR4 +7 and master +2 compose (1947 measured); +1 memory proof wave 2 W1: the recall.question_admission KNOWN_CONFIG_KEYS row (values validated in facts/question-recall.ts); +2 Cat 40 Hard fix wave (#6271) on top: mentions.alias_deny/multiword_aliases/sibling_merge and search.alias_fanout_max/demote_generated KNOWN_CONFIG_KEYS rows (1950 measured); +1 wave 15 P7.1 #5213: cycle.propose_takes.types KNOWN_CONFIG_KEYS row (parse + filter live in cycle/propose-takes.ts); +1 wave 15 P7.2 #6451: autopilot.git_pull KNOWN_CONFIG_KEYS row (read in persistence/automatic-sync-policy.ts); +1 wave 15 P7.3 #6369: cycle.lint.enabled KNOWN_CONFIG_KEYS row (read in cycle/lint-fix-setting.ts); +2 wave 15 P7.4 #5461: think.pages_budget_chars / think.excerpt_ceiling_chars KNOWN_CONFIG_KEYS rows (validation in think/pages-budget.ts); +6 wave 16 G5.1 (#6495): search.keyword_statement_timeout_ms type field, DB merge and KNOWN_CONFIG_KEYS row, toEngineConfig carries it (range + resolver live in postgres-engine/keyword-statement-timeout.ts); +1 GBRA-81 item 1: search.mode_source registered; +1 GBRA-60 S1: search.diverse_pool_depth in the known search keys; +3 #6643: sync.knock_on_refreeze_limit / sync.knock_on_run_limit KNOWN_CONFIG_KEYS rows (read by persistence/sync-run.ts knockOnLimits); +3 #6696: KNOWN_CONFIG_KEYS rows for persistence.maintenance.compaction_stale_hours and refusal_breaker_threshold; +1 wave 5 D5: context.proactive_brief KNOWN_CONFIG_KEYS row (read in context/proactive-brief.ts); +3 Cat 40 next wave part 1: KNOWN_CONFIG_KEYS rows for entity.names_references + entity.record_types + entity.row_page_status (one line), mcp.instructions_governing_rule and search.long_page_unit (re-summed at the 0.60.242.0 merge: master 1975 + 3); +1 wave 17 (#6667): cycle.consolidate.enabled KNOWN_CONFIG_KEYS row (read in cycle/phases/consolidate.ts); +2 Wave B PR 1: pages.segmented_storage and the segmented ceiling/retention keys (page-body/limits.ts); merge v0.60.249.0: Wave B PR 1 and master growth compose at 1981; +1 #6297: dream.patterns.min_interval_hours / child_read_budget_kb known keys; +1 #5012: loops.updates_require_reciprocity known key; +1 wave 18b lane 2 (#6495): search.keyword_timeout_negative_cache_seconds KNOWN_CONFIG_KEYS row
+src/core/config.ts 1985 ratchet +2 W5: search.page_rank_cut / page_rank_cut_factor KNOWN_CONFIG_KEYS rows (read in search/page-rank-cut.ts); +3 W3 confidence-gated reranking: search.reranker.gate / gate_min_gap KNOWN_CONFIG_KEYS rows (values parsed in search/crag.ts); re-summed at the W3 merge onto master v0.60.169.0 (1951 measured); +1 budgeted delivery PR 1: the search.auto_packing KNOWN_CONFIG_KEYS row (values validated in search/evidence-packing.ts); +1 #6278: persistence.sync_preparation_ms/maintenance_preparation_ms/preparation_ceiling_ms/max_preparation_attempts/preparation_deadlines key row (logic in persistence/preparation-budget.ts, switches.ts); +22 fix wave 11 W6.2/W6.3 (#5989, #6132): search.cjk_keyword_deadline_ms and search.hnsw_iterative_scan type fields, KNOWN_CONFIG_KEYS rows and the mergeSearchScanKnobs helper that keeps loadConfigWithEngine under its function-size baseline (logic in search/cjk-keyword-deadline.ts, search/hnsw-iterative-scan.ts); +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +2 fix wave 10 lane L1 #4907: cycle.synthesize_concepts.budget_usd registered (validation in cycle/phase-config-values.ts); +2 #5958: dream.propose_takes.call_timeout_ms registered; 3 core memory: memory.core.* and memory.pressure.* known keys; +15 P5: wanted_pages.enabled/remote, line_grammar.enabled/allow_undeclared_types/effective_ranges and put_page.similar_pages key rows (logic in wanted-links.ts, line-grammar.ts, similar-pages.ts); +1 P2 extraction.date_grounding / facts.attribution keys; +1 #6188: fences.normalize registered in KNOWN_CONFIG_KEYS; +2 #6188: fences.repair.max_usd_per_page/per_day key rows; +1 fix wave 12 W2.3 #6231: facts.page_write_notability_filter key row (resolver in facts/notability-filter.ts); +1 #6317: persistence.single_consumer key row (logic in persistence/switches.ts, consumer-election.ts); +2 newer mentions on context_pack cards: mentions.newer_on_cards key row (logic in mentions/newer-mentions.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +1 #5329 (W14 PR3): chronicle.max_events_per_page registered in KNOWN_CONFIG_KEYS (validation in chronicle/config.ts); +2 C1/C2 memory proof wave: search.evidence_date_header + facts.candidate_fusion registry rows; +1 facts.supersession_thresholds registry row (per-model supersession calibration); +1 C4: models.standing_questions key row; +1 search.entity_anchoring key registration (default off; search/entity-anchor.ts); +1 search.query_facts_arm key registration (default off; search/facts-arm.ts); re-summed at the master 6ccf30c3e merge (1871 integration + 1868 master - 1865 base); +1 search.temporal_fact_reserve key registration (default off; search/facts-arm.ts); +1 fix wave 13 PR2: persistence.publication_ceiling_ms (P2.1/P2.3); v0.60.165.0 merge: W14 PR4 +7 and master +2 compose (1947 measured); +1 memory proof wave 2 W1: the recall.question_admission KNOWN_CONFIG_KEYS row (values validated in facts/question-recall.ts); +2 Cat 40 Hard fix wave (#6271) on top: mentions.alias_deny/multiword_aliases/sibling_merge and search.alias_fanout_max/demote_generated KNOWN_CONFIG_KEYS rows (1950 measured); +1 wave 15 P7.1 #5213: cycle.propose_takes.types KNOWN_CONFIG_KEYS row (parse + filter live in cycle/propose-takes.ts); +1 wave 15 P7.2 #6451: autopilot.git_pull KNOWN_CONFIG_KEYS row (read in persistence/automatic-sync-policy.ts); +1 wave 15 P7.3 #6369: cycle.lint.enabled KNOWN_CONFIG_KEYS row (read in cycle/lint-fix-setting.ts); +2 wave 15 P7.4 #5461: think.pages_budget_chars / think.excerpt_ceiling_chars KNOWN_CONFIG_KEYS rows (validation in think/pages-budget.ts); +6 wave 16 G5.1 (#6495): search.keyword_statement_timeout_ms type field, DB merge and KNOWN_CONFIG_KEYS row, toEngineConfig carries it (range + resolver live in postgres-engine/keyword-statement-timeout.ts); +1 GBRA-81 item 1: search.mode_source registered; +1 GBRA-60 S1: search.diverse_pool_depth in the known search keys; +3 #6643: sync.knock_on_refreeze_limit / sync.knock_on_run_limit KNOWN_CONFIG_KEYS rows (read by persistence/sync-run.ts knockOnLimits); +3 #6696: KNOWN_CONFIG_KEYS rows for persistence.maintenance.compaction_stale_hours and refusal_breaker_threshold; +1 wave 5 D5: context.proactive_brief KNOWN_CONFIG_KEYS row (read in context/proactive-brief.ts); +3 Cat 40 next wave part 1: KNOWN_CONFIG_KEYS rows for entity.names_references + entity.record_types + entity.row_page_status (one line), mcp.instructions_governing_rule and search.long_page_unit (re-summed at the 0.60.242.0 merge: master 1975 + 3); +1 wave 17 (#6667): cycle.consolidate.enabled KNOWN_CONFIG_KEYS row (read in cycle/phases/consolidate.ts); +2 Wave B PR 1: pages.segmented_storage and the segmented ceiling/retention keys (page-body/limits.ts); merge v0.60.249.0: Wave B PR 1 and master growth compose at 1981; +1 #6297: dream.patterns.min_interval_hours / child_read_budget_kb known keys; +1 #5012: loops.updates_require_reciprocity known key; +1 wave 18b lane 2 (#6495): search.keyword_timeout_negative_cache_seconds KNOWN_CONFIG_KEYS row; integrated at wave 18b: master 1981 + 4 (lanes 2, 3, 5 known keys)
src/core/persistence/sync-run.ts 1690 ratchet new row: crossed the 1500 unlisted cap in #6643 (knock-on re-freeze, checkpoint revival, root cause and the truthful --retry-failed wait all drive the private cursor/gate machinery: holdUnderGate, freezeEntry, saveCursor); classification lives in sync-knock-on.ts, the checkpoint clause in checkpoint-validation.ts; peel the settle path (settleFailedRequest and its recoveries) into a sibling module next; +3 #6722: committed pages' size_state tallied into the cursor and the sync receipt size_states (logic in page-embedding-budget.ts addSizeState); merge v0.60.240.0: large pages and master growth compose at 1687; +2 #6694: the slug-mode checkpoint revival import and its doc line (predicate lives in persistence/sync-slug-mode.ts)
src/core/bootstrap/harness.ts 2615 ratchet +29 live-PGLite-serve lane: LIVE_SERVE refusal ahead of source resolution + unpinned --token hooks (CI e2e fix); +46 wave review: resolveHookSource dep (serve-parity resolver + federated grant), --source shape validation, loud SOURCE_UNRESOLVED instead of a silent 'default'; +10: #4574 parseCodexBlockBearer http_headers shape + legacy bearer_token fallback; +4 at megawave/wave-k merge; +codex hooks lane: step-7 codex hooks.json + config.toml trust pair, removeHarness arm; +234 ambient-writeback WP3: kind:'instructions' targets (plan/apply/converge-off/remove/status probes, OV-A4 override pre-check) — splice/render mechanics live in instructions-block.ts; +59 adversarial fix wave: registrar-mode block suppression, converge-failure receipt tracking, MCP-confirmed guard before block install; +26 round-3 fixes: codex-lane MCP-confirmed guard + smoke-rollback block strip; master: | merged v0.48.1.0 true-up; +41 #4897 resolveImplicitSource dep + defaultResolveImplicitSource: hooks/token/receipt bind to the serve's implicit default source when --source is omitted; +23 #4586 statusHarness live claude-code mcp verdict (URL mismatch or same-scope non-HTTP registration reads failed, receipt untouched); shared-skills integration on company-ingestion base; +18 #5671: logAmbientPostureNotes helper (registrar note moved out of applyHarness + pre-consent warning when an explicit private facts default meets the HTTP harness; text shared with doctor in facts/writeback-config.ts); +24 #5893: rotation grant carry wiring and its rotationCarry/withheldOperationsNote helpers (carry rules live in token-mint.ts carryLegacyGrant); +6 #5878: --refresh-skills flag and status epoch line (refresh logic lives in harness-skills.ts); +7 #4618 seat: HarnessFlags.seat field, --seat/--no-seat parse via hooks.ts parseSeatFlags, GBRAIN_SEAT in the hook env; -119 #6082: plugin-lane detectors moved to plugin-lanes.ts (re-exported); +18 #6092/#6171: hook ownership identity on write/remove/converge, permission ownership carry, --remove --dry-run and the --status hook census (logic in hooks.ts + harness-hooks.ts); +5 D8 Codex slice: the Codex SessionEnd capture hook obeys the recorded consent (wireCodexCapture: hooks on, capture accepted, never registrar mode) and is disclosed in the consent block
src/core/oauth-provider.ts 1236 ratchet new row: crossed the 1500 unlisted cap absorbing #3819 (DCR 400 invalid_client_metadata + scope filtering + custom-scheme redirect_uris + pseudo-scheme guard); merged v0.49: transactional grant enforcement shared with hosted grant policies; +1 #5222 resourceUrl option
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index d2201c5e36..1865553c0e 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -62,6 +62,7 @@
"addTakesBatch: (rows: TakeBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntriesBatch: (entries: TimelineBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntry: (slug: string, entry: TimelineInput, opts?: { skipExistenceCheck?: boolean; sourceId?: string; }) => Promise<boolean>",
+ "allocateBodyOccurrenceIds: (count: number) => Promise<number[]>",
"batchLoadEmotionalInputs: (slugs?: string[]) => Promise<EmotionalWeightInputRow[]>",
"connect: (config: EngineConfig) => Promise<void>",
"consolidateFact: (id: number, takeId: number) => Promise<void>",
@@ -72,6 +73,7 @@
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
+ "createSegmentedPageShell: (slug: string, meta: SegmentedPageMeta, opts: { sourceId: string; }) => Promise<{ id: number; }>",
"createVersion: (slug: string, opts?: { sourceId?: string; preimage?: PageSnapshot; }) => Promise<PageVersion>",
"deleteChunks: (slug: string, opts?: { sourceId?: string; }) => Promise<void>",
"deleteCodeEdgesForChunks: (chunkIds: number[]) => Promise<void>",
@@ -92,6 +94,7 @@
"findOntologyConflicts: (opts?: PageReadScope & { minConfidence?: number; visibility?: OntologyReadOpts[\"visibility\"]; }) => Promise<OntologyConflict[]>",
"findOrphanPages: (opts?: PageReadScope & { sourceId?: string; sourceIds?: string[]; mode?: \"inbound\" | \"islanded\"; }) => Promise<Array<{ slug: string; title: string; domain: string | null; type?: string | null; quarantined?: boolean; source_id?: string; }>>",
"findTrajectory: (opts: TrajectoryOpts) => Promise<TrajectoryPoint[]>",
+ "flipBodyGeneration: (input: BodyFlipInput) => Promise<BodyFlipResult>",
"getAdjacencyBoosts: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, AdjacencyRow>>",
"getAllConfig: () => Promise<Record<string, string>>",
"getAllSlugs: (opts?: { sourceId?: string; }) => Promise<Set<string>>",
@@ -171,14 +174,17 @@
"markPagesExtractedBatch: (refs: Array<{ slug: string; source_id: string; extractedAt?: string; }>, defaultExtractedAt: string) => Promise<number>",
"mergeOntologyFact: (obs: OntologyObservationInput) => Promise<OntologyMergeResult>",
"migrateFactsToCanonical: (phantomSlug: string, canonicalSlug: string, sourceId: string) => Promise<{ migrated: number; }>",
+ "openBodyStaging: (input: BodyStagingInput) => Promise<void>",
"purgeDeletedPages: (olderThanHours: number, opts?: { dryRun?: boolean; }) => Promise<{ slugs: string[]; count: number; pages?: { slug: string; deleted_at: Date; }[]; }>",
"putContradictionCacheEntry: (opts: { chunk_a_hash: string; chunk_b_hash: string; model_id: string; prompt_version: string; truncation_policy: string; verdict: Record<string, unknown>; ttl_seconds?: number; }) => Promise<void>",
"putDreamVerdict: (filePath: string, contentHash: string, verdict: DreamVerdictInput) => Promise<void>",
"putPage: (slug: string, page: PageInput, opts?: PageWriteOptions) => Promise<Page>",
"putRawData: (slug: string, source: string, data: object, opts?: { sourceId?: string; }) => Promise<void>",
"readEmbeddingStateCounts: (opts: { mode: \"ops\" | \"full\"; sourceIds?: string[]; purgeWindowHours: number; }) => Promise<EmbeddingStateCounts>",
+ "readManifest: (pageId: number, opts?: { generation?: number; stagingId?: string; region?: BodyRegion; lastN?: number; }) => Promise<ManifestRow[]>",
"readPageSnapshot: (slug: string, opts?: PageSnapshotOptions) => Promise<PageSnapshot | null>",
"readPageSnapshotsBatch: (refs: ReadonlyArray<{ slug: string; sourceId: string; }>, opts?: { maxBytes?: number; includeDeleted?: boolean; absentIsNull?: boolean; }) => Promise<PageSnapshotBatch>",
+ "readSegmentTexts: (sourceId: string, sha256s: readonly Uint8Array[]) => Promise<Map<string, Uint8Array>>",
"readonly kind: \"postgres\" | \"pglite\"",
"reconnect: (ctx?: { error?: unknown; }) => Promise<void>",
"refreshPageBody: (slug: string, sourceId: string, compiledTruth: string, timeline: string, contentHash: string) => Promise<void>",
@@ -207,17 +213,22 @@
"searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",
"searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",
"searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>",
+ "setBodyStagingState: (id: string, state: BodyStagingState, opts?: { commitRequestId?: string | null; }) => Promise<void>",
"setConfig: (key: string, value: string) => Promise<void>",
"setEmotionalWeightBatch: (rows: EmotionalWeightWriteRow[]) => Promise<number>",
"setPageAliases: (slug: string, sourceId: string, aliasNorms: string[], opts?: { inline?: boolean; }) => Promise<void>",
"setPageEmbeddingSignature: (slug: string, opts: { sourceId?: string; signature: string; }) => Promise<void>",
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
+ "stageManifestRows: (rows: readonly ManifestRowInput[]) => Promise<void>",
+ "stageSegmentChunks: (pageId: number, generation: number, chunks: readonly SegmentChunkInput[], opts?: { embeddingColumn?: ResolvedColumn; }) => Promise<number[]>",
+ "stageSegmentTexts: (sourceId: string, texts: readonly SegmentTextInput[]) => Promise<{ inserted: number; }>",
"stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
"sweepDreamVerdicts: () => Promise<number>",
+ "sweepSegments: (opts?: SegmentSweepOptions) => Promise<SegmentSweepResult>",
"transaction: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"transactionDirect: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"traverseGraph: (slug: string, depth?: number, opts?: TraverseGraphOpts) => Promise<GraphNode[]>",
@@ -367,7 +378,7 @@
"kind": "interface",
"members": [
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\"",
"chunk_text: string",
"doc_comment?: string | null | undefined",
"embedded_at: Date | null",
@@ -394,7 +405,7 @@
"kind": "interface",
"members": [
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\" | \"image_asset\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\" | \"image_asset\"",
"chunk_text: string",
"doc_comment?: string | undefined",
"embedding?: Float32Array<ArrayBufferLike> | undefined",
@@ -469,7 +480,7 @@
"kind": "variable",
"name": "DEGRADED_REASONS",
"signature": [
- "readonly [\"no_provider\", \"provider_error\", \"timeout\", \"variant_embed_failed\", \"original_embed_failed\", \"first_result_truncated\", \"no_key\", \"empty_result_set\", \"malformed_shape\", \"budget\", \"rate_limited\", \"unreachable\", \"auth\", \"candidate_budget\", \"iterative_scan_unavailable\", \"egress_denied\", \"embedding_disabled\"]"
+ "readonly [\"no_provider\", \"provider_error\", \"timeout\", \"variant_embed_failed\", \"original_embed_failed\", \"first_result_truncated\", \"no_key\", \"empty_result_set\", \"malformed_shape\", \"budget\", \"rate_limited\", \"unreachable\", \"auth\", \"candidate_budget\", \"iterative_scan_unavailable\", \"egress_denied\", \"embedding_disabled\", \"skipped_after_timeout\"]"
]
},
{
@@ -483,7 +494,7 @@
"kind": "type",
"name": "DegradedReason",
"signature": [
- "\"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\""
+ "\"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\" | \"skipped_after_timeout\""
]
},
{
@@ -496,7 +507,7 @@
{
"kind": "interface",
"members": [
- "reason?: \"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\" | undefined",
+ "reason?: \"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\" | \"skipped_after_timeout\" | undefined",
"stage: \"embed_unavailable\" | \"embed_timeout\" | \"expansion_failed\" | \"expansion_partial\" | \"rescore_skipped\" | \"vector_arm_failed\" | \"keyword_arm_failed\" | \"title_arm_failed\" | \"budget_dropped_all\" | \"budget_truncated\" | \"keyword_zero\" | \"cache_prestamp\" | \"reranker_skipped\" | \"rerank_passthrough\" | \"rerank_failed\" | \"keyword_relaxed_carried\" | \"safe_index_pending\" | \"vector_candidates_incomplete\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"projection_status_unknown\" | \"keyword_count_unavailable\""
],
"name": "DegradedStageEntry"
@@ -897,6 +908,8 @@
{
"kind": "interface",
"members": [
+ "body_bytes?: number | null | undefined",
+ "body_storage?: BodyStorage | undefined",
"compiled_truth: string",
"content_hash?: string | undefined",
"contextual_retrieval_mode?: \"none\" | \"title\" | \"per_chunk_synopsis\" | null | undefined",
@@ -1014,7 +1027,11 @@
{
"kind": "interface",
"members": [
+ "body_bytes?: number | undefined",
+ "body_generation?: number | undefined",
+ "body_storage?: \"segmented\" | undefined",
"compiled_truth: string",
+ "content_hash?: string | null | undefined",
"frontmatter: Record<string, unknown>",
"id: number",
"is_deleted?: boolean | null | undefined",
@@ -1040,6 +1057,7 @@
"addTakesBatch: (rowsIn: TakeBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntriesBatch: (entries: TimelineBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntry: (slug: string, entry: TimelineInput, opts?: { skipExistenceCheck?: boolean; sourceId?: string; }) => Promise<boolean>",
+ "allocateBodyOccurrenceIds: (count: number) => Promise<number[]>",
"batchLoadEmotionalInputs: (slugs?: string[]) => Promise<EmotionalWeightInputRow[]>",
"connect: (config: EngineConfig & { poolSize?: number; parentConnectionManager?: ConnectionManager; }) => Promise<void>",
"connectionManager: ConnectionManager | null",
@@ -1051,6 +1069,7 @@
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
+ "createSegmentedPageShell: (slug: string, meta: SegmentedPageMeta, opts: { sourceId: string; }) => Promise<{ id: number; }>",
"createVersion: (slug: string, opts?: { sourceId?: string; preimage?: PageSnapshot; }) => Promise<PageVersion>",
"deleteChunks: (slug: string, opts?: { sourceId?: string; }) => Promise<void>",
"deleteCodeEdgesForChunks: (chunkIds: number[]) => Promise<void>",
@@ -1072,6 +1091,7 @@
"findOntologyConflicts: (opts?: PageReadScope & { minConfidence?: number; visibility?: OntologyReadOpts[\"visibility\"]; }) => Promise<OntologyConflict[]>",
"findOrphanPages: (opts?: { sourceId?: string; sourceIds?: string[]; excludePrivate?: boolean; mode?: \"inbound\" | \"islanded\"; }) => Promise<Array<{ slug: string; title: string; domain: string | null; type?: string | null; quarantined?: boolean; source_id?: string; }>>",
"findTrajectory: (opts: TrajectoryOpts) => Promise<TrajectoryPoint[]>",
+ "flipBodyGeneration: (input: BodyFlipInput) => Promise<BodyFlipResult>",
"getAdjacencyBoosts: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, AdjacencyRow>>",
"getAllConfig: () => Promise<Record<string, string>>",
"getAllSlugs: (opts?: { sourceId?: string; }) => Promise<Set<string>>",
@@ -1153,6 +1173,7 @@
"mergeOntologyFact: (obs: OntologyObservationInput) => Promise<OntologyMergeResult>",
"migrateFactsToCanonical: (phantomSlug: string, canonicalSlug: string, sourceId: string) => Promise<{ migrated: number; }>",
"onCheckout: (listener: () => void) => () => void",
+ "openBodyStaging: (input: BodyStagingInput) => Promise<void>",
"private _beforeDisconnect",
"private _bulkRetryOptsCache",
"private _chunkWritesInTransaction",
@@ -1179,6 +1200,7 @@
"private jitOffRead",
"private keywordStatementTimeout",
"private keywordStatementTimeoutSetting",
+ "private keywordTimeouts",
"private onPoisoned",
"private poisonedDiscards",
"private poolHealth",
@@ -1198,8 +1220,10 @@
"putPage: (slug: string, page: PageInput, opts?: PageWriteOptions) => Promise<Page>",
"putRawData: (slug: string, source: string, data: object, opts?: { sourceId?: string; }) => Promise<void>",
"readEmbeddingStateCounts: (opts: { mode: \"ops\" | \"full\"; sourceIds?: string[]; purgeWindowHours: number; }) => Promise<EmbeddingStateCounts>",
+ "readManifest: (pageId: number, opts?: { generation?: number; stagingId?: string; region?: BodyRegion; lastN?: number; }) => Promise<ManifestRow[]>",
"readPageSnapshot: (slug: string, opts?: PageSnapshotOptions) => Promise<PageSnapshot | null>",
"readPageSnapshotsBatch: (refs: ReadonlyArray<{ slug: string; sourceId: string; }>, opts?: { maxBytes?: number; includeDeleted?: boolean; absentIsNull?: boolean; }) => Promise<PageSnapshotBatch>",
+ "readSegmentTexts: (sourceId: string, sha256s: readonly Uint8Array[]) => Promise<Map<string, Uint8Array>>",
"readonly kind: \"postgres\"",
"reconnect: (ctx?: { error?: unknown; }) => Promise<void>",
"refreshPageBody: (slug: string, sourceId: string, compiledTruth: string, timeline: string, contentHash: string) => Promise<void>",
@@ -1228,6 +1252,7 @@
"searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",
"searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",
"searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>",
+ "setBodyStagingState: (id: string, state: BodyStagingState, opts?: { commitRequestId?: string | null; }) => Promise<void>",
"setConfig: (key: string, value: string) => Promise<void>",
"setEmotionalWeightBatch: (rows: EmotionalWeightWriteRow[]) => Promise<number>",
"setPageAliases: (slug: string, sourceId: string, aliasNorms: string[], opts?: { inline?: boolean; }) => Promise<void>",
@@ -1235,11 +1260,15 @@
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
"sql: postgres.Sql<{}>",
+ "stageManifestRows: (rows: readonly ManifestRowInput[]) => Promise<void>",
+ "stageSegmentChunks: (pageId: number, generation: number, chunks: readonly SegmentChunkInput[], opts?: { embeddingColumn?: ResolvedColumn; }) => Promise<number[]>",
+ "stageSegmentTexts: (sourceId: string, texts: readonly SegmentTextInput[]) => Promise<{ inserted: number; }>",
"stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
"sweepDreamVerdicts: () => Promise<number>",
+ "sweepSegments: (opts?: SegmentSweepOptions) => Promise<SegmentSweepResult>",
"transaction: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"transactionDirect: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"traverseGraph: (slug: string, depth?: number, opts?: TraverseGraphOpts) => Promise<GraphNode[]>",
@@ -1397,6 +1426,7 @@
"hnswIterativeScan?: \"relaxed_order\" | \"strict_order\" | \"off\" | undefined",
"include_slug_prefixes?: string[] | undefined",
"intentWeighting?: boolean | undefined",
+ "keywordTimeoutCache?: boolean | undefined",
"language?: string | undefined",
"limit?: number | undefined",
"minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined",
@@ -1445,7 +1475,7 @@
"chronicle_boost?: number | undefined",
"chunk_id: number",
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\"",
"chunk_text: string",
"content_flag?: { reason: string; detail: string; } | undefined",
"content_hash?: string | null | undefined",
@@ -1522,7 +1552,7 @@
"kind": "interface",
"members": [
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\"",
"chunk_text: string",
"model: string | null",
"page_id: number",
@@ -1920,7 +1950,7 @@
"kind": "type",
"name": "ToolLoopStopReason",
"signature": [
- "\"length\" | \"unrecoverable\" | \"end\" | \"refusal\" | \"content_filter\" | \"max_turns\" | \"aborted\" | \"empty_response\""
+ "\"aborted\" | \"length\" | \"end\" | \"unrecoverable\" | \"refusal\" | \"content_filter\" | \"max_turns\" | \"empty_response\""
]
},
{
@@ -3316,6 +3346,7 @@
"addTakesBatch: (rows: TakeBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntriesBatch: (entries: TimelineBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntry: (slug: string, entry: TimelineInput, opts?: { skipExistenceCheck?: boolean; sourceId?: string; }) => Promise<boolean>",
+ "allocateBodyOccurrenceIds: (count: number) => Promise<number[]>",
"batchLoadEmotionalInputs: (slugs?: string[]) => Promise<EmotionalWeightInputRow[]>",
"connect: (config: EngineConfig) => Promise<void>",
"consolidateFact: (id: number, takeId: number) => Promise<void>",
@@ -3326,6 +3357,7 @@
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
+ "createSegmentedPageShell: (slug: string, meta: SegmentedPageMeta, opts: { sourceId: string; }) => Promise<{ id: number; }>",
"createVersion: (slug: string, opts?: { sourceId?: string; preimage?: PageSnapshot; }) => Promise<PageVersion>",
"deleteChunks: (slug: string, opts?: { sourceId?: string; }) => Promise<void>",
"deleteCodeEdgesForChunks: (chunkIds: number[]) => Promise<void>",
@@ -3346,6 +3378,7 @@
"findOntologyConflicts: (opts?: PageReadScope & { minConfidence?: number; visibility?: OntologyReadOpts[\"visibility\"]; }) => Promise<OntologyConflict[]>",
"findOrphanPages: (opts?: PageReadScope & { sourceId?: string; sourceIds?: string[]; mode?: \"inbound\" | \"islanded\"; }) => Promise<Array<{ slug: string; title: string; domain: string | null; type?: string | null; quarantined?: boolean; source_id?: string; }>>",
"findTrajectory: (opts: TrajectoryOpts) => Promise<TrajectoryPoint[]>",
+ "flipBodyGeneration: (input: BodyFlipInput) => Promise<BodyFlipResult>",
"getAdjacencyBoosts: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, AdjacencyRow>>",
"getAllConfig: () => Promise<Record<string, string>>",
"getAllSlugs: (opts?: { sourceId?: string; }) => Promise<Set<string>>",
@@ -3425,14 +3458,17 @@
"markPagesExtractedBatch: (refs: Array<{ slug: string; source_id: string; extractedAt?: string; }>, defaultExtractedAt: string) => Promise<number>",
"mergeOntologyFact: (obs: OntologyObservationInput) => Promise<OntologyMergeResult>",
"migrateFactsToCanonical: (phantomSlug: string, canonicalSlug: string, sourceId: string) => Promise<{ migrated: number; }>",
+ "openBodyStaging: (input: BodyStagingInput) => Promise<void>",
"purgeDeletedPages: (olderThanHours: number, opts?: { dryRun?: boolean; }) => Promise<{ slugs: string[]; count: number; pages?: { slug: string; deleted_at: Date; }[]; }>",
"putContradictionCacheEntry: (opts: { chunk_a_hash: string; chunk_b_hash: string; model_id: string; prompt_version: string; truncation_policy: string; verdict: Record<string, unknown>; ttl_seconds?: number; }) => Promise<void>",
"putDreamVerdict: (filePath: string, contentHash: string, verdict: DreamVerdictInput) => Promise<void>",
"putPage: (slug: string, page: PageInput, opts?: PageWriteOptions) => Promise<Page>",
"putRawData: (slug: string, source: string, data: object, opts?: { sourceId?: string; }) => Promise<void>",
"readEmbeddingStateCounts: (opts: { mode: \"ops\" | \"full\"; sourceIds?: string[]; purgeWindowHours: number; }) => Promise<EmbeddingStateCounts>",
+ "readManifest: (pageId: number, opts?: { generation?: number; stagingId?: string; region?: BodyRegion; lastN?: number; }) => Promise<ManifestRow[]>",
"readPageSnapshot: (slug: string, opts?: PageSnapshotOptions) => Promise<PageSnapshot | null>",
"readPageSnapshotsBatch: (refs: ReadonlyArray<{ slug: string; sourceId: string; }>, opts?: { maxBytes?: number; includeDeleted?: boolean; absentIsNull?: boolean; }) => Promise<PageSnapshotBatch>",
+ "readSegmentTexts: (sourceId: string, sha256s: readonly Uint8Array[]) => Promise<Map<string, Uint8Array>>",
"readonly kind: \"postgres\" | \"pglite\"",
"reconnect: (ctx?: { error?: unknown; }) => Promise<void>",
"refreshPageBody: (slug: string, sourceId: string, compiledTruth: string, timeline: string, contentHash: string) => Promise<void>",
@@ -3461,17 +3497,22 @@
"searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",
"searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",
"searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>",
+ "setBodyStagingState: (id: string, state: BodyStagingState, opts?: { commitRequestId?: string | null; }) => Promise<void>",
"setConfig: (key: string, value: string) => Promise<void>",
"setEmotionalWeightBatch: (rows: EmotionalWeightWriteRow[]) => Promise<number>",
"setPageAliases: (slug: string, sourceId: string, aliasNorms: string[], opts?: { inline?: boolean; }) => Promise<void>",
"setPageEmbeddingSignature: (slug: string, opts: { sourceId?: string; signature: string; }) => Promise<void>",
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
+ "stageManifestRows: (rows: readonly ManifestRowInput[]) => Promise<void>",
+ "stageSegmentChunks: (pageId: number, generation: number, chunks: readonly SegmentChunkInput[], opts?: { embeddingColumn?: ResolvedColumn; }) => Promise<number[]>",
+ "stageSegmentTexts: (sourceId: string, texts: readonly SegmentTextInput[]) => Promise<{ inserted: number; }>",
"stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
"sweepDreamVerdicts: () => Promise<number>",
+ "sweepSegments: (opts?: SegmentSweepOptions) => Promise<SegmentSweepResult>",
"transaction: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"transactionDirect: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"traverseGraph: (slug: string, depth?: number, opts?: TraverseGraphOpts) => Promise<GraphNode[]>",
@@ -4633,21 +4674,21 @@
"kind": "variable",
"name": "importFile",
"signature": [
- "(engine: BrainEngine, filePath: string, relativePath: string, opts?: { noEmbed?: boolean; inferFrontmatter?: boolean; sourceId?: string; forceRechunk?: boolean; activePack?: { page_types: ReadonlyArray<{ name: string; path_prefixes: ReadonlyArray<string>; aliases?: ReadonlyArray<string>; }>; }; firstCommitAt?: Date; }) => Promise<ImportResult>"
+ "(engine: BrainEngine, filePath: string, relativePath: string, opts?: { noEmbed?: boolean; inferFrontmatter?: boolean; sourceId?: string; forceRechunk?: boolean; activePack?: { page_types: ReadonlyArray<{ name: string; path_prefixes: ReadonlyArray<string>; aliases?: ReadonlyArray<string>; }>; }; firstCommitAt?: Date; bodyPolicy?: PageBodyPolicy; }) => Promise<ImportResult>"
]
},
{
"kind": "function",
"name": "importFromContent",
"signature": [
- "(engine: BrainEngine, slug: string, content: string, opts?: { prepare?: (prepared: PreparedContentImport) => Promise<ImportResult>; coordinated?: boolean; existingSnapshot?: PageSnapshot | null; prepareFrontmatter?: (page: ParsedPage) => void; noEmbed?: boolean; sourceId?: string; filename?: string; sourcePath?: string; sourceRoot?: string; fileTimes?: { birthtime?: Date; mtime?: Date; firstCommit?: Date; }; forceRechunk?: boolean; activePack?: ParseOpts[\"activePack\"]; source_kind?: string | null; source_uri?: string | null; ingested_via?: string | null; remote?: boolean; preserveGateMarkers?: boolean; allowEmptyOverwrite?: boolean; overrideTier?: unknown; writeGate?: WriteGateInput; beforeCommit?: (tx: BrainEngine, slug: string) => Promise<void>; onPostCommitEmbedding?: (complete: () => Promise<ImportEmbeddingResult>) => void; } & ImportFenceOptions) => Promise<ImportResult>"
+ "(engine: BrainEngine, slug: string, content: string, opts?: { prepare?: (prepared: PreparedContentImport) => Promise<ImportResult>; coordinated?: boolean; existingSnapshot?: PageSnapshot | null; prepareFrontmatter?: (page: ParsedPage) => void; noEmbed?: boolean; sourceId?: string; filename?: string; sourcePath?: string; sourceRoot?: string; fileTimes?: { birthtime?: Date; mtime?: Date; firstCommit?: Date; }; forceRechunk?: boolean; activePack?: ParseOpts[\"activePack\"]; source_kind?: string | null; source_uri?: string | null; ingested_via?: string | null; segmentedOwner?: SegmentedStagingOwner; reuseSegments?: SegmentedImport; remote?: boolean; preserveGateMarkers?: boolean; allowEmptyOverwrite?: boolean; overrideTier?: unknown; writeGate?: WriteGateInput; beforeCommit?: (tx: BrainEngine, slug: string) => Promise<void>; onPostCommitEmbedding?: (complete: () => Promise<ImportEmbeddingResult>) => void; } & ImportFenceOptions) => Promise<ImportResult>"
]
},
{
"kind": "function",
"name": "importFromFile",
"signature": [
- "(engine: BrainEngine, filePath: string, relativePath: string, opts?: { noEmbed?: boolean; inferFrontmatter?: boolean; sourceId?: string; forceRechunk?: boolean; activePack?: { page_types: ReadonlyArray<{ name: string; path_prefixes: ReadonlyArray<string>; aliases?: ReadonlyArray<string>; }>; }; firstCommitAt?: Date; }) => Promise<ImportResult>"
+ "(engine: BrainEngine, filePath: string, relativePath: string, opts?: { noEmbed?: boolean; inferFrontmatter?: boolean; sourceId?: string; forceRechunk?: boolean; activePack?: { page_types: ReadonlyArray<{ name: string; path_prefixes: ReadonlyArray<string>; aliases?: ReadonlyArray<string>; }>; }; firstCommitAt?: Date; bodyPolicy?: PageBodyPolicy; }) => Promise<ImportResult>"
]
},
{
@@ -4664,6 +4705,13 @@
"(relativePath: string) => boolean"
]
},
+ {
+ "kind": "function",
+ "name": "loadBrainTimeZone",
+ "signature": [
+ "(engine: BrainEngine) => Promise<string | undefined>"
+ ]
+ },
{
"kind": "function",
"name": "pLimit",
@@ -5043,6 +5091,13 @@
],
"name": "SlugResolver"
},
+ {
+ "kind": "variable",
+ "name": "TIMELINE_HEADING_RE",
+ "signature": [
+ "RegExp"
+ ]
+ },
{
"kind": "interface",
"members": [
@@ -5295,6 +5350,13 @@
],
"name": "ContentHold"
},
+ {
+ "kind": "variable",
+ "name": "FENCE_TOGGLE_RE",
+ "signature": [
+ "RegExp"
+ ]
+ },
{
"kind": "interface",
"members": [
@@ -5442,6 +5504,26 @@
],
"name": "ParsedMarkdown"
},
+ {
+ "kind": "type",
+ "name": "ParsedMarkdownFields",
+ "signature": [
+ "{ title: string; slug: string; type: PageType; typeExplicit?: boolean | undefined; inferredSubtype?: { type: string; name: string; } | undefined; tags: string[]; errors?: ParseValidationError[] | undefined; warnings?: ParseValidationWarning[] | undefined; recovery?: FrontmatterRecovery | undefined; }"
+ ]
+ },
+ {
+ "kind": "interface",
+ "members": [
+ "body: string",
+ "errors: ParseValidationError[]",
+ "frontmatter: Record<string, unknown>",
+ "lifted: string",
+ "recovery?: FrontmatterRecovery | undefined",
+ "safeContent: string",
+ "warnings: ParseValidationWarning[]"
+ ],
+ "name": "ParsedMarkdownHead"
+ },
{
"kind": "variable",
"name": "RECOVERY_VERSION",
@@ -5470,6 +5552,13 @@
],
"name": "SerializePageOpts"
},
+ {
+ "kind": "function",
+ "name": "bareTimelineSectionLine",
+ "signature": [
+ "(raw: string, datedBullets: number) => \"end\" | \"blank\" | \"bullet\" | \"wrap\" | \"other\""
+ ]
+ },
{
"kind": "function",
"name": "classifyImportHold",
@@ -5498,6 +5587,13 @@
"(byteLength: number, maxBytes: number, codeFile?: boolean) => ContentHold | null"
]
},
+ {
+ "kind": "function",
+ "name": "embeddedTitleLineValue",
+ "signature": [
+ "(line: string) => string | null"
+ ]
+ },
{
"kind": "function",
"name": "findTimelineSplitIndex",
@@ -5519,6 +5615,20 @@
"(message: string) => string"
]
},
+ {
+ "kind": "function",
+ "name": "frontmatterQuoteFence",
+ "signature": [
+ "(lifted: string) => \"none\" | \"closed\" | \"open\""
+ ]
+ },
+ {
+ "kind": "function",
+ "name": "h1TitleLineValue",
+ "signature": [
+ "(raw: string) => string | null"
+ ]
+ },
{
"kind": "function",
"name": "inferTypeAndSubtypeFromPack",
@@ -5533,6 +5643,13 @@
"(filePath: string | undefined, pack: { page_types: ReadonlyArray<{ name: string; path_prefixes: ReadonlyArray<string>; }>; }) => PageType"
]
},
+ {
+ "kind": "function",
+ "name": "isBareTimelineHeading",
+ "signature": [
+ "(raw: string) => boolean"
+ ]
+ },
{
"kind": "function",
"name": "isFrontmatterHoldMessage",
@@ -5547,6 +5664,20 @@
"(sourceUri: string | null | undefined) => boolean"
]
},
+ {
+ "kind": "function",
+ "name": "isTimelineHeadingAfterDash",
+ "signature": [
+ "(trimmed: string) => boolean"
+ ]
+ },
+ {
+ "kind": "function",
+ "name": "nullBytesError",
+ "signature": [
+ "(line: number) => ParseValidationError"
+ ]
+ },
{
"kind": "function",
"name": "parseMarkdown",
@@ -5554,6 +5685,27 @@
"(content: string, filePath?: string, opts?: ParseOpts) => ParsedMarkdown"
]
},
+ {
+ "kind": "function",
+ "name": "parseMarkdownHead",
+ "signature": [
+ "(content: string, opts?: ParseOpts) => ParsedMarkdownHead"
+ ]
+ },
+ {
+ "kind": "function",
+ "name": "parsedMarkdownFields",
+ "signature": [
+ "(head: ParsedMarkdownHead, bodyTitle: () => string, filePath?: string, opts?: ParseOpts) => ParsedMarkdownFields"
+ ]
+ },
+ {
+ "kind": "function",
+ "name": "quoteAmbiguousFrontmatterLine",
+ "signature": [
+ "(line: string) => { key: string; replacement: string; } | null"
+ ]
+ },
{
"kind": "function",
"name": "recoverFrontmatter",
@@ -5617,6 +5769,20 @@
"(body: string) => { compiled_truth: string; timeline: string; }"
]
},
+ {
+ "kind": "function",
+ "name": "timelineSentinelKind",
+ "signature": [
+ "(trimmed: string) => \"marker\" | \"dash\" | null"
+ ]
+ },
+ {
+ "kind": "function",
+ "name": "validatorFrontmatterFence",
+ "signature": [
+ "(lines: readonly string[]) => { firstNonEmpty: number; opens: boolean; closeLine: number; }"
+ ]
+ },
{
"kind": "function",
"name": "yamlAliasesWithinLimit",
@@ -6158,7 +6324,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"rate_limited\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"write_outcome_unknown\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"budget_below_recent_runtime\" | \"backup_dump_failed\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"cache_quota_exceeded\" | \"capacity_paused\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"commit_lock_busy\" | \"commit_paths_invalid\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"connection_lost\" | \"chunkless_pages_healable\" | \"consent_required\" | \"consent_timeout\" | \"consumers_without_heartbeat\" | \"content_repair_needs_human\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cursor_incarnation_retired\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"deleted_page_chunks_overdue\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"drain_stalled\" | \"managed_sync_not_moving\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"doctor_tier_unavailable\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_state_unknown\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"entity_types_unavailable\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"fact_withdrawn\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"fix_not_writable\" | \"file_removed_during_scan\" | \"file_too_large\" | \"follow_approval_required\" | \"forget_requires_owner\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"ghost_mass_delete_refused\" | \"ghost_storage_unknown\" | \"git_branch_unborn\" | \"git_durability_not_enabled\" | \"git_checkout_required\" | \"git_detached_head\" | \"git_index_locked\" | \"git_index_stale\" | \"git_target_pending\" | \"git_operation_in_progress\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"graph_incomplete\" | \"host_identity_mismatch\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"head_blocked\" | \"held_failed\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"integrate_conflict\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"unclosed_ambiguous_tail\" | \"tail_exposure_approval\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"loops_extraction_skipped\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_failure_unsettled\" | \"merge_recommended\" | \"managed_sync_flag_refused\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_declined\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_owner_host\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"page_shrink_refused\" | \"page_too_large_for_inline\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pattern_claims_pending\" | \"pending_writes\" | \"persistence_restart_required\" | \"pool_inflight_over_budget\" | \"deep_health_probe_failed\" | \"serve_self_exit_suppressed\" | \"serve_unhealthy_exit\" | \"persistence_write_stall\" | \"push_unconfirmed\" | \"schema_lock_blocked\" | \"pg_connection_recovery_failed\" | \"pg_connection_stuck\" | \"pg_pool_stalled\" | \"pg_statement_build_failed\" | \"pglite_busy\" | \"pglite_vector_index_too_large\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"knock_on_exhausted\" | \"publication_pending\" | \"purge_blocked_pending_recovery\" | \"purge_lookup_timeout\" | \"question_not_found\" | \"question_owner_only\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"pat_file_unreadable\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"result_too_large\" | \"revision_changed\" | \"revision_unavailable\" | \"scope_missing\" | \"search_cursor_requires_keyword\" | \"search_mode_local_only\" | \"search_offset_over_cap\" | \"serve_build_drift\" | \"serve_port_in_use\" | \"serve_status_only\" | \"setup_harness_unsupported\" | \"setup_hosted_connection\" | \"setup_owner_conflict\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"slug_page_mismatch\" | \"slug_root_mode_mismatch\" | \"source_binding_required\" | \"source_id_taken\" | \"source_mismatch\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stale_unavailable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_first_run_in_progress\" | \"sync_no_successful_sync\" | \"sync_cursor_replaced\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trust_raise_refused\" | \"two_consumers_on_host\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unpriced_model\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"write_capacity_low\" | \"write_gate_rejected\" | \"write_held\" | \"worktree_dirty\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | \"schema_pack_too_large\" | \"schema_pack_emit_mismatch\" | undefined",
+ "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"rate_limited\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"write_outcome_unknown\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"body_staging_expired\" | \"budget_below_recent_runtime\" | \"backup_dump_failed\" | \"backup_too_large\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"cache_quota_exceeded\" | \"calendar_unreadable\" | \"capacity_paused\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"page_body_segmented\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"commit_lock_busy\" | \"commit_paths_invalid\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"connection_lost\" | \"chunkless_pages_healable\" | \"consent_required\" | \"consent_timeout\" | \"consumers_without_heartbeat\" | \"content_repair_needs_human\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cursor_incarnation_retired\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"deleted_page_chunks_overdue\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"drain_stalled\" | \"managed_sync_not_moving\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"doctor_tier_unavailable\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_identity_unqualified\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_state_unknown\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"entity_types_unavailable\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"fact_withdrawn\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"fix_not_writable\" | \"file_removed_during_scan\" | \"file_too_large\" | \"follow_approval_required\" | \"forget_requires_owner\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"ghost_mass_delete_refused\" | \"ghost_storage_unknown\" | \"git_branch_unborn\" | \"git_durability_not_enabled\" | \"git_checkout_required\" | \"git_detached_head\" | \"git_index_locked\" | \"git_index_stale\" | \"git_target_pending\" | \"git_operation_in_progress\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"graph_incomplete\" | \"host_identity_mismatch\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"head_blocked\" | \"held_failed\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"integrate_conflict\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"unclosed_ambiguous_tail\" | \"tail_exposure_approval\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"ipc_path_too_long\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"loops_extraction_skipped\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_failure_unsettled\" | \"merge_recommended\" | \"managed_sync_flag_refused\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_declined\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_owner_host\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"page_shrink_refused\" | \"page_too_large_for_inline\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pattern_claims_pending\" | \"patterns_min_interval\" | \"pending_verify\" | \"pending_writes\" | \"persistence_restart_required\" | \"pool_inflight_over_budget\" | \"deep_health_probe_failed\" | \"serve_self_exit_suppressed\" | \"serve_unhealthy_exit\" | \"persistence_write_stall\" | \"push_unconfirmed\" | \"schema_lock_blocked\" | \"pg_connection_recovery_failed\" | \"pg_connection_stuck\" | \"pg_pool_stalled\" | \"pg_statement_build_failed\" | \"pglite_busy\" | \"pglite_vector_index_too_large\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"knock_on_exhausted\" | \"keyword_skipped_after_timeout\" | \"publication_pending\" | \"purge_blocked_pending_recovery\" | \"purge_lookup_timeout\" | \"question_not_found\" | \"question_owner_only\" | \"read_budget_exhausted\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"pat_file_unreadable\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"result_too_large\" | \"revision_changed\" | \"revision_unavailable\" | \"scope_missing\" | \"search_cursor_requires_keyword\" | \"search_mode_local_only\" | \"search_offset_over_cap\" | \"serve_build_drift\" | \"serve_port_in_use\" | \"serve_status_only\" | \"setup_harness_unsupported\" | \"setup_hosted_connection\" | \"setup_owner_conflict\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"slug_page_mismatch\" | \"slug_root_mode_mismatch\" | \"source_binding_required\" | \"source_id_taken\" | \"source_mismatch\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stale_unavailable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_first_run_in_progress\" | \"sync_no_successful_sync\" | \"sync_cursor_replaced\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trust_raise_refused\" | \"two_consumers_on_host\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unpriced_model\" | \"unmanaged_database_path\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"write_capacity_low\" | \"write_gate_rejected\" | \"write_held\" | \"worktree_dirty\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | \"schema_pack_too_large\" | \"schema_pack_emit_mismatch\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
@@ -6370,6 +6536,7 @@
"addTakesBatch: (rowsIn: TakeBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntriesBatch: (entries: TimelineBatchInput[], opts?: BatchOpts) => Promise<number>",
"addTimelineEntry: (slug: string, entry: TimelineInput, opts?: { skipExistenceCheck?: boolean; sourceId?: string; }) => Promise<boolean>",
+ "allocateBodyOccurrenceIds: (count: number) => Promise<number[]>",
"batchLoadEmotionalInputs: (slugs?: string[]) => Promise<EmotionalWeightInputRow[]>",
"closeRetainingLock: () => Promise<LockHandle>",
"connect: (config: EngineConfig) => Promise<void>",
@@ -6383,6 +6550,7 @@
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
+ "createSegmentedPageShell: (slug: string, meta: SegmentedPageMeta, opts: { sourceId: string; }) => Promise<{ id: number; }>",
"createVersion: (slug: string, opts?: { sourceId?: string; preimage?: PageSnapshot; }) => Promise<PageVersion>",
"db: PGlite",
"deleteChunks: (slug: string, opts?: { sourceId?: string; }) => Promise<void>",
@@ -6404,6 +6572,7 @@
"findOntologyConflicts: (opts?: PageReadScope & { minConfidence?: number; visibility?: OntologyReadOpts[\"visibility\"]; }) => Promise<OntologyConflict[]>",
"findOrphanPages: (opts?: { sourceId?: string; sourceIds?: string[]; excludePrivate?: boolean; mode?: \"inbound\" | \"islanded\"; }) => Promise<Array<{ slug: string; title: string; domain: string | null; type?: string | null; quarantined?: boolean; source_id?: string; }>>",
"findTrajectory: (opts: TrajectoryOpts) => Promise<TrajectoryPoint[]>",
+ "flipBodyGeneration: (input: BodyFlipInput) => Promise<BodyFlipResult>",
"getAdjacencyBoosts: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, AdjacencyRow>>",
"getAllConfig: () => Promise<Record<string, string>>",
"getAllSlugs: (opts?: { sourceId?: string; }) => Promise<Set<string>>",
@@ -6483,6 +6652,7 @@
"markPagesExtractedBatch: (refs: Array<{ slug: string; source_id: string; extractedAt?: string; }>, defaultExtractedAt: string) => Promise<number>",
"mergeOntologyFact: (obs: OntologyObservationInput) => Promise<OntologyMergeResult>",
"migrateFactsToCanonical: (phantomSlug: string, canonicalSlug: string, sourceId: string) => Promise<{ migrated: number; }>",
+ "openBodyStaging: (input: BodyStagingInput) => Promise<void>",
"private _adoptedLock",
"private _attachDatabase",
"private _beforeDisconnect",
@@ -6521,8 +6691,10 @@
"putPage: (slug: string, page: PageInput, opts?: PageWriteOptions) => Promise<Page>",
"putRawData: (slug: string, source: string, data: object, opts?: { sourceId?: string; }) => Promise<void>",
"readEmbeddingStateCounts: (opts: { mode: \"ops\" | \"full\"; sourceIds?: string[]; purgeWindowHours: number; }) => Promise<EmbeddingStateCounts>",
+ "readManifest: (pageId: number, opts?: { generation?: number; stagingId?: string; region?: BodyRegion; lastN?: number; }) => Promise<ManifestRow[]>",
"readPageSnapshot: (slug: string, opts?: PageSnapshotOptions) => Promise<PageSnapshot | null>",
"readPageSnapshotsBatch: (refs: ReadonlyArray<{ slug: string; sourceId: string; }>, opts?: { maxBytes?: number; includeDeleted?: boolean; absentIsNull?: boolean; }) => Promise<PageSnapshotBatch>",
+ "readSegmentTexts: (sourceId: string, sha256s: readonly Uint8Array[]) => Promise<Map<string, Uint8Array>>",
"readonly kind: \"pglite\"",
"reconnect: (_ctx?: { error?: unknown; }) => Promise<void>",
"refreshPageBody: (slug: string, sourceId: string, compiledTruth: string, timeline: string, contentHash: string) => Promise<void>",
@@ -6551,17 +6723,22 @@
"searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",
"searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",
"searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>",
+ "setBodyStagingState: (id: string, state: BodyStagingState, opts?: { commitRequestId?: string | null; }) => Promise<void>",
"setConfig: (key: string, value: string) => Promise<void>",
"setEmotionalWeightBatch: (rows: EmotionalWeightWriteRow[]) => Promise<number>",
"setPageAliases: (slug: string, sourceId: string, aliasNorms: string[], opts?: { inline?: boolean; }) => Promise<void>",
"setPageEmbeddingSignature: (slug: string, opts: { sourceId?: string; signature: string; }) => Promise<void>",
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
+ "stageManifestRows: (rows: readonly ManifestRowInput[]) => Promise<void>",
+ "stageSegmentChunks: (pageId: number, generation: number, chunks: readonly SegmentChunkInput[], opts?: { embeddingColumn?: ResolvedColumn; }) => Promise<number[]>",
+ "stageSegmentTexts: (sourceId: string, texts: readonly SegmentTextInput[]) => Promise<{ inserted: number; }>",
"stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
"sweepDreamVerdicts: () => Promise<number>",
+ "sweepSegments: (opts?: SegmentSweepOptions) => Promise<SegmentSweepResult>",
"transaction: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"transactionDirect: <T>(fn: (engine: BrainEngine) => Promise<T>, opts?: TransactionOptions) => Promise<T>",
"traverseGraph: (slug: string, depth?: number, opts?: TraverseGraphOpts) => Promise<GraphNode[]>",
@@ -7534,6 +7711,7 @@
"include_slug_prefixes?: string[] | undefined",
"intentWeighting?: boolean | undefined",
"keywordArmConfidenceFloor?: number | null | undefined",
+ "keywordTimeoutCache?: boolean | undefined",
"language?: string | undefined",
"limit?: number | undefined",
"metadataBoostGate?: MetadataBoostGate | undefined",
@@ -8265,7 +8443,7 @@
"kind": "interface",
"members": [
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\"",
"chunk_text: string",
"doc_comment?: string | null | undefined",
"embedded_at: Date | null",
@@ -8292,7 +8470,7 @@
"kind": "interface",
"members": [
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\" | \"image_asset\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\" | \"image_asset\"",
"chunk_text: string",
"doc_comment?: string | undefined",
"embedding?: Float32Array<ArrayBufferLike> | undefined",
@@ -8367,7 +8545,7 @@
"kind": "variable",
"name": "DEGRADED_REASONS",
"signature": [
- "readonly [\"no_provider\", \"provider_error\", \"timeout\", \"variant_embed_failed\", \"original_embed_failed\", \"first_result_truncated\", \"no_key\", \"empty_result_set\", \"malformed_shape\", \"budget\", \"rate_limited\", \"unreachable\", \"auth\", \"candidate_budget\", \"iterative_scan_unavailable\", \"egress_denied\", \"embedding_disabled\"]"
+ "readonly [\"no_provider\", \"provider_error\", \"timeout\", \"variant_embed_failed\", \"original_embed_failed\", \"first_result_truncated\", \"no_key\", \"empty_result_set\", \"malformed_shape\", \"budget\", \"rate_limited\", \"unreachable\", \"auth\", \"candidate_budget\", \"iterative_scan_unavailable\", \"egress_denied\", \"embedding_disabled\", \"skipped_after_timeout\"]"
]
},
{
@@ -8381,7 +8559,7 @@
"kind": "type",
"name": "DegradedReason",
"signature": [
- "\"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\""
+ "\"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\" | \"skipped_after_timeout\""
]
},
{
@@ -8394,7 +8572,7 @@
{
"kind": "interface",
"members": [
- "reason?: \"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\" | undefined",
+ "reason?: \"candidate_budget\" | \"iterative_scan_unavailable\" | \"no_provider\" | \"provider_error\" | \"timeout\" | \"variant_embed_failed\" | \"original_embed_failed\" | \"first_result_truncated\" | \"no_key\" | \"empty_result_set\" | \"malformed_shape\" | \"budget\" | \"rate_limited\" | \"unreachable\" | \"auth\" | \"egress_denied\" | \"embedding_disabled\" | \"skipped_after_timeout\" | undefined",
"stage: \"embed_unavailable\" | \"embed_timeout\" | \"expansion_failed\" | \"expansion_partial\" | \"rescore_skipped\" | \"vector_arm_failed\" | \"keyword_arm_failed\" | \"title_arm_failed\" | \"budget_dropped_all\" | \"budget_truncated\" | \"keyword_zero\" | \"cache_prestamp\" | \"reranker_skipped\" | \"rerank_passthrough\" | \"rerank_failed\" | \"keyword_relaxed_carried\" | \"safe_index_pending\" | \"vector_candidates_incomplete\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"projection_status_unknown\" | \"keyword_count_unavailable\""
],
"name": "DegradedStageEntry"
@@ -8795,6 +8973,8 @@
{
"kind": "interface",
"members": [
+ "body_bytes?: number | null | undefined",
+ "body_storage?: BodyStorage | undefined",
"compiled_truth: string",
"content_hash?: string | undefined",
"contextual_retrieval_mode?: \"none\" | \"title\" | \"per_chunk_synopsis\" | null | undefined",
@@ -8912,7 +9092,11 @@
{
"kind": "interface",
"members": [
+ "body_bytes?: number | undefined",
+ "body_generation?: number | undefined",
+ "body_storage?: \"segmented\" | undefined",
"compiled_truth: string",
+ "content_hash?: string | null | undefined",
"frontmatter: Record<string, unknown>",
"id: number",
"is_deleted?: boolean | null | undefined",
@@ -9061,6 +9245,7 @@
"hnswIterativeScan?: \"relaxed_order\" | \"strict_order\" | \"off\" | undefined",
"include_slug_prefixes?: string[] | undefined",
"intentWeighting?: boolean | undefined",
+ "keywordTimeoutCache?: boolean | undefined",
"language?: string | undefined",
"limit?: number | undefined",
"minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined",
@@ -9109,7 +9294,7 @@
"chronicle_boost?: number | undefined",
"chunk_id: number",
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\"",
"chunk_text: string",
"content_flag?: { reason: string; detail: string; } | undefined",
"content_hash?: string | null | undefined",
@@ -9186,7 +9371,7 @@
"kind": "interface",
"members": [
"chunk_index: number",
- "chunk_source: \"compiled_truth\" | \"timeline\" | \"fenced_code\"",
+ "chunk_source: \"timeline\" | \"compiled_truth\" | \"fenced_code\"",
"chunk_text: string",
"model: string | null",
"page_id: number",