Files
portal/tools/judge-prompt-memory.test.mjs
T

21 lines
1.1 KiB
JavaScript

import { describe, it, expect } from 'vitest';
import { buildJudgePrompt } from './judge-engine.mjs';
describe('buildJudgePrompt round-memory', () => {
it('круг 1 (нет prior) → нет блока памяти (слеп)', () => {
const { user } = buildJudgePrompt({ functionName: 'gate2', goal: 'g', product: {}, cards: [] });
expect(user).not.toContain('ТВОИ ПРОШЛЫЕ ПРЕТЕНЗИИ');
});
it('круг 2 → дословная претензия + позиция контроллера + анти-самопротиворечие', () => {
const { user } = buildJudgePrompt({
functionName: 'gate2', goal: 'g', product: {}, cards: [],
priorObjections: ['нет карточки X'],
controllerResponses: [{ round: 1, position: 'карточка добавлена в тело плана' }],
});
expect(user).toContain('ТВОИ ПРОШЛЫЕ ПРЕТЕНЗИИ');
expect(user).toContain('нет карточки X');
expect(user).toContain('карточка добавлена в тело плана');
expect(user).toContain('НЕ противоречь себе');
});
});