abf2060328
Сессионный флаг standby-mode + управляющий UserPromptSubmit-хук рукопожатия + SessionStart-сброс. Страж if standbyActive в 12 блокирующих хуках; рельсы floor/snapshot/verify-gate не тронуты. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
1.4 KiB
JavaScript
24 lines
1.4 KiB
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import { decideControl } from './standby-mode-control.mjs';
|
|
|
|
describe('decideControl — переходы штатного режима', () => {
|
|
it('«штатный режим» без active/pending → pending (переспрос)', () => {
|
|
expect(decideControl({ text: 'перейди в штатный режим', active: false, pending: false }).action).toBe('pending');
|
|
});
|
|
it('«да, штатный» при pending → enable', () => {
|
|
expect(decideControl({ text: 'да, штатный', active: false, pending: true }).action).toBe('enable');
|
|
});
|
|
it('«да, штатный» без pending → НЕ enable (двухтактное рукопожатие)', () => {
|
|
expect(decideControl({ text: 'да, штатный', active: false, pending: false }).action).not.toBe('enable');
|
|
});
|
|
it('«выключи штатный» → disable', () => {
|
|
expect(decideControl({ text: 'выключи штатный', active: true, pending: false }).action).toBe('disable');
|
|
});
|
|
it('активен, обычный промпт → banner', () => {
|
|
expect(decideControl({ text: 'что по задаче', active: true, pending: false }).action).toBe('banner');
|
|
});
|
|
it('ничего не подходит → none', () => {
|
|
expect(decideControl({ text: 'привет', active: false, pending: false }).action).toBe('none');
|
|
});
|
|
});
|