From 637259a07a4cbd8fa4b913d7d7a169e55b64c50f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 21 Feb 2026 20:38:30 +0000 Subject: [PATCH] refactor(ops): extract cmdRemove to src/cmd-remove.mjs and fix lock-utils export Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- src/context/CONTEXT_2026-02-21T20-22-19Z.md | 5 +++-- src/decisions/DECISIONS_2026-02-21T20-22-19Z.md | 4 ++-- src/lock-utils.mjs | 6 +++++- .../2026-02-21T20-36-33Z__refactor-agent__completed.md | 7 +++++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 task-logs/weekly/2026-02-21T20-36-33Z__refactor-agent__completed.md diff --git a/src/context/CONTEXT_2026-02-21T20-22-19Z.md b/src/context/CONTEXT_2026-02-21T20-22-19Z.md index 8af26e9..66a50e8 100644 --- a/src/context/CONTEXT_2026-02-21T20-22-19Z.md +++ b/src/context/CONTEXT_2026-02-21T20-22-19Z.md @@ -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. diff --git a/src/decisions/DECISIONS_2026-02-21T20-22-19Z.md b/src/decisions/DECISIONS_2026-02-21T20-22-19Z.md index 375af91..06e4e61 100644 --- a/src/decisions/DECISIONS_2026-02-21T20-22-19Z.md +++ b/src/decisions/DECISIONS_2026-02-21T20-22-19Z.md @@ -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. diff --git a/src/lock-utils.mjs b/src/lock-utils.mjs index 69fc281..7abcad2 100644 --- a/src/lock-utils.mjs +++ b/src/lock-utils.mjs @@ -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() { diff --git a/task-logs/weekly/2026-02-21T20-36-33Z__refactor-agent__completed.md b/task-logs/weekly/2026-02-21T20-36-33Z__refactor-agent__completed.md new file mode 100644 index 0000000..ee4f3ce --- /dev/null +++ b/task-logs/weekly/2026-02-21T20-36-33Z__refactor-agent__completed.md @@ -0,0 +1,7 @@ +--- +agent: refactor-agent +cadence: weekly +platform: codex +--- + +Run completed successfully. \ No newline at end of file