-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathissue-2652-runtime-wiring-and-output-contract.test.ts
More file actions
27 lines (23 loc) · 1.19 KB
/
issue-2652-runtime-wiring-and-output-contract.test.ts
File metadata and controls
27 lines (23 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { describe, expect, it } from 'vitest';
import { readFileSync } from 'fs';
import { join } from 'path';
import { ULTRAWORK_MESSAGE } from '../installer/hooks.js';
describe('issue #2652 runtime wiring and output contract', () => {
it('ships the Stop hook through persistent-mode.mjs', () => {
const hooksJsonPath = join(process.cwd(), 'hooks', 'hooks.json');
const hooks = JSON.parse(readFileSync(hooksJsonPath, 'utf-8')) as {
hooks?: Record<string, Array<{ hooks?: Array<{ command?: string }> }>>;
};
const stopCommands = (hooks.hooks?.Stop ?? [])
.flatMap((entry) => entry.hooks ?? [])
.map((hook) => hook.command ?? '');
expect(stopCommands.some((command) => command.includes('/scripts/persistent-mode.mjs'))).toBe(true);
expect(stopCommands.some((command) => command.includes('/scripts/persistent-mode.cjs'))).toBe(false);
});
it('ultrawork mode instructs spawned agents to keep outputs concise', () => {
expect(ULTRAWORK_MESSAGE).toContain('CONCISE OUTPUTS');
expect(ULTRAWORK_MESSAGE).toContain('under 100 words');
expect(ULTRAWORK_MESSAGE).toContain('files touched');
expect(ULTRAWORK_MESSAGE).toContain('verification status');
});
});