Bug Fix Workflow
Fix $ARGUMENTS using this systematic process.
Step 1: Investigation (parallel)
- Search for related issues:
gh issue list --label bug - Search error patterns:
rg "unwrap\(\)|expect\(" src/andrg "TODO|FIXME" src/ - Review recent commits for potential causes:
git log --oneline -20
Step 2: Reproduction
- Extract error messages and affected context
- Create a minimal failing test:
#[test] fn test_reproduce_issue() { // Minimal reproduction } - Verify the issue:
cargo test test_reproduce_issue -- --nocapture
Step 3: Root Cause Analysis
Common categories in this project:
- Parsing: Malformed JSONL handling
- Date/Time: Timezone or format issues
- Paths: Cross-platform path handling
- Memory: Large file processing
- Display: Terminal width/color issues
Step 4: Fix Implementation
- Add a failing test first
- Implement the fix
- Verify the test passes
- Check for regressions
Step 5: Verification
cargo test <specific_test>
cargo test
cargo test --all-features
Step 6: Regression Prevention
Add a dedicated regression test to prevent recurrence:
#[cfg(test)]
mod regression_tests {
#[test]
fn issue_NNN_description() {
// Ensure this specific issue doesn't reoccur
}
}
Checklist
- Issue reproduced locally
- Root cause identified
- Fix implemented with tests
- No regressions introduced
- Performance impact assessed