/** Ownership metadata published atomically with each lock. */
interface LockOwner {
    readonly token: string;
    readonly pid: number;
    readonly createdAt: number;
}
/**
 * Serialize same-target writers across processes with an exclusive hard link.
 * @param target - Absolute learnings target
 * @param operation - Complete read, validate, and atomic-write transaction
 * @returns Operation result
 */
export declare function withLearningTargetLock<T>(target: string, operation: () => Promise<T>): Promise<T>;
/**
 * Serialize same-target file transactions across processes.
 * @param target - Absolute target whose adjacent lock is acquired
 * @param operation - Transaction performed while the caller owns the lock
 * @returns Operation result
 */
export declare function withFileTargetLock<T>(target: string, operation: () => Promise<T>): Promise<T>;
/**
 * Snapshot of one lock observed to be reclaimable. The reclaim is anchored to
 * this snapshot: a lock is only ever deleted while it still *is* the exact
 * inode and ownership this observation judged stale.
 */
export interface StaleLockObservation {
    /** Owner metadata when the lock was parseable; undefined when unowned. */
    readonly owner: LockOwner | undefined;
    /** Device of the inode that was judged stale. */
    readonly dev: number;
    /** Inode that was judged stale. */
    readonly ino: number;
}
/**
 * Determine whether a regular lock is reclaimable and retain its owner path.
 * @param lockPath - Shared lock path
 * @returns Observation of a reclaimable lock, or null when it is still held
 */
export declare function observeStaleLock(lockPath: string): Promise<StaleLockObservation | null>;
/**
 * Reclaim only the same lock inode retained in a safe quarantine link.
 *
 * Proving the lock is still the inode judged stale and unlinking it are two
 * syscalls, and POSIX has no "unlink only if still this inode". Every reclaimer
 * that passed the proof therefore used to unlink whatever sat at the path
 * afterwards — including a lock a live writer had legitimately acquired in
 * between, which left two writers holding one "exclusive" lock and silently
 * dropped a learning (CodySwannGT/lisa#2488). That gap is closed by holding the
 * generation's exclusive reclaim capability across both syscalls; see
 * `learnings-lock-capability.ts` for why this cannot interleave rather than
 * merely interleaving rarely.
 * @param lockPath - Shared lock path
 * @param observation - Snapshot that judged this lock reclaimable
 * @returns Whether the observed lock was reclaimed
 */
export declare function reclaimObservedStaleLock(lockPath: string, observation: StaleLockObservation): Promise<boolean>;
export {};
//# sourceMappingURL=learnings-lock.d.ts.map