import type { SprintFile, WorkFile, WorkPromotionJournal, WorkPromotionPreview, WorkPromotionSidecar } from '../types'; export declare const PROMOTION_SCHEMA_VERSION: 1; export declare const PROMOTION_JOURNAL_NAME = ".pending-promotion.json"; export declare const PROMOTION_SIDECAR_NAME = "promotion-source.json"; export declare const PROMOTION_ORIGIN_NAME = "promotion-initial-sprint.json"; export interface PromotionRequest { toScope: string; actor: string; expectedRevision: number; } /** Workspace-relative path of the pending promotion journal for a Work. */ export declare function workPromotionJournalPath(id: string): string; /** Workspace-relative path of the reciprocal sidecar for a target scope. */ export declare function promotionSidecarPath(scope: string): string; export declare function promotionOriginPath(scope: string): string; /** * Canonical digest binding one exact promotion request. Any retry must present * the same source, target, actor, and revision to reproduce this digest; * anything else fails closed instead of overwriting the intent. */ export declare function promotionRequestDigest(workId: string, request: PromotionRequest): string; /** * Pure promotion planner. Reads nothing except an optional target-collision * probe (no writes); throws fail-closed before any caller publishes state. * * Transfer rules: * - Only unfinished, nonterminal tasks transfer (pending, in_progress, * awaiting_review). Verified and disposed tasks are named history, never imports. * - A blocked source task fails the whole promotion: it must be resolved first. * - A dependency on a disposed task fails the promotion: disposed prerequisites * never auto-rewire. * - A dependency on verified source work is dropped only with an explicit * adjudication naming that verified source. * - Wn maps deterministically to T1.n in transferred source order; edges among * transferred tasks are preserved. In-progress and awaiting-review tasks reset * to pending and the preview states that loss of approval. * - Work evidence, verdicts, and passes never become Forge approvals or QA. */ export declare function planPromotionPreview(work: WorkFile, request: PromotionRequest): WorkPromotionPreview; /** Fail closed when the destination already exists or the path is unsafe. */ export declare function assertPromotionTargetAvailable(toScope: string): void; /** * Build the reciprocal sidecar from a preview plus the exact digests of the * bytes the commit publishes. All digests bind external bytes; the sidecar * never hashes itself. */ export declare function buildPromotionSidecar(preview: WorkPromotionPreview, digests: { sourceDigest: string; targetDigest: string; promotedAt: string; }): WorkPromotionSidecar; /** * Dedicated promotion adapter: build the destination Forge scope document * through the SAME pure builders the `plan` command uses, without any of its * side effects (no applyPlan, no scope registration, no activeScope switch). * * The shell (scope title/objective/spec/roadmap) comes from buildPlanInitPlan; * Sprint 1 (phases, mapped tasks, derived handoff) comes from * buildPlanSprintPlan. Only the mapped Sprint 1 content differs from an * ordinary Forge plan: every imported task starts pending with null * evidence/verdict and carries its exact source identity in context. * The git-derived author is stripped so staged bytes are deterministic; * provenance lives in the reciprocal sidecar and the Work history. */ export declare function buildPromotionTargetSprint(work: WorkFile, preview: WorkPromotionPreview, options?: { allowExistingScope?: boolean; }): SprintFile; export declare const PROMOTION_STAGE_DIR_NAME = ".promotion-stage"; /** Confined hidden staging directory for one promotion target (never a runnable scope). */ export declare function promotionStageDir(workId: string, toScope: string): string; export interface StagedPromotionDestination { sprint: SprintFile; sprintBytes: string; sidecarBytes: string; targetDigest: string; stagedSprintPath: string; stagedSidecarPath: string; stagedOriginPath: string; } /** * Stage a validated Forge destination without touching the published Forge * tree, project.json, local.json (including activeScope), or the live Work. * Staged files land under a hidden Work-local directory that scope discovery * never treats as a scope. The caller must hold the state-writer lock. */ export declare function stagePromotionDestination(work: WorkFile, preview: WorkPromotionPreview, digests: { sourceDigest: string; promotedAt: string; }): StagedPromotionDestination; /** * Write the staged destination without the pre-publication availability * probe. Used by commit resume after the destination is legitimately * published; every byte is still rebuilt deterministically and compared to * the journal before publication or verification. */ export declare function writeStagedPromotionDestination(work: WorkFile, preview: WorkPromotionPreview, digests: { sourceDigest: string; promotedAt: string; }, options?: { allowExistingScope?: boolean; stage?: boolean; }): StagedPromotionDestination; export declare function throwInjectedPromotionFailure(boundary: string): void; /** Build the durable pending intent record from a preview plus staging digests. */ export declare function buildPromotionJournal(preview: WorkPromotionPreview, digests: { oldWorkDigest: string; newWorkDigest: string; stagedTargetDigest: string; preparedAt: string; }): WorkPromotionJournal; //# sourceMappingURL=promotion.d.ts.map