import type { RunnerPlatform } from "./commands.js"; import type { WorkOrder } from "./prompts.js"; import type { TestRun } from "./types.js"; /** * CI job definitions the algorithm can execute remotely. The names refer * to jobs in the GitLab CI config — the job definition (docker image, * script, env) is the canonical environment — but here they are executed * DIRECTLY on the runner hardware, not by triggering a pipeline. */ export type RemoteJobName = "mobile-acceptance-tests" | "mobile-smoke-tests"; /** * Which runner fleet executes each job. All three lanes run on Android * today (the e2e CI decision is Android-only; the iOS acceptance and * smoke CI jobs exist but are not driven by the algorithm yet) — iOS * entries join here when the algorithm grows an iOS lane. */ export declare const RUNNER_FOR_JOB: Record; /** * Which binary each job drives: both device lanes (acceptance, smoke) * run against the release binary. Pre-building it is * a warm-cache and failure-isolation step — the job's own script would * build too (parity), but by then a build failure is entangled with the * run; built here first, it is its own classifiable step and the job's * internal build becomes a no-op. */ export declare const BUILD_FOR_JOB: Record; /** * Result of one composed remote attempt (see runRemoteJob in shared.ts, * which composes the CommandCatalog's remote group: acquireLock → * checkRunner → syncTree → ensureDevice → install → build → runJob → * fetchResults → releaseLock). Because the synced snapshot contains * EVERY agent's in-flight work, a run can fail without saying anything * about the tests. The failure class comes from WHICH step failed: * - environment steps (checkRunner, syncTree, ensureDevice after one * kill-and-retry) never touched the code → infrastructureFailure; * - code-bound steps (install, build, the job itself) are judged by the * RemoteRunJudge → brokenByOtherAgentsWork or a genuine result. */ export interface RemoteRunResult extends TestRun { /** * True when the run failed because of other agents' in-flight work in * the snapshot, not because of the tests. The caller waits for the * tree to reach a stable checkpoint and re-runs, exactly as the team * treats a pipeline broken by someone else's commit. */ brokenByOtherAgentsWork: boolean; /** * True when the run never got to say anything about the code at all: * emulator boot timeout, runner box unreachable, tree sync failure. * The caller retries the job (budgeted) — an infrastructure failure * must NEVER reach a repair loop or spend a test attempt budget. */ infrastructureFailure: boolean; } /** * The one genuinely intelligent step left in remote execution — every * mechanical part (the command sequence, the lock, the per-position * failure classes) is deterministic composition in shared.ts. A * code-bound step failed; only judgment can tell a snapshot broken by * another agent's half-finished edit (torn lockfile, mid-regeneration * OpenAPI code — build errors OUTSIDE the failing job's own scope) from * a failure that belongs to the job and must reach the repair loops. * Instructions arrive as order.prompt (the failure-judgment prompt). */ export interface RemoteRunJudge { wasBrokenByOtherAgentsWork(order: WorkOrder, step: string, output: string): Promise; }