Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(errors): company ingestion storage refusal lists pending migrations instead of inviting a bare --yes; lower B10 baselines

garrytan399889d2d30c
diff --git a/scripts/agent-contract-baselines/suggestionless-operation-error.tsv b/scripts/agent-contract-baselines/suggestionless-operation-error.tsv
index ba156598de..79aac39de1 100644
--- a/scripts/agent-contract-baselines/suggestionless-operation-error.tsv
+++ b/scripts/agent-contract-baselines/suggestionless-operation-error.tsv
@@ -2,29 +2,23 @@
src/cli.ts 3
src/commands/book-mirror.ts 1
src/commands/capture.ts 4
-src/commands/company-brain-connect.ts 15
src/commands/company-brain-inspect.ts 8
src/commands/embed-facts-delegate.ts 5
src/commands/extract-stale-delegate.ts 4
src/commands/extract-timeline-db.ts 2
-src/commands/google-attachments.ts 11
src/commands/persistence-admin.ts 11
src/commands/recall.ts 3
src/commands/reindex-code-delegate.ts 5
src/commands/repair.ts 6
-src/commands/source-reconcile.ts 29
src/commands/sources-lifecycle-args.ts 1
src/commands/sources-lifecycle.ts 2
src/commands/sync-persistence-delegate.ts 4
src/commands/takes-mutation.ts 1
-src/core/company-brain/admission.ts 20
src/core/company-brain/demo.ts 5
src/core/company-brain/inspection.ts 8
src/core/company-brain/policy.ts 2
src/core/company-brain/profile.ts 7
src/core/company-brain/receipts.ts 1
-src/core/company-brain/revision.ts 21
-src/core/company-brain/runtime.ts 16
src/core/cycle/phantom-redirect-managed.ts 3
src/core/cycle/synthesize-postprocess.ts 4
src/core/embed-backfill-submit.ts 1
@@ -32,8 +26,6 @@ src/core/embed-facts-options.ts 1
src/core/embed-facts.ts 2
src/core/facts/backstop.ts 1
src/core/facts/proposal-supersede.ts 4
-src/core/facts/relink-publish.ts 8
-src/core/google/attachment-backfill.ts 7
src/core/harness/native-router.ts 1
src/core/harness/shared-skills.ts 2
src/core/minions/submission-authority.ts 1
@@ -41,14 +33,11 @@ src/core/minions/tool-write-identity.ts 1
src/core/page-state/import-guard.ts 1
src/core/persistence/activation.ts 5
src/core/persistence/administration.ts 4
-src/core/persistence/atom-maintenance.ts 23
src/core/persistence/atom-retry.ts 8
src/core/persistence/authority.ts 1
src/core/persistence/bundle-files.ts 8
src/core/persistence/canonical-projections.ts 3
src/core/persistence/checkpoint-validation.ts 1
-src/core/persistence/connector-google-receipts.ts 10
-src/core/persistence/connector-sync.ts 39
src/core/persistence/context.ts 1
src/core/persistence/control.ts 1
src/core/persistence/coordinator.ts 16
@@ -62,15 +51,12 @@ src/core/persistence/effect-journal.ts 1
src/core/persistence/effect-recovery.ts 11
src/core/persistence/effect-retry.ts 12
src/core/persistence/effect-targets.ts 2
-src/core/persistence/effects.ts 22
src/core/persistence/embed-facts-administration.ts 2
src/core/persistence/embedding-settlement.ts 1
-src/core/persistence/facts-maintenance.ts 19
src/core/persistence/facts-prepare.ts 13
src/core/persistence/grandfather.ts 6
src/core/persistence/identity.ts 9
src/core/persistence/import-mutations.ts 2
-src/core/persistence/import-prepare.ts 21
src/core/persistence/ipc.ts 9
src/core/persistence/journal.ts 8
src/core/persistence/limits.ts 1
@@ -79,41 +65,29 @@ src/core/persistence/loop-fact-retirement.ts 4
src/core/persistence/managed-sources.ts 5
src/core/persistence/memory-mutations.ts 4
src/core/persistence/memory-prepare.ts 4
-src/core/persistence/ownership.ts 20
src/core/persistence/page-mutations.ts 6
src/core/persistence/page-prepare.ts 11
src/core/persistence/page-visibility.ts 1
-src/core/persistence/prepared-maintenance.ts 26
src/core/persistence/projection-reindex.ts 7
src/core/persistence/protected-takes.ts 2
src/core/persistence/protocol.ts 1
src/core/persistence/provider.ts 3
-src/core/persistence/reconcile-audit.ts 12
-src/core/persistence/reconcile-backup.ts 17
-src/core/persistence/reconcile-merge.ts 13
src/core/persistence/reconcile-prepare.ts 7
-src/core/persistence/reconcile-state.ts 11
-src/core/persistence/reconcile.ts 10
src/core/persistence/reindex-administration.ts 3
src/core/persistence/root-registry.ts 2
src/core/persistence/semantic-pages.ts 3
src/core/persistence/service.ts 5
src/core/persistence/skill-activation.ts 1
-src/core/persistence/source-lifecycle.ts 25
src/core/persistence/staging.ts 2
src/core/persistence/sync-administration.ts 1
src/core/persistence/sync-authority.ts 7
-src/core/persistence/sync-discovery.ts 19
src/core/persistence/sync-origin.ts 3
-src/core/persistence/sync-prepare.ts 31
src/core/persistence/sync-run.ts 8
src/core/persistence/sync-wire.ts 1
src/core/persistence/takes-prepare.ts 8
-src/core/persistence/topology-clone.ts 19
src/core/persistence/topology-filesystem.ts 5
src/core/persistence/topology-locks.ts 9
src/core/persistence/topology-receipts.ts 6
-src/core/persistence/topology-recovery.ts 19
src/core/persistence/unbound-source.ts 1
src/core/persistence/worktree-refresh.ts 5
src/core/repair/captured-facts.ts 1
@@ -126,7 +100,6 @@ src/core/shared-skills/membership-authority.ts 1
src/core/shared-skills/membership.ts 1
src/core/shared-skills/migration-projection.ts 2
src/core/shared-skills/setup-source-policy.ts 2
-src/core/skillpack/brain-resident-locate.ts 12
src/core/skillpack/writer-guard.ts 1
src/core/source-local-reference-index.ts 2
src/mcp/dispatch.ts 1
diff --git a/src/core/company-brain/admission.ts b/src/core/company-brain/admission.ts
index 1f3e6ceccc..5c058a9a30 100644
--- a/src/core/company-brain/admission.ts
+++ b/src/core/company-brain/admission.ts
@@ -117,8 +117,11 @@ async function assertIngestionStorage(engine: BrainEngine): Promise<void> {
const [storage] = await engine.executeRaw<{ receipts: string | null; persistence: string | null; policy: boolean }>(
`SELECT to_regclass('source_ingestion_receipts')::text AS receipts,to_regclass('persistence_brain')::text AS persistence,
EXISTS(SELECT 1 FROM information_schema.columns WHERE table_schema=current_schema() AND table_name='source_ingestion_receipts' AND column_name='policy_fingerprint') AS policy`);
- if (!storage?.receipts || !storage.persistence || !storage.policy) throw new OperationError('destination_not_ready', 'The selected brain needs company ingestion migration 162 with immutable policy receipts.',
- 'Run gbrain apply-migrations --yes against the explicitly selected brain, then preview again.');
+ if (!storage?.receipts || !storage.persistence || !storage.policy) {
+ throw opError('destination_not_ready', 'The selected brain needs company ingestion migration 162 with immutable policy receipts.',
+ 'The selected brain has pending schema migrations. List them with the command in fix, ask the user to approve applying them to that brain, then preview again.',
+ { fix: { argv: ['gbrain', 'apply-migrations', '--dry-run', '--json'], consent: [], actor: 'agent', why: 'Lists the pending migrations without applying them.', requires_exclusive: false } });
+ }
}
function admissionConfig(input: CompanyBrainConnectInput, requestId: string, databaseId: string) {