/** * autonomy/objective-run.ts — Typed ObjectiveRun schema (Phase B.1, F-194). * * An `ObjectiveRun` is the canonical, typed record of a single autonomous * task dispatch. It captures the goal, the constraints (allowed side * effects, forbidden paths, budget), the current phase, and the immutable * evaluator version so future readers can replay the run against the * exact rubric that scored it. * * Why this is a separate type (not embedded in `EvidenceBundle`): * - The `ObjectiveRun` is the *intent*: it is created before any * evidence is collected. The bundle is the *observation* that fills * the run in. * - Operators may inspect a queued or in-flight run before any * evidence exists; that requires a type that does not depend on * `EvidenceBundle`. * - Phase transitions (`planning` → `executing` → `verifying` → * `done` | `failed` | `cancelled`) are part of the run, not the * bundle. * * Invariants: * - `objectiveRunId` is a UUID v4 string generated server-side via * `newObjectiveRunId()`. Callers MUST NOT supply one. * - `createdAt` is stamped server-side; caller values are ignored. * - `evaluatorVersion` is required so the rubric that scored the run * is unambiguous at replay time. * - `budget` is in USD micro-cents (`uSD`) to avoid floating-point drift. */ /** * Schema version of `ObjectiveRun` (audit #84, P2 spec-sprawl reduction). * Bump on ANY breaking change to the schema (new required field, removed * field, or semantic change). Additive changes (new optional field) * bump the minor version. The factory and verifier both consult this * constant so a single source of truth exists. */ export declare const OBJECTIVE_RUN_SCHEMA_VERSION = "1.1.0"; /** Lifecycle phases of an `ObjectiveRun`. */ export type ObjectiveRunPhase = "planning" | "executing" | "verifying" | "reviewing" | "checkpointing" | "done" | "failed" | "cancelled" /** * `blocked` is NON-TERMINAL. It signals "cannot proceed without * external input" (matches OMX `$ultragoal` semantics). A blocked * run transitions back to `executing` on resume, not to `done` or * `failed`. Phase 1 OMX adoption (F-202) adds this value * additively; older deserializers reject it when the * `schemaVersion` mismatch is detected. */ | "blocked"; /** Runtime array of `ObjectiveRunPhase` values — kept in lock-step with the * type union above so JS callers and drift-guard tests can compare against * the same canonical list. The audit calls out drift between the typed * schema and the scheduler's runtime guards as a regression source. */ export declare const OBJECTIVE_PHASES: readonly ["planning", "executing", "verifying", "reviewing", "checkpointing", "done", "failed", "cancelled", "blocked"]; /** Terminal vs. in-flight status of an `ObjectiveRun`. */ export type ObjectiveRunStatus = "active" | "succeeded" | "failed" | "cancelled"; /** Runtime array of `ObjectiveRunStatus` values. See `OBJECTIVE_PHASES`. */ export declare const OBJECTIVE_STATUSES: readonly ["active", "succeeded", "failed", "cancelled"]; /** A single side effect the run is allowed to perform. */ export interface AllowedSideEffect { /** Side-effect class (e.g. `Bash`, `Edit`, `Write`). */ readonly kind: string; /** Optional narrower matcher (e.g. a glob or command prefix). */ readonly matcher?: string; } /** Budget in USD micro-cents (1 USD = 1_000_000 uSD). */ export interface Budget { readonly usd: number; /** Optional wall-clock cap in seconds; `undefined` means unbounded. */ readonly wallClockSeconds?: number; } /** Constraint envelope that gates an `ObjectiveRun`. */ export interface ObjectiveRunConstraints { /** Allow-list of side effects the run may invoke. */ readonly allowedSideEffects: ReadonlyArray; /** Absolute or relative paths the run MUST NOT touch. */ readonly forbiddenPaths: ReadonlyArray; /** Hard budget for the run; the orchestrator halts on overrun. */ readonly budget: Budget; } /** The typed record of a single autonomous task dispatch. */ export interface ObjectiveRun { readonly objectiveRunId: string; /** Free-form goal string supplied by the orchestrator. */ readonly goal: string; /** Optional repo-relative scope the run is constrained to. */ readonly scope?: string; /** Constraints gating the run. */ readonly constraints: ObjectiveRunConstraints; /** Current phase. */ readonly phase: ObjectiveRunPhase; /** Current status. */ readonly status: ObjectiveRunStatus; /** Rubric version that scored this run; required for replay parity. */ readonly evaluatorVersion: string; /** Schema version that produced this record (audit #84). */ readonly schemaVersion: string; /** Server-stamped ISO 8601 creation timestamp. */ readonly createdAt: string; /** Server-stamped ISO 8601 last-update timestamp. */ readonly updatedAt: string; } /** Generate a new server-side `objectiveRunId`. */ export declare function newObjectiveRunId(): string; /** * Create a new `ObjectiveRun`. Server-stamps `objectiveRunId`, the * timestamps, and the initial phase/status. The caller MUST supply * `goal`, `constraints`, and `evaluatorVersion`. */ export declare function createObjectiveRun({ goal, scope, allowedSideEffects, forbiddenPaths, budget, evaluatorVersion, }: { goal: string; scope?: string; allowedSideEffects: ReadonlyArray; forbiddenPaths: ReadonlyArray; budget: Budget; evaluatorVersion: string; }): ObjectiveRun; //# sourceMappingURL=objective-run.d.ts.map