import type { CampaignStatus, TaskActivity, TaskHealth } from "./types.js"; /** One list owns the persisted ResultAuthority schema. */ export declare const RESULT_AUTHORITY_KEYS: readonly ["run_id", "run_version", "run_status", "deadline_at", "needs_human", "needs_human_reason", "workspace_root", "goal_version", "repository", "source_digest", "source_snapshot", "task_id", "task_version", "attempt", "max_attempts", "activity", "health", "pending_verification", "advice_operation_id", "engine", "model", "policy_digest", "capability_evidence_digest", "pane_id", "provider_session_id", "launch_operation_id", "launch_identity_digest", "worktree_operation_id", "worktree_identity_digest", "worktree_id", "worktree_path", "worktree_branch", "base_commit", "git_dir", "common_git_dir", "pending_result_operation_id", "pending_result_digest", "lineage_operation_id", "lineage_digest", "delivery_auth_operation_id", "delivery_auth_digest", "result_commit"]; /** Binding keys = authority keys + operation_id + fingerprint + identity (no second field list). */ export declare const RESULT_BINDING_KEYS: readonly ["operation_id", "run_id", "run_version", "run_status", "deadline_at", "needs_human", "needs_human_reason", "workspace_root", "goal_version", "repository", "source_digest", "source_snapshot", "task_id", "task_version", "attempt", "max_attempts", "activity", "health", "pending_verification", "advice_operation_id", "engine", "model", "policy_digest", "capability_evidence_digest", "pane_id", "provider_session_id", "launch_operation_id", "launch_identity_digest", "worktree_operation_id", "worktree_identity_digest", "worktree_id", "worktree_path", "worktree_branch", "base_commit", "git_dir", "common_git_dir", "pending_result_operation_id", "pending_result_digest", "lineage_operation_id", "lineage_digest", "delivery_auth_operation_id", "delivery_auth_digest", "result_commit", "authority_fingerprint", "identity_digest"]; export type ResultAuthorityKey = (typeof RESULT_AUTHORITY_KEYS)[number]; export type ResultBindingKey = (typeof RESULT_BINDING_KEYS)[number]; export interface ResultAuthority { readonly run_id: string; readonly run_version: number; readonly run_status: CampaignStatus; readonly deadline_at: string; readonly needs_human: boolean; readonly needs_human_reason: string | null; readonly workspace_root: string; readonly goal_version: number; readonly repository: string | null; readonly source_digest: string; readonly source_snapshot: Readonly>; readonly task_id: string; readonly task_version: number; readonly attempt: number; readonly max_attempts: number; readonly activity: TaskActivity; readonly health: TaskHealth; readonly pending_verification: true; readonly advice_operation_id: string; readonly engine: "claude" | "codex"; readonly model: string; readonly policy_digest: string; readonly capability_evidence_digest: string; readonly pane_id: string; readonly provider_session_id: string; readonly launch_operation_id: string; readonly launch_identity_digest: string; readonly worktree_operation_id: string; readonly worktree_identity_digest: string; readonly worktree_id: string; readonly worktree_path: string; readonly worktree_branch: string; readonly base_commit: string; readonly git_dir: string; readonly common_git_dir: string; readonly pending_result_operation_id: string; readonly pending_result_digest: string; readonly lineage_operation_id: string | null; readonly lineage_digest: string | null; readonly delivery_auth_operation_id: string | null; readonly delivery_auth_digest: string | null; readonly result_commit: string; } /** * Immutable full-identity result binding for one run/task/attempt. * Authority fields + operation_id + fingerprint + identity_digest. */ export interface ResultCommitBinding extends ResultAuthority { readonly operation_id: string; readonly authority_fingerprint: string; readonly identity_digest: string; } export type ResultAuthorityContext = Omit; export { resultCommitOpId } from "./result-op-ids.js"; /** Fingerprint hashes only {stage:"result_authority_v2", authority}. */ export declare function resultAuthorityFingerprint(authority: ResultAuthority): string; /** Binding identity hashes only {stage, operation_id, authority_fingerprint}. */ export declare function resultBindingIdentityDigest(operationId: string, authorityFingerprint: string): string; /** * Validate and freeze the complete ResultAuthority once. * Enforces result-path semantics (active, not needs_human, pending, attempt bounds, lineage pair). */ export declare function buildResultAuthority(input: ResultAuthority): ResultAuthority; /** * Pure exact builder for a full result binding. Does not write journal. * Recomputes fingerprint + identity through the shared formulas. */ export declare function buildResultCommitBinding(input: { readonly operation_id: string; readonly authority: ResultAuthority; }): ResultCommitBinding; /** * Exact binding-record parser: kind result_commit, journal/run equality, * canonical resultCommitOpId, rebuild authority, recompute fingerprint + identity. */ export declare function parseResultCommitBinding(record: { readonly operation_id: string; readonly kind: string; readonly run_id: string; readonly payload: Readonly>; }): ResultCommitBinding; /** Authority slice of a parsed binding (for basis:"binding" resolve). */ export declare function authorityFromBinding(binding: ResultCommitBinding): ResultAuthority; export declare const DELIVERY_AUTH_KEYS: readonly ["workspace_root", "repository", "remote", "base_branch", "allowed_ops", "allow_force", "allow_merge", "allow_spend", "digest"]; export interface DeliveryAuthorization { readonly workspace_root: string; readonly repository: string; readonly remote: string; readonly base_branch: string; readonly allowed_ops: readonly ("push" | "draft_pr")[]; readonly allow_force: false; readonly allow_merge: false; readonly allow_spend: false; } export declare function deliveryAuthorizationDigest(auth: DeliveryAuthorization): string; export declare function parseDeliveryAuthorizationPayload(payload: Readonly>, expected: DeliveryAuthorization & { readonly digest: string; }): void; /** * Canonical exact binding-equality helper (7A.3B.1 §E.2). */ export declare function assertResultCommitBindingsEqual(actual: ResultCommitBinding, expected: ResultCommitBinding): void;