From 5baec49f49fedfa892dae1c819fdc647d7bb2c3e Mon Sep 17 00:00:00 2001 From: Rudy Celekli Date: Fri, 23 Oct 2026 22:13:38 -0400 Subject: [PATCH] fix(pstack): count plan boxes checked with an uppercase X --- .../skills/poteto-mode/scripts/check-plan.mjs | 2 +- .../skills/poteto-mode/scripts/check-plan.test.ts | 14 ++++++++++++++ pstack/skills/poteto-mode/scripts/check-plan.mjs | 2 +- .../skills/poteto-mode/scripts/check-plan.test.ts | 14 ++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.mjs b/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.mjs index c3ddc3989..549b286f1 100755 --- a/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.mjs +++ b/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.mjs @@ -26,7 +26,7 @@ const HOW_TO_READ_MARKERS = [ RULE, ]; const PERF_ITEMS = ["Metric.", "Probe.", "Baseline.", "Rule."]; -const BOX = /^\s*- \[[ x]\] (.*)$/; +const BOX = /^\s*- \[[ xX]\] (.*)$/; const file = process.argv[2]; if (!file) { diff --git a/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.test.ts b/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.test.ts index cd1debfa3..0992ac73e 100644 --- a/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.test.ts +++ b/harness/pstack/claude-code/skills/poteto-mode/scripts/check-plan.test.ts @@ -63,6 +63,20 @@ const runPlan = (example: string, expectedExit: number) => { } }; +test("counts boxes checked with an uppercase X", () => { + const directory = mkdtempSync(join(tmpdir(), "check-plan-test-")); + const file = join(directory, "plan.md"); + writeFileSync(file, validPlan.replaceAll("- [ ]", "- [X]")); + try { + const result = spawnSync("node", [checker, file], { encoding: "utf8" }); + expect(result.stderr).toBe(""); + expect(result.status).toBe(0); + expect(result.stdout).toContain("PR 1 boxes=19"); + } finally { + rmSync(directory, { recursive: true, force: true }); + } +}); + test("accepts ordinary, indented, and longer closing fences", () => { for (const indent of ["", " ", " ", " "]) runPlan(`${indent}\`\`\`markdown\n## Example only\n${indent}\`\`\`\n`, 0); diff --git a/pstack/skills/poteto-mode/scripts/check-plan.mjs b/pstack/skills/poteto-mode/scripts/check-plan.mjs index c3ddc3989..549b286f1 100755 --- a/pstack/skills/poteto-mode/scripts/check-plan.mjs +++ b/pstack/skills/poteto-mode/scripts/check-plan.mjs @@ -26,7 +26,7 @@ const HOW_TO_READ_MARKERS = [ RULE, ]; const PERF_ITEMS = ["Metric.", "Probe.", "Baseline.", "Rule."]; -const BOX = /^\s*- \[[ x]\] (.*)$/; +const BOX = /^\s*- \[[ xX]\] (.*)$/; const file = process.argv[2]; if (!file) { diff --git a/pstack/skills/poteto-mode/scripts/check-plan.test.ts b/pstack/skills/poteto-mode/scripts/check-plan.test.ts index cd1debfa3..0992ac73e 100644 --- a/pstack/skills/poteto-mode/scripts/check-plan.test.ts +++ b/pstack/skills/poteto-mode/scripts/check-plan.test.ts @@ -63,6 +63,20 @@ const runPlan = (example: string, expectedExit: number) => { } }; +test("counts boxes checked with an uppercase X", () => { + const directory = mkdtempSync(join(tmpdir(), "check-plan-test-")); + const file = join(directory, "plan.md"); + writeFileSync(file, validPlan.replaceAll("- [ ]", "- [X]")); + try { + const result = spawnSync("node", [checker, file], { encoding: "utf8" }); + expect(result.stderr).toBe(""); + expect(result.status).toBe(0); + expect(result.stdout).toContain("PR 1 boxes=19"); + } finally { + rmSync(directory, { recursive: true, force: true }); + } +}); + test("accepts ordinary, indented, and longer closing fences", () => { for (const indent of ["", " ", " ", " "]) runPlan(`${indent}\`\`\`markdown\n## Example only\n${indent}\`\`\`\n`, 0);