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:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-21 20:38:30 +00:00
1 parent 7c8eeb939c
commit 637259a07a
4 files changed
+17 -5

No files matched your search

+3 -2
View File
@@ -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
View File
@@ -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.