-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
refactoringCode refactoring without changing functionalityCode refactoring without changing functionalitytech-debtTechnical debt that needs addressingTechnical debt that needs addressing
Milestone
Description
Part of SRP Refactoring (Priority 1: Core Infrastructure)
Current Problem
cache_rebuild_internal()
in src/cache/builder.c is a 67-line function doing everything - violates SRP.
Refactoring Plan
Split into focused functions:
prepare_cache_rebuild()
- Setup temp directory and contextcollect_all_edges()
- Gather edges from journalbuild_edge_maps()
- Create forward/reverse mappingspersist_cache_data()
- Write bitmaps and treesfinalize_cache_commit()
- Create commit and update refs
Acceptance Criteria
- Original function replaced with orchestrator calling new functions
- Each new function has single responsibility
- Each function ≤ 20 lines
- Unit tests for each new function
- Integration tests still pass
- Performance not degraded
Technical Notes
- Use dependency injection for testability
- Extract pure functions where possible
- Document each function's responsibility
Related to SRP_REFACTORING_PLAN.md Priority 1.1
Metadata
Metadata
Assignees
Labels
refactoringCode refactoring without changing functionalityCode refactoring without changing functionalitytech-debtTechnical debt that needs addressingTechnical debt that needs addressing