easysdd-issue-fix
At this stage, the root cause and solution have been determined (the standard path is in
, and the quick path was confirmed verbally during the report stage). Your task is to modify the code according to the solution, verify the effect, and write the repair record.
It sounds straightforward, but the most prone problem in the fix stage is not the code modification itself, but the "casual" impulse that arises during the modification—casually optimizing a bit, casually refactoring a little, casually adding an abstraction. Each item makes sense on its own, but putting them all in one PR makes it impossible for others to distinguish "what exactly was changed to fix the bug this time". The purpose of all the following rules is to stop this impulse.
For shared paths and naming conventions, refer to Section 0 of
easysdd/reference/shared-conventions.md
and the "Where to put files" section of
.
Two Entry Points
Standard Path Entry (with {slug}-analysis.md)
- Root cause analysis exists and solution is confirmed——Read , confirm that the frontmatter has and , and which solution the user selected in Section 5 "Repair Solution"
- Read the full context:
- Full root cause analysis text
- Full problem report text
- All code files located in Section 1 of the root cause analysis
- Records related to this issue in the compound directory (search uniformly in , filter by as needed):
- Trick search:
python easysdd/tools/search-yaml.py --dir easysdd/compound --filter doc_type=trick --filter status=active --query "{issue keywords}"
——Confirm that the repair method does not violate existing library usage / pattern suggestions
- Explore search:
python easysdd/tools/search-yaml.py --dir easysdd/compound --filter doc_type=explore --query "{issue keywords}"
——Confirm that the repair point does not conflict with existing evidence
- Confirm the repair starting point——Tell the user "I will modify {file list} according to Solution X, starting the repair", and wait for user confirmation before taking action
Quick Path Entry (without {slug}-analysis.md, triggered directly from easysdd-issue-report)
When entering this entry, the AI has already read the code during the report stage and is confident about the root cause.
- Clearly state the root cause to the user: "The {specific code} at has {problem description}", and let the user confirm that the root cause judgment is accurate
- Provide a repair solution——Where to modify and how to modify (just one or two sentences, no need to write a complete analysis document)
- Wait for the user to clearly say 'Yes, modify it this way' before taking action——"I think it's correct, modify directly" is not allowed
- Read
- Supplement search in the compound directory——The quick path also requires using
search-yaml.py --dir easysdd/compound
to search, check similar tricks with , and avoid mistaking known boundary conditions for new issues with --filter doc_type=explore
Constraints During Implementation
Only Modify Files Stated in the Root Cause Analysis
The repair scope comes from the "Impact Scope" in Section 5 "Recommended Solution" of
. Do
not modify files outside the scope—even if they look good.
If you find something worth modifying outside the scope, record it as a "casual discovery" without modifying the code:
markdown
> Casual discovery: {file:line number} {brief problem description}. Not within the scope of this repair, can open a separate issue later.
Why is this so strict? The reason is the same as feature-implement——casually modified code is not in the analysis, it cannot be checked during acceptance, and future developers cannot distinguish which changes were made to fix this bug via git blame.
Minimize Changes
The repair changes should only target the root cause, do not introduce new abstractions, new interfaces, or new patterns. If you find that "to fix this properly, you need to refactor X first"——stop, and confirm with the user whether to do the refactoring in this issue or split it into independent work.
Why is this so strict? Bug fixes are naturally narrow-scoped actions. Introducing a new abstraction means this abstraction is only supported by one usage point——a typical case of premature abstraction. Either refactor separately first then fix the bug, or fix the bug then refactor separately, but don't do both in one PR.
Code Quality Reflection Check
Although bug fixes seem small, AI can still drift when writing repair code——adding another special handling in an already long file, adding another method to an already heavy class, adding an
branch to bypass some boundary condition. For reflection checks, refer to Section 7 of
easysdd/reference/shared-conventions.md
.
In issue-fix, this section needs to be more cautious than feature-implement: when a reflection signal is triggered but the conclusion is 'should split', do not do it in this PR by default——record it as a casual discovery according to the "minimize changes" logic, and handle it in separate work later. The only exception is "cannot fix this bug cleanly without splitting", then stop and clearly tell the user "The prerequisite for fixing this bug is {refactoring action}, should it be included or split out to do separately".
Report After Completing Each Change
The repair report template is in the same directory
,
vague reports are not allowed. Stop and wait for the user's reply after reporting.
Verification Checklist
After modifying the repair code, check each item in the report:
When Repair Fails to Take Effect: Upgrade to Log Debugging
If after going through the verification checklist you find that the problem still reproduces or the behavior is inconsistent with expectations, do not repeatedly trial and error based on the original guess——switch to log debugging mode and re-collect runtime evidence.
Why switch? The essence of repeated trial and error is guessing what other possibilities exist under the original hypothesis, but if the original hypothesis itself is wrong, more guessing is just going in circles. Logs will force you to look at actual runtime data, which often reveals where the original hypothesis was wrong at a glance.
Log debugging steps, user prompt words for retrieving logs, and loop limits are in the same directory
.
Write {slug}-fix-note.md
After verification passes, create
in the issue directory (location refers to the "Where to put files" section of
) to record the complete loop of this repair. Both the standard path template and quick path template are in the same directory
.
Exit Conditions
Final Commit
Follow the rules in Section 4 "Final Commit (scoped-commit)" of
easysdd/reference/shared-conventions.md
. Specific points for this stage:
- Commit Scope: Repair code, , and / that were actually updated together this time
- After the repair loop is completed, tell the user "Repair verification is completed, has been archived", then immediately ask if commit is needed
After Exit
Tell the user: "Issue repair is completed, workflow is closed. Problem report ({slug}-report.md) + root cause analysis ({slug}-analysis.md) + repair record ({slug}-fix-note.md) have been archived."
Then ask one sentence each in the recommended closing order for "issue-fix" in Section 3 of
easysdd/reference/shared-conventions.md
(skip immediately if the user says "no"):
- This repair exposed a pitfall / experience worth reusing → "Do you need to document this pitfall into a learning document? (Follow , will be written into )"
- This repair documented long-term constraints, conventions, or technical decisions → "Do you need to archive this decision? (Follow )"
- Finally, ask again if you need to commit this repair on behalf of the user. When the user agrees, follow the final commit rules until the commit is completed.
You can suggest:
- Put the files in the issue directory and code changes in the same commit for easy future tracing
- Handle subsequent issues from "casual discoveries" in a new round of , do not include them in this PR
If during the repair you find that the problem is actually a feature gap (not a bug), suggest the user open a separate
workflow to handle it, do not secretly implement new features in the issue workflow.
Common Pitfalls
- Declare "fixed" without going through the verification checklist after modifying the code
- Casually modified code outside the scope of the root cause analysis
- Introduced new abstractions / interfaces during repair but did not stop to confirm with the user
- Declared workflow completed without creating
- Found regression issues in the impact scope but wrote "minor impact, can be ignored" in the report——must fix until it's clean
- Made frontend changes but did not run in the browser, only did typecheck and reported passing
- Ended the workflow without the user clearly saying "repair completed"
- When repair failed to take effect, continued to guess and trial and error based on the original hypothesis instead of switching to log debugging
- Submitted code without cleaning up temporary log statements after log debugging
- Did not ask the user if they need to commit on their behalf when closing the workflow
- Directly without the user's explicit consent