Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Update three tests that full CI found out of step with the label hold and the new migration
garrytana2cd62b8c083
diff --git a/test/e2e/managed-import-statement-budget.test.ts b/test/e2e/managed-import-statement-budget.test.tsindex 9620f8f2d9..89f45fc2d2 100644--- a/test/e2e/managed-import-statement-budget.test.ts+++ b/test/e2e/managed-import-statement-budget.test.ts@@ -27,8 +27,8 @@ import { byText, chunkOf, CHUNKED, PAGE_SLUG, prepareManagedImport, publicationOimport type { YcShapedPage } from '../helpers/yc-shaped-page.ts';import { withEnv } from '../helpers/with-env.ts';-/** About 10% over the import's own statements in the publication transaction at 1x (#6712 L6 measured 67 on Postgres; 317 before code references were batched); the folded stamp is budgeted apart. GBRA-161 PR 2 adds five for the fact fence generation (its lock, its live read, the generation row, its items in one statement, and the held and attempts clear); on a first import its retire read replaces the expire update. */-const PUBLICATION_BUDGET = 79;+/** About 10% over the import's own statements in the publication transaction at 1x (#6712 L6 measured 67 on Postgres; 317 before code references were batched); the folded stamp is budgeted apart. GBRA-161 PR 2 adds five for the fact fence generation (its lock, its live read, the generation row, its items in one statement, and the held and attempts clear); on a first import its retire read replaces the expire update. GST-2511 adds one: the fence guard's read of the page's live fact rows, which finds a guarded private row a less trusted write would make world. */+const PUBLICATION_BUDGET = 80;/*** #6712 PR 4b: the folded pass stamp, budgeted on its own inside the same transaction (about 10% over 17 measured on* Postgres). A writeback import publishes the source checkpoint here instead of as a separate checkpoint request, so thesediff --git a/test/e2e/member-page-withdrawal-scope-migration.test.ts b/test/e2e/member-page-withdrawal-scope-migration.test.tsindex 7a1ba016f3..07c08ecd3c 100644--- a/test/e2e/member-page-withdrawal-scope-migration.test.ts+++ b/test/e2e/member-page-withdrawal-scope-migration.test.ts@@ -45,8 +45,9 @@ const settled = (results: PromiseSettledResult<unknown>[]) => results.map(r => rconst twoRunners = (a: BrainEngine, b: BrainEngine) => withEnv({ GBRAIN_INITSCHEMA_LOCK_TIMEOUT_SECONDS: '90' }, () =>bounded('both runners', 60_000, Promise.allSettled([runMigrations(a), runMigrations(b)])));-test('the migration is the latest one and is idempotent', () => {- expect(migration.version).toBe(LATEST_VERSION);+test('the migration is registered at 306, no later than the latest, and is idempotent', () => {+ expect(migration.version).toBe(306);+ expect(migration.version).toBeLessThanOrEqual(LATEST_VERSION);expect(migration.idempotent).toBe(true);});diff --git a/test/git-canonical-declared-g7a.test.ts b/test/git-canonical-declared-g7a.test.tsindex 70381c1176..c0115a6ac0 100644--- a/test/git-canonical-declared-g7a.test.ts+++ b/test/git-canonical-declared-g7a.test.ts@@ -27,6 +27,8 @@ import { resetWriteSwitches } from '../src/core/persistence/switches.ts';import { assertStrictGitHome } from '../src/core/persistence/git-declared.ts';import { preparePrivateTransition } from '../src/core/persistence/page-prepare.ts';import { performManagedSync } from '../src/core/persistence/sync-run.ts';+import { decideTrustProposal } from '../src/core/trust/decide.ts';+import { parseTrustProposalRef } from '../src/core/trust/proposals.ts';import { durableGitRepo, git } from './helpers/git-publication.ts';import { managedBrain, settleManagedGitEffects } from './helpers/managed-brain.ts';import { requirePostgresTestDatabase, testBackends } from './helpers/test-backends.ts';@@ -175,7 +177,12 @@ test('Q3: every strict writer is classified when it prepares; a managed import,await performManagedSync(engine, OPTS);expect(await filed()).toEqual({ reason: 'private', source_path: null, withheld: 'concepts/Turning Idea.md' });const before = head(root);- expect(await put(ctx, 'concepts/turning-idea', page('Turning idea', 'World again.'), randomUUID(), turned.revision)).toMatchObject({ state: 'committed' });+ // GST-2518: the synced file was the owner's, so the agent's widening keeps the page private until the owner accepts it.+ const widened = await put(ctx, 'concepts/turning-idea', page('Turning idea', 'World again.'), randomUUID(), turned.revision);+ expect(widened).toMatchObject({ state: 'committed', privacy_labels_kept: { keys: ['visibility'] } });+ expect(await filed()).toEqual({ reason: 'private', source_path: null, withheld: 'concepts/Turning Idea.md' });+ expect(await decideTrustProposal(engine, parseTrustProposalRef(widened.privacy_labels_kept.proposal_ref)!, 'accept', { confirmation: { via: 'tty' } })).toMatchObject({ status: 'accepted' });+ await settleManagedGitEffects(engine);expect(head(root)).not.toBe(before);expect(atHead(root, 'concepts/Turning Idea.md')).toBe('concepts/Turning Idea.md');expect(atHead(root, 'concepts/turning-idea.md')).toBe('');