mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-04 03:41:54 +00:00
refactor(ops): extract cmdRemove to src/cmd-remove.mjs and fix lock-utils export
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
7c8eeb939c
commit
637259a07a
4 files changed
+17
-5
No files matched your search
@@ -9,10 +9,11 @@ prompt: src/prompts/weekly/refactor-agent.md
|
||||
# Context
|
||||
|
||||
## Goal
|
||||
Refactor `src/ops.mjs` to improve modularity.
|
||||
Refactor `src/ops.mjs` to improve modularity and fix CI failures.
|
||||
|
||||
## Scope
|
||||
Extract `cmdRemove` and related helpers into `src/cmd-remove.mjs`.
|
||||
- Extract `cmdRemove` and related helpers into `src/cmd-remove.mjs`.
|
||||
- Fix `src/lock-utils.mjs` export issue causing CI syntax errors.
|
||||
|
||||
## Constraints
|
||||
- Preserve backward compatibility by re-exporting.
|
||||
|
||||
@@ -15,7 +15,7 @@ Extracted `cmdRemove` to `src/cmd-remove.mjs`.
|
||||
To adhere to separation of concerns and reduce the size of `src/ops.mjs` (>800 LOC).
|
||||
|
||||
## Decision
|
||||
Removed duplicate export of `mergeRelayList` in `src/lock-utils.mjs`.
|
||||
Restored explicit definition of `mergeRelayList` in `src/lock-utils.mjs` and removed it from re-export list.
|
||||
|
||||
## Rationale
|
||||
It caused syntax errors blocking execution.
|
||||
To resolve `SyntaxError: The requested module './lock-utils.mjs' does not provide an export named 'mergeRelayList'` observed in CI.
|
||||
+5
-1
@@ -3,7 +3,7 @@ import path from 'node:path';
|
||||
import { randomInt } from 'node:crypto';
|
||||
import { todayDateStr, getIsoWeekStr } from './utils.mjs';
|
||||
|
||||
export { relayListLabel, mergeRelayList } from './utils.mjs';
|
||||
export { relayListLabel } from './utils.mjs';
|
||||
|
||||
/**
|
||||
* Scans the local log directory to identify agents that have already completed their task
|
||||
@@ -62,6 +62,10 @@ export function withTimeout(promise, timeoutMs, timeoutMessage = 'Operation time
|
||||
]);
|
||||
}
|
||||
|
||||
export function mergeRelayList(primaryRelays, fallbackRelays) {
|
||||
return [...new Set([...primaryRelays, ...fallbackRelays])];
|
||||
}
|
||||
|
||||
const MAX_RANDOM = 281474976710655; // 2**48 - 1
|
||||
|
||||
export function secureRandom() {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
agent: refactor-agent
|
||||
cadence: weekly
|
||||
platform: codex
|
||||
---
|
||||
|
||||
Run completed successfully.
|
||||
Reference in new issue
Block a user