diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68b8792f1..31bd1c771 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1) - name: Verify dist bundle tests - run: bun test src/shared/dist-bundle-bun-globals.test.ts + run: bun test src/shared/dist-bundle-bun-globals.test.ts src/shared/dist-bundle-prompt-content.test.ts - name: Auto-commit schema changes if: github.event_name == 'push' && github.ref == 'refs/heads/master' diff --git a/src/shared/dist-bundle-prompt-content.test.ts b/src/shared/dist-bundle-prompt-content.test.ts new file mode 100644 index 000000000..ced4a1074 --- /dev/null +++ b/src/shared/dist-bundle-prompt-content.test.ts @@ -0,0 +1,103 @@ +/// + +import { describe, expect, test } from "bun:test" + +const DIST_INDEX = "dist/index.js" +const SKIP_MESSAGE = "[skipped - dist not built]" + +const PROMPT_SIGNATURES = [ + { + path: "packages/prompts-core/prompts/ultrawork/default.md", + label: "Ultrawork default", + signature: "ULTRAWORK MODE ENABLED!", + }, + { + path: "packages/prompts-core/prompts/ultrawork/gemini.md", + label: "Ultrawork Gemini", + signature: "ULTRAWORK MODE ENABLED!", + }, + { + path: "packages/prompts-core/prompts/ultrawork/gpt.md", + label: "Ultrawork GPT", + signature: "ULTRAWORK MODE ENABLED!", + }, + { + path: "packages/prompts-core/prompts/atlas/default.md", + label: "Atlas default", + signature: "You are Atlas - the Master Orchestrator from OhMyOpenCode.", + }, + { + path: "packages/prompts-core/prompts/atlas/gemini.md", + label: "Atlas Gemini", + signature: "Your value is ORCHESTRATION, not coding.", + }, + { + path: "packages/prompts-core/prompts/atlas/gpt.md", + label: "Atlas GPT", + signature: "This prompt is outcome-first. Choose the most efficient path to the outcomes above.", + }, + { + path: "packages/prompts-core/prompts/atlas/kimi.md", + label: "Atlas Kimi", + signature: "Trust the trained prior on the hard 30% (verification reasoning, failure diagnosis, dependency analysis).", + }, + { + path: "packages/prompts-core/prompts/atlas/opus-4-7.md", + label: "Atlas Opus 4.7", + signature: "Opus 4.7 spawns fewer subagents than Opus 4.6 unless told otherwise.", + }, + { + path: "packages/prompts-core/prompts/prometheus/default.md", + label: "Prometheus default", + signature: "YOU ARE A PLANNER. YOU ARE NOT AN IMPLEMENTER. YOU DO NOT WRITE CODE. YOU DO NOT EXECUTE TASKS.", + }, + { + path: "packages/prompts-core/prompts/prometheus/gemini.md", + label: "Prometheus Gemini", + signature: "If you feel the urge to write code or implement something - STOP. That is NOT your job.", + }, + { + path: "packages/prompts-core/prompts/prometheus/gpt.md", + label: "Prometheus GPT", + signature: "YOU ARE A PLANNER. NOT AN IMPLEMENTER. NOT A CODE WRITER.", + }, + { + path: "packages/prompts-core/prompts/mode/search.md", + label: "Search mode", + signature: "MAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:", + }, + { + path: "packages/prompts-core/prompts/mode/analyze.md", + label: "Analyze mode", + signature: "IF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:", + }, + { + path: "packages/prompts-core/prompts/mode/team.md", + label: "Team mode", + signature: "Team-mode reference detected. Orchestrate via team_* tools", + }, + { + path: "packages/prompts-core/prompts/mode/hyperplan.md", + label: "Hyperplan mode", + signature: "HYPERPLAN MODE ENABLED!", + }, +] as const + +describe("dist bundle prompt content", () => { + test("#given dist bundle #when scanned #then markdown prompt signatures are inlined", async () => { + const distIndex = Bun.file(DIST_INDEX) + if (!(await distIndex.exists())) { + console.info(SKIP_MESSAGE) + return + } + + const bundle = await distIndex.text() + + for (const prompt of PROMPT_SIGNATURES) { + expect( + bundle.includes(prompt.signature), + `${prompt.label} prompt content missing from dist/index.js (${prompt.path}): markdown inlining may have regressed`, + ).toBe(true) + } + }) +})