Files
pi-plan/test/prompts.test.ts
T
wassnameandPi/OpenAI ac3b9575fa Rotate curated supervisor nudges and repeat delivered upkeep
Keep the hourly schedule unchanged. Advance the local nudge cycle only on prompt delivery and reset the unchanged-turn counter so upkeep repeats. Test compaction supersession, cadence, rotation and solo behavior.

Co-Authored-By: Pi/OpenAI <288921227+claudypoo@users.noreply.github.com>
2026-09-11 20:58:39 +08:00

31 lines
1.8 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { planDrafting, upkeep } from "../src/prompts.js";
it("cycles six curated supervisor nudges without changing the shared upkeep instructions", () => {
const base = upkeep("/plan.md");
const variants = Array.from({ length: 6 }, (_, round) => upkeep("/plan.md", round));
expect(new Set(variants).size).toBe(6);
for (const text of variants) expect(text.endsWith(base)).toBe(true);
expect(upkeep("/plan.md", 6)).toBe(variants[0]);
expect(base.startsWith("Plan upkeep:")).toBe(true);
});
describe("planning prompt", () => {
it("requires fact finding or a focused question before a goal", () => {
expect(planDrafting).toContain("Use read-only repository tools or web search when either can\nresolve a fact.");
expect(planDrafting).toContain("Do not use a question quota");
expect(planDrafting).toContain("Briefly reframe the request in your own words to check comprehension");
expect(planDrafting).toContain("point as unknown; do not silently replace it with an inference or turn it into a new blocking decision");
expect(planDrafting).toContain("answer materially reduces uncertainty\nwhile discovering the right plan");
expect(planDrafting).toContain("self-contained: state the relevant\ncontext, use the human's language and ASD-STE100");
expect(planDrafting).toContain("placeholder goal such as \"work out the thing\"");
expect(planDrafting).toContain("Only withhold Ready for an unanswered choice that changes scope, spending, or the user-visible result");
});
it("anchors work and sign-off to the user-visible result", () => {
expect(planDrafting).toContain("## User-visible result");
expect(planDrafting).toContain("Take it from the original request, not from your implementation plan");
expect(planDrafting).toContain("Future work may not defer any artifact or action named there");
});
});