import { strict as assert } from 'node:assert'; import { describe, it } from 'node:test'; import type { Database } from '@pig/db'; import { createInteractivePigTools } from '../src/chat-tools'; describe('interactive lifecycle tool boundary', () => { it('exposes deterministic lifecycle context only for the account in focus', () => { const accountTools = createInteractivePigTools({} as Database, { type: 'account', id: '10000000-0000-4000-8000-000000000001', }); const contractTools = createInteractivePigTools({} as Database, { type: 'contract', id: '20000000-0000-4000-8000-000000000001', }); assert.deepEqual(accountTools.map((tool) => tool.name), ['pig_get_record', 'pig_get_account_lifecycle']); assert.equal(contractTools.some((tool) => tool.name === 'pig_get_account_lifecycle'), false); }); });