-
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
journal_append_generic()
in src/journal/writer.c mixes buffer management, encoding, and batching logic.
Refactoring Plan
Split into focused functions:
prepare_journal_buffer()
- Allocate and manage bufferencode_edges_batch()
- CBOR encoding onlyshould_commit_batch()
- Batch size decision logiccommit_journal_batch()
- Commit creation only
Acceptance Criteria
- Original function replaced with orchestrator
- Buffer management separated from encoding
- Batching logic isolated and testable
- Each function has single responsibility
- Unit tests for each new function
- No regression in functionality
Technical Notes
- Consider extracting buffer management to separate module
- Make batch size configurable
- Ensure thread safety if needed
Related to SRP_REFACTORING_PLAN.md Priority 1.2
Metadata
Metadata
Assignees
Labels
refactoringCode refactoring without changing functionalityCode refactoring without changing functionalitytech-debtTechnical debt that needs addressingTechnical debt that needs addressing