import { buildProjectChronicleGuardContext, ProjectProfile } from '../src/features/projectChronicle'; const profile: ProjectProfile = { projectId: 'connectai', projectName: 'ConnectAI', projectRoot: '/workspace/ConnectAI', recordRoot: '/workspace/ConnectAI/docs/records/ConnectAI', description: 'Local AI assistant', corePurpose: 'Keep project knowledge traceable.', detailLevel: 'standard', createdAt: '2026-05-02T00:00:00.000Z', updatedAt: '2026-05-02T00:00:00.000Z' }; describe('buildProjectChronicleGuardContext', () => { it('requires project checks, question reasons, MVP-first scope, and candidate records', () => { const context = buildProjectChronicleGuardContext(profile); expect(context).toContain('Project selection status: selected'); expect(context).toContain('Short conclusion first'); expect(context).toContain('Brief summary'); expect(context).toContain('Detailed answer'); expect(context).toContain('No Evidence, No Project Claim'); expect(context).toContain('confirmed facts, inferences, general knowledge, and needs verification'); expect(context).toContain('Project record target check'); expect(context).toContain('Record path check'); expect(context).toContain('Question reason'); expect(context).toContain('Recommend a low-dependency MVP first'); expect(context).toContain('Later expansion'); expect(context).toContain('Candidate records for this discussion'); expect(context).toContain('Do not mark a decision as accepted until the user confirms it'); expect(context).toContain('Markdown, JSON, local files'); }); it('handles missing project context explicitly', () => { const context = buildProjectChronicleGuardContext(null); expect(context).toContain('Project selection status: not selected'); expect(context).toContain('existing project, create a new project, or skip recording'); expect(context).toContain('must be described but not written'); }); });