Rework story engine flow and reorganize project docs
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
54
src/services/storyEngine/storySimulationRunner.test.ts
Normal file
54
src/services/storyEngine/storySimulationRunner.test.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user