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:
34
src/services/storyEngine/narrativeTelemetry.test.ts
Normal file
34
src/services/storyEngine/narrativeTelemetry.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { buildTelemetrySnapshot, captureNarrativeTelemetry } from './narrativeTelemetry';
|
||||
|
||||
describe('narrativeTelemetry', () => {
|
||||
it('builds telemetry snapshots and summaries', () => {
|
||||
const snapshot = buildTelemetrySnapshot({
|
||||
memory: {
|
||||
activeThreadIds: ['a', 'b'],
|
||||
recentCompanionReactions: [{}, {}],
|
||||
endingState: { id: 'ending-1' },
|
||||
} as never,
|
||||
qaReport: {
|
||||
generatedAt: new Date().toISOString(),
|
||||
issues: [{ id: 'issue-1', severity: 'medium', category: 'payoff', summary: 'missing', relatedIds: [] }],
|
||||
summary: '1 issue',
|
||||
},
|
||||
});
|
||||
|
||||
expect(snapshot.averageActiveThreadCount).toBe(2);
|
||||
expect(captureNarrativeTelemetry({
|
||||
memory: {
|
||||
activeThreadIds: ['a', 'b'],
|
||||
recentCompanionReactions: [{}, {}],
|
||||
endingState: { id: 'ending-1' },
|
||||
} as never,
|
||||
qaReport: {
|
||||
generatedAt: new Date().toISOString(),
|
||||
issues: [{ id: 'issue-1', severity: 'medium', category: 'payoff', summary: 'missing', relatedIds: [] }],
|
||||
summary: '1 issue',
|
||||
},
|
||||
}).summary).toContain('平均活跃线程');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user