/** * Assignment Control Service (2.11.0). * * The authoritative application/operator boundary over the durable mission ↔ * executor assignment domain. It never schedules, never auto-selects executors, * and never starts mission work merely by creating an assignment. * * - `assignMission` designates a mission for an executor. * - `reassignMission` explicitly supersedes the current designation. * - `releaseAssignment` removes a designation without cancelling work. * - `acceptAssignment` a current runtime claims the assignment. * - `beginAssignedExecution` persists the EXECUTING intent + owner correlation. * - `startAssignedMission` drives the existing fenced child-resume path. * * Execution ownership (`ExecutionLease`/`fencingToken`) and executor runtime * incarnation (`runtimeInstanceId`/`runtimeEpoch`) remain separate authority * domains; the assignment only records logical designation and audit metadata. */ import { type BuiltChildResume } from "../durable-child-session/child-session-restore.js"; import type { ExecutorControlService, ExecutorRuntimeProof } from "../executor-registry/index.js"; import type { DurableMissionRecord, DurableMissionStore } from "../mission-domain/durable-store.js"; import type { ProcessMissionVerifier } from "../mission-domain/process-mission-executor.js"; import type { SessionManager } from "../session-manager.js"; import type { AssignmentStore } from "./assignment-store.js"; import { type AcceptAssignmentOutcome, type AssignabilityResult, type AssignMissionInput, type AssignMissionOutcome, type AssignmentDetail, type AssignmentListOptions, type AssignmentListResult, type AssignmentRecord, type AssignmentSummary, type BeginAssignedExecutionOutcome, type CompleteAssignmentInput, type CompleteAssignmentOutcome, type MissionRequirements, type ReassignMissionInput, type StartAssignedMissionOutcome } from "./assignment-types.js"; /** Maps a resume to the concrete child CLI launch (mirrors Mission Control). */ export type BuildAssignedResumeLaunch = (input: { request: DurableMissionRecord["request"]; resumePrompt: string; childSessionId: string; }) => { command: string; args: readonly string[]; cwd: string; env?: Record; }; /** * Builds the executor for a resolved durable child session. Defaults to the * local `ProcessMissionExecutor`; a remote worker injects a builder that * constructs a `RemoteMissionExecutor` bound to the same resolved session. */ export type BuildAssignedExecutor = (input: { record: DurableMissionRecord; sessionManager: SessionManager; childSessionId: string; assignmentId: string; }) => BuiltChildResume; export interface AssignmentControlServiceOptions { store: AssignmentStore; missions: DurableMissionStore; executors: ExecutorControlService; now?: () => number; assignmentIdFactory?: () => string; ownerIdFactory?: () => string; sessionDir?: string; leaseDurationMs?: number; heartbeatIntervalMs?: number; renewalSafetyMarginMs?: number; attemptIdFactory?: () => string; leaseIdFactory?: () => string; } export declare class AssignmentControlService { private readonly _store; private readonly _missions; private readonly _executors; private readonly _now; private readonly _assignmentIdFactory; private readonly _ownerIdFactory; private readonly _sessionDir?; private readonly _coordinatorOptions; constructor(options: AssignmentControlServiceOptions); get store(): AssignmentStore; listAssignments(options?: AssignmentListOptions): Promise; getAssignment(assignmentId: string): Promise; getCurrentForMission(missionId: string): Promise; listForMission(missionId: string): Promise; listForExecutor(executorId: string): Promise; /** Current designation per mission (for Mission Control / Executor Control views). */ listCurrentAssignments(): Promise>; /** Read-only deterministic compatibility/assignability for a mission↔executor pair. */ evaluateCompatibility(missionId: string, executorId: string, requirements?: MissionRequirements): Promise<{ missionId: string; executorId: string; requirements: MissionRequirements | undefined; assignability: AssignabilityResult; }>; assignMission(input: AssignMissionInput): Promise; reassignMission(missionId: string, newExecutorId: string, input?: Omit): Promise; releaseAssignment(assignmentId: string): Promise; acceptAssignment(assignmentId: string, proof: ExecutorRuntimeProof): Promise; beginAssignedExecution(assignmentId: string, proof: ExecutorRuntimeProof): Promise; startAssignedMission(assignmentId: string, proof: ExecutorRuntimeProof, options: { buildResumeLaunch: BuildAssignedResumeLaunch; signal?: AbortSignal; verifier?: ProcessMissionVerifier; /** Optional executor builder (remote); defaults to local ProcessMissionExecutor. */ buildExecutor?: BuildAssignedExecutor; }): Promise; completeAssignment(assignmentId: string, input: CompleteAssignmentInput): Promise; /** * Honest interruption of a previously-EXECUTING assignment after a worker * restart reconciliation. The mission (owned by the mission domain) is * reconciled separately to INTERRUPTED; this marks the assignment's * execution attempt FAILED so it is never silently re-executed and never * reported as a fabricated completion. */ interruptExecution(assignmentId: string, reason: string): Promise; private _toSummary; private _toDetail; private _unwrap; private _requireAssignment; private _requireMission; private _executorDetail; private _evaluateAssignability; private _assertAssignable; private _assertCurrentRuntime; private _requireNonTerminalMission; private _requireAcceptableMission; private _requireExecutableMission; private _failAssignment; } //# sourceMappingURL=assignment-control-service.d.ts.map