export { canonicalJson, sha256 } from '../core/digest'; import { type ActiveSprint, type KyroScopeEntry, type SprintCloseCheckpointV1, type SprintCloseInputs, type SprintFile } from '../types'; /** * Path reported/written for the project-scope CAS during sprint close. * Layers prefer shared project.json; monolito dual-read keeps kyro.json until migrated. */ export declare function projectScopeWritePath(): string; export interface SprintCloseCheckpointMaterials { scope: string; active: ActiveSprint; createdAt: string; close: SprintCloseInputs; legacySnapshotPath: string; narrativePath: string; beforeClose: SprintFile; intendedAfterClose: SprintFile; projectScopeBefore: KyroScopeEntry; projectScopeAfter: KyroScopeEntry; legacySnapshotContent: string; narrativeContent: string; } export interface SprintCloseTransaction { checkpointPath: string; checkpoint: SprintCloseCheckpointV1; checkpointContent: string; legacySnapshotContent: string; narrativeContent: string; } export interface SprintCloseApplyResult { checkpointPath: string; checkpointId: string; resumed: boolean; } /** * Commitment anchored outside the archive in ledger[].checkpointSha256. * The commitment excludes self-derived digests and its own ledger field, avoiding a hash cycle * while still protecting the complete before/after images, identity, close inputs and paths. */ export declare function checkpointCommitment(checkpoint: SprintCloseCheckpointV1): string; /** * Commitment for a checkpoint that has been parsed but not schema-validated. * * A checkpoint is historical evidence: it is proven by its recorded commitment, not by the schema * Kyro happens to enforce today. A scope closed before a contract was tightened embeds a state that * the current strict validator rejects — remediation exists precisely for that case, so it must be * able to verify the checkpoint is untampered without first demanding it pass the new rules. */ export declare function checkpointCommitmentOfRecord(value: unknown): string; export declare function buildSprintCloseCheckpoint(checkpointPath: string, materials: SprintCloseCheckpointMaterials): SprintCloseTransaction; export declare function deriveSprintCloseTransition(beforeClose: SprintFile, projectScopeBefore: KyroScopeEntry, close: SprintCloseInputs, createdAt: string, legacySnapshotPath: string, narrativePath: string, checkpointPath: string): { intendedAfterClose: SprintFile; projectScopeAfter: KyroScopeEntry; }; /** * Historical intermediate checkpoint v1 residual shape (4.19.0–4.43.0): remaining sprints kept * `projectScopeAfter.status = 'active'` by copying the before entry. New writes emit `planning`. * Read-time validate/doctor accept this residual only when the stored after entry is the exact * copy of an active before entry that historical v1 writers emitted. There is no writer-version * field on the checkpoint — match the complete observable write shape instead. */ export declare function isLegacyIntermediateActiveScopeAfter(checkpoint: SprintCloseCheckpointV1): boolean; /** Normalized live after-image for historical intermediate residual `active` → canonical `planning`. */ export declare function legacyNormalizedProjectScopeAfter(checkpoint: SprintCloseCheckpointV1): KyroScopeEntry | null; export declare function readSprintCloseCheckpoint(path: string): SprintCloseCheckpointV1 | null; /** * Integrity issues only (structural, commitment, digests, paths, transitions). * A checkpoint with a valid commitment and no integrity issues is historical evidence, * even if its schema is stale. */ export declare function checkpointIntegrityIssues(value: unknown, path: string): string[]; /** * Schema issues only (embedded beforeClose and intendedAfterClose images fail current validator). * Returns the specific stale fields that fail the current schema. */ export declare function checkpointSchemaIssues(value: unknown, path: string): string[]; /** * Full validation (integrity + schema). Used by readSprintCloseCheckpoint (close-sprint writer) * to ensure new checkpoints meet all requirements. Historical checkpoints use checkpointIntegrityIssues * to separate evidence validity (commitment) from schema currency. */ export declare function validateSprintCloseCheckpoint(value: unknown, path: string): string[]; /** * A checkpoint is historical evidence if its commitment is valid (passes integrity checks) * even if the embedded schema is stale. Doctor reports it as historical with the specific * stale field named. */ export declare function isHistoricalCheckpoint(checkpoint: SprintCloseCheckpointV1, path: string): boolean; export declare function applySprintCloseTransaction(transaction: SprintCloseTransaction): SprintCloseApplyResult; /** * Create a file that must not already exist, durably. Exported so other immutable-artifact writers * (remediation records) inherit the same fsync + link + parent-fsync discipline rather than copying it. */ export declare function publishExclusive(path: string, content: string, label: string): void; /** Durable rename-based replacement of a managed file. Exported for the same reason as publishExclusive. */ export declare function atomicReplace(path: string, content: string): void; //# sourceMappingURL=sprint-close.d.ts.map