import { HsonNodeQuidValidationError } from "../../core/hson-node-quid.js"; import type { HsonNode, Primitive } from "../../core/types.js"; import type { DocumentLiveMapMode, LiveMapGraphCommit, LiveMapDocumentPath } from "../../types/livemap.types.js"; import { type LiveMapDocumentPathEffect } from "./livemap.document.path.js"; /** Sparse, immutable QUID/path correspondence for one current document graph. */ export type LiveMapDocumentIdentityOverlay = Readonly<{ size: number; pathForQuid: (quid: string) => LiveMapDocumentPath | undefined; quidAtPath: (path: LiveMapDocumentPath) => string | undefined; }>; /** * Derived structural evidence from one canonical operation; never an * independent lifecycle command. In particular, `retired` means displaced * from the operation's old structural edge. A same-QUID replacement may pair * `retired` with `introduced` while the final overlay and owner epoch retain * one continuously active subject. Terminal QUID retirement is decided from * the before/final active sets by the identity-epoch ledger, not by this word. */ export type LiveMapDocumentIdentityEffect = Readonly<{ kind: "preserved"; quid: string; path: LiveMapDocumentPath; }> | Readonly<{ kind: "moved"; quid: string; from: LiveMapDocumentPath; to: LiveMapDocumentPath; }> | Readonly<{ kind: "retired"; quid: string; formerPath: LiveMapDocumentPath; }> | Readonly<{ kind: "introduced"; quid: string; path: LiveMapDocumentPath; }>; export type LiveMapDocumentIdentityAccounting = Readonly<{ fullBuilds: number; reconciliations: number; overlayEntriesVisited: number; overlayEntriesChanged: number; incomingNodesVisited: number; }>; export type LiveMapDocumentIdentityReconciliation = Readonly<{ overlay: LiveMapDocumentIdentityOverlay; effects: readonly LiveMapDocumentIdentityEffect[]; }>; export declare class LiveMapDocumentIdentityError extends Error { readonly code: "MALFORMED_QUID" | "DUPLICATE_QUID" | "OVERLAY_INVARIANT"; constructor(code: LiveMapDocumentIdentityError["code"], message: string, cause?: HsonNodeQuidValidationError); } /** * Build the sole retained LiveMap document identity structure. * * Traversal validates all metadata in the owned root, but retains only two * strings plus one frozen canonical path per present QUID. It never retains a * graph node and never mints identity. */ export declare function build_livemap_document_identity_overlay(root: HsonNode, mode: DocumentLiveMapMode): LiveMapDocumentIdentityOverlay; /** * Reconcile one sparse overlay from the same structural effect applied to the * canonical graph. Existing graph nodes are never scanned; only current sparse * claims and an optional incoming subtree participate. */ export declare function reconcile_livemap_document_identity_overlay(current: LiveMapDocumentIdentityOverlay, effect: LiveMapDocumentPathEffect, incoming?: Readonly<{ content: HsonNode | Primitive; path: LiveMapDocumentPath; }>): LiveMapDocumentIdentityReconciliation; /** Derive an attribute-preservation effect without replacing the overlay. */ export declare function preserve_livemap_document_identity_at_path(overlay: LiveMapDocumentIdentityOverlay, path: LiveMapDocumentPath): LiveMapDocumentIdentityReconciliation; /** Add one validated canonical registration without scanning unrelated graph nodes. */ export declare function register_livemap_document_identity_at_path(overlay: LiveMapDocumentIdentityOverlay, quid: string, path: LiveMapDocumentPath): LiveMapDocumentIdentityReconciliation; /** Derive whole-domain replacement evidence after the admitted root was scanned. */ export declare function replace_livemap_document_identity_overlay_effects(current: LiveMapDocumentIdentityOverlay, replacement: LiveMapDocumentIdentityOverlay): readonly LiveMapDocumentIdentityEffect[]; /** Prove both overlay directions agree with a fresh scan of the supplied root. */ export declare function assert_livemap_document_identity_overlay(root: HsonNode, mode: DocumentLiveMapMode, overlay: LiveMapDocumentIdentityOverlay): void; /** Internal construction instrumentation used by authoritative lifecycle tests. */ export declare function livemap_document_identity_overlay_build_count(): number; /** Internal deterministic accounting used instead of wall-clock thresholds. */ export declare function livemap_document_identity_accounting(): LiveMapDocumentIdentityAccounting; /** Attach derived identity evidence to the exact internal commit envelope. */ export declare function register_livemap_document_identity_effects(commit: LiveMapGraphCommit, effects: readonly LiveMapDocumentIdentityEffect[]): void; /** Resolve derived identity evidence without widening the public commit shape. */ export declare function livemap_document_identity_effects_for(commit: LiveMapGraphCommit): readonly LiveMapDocumentIdentityEffect[] | undefined; /** Register one internal façade owner without widening its public shape. */ export declare function register_livemap_document_identity_overlay(owner: object, current: () => LiveMapDocumentIdentityOverlay): void; /** Resolve the current overlay for internal path-first consumers such as reflection. */ export declare function livemap_document_identity_overlay_for(owner: object): LiveMapDocumentIdentityOverlay; //# sourceMappingURL=livemap.document.identity.d.ts.map