export declare const NATIVE_DELTA_SCHEMA: "comet.native.delta.v1"; export declare const NATIVE_DELTA_FILE: "delta.yaml"; export type NativeDeltaOperationKind = 'add' | 'modify' | 'remove' | 'rename'; export interface NativeDeltaOperation { readonly id: string; readonly operation: NativeDeltaOperationKind; readonly to_id?: string; readonly title?: string; readonly body?: string; /** Hash of the addressed total-Spec requirement before this delta. */ readonly expected_hash?: string; } export interface NativeDeltaDocument { readonly schema: typeof NATIVE_DELTA_SCHEMA; /** Stable capability identity; it is intentionally independent of change name. */ readonly capability: string; readonly base_hash: string; readonly base_version: number; /** Hash of content outside managed Requirement sections for legacy migration safety. */ readonly legacy_hash?: string; /** Complete requirement hash snapshot used to detect uncertain cross-requirement impact. */ readonly base_requirements?: Readonly>; /** Explicit proof for requirements known to be independent of this delta. */ readonly independent_requirements?: Readonly>; readonly operations: readonly NativeDeltaOperation[]; } export interface NativeDeltaApplyResult { readonly markdown: string; readonly base_hash: string; readonly result_hash: string; readonly rebased: boolean; readonly changedRequirementIds: readonly string[]; readonly operationResults: readonly NativeDeltaOperationResult[]; } export interface NativeDeltaOperationResult { readonly id: string; readonly operation: NativeDeltaOperationKind; readonly status: 'changed' | 'already-applied'; readonly targetIds: readonly string[]; } export declare class NativeDeltaValidationError extends Error { readonly code = "native-delta-invalid"; constructor(message: string); } export declare class NativeDeltaConflictError extends Error { readonly code = "native-delta-conflict"; readonly conflictIds: readonly string[]; constructor(conflictIds: readonly string[], message: string); } interface NativeRequirement { readonly id: string; readonly level: number; readonly title: string; readonly body: string; readonly raw: string; readonly startLine: number; readonly endLine: number; } export declare function parseNativeDelta(value: unknown): NativeDeltaDocument; /** Render a validated delta deterministically before it is persisted. */ export declare function renderNativeDelta(delta: NativeDeltaDocument): string; export declare function nativeRequirementSectionHash(section: string): string; export declare function nativeTotalSpecHash(markdown: string): string; export declare function nativeLegacySectionHash(markdown: string): string; export declare function inspectNativeTotalSpec(markdown: string): { readonly legacy_hash: string; readonly requirements: readonly NativeRequirement[]; }; /** * Return only the complete requirement sections touched by a delta. * * Native keeps the change's full target Spec for human review and backwards * compatibility, but the historical requirements in that target are not a * new implementation scope. The returned Markdown is therefore used for * change acceptance discovery, while the full target remains the archive * result and Shape fingerprint. */ export declare function nativeDeltaAcceptanceMarkdown(targetMarkdown: string, delta: NativeDeltaDocument): string; export declare function applyNativeDelta(options: { readonly baselineMarkdown: string; readonly delta: NativeDeltaDocument; /** Allow a re-based operation that is already present in the new baseline. */ readonly allowAlreadyApplied?: boolean; }): NativeDeltaApplyResult; export declare function mergeNativeDelta(options: { readonly baselineMarkdown: string; readonly currentMarkdown: string; readonly delta: NativeDeltaDocument; }): NativeDeltaApplyResult; /** * Merge a delta into the latest canonical Spec when the original baseline is * no longer available. Per-requirement expected hashes are the proof that an * independent concurrent edit can be replayed safely; an uncertain edit is a * conflict and never becomes a blind replacement. */ export declare function mergeNativeDeltaAgainstCurrent(options: { readonly currentMarkdown: string; readonly delta: NativeDeltaDocument; }): NativeDeltaApplyResult; export {}; //# sourceMappingURL=native-delta-spec.d.ts.map