Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge capy/w15-g1 into capy/w15-wave (notice rows unioned; automatic-sync-policy imports reconciled; flag registry regenerated)

garrytanebc96cf4cc27
diff --cc src/commands/autopilot-dispatch.ts
index 7ff3c3c0f6,9402ad2f31..6adbaf5c60
--- a/src/commands/autopilot-dispatch.ts
+++ b/src/commands/autopilot-dispatch.ts
@@@ -9,9 -9,9 +9,9 @@@ import type { MinionQueue } from '../co
import { loadAllSources, parseSourceConfig, sourceConfigHasRemoteUrl, sourceLocalPathSkipWarning, type SourceRow } from '../core/sources-load.ts';
import { isConnectorSourceKind } from '../core/persistence/connector-identity.ts';
import { attemptedConnectorSourceIds } from '../core/persistence/connector-state.ts';
-import { automaticSyncPull } from '../core/persistence/automatic-sync-policy.ts';
+import { AUTOPILOT_GIT_PULL_KEY, automaticGitPullDisabled, automaticSyncPull } from '../core/persistence/automatic-sync-policy.ts';
import { isSyncDisabledConfig } from '../core/sync-policy.ts';
- import { loadActivationPendingSourceIds, skipActivationPendingSync } from '../core/sync-policy.ts';
+ import { automaticSyncSkip, loadActivationPendingSourceIds, reportAutomaticSyncSkip, skipActivationPendingSync } from '../core/sync-policy.ts';
import { resolveAutopilotDispatchTimeoutMs } from './autopilot-timeout.ts';
import {
autopilotRemediationIdempotencyKey,
diff --cc src/core/behavior-change-notice.ts
index 66a7036c4e,099dc0d5b2..bd35780730
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -437,34 -437,8 +437,36 @@@ export const BEHAVIOR_CHANGES: Readonly
{ since: '0.60.165.0', text: '`gbrain extract --stale` and `extract links|all --source db` skip and count a page another writer changed mid-run (`skipped_concurrent_write`) instead of aborting the run; the page stays stale for the next run. `extract all --source db` marks a page extracted only when both its links and its timeline finished at the same revision. On a managed brain, `extract timeline --from-meetings` (and its job) now writes through the coordinator as one `managed_maintenance_meeting_timeline` request per entity page, gated at the meeting\'s trust tier; a refused or pending write fails the job and the command exits 1. An owner on an older build refuses that request kind until it upgrades. On a managed brain, `extract_entities` now writes stubs, timeline rows and backlinks through the coordinator (creating a stub needs permission to write pages); a refusal or pending write returns its error envelope and names the entities already written, instead of a raw `writer_coordinator_required` error or a silently missing timeline row.' },
// Memory proof wave 2 W1 (question-ranked recall).
{ since: '0.60.169.0', text: '`recall` takes an optional `question` and returns saved facts ranked by relevance to it (facts below the match threshold are left out); calls without it still return the newest facts, every response now says `facts_order`, and a call that passes only `query` carries a `recall_hint` notice. `gbrain recall --question` passes the question instead of reading its value as an entity name. In `query`, the facts of an entity the question names come only from that entity page\'s own source, and the temporal fact reserve (`search.temporal_fact_reserve`, off by default) scores with the same question scorer: whole-word matches, and a long fact\'s word matches count for less.' },
+ // Fix wave 15 G2 (GBRA-79, #6454); `since` is the provisional merge-slot stamp (the integrator restamps).
+ { since: '0.60.176.0', text: 'A coordinated write to a page whose stored frontmatter carries one of the parser\'s reserved top-level keys (`type`, `title`, `tags`, `slug`, kept by imports before mid-2026) is no longer refused `source_changed` when the file matches the database in every other way: the file/database comparison (publication, `sources reconcile`, file repairs) strips those four keys on both sides, as the parser does (#6454). A real body, title or tag drift still refuses. Writes refused this way whose receipt is retained replay with `gbrain repair failed-writes --source <id>`; doctor `stale_frontmatter_keys` counts the rows and names the explicit-only `gbrain repair frontmatter-keys` sweep, which removes the inert keys in coordinated batches and advances each swept page\'s `knowledge_revision` once (a client holding an older revision gets one `revision_conflict`).' },
+ { since: '0.60.176.0', text: 'A published page file now always carries the page\'s own `type`, `title` and tags from the database columns. A legacy row whose stored frontmatter also held a `type` or `title` that disagreed with the columns used to render the stored value (and stored `tags` rendered when the page had none); the next write of such a page now renders the columns and drops the stale keys, so the file\'s header can change once. Nested keys of the same names (`metadata.title`) and the `slug:` stamp for slugs the path cannot derive are unchanged.' },
+ // Fix wave 15 G2 (GBRA-79, #6501); provisional merge-slot stamp.
+ { since: '0.60.176.0', text: 'A managed checkout\'s persisted directory birth stamp now matches the live directory when the two are within 1 µs, instead of only when they are byte-identical (#6501: on APFS a freshly created root reports a birth time tens of nanoseconds apart between the process that stamped it and later processes, which left every write to that root refused `recovery_required`). The owner token, brain, worktree, root, inode and device still have to match exactly; a damaged or zero stamp still refuses; the in-process file target check, the staging identity and the transfer prepare/accept comparison stay exact. When the inode or birth time moved beyond that while everything else matches (a checkout restored or recreated at its recorded path), the refusal now carries detail `physical_root_directory_changed` and names the exit: `gbrain sources writer transfer prepare/accept <source> --self-transfer --confirm-relocated-root` (`writer status --json` prints it filled in). The tolerance covers the reported drift; it was not reproduced on APFS here, so #6501 stays open until a reporter confirms on this build.' },
+ // Fix wave 15 G2 (GBRA-79, #6449); provisional merge-slot stamp.
+ { since: '0.60.176.0', text: '`gbrain sources writer activate` no longer refuses `writer_registration_required` for a source that has a checkout path but no canonical owner when the brain\'s `sync.write_through` is `false` (#6449): `writer status` already reported that source `database_only`, and activation now agrees, listing it under `database_only_sources` and leaving it unbound. Page writes to it stay database-only (`disabled_by_config`), and turning `sync.write_through` back on does not claim it automatically on a PGLite brain (activation records the listed sources in `persistence.database_only_sources`; deactivation clears it): the next write refuses `owner_unavailable` with `detail: unbound_source` and the `gbrain sources writer claim` to run (or publishes database-only under `persistence.unbound_write=database_only`), the same as on Postgres. With `sync.write_through` on, the activation refusal and the `owner_unavailable` that `gbrain sync` gives such a source now name the claim (preview with `--dry-run`) instead of a generic inspection hint.' },
+ // Fix wave 15 G2 (GBRA-79, #5808); provisional merge-slot stamp.
+ { since: '0.60.176.0', text: 'On a managed canonical worktree, `gbrain sources writer git-durability <source> --enable` (and `--pat-file`) now rewrites the durability block between the gbrain markers in `AGENTS.md`/`RESOLVER.md` to a managed variant (#5808). The block `sources harden` wrote before activation told agents to run the commit-and-push helper after every write and to pull --rebase before writing, both of which route around the persistence owner; the managed variant says page writes go through gbrain, files that are not pages are committed with plain git and ride the owner\'s next push, and the checkout is never pulled, rebased or reset. The rewrite is idempotent, changes nothing outside the markers and is not committed: the file is left for the operator to commit. The preview (`--dry-run`) lists it as `agents`.' },
+ // Fix wave 15 G2 (GBRA-79, #5913); provisional merge-slot stamp.
+ { since: '0.60.176.0', text: 'A slug-bound OAuth client (a `memory-writer` or `coding-agent` grant with `--bound-slug-prefixes`) can now call `remember` (#5913). The operation was fenced to the one slug it writes (the caller\'s entity, or `memory/unattributed`) but not on the allow-list of fenced write operations, so dispatch denied it before the fence ran and a bound grant could not remember anything. A save against an entity under the prefixes commits; one against an entity outside them, or with no entity, is refused `scope_denied` by the slug fence with nothing saved; `replaces` naming a fact outside the prefixes answers exactly like an id that does not exist. `forget` and `forget_fact` stay denied for bound clients: a withdrawal reaches pages the fenced slug does not name. New bound grants list `remember`; an existing grant keeps its operation snapshot until `gbrain auth rescope` (doctor `grant_new_ops_available` names it).' },
+ // Fix wave 15 (GBRA-79), doctor / repair / migrations group.
+ { since: '0.60.176.0', text: '`gbrain doctor --only harness_wiring` on a Postgres, `database_url` or `remote_mcp` brain now probes an HTTP registration\'s `/health` without any credential instead of reporting `http_serve_missing` unseen: a healthy gbrain answer is `wired_running` with `mcp_access: unverified` (a listener is proven, this registration\'s token and tool access are not; confirm tools in a new session), a refused local `http:` port keeps `http_serve_missing` with the `serve --http` fix, and anything else (`https:` refused, DNS or TLS errors, a timeout, a redirect, a 503 or a non-gbrain answer) is `http_serve_unreachable` / `http_serve_unhealthy` with no fix. Registered URLs are printed without userinfo, query or fragment in every doctor message and JSON (#6453).' },
+ { since: '0.60.176.0', text: '`gbrain repair <kind> --apply` no longer stops the whole run when one item is refused with `invalid_params` (a slug the grammar no longer accepts) or `source_changed` (file and database copies disagree): the item is listed in `failed[]` with its reason and left exactly as it was, the remaining items are repaired, and the command exits 1. A failed item is not retried by a resumed run; the next full scan (the printed apply command once the run has completed) retries it. `gbrain doctor --remediate` reports a repair step with failed items as `failed`, never `completed`, and the content lane and maintenance phases warn on them.' },
+ { since: '0.60.176.0', text: '`gbrain config set shared_skills.migration.enabled false` declines the v0.53.0 shared-skills migration for every machine on the brain: `gbrain apply-migrations` (the install postinstall, `gbrain upgrade` and `gbrain post-upgrade` included) skips it with no inventory and no config writes, `--list` and `--dry-run` show it `declined`, doctor and `get_health.migrations.declined` report it, and an explicit `--migration 0.53.0` refuses with `migration_declined` (exit 3) naming the command that turns it back on (#6466).' },
+ // Fix wave 15 G5 (GBRA-79).
+ { since: '0.60.176.0', text: '`gbrain backup create` on a PGLite brain now removes gbrain\'s own IPC socket files (`.gbrain-resolve.sock`, `.gbrain-persistence.sock`) from the data dir before the dump when nothing listens on them, so a `serve` that was killed no longer blocks every later backup; each removal is listed in the archive\'s `omitted`. Any other socket, FIFO or symlink in the data dir is left alone and the backup refuses with `backup_dump_failed` naming it.' },
+ { since: '0.60.176.0', text: 'The pull that `gbrain sources pull`, `sources push`, `sources harden` and the workspace push run before pushing now passes `--no-autostash`: a repository or user `rebase.autoStash=true` no longer stashes and replays edits made while the pull ran. A dirty tree still ends as `skipped_dirty`, the documented contract.' },
+ // Fix wave 15 G6 (GBRA-79).
+ { since: '0.60.176.0', text: 'A subagent job whose final model turn produced no answer (an empty or whitespace-only body, a thinking-only turn) now ends with `stop_reason: error`, and a turn the provider stopped with `refusal` ends `refusal`; both used to be reported as a clean `end_turn`. A resumed job whose stored transcript already ends on such a turn is answered from the transcript with that stop reason instead of sending the turn back to the provider as an assistant prefill (which Haiku 5.5 and Sonnet 4.6+ reject with HTTP 400). The queue\'s terminal-state policy is unchanged; `require_writes` jobs that produced nothing already failed.' },
+ { since: '0.60.176.0', text: 'Embedding chunks are now capped at the documented per-input limit of four more hosted encoders: DashScope `text-embedding-v1` / `v2` (2,048 tokens; new chunks at most 1,228 estimated tokens instead of 2,000), Google `gemini-embedding-001` (2,048; it used to truncate long chunks silently), Zhipu `embedding-3` (3,072; chunks at most 1,843) and `embedding-2` (512; chunks at most 307). On a brain using one of them, the next `gbrain embed` or `embed --stale` pass splits stored chunks over the cap and re-embeds the pieces (billed as ordinary embedding tokens); other models chunk as before. A model with no declared cap whose provider rejects one chunk as too long is now split to a cap derived from that rejection and retried on the next pass, at most three times per page, instead of failing identically on every pass; the failure line names the fix when the descent stops.' },
+ { since: '0.60.176.0', text: 'Google contacts now import phone numbers and user-created contact groups: person pages gain `phones:` (E.164 where Google supplies it) and `groups:` frontmatter, and a contact with phones but no email address, which used to produce no page at all, now gets one (at `contact-<id-hash>` when it also has no name). Because the People API ties a sync token to the request that minted it, the first contacts sweep after this upgrade lists every contact once (one full `connections.list` per Google source, within the usual quota) and then continues incrementally; `gbrain sync --full` is not needed. A group rename or deletion reaches a page when that contact next changes or on `--full`.' },
+ // Fix wave 15 G3 (GBRA-79). `since` is provisional (0.60.176.0); the integrator restamps it at the merge slot.
+ { since: '0.60.176.0', text: '`gbrain extract-conversation-facts` now walks a source\'s pages by slug (a keyset) instead of OFFSET over `updated_at`, so a page is listed, extracted and frozen once per run even while other writers touch pages that share one timestamp; a page the run sees twice is counted as `pages_skipped_duplicate_listing` with no second model call. A batch request the writer refused as malformed (`invalid_params`, the shape a page listed twice produced) is no longer a permanent block: its stored entries are resubmitted on the next run with zero model calls, up to 3 failed requests per page version, and one failed request counts once however many times it listed the page. `list_pages` sorted by `updated_desc` (the default) now breaks timestamp ties by slug, source and id, so ties page deterministically; offset paging is still unstable under writes that change `updated_at`.' },
+ { since: '0.60.176.0', text: '`gbrain projections drain` (and the migration drain) no longer loops on one queue row whose revision does not match its page: the row is re-keyed to the page\'s current revision and rebuilt in the same pass, or deleted when the page is already projected or belongs to a dead source incarnation, always as a compare-and-set on the exact row listed so a newer queued row survives. A page whose content changes while it is being rebuilt appears once under `failed` with a `revision_conflict:` reason and stays queued for the next run; `--json` may now list such rows where the command used to hang.' },
+ { since: '0.60.176.0', text: '`gbrain extract-conversation-facts` now sends every eligible turn of a conversation page to the extractor in bounded windows: a window closes at 30 messages or when its rendered text, header included, would exceed 6,500 characters, and the next turn opens a new window instead of being cut off; a turn too long for one window is split at sentence boundaries with its speaker and timestamp repeated; the 31st reply of a 31-turn group is extracted as its own window instead of being dropped. A dense page therefore takes more extractor calls than before, under the same cost cap. Pages already stamped complete from clipped input are not re-extracted automatically; to recompute them run `gbrain extract-conversation-facts --source <id> --force` (narrowed to one page with its slug option, or the whole source after a `--dry-run` preview of the window count), which spends model calls.' },
+ { since: '0.60.176.0', text: 'Fact extraction on explicit lanes (sync import, put_page) now measures same-page rewordings: when a page is re-extracted and a new claim sits within cosine 0.85 of a fact the same page produced earlier without changing a number, date, amount or negation, the run counts it as `would_dedup_same_page` and prints one stderr line naming the matched fact id. Nothing is dropped or expired; the counter exists so the rule\'s false-positive rate can be measured before any automatic dedup ships.' },
+ { since: '0.60.176.0', text: 'The atom-extraction phase (`extract_atoms`) now honors a schema pack that declares one of the built-in extractable types (meeting, source, article, video, book, original) as `extractable: false`, the way facts extraction already did: such pages are no longer mined into atoms. gbrain-base declares meeting and source extractable and is unchanged; on gbrain-recommended, `source` pages stop being atom-extracted. A pack that does not mention a built-in type keeps it extractable.' },
+ // Fix wave 15 group 1 (managed sync authority and data safety).
+ { since: '0.60.176.0', text: 'A brain whose persistence mode cannot be read (no `persistence_brain` row, more than one, or an `enabled` value that is not a boolean) now refuses every write, sync, connector run, activation and maintenance step that depends on it with `storage_error` (`detail: persistence_mode_unknown`, fix: `gbrain sources writer status --probe --json`) instead of treating the brain as unmanaged and writing around the owner; only a well-formed `enabled: false` row selects the unmanaged path. A managed `gbrain sync --full` tree walk no longer soft-deletes a page it imported from an untracked working-tree file: a page whose stored import provenance is the working tree, or is unknown, is kept while its file is still present (`working_tree_kept` in the result), and a page imported from a Git blob still follows Git. A soft deletion is not harmless (recall stops at once and the purge lifecycle follows), so this applies on the next sync without opt-in. A first sync, a `--full` sync or one commit that alone exceeds the 100,000-entry / 16 MiB cursor bound now completes in path slices (every import slice, then bounded deletion slices, pinned at one target; the slice cursor is checkpointed with each slice and `last_commit` moves only when the whole target settles) instead of refusing with `request_too_large`; a scheduled sync takes one slice per run and `gbrain sync --drain` takes them all. One file whose manifest entry alone exceeds the byte bound still refuses by name.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --cc src/core/cli-flag-registry.generated.ts
index 3b11cb7105,322c2e2740..cb7cdf1abc
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@@ -71,8 -71,8 +71,8 @@@ export const CLI_FLAG_REGISTRY: Record<
'google': ['--access', '--account', '--allow-create-db', '--allow-docker', '--brain', '--calendar-id', '--chat-model', '--client-id', '--client-json', '--client-secret', '--code', '--consent-state', '--content-root', '--db-only', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--history-days', '--http', '--issuer-url', '--json', '--key', '--kind', '--limit', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-browser', '--no-embedding', '--no-git', '--no-probe', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--paste', '--path', '--pglite', '--plan', '--port', '--prefer-postgres', '--provenance', '--purge-client', '--query', '--reauth', '--retry-failed', '--schema-pack', '--scopes', '--services', '--skip-embed-check', '--source', '--status', '--supabase', '--surface', '--sync-budget-ms', '--timeout-ms', '--to', '--token-command', '--url', '--version', '--via', '--yes'],
'graph-query': ['--brain', '--depth', '--direction', '--help', '--hop', '--include-foreign', '--json', '--mcp-only', '--source', '--type'],
'hook': ['--allow-unverified-remote', '--auto', '--brain', '--branch', '--cached', '--count', '--diff-filter', '--enable', '--end-of-options', '--env', '--get', '--harness', '--help', '--jq', '--json', '--limit', '--name-only', '--others', '--pat-file', '--path', '--porcelain', '--pure', '--quiet', '--remove', '--seat', '--session', '--show-current', '--show-toplevel', '--since', '--source', '--yes'],
- 'import': ['--accept-pending', '--allow-empty', '--allow-noncanonical-root', '--apply', '--background', '--brain', '--cached', '--diff-filter', '--dim', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--explain', '--follow', '--force', '--force-rechunk', '--format', '--fresh', '--help', '--include-gitignored', '--is-shallow-repository', '--json', '--log-noop', '--name-only', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-gpg-sign', '--no-pull', '--no-renames', '--no-verify', '--only', '--others', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--url', '--verify', '--wait', '--workers'],
- 'init': ['--access', '--adopt', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--auto', '--background', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--budget-usd', '--chat-model', '--check', '--confirm-relocated-root', '--content-root', '--db-only', '--dest', '--dim', '--disable', '--embedding-dimensions', '--embedding-model', '--enable', '--expansion-model', '--facts', '--fix', '--force', '--from-meetings', '--full', '--git', '--grant-types', '--harness', '--help', '--http', '--id', '--images', '--issuer-url', '--json', '--key', '--lanes', '--limit', '--list', '--local-postgres', '--markdown', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-git', '--no-llm', '--no-repair', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--query', '--question', '--quiet', '--rebase', '--reference-date', '--remediate', '--remove', '--reset', '--retry-failed', '--save', '--schema-pack', '--scope', '--scopes', '--section', '--self-transfer', '--show-toplevel', '--skip-embed-check', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--warn-only', '--workspace', '--yes'],
+ 'import': ['--accept-pending', '--admin-intent', '--allow-empty', '--allow-noncanonical-root', '--apply', '--background', '--brain', '--cached', '--confirm-relocated-root', '--diff-filter', '--dim', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--format', '--fresh', '--help', '--include-gitignored', '--is-shallow-repository', '--json', '--log-noop', '--manifest', '--name-only', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-gpg-sign', '--no-pull', '--no-renames', '--no-verify', '--only', '--others', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--self-transfer', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--url', '--verify', '--wait', '--workers'],
- 'init': ['--access', '--adopt', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--auto', '--background', '--brain', '--break-lock', '--budget-ms', '--budget-usd', '--chat-model', '--check', '--confirm-relocated-root', '--content-root', '--db-only', '--dest', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--expansion-model', '--facts', '--fix', '--force', '--from-meetings', '--full', '--git', '--grant-types', '--harness', '--help', '--http', '--id', '--images', '--issuer-url', '--json', '--key', '--lanes', '--limit', '--local-postgres', '--markdown', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-autopilot-install', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-git', '--no-llm', '--no-repair', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--query', '--question', '--quiet', '--reference-date', '--remediate', '--remove', '--reset', '--retry-failed', '--save', '--schema-pack', '--scope', '--scopes', '--section', '--self-transfer', '--show-toplevel', '--skip-embed-check', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--warn-only', '--workspace', '--yes'],
++ 'init': ['--access', '--adopt', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--auto', '--background', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--budget-usd', '--chat-model', '--check', '--confirm-relocated-root', '--content-root', '--db-only', '--dest', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--expansion-model', '--facts', '--fix', '--force', '--from-meetings', '--full', '--git', '--grant-types', '--harness', '--help', '--http', '--id', '--images', '--issuer-url', '--json', '--key', '--lanes', '--limit', '--list', '--local-postgres', '--markdown', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-git', '--no-llm', '--no-repair', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--query', '--question', '--quiet', '--rebase', '--reference-date', '--remediate', '--remove', '--reset', '--retry-failed', '--save', '--schema-pack', '--scope', '--scopes', '--section', '--self-transfer', '--show-toplevel', '--skip-embed-check', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--warn-only', '--workspace', '--yes'],
'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],
'integrity': ['--accept-pending', '--auto', '--backend', '--background', '--brain', '--confidence', '--cost', '--dry-run', '--explain', '--follow', '--fresh', '--help', '--json', '--limit', '--no-accept-pending', '--probe', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--supabase', '--timeout', '--type', '--url', '--wait'],
'jobs': ['--abbrev-ref', '--access', '--acknowledge-managed', '--add', '--admin-intent', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--check', '--cli-path', '--client', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--confirm-quiesced', '--cost-estimate', '--date', '--dated-since', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--expected-state', '--explain', '--facts', '--federated-read', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--fuzzy', '--grammar-diagnostics', '--group', '--hard-deadline', '--health-interval', '--help', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-deleted', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--lanes', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--probe', '--prune-orphans', '--purge', '--queue', '--queue-only', '--quiet', '--reason', '--rebuild', '--recent', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--replace', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--retry-held', '--review-lower', '--row', '--scopes', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--to', '--trust', '--type', '--types', '--uninstall', '--updated-after', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
@@@ -127,7 -127,7 +127,7 @@@
'status': ['--abbrev-ref', '--acknowledge-managed', '--all', '--allow-empty', '--apply', '--brain', '--break-lock', '--cached', '--concurrency', '--confirm-destructive', '--deadline-ms', '--diff-filter', '--empty', '--exclude', '--exclude-standard', '--fast', '--filters', '--fix', '--force-break-lock', '--format', '--full', '--full-history', '--hard-deadline', '--help', '--include-gitignored', '--include-hidden', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--lanes', '--max-age', '--max-sources', '--mcp-only', '--missing-path', '--name-only', '--no-auto-embed', '--no-bulk', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--others', '--parallel', '--path', '--priority', '--quiet', '--repo', '--reset-checkpoint', '--retry-failed', '--retry-held', '--section', '--serial', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--strategy', '--timeout', '--url', '--verify', '--watch', '--workers', '--working-tree', '--yes'],
'storage': ['--brain', '--fix', '--help', '--json', '--plan', '--repo', '--restore-only', '--source', '--to'],
'sweep': ['--accept-pending', '--apply', '--assign-corpus', '--background', '--batch-limit', '--brain', '--budget-ms', '--delete-brain', '--explain', '--follow', '--help', '--home', '--json', '--no-accept-pending', '--no-delegate', '--once', '--only', '--progress-interval', '--progress-json', '--quiet', '--session', '--source', '--timeout', '--wait'],
- 'sync': ['--abbrev-ref', '--abort', '--accept-pending', '--account', '--acknowledge-managed', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--assign-corpus', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--confirm-quiesced', '--contacts-dir', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--enable', '--exclude', '--exclude-standard', '--expect', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--first-parent', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lanes', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--log-noop', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-autostash', '--no-bulk', '--no-capture', '--no-delegate', '--no-edit', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-rebase', '--no-recurse-submodules', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--once', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--reverse', '--scope', '--scopes', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],
- 'sync': ['--abbrev-ref', '--abort', '--accept-pending', '--account', '--acknowledge-managed', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--assign-corpus', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--confirm-quiesced', '--confirm-relocated-root', '--contacts-dir', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--first-parent', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lanes', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--log-noop', '--manifest', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-capture', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-recurse-submodules', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--once', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--reverse', '--scope', '--scopes', '--self-transfer', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],
++ 'sync': ['--abbrev-ref', '--abort', '--accept-pending', '--account', '--acknowledge-managed', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--assign-corpus', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--confirm-quiesced', '--confirm-relocated-root', '--contacts-dir', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--enable', '--exclude', '--exclude-standard', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--first-parent', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lanes', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--log-noop', '--manifest', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-autostash', '--no-bulk', '--no-capture', '--no-delegate', '--no-edit', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-rebase', '--no-recurse-submodules', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--once', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--reverse', '--scope', '--scopes', '--self-transfer', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],
'takes': ['--accept', '--batch-size', '--before', '--brain', '--bucket-size', '--by', '--claim', '--dim', '--dir', '--domain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--evidence', '--expected-revision', '--expired', '--force', '--from-pages', '--help', '--holder', '--include-covered', '--json', '--kind', '--limit', '--max-pages', '--no-embed', '--no-embedding', '--offset', '--outcome', '--path', '--quality', '--reject', '--request-id', '--row', '--semantic', '--since', '--sort', '--source', '--source-id', '--stale', '--status', '--supabase', '--to', '--unit', '--until', '--value', '--weight', '--who', '--yes'],
'think': ['--anchor', '--brain', '--calibration-holder', '--help', '--json', '--mcp-only', '--model', '--only', '--reference-date', '--rounds', '--save', '--since', '--source', '--take', '--until', '--with-calibration'],
'transcripts': ['--accept-pending', '--all', '--all-discovery', '--apply', '--background', '--brain', '--days', '--dry-run', '--embed', '--explain', '--facts', '--follow', '--format', '--full', '--help', '--include-self', '--json', '--limit', '--max-bytes', '--max-cost-usd', '--no-accept-pending', '--only', '--progress-interval', '--progress-json', '--purge', '--quiet', '--since', '--source', '--source-id', '--timeout', '--wait'],
diff --cc src/core/persistence/activation.ts
index f489a6f1fd,73d4878c59..7cfa10109b
--- a/src/core/persistence/activation.ts
+++ b/src/core/persistence/activation.ts
@@@ -179,15 -153,14 +178,15 @@@ export async function activatePersisten
return await engine.transaction(async tx => {
await tx.executeRaw("SELECT set_config('lock_timeout','2000ms',true),set_config('synchronous_commit','on',true)");
await assertWriterAdminState(tx, opts.expectedState);
- const [current] = await tx.executeRaw<{ enabled: boolean }>('SELECT enabled FROM persistence_brain WHERE singleton=1 FOR UPDATE');
+ const current = await readManagedMode(tx, { lock: 'update' });
await assertWriterAdminUnlocked(tx);
- if (current?.enabled) return { enabled: true, activated: false, filesystem_sources: initial.length, native_lock: native, ...ALREADY_ENABLED };
+ if (current) return { enabled: true, activated: false, filesystem_sources: initial.length, native_lock: native, ...ALREADY_ENABLED };
const currentSources = await configuredSources(tx, true);
- const bindings = await validatedBindings(tx, currentSources, hostId, true);
+ const currentWriteThrough = writeThroughConfigured(await tx.getConfig('sync.write_through'));
+ const { bindings, databaseOnly: currentDatabaseOnly } = await validatedBindings(tx, currentSources, hostId, currentWriteThrough, true);
const identity = (rows: WorktreeBinding[]) => JSON.stringify(rows.map(row => [row.source_id,row.source_incarnation,row.worktree_id,row.owner_host_id,
String(row.owner_epoch),String(row.topology_generation),row.relative_path,row.local_path,row.coordination_path]));
- if (identity(bindings) !== identity(initial) || JSON.stringify(currentSources) !== JSON.stringify(sources)) {
+ if (identity(bindings) !== identity(initial) || JSON.stringify(currentSources) !== JSON.stringify(sources) || JSON.stringify(currentDatabaseOnly) !== JSON.stringify(databaseOnly)) {
throw opError('source_changed', 'Source ownership changed during activation; inspect writer status and retry.',
'Sources or their owners changed while activation ran, so it rolled back and nothing was activated. Inspect the writer status, then rerun gbrain sources writer activate --confirm-quiesced --dry-run before activating again.',
{ fix: writerStatusFix('Shows the current sources, owners and registrations, read-only.') });
diff --cc src/core/persistence/automatic-sync-policy.ts
index ec6fe8754c,42a56ce32a..2dc10b8692
--- a/src/core/persistence/automatic-sync-policy.ts
+++ b/src/core/persistence/automatic-sync-policy.ts
@@@ -1,48 -1,19 +1,39 @@@
+import { isConfigTruthy } from '../config.ts';
+import type { BrainEngine } from '../engine.ts';
- import { opError } from '../ops/contract.ts';
- import { readFix } from '../ops/op-fix.ts';
import { sourceConfigHasRemoteUrl } from '../sources-load.ts';
import type { SqlEngine } from './model.ts';
- import { getWorktreeBinding } from './ownership.ts';
+ import { getWorktreeBinding, readManagedMode } from './ownership.ts';
+/** #6451: brain-wide opt-out for the Git pull automatic sync requests (default on). */
+export const AUTOPILOT_GIT_PULL_KEY = 'autopilot.git_pull';
+
+type PolicyEngine = SqlEngine & Partial<Pick<BrainEngine, 'getConfig'>>;
+
+/**
+ * True when `autopilot.git_pull` is set to an explicit non-truthy value. Unset,
+ * an engine without a config reader, or a config read failure keep the default
+ * (pulls on), so a config-plane blip never changes sync behavior.
+ */
+export async function automaticGitPullDisabled(engine: PolicyEngine): Promise<boolean> {
+ const raw = await engine.getConfig?.(AUTOPILOT_GIT_PULL_KEY).catch(() => null) ?? null;
+ return raw != null && !isConfigTruthy(raw);
+}
+
/**
* Whether an automatic sync (autopilot freshness or per-source fanout) may
* request a Git pull for `source`. It needs a remote URL plus positive proof of
* an unmanaged source: exactly one boolean persistence state that is off, and
* no worktree binding. A managed brain or a claimed source syncs local HEAD
* without pulling; missing or malformed persistence metadata refuses instead of
- * granting a pull. Explicit `gbrain sync` intent is resolved elsewhere.
+ * granting a pull. `autopilot.git_pull=false` (#6451) turns the pull off for
+ * every source before any of that is read. Explicit `gbrain sync` intent is
+ * resolved elsewhere.
*/
-export async function automaticSyncPull(engine: SqlEngine, source: { id: string; config: unknown }): Promise<boolean> {
+export async function automaticSyncPull(engine: PolicyEngine, source: { id: string; config: unknown }): Promise<boolean> {
+ if (await automaticGitPullDisabled(engine)) return false;
if (!sourceConfigHasRemoteUrl(source.config)) return false;
- const rows = await engine.executeRaw<{ enabled: unknown }>('SELECT enabled FROM persistence_brain WHERE singleton=1');
- if (rows.length !== 1 || typeof rows[0]?.enabled !== 'boolean') {
- throw opError('storage_error', 'Automatic sync requires exactly one known boolean persistence state.',
- `Run the read-only probe in fix on the brain host and fix the persistence state it reports; automatic sync of ${source.id} resumes on the next tick.`, {
- why: `The persistence_brain singleton is missing, duplicated or not a boolean, so gbrain cannot tell whether ${source.id} is a managed canonical checkout; automatic sync is not queued rather than risk a Git pull over it.`,
- fix: { ...readFix('Shows the brain\'s persistence mode and each source\'s writer binding without changing anything.',
- { argv: ['gbrain', 'sources', 'writer', 'status', '--probe', '--json'] }), verify: { argv: ['gbrain', 'doctor', '--json'] } },
- });
- }
- if (rows[0].enabled) return false;
+ // #6482: the shared fail-closed predicate (`storage_error` on a missing, duplicated or non-boolean singleton) lives in ownership.ts.
+ if (await readManagedMode(engine, { refusal: { subject: 'Automatic sync',
+ consequence: `automatic sync of ${source.id} is not queued rather than risk a Git pull over it; it resumes on the next tick once the state is repaired` } })) return false;
return await getWorktreeBinding(engine, source.id, null) === null;
}