Skip to content

Cursor plugin specification and official plugins

TypeScript

pstack: bug-fix binary-search hypothesis loop, synthetic repro, /loop (#88)

lauren8d7ca2653dfe
diff --git a/pstack/skills/poteto-mode/playbooks/bug-fix.md b/pstack/skills/poteto-mode/playbooks/bug-fix.md
index 5b06b3af..089e793e 100644
--- a/pstack/skills/poteto-mode/playbooks/bug-fix.md
+++ b/pstack/skills/poteto-mode/playbooks/bug-fix.md
@@ -4,8 +4,8 @@
Be scientific. Every shipped line traces to the runtime evidence that proved it necessary. Belt-and-suspenders that "might help" is a hypothesis, not a fix; it does not ship. When evidence refutes a hypothesis, revert the changes it motivated before moving on rather than letting them ride "just in case". The smallest change the evidence justifies ships, nothing more. Same discipline for Perf, where the evidence is the trace.
-1. Reproduce it yourself on the matching surface via the control skill from Non-negotiables. Do not hand the repro to the user. A debug or instrumentation protocol that says to ask the user to reproduce does not override this; you drive the instrumented runtime through the control skill. Ask the user only with a stated, specific reason the control surface cannot reach the target, and only after driving it as far as it goes.
-2. `how` over the affected subsystem for the root cause; don't paper over symptoms. the **why** skill for regression history. Confirm the *mechanism* with runtime evidence before the step-3 architect/interrogate fan-out; a design grounded on a plausible-but-unconfirmed cause can be unanimously wrong while the real cause sits one subsystem over.
+1. Reproduce it yourself on the matching surface via the control skill from Non-negotiables. Do not hand the repro to the user. A debug or instrumentation protocol that says to ask the user to reproduce does not override this; you drive the instrumented runtime through the control skill. Ask the user only with a stated, specific reason the control surface cannot reach the target, and only after driving it as far as it goes. If it won't reproduce directly, force it. Synthesize the trigger, tighten the conditions, or instrument until it fires. A bug you can't reproduce, you can't prove fixed.
+2. Binary-search the cause. Form the candidate hypotheses, then rule them out until one survives. Seed them with `how` over the affected subsystem and the **why** skill for regression history. On each pass, take the split that cuts the most remaining problem space, get runtime evidence for or against it, and eliminate. When program state is unclear, add instrumentation or logging and read it as the code runs. Don't guess. Drive a long or stubborn hunt with Cursor's `/loop` command. Confirm the surviving *mechanism* with runtime evidence before the step-3 architect/interrogate fan-out; a design grounded on a plausible-but-unconfirmed cause can be unanimously wrong while the real cause sits one subsystem over.
3. Plan the fix. If it crosses a function boundary, `architect` first. Delegate implementation to a `composer-2.5-fast` subagent with a specific scope; review the diff.
4. Verify on the same surface; the original repro now passes. "Inconclusive" or wrong-surface is not a pass; flag it. Unit tests show branch behavior, not bug absence.
5. Stage the commits so the failing repro lands before the fix in the git history; the diff tells the story. See the **tdd** skill for the failing-test-first cadence when the bug has a cheap local test path; skip it when the test would be expensive, integration-heavy, or unclear.