Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
verify: agent-contract advice keys, function-size ratchet, Postgres goldens and llms-full for wave 14 PR2
garrytan24dd1b76050c
diff --git a/llms-full.txt b/llms-full.txtindex 60717e6980..be68c0c352 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -7180,6 +7180,20 @@ When HEAD moved past the pinned target while the run drained, the drain takesexactly one more pass (an incremental pin..HEAD discovery) so the invocationends at HEAD; never a second one, so a live checkout cannot loop.+## A cursor doctor reports that no sync can reach++`sync_incomplete` in the table above resumes with the same command because the+live writer reads its own cursor key. A cursor written under a key nothing+current derives (an older writer identity such as a `legacy_token` principal,+a revoked local writer, a cursor from before sync options were recorded) is+still read by doctor, so `sync_failures` reports it after every green sync.+That is not a page fault and no rerun clears it: preview+`gbrain repair managed-sync-orphans --source <id>`, relay the listed classes+(`no_cursor`, `principal_unadoptable`, `superseded`) and the kept rows, then+apply with the printed `--apply --expect <hash>` once the user agrees. A cursor+with a live pending request is kept; the loop above owns it+([repair guide](repair.md#managed-sync-orphans)).+## See also- [`write-refusals.md`](write-refusals.md#held-files-and-content-refusals): every hold code with its recovery.diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsvindex 5d6fe78be7..2d43b05773 100644--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@ -28,7 +28,7 @@ src/core/minions/queue.ts 2528 ratchet grown #4078 + megawave probe-liveness unlsrc/commands/init.ts 1878 ratchet +2 fix wave 9 lane F #5253: leaving deferred setup also clears the DB-plane embedding_disabled row (both init branches); grown v0.46.x keyless capability notices; grown db-availability loop: initPostgresCore typed-failure extraction + --prefer-postgres ladder hook + pgvector rethrow fix; +1 at megawave/wave-k merge; +master-merge true-up; wave-k: merge; #3753 --force re-init engine-preservation guard; +1 wave-k merge-union brace (--prefer-postgres close); +10 ambient-writeback WP8: runWritebackNudge consent ask in both engine epilogues (logic lives in core/onboard/writeback-nudge.ts); +4: v0.48.2 reranker readiness at init + test seam; +1: v0.48.2 provider normalization; +3: v0.48.2 review fixes; master integration: +2: preserve typed PGLite busy errors in schema-only init; shared-skills integration on company-ingestion base; retired provider integration removed; retain stored-vector identity on re-init; -14: first-run bundle + quickstart registration helpers live in init-first-run.ts (writeback/skills asks folded into the bundle); +5 agent operator follow-up Item 2: --surface flag (value flag, parse, help line, module-level registration surface, type import) for the printed harness registration; +2 fix wave lane B3: both engine paths stamp a database init created as a fresh install for the behavior_changes notice (core/behavior-change-notice.ts)src/commands/integrations.ts 1739 ratchet grown v0.46.26.0 megawave (#4039 connector compat) + 1 nosemgrep dataflow annotation (path-traversal audit); wave-k: exported heartbeatPath seam (#3900)src/core/minions/handlers/subagent.ts 1925 ratchet merged: master v131 settle rework + dream-wave C5 peel + C6 accounting + C7 lease heartbeats/lost-lease aborts + C9 oneshot dispatch + adversarial fix batches; grown by #4078 subagent-loop capability fix; +6 lines (reasoning-item replay: adaptContentBlocksToChatBlocks handles 'reasoning' blocks); +3 wave G #4514: Anthropic-via-OpenRouter allowed on the subagent loop; +36 lines (code review, same PR): isPromptTooLongError walks a bounded .cause chain so it still matches post-normalizeAIError() wrapping, plus extractPromptTooLongDetail so the dead-lettered job's error carries the matched provider detail instead of the generic normalizeAIError() wrapper text; master integration: harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; #5105: +13 call-site wiring to shared tool-write-identity helper across fresh and replay dispatch; +7 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms read once and passed to the oneshot and gateway-loop paths (resolver lives in minions/handler-timeouts.ts)-src/commands/bootstrap.ts 2141 ratchet grandfathered at merge (grew past the 1500 cap on master); raised for #4066 HOME_WORKSPACE_GUARD_EXEMPT (status/uninstall/harness); +5 for the harnessDetect test seam (bulk lives in core/bootstrap/harness.ts); +23 for the contract subcommand dispatcher glue (#4105 absorb — bulk lives in core/bootstrap/contract.ts); +codex hooks-consent gate + mcp+hooks receipt registration + uninstall arm; +42 ambient-writeback WP8: interview-time SURFACE_MULTIUSER audience apply (pre-init ordering) + applyDeclaredAudienceFromInterview; +3 #4897 harness usage clause documenting --source ID semantics; +5 #5878: --refresh-skills dispatch and usage lines (logic in core/bootstrap/harness-skills.ts); +11 #5488: SUBCOMMAND_HELP harness entry (gate on --help / -h / help) — CLI help line, cannot move; +11 #4618 seat: --seat/--no-seat help lines and the runHooks parse (parse + notes live in core/bootstrap/hooks.ts parseSeatFlags); +7 #4082: --adopt dispatch in runHooks and its two help lines (adoption logic lives in core/bootstrap/adopt-connection.ts + adopted-connections.ts)+src/commands/bootstrap.ts 2147 ratchet grandfathered at merge (grew past the 1500 cap on master); raised for #4066 HOME_WORKSPACE_GUARD_EXEMPT (status/uninstall/harness); +5 for the harnessDetect test seam (bulk lives in core/bootstrap/harness.ts); +23 for the contract subcommand dispatcher glue (#4105 absorb — bulk lives in core/bootstrap/contract.ts); +codex hooks-consent gate + mcp+hooks receipt registration + uninstall arm; +42 ambient-writeback WP8: interview-time SURFACE_MULTIUSER audience apply (pre-init ordering) + applyDeclaredAudienceFromInterview; +3 #4897 harness usage clause documenting --source ID semantics; +5 #5878: --refresh-skills dispatch and usage lines (logic in core/bootstrap/harness-skills.ts); +11 #5488: SUBCOMMAND_HELP harness entry (gate on --help / -h / help) — CLI help line, cannot move; +11 #4618 seat: --seat/--no-seat help lines and the runHooks parse (parse + notes live in core/bootstrap/hooks.ts parseSeatFlags); +13 #4082: runAdoptHooks (the --adopt branch of the hooks subcommand, kept out of runHooks for the function-size ratchet) and its two help lines (adoption logic lives in core/bootstrap/adopt-connection.ts + adopted-connections.ts)src/core/minions/worker.ts 1774 ratchet grandfathered at merge (grew past the 1500 cap on master, #4170); grown v0.46.11.0 five-issue wave; security: durable queued authority and confined filesystem dispatch; typed readiness, configuration-blocked lifecycle and bounded release; post-validation readiness publication and confirmed isolated-execution stop evidence; latch typed lock-renewal faults before generic retry; +9 Lane D: JobDeferredError routing (deferJob helper); +1 spend authorization: runWithJobSpend import (both handler seams call it in place of the bare handler)src/commands/sources.ts 2059 ratchet +5 PR #5955 / fix wave 14 P2.7: sources set-strategy dispatch and help row, the strategy field of sources list --json (body in sources-strategy.ts); +5 #5988: sources status/retry-held help rows describe Git holds (help lines cannot move); +2 #5988: sources status <id> filter and Git held files (view in persistence/connector-status.ts); +5 F0: sources refresh dispatch and help rows (command body in sources-refresh.ts, protocol in persistence/worktree-refresh.ts); +6 fix wave 5 #5409: mirror-readonly/mirror-writable dispatch, help rows and the list --json mirror_read_only field (body in sources-mirror.ts); grown v0.46.22.0 phone wave: github source kind (#4104); +129 v0.47 gmail-loops: google source-kind flags + vault preflight + duplicate-account warn + access-mode validation; +8 set-path dispatch + help rows (#4739 — command body peeled to sources-set-path.ts); +29 #4698 adoption: --calendar-id flag + duplicate-account warn scoped to overlapping services; #5105: trusted writer administration route; company handlers and receipt status wiring; parsing stays in dedicated modules; canonical reconciliation: +5 engine-free sibling-command dispatch and help row, implementation remains in source-reconcile.ts; +4 fix wave 3 lane A: sources status connector recovery state and run counts (view lives in persistence/connector-status.ts); +3 fix wave 4 lane B: sources retry-held dispatch and help row (command body in sources-retry-held.ts) and the connector first-sync note on add; bodies in source-delete.ts and sources-set-path.ts); +4 #5984: sources status shows the managed sync backlog (logic in persistence/sync-drain.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2031 measured); +11 W-B4: sources shared-skills dispatch, its --help guard and help rows, and the shared_skills field/lines in sources status (body in sources-shared-skills.ts, view in shared-skills/source-opt-out.ts); +4 #6188: uncommitted legacy fence-repair notices in sources status (logic in fence-repair/uncommitted.ts); +7 #6317: data_moving/movement_state on sources status and its human line (reader in persistence/sync-movement.ts), writer movement help rowsrc/core/link-extraction.ts 2358 ratchet grown v0.46.26.0 megawave: link-aware timeline split + delimiter-outside-links (#3957 #4062 #3737); +37 wave-k #3908 reimpl: isCrossSourceLinksEnabled config ladder; +10 wave #4277: parseTimelineEntries skips generated backlink receipts; +17 #4855: latin-fold in normalizeBasename + dir-hint step tries both slug grammars; +17: #4855 Latin stroke-letter fold; +5: #4873 ./-relative markdown links kept as live references; +34 wave review: `../y.md` sibling links resolve on the DB path + folded bare-wikilink grammar (#4873 class); +62 #4977: role-prior suppression in machine-list sections (rolePriorSuppressedRanges, EntityRef.index); +3 composed with #4985 (variation-selector strip) in the same wave; +4 #4995: markdown-link anchor strip + lowercase-candidate rationale comments; +6 pre-landing review: #4977 suppression on code-stripped content + truthful watermark/section-list comments; T2: source-qualified inference and atomic origin-scoped derived links; canonical attendance evidence, source-qualified orientation, strict attendee resolution, and relocated filesystem link scanner (command export preserved); +4: pack-owned fallback and ambiguous attendee guards Display-label attendance exclusion, indexed evidence membership, and bounded strict resolver caching; attendance-boundary review.; complete attendance resolution and fence-safe evidence traversal; frontmatter discovery, canonical basename admission and code-aware attendance comment masking; exclude inline HTML comment spans from admitted attendance ranges; +17 write-path wave: same-name rule for entity fuzzy matches + rename-alias fallback in makeResolver; +1 #5567: materialized marker ends bullet detail; +30 #5749: unique global-basename step before fuzzy and live keyword resolution (ResolveOptions, watermark note); #5765: bold **Attendees:** label accepted + LINK_EXTRACTOR_VERSION_TS bump note; +10 eval-wave N9-2/N9-3/N12-7: pack frontmatter mappings inherit FRONTMATTER_LINK_MAP direction, page-type-bound pack attended follows canonical attendance, LINK_EXTRACTOR_VERSION_TS bump note; +1 #5623: normalizeBasename collapses hyphen runs like slugifySegment (extractor watermark note); +11 #5562: parseTimelineEntries accepts dated ### headings (FS-extractor parity); +3 eval-wave N12-6: Participants accepted as attendance evidence + LINK_EXTRACTOR_VERSION_TS bump note; +22 P5 wanted pages: AuthoredRef on body link candidates; -33 lowered: P5 moved machine-section ranges to core/machine-sections.ts and stated relation types to core/line-grammar.ts; +7 P5: ExtractPageLinksOptions interface + wikilinkAuthoredRef helper (keeps extractPageLinks under the function-size limit); +32 P5: per-edge verb attachment (attachedVerb, VERB_RULES) + joined-as works_at + extractor watermark note; P5 x temporal-edges merge: verb attachment reads the verb at the link's own position in the window (excerptAnchor) and the within-page dedup (now dedupeCandidates) drops a mention of a target the page also links with a typed edge; links joined only by commas/conjunctions share the verb before the first (coordinated); board roles (BOARD_RE, BOARD_AFTER_RE) resolve to invested_in for an investor page and advises otherwise, never works_at; +1 fix wave 11 #6191: imports targetTakesVerb (role-verb target guard lives in link-target-roles.ts); v0.60.105.0 merge: #5984 Phase 5 link preparation (+6) re-summed over wave 11 at 2211; +109 Q2 Track C: stable verb-rule ids, traceLinkType/explainLinkType (reasons for every typing decision), per-occurrence typer hoisted out of extractPageLinks (makeTypeFor); unit logic lives in core/link-typing-units.ts; +25 Q2 Track C: typing-unit verb rules and vetoes in attachedVerb/traceLinkType, validity stints in explainLinkType; +4 U3: board-seat rule split out of INVESTED_RE (same verb and precedence) and investor-prior/link offsets passed to unit vetoes; +11 U2: locateLink shared by attachedVerb and the U2 post-pass in traceLinkType; -11 lowered: Q2 verdict reverted U2 (locateLink and the post-pass)diff --git a/src/commands/bootstrap.ts b/src/commands/bootstrap.tsindex 5ea8157267..bafff61013 100644--- a/src/commands/bootstrap.ts+++ b/src/commands/bootstrap.ts@@ -1054,6 +1054,18 @@ async function runRepo(ws: string, rest: string[], home: string, runner: ExecRun});}+/** `hooks --adopt` (#4082): record an operator-managed Codex project connection as the wire evidence; writes no harness config. */+async function runAdoptHooks(ws: string, rest: string[], home: string): Promise<number> {+ const harnessFlag = flagValue(rest, '--harness');+ const harness = isHarness(harnessFlag) ? harnessFlag : harnessFlag ? null : detectHarness();+ if (!harness) { console.error('--adopt needs the harness — pass --harness codex'); return 2; }+ if (readManifest(ws).state !== 'initialized') { console.error('not an initialized agent workspace — run `gbrain bootstrap render` first'); return 1; }+ const { adoptConnection } = await import('../core/bootstrap/adopt-connection.ts');+ const adopted = adoptConnection(ws, home, harness, flagValue(rest, '--name') ?? undefined);+ for (const line of adopted.lines) (adopted.code === 0 ? console.log : console.error)(line);+ return adopted.code;+}+async function runHooks(ws: string,rest: string[],@@ -1101,12 +1113,6 @@ async function runHooks(return 1;}const sourceId = state.manifest.source_id;- if (rest.includes('--adopt')) {- const { adoptConnection } = await import('../core/bootstrap/adopt-connection.ts');- const adopted = adoptConnection(ws, home, harness, flagValue(rest, '--name') ?? undefined);- for (const line of adopted.lines) (adopted.code === 0 ? console.log : console.error)(line);- return adopted.code;- }// WP8: the interview's declared audience becomes the machine-local// brain.audience declaration (file mirror; the classifier and the harness@@ -2093,7 +2099,7 @@ export async function runBootstrap(args: string[], opts: RunBootstrapOpts = {}):code = await runRepo(ws, rest, home, runner);break;case 'hooks':- code = await runHooks(ws, rest, home, runner, opts.probeSpawn);+ code = rest.includes('--adopt') ? await runAdoptHooks(ws, rest, home) : await runHooks(ws, rest, home, runner, opts.probeSpawn);break;case 'verify':code = await runVerify(ws, rest, home);diff --git a/src/core/persistence/activation.ts b/src/core/persistence/activation.tsindex f2d55f7d2c..ba7ecadf7e 100644--- a/src/core/persistence/activation.ts+++ b/src/core/persistence/activation.ts@@ -33,12 +33,14 @@ export interface ActivationReport {git_durability?: Array<{ source_id: string; state: 'on' | 'off' | 'unknown'; enable_command: string | null }>;/** #5514: `activated: false` with `enabled: true` says why, so a no-op is not read as a silent failure. */reason?: 'already_enabled';- next_action?: string;+ why?: string;+ fix?: Action;}/** #5514: the brain was managed before the command ran; activation changes nothing and cannot start an owner process. */-const ALREADY_ENABLED = { reason: 'already_enabled', next_action: 'Managed persistence was already enabled before this command, so nothing changed. '+const ALREADY_ENABLED = { reason: 'already_enabled', why: 'Managed persistence was already enabled before this command, so nothing changed. '+ 'If writes are accepted but never published (writer status shows ingress not_running or a null heartbeat), no owner process is running: '- + 'start the owner process (`gbrain serve`, or the autopilot) on the owner host, then check `gbrain sources writer status --probe --json`.' } as const;+ + 'start the owner process (`gbrain serve`, or the autopilot) on the owner host, then check writer status again.',+ fix: readFix('Shows the owner process, its ingress and heartbeat, read-only.', { argv: ['gbrain', 'sources', 'writer', 'status', '--probe', '--json'] }) } as const;const gitDurabilityListing = (bindings: WorktreeBinding[]): NonNullable<ActivationReport['git_durability']> => bindings.map(binding => {const state = gitDurabilityState(binding);return { source_id: binding.source_id, state, enable_command: state === 'on' ? null : `gbrain sources writer git-durability ${binding.source_id} --enable --dry-run` };diff --git a/src/core/persistence/git-durability-administration.ts b/src/core/persistence/git-durability-administration.tsindex 9d7daf82f4..5501661959 100644--- a/src/core/persistence/git-durability-administration.ts+++ b/src/core/persistence/git-durability-administration.ts@@ -233,8 +233,12 @@ export async function runGitDurabilityAdministration(engine: BrainEngine, paramsreport.catch_up = { planned: plan.length, paths: plan.slice(0, 50).map(effect => effect.relative_path) };if (input.dryRun) {const state = await writerAdminState(engine);- return { ...report, queued_catch_up: 0, next_action: before === target && !token ? 'The setting is already as requested; nothing to apply.'- : `Review this preview, then apply with: gbrain sources writer git-durability ${input.sourceId}${input.enable ? ' --enable' : input.disable ? ' --disable' : ''}${input.patFile ? ` --pat-file ${input.patFile}` : ''} --admin-intent writer_git_durability --expected-state ${state}` };+ if (before === target && !token) return { ...report, queued_catch_up: 0, why: 'The setting is already as requested; nothing to apply.' };+ return { ...report, queued_catch_up: 0, why: 'Review this preview, then run the apply command; it records the setting on this host\'s binding and re-queues the listed effects.',+ fix: { argv: ['gbrain', 'sources', 'writer', 'git-durability', input.sourceId, ...(input.enable ? ['--enable'] : input.disable ? ['--disable'] : []),+ ...(input.patFile ? ['--pat-file', input.patFile] : []), '--admin-intent', 'writer_git_durability', '--expected-state', state],+ consent: token ? ['credentials'] : [], actor: 'agent', requires_exclusive: false, why: 'Applies the previewed Git durability change on the owner host.',+ verify: { argv: ['gbrain', 'sources', 'writer', 'status', input.sourceId, '--json'] } } };}const expectedState = await requireWriterAdminIntent(engine, 'writer_git_durability', params);const queued = await engine.transaction(async tx => {@@ -246,8 +250,8 @@ export async function runGitDurabilityAdministration(engine: BrainEngine, params`Source ${input.sourceId}'s host binding was removed by another topology change, so nothing was recorded. Inspect writer status before trying again.`, { fix: statusFix(input.sourceId) });return target === 'enabled' ? await requeueGitDurabilityCatchUp(tx, binding, plan.map(effect => effect.id)) : [];});- return { ...report, applied: true, queued_catch_up: queued.length,- next_action: target === 'enabled' ? `Page writes to ${input.sourceId} now commit (and push to ${checkout?.remote ?? 'no tracking remote: commits stay local'}) through the persistence owner's Git effect; ${queued.length} earlier skipped effect(s) were re-queued. Check with gbrain sources writer status ${input.sourceId} --json.`+ return { ...report, applied: true, queued_catch_up: queued.length, fix: statusFix(input.sourceId),+ why: target === 'enabled' ? `Page writes to ${input.sourceId} now commit (and push to ${checkout?.remote ?? 'no tracking remote: commits stay local'}) through the persistence owner's Git effect; ${queued.length} earlier skipped effect(s) were re-queued.`: target === 'disabled' ? `Git effects for ${input.sourceId} now complete as skipped (durability_not_enabled) even where a legacy hook exists; database writes are unaffected. Re-enable with --enable; the skipped effects are caught up then.`: `The push credential was re-wired; ${report.parked_pushes ? (report.parked_pushes as { queued: number }).queued : 0} parked push(es) got one more attempt.` };}diff --git a/test/fixtures/goldens/catalog/postgres-db-initschema.json b/test/fixtures/goldens/catalog/postgres-db-initschema.jsonindex 82a0863b19..92653db464 100644--- a/test/fixtures/goldens/catalog/postgres-db-initschema.json+++ b/test/fixtures/goldens/catalog/postgres-db-initschema.json@@ -181,6 +181,7 @@"persistence_effects.persistence_effects_request_id_fkey": "f FOREIGN KEY (request_id) REFERENCES persistence_requests(id)","persistence_effects.persistence_effects_request_id_kind_key": "u UNIQUE (request_id, kind)","persistence_effects.persistence_effects_state_check": "c CHECK ((state = ANY (ARRAY['queued'::text, 'running'::text, 'committed'::text, 'failed'::text])))",+ "persistence_host_bindings.persistence_host_bindings_git_durability_check": "c CHECK ((git_durability = ANY (ARRAY['enabled'::text, 'disabled'::text])))","persistence_host_bindings.persistence_host_bindings_pkey": "p PRIMARY KEY (worktree_id, host_id)","persistence_host_bindings.persistence_host_bindings_worktree_id_fkey": "f FOREIGN KEY (worktree_id) REFERENCES persistence_worktrees(id)","persistence_local_writers.persistence_local_writers_credential_hash_key": "u UNIQUE (credential_hash)",@@ -2035,7 +2036,8 @@"1 worktree_id uuid/uuid NOT NULL","2 host_id uuid/uuid NOT NULL","3 local_path text/text NOT NULL",- "4 coordination_path text/text NOT NULL"+ "4 coordination_path text/text NOT NULL",+ "5 git_durability text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.jsonindex 5d4182e0ba..fc6268f91e 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json@@ -257,6 +257,7 @@"persistence_graduation.persistence_graduation_singleton_check": "c CHECK ((singleton = 1))","persistence_graduation.persistence_graduation_state_check": "c CHECK ((state = ANY (ARRAY['quiesced'::text, 'cutover'::text, 'rolled_back'::text, 'copying'::text, 'verifying'::text, 'verified'::text, 'authoritative'::text, 'verify_failed'::text, 'rollback_fenced'::text, 'rollback_approved'::text, 'source_restoring'::text, 'abandoned'::text])))","persistence_graduation.persistence_graduation_trigger_bypass_check": "c CHECK (((trigger_bypass IS NULL) OR (trigger_bypass = ANY (ARRAY['session_replication_role'::text, 'disable_trigger'::text]))))",+ "persistence_host_bindings.persistence_host_bindings_git_durability_check": "c CHECK ((git_durability = ANY (ARRAY['enabled'::text, 'disabled'::text])))","persistence_host_bindings.persistence_host_bindings_pkey": "p PRIMARY KEY (worktree_id, host_id)","persistence_host_bindings.persistence_host_bindings_worktree_id_fkey": "f FOREIGN KEY (worktree_id) REFERENCES persistence_worktrees(id)","persistence_local_writers.persistence_local_writers_credential_hash_key": "u UNIQUE (credential_hash)",@@ -2734,7 +2735,8 @@"1 worktree_id uuid/uuid NOT NULL","2 host_id uuid/uuid NOT NULL","3 local_path text/text NOT NULL",- "4 coordination_path text/text NOT NULL"+ "4 coordination_path text/text NOT NULL",+ "5 git_durability text/text NULL"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.jsonindex 9d3449d39a..755f1373c6 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json@@ -257,6 +257,7 @@"persistence_graduation.persistence_graduation_singleton_check": "c CHECK ((singleton = 1))","persistence_graduation.persistence_graduation_state_check": "c CHECK ((state = ANY (ARRAY['quiesced'::text, 'cutover'::text, 'rolled_back'::text, 'copying'::text, 'verifying'::text, 'verified'::text, 'authoritative'::text, 'verify_failed'::text, 'rollback_fenced'::text, 'rollback_approved'::text, 'source_restoring'::text, 'abandoned'::text])))","persistence_graduation.persistence_graduation_trigger_bypass_check": "c CHECK (((trigger_bypass IS NULL) OR (trigger_bypass = ANY (ARRAY['session_replication_role'::text, 'disable_trigger'::text]))))",+ "persistence_host_bindings.persistence_host_bindings_git_durability_check": "c CHECK ((git_durability = ANY (ARRAY['enabled'::text, 'disabled'::text])))","persistence_host_bindings.persistence_host_bindings_pkey": "p PRIMARY KEY (worktree_id, host_id)","persistence_host_bindings.persistence_host_bindings_worktree_id_fkey": "f FOREIGN KEY (worktree_id) REFERENCES persistence_worktrees(id)","persistence_local_writers.persistence_local_writers_credential_hash_key": "u UNIQUE (credential_hash)",@@ -2734,7 +2735,8 @@"1 worktree_id uuid/uuid NOT NULL","2 host_id uuid/uuid NOT NULL","3 local_path text/text NOT NULL",- "4 coordination_path text/text NOT NULL"+ "4 coordination_path text/text NOT NULL",+ "5 git_durability text/text NULL"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.jsonindex 423b644953..17f50dd83a 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json@@ -257,6 +257,7 @@"persistence_graduation.persistence_graduation_singleton_check": "c CHECK ((singleton = 1))","persistence_graduation.persistence_graduation_state_check": "c CHECK ((state = ANY (ARRAY['quiesced'::text, 'cutover'::text, 'rolled_back'::text, 'copying'::text, 'verifying'::text, 'verified'::text, 'authoritative'::text, 'verify_failed'::text, 'rollback_fenced'::text, 'rollback_approved'::text, 'source_restoring'::text, 'abandoned'::text])))","persistence_graduation.persistence_graduation_trigger_bypass_check": "c CHECK (((trigger_bypass IS NULL) OR (trigger_bypass = ANY (ARRAY['session_replication_role'::text, 'disable_trigger'::text]))))",+ "persistence_host_bindings.persistence_host_bindings_git_durability_check": "c CHECK ((git_durability = ANY (ARRAY['enabled'::text, 'disabled'::text])))","persistence_host_bindings.persistence_host_bindings_pkey": "p PRIMARY KEY (worktree_id, host_id)","persistence_host_bindings.persistence_host_bindings_worktree_id_fkey": "f FOREIGN KEY (worktree_id) REFERENCES persistence_worktrees(id)","persistence_local_writers.persistence_local_writers_credential_hash_key": "u UNIQUE (credential_hash)",@@ -2730,7 +2731,8 @@"1 worktree_id uuid/uuid NOT NULL","2 host_id uuid/uuid NOT NULL","3 local_path text/text NOT NULL",- "4 coordination_path text/text NOT NULL"+ "4 coordination_path text/text NOT NULL",+ "5 git_durability text/text NULL"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex 0f55a1a67b..8c78500070 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -514,7 +514,7 @@},{"category": "meta",- "message": "1072 column(s) verified against live schema",+ "message": "1073 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -904,6 +904,17 @@"name": "orphan_persistence_bindings","status": "ok"},+ {+ "category": "brain",+ "details": {+ "count": 0,+ "docs": "docs/guides/write-refusals.md#foreign-ownership-marker",+ "markers": []+ },+ "message": "Every ownership marker beside a source checkout belongs to this brain.",+ "name": "foreign_ownership_marker",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/persistence-activation.test.ts b/test/persistence-activation.test.tsindex 59d7108708..c29cfa752e 100644--- a/test/persistence-activation.test.ts+++ b/test/persistence-activation.test.ts@@ -88,8 +88,8 @@ test('activation fsyncs source and selected datastore refusal records before bec// #5514: a second activation says why it changed nothing and where the missing owner process is.const again = await activatePersistence(engine, { confirmQuiesced: true });expect(again).toMatchObject({ enabled: true, activated: false, reason: 'already_enabled' });- expect(again.next_action).toContain('gbrain serve');- expect(again.next_action).toContain('writer status --probe');+ expect(again.why).toContain('gbrain serve');+ expect(again.fix?.argv).toEqual(['gbrain', 'sources', 'writer', 'status', '--probe', '--json']);expect(await activatePersistence(engine, { confirmQuiesced: true, expectedState: (await reviewedWriterIntent(engine, "writer_activate")).expected_state })).toMatchObject({ enabled: true, activated: false, reason: "already_enabled" });const later = join(home, 'later-canonical'); mkdirSync(later);await claimWorktree(engine, `${sourceId}-later`, later);diff --git a/test/persistence-admin-git-durability.test.ts b/test/persistence-admin-git-durability.test.tsindex 7cc92fbde7..0c661d7c5e 100644--- a/test/persistence-admin-git-durability.test.ts+++ b/test/persistence-admin-git-durability.test.ts@@ -195,7 +195,7 @@ describe('[R7ii] writer git-durability verb', () => {const preview = await runPersistenceAdministration(engine, 'writer_git_durability', { source_id: sourceId, enable: true, dry_run: true });expect(preview).toMatchObject({ dry_run: true, git_durability: { before: null, after: 'enabled' }, current_policy: { durable: false, source: 'no_hook' },branch: 'main', tracking_remote: 'origin', push_probe: { ok: true }, catch_up: { planned: 2 }, queued_catch_up: 0 });- expect(String(preview.next_action)).toContain('--admin-intent writer_git_durability --expected-state ');+ expect((preview.fix as { argv: string[] }).argv.join(' ')).toContain('--admin-intent writer_git_durability --expected-state ');expect((await getWorktreeBinding(engine, sourceId, localHostId()))!.git_durability).toBeNull();expect((await planGitDurabilityCatchUp(engine, (await getWorktreeBinding(engine, sourceId, localHostId()))!)).map(effect => effect.relative_path).sort()).toEqual(['alpha.md', 'beta.md']);@@ -224,7 +224,7 @@ describe('[R7ii] writer git-durability verb', () => {expect(await gitAsync(root, 'ls-tree', '--name-only', 'origin/main')).toContain('beta.md');// Enabling again plans nothing: the caught-up effects are no longer skipped.const again = await runPersistenceAdministration(engine, 'writer_git_durability', { source_id: sourceId, enable: true, dry_run: true });- expect(again).toMatchObject({ catch_up: { planned: 0 }, next_action: expect.stringContaining('already as requested') });+ expect(again).toMatchObject({ catch_up: { planned: 0 }, why: expect.stringContaining('already as requested') });}), 120_000);test('--disable wins over a legacy hook: the next Git effect completes as skipped; --pat-file refuses a readable token file first', () => isolated(async home => {