-
Confirm the logging configuration before editing.
Resolve a logging destination before instrumenting.
If the user already gave a session log path, use it.
Otherwise, create one yourself with a deterministic unique name such as /tmp/evidence-debugger-<timestamp>-<shortid>.ndjson and tell the user the exact path so later turns can refer to it.
When relevant, also resolve the server endpoint and session ID.
Do not instrument anything until the logging destination is known.
-
Reconstruct the failure from runtime context.
Read the bug report, stack trace, and relevant code paths.
Identify the user flow, the failing method, and the likely lifecycle boundaries involved.
-
Generate 3 to 5 precise hypotheses.
Make each hypothesis falsifiable.
Prefer mechanism-level statements such as stale references, destroyed objects, unexpected branch selection, out-of-order callbacks, or invalid state transitions.
-
Add the minimum instrumentation needed to test the hypotheses in parallel.
Add at least 1 log and usually 2 to 6 total.
Never exceed 10 logs without narrowing the hypotheses first.
Wrap every debug log in a collapsible region.
Include hypothesisId, location, message, timestamp, and useful state in every payload.
Never log secrets, tokens, passwords, API keys, or PII.
-
Clear only the current session log before the user runs again.
Delete only the current session log file.
Do not treat log clearing as instrumentation removal.
If you generated the log path yourself, keep using that same path for the current investigation until verification is complete.
-
Ask the user to reproduce with a <reproduction_steps> block.
End with a short, numbered, interface-agnostic instruction block.
Tell the user to reply in natural language when the reproduction attempt is done.
If services must restart, say so.
-
Read the logs and evaluate every hypothesis.
Mark each one as CONFIRMED, REJECTED, or INCONCLUSIVE.
Cite exact log lines when explaining the verdict.
Identify the single root-cause mechanism that best explains the failure.
-
Apply only the evidence-backed fix.
Keep the change small and architecture-consistent.
Do not keep speculative guards or unrelated cleanup.
If a hypothesis was rejected, remove the code changes that were only supporting that hypothesis.
-
Verify with logs before claiming success.
Keep instrumentation active for the verification run.
Compare before and after behavior with cited log evidence.
Remove instrumentation only after the logs prove success or the user explicitly confirms the issue is fixed.
-
Close with a short explanation.
Summarize the actual failure mechanism and the precise fix in 1 to 2 lines.
Only keep numbered steps inside the tag.