Files
Genarrative/src/services/storyEngine/narrativeRegressionRerun.ts
2026-05-08 11:44:42 +08:00

30 lines
668 B
TypeScript

import type { SimulationRunResult } from '../../types';
export interface NarrativeRerunSeed {
id: string;
seed: string;
label: string;
}
export function recordRerunSeed(params: {
seed: string;
label: string;
}) {
return {
id: `rerun-seed:${params.seed}`,
seed: params.seed,
label: params.label,
} satisfies NarrativeRerunSeed;
}
export function rerunNarrativeSimulation(params: {
recordedSeed: NarrativeRerunSeed;
result: SimulationRunResult;
}) {
return {
rerunId: `rerun:${params.recordedSeed.id}`,
seed: params.recordedSeed.seed,
summary: `${params.recordedSeed.label} 复测结果:${params.result.summary}`,
};
}