pstack: inline playbook principle rules, keep leaves as deep references - #172
Open
poteto wants to merge 15 commits into
Open
pstack: inline playbook principle rules, keep leaves as deep references#172poteto wants to merge 15 commits into
poteto wants to merge 15 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Restart state rule dropped inline
- Step 3 now directs agents to suspect stale persistent state in restart failures and prioritize state validation when clearing state restores behavior.
Or push these changes by commenting:
@cursor push 2eea757e8a
Preview (2eea757e8a)
diff --git a/pstack/skills/poteto-mode/playbooks/bug-fix.md b/pstack/skills/poteto-mode/playbooks/bug-fix.md
--- a/pstack/skills/poteto-mode/playbooks/bug-fix.md
+++ b/pstack/skills/poteto-mode/playbooks/bug-fix.md
@@ -6,7 +6,7 @@
1. Reproduce it yourself on the matching surface via the control skill (Non-negotiables). Don't hand the repro to the user. A debug or instrumentation protocol that says to ask the user does not override this; you drive the instrumented runtime. 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. Won't reproduce directly, force it: synthesize the trigger, tighten 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. Each pass, take the split that cuts the most remaining problem space, get runtime evidence, 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 at the root cause, not the symptom. A nil check or guard that silences the crash without explaining it is a symptom fix and does not ship. Check for the pattern, not just the instance: grep for the same shape elsewhere and fix every occurrence. If the fix crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured bug-fix model (default `gpt-5.6-sol-max`) with a specific scope; review the diff.
+3. Plan the fix at the root cause, not the symptom. A nil check or guard that silences the crash without explaining it is a symptom fix and does not ship. Check for the pattern, not just the instance: grep for the same shape elsewhere and fix every occurrence. For failures after restart, suspect stale persistent state before code: config files, caches, lock files, and serialized state. If clearing state restores behavior, prioritize state validation as the fix. If the fix crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured bug-fix model (default `gpt-5.6-sol-max`) 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 git history; the reviewer watches it go red, then green. 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.
6. Run **Opening a PR**.You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 0bbcfb4. Configure here.
| 1. Reproduce it yourself on the matching surface via the control skill (Non-negotiables). Don't hand the repro to the user. A debug or instrumentation protocol that says to ask the user does not override this; you drive the instrumented runtime. 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. Won't reproduce directly, force it: synthesize the trigger, tighten 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. Each pass, take the split that cuts the most remaining problem space, get runtime evidence, 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 subagent using your configured bug-fix model (default `gpt-5.6-sol-max`) with a specific scope; review the diff. | ||
| 3. Plan the fix at the root cause, not the symptom. A nil check or guard that silences the crash without explaining it is a symptom fix and does not ship. Check for the pattern, not just the instance: grep for the same shape elsewhere and fix every occurrence. If the fix crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured bug-fix model (default `gpt-5.6-sol-max`) with a specific scope; review the diff. |
There was a problem hiding this comment.
Restart state rule dropped inline
Medium Severity · Logic Bug
Step 3 now inlines fix-root-causes planning rules (symptom guards, pattern grep) but omits the leaf skill’s restart-specific guidance to suspect stale persistent state before chasing code changes. The playbook is read every time; the leaf may not be opened.
Reviewed by Cursor Bugbot for commit 0bbcfb4. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Trace measurements of which files agents actually open show that an invoked playbook gets read essentially every time, while separately indexed principle leaf files get opened only about half the time. A rule that changes how a playbook's work is done therefore belongs inline at the step where it bites, not behind a pointer the agent may never follow.
howskill degrades gracefully when subagents are unavailable: if explorers can't spawn or a spawned explorer never returns, run the exploration angles yourself sequentially and never end the turn waiting. Agents invoked as subagents often can't be woken by their own children, and observed runs have died waiting on explorers that would never report back.Note
Low Risk
Documentation and agent-instruction changes only; no application runtime code. Behavior shifts are intentional guidance for how agents read and apply principles.
Overview
Principle rules now live in playbooks because agents read playbooks almost every time but opened indexed
principle-*leaf skills only about half the time. Each affected playbook states the rules that change its work as short inline text at the step where they apply, withprinciple-*links removed from those steps. The 21 leaf skills stay as deep references.poteto-moderoot skill is slimmer. The long Principles index with per-principle “when it applies” blurbs is replaced by two cross-cutting rules in full (Guard the Context Window, Never Block on the Human) plus a name-only pointer list. Non-negotiables no longer require naming applied principles in every reply; playbooks are the source of truth at each step. The “any code” trigger inlines domain-modeling guidance instead of pointing at principle-model-the-domain.Docs and routing align with the model. README, the principles guide,
poteto-agent, andreferences/plan.mddescribe playbooks as carrying inline rules and leaves as optional depth.howadds a fallback: if explorers cannot spawn or never return, run the exploration angles sequentially and do not end the turn waiting on subagents.Reviewed by Cursor Bugbot for commit 0bbcfb4. Bugbot is set up for automated code reviews on this repo. Configure here.