Merge pull request #58 from PR0M3TH3AN/agents/daily/decompose-agent-v1-14520720754219938139

[decompose] Extract modules from src/lib.mjs
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-14 08:51:26 -05:00
commit e67d8441a4
12 files changed
+429 -528

No files matched your search

+14 -12
View File
@@ -1,14 +1,16 @@
# Context: 2026-02-14 Constants Refactor
# Context: Decompose src/lib.mjs
## Chosen File
`src/lib.mjs` (approx 700 lines).
## Reason for Selection
It is one of the largest grandfathered files (excluding HTML files which are harder to module-decompose). It contains mixed concerns: roster management, lock operations, and dashboard server logic.
## Extraction Plan
1. Extract roster logic to `src/roster.mjs`.
2. Extract lock operations to `src/lock-ops.mjs`.
3. Extract dashboard logic to `src/dashboard.mjs`.
4. Move configuration helpers to `src/torch-config.mjs` and constants to `src/constants.mjs`.
## Goal
To refactor duplicate or magic numeric literals into a canonical constants file.
Specifically targeting `4173` (default dashboard port) and `1500` (race check delay).
## Scope
- Create `src/constants.mjs`.
- Modify `src/lib.mjs`.
## Constraints
- Must preserve existing values.
- Must pass lint and tests.
- Must follow `const-refactor-agent` guidelines.
Reduce `src/lib.mjs` by at least 200 lines while preserving behavior.