import { type PreparedNativeWorkspace } from './native-workspace-preparation.js'; import type { CometProjectConfig } from './native-types.js'; import type { NativePortableState } from './native-portable-types.js'; import type { NativeChildrenContract, NativeChildrenInspection } from './native-children.js'; import type { NativeProjectPaths } from './native-types.js'; export declare const NATIVE_SUPERVISOR_SCHEMA: "comet.native.supervisor.v2"; export type NativeSupervisorChildStatus = 'pending' | 'ready' | 'active' | 'verified' | 'integrated' | 'archived' | 'blocked' | 'needs-reverify'; export interface NativeSupervisorVerificationEvidence { summary: string; checks: string[]; } export interface NativeSupervisorIntegrationCheck { name: string; status: 'passed' | 'failed' | 'incomplete'; reason?: string | null; } export interface NativeSupervisorTask { role: 'builder' | 'verifier'; child: string; projectRoot: string; baseCommit: string; runId: string; } export interface NativeSupervisorEvent { kind: 'task-dispatched' | 'task-reconnected' | 'task-cancelled' | 'task-blocked' | 'builder-result' | 'verifier-result' | 'child-integrated' | 'child-verified' | 'integration-head-reconciled' | 'target-refreshed' | 'delivery-reconciled'; child: string | null; runId: string | null; summary: string; at: string; } export interface NativeSupervisorChildState { name: string; summary: string | null; dependsOn: string[]; status: NativeSupervisorChildStatus; baseCommit: string | null; candidateCommit: string | null; verifiedCommit: string | null; integrationCommit: string | null; verification: NativeSupervisorVerificationEvidence | null; checks: NativeSupervisorIntegrationCheck[]; blocker: string | null; /** Last known Child worktree; retained after a task completes for recovery/status. */ projectRoot?: string | null; task: NativeSupervisorTask | null; } export interface NativeSupervisorState { schema: typeof NATIVE_SUPERVISOR_SCHEMA; stateVersion: number; parent: string; integration: { branch: string; worktree: string; targetBranch: string; targetCommit: string; headCommit: string; }; children: NativeSupervisorChildState[]; history: NativeSupervisorEvent[]; finalVerification: { status: 'pending' | 'passed' | 'failed' | 'incomplete'; summary: string | null; layers?: { childVerification: 'complete' | 'incomplete'; parentIntegration: 'complete' | 'incomplete'; parentChecks: string[]; notRerun: string[]; incomplete: string[]; }; }; } export declare function nativeSupervisorIntegrationBranch(parent: string): string; export declare function nativeSupervisorIntegrationWorktree(projectRoot: string, parent: string): string; export declare function nativeSupervisorChildWorktree(projectRoot: string, parent: string, child: string): string; export declare function prepareNativeSupervisorIntegrationWorkspace(options: { projectRoot: string; parent: string; targetBranch: string; sourceConfig: CometProjectConfig | null; }): Promise; export declare function prepareNativeSupervisorChildWorkspace(options: { projectRoot: string; parent: string; child: string; targetBranch: string; sourceConfig: CometProjectConfig | null; }): Promise; export declare function nativeSupervisorRuntimeDir(paths: Pick, parent: string): string; export declare function nativeSupervisorStateFile(paths: Pick, parent: string): string; export declare function readNativeSupervisorState(paths: Pick, parent: string): Promise; export declare function writeNativeSupervisorState(paths: Pick, state: NativeSupervisorState): Promise; export declare function createNativeSupervisorState(options: { parent: string; targetBranch: string; targetCommit: string; integrationBranch: string; integrationWorktree: string; contract: NativeChildrenContract; }): NativeSupervisorState; /** * Reconstruct a Supervisor state when the machine-only runtime file was lost. * Git can prove the integration branch/worktree, but without portable Child * verification evidence it must not invent `verified` or `integrated` facts. */ export declare function rebuildNativeSupervisorStateFromFacts(options: { paths: NativeProjectPaths; parent: string; targetBranch: string; contract: NativeChildrenContract; }): Promise; export declare function reconcileNativeSupervisorState(options: { state: NativeSupervisorState; contract: NativeChildrenContract; }): NativeSupervisorState; export declare function markNativeSupervisorChildVerified(state: NativeSupervisorState, options: { name: string; baseCommit: string; verifiedCommit: string; evidence: NativeSupervisorVerificationEvidence; }): NativeSupervisorState; export declare function createNativeSupervisorTask(state: NativeSupervisorState, options: Omit): { state: NativeSupervisorState; task: NativeSupervisorTask; }; export declare function reconnectNativeSupervisorTask(state: NativeSupervisorState, options: { child: string; runId: string; }): NativeSupervisorTask; /** Reconnect a task and return the auditable state transition for persistence. */ export declare function reconnectNativeSupervisorTaskWithState(state: NativeSupervisorState, options: { child: string; runId: string; }): { state: NativeSupervisorState; task: NativeSupervisorTask; }; export declare function cancelNativeSupervisorTask(state: NativeSupervisorState, options: { child: string; runId: string; reason: string; }): NativeSupervisorState; export declare function blockNativeSupervisorTask(state: NativeSupervisorState, options: { child: string; runId: string; reason: string; }): NativeSupervisorState; export declare function dispatchNativeSupervisorReadyTasks(options: { paths: NativeProjectPaths; parent: string; maxParallel?: number; }): Promise<{ state: NativeSupervisorState; tasks: NativeSupervisorTask[]; }>; export declare function applyNativeSupervisorBuilderResult(state: NativeSupervisorState, options: { child: string; runId: string; candidateCommit: string; }): NativeSupervisorState; export declare function applyNativeSupervisorVerifierResult(state: NativeSupervisorState, options: { child: string; runId: string; verdict: 'pass' | 'fail' | 'incomplete'; evidence: NativeSupervisorVerificationEvidence; }): NativeSupervisorState; export declare function integrateNativeSupervisorChild(state: NativeSupervisorState, options: { name: string; integrationCommit: string; checks: NativeSupervisorIntegrationCheck[]; }): NativeSupervisorState; /** * Merge one verified Child into the dedicated integration worktree. * * Git is the source of truth for the resulting integration commit. A failed * merge deliberately leaves the worktree in place for diagnosis and does not * advance the persisted Supervisor state. */ export declare function integrateNativeSupervisorChildWorkspace(options: { paths: NativeProjectPaths; state: NativeSupervisorState; name: string; checks: NativeSupervisorIntegrationCheck[]; }): Promise; export declare function assertNativeSupervisorTargetUnchanged(projectRoot: string, state: NativeSupervisorState): string; /** * Bring a drifted target into the isolated integration branch. The target is * never modified here; the caller must rerun parent checks before delivery. */ export declare function refreshNativeSupervisorTarget(options: { paths: NativeProjectPaths; state: NativeSupervisorState; }): Promise; export declare function recordNativeSupervisorFinalVerification(state: NativeSupervisorState, options: { status: 'passed' | 'failed' | 'incomplete'; summary: string; headCommit: string; layers: NonNullable; }): NativeSupervisorState; /** * Record a final verification against the actual integration workspace HEAD. * Parent-level review fixes may legitimately advance that branch after the * final Child integration, but only a clean forward descendant can become the * verified delivery commit. */ export declare function advanceNativeSupervisorFinalVerificationHead(state: NativeSupervisorState): NativeSupervisorState; /** Recover the Supervisor half of a final result already persisted in Portable State. */ export declare function recordNativeSupervisorPortableFinalVerification(state: NativeSupervisorState, portable: NativePortableState): NativeSupervisorState; declare function finalizeNativeSupervisorDeliveryLocked(options: { paths: NativeProjectPaths; state: NativeSupervisorState; }): Promise<{ state: NativeSupervisorState; targetRoot: string; targetCommit: string; }>; export declare function finalizeNativeSupervisorDelivery(options: { paths: NativeProjectPaths; state: NativeSupervisorState; }): Promise<{ state: NativeSupervisorState; targetRoot: string; targetCommit: string; }>; /** * Run the final target delivery while an enclosing Portable Archive transaction * already owns the Native mutation lock. */ export { finalizeNativeSupervisorDeliveryLocked }; export declare function projectNativeSupervisorChildren(state: NativeSupervisorState): NativeChildrenInspection; //# sourceMappingURL=native-supervisor.d.ts.map