Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(w9f): gate fixes on the integrated tree

garrytan79e47727ed97
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c39be9b909..631279cf26 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,7 +41,7 @@ gbrain doctor --only conversation_label_facts,conversation_outcomes_stale
| Worker shutdown | An `UnrecoverableError` thrown while a worker shuts down dead-letters with its own message instead of being re-queued for another (possibly paid) run; other errors are still handed back, now keeping the handler's message. |
| `gbrain jobs supervisor stop` | A recycled worker pid no longer reads as still running, a run that crossed the weekly audit boundary no longer reports a false `drained`, a run with no `started` record reports `unverified`, and a stale PID file whose pid now belongs to another process is never signaled (`stale_pid_file`). |
| `gbrain takes rebuild` | Works while `gbrain serve` owns a PGLite brain (it used to hang on the lock); same JSON and exit codes as a local rebuild. |
-| Eval judges | With `thinking: off`, Gemini 2.5 Flash sends `thinkingBudget: 0` and GPT-5.1+ sends `reasoningEffort: none`. Models that can't turn reasoning off (Gemini 2.5 Pro and 3.x, gpt-5/-mini/-nano, o-series, gpt-6) run at their lowest setting with a 32,000-token reply cap, and the takes-quality and cross-modal preflights price that cap instead of underestimating it 8-16x. |
+| Eval judges | With `thinking: off`, Gemini 2.5 Flash sends `thinkingBudget: 0` and GPT-5.1+ sends `reasoningEffort: none`. Models that can't turn reasoning off (Gemini 2.5 Pro and 3.x, gpt-5/-mini/-nano, o-series) run at their lowest setting with a 32,000-token reply cap, and the takes-quality and cross-modal preflights price that cap instead of underestimating it 8-16x. |
### Things to watch
diff --git a/TODOS.md b/TODOS.md
index 0514d18b51..966e124c0e 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -46,7 +46,7 @@ Context: the wave 9 follow-up wave (plan reviewed 2026-10-06; Garry approved eve
- [ ] **P3 — Owner delegation for every `gbrain repair` kind under a live serve.** **What:** while `gbrain serve` owns a PGLite brain, repair kinds that open the engine wait on its lock or refuse with stop, repair, restart. **Fix:** delegate each repair kind's preview and apply through the owner (as `takes remove` does), keeping preview hashes and `--expect` consent identical to the local path. **Effort:** M. **Priority:** P3.
- [ ] **P3 — Typed `ShutdownInterruptedError` for cooperative handlers.** **What:** during worker shutdown only `UnrecoverableError` now burns an attempt (Decision 7); every other error from an in-process handler is still treated as a shutdown interruption, because cooperative handlers throw plain `Error`s (`subagent.ts`, `shell.ts`). **Fix:** have every cooperating handler throw a typed `ShutdownInterruptedError` on the shutdown abort, then take the requeue path only for that type so ordinary failures during a deploy burn an attempt. **Effort:** M. **Priority:** P3.
- [ ] **P2 — Judge-panel refresh to current frontier models.** **What:** the takes-quality panel (`openai:gpt-5.2`, `anthropic:claude-opus-4-7`, `google:gemini-2.5-flash`) and the cross-modal slots (`openai:gpt-5.2`, `anthropic:claude-opus-4-7`, `deepseek:deepseek-v4-pro`) predate the project's newest-model-per-family eval rule. **Fix:** an eval-owned, preregistered panel change in gbrain-evals first (keep at most one older model as the link to previous results), then update the defaults, their recipe listings and the default-panel tests together. **Effort:** M. **Priority:** P2.
-- [ ] **P3 — gpt-6 judges cannot lower reasoning effort.** **What:** the pinned `@ai-sdk/openai` (3.0.58) does not recognise gpt-6 ids as reasoning models and drops `reasoningEffort` with a warning, so `thinking: 'off'` on gpt-6-sol/-luna cannot send `none` and on gpt-6-astra/6.1-sol cannot send the `low` floor; `thinking-off.ts` gives those routes headroom only. **Fix:** bump `@ai-sdk/openai` to a release that knows gpt-6 (or set `forceReasoning`), verify the request live, and add the gpt-6 rows to the capability table. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — gpt-6 judges cannot lower reasoning effort.** **What:** the pinned `@ai-sdk/openai` (3.0.58) does not recognise gpt-6 ids as reasoning models and drops `reasoningEffort` with a warning, so `thinking: 'off'` on gpt-6-sol/-luna cannot send `none` and on gpt-6-astra/6.1-sol cannot send the `low` floor; `thinking-off.ts` has no gpt-6 row, so those routes send no option and keep the requested cap (fence repair's `openai:gpt-6.1-sol` per-page cost depends on it; a 32,000-token reservation would exceed its $0.30 cap). **Fix:** bump `@ai-sdk/openai` to a release that knows gpt-6 (or set `forceReasoning`), verify the request live (including how much gpt-6 reasons under a judge-sized cap), and add the gpt-6 rows to the capability table, re-checking fence repair's per-page cap. **Effort:** S. **Priority:** P3.
## Fix wave 10 lane H follow-ups (filed 2026-10-06, GBRA-51)
diff --git a/docs/architecture/key-files/core-ai.md b/docs/architecture/key-files/core-ai.md
index f883d84d33..b815029fe7 100644
--- a/docs/architecture/key-files/core-ai.md
+++ b/docs/architecture/key-files/core-ai.md
@@ -24,7 +24,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/ai/fallback-hop-queue.ts`: the process-level queue for the first hop's `chat_fallback_hop` notice (at most one per process; type-only imports so every drain site loads it cheaply). Drained by stdio MCP dispatch, the CLI op notice channel (`src/cli/op-notices.ts`) and `finishCliTeardown`; never by HTTP, because the notice names models.
- `src/core/ai/chat-fallback-planes.ts`: where the effective `chat_fallback_chain` comes from, read without network, subprocess or inference. `readChatFallbackPlanes(db)` reads env `GBRAIN_CHAT_FALLBACK_CHAIN` > the config.json key > the DB row (`parseDbChatFallbackChain` in `config-db-merge.ts`) with the loader's rule that the first plane that speaks wins even when its value yields no chain, and returns the winner, shadowed values, unreadable planes and the `chat_fallback_on_refusal` value with its plane. `diagnoseChatFallbackEntry` checks one entry by presence: `provider:model` parse, known provider with chat, the provider's own credential (recipe env keys or `authPresent`; for `claude-cli` the binary on PATH or `GBRAIN_CLAUDE_CLI_BIN`), and a price when a key in `USER_CHAT_CAP_KEYS` sets a user cap. `chatFallbackRemovalFix` is the per-plane removal guidance (DB `gbrain config unset chat_fallback_chain` with `destructive` consent → `ask_user`; env/file are the user's, with the restart note). Consumers: the `chat_fallback_chain` doctor check and the `behavior_changes` notice.
- `src/core/ai/sdk-warnings.ts` — AI SDK provider warnings to stderr (#5892). The gateway calls `installAiSdkWarningWriter()` when it loads, which sets `globalThis.AI_SDK_LOG_WARNINGS` to a writer with the `ai` logger signature (`{ warnings, provider, model }`) that prints each warning in the SDK's own wording to stderr and never the SDK's `console.info` banner, which landed on stdout and broke `--json` output (the claude-cli model's v2-compat notice fires on every process's first call). A user-set value (`false` or a function) is kept. Tests: `ai-sdk-warnings.test.ts`, `json-stdout-ai-warnings.test.ts`.
-- `src/core/ai/thinking-off.ts`: the per-route mapping behind `ChatOpts.thinking: 'off'` (#5331). `thinkingOffControl(modelStr)` is the per-model capability table: the provider-options namespace and keys to set, and whether they turn reasoning off (`disables`) or only set its floor. Full off: native `anthropic`, `deepseek`, `openrouter` with a `deepseek/` model (`thinking: { type: 'disabled' }`), Gemini 2.5 Flash/Flash-Lite (`thinkingConfig.thinkingBudget: 0`), OpenAI gpt-5.1/5.2/5.4/5.5/5.6 (`reasoningEffort: 'none'`). Floor: Gemini 2.5 Pro (`thinkingBudget: 128`), Gemini 3.x (`thinkingLevel` `minimal`, or `low` on 3.7/3.8 Flash and 3.x Pro, where `minimal` is a 400), gpt-5/-mini/-nano (`minimal`), o-series (`low`). Other Gemini 3+ and OpenAI reasoning ids, gpt-6 included (the pinned @ai-sdk/openai drops its effort), get no option. Only native recipes get an option; the two Google fields are never sent together. `applyThinkingOff` sets the keys, replacing a configured value under the same key while siblings such as `cacheControl` or `promptCacheKey` survive; `chat()` applies it after the call-scoped `providerOptions` merge, on the resolved recipe. `thinkingOffMaxOutputTokens` keeps the requested cap where reasoning turns off and raises a route that keeps reasoning (a floor row, or no row and `isThinkingModel`) to the thinking headroom. gateway.ts `thinkingOffOutputCap(model, requested)` wraps it for `chat()` and for the takes-quality and cross-modal preflight estimates, so they price the cap the call sends. Callers: those two judges and the synthesize triage judge. Rows were checked live on 2026-10-07 (`docs/fix-wave-notes/capy-wave-9-followups.md`). Pinned by `test/ai/chat-thinking-off.test.ts` (request bodies per route against a local stub, estimate parity per default panel model) and `test/ai/gateway-chat.test.ts`.
+- `src/core/ai/thinking-off.ts`: the per-route mapping behind `ChatOpts.thinking: 'off'` (#5331). `thinkingOffControl(modelStr)` is the per-model capability table: the provider-options namespace and keys to set, and whether they turn reasoning off (`disables`) or only set its floor. Full off: native `anthropic`, `deepseek`, `openrouter` with a `deepseek/` model (`thinking: { type: 'disabled' }`), Gemini 2.5 Flash/Flash-Lite (`thinkingConfig.thinkingBudget: 0`), OpenAI gpt-5.1/5.2/5.4/5.5/5.6 (`reasoningEffort: 'none'`). Floor: Gemini 2.5 Pro (`thinkingBudget: 128`), Gemini 3.x (`thinkingLevel` `minimal`, or `low` on 3.7/3.8 Flash and 3.x Pro, where `minimal` is a 400), gpt-5/-mini/-nano (`minimal`), o-series (`low`). Other Gemini 3+ and OpenAI gpt-5/o-series reasoning ids get no option and the headroom. gpt-6 ids have no row (the pinned @ai-sdk/openai drops their effort, and no live check measured them), so they keep the requested cap that fence repair's measured default `openai:gpt-6.1-sol` is costed against. Only native recipes get an option; the two Google fields are never sent together. `applyThinkingOff` sets the keys, replacing a configured value under the same key while siblings such as `cacheControl` or `promptCacheKey` survive; `chat()` applies it after the call-scoped `providerOptions` merge, on the resolved recipe. `thinkingOffMaxOutputTokens` keeps the requested cap where reasoning turns off and raises a route that keeps reasoning (a floor row, or no row and `isThinkingModel`) to the thinking headroom. gateway.ts `thinkingOffOutputCap(model, requested)` wraps it for `chat()` and for the takes-quality and cross-modal preflight estimates, so they price the cap the call sends. Callers: those two judges and the synthesize triage judge. Rows were checked live on 2026-10-07 (`docs/fix-wave-notes/capy-wave-9-followups.md`). Pinned by `test/ai/chat-thinking-off.test.ts` (request bodies per route against a local stub, estimate parity per default panel model) and `test/ai/gateway-chat.test.ts`.
- `src/core/ai/model-resolver.ts` — Recipe-touchpoint validator. `assertTouchpoint(recipe, touchpoint, modelId)` checks the PROVIDER's capability only (anthropic has no embedding touchpoint; voyage/ollama have no chat) and never gates on the model id. Recipe `models:` arrays are informational — default-model selection (`models[0]` for `--model <provider>` shorthand and env-ready pickers), guard-test fixtures for the repo's own hardcoded defaults, and `gbrain providers list` display — NOT a runtime allowlist, so frontier models newer than a recipe work without a recipe PR. A nonexistent id surfaces as the provider's own `model_not_found` at call time; `gbrain models doctor` live-probes the configured models for a pre-flight check. Exception: `gateway.rerank()` keeps its own model-list check because each listed reranker id maps to a known request/response wire shape. `embeddingDimsForModel` matches recipe `model_dims` keys exactly first, then case-insensitively with BOTH sides folded (configured ids arrive cased, and user-editable recipe tables can carry cased keys; without the fold a cased id would fall through to `default_dims` and `gbrain init` would build a wrong-width column), before falling back to `default_dims`.
diff --git a/docs/fix-wave-notes/capy-wave-9-followups.md b/docs/fix-wave-notes/capy-wave-9-followups.md
index 393a9cbdc1..7f6f6fa106 100644
--- a/docs/fix-wave-notes/capy-wave-9-followups.md
+++ b/docs/fix-wave-notes/capy-wave-9-followups.md
@@ -27,8 +27,12 @@ the coverage table only.
- `fence-repair/llm.ts` (#6188 PR4) used `thinkingOffNamespace`, which lane J
replaced with the capability table: its Tier 3 ceiling now reserves room to
reason only where the route's thinking-off option does not turn reasoning
- fully off (gpt-6 gets the 32,000-token cap the gateway sends; Gemini 2.5
- Flash, which now sends `thinkingBudget: 0`, gets the table's size).
+ fully off (Gemini 2.5 Flash, which now sends `thinkingBudget: 0`, gets the
+ table's size). Lane J gave gpt-6 the 32,000-token headroom; that reserved
+ $0.32 per page for fence repair's measured default `openai:gpt-6.1-sol`,
+ over its $0.30 per-page cap, so every model-tier page was held
+ (`test/fence-walkthrough.test.ts`). gpt-6 now has no row and keeps the
+ requested cap, as before this wave, until a live check measures it.
- `repair conversation-labels` replays a still-pending batch with the CLI write
wait, as #6185 made `repair extractor-facts` do.
- Wave 12's `repair timeline-comments` row cleanup is listed in the receipt
@@ -156,7 +160,8 @@ Item 5 is confirmed on current master and fixed on this branch. Re-verification
| `openai:gpt-5.1`, `-5.2`, `-5.4`(`-mini`/`-nano`), `-5.5`, `-5.6-{luna,sol,terra}` | `reasoningEffort: 'none'` | yes (probe O2) | requested |
| `openai:gpt-5`, `-5-mini`, `-5-nano` | `reasoningEffort: 'minimal'` | no | 32,000 |
| `openai:o1`, `o3`, `o3-mini`, `o4-mini` | `reasoningEffort: 'low'` | no | 32,000 |
-| other OpenAI reasoning ids (`-pro`, `-codex`, gpt-6 family, unknown gpt-5+/o-series) | none | no | 32,000 |
+| other OpenAI reasoning ids (`-pro`, `-codex`, unknown gpt-5/o-series) | none | no | 32,000 |
+| `openai:gpt-6*` | none, no row | n/a | requested |
| `openai:*-chat*`, `gpt-4o*` | none, no row | n/a | requested |
| every other route | none, no row | when `isThinkingModel` (claude-cli Claude 5, GLM, local reasoning) | 32,000 if thinking, else requested |
@@ -164,7 +169,7 @@ Rules the table enforces:
- Never both Google fields: the Google option replaces any configured `thinkingConfig` wholesale (probe G7: both fields together are a 400 on 3.8 Flash).
- A namespace alone is not an off switch: only the native `google` and `openai` recipes get these rows. `openrouter:openai/gpt-5.2`, `openrouter:google/...` and `litellm:` routes get nothing.
-- gpt-6 has no option because the pinned `@ai-sdk/openai` 3.0.58 lists only `o1`/`o3`/`o4-mini`/`gpt-5*` as reasoning models (`getOpenAILanguageModelCapabilities`) and drops `reasoningEffort` for gpt-6 with a warning. The unit test caught this; a TODO covers it.
+- gpt-6 has no option because the pinned `@ai-sdk/openai` 3.0.58 lists only `o1`/`o3`/`o4-mini`/`gpt-5*` as reasoning models (`getOpenAILanguageModelCapabilities`) and drops `reasoningEffort` for gpt-6 with a warning. With no live measurement either, gpt-6 has no row and keeps the requested cap (see the integration note above); a TODO covers it.
- Sources: Google's generateContent thinking guide (levels per model, budget ranges), OpenAI's reasoning guide (supported efforts per model), and the probe.
Out of scope on purpose: the Google and OpenAI recipes still declare no `thinking_by_default`, so calls without `thinking: 'off'` keep today's default caps. Flipping them would raise default caps (and budget reservations) for every Gemini and gpt-5.5+ caller, which is a wider change than item 5.
diff --git a/src/core/ai/thinking-off.ts b/src/core/ai/thinking-off.ts
index 05494b7132..bcfbe9d240 100644
--- a/src/core/ai/thinking-off.ts
+++ b/src/core/ai/thinking-off.ts
@@ -26,10 +26,13 @@
* - Gemini 3.x: the lowest `thinkingLevel` the model accepts (`minimal` is
* a 400 on 3.7/3.8 Flash and 3.x Pro, so those get `low`; never a budget)
* - OpenAI gpt-5/-mini/-nano (`minimal`) and the o-series (`low`)
- * - other Gemini 3+ and OpenAI reasoning ids: no option (an unsupported
- * level or effort is a 400), headroom only. That includes gpt-6: the
- * pinned @ai-sdk/openai (3.0.58) does not know gpt-6 is a reasoning model
- * and drops `reasoningEffort` with a warning, so no option would arrive.
+ * - other Gemini 3+ and OpenAI gpt-5/o-series reasoning ids: no option
+ * (an unsupported level or effort is a 400), headroom only.
+ * gpt-6 ids have no row: the pinned @ai-sdk/openai (3.0.58) does not know
+ * gpt-6 is a reasoning model and drops `reasoningEffort` with a warning, so
+ * no option would arrive, and no live check measured how much a gpt-6 call
+ * reasons under a small cap. They keep the requested cap, which fence
+ * repair's measured default (`openai:gpt-6.1-sol`) is costed against.
* The option REPLACES any configured value under the same key: a configured
* Anthropic `{type:'enabled', budgetTokens}` would otherwise be forwarded
* verbatim, and a configured Google `thinkingConfig.thinkingLevel` merged
@@ -93,7 +96,7 @@ const OPENAI_DATE_SUFFIX = '(?:-\\d{4}-\\d{2}-\\d{2})?$';
const OPENAI_EFFORT_NONE_RE = new RegExp(`^gpt-(?:5\\.[1245](?:-mini|-nano)?|5\\.6-(?:luna|sol|terra))${OPENAI_DATE_SUFFIX}`);
const OPENAI_EFFORT_MINIMAL_RE = new RegExp(`^gpt-5(?:-mini|-nano)?${OPENAI_DATE_SUFFIX}`);
const OPENAI_EFFORT_LOW_RE = new RegExp(`^(?:o1|o3|o3-mini|o4-mini)${OPENAI_DATE_SUFFIX}`);
-const OPENAI_REASONING_RE = /^(?:gpt-(?:[5-9]|\d{2,})|o\d)/;
+const OPENAI_REASONING_RE = /^(?:gpt-5|o\d)/;
const OPENAI_NON_REASONING_RE = /-chat(?:-|$)/;
function openaiControl(model: string): ThinkingOffControl | undefined {
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 3fbccffa63..bfc3d562cc 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -309,7 +309,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }
{ since: '0.60.107.0', text: 'On an unmanaged brain a dream-cycle concept whose file holds an edit the database has not imported is deferred (`revision_conflict`) and published after sync imports it, instead of being overwritten.' },
{ since: '0.60.107.0', text: 'A job error during worker shutdown now records `worker_shutdown: <handler error>` instead of bare `worker_shutdown`, and an `UnrecoverableError` thrown then dead-letters at once instead of running again.' },
{ since: '0.60.107.0', text: '`gbrain jobs supervisor stop` can now report `unverified` (exit 1) and `stale_pid_file` (exit 0, nothing signaled), and on Linux the supervisor PID file has a second line with the process start time; read only its first line.' },
- { since: '0.60.107.0', text: '`thinking: off` calls on native Google and OpenAI routes (eval judges, the synthesize triage judge, fence repair\'s model tier) now send the model\'s thinking switch (`thinkingBudget: 0`, `reasoningEffort: none`) and, where reasoning cannot be turned off (Gemini 2.5 Pro and 3.x, gpt-5/-mini/-nano, o-series, gpt-6), a 32,000-token reply cap; `eval takes-quality --budget-usd` and `eval cross-modal --max-usd` price that cap, so a budget that passed before can refuse earlier.' },
+ { since: '0.60.107.0', text: '`thinking: off` calls on native Google and OpenAI routes (eval judges, the synthesize triage judge, fence repair\'s model tier) now send the model\'s thinking switch (`thinkingBudget: 0`, `reasoningEffort: none`) and, where reasoning cannot be turned off (Gemini 2.5 Pro and 3.x, gpt-5/-mini/-nano, o-series), a 32,000-token reply cap; `eval takes-quality --budget-usd` and `eval cross-modal --max-usd` price that cap, so a budget that passed before can refuse earlier.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/src/core/cycle/extract-facts.ts b/src/core/cycle/extract-facts.ts
index 87dba25065..d3557de4c3 100644
--- a/src/core/cycle/extract-facts.ts
+++ b/src/core/cycle/extract-facts.ts
@@ -52,8 +52,7 @@ import { maintenanceTransaction } from '../persistence/attribution.ts';
import { authorizeWrite } from '../persistence/authority.ts';
import { digest } from '../persistence/digest.ts';
import { getWriteRequest } from '../persistence/journal.ts';
-import { managedPersistenceEnabled } from '../persistence/ownership.ts';
-import { maintenancePreflight, submitDatabaseMaintenanceIntent, type MaintenanceAuthority } from '../persistence/prepared-maintenance.ts';
+import { maintenanceCallerPreflight, maintenancePreflight, submitDatabaseMaintenanceIntent, type MaintenanceAuthority } from '../persistence/prepared-maintenance.ts';
import { resolveManagedFactsEmbedding } from '../persistence/facts-maintenance.ts';
import { REVISION_BACKFILL_PENDING } from '../page-state/types.ts';
import { opError, OperationError } from '../ops/contract.ts';
@@ -710,8 +709,8 @@ export async function runExtractFacts(
// Managed brains reconcile the same way, but each page's writes publish as
// a receipted database-only maintenance request. The authority is
// preflighted on the first page that needs a write, so a run with nothing
- // to change never needs one.
- const managed = await managedPersistenceEnabled(engine);
+ // to change never needs one; an unacceptable caller still refuses first.
+ const managed = await maintenanceCallerPreflight(engine, sourceId);
let authority: Promise<MaintenanceAuthority | null> | undefined;
const managedAuthority = () => managed ? authority ??= maintenancePreflight(engine, sourceId) : Promise.resolve(null);
const result: ExtractFactsResult = {
diff --git a/src/core/facts/conversation-publication.ts b/src/core/facts/conversation-publication.ts
index a789da9cbc..4936384bc3 100644
--- a/src/core/facts/conversation-publication.ts
+++ b/src/core/facts/conversation-publication.ts
@@ -65,8 +65,7 @@ import { readJournalLimits } from '../persistence/limits.ts';
import { principalKey } from '../persistence/model.ts';
import { PERSISTENCE_IPC_MAX_BYTES } from '../persistence/ipc.ts';
import { resolveManagedFactsEmbedding } from '../persistence/facts-maintenance.ts';
-import { maintenancePreflight, submitDatabaseMaintenanceIntent, type MaintenanceAuthority } from '../persistence/prepared-maintenance.ts';
-import { managedPersistenceEnabled } from '../persistence/ownership.ts';
+import { maintenanceCallerPreflight, maintenancePreflight, submitDatabaseMaintenanceIntent, type MaintenanceAuthority } from '../persistence/prepared-maintenance.ts';
import { loadConfig } from '../config.ts';
import { waitForWrite } from '../persistence/service.ts';
import { catalogueError } from '../error-catalogue.ts';
@@ -540,8 +539,10 @@ export interface ManagedPageStart { generation: Generation; attempt: number; sin
const log = (line: string) => process.stderr.write(`[extract-conversation-facts] ${line}\n`);
/**
- * On a managed brain (not a dry run, which writes and registers nothing),
- * the run's publisher. Once per run, at the first page with managed work and
+ * On a managed brain, refuses a caller the coordinator cannot accept (a
+ * remote job or writer) and an inactive source before any provider work,
+ * dry runs included; then (not for a dry run, which writes and registers
+ * nothing) returns the run's publisher. Once per run, at the first page with managed work and
* before its model call, it preflights the maintenance authority, resolves
* the facts embedding signature, checks that the planned batch requests fit
* the writer's request capacity, and reads its unsettled and failed batches;
@@ -550,7 +551,7 @@ const log = (line: string) => process.stderr.write(`[extract-conversation-facts]
*/
export async function managedConversationPublisher(engine: BrainEngine, sourceId: string,
opts: { dryRun?: boolean; slugs?: string[]; slug?: string; limit?: number; force?: boolean; types?: readonly AllowedType[] }): Promise<ManagedConversationPublisher | null> {
- if (opts.dryRun || !await managedPersistenceEnabled(engine)) return null;
+ if (!await maintenanceCallerPreflight(engine, sourceId) || opts.dryRun) return null;
const config = loadConfig() ?? { engine: engine.kind };
const prepare = async (): Promise<ManagedPublisherRun> => {
const authority = (await maintenancePreflight(engine, sourceId))!;
diff --git a/src/core/persistence/prepared-maintenance.ts b/src/core/persistence/prepared-maintenance.ts
index 2d77028002..bbaf11d911 100644
--- a/src/core/persistence/prepared-maintenance.ts
+++ b/src/core/persistence/prepared-maintenance.ts
@@ -46,6 +46,27 @@ function maintenanceRequestId(value: unknown): string {
return `${key.slice(0, 8)}-${key.slice(8, 12)}-4${key.slice(13, 16)}-a${key.slice(17, 20)}-${key.slice(20, 32)}`;
}
+/**
+ * The cheap up-front part of a managed maintenance preflight, for runs that
+ * resolve `maintenancePreflight` lazily at their first write: refuses a
+ * caller the coordinator cannot accept (a remote job or writer) and an
+ * inactive source before any provider work, dry runs included. Returns
+ * whether the brain is managed; needs no canonical owner.
+ */
+export async function maintenanceCallerPreflight(engine: BrainEngine, sourceId: string): Promise<boolean> {
+ if (!await managedPersistenceEnabled(engine)) return false;
+ assertPersistenceAccepting(engine);
+ const job = currentSubmissionAuthority();
+ if (job && job.kind !== 'application' || currentVerifiedLocalWriter()?.remote) {
+ throw trustedCliRequired('Managed fact maintenance requires a local writer; remote maintenance jobs are not supported.');
+ }
+ const [source] = await engine.executeRaw<{ archived: boolean }>('SELECT archived FROM sources WHERE id=$1', [sourceId]);
+ if (!source || source.archived) throw opError('source_changed', 'The maintenance source is not active.',
+ `Source '${sourceId}' is missing or archived, so maintenance submitted nothing and no model was called. Check it with the command in fix; restore an archived source with gbrain sources restore ${sourceId} before running maintenance on it.`,
+ { fix: readFix('Lists registered sources, archived ones included.', { argv: ['gbrain', 'sources', 'list', '--json'] }) });
+ return true;
+}
+
export async function maintenancePreflight(engine: BrainEngine, sourceId: string, root?: string,
opts: { deadlineAtMs?: number | null } = {}): Promise<MaintenanceAuthority | null> {
if (!await managedPersistenceEnabled(engine)) return null;
diff --git a/test/ai/chat-thinking-off.test.ts b/test/ai/chat-thinking-off.test.ts
index 3a0fe18c5c..9a2614c9b8 100644
--- a/test/ai/chat-thinking-off.test.ts
+++ b/test/ai/chat-thinking-off.test.ts
@@ -215,10 +215,10 @@ describe("chat({ thinking: 'off' }) capability table: native Google and OpenAI (
['gpt-5', 'minimal', H],
['gpt-5-mini', 'minimal', H],
['o3', 'low', H],
- ['gpt-6-sol', undefined, H],
- ['gpt-6-astra', undefined, H],
+ ['gpt-6-sol', undefined, 2000],
+ ['gpt-6-astra', undefined, 2000],
['gpt-5.5-pro', undefined, H],
- ['gpt-6.2-sol', undefined, H],
+ ['gpt-6.2-sol', undefined, 2000],
['gpt-5.2-chat-latest', undefined, 2000],
['gpt-4o-mini', undefined, 2000],
];
diff --git a/test/fence-repair-llm.test.ts b/test/fence-repair-llm.test.ts
index 3d8eb7247d..13f139868a 100644
--- a/test/fence-repair-llm.test.ts
+++ b/test/fence-repair-llm.test.ts
@@ -107,7 +107,7 @@ describe('Tier 3 requests and prompt', () => {
const req = residualOf(rowLevel).requests[0]!;
const table = tier3TokenBudget(req, 'anthropic:claude-opus-4-7').maxOutputTokens;
expect(tier3TokenBudget(req, 'anthropic:claude-fable-5-1').maxOutputTokens).toBe(table + TIER3_REASONING_TOKENS);
- expect(tier3TokenBudget(req, 'openai:gpt-6.1-sol').maxOutputTokens).toBe(32000);
+ expect(tier3TokenBudget(req, 'openai:gpt-6.1-sol').maxOutputTokens).toBe(table + TIER3_REASONING_TOKENS);
expect(tier3TokenBudget(req, 'google:gemini-2.5-flash').maxOutputTokens).toBe(table);
expect(tier3TokenBudget(req, 'google:gemini-3.8-flash').maxOutputTokens).toBe(32000);
for (const model of ['anthropic:claude-fable-5-1', 'openai:gpt-6.1-sol', 'google:gemini-2.5-flash', 'google:gemini-3.8-flash']) {
diff --git a/test/fix-wave-5-integration.test.ts b/test/fix-wave-5-integration.test.ts
index d9733d0196..76ba5f9c66 100644
--- a/test/fix-wave-5-integration.test.ts
+++ b/test/fix-wave-5-integration.test.ts
@@ -194,7 +194,7 @@ for (const backend of testBackends()) {
const activeFacts = async () => (await engine.executeRaw<{ n: number }>("SELECT count(*)::int AS n FROM facts WHERE source_markdown_slug='conversations/expired' AND expired_at IS NULL"))[0].n;
const untouched = async () => { expect(await liveAtoms()).toBe(30); expect(await activeFacts()).toBe(0); };
const previews = { 'google-file-modes': 'gbrain repair google-file-modes', 'stale-atoms': 'gbrain repair stale-atoms', 'extractor-facts': 'gbrain repair extractor-facts',
- 'captured-facts': 'gbrain repair captured-facts', 'loop-facts': 'gbrain repair loop-facts', 'ontology-facts': 'gbrain repair ontology-facts', 'orphan-children': 'gbrain repair orphan-children', 'failed-writes': 'gbrain repair failed-writes',
+ 'conversation-labels': 'gbrain repair conversation-labels', 'captured-facts': 'gbrain repair captured-facts', 'loop-facts': 'gbrain repair loop-facts', 'ontology-facts': 'gbrain repair ontology-facts', 'orphan-children': 'gbrain repair orphan-children', 'failed-writes': 'gbrain repair failed-writes',
frontmatter: 'gbrain repair frontmatter', 'timeline-comments': 'gbrain repair timeline-comments' };
// The post-upgrade banner names both findings with the kind's read-only preview.
diff --git a/test/fixtures/goldens/cli/dispatch-phase.json b/test/fixtures/goldens/cli/dispatch-phase.json
index 4806bc7e8f..0ee78e6658 100644
--- a/test/fixtures/goldens/cli/dispatch-phase.json
+++ b/test/fixtures/goldens/cli/dispatch-phase.json
@@ -224,7 +224,7 @@
"phase": "pre-connect-own-engine",
"preConnectRules": [
{
- "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove'].includes(args[0]) && !hasHelpFlag(args)",
+ "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove', 'rebuild'].includes(args[0]) && !hasHelpFlag(args)",
"connectsEngine": true,
"refusesThinClient": false,
"routesThinClient": false,
@@ -245,7 +245,7 @@
"phase": "pre-connect-own-engine",
"preConnectRules": [
{
- "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove'].includes(args[0]) && !hasHelpFlag(args)",
+ "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove', 'rebuild'].includes(args[0]) && !hasHelpFlag(args)",
"connectsEngine": true,
"refusesThinClient": false,
"routesThinClient": false,
@@ -845,7 +845,7 @@
"phase": "pre-connect-own-engine",
"preConnectRules": [
{
- "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove'].includes(args[0]) && !hasHelpFlag(args)",
+ "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove', 'rebuild'].includes(args[0]) && !hasHelpFlag(args)",
"connectsEngine": true,
"refusesThinClient": false,
"routesThinClient": false,
@@ -1706,7 +1706,7 @@
"phase": "post-connect",
"preConnectRules": [
{
- "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove'].includes(args[0]) && !hasHelpFlag(args)",
+ "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove', 'rebuild'].includes(args[0]) && !hasHelpFlag(args)",
"connectsEngine": true,
"refusesThinClient": false,
"routesThinClient": false,
@@ -1841,7 +1841,7 @@
"phase": "post-connect",
"preConnectRules": [
{
- "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove'].includes(args[0]) && !hasHelpFlag(args)",
+ "condition": "command === 'capture' || command === 'forget' || command === 'call' || command === 'sources' && ['writer', 'reconcile', 'add', 'remove', 'archive', 'restore', 'purge', 'set-path', 'reclone'].includes(args[0]) || command === 'takes' && ['add', 'update', 'supersede', 'resolve', 'remove', 'rebuild'].includes(args[0]) && !hasHelpFlag(args)",
"connectsEngine": true,
"refusesThinClient": false,
"routesThinClient": false,
diff --git a/test/fixtures/goldens/exports/runtime.json b/test/fixtures/goldens/exports/runtime.json
index 138dcd4d68..a5ded4d59e 100644
--- a/test/fixtures/goldens/exports/runtime.json
+++ b/test/fixtures/goldens/exports/runtime.json
@@ -468,6 +468,7 @@
"resetGateway",
"resolveNativeBaseUrl",
"splitByTokenBudget",
+ "thinkingOffOutputCap",
"toAISDKTools",
"toModelMessages",
"toolLoop",
@@ -755,6 +756,7 @@
"msSinceLastReap",
"peekLock",
"pgliteLockDirFor",
+ "processStartTime",
"readBootId",
"readPidNs",
"releaseLock"
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 71b045e1a1..540db4798c 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -2301,6 +2301,13 @@
"(texts: string[], budgetTokens: number, charsPerToken?: number) => string[][]"
]
},
+ {
+ "kind": "variable",
+ "name": "thinkingOffOutputCap",
+ "signature": [
+ "(modelStr: string, requested: number) => number"
+ ]
+ },
{
"kind": "function",
"name": "toAISDKTools",
@@ -5859,7 +5866,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"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\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"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\" | \"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\" | \"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\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"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\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"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\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"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\" | \"maintenance_lock_busy\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"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_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pattern_claims_pending\" | \"pending_writes\" | \"persistence_write_stall\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"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\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"source_binding_required\" | \"source_id_taken\" | \"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_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"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\" | undefined",
+ "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"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\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"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\" | \"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\" | \"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\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"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\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"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\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"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\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"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_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pattern_claims_pending\" | \"pending_writes\" | \"persistence_write_stall\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"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\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"source_binding_required\" | \"source_id_taken\" | \"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_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"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\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
@@ -6521,6 +6528,13 @@
"(dataDir: string) => string"
]
},
+ {
+ "kind": "function",
+ "name": "processStartTime",
+ "signature": [
+ "(pid: number) => string | null"
+ ]
+ },
{
"kind": "function",
"name": "readBootId",