import { describe, expect, it } from 'vitest'; import { runStorySimulation } from './storySimulationRunner'; describe('storySimulationRunner', () => { it('creates a deterministic simulation result', () => { const result = runStorySimulation({ scenarioPackId: 'scenario-1', campaignPack: { id: 'campaign-1', scenarioPackId: 'scenario-1', title: 'Campaign', authoringStyle: 'classic', campaignStateSeed: { id: 'campaign-state', title: 'Campaign', currentActId: 'act-1', currentActIndex: 0, }, actTemplates: [], requiredCompanionIds: [], }, memory: { activeThreadIds: ['a', 'b'], companionResolutions: [ { characterId: 'archer-hero', resolutionType: 'estranged', summary: '离心', relatedThreadIds: [], }, ], endingState: { id: 'ending-1', title: '结局', endingType: 'heroic', summary: '达成', contributingThreadIds: [], companionResolutions: [], worldOutcomeSummary: '稳定', }, narrativeQaReport: { generatedAt: new Date().toISOString(), issues: [{ id: 'issue-1', severity: 'low', category: 'pacing', summary: 'ok', relatedIds: [] }], summary: '有 1 条 QA 问题', }, } as never, seed: 'baseline', }); expect(result.endingId).toBe('ending-1'); expect(result.issueCount).toBe(1); }); });