import type { NativeContentSnapshotManifest, NativeSnapshotEntry, NativeSnapshotOmission, NativeSnapshotPolicy } from './native-types.js'; export declare const NATIVE_IMPLEMENTATION_SCOPE_SCHEMA: "comet.native.implementation-scope.v2"; export declare const NATIVE_SNAPSHOT_PROJECTION_SCHEMA: "comet.native.content-snapshot-projection.v1"; export declare const MAX_NATIVE_IMPLEMENTATION_EVIDENCE_DOCUMENT_BYTES: number; export declare const MAX_NATIVE_DETAILED_SCOPE_CHANGES = 128; export declare const MAX_NATIVE_DETAILED_UNRESOLVED_SCOPES = 128; export interface NativeDeclaredArtifact { path: string; kind: 'file' | 'directory'; } export type NativeSnapshotProjectionRef = `runtime/evidence/snapshots/${string}.json`; export interface NativeImplementationChange { path: string; kind: 'added' | 'modified' | 'removed'; before: NativeImplementationFileIdentity | null; after: NativeImplementationFileIdentity | null; attributedTo: NativeDeclaredArtifact[]; } export interface NativeImplementationFileIdentity { hash: string; size: number; } export type NativeUnresolvedScopeKind = 'unattributed-change' | 'snapshot-omission' | 'snapshot-incomplete' | 'snapshot-omission-overflow' | 'scope-detail-overflow' | 'missing-no-code-reason'; export interface NativeUnresolvedScope { id: string; kind: NativeUnresolvedScopeKind; source: 'baseline' | 'current' | 'implementation-scope'; path: string | null; reason: string; } export interface NativeGitScopeAdvisory { advisoryOnly: true; changedPaths: string[]; pathsPresentInSnapshotChanges: string[]; pathsAbsentFromSnapshotChanges: string[]; } export interface NativeExternalDrift { provider: 'git'; baseCommit: string; targetBranch: string; targetCommit: string; paths: string[]; } export interface NativeImplementationScope { schema: typeof NATIVE_IMPLEMENTATION_SCOPE_SCHEMA; contractHash: string; baselineProjectionRef: NativeSnapshotProjectionRef; baselineProjectionHash: string; currentProjectionRef: NativeSnapshotProjectionRef; currentProjectionHash: string; complete: boolean; declaredArtifacts: NativeDeclaredArtifact[]; changes: NativeImplementationChange[]; unattributed: NativeImplementationChange[]; unresolvedScopes: NativeUnresolvedScope[]; noCodeReason: string | null; gitAdvisory?: NativeGitScopeAdvisory; externalDrift?: NativeExternalDrift; scopeHash: string; } export interface BuildNativeImplementationScopeInput { baseline: NativeContentSnapshotManifest; current: NativeContentSnapshotManifest; contractHash: string; declaredArtifacts: readonly NativeDeclaredArtifact[]; noCodeReason?: string | null; gitChangedPaths?: readonly string[]; externalDrift?: NativeExternalDrift; } export interface NativeSnapshotProjection { schema: typeof NATIVE_SNAPSHOT_PROJECTION_SCHEMA; origin: NativeContentSnapshotManifest['origin']; capture?: NativeContentSnapshotManifest['capture']; complete: boolean; limits: NativeContentSnapshotManifest['limits']; policy?: NativeSnapshotPolicy; entries: NativeSnapshotEntry[]; omitted: NativeSnapshotOmission[]; omittedCount: number; omissionOverflow?: NativeContentSnapshotManifest['omissionOverflow']; } export interface NativeImplementationScopeAuthority { contractHash: string; declaredArtifacts: NativeDeclaredArtifact[]; noCodeReason: string | null; gitChangedPaths?: string[]; externalDrift?: NativeExternalDrift; } /** * In-memory authority bundle produced from bounded snapshot manifests. * * Storage accepts this bundle rather than a standalone scope so it can rebuild every derived * scope field before persisting it. */ export interface NativeImplementationScopeBundle { authority: NativeImplementationScopeAuthority; baseline: NativeSnapshotProjection; current: NativeSnapshotProjection; scope: NativeImplementationScope; } export declare function nativeSnapshotProjectionRef(hash: string): NativeSnapshotProjectionRef; export declare function nativeDeclaredArtifactOwnsPath(artifact: NativeDeclaredArtifact, changedPath: string): boolean; /** * Derive the complete change set from the authoritative snapshot projections. * * The persisted scope intentionally stores only a bounded detail page. Callers that need to * execute a check must use this projection-derived view instead of treating `scope.changes` as * the complete set. */ export declare function deriveNativeImplementationChanges(input: { baseline: NativeSnapshotProjection; current: NativeSnapshotProjection; declaredArtifacts: readonly NativeDeclaredArtifact[]; }): NativeImplementationChange[]; /** * Build the authority bundle consumed by Native evidence storage. * Snapshot timestamps are parsed but deliberately excluded from the normalized projections. */ export declare function buildNativeImplementationScopeBundle(input: BuildNativeImplementationScopeInput): NativeImplementationScopeBundle; /** Derive the implementation scope while preserving the existing pure-call interface. */ export declare function buildNativeImplementationScope(input: BuildNativeImplementationScopeInput): NativeImplementationScope; /** Parse the timestamp-free, content-addressed projection persisted beside a scope. */ export declare function parseNativeSnapshotProjection(value: unknown, expectedHash?: string): NativeSnapshotProjection; /** * Parse a persisted scope and re-check its self-contained invariants. * Storage additionally calls `rebuildNativeImplementationScopeBundle` so snapshot-derived facts * are verified against the two projections instead of trusted from this document. */ export declare function parseNativeImplementationScope(value: unknown): NativeImplementationScope; /** * Rebuild and verify a bundle at the storage seam. The supplied scope is never authoritative: * normalized projections plus the independently retained build authority must reproduce it. */ export declare function parseNativeImplementationScopeBundle(value: unknown): NativeImplementationScopeBundle; /** Rebuild a persisted scope from the two content-addressed projections it names. */ export declare function rebuildNativeImplementationScopeBundle(input: { baseline: NativeSnapshotProjection; current: NativeSnapshotProjection; scope: NativeImplementationScope; }): NativeImplementationScopeBundle; //# sourceMappingURL=native-verification-scope.d.ts.map