MCP tools don't populate output.output in the tool.execute.after hook — the MCP content flows through OpenCode's internal parts pipeline instead. This caused a crash: undefined is not an object (evaluating 'text.length') in the truncate function.
35 lines
1.0 KiB
Markdown
35 lines
1.0 KiB
Markdown
---
|
|
description: Execution rules for debugging: hypothesis testing, instrumentation, and trace cleanup
|
|
---
|
|
|
|
# Research Execution
|
|
|
|
Keep context clean and evidence tracked during active investigation.
|
|
|
|
## Context Management
|
|
|
|
Methodology degrades after ~15 tool calls. Re-read investigation file and
|
|
dead-ends every ~10 tool calls. When drifting toward guess-and-check, pause and
|
|
re-read notes. Hold references; load on demand.
|
|
|
|
## Findings Format
|
|
|
|
Record each hypothesis test to `.session/findings.md`:
|
|
|
|
```
|
|
- [timestamp] Hypothesis: [one sentence]
|
|
Falsification: [what you'd expect if wrong]
|
|
Result: [ELIMINATED/CONFIRMED] — [why, in one sentence]
|
|
```
|
|
|
|
## Timing Awareness
|
|
|
|
Prefix unknown commands with `time`. Fast (<5s): low barrier. Slow (>30s):
|
|
reason first. Unknown: measure. Capture: `time cmd 2>&1 | tee /tmp/output.txt`
|
|
|
|
## Techniques
|
|
|
|
- **Five Whys**: trace causal chains; starting point, not sole method
|
|
- **Delta Debugging**: binary search between passing/failing cases
|
|
- **Rubber Duck**: explain the system step by step to expose gaps
|