diff --git a/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts b/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts index 9f2e5df8a1..889b8ecd3f 100644 --- a/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts +++ b/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts @@ -478,6 +478,10 @@ describe('SqliteSessionMetadataStore', () => { let rejectedRequestId: string | undefined; try { await store.create(fullHeader()); + // Each request stays near MAX_SANDBOX_BOUNDARY_SERIALIZED_BYTES so the + // cumulative boundary crosses capacity in the fewest settles, using few + // near-MAX_SANDBOX_BOUNDARY_PATH_CHARS entries to keep the per-settle + // boundary scans cheap. for (let request = 0; request < 30; request += 1) { const requestId = `capacity-${request}`; await store.createSandboxBoundaryRequest({ @@ -486,8 +490,8 @@ describe('SqliteSessionMetadataStore', () => { turnId: 'turn-1', expansion: { filesystem: { - entries: Array.from({ length: 32 }, (_, entry) => ({ - path: `/outside/${request}/${entry}-${'x'.repeat(1_800)}`, + entries: Array.from({ length: 15 }, (_, entry) => ({ + path: `/outside/${request}/${entry}-${'x'.repeat(4_000)}`, access: 'read' as const, scope: 'exact' as const, })), diff --git a/packages/storage/src/__tests__/sqlite-workflow-store.test.ts b/packages/storage/src/__tests__/sqlite-workflow-store.test.ts index 3fd1f00d24..bfd1f4a3cf 100644 --- a/packages/storage/src/__tests__/sqlite-workflow-store.test.ts +++ b/packages/storage/src/__tests__/sqlite-workflow-store.test.ts @@ -414,11 +414,16 @@ describe('SQLite workflow stores', () => { function seedLegacyPlanLedger(root: string, eventCount = 3): void { const lease = acquireOperationalStateDatabase(root); try { - const steps = Array.from({ length: 50 }, (_, index) => ({ + // Each dimension exceeds its projection bound by just enough to force + // truncation: 51 files > PLAN_MAX_FILES_PER_STEP, 21 risks > + // PLAN_MAX_RISKS, 31 title chars > PLAN_STEP_TITLE_MAX_CHARS, and four + // 4_000-byte descriptions oversubscribe PLAN_PROJECTION_ITEM_MAX_BYTES so + // the shared text budget must settle below 4_000 bytes. + const steps = Array.from({ length: 4 }, (_, index) => ({ id: `legacy step ${index}`, - title: '"'.repeat(100), + title: '"'.repeat(31), description: '"'.repeat(4_000), - files: Array.from({ length: 60 }, () => '"'.repeat(100)), + files: Array.from({ length: 51 }, () => '"'.repeat(100)), })); const proposal = { planId: 'legacy-plan', @@ -428,7 +433,7 @@ function seedLegacyPlanLedger(root: string, eventCount = 3): void { revision: 1, title: '"'.repeat(16 * 1024), steps, - risks: Array.from({ length: 25 }, (_, index) => `Legacy risk ${index}`), + risks: Array.from({ length: 21 }, (_, index) => `Legacy risk ${index}`), status: 'pending_approval', submittedAt: 1, };