397777089e
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
1.3 KiB
JavaScript
25 lines
1.3 KiB
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import { buildMentorArbitrationMessage } from './enforce-mentor-on-plan-write.mjs';
|
|
|
|
describe('buildMentorArbitrationMessage (wave 7 — mentor escalation → card)', () => {
|
|
it('дословное замечание наставника + позиция контроллера + 3 выбора + L1', () => {
|
|
const msg = buildMentorArbitrationMessage(
|
|
{ ok: false, wired: true, reason: 'шаг 2 склеен', verdict: { decision: 'NO-GO', recommendation: 'разбей шаг 2' } },
|
|
'## Переговоры\n### Круг 3\nШаг 2 атомарен — настаиваю.',
|
|
3,
|
|
);
|
|
expect(msg).toContain('шаг 2 склеен');
|
|
expect(msg).toContain('разбей шаг 2');
|
|
expect(msg).toContain('Шаг 2 атомарен — настаиваю');
|
|
expect(msg).toMatch(/L1/);
|
|
expect(msg).toMatch(/держусь/i);
|
|
expect(msg).toMatch(/согласиться/i);
|
|
expect(msg).toMatch(/своё/i);
|
|
});
|
|
it('нет позиции в плане → плейсхолдер, не падает', () => {
|
|
const msg = buildMentorArbitrationMessage({ ok: false, wired: true, reason: 'X' }, '# План\n', 3);
|
|
expect(msg).toContain('X');
|
|
expect(typeof msg).toBe('string');
|
|
});
|
|
});
|