/** * ID Registry - Atomic Feature ID registration with collision detection * * Provides thread-safe ID registration using file-based locking to prevent * race conditions during concurrent imports. * * Features: * - File-based locking for atomic updates * - Collision detection (checks both FS-XXX and FS-XXXE) * - JSON-based persistent storage * - Automatic lock cleanup with timeout */ /** * Registry entry metadata */ export interface RegistryEntry { /** Feature ID (e.g., "FS-042E") */ id: string; /** Registration timestamp (ISO 8601) */ registeredAt: string; /** External ID if external origin */ externalId?: string; /** External URL */ externalUrl?: string; /** Origin type */ origin: 'internal' | 'external'; } /** * Registry data structure */ export interface RegistryData { /** Map of FS-ID to metadata */ entries: Record; /** Last updated timestamp */ lastUpdated: string; /** Registry version */ version: number; } /** * ID Registry with atomic file-based locking */ export declare class IDRegistry { private registryPath; private lockPath; private lockTimeout; private retryDelay; constructor(projectRoot: string); /** * Register a new Feature ID atomically * * @param fsId - Feature ID to register (e.g., "FS-042E") * @param entry - Registry entry metadata * @throws Error if collision detected or lock acquisition fails */ registerID(fsId: string, entry: Omit): Promise; /** * Check if ID exists in registry * * @param fsId - Feature ID to check * @returns True if ID is registered */ hasID(fsId: string): Promise; /** * Get registry entry * * @param fsId - Feature ID to retrieve * @returns Registry entry or null if not found */ getEntry(fsId: string): Promise; /** * Get all registered IDs * * @returns Array of all registered Feature IDs */ getAllIDs(): Promise; /** * Acquire lock file with timeout and retry * * @throws Error if lock cannot be acquired within timeout */ private acquireLock; /** * Release lock file */ private releaseLock; /** * Get lock file age in milliseconds * * @returns Lock age or Infinity if lock doesn't exist */ private getLockAge; /** * Read registry from disk * * @returns Registry data */ private readRegistry; /** * Write registry to disk atomically * * @param registry - Registry data to write */ private writeRegistry; /** * Detect ID collision (exact match or variant) * * @param fsId - ID to check (e.g., "FS-042E") * @param registry - Current registry * @returns Conflicting ID or null if no collision */ private detectCollision; /** * Sleep for specified milliseconds * * @param ms - Milliseconds to sleep */ private sleep; } //# sourceMappingURL=id-registry.d.ts.map