import { KYRO_STATE_PATH, PROJECT_STATE_PATH } from '../constants'; import { type RegistryClassification } from '../project/reconcile'; import type { Convention, KyroScopeEntry, SprintFile } from '../types'; export declare const INTEGRITY_REPAIR_KIND: "kyro.integrity-repair"; export declare const INTEGRITY_REPAIR_SCHEMA_VERSION: 1; interface IntegrityCanonicalizationTarget { scope: string; sprintN: number; sprintSlug: string; } interface IntegrityAdrTarget { id: string; title: string; } interface IntegrityLedgerReanchorTarget { sprintN: number; sprintSlug: string; from: string; to: string; } interface IntegrityLiveTarget { scope: string; conventions: Convention[]; adrs: IntegrityAdrTarget[]; ledgerReanchors: IntegrityLedgerReanchorTarget[]; } interface IntegrityActiveScopeTarget { before: string | null; after: string | null; } interface IntegrityCheckpointCommitment { path: string; sha256: string; } interface IntegrityLiveStateCommitment { scope: string; sha256: string; } export interface IntegrityBeforeCommitments { projectSha256: string; checkpointFiles: IntegrityCheckpointCommitment[]; liveStates: IntegrityLiveStateCommitment[]; } export interface IntegrityTargets { register: string[]; unregister: string[]; canonicalize: IntegrityCanonicalizationTarget[]; live: IntegrityLiveTarget[]; activeScope: IntegrityActiveScopeTarget; } export type IntegrityOperation = { kind: 'registry.register-on-disk'; scope: string; entry: KyroScopeEntry; } | { kind: 'registry.unregister-orphan'; scope: string; entry: KyroScopeEntry; reason: string; } | { kind: 'legacy-scope.discard'; scope: string; sourcePath: typeof PROJECT_STATE_PATH | typeof KYRO_STATE_PATH; sourceSha256: string; afterSha256: string; entry: Record; reason: string; } | { kind: 'checkpoint.canonicalize'; scope: string; sprintN: number; sprintSlug: string; originalPath: string; originalSha256: string; reason: string; } | { kind: 'convention.append'; scope: string; expectedConventionCollectionSha256: string; after: Convention; reason: string; } | { kind: 'adr.append'; scope: string; expectedAdrCollectionSha256: string; after: NonNullable[number]; reason: string; } | { kind: 'ledger.checkpoint.reanchor'; scope: string; sprintN: number; sprintSlug: string; expectedOldSha256: string; afterSha256: string; reason: string; }; export type IntegrityFindingClass = 'register' | 'unregister' | 'canonicalize' | 'live' | 'activeScope' | 'blocker'; export type IntegrityBlockerCode = 'unsupported' | 'diverged' | 'irreconcilable' | 'identity-conflict' | 'legacy-registered-orphan' | 'unrecoverable' /** sprint.json is gone but a usable close checkpoint can resume the scope. */ | 'recoverable-no-sprint' /** Kyro artifacts are present but nothing here can be resumed. */ | 'owned-damaged'; export interface IntegrityFinding { class: IntegrityFindingClass; summary: string; code?: IntegrityBlockerCode; } export interface IntegrityPlan { schemaVersion: typeof INTEGRITY_REPAIR_SCHEMA_VERSION; kind: typeof INTEGRITY_REPAIR_KIND; targets: IntegrityTargets; findings: IntegrityFinding[]; blockers: IntegrityFinding[]; operations: IntegrityOperation[]; beforeCommitments: IntegrityBeforeCommitments; digest: string; kyroVersion: string; classifications: RegistryClassification[]; } export interface IntegrityWarrant { schemaVersion: typeof INTEGRITY_REPAIR_SCHEMA_VERSION; kind: typeof INTEGRITY_REPAIR_KIND; id: string; digest: string; targets: IntegrityTargets; operations: IntegrityOperation[]; beforeCommitments: IntegrityBeforeCommitments; actor: string; kyroVersion: string; createdAt: string; } export interface IntegrityApprovalPayload { targets: IntegrityTargets; operations: IntegrityOperation[]; beforeCommitments: IntegrityBeforeCommitments; kyroVersion: string; } export declare function integrityApprovalDigest(payload: IntegrityApprovalPayload): string; export declare function validateIntegrityWarrant(value: unknown, path: string): string[]; export declare function integrityRepairsDir(): string; export declare function prepareIntegrityPlan(options: { kyroScope?: string | null; reason?: string; }): IntegrityPlan; export declare function formatIntegritySummary(plan: IntegrityPlan): string; export {}; //# sourceMappingURL=integrity-plan.d.ts.map