Skip to content

Commit 8cfac3d

Browse files
authored
Fix duplicate terminal redraws on activation (#338)
* Fix duplicate terminal redraws on activation * Add falsifiable investigation experiment loop
1 parent 6eb1ea1 commit 8cfac3d

3 files changed

Lines changed: 192 additions & 59 deletions

File tree

.claude/skills/investigate/SKILL.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,34 @@ Use these in order of effectiveness:
6767
4. **Trace data flow across boundaries** — follow data transformations across service/component boundaries (API → service → repository, or parent → child → grandchild)
6868
5. **Check git blame/log** — find the commit that introduced or changed the broken behavior
6969

70+
### Falsifiable Experiment Loop
71+
72+
When inspection alone cannot prove the cause and the real runtime surface is available, turn each hypothesis into a controlled experiment:
73+
74+
1. **State one falsifiable claim** — describe the exact cause or behavior the experiment will support or refute.
75+
2. **Define the signal first** — name the observable pass/fail metric: screenshot state, log sequence, raw buffer marker count, persisted row, network response, process state, or another concrete output.
76+
3. **Isolate the runtime** — use a fresh profile, database, temporary repository, port, or process namespace so existing state cannot contaminate the result.
77+
4. **Capture the baseline** — reproduce the failure and save the same evidence that will be collected after the experiment.
78+
5. **Change one variable** — use the smallest diagnostic or implementation change that distinguishes this hypothesis from the alternatives.
79+
6. **Drive the real surface** — exercise the application through the CLI, socket, browser, desktop window, or TUI rather than calling an internal function directly.
80+
7. **Capture multiple layers** — combine user-visible evidence with logs and authoritative raw or persisted state when available.
81+
8. **Classify the result** — mark the hypothesis supported, refuted, or inconclusive and state why the evidence reaches that conclusion.
82+
9. **Revert failed experiments immediately** — do not stack unproven changes or let an inconclusive attempt become part of the next experiment.
83+
10. **Update the experiment ledger** — record the hypothesis, single variable, command or driver, evidence paths, and verdict before starting the next loop.
84+
85+
If implementation changes have not been authorized, limit experiments to diagnostics or disposable external fixtures and report the candidate change instead of keeping it.
86+
87+
#### Freeze the First Reliable Result
88+
89+
Once a candidate passes the original reproduction:
90+
91+
- Record the exact diff or checkpoint that passed.
92+
- Rerun the original flow from fresh isolated state.
93+
- Probe the nearest regression surfaces and one negative or stress case.
94+
- Preserve that known-good checkpoint before optional hardening.
95+
- Treat each hardening change as a new hypothesis with its own measurable failure signal and revert it if the runtime evidence regresses.
96+
- Stop expanding the solution when the stated acceptance criteria and adjacent probes pass; move broader architecture work into a separate follow-up.
97+
7098
### What to Look For
7199

72100
- **What's wrong** — the specific code causing the incorrect behavior
@@ -142,6 +170,8 @@ Stop and reassess if you notice yourself doing any of these:
142170
- Investigating code that has nothing to do with the reported symptoms
143171
- Testing variations of the same failed hypothesis instead of forming a new one
144172
- Saying "let's just try changing X and see if it works"
173+
- Stacking multiple experimental changes without measuring each one independently
174+
- Continuing to harden after a reliable result without preserving the known-good checkpoint
145175
- Spending excessive time without reporting intermediate findings to the user
146176

147177
Bug to investigate: $ARGUMENTS

.codex/skills/investigate/SKILL.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,21 @@ Workflow:
1717
3. Write 3-5 ranked hypotheses before reading deeply.
1818
4. Test those hypotheses by tracing the relevant code and recent history.
1919
5. Compare broken and working paths when possible.
20-
6. If the cause is still unclear, propose targeted logging and explain exactly why.
21-
7. Report the root cause, confidence level, affected files, likely introduction point, and what needs to change.
20+
6. When inspection is insufficient and a runtime surface exists, run a falsifiable experiment loop:
21+
- state one claim and its observable pass/fail signal;
22+
- use fresh isolated state and capture a baseline;
23+
- change one variable and drive the real CLI, socket, browser, desktop window, or TUI;
24+
- capture user-visible evidence plus logs and authoritative raw or persisted state;
25+
- classify the result as supported, refuted, or inconclusive;
26+
- revert failed experiments immediately and record the command, evidence, and verdict before the next loop.
27+
7. If the cause is still unclear, propose targeted logging and explain exactly why.
28+
8. When a candidate passes, freeze the exact known-good checkpoint, rerun from fresh state, probe adjacent behavior, and treat optional hardening as separate measured experiments.
29+
9. Stop expanding once the acceptance criteria and adjacent probes pass; move broader architecture work to a follow-up.
30+
10. Report the root cause, confidence level, affected files, likely introduction point, and what needs to change.
2231

2332
Red flags:
2433
- proposing a fix before confirming the cause
2534
- pursuing the same failed theory repeatedly
35+
- stacking unmeasured experimental changes
36+
- losing the known-good checkpoint before optional hardening
2637
- analyzing code unrelated to the symptoms

0 commit comments

Comments
 (0)