examples / example-03-investigation-flaky-test.md
examples / example-03-investigation-flaky-test.md
A test fails intermittently on CI but passes locally. The developer needs to understand the root cause without modifying any production code first. They need a read-only investigation.
This maps to the Investigation playbook. The key pattern from pstack usage is: state the goal, explicitly request no code changes, and ask for a reproducible trace with source locations.
Step 1: Route to the Investigation playbook
{ "tool": "playbook-route", "parameters": { "task": "Investigate why a Counter state machine test fails intermittently on CI but passes locally. Do not modify any files. Trace the state transitions with source locations and reproduction steps.", "limit": 1 } }
Step 2: Load the Investigation playbook
Step 3: Use the Why skill for root-cause analysis
Step 4: Get the principle about verifiable units
Step 5: Use the Interrogate skill for failure demonstration
pstack-mcp returns:
The model produces a findings report rather than a patch, including what could not be confirmed given the environment constraints.
A test fails intermittently on CI but passes locally. The developer needs to understand the root cause without modifying any production code first. They need a read-only investigation.
This maps to the Investigation playbook. The key pattern from pstack usage is: state the goal, explicitly request no code changes, and ask for a reproducible trace with source locations.
Step 1: Route to the Investigation playbook
{ "tool": "playbook-route", "parameters": { "task": "Investigate why a Counter state machine test fails intermittently on CI but passes locally. Do not modify any files. Trace the state transitions with source locations and reproduction steps.", "limit": 1 } }
Step 2: Load the Investigation playbook
Step 3: Use the Why skill for root-cause analysis
Step 4: Get the principle about verifiable units
Step 5: Use the Interrogate skill for failure demonstration
pstack-mcp returns:
The model produces a findings report rather than a patch, including what could not be confirmed given the environment constraints.
{
"tool": "get_playbook",
"parameters": {
"name": "investigation",
"mode": "full"
}
}
{
"tool": "get_skill",
"parameters": {
"name": "why",
"mode": "full"
}
}
{
"tool": "get_principles",
"parameters": {
"names": ["sequence-verifiable-units", "exhaust-the-design-space"],
"mode": "full"
}
}
{
"tool": "skill-prompt",
"parameters": {
"skill_name": "interrogate",
"task_context": "hand a failing test diff to several models and ask each to demonstrate the failure with executable reproduction steps"
}
}
{
"tool": "get_playbook",
"parameters": {
"name": "investigation",
"mode": "full"
}
}
{
"tool": "get_skill",
"parameters": {
"name": "why",
"mode": "full"
}
}
{
"tool": "get_principles",
"parameters": {
"names": ["sequence-verifiable-units", "exhaust-the-design-space"],
"mode": "full"
}
}
{
"tool": "skill-prompt",
"parameters": {
"skill_name": "interrogate",
"task_context": "hand a failing test diff to several models and ask each to demonstrate the failure with executable reproduction steps"
}
}