Logs and IDE Reports
Logs may contain symptoms rather than the root cause.
Correlate:
- timestamps/order of events;
- repeated operations;
- preceding warnings;
- exception chains;
- affected component;
- user-visible behavior.
If the IDE reports a problem without enough context, inspect the referenced source and project configuration before asking the user for more information.
If the report is sufficient to investigate, proceed without unnecessary clarification.
Tests and Regression Coverage
When a bug is reproducible in a testable component:
- Prefer an existing test that demonstrates the failure.
- If no suitable test exists, add a focused regression test when practical.
- Keep the test specific to the bug and its expected behavior.
- Do not weaken or delete a test simply because it fails after the change.
- Do not modify tests merely to make an incorrect implementation appear correct.
A regression test should fail for the old behavior and pass for the corrected behavior whenever practical.
Validation
Use the project's existing validation configuration and commands.
Start with the narrowest useful check, for example:
- the affected test;
- the relevant test module;
- the relevant linter command;
- a targeted type check;
- the affected build/package check.
Then broaden validation when the change warrants it.
For a lint report, re-run the relevant linter and confirm the reported diagnostic is gone. If the command still exits non-zero because of unrelated existing findings, distinguish the fixed finding from the remaining findings.
For a traceback, run the relevant test or reproduction and verify that the same traceback no longer occurs.
Never report "all checks pass" if only a targeted check passed.
Scope and Safety
- Never reset, rebase, force-push, amend, or rewrite existing Git history.
- Never discard unrelated working-tree changes.
- Never use blanket staging or modify unrelated files just to satisfy validation.
- Do not update dependencies unless the diagnosis actually requires it.
- Do not change public behavior unnecessarily.
- Do not silence diagnostics when a proper fix is reasonably safe.
- Do not introduce a workaround when the root cause can be fixed cleanly.
- Preserve existing project conventions and architecture.
- Keep fixes focused and reviewable.
Fix vs. Refactor
A fix may require a refactor when the existing structure directly causes the bug or prevents a safe correction.
Keep the change focused:
- bug fix first;
- supporting refactor only when needed;
- unrelated cleanup belongs in a separate change.
For lint-only maintenance, prefer the smallest refactor that genuinely improves the reported issue.
Multiple Problems
When the user provides several diagnostics:
- Group them by root cause or affected component.
- Fix related diagnostics together when one change resolves several findings.
- Avoid mixing unrelated fixes into one broad rewrite.
- Validate each meaningful group.
- Report which diagnostics were resolved and which remain.
If one reported issue blocks investigation of another, resolve the blocker first and continue.
Final Report
After the fix, provide a concise summary:
- Root cause: what actually caused the problem.
- Fix: what was changed and why.
- Files: files modified.
- Validation: exact relevant checks performed and their result.
- Remaining: any unresolved diagnostics, unrelated failures, or limitations.
If the user supplied a large diagnostic dump, explicitly identify which reported items were addressed so it is clear what the fix covered.