[decompose] extract modules from src/lib.mjs

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-14 13:18:07 +00:00
1 parent c731f2b09d
commit 581dc3484e
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.