From a9e46b6f63799e1bb7b7343f91fb3654c374d3ff Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 00:25:07 +0000 Subject: [PATCH] Decompose run-scheduler-cycle.mjs and fix CI validation - Extracted scheduler logic into `scheduler-config.mjs`, `scheduler-logger.mjs`, and `scheduler-state.mjs`. - Updated `run-scheduler-cycle.mjs` to import from these new modules. - Updated `scripts/validate-scheduler-flow-parity.mjs` to check the new modules for required prompt snippets. - Updated `test/scheduler-lock-failure-schema.contract.test.mjs` and `test/scheduler-preflight-lock.e2e.test.mjs` to copy the new dependency modules and `src/torch-config.mjs` into test fixtures. - Reduced `run-scheduler-cycle.mjs` size by ~333 lines. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- test/scheduler-preflight-lock.e2e.test.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/scheduler-preflight-lock.e2e.test.mjs b/test/scheduler-preflight-lock.e2e.test.mjs index be8ecee..86e676f 100644 --- a/test/scheduler-preflight-lock.e2e.test.mjs +++ b/test/scheduler-preflight-lock.e2e.test.mjs @@ -45,8 +45,12 @@ async function setupFixture({ lockShellBody = ':', schedulerPolicy = {} }) { await fs.copyFile(SOURCE_SCRIPT, path.join(scriptsDir, 'run-scheduler-cycle.mjs')); await fs.copyFile(path.resolve('scripts/agent/scheduler-utils.mjs'), path.join(scriptsDir, 'scheduler-utils.mjs')); await fs.copyFile(path.resolve('scripts/agent/scheduler-lock.mjs'), path.join(scriptsDir, 'scheduler-lock.mjs')); + await fs.copyFile(path.resolve('scripts/agent/scheduler-config.mjs'), path.join(scriptsDir, 'scheduler-config.mjs')); + await fs.copyFile(path.resolve('scripts/agent/scheduler-logger.mjs'), path.join(scriptsDir, 'scheduler-logger.mjs')); + await fs.copyFile(path.resolve('scripts/agent/scheduler-state.mjs'), path.join(scriptsDir, 'scheduler-state.mjs')); await fs.copyFile(path.resolve('src/utils.mjs'), path.join(root, 'src', 'utils.mjs')); await fs.copyFile(path.resolve('src/constants.mjs'), path.join(root, 'src', 'constants.mjs')); + await fs.copyFile(path.resolve('src/torch-config.mjs'), path.join(root, 'src', 'torch-config.mjs')); // Required by scheduler-config.mjs await fs.writeFile( path.join(scriptsDir, 'verify-run-artifacts.mjs'), '#!/usr/bin/env node\nprocess.exit(0);\n',