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.tsvindex 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 3src/commands/book-mirror.ts 1src/commands/capture.ts 4-src/commands/company-brain-connect.ts 15src/commands/company-brain-inspect.ts 8src/commands/embed-facts-delegate.ts 5src/commands/extract-stale-delegate.ts 4src/commands/extract-timeline-db.ts 2-src/commands/google-attachments.ts 11src/commands/persistence-admin.ts 11src/commands/recall.ts 3src/commands/reindex-code-delegate.ts 5src/commands/repair.ts 6-src/commands/source-reconcile.ts 29src/commands/sources-lifecycle-args.ts 1src/commands/sources-lifecycle.ts 2src/commands/sync-persistence-delegate.ts 4src/commands/takes-mutation.ts 1-src/core/company-brain/admission.ts 20src/core/company-brain/demo.ts 5src/core/company-brain/inspection.ts 8src/core/company-brain/policy.ts 2src/core/company-brain/profile.ts 7src/core/company-brain/receipts.ts 1-src/core/company-brain/revision.ts 21-src/core/company-brain/runtime.ts 16src/core/cycle/phantom-redirect-managed.ts 3src/core/cycle/synthesize-postprocess.ts 4src/core/embed-backfill-submit.ts 1@@ -32,8 +26,6 @@ src/core/embed-facts-options.ts 1src/core/embed-facts.ts 2src/core/facts/backstop.ts 1src/core/facts/proposal-supersede.ts 4-src/core/facts/relink-publish.ts 8-src/core/google/attachment-backfill.ts 7src/core/harness/native-router.ts 1src/core/harness/shared-skills.ts 2src/core/minions/submission-authority.ts 1@@ -41,14 +33,11 @@ src/core/minions/tool-write-identity.ts 1src/core/page-state/import-guard.ts 1src/core/persistence/activation.ts 5src/core/persistence/administration.ts 4-src/core/persistence/atom-maintenance.ts 23src/core/persistence/atom-retry.ts 8src/core/persistence/authority.ts 1src/core/persistence/bundle-files.ts 8src/core/persistence/canonical-projections.ts 3src/core/persistence/checkpoint-validation.ts 1-src/core/persistence/connector-google-receipts.ts 10-src/core/persistence/connector-sync.ts 39src/core/persistence/context.ts 1src/core/persistence/control.ts 1src/core/persistence/coordinator.ts 16@@ -62,15 +51,12 @@ src/core/persistence/effect-journal.ts 1src/core/persistence/effect-recovery.ts 11src/core/persistence/effect-retry.ts 12src/core/persistence/effect-targets.ts 2-src/core/persistence/effects.ts 22src/core/persistence/embed-facts-administration.ts 2src/core/persistence/embedding-settlement.ts 1-src/core/persistence/facts-maintenance.ts 19src/core/persistence/facts-prepare.ts 13src/core/persistence/grandfather.ts 6src/core/persistence/identity.ts 9src/core/persistence/import-mutations.ts 2-src/core/persistence/import-prepare.ts 21src/core/persistence/ipc.ts 9src/core/persistence/journal.ts 8src/core/persistence/limits.ts 1@@ -79,41 +65,29 @@ src/core/persistence/loop-fact-retirement.ts 4src/core/persistence/managed-sources.ts 5src/core/persistence/memory-mutations.ts 4src/core/persistence/memory-prepare.ts 4-src/core/persistence/ownership.ts 20src/core/persistence/page-mutations.ts 6src/core/persistence/page-prepare.ts 11src/core/persistence/page-visibility.ts 1-src/core/persistence/prepared-maintenance.ts 26src/core/persistence/projection-reindex.ts 7src/core/persistence/protected-takes.ts 2src/core/persistence/protocol.ts 1src/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 13src/core/persistence/reconcile-prepare.ts 7-src/core/persistence/reconcile-state.ts 11-src/core/persistence/reconcile.ts 10src/core/persistence/reindex-administration.ts 3src/core/persistence/root-registry.ts 2src/core/persistence/semantic-pages.ts 3src/core/persistence/service.ts 5src/core/persistence/skill-activation.ts 1-src/core/persistence/source-lifecycle.ts 25src/core/persistence/staging.ts 2src/core/persistence/sync-administration.ts 1src/core/persistence/sync-authority.ts 7-src/core/persistence/sync-discovery.ts 19src/core/persistence/sync-origin.ts 3-src/core/persistence/sync-prepare.ts 31src/core/persistence/sync-run.ts 8src/core/persistence/sync-wire.ts 1src/core/persistence/takes-prepare.ts 8-src/core/persistence/topology-clone.ts 19src/core/persistence/topology-filesystem.ts 5src/core/persistence/topology-locks.ts 9src/core/persistence/topology-receipts.ts 6-src/core/persistence/topology-recovery.ts 19src/core/persistence/unbound-source.ts 1src/core/persistence/worktree-refresh.ts 5src/core/repair/captured-facts.ts 1@@ -126,7 +100,6 @@ src/core/shared-skills/membership-authority.ts 1src/core/shared-skills/membership.ts 1src/core/shared-skills/migration-projection.ts 2src/core/shared-skills/setup-source-policy.ts 2-src/core/skillpack/brain-resident-locate.ts 12src/core/skillpack/writer-guard.ts 1src/core/source-local-reference-index.ts 2src/mcp/dispatch.ts 1diff --git a/src/core/company-brain/admission.ts b/src/core/company-brain/admission.tsindex 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) {