import { type RuntimeTreePosture, type VerifiedRuntimeManifest } from './runtime-manifest.js'; import { type RuntimePromotionFilesystemCapabilityState } from './runtime-promotion-filesystem-authority.js'; import type { StablePromotionDirectory } from './runtime-promotion-filesystem-io.js'; import type { RuntimePromotionFilesystemMutation, RuntimePromotionArtifactMarker } from './runtime-promotion-filesystem-types.js'; import type { RuntimeManifestIdentity, RuntimePromotionJournal } from './runtime-promotion-journal-schema.js'; type RuntimeFilesystemSlot = 'destinationParent' | 'runtimeStage' | 'destinationBackup' | 'sourceTombstone'; export declare function encodedOwnedMarker(journal: RuntimePromotionJournal, slot: RuntimeFilesystemSlot, purpose: RuntimePromotionArtifactMarker['purpose'], manifest: RuntimeManifestIdentity | null, rootIdentity?: RuntimePromotionArtifactMarker['rootIdentity']): string; export type BoundOwnedMarkerInspection = { readonly status: 'absent'; } | { readonly status: 'exact'; readonly content: string; readonly rootIdentity: NonNullable; } | { readonly status: 'mismatch'; }; export declare function inspectBoundOwnedMarker(markerPath: string, rootPath: string, journal: RuntimePromotionJournal, slot: RuntimeFilesystemSlot, purpose: RuntimePromotionArtifactMarker['purpose'], manifest: RuntimeManifestIdentity | null): BoundOwnedMarkerInspection; export declare function ensurePromotionMarker(parent: StablePromotionDirectory, path: string, content: string, state: RuntimePromotionFilesystemCapabilityState, operation: RuntimePromotionFilesystemMutation, allowPartial: boolean, revalidateBeforeCreate?: () => void): void; interface EnsureBoundOwnerMarkerInput { readonly state: RuntimePromotionFilesystemCapabilityState; readonly parent: StablePromotionDirectory; readonly root: string; readonly markerPath: string; readonly slot: 'destinationBackup' | 'sourceTombstone'; readonly expected: RuntimeManifestIdentity; readonly operation: Extract; } /** * Publish or replay an owner marker whose canonical bytes name the exact * artifact inode. A byte-identical replacement therefore cannot inherit * destructive rollback or cleanup authority. */ export declare function ensureBoundOwnerMarker(input: EnsureBoundOwnerMarkerInput): Extract; export declare function openExactDestinationParent(state: RuntimePromotionFilesystemCapabilityState): StablePromotionDirectory; export declare function assertEmptyPromotionDirectory(path: string): void; export declare function inspectExactRuntimeManifest(path: string, posture: Extract, expected: RuntimeManifestIdentity): VerifiedRuntimeManifest; interface CleanupOwnedRuntimeTreeInput { readonly state: RuntimePromotionFilesystemCapabilityState; readonly parent: StablePromotionDirectory; readonly root: string; readonly slot: Exclude; readonly expected: RuntimeManifestIdentity; readonly externalOwner?: { readonly path: string; readonly content: string; }; /** * Required before the cleanup-start marker is durable. It may validate a * complete manifest or a narrowly recoverable incomplete stage. */ readonly verifyBefore: () => void; /** * Runs inside every destructive mutation after its before-checkpoint. Closed * cleanup supplies its terminal-authority guard; transactional stage cleanup * supplies its stable parent authority. Unlike verifyBefore, it must remain * valid after partial tree removal. */ readonly revalidateBeforeMutation: () => void; } /** * Publish a separate cleanup-start proof before the first recursive unlink. * Once durable, it authorizes bounded idempotent continuation of a partial * cleanup without pretending the now-incomplete tree still has its old digest. */ export declare function cleanupOwnedRuntimeTree(input: CleanupOwnedRuntimeTreeInput): boolean; export declare function artifactPresence(path: string): 'absent' | 'directory'; export {}; //# sourceMappingURL=runtime-promotion-filesystem-operation-helpers.d.ts.map