diff --git a/test/cookie-validation-phases.test.ts b/test/cookie-validation-phases.test.ts index 0d68b33ff..6fa4170ad 100644 --- a/test/cookie-validation-phases.test.ts +++ b/test/cookie-validation-phases.test.ts @@ -44,10 +44,11 @@ test('the existing quality and behavior phases retain their complete separate sh expect(quality.evalsAll).toBe(true); expect(behavior.evalsAll).toBe(true); expect(qualityFiles).toHaveLength(1); - // 45 files (first-task-scaffold registers no gate case, so the gate lane - // skips it); the seven case-sharded files contribute one shard per gate case. - expect(new Set(behaviorFiles.map(file => file.split('#')[0])).size).toBe(45); - expect(behaviorFiles).toHaveLength(72); + // 50 files, five of them the gate safety-rule evals (first-task-scaffold + // registers no gate case, so the gate lane skips it); the seven case-sharded + // files contribute one shard per gate case. + expect(new Set(behaviorFiles.map(file => file.split('#')[0])).size).toBe(50); + expect(behaviorFiles).toHaveLength(77); expect(behaviorFiles).toEqual(expect.arrayContaining([ ...['review-exploratory-small-cli', 'ship-exploratory-small-cli', 'ship-exploratory-unavailable', 'ship-exploratory-plan-checks', 'ship-exploratory-late-input'].map(id => `test/skill-e2e-qa-callers.test.ts#${id}`), diff --git a/test/outside-voice-preflight.test.ts b/test/outside-voice-preflight.test.ts index 200d2626e..e6c68b343 100644 --- a/test/outside-voice-preflight.test.ts +++ b/test/outside-voice-preflight.test.ts @@ -64,7 +64,10 @@ test('CEO and Eng describe the actual disabled route and completion validator', expect(output.replace(/\s+/g, ' ')).toContain('If preflight selected `disabled`, use the guarded record below'); expect(output).toContain('"outside_status":"disabled"'); } else expect(output).toContain('persist `outside_status: disabled` with the guarded'); - const prompt = output.slice(output.indexOf('"IMPORTANT:'), output.indexOf('\n"')); + const promptEnd = output.indexOf('\n"'); + const prompt = output.slice(output.lastIndexOf('\n"', promptEnd) + 1, promptEnd); + expect(prompt.startsWith('"')).toBe(true); + expect(prompt.split('\n')[0]).toContain('.claude/skills/'); expect(prompt).toContain('End with Recommendation: because '); expect(prompt).toContain('If there are no findings, say so and explain why'); const invocation = outsideVoiceInvocation(ctx); diff --git a/test/run-in-background-guidance.test.ts b/test/run-in-background-guidance.test.ts index a9dfcad59..0c440efe8 100644 --- a/test/run-in-background-guidance.test.ts +++ b/test/run-in-background-guidance.test.ts @@ -196,10 +196,12 @@ describe('outside-voice dispatch contract', () => { }); test('the delegated prompt itself requires findings only and forbids plan mutations', () => { - const promptStart = rendered.indexOf('"IMPORTANT:'); const promptEnd = rendered.indexOf('\n"'); - expect(promptStart).toBeGreaterThan(-1); + const promptStart = rendered.lastIndexOf('\n"', promptEnd) + 1; + expect(promptStart).toBeGreaterThan(0); expect(promptEnd).toBeGreaterThan(promptStart); + expect(rendered.slice(promptStart, promptStart + 1)).toBe('"'); + expect(rendered.slice(promptStart, rendered.indexOf('\n', promptStart))).toContain('.claude/skills/'); const prompt = rendered.slice(promptStart, promptEnd); // A sovereignty rule elsewhere in the parent workflow does not reach // a fresh-context reviewer receiving only this constructed prompt. diff --git a/test/team-mode.test.ts b/test/team-mode.test.ts index ea9f854aa..3afc1a286 100644 --- a/test/team-mode.test.ts +++ b/test/team-mode.test.ts @@ -351,7 +351,7 @@ describe('setup --team / --no-team / -q', () => { fs.writeFileSync(file, content, { mode: 0o755 }); }; try { - for (const rel of ['setup', 'VERSION', 'SKILL.md', 'qa/SKILL.md', 'bin/gstack-config', 'bin/gstack-patch-names', 'bin/gstack-state-root.sh', 'bin/gstack-install-registry.sh', 'scripts/resolve-codex-generation-model.ts', 'scripts/models.ts', 'scripts/preflight-codex-overlap.ts', 'scripts/discover-skills.ts', 'scripts/external-skill-names.ts', 'scripts/host-config.ts']) { + for (const rel of ['setup', 'VERSION', 'SKILL.md', 'qa/SKILL.md', 'bin/gstack-config', 'bin/gstack-patch-names', 'bin/gstack-state-root.sh', 'bin/gstack-install-registry.sh', 'bin/gstack-render-claude.sh', 'scripts/resolve-codex-generation-model.ts', 'scripts/models.ts', 'scripts/preflight-codex-overlap.ts', 'scripts/discover-skills.ts', 'scripts/external-skill-names.ts', 'scripts/host-config.ts']) { const dest = path.join(cwd, rel); fs.mkdirSync(path.dirname(dest), { recursive: true }); fs.copyFileSync(path.join(ROOT, rel), dest);