/** * Instance registry: cross-worktree instance existence (AC-15, AC-16, * AC-24, AC-26). * * One YAML file per instance under `/aidlc/registry/`. * Creation writes with flag 'wx' DIRECTLY on the final path — the atomic * exactly-one-success arbiter for racing `aidlc start` calls (AC-24). * This is the one deliberate exception to the temp-rename discipline: * creation is a single write, and readers tolerate parse failures as * absent, so there is no partial-read hazard. * * The registry is live coordination data, not durable identity (design * F5): entries exist from creation until pruned or completed. A merged * instance with no entry and no claim is "complete and inactive". */ import type { RegistryEntry } from './types.js'; /** Thrown when a registry entry for the name already exists (AC-24). */ export declare class RegistryConflictError extends Error { readonly instance: string; constructor(instance: string); } export interface PruneItem { name: string; reason: string; } export declare class Registry { private readonly dir; private readonly projectRoot; constructor(dir: string, projectRoot: string); private entryPath; /** Register a new instance; fails atomically if it exists (AC-24). */ register(entry: RegistryEntry): void; lookup(name: string): RegistryEntry | null; list(): RegistryEntry[]; /** Remove an entry (AC-17 completion cleanup). Missing entry is a no-op. */ remove(name: string): void; /** True when `branch` is merged into main (AC-26). */ private isMerged; private branchExists; /** * Identify stale entries: worktree path gone AND branch merged or * deleted (AC-16). Read-only — shared by `status --prune` previews and * `aidlc doctor` checks (update-spring-clean AC-20). */ stale(): PruneItem[]; /** * Why one entry is stale, or null when it is not. Shared with `aidlc start`, which * reclaims its own name only on this test (start-failure-leaves-branch/AC-6, AC-10). */ staleReason(entry: RegistryEntry): string | null; /** Remove stale entries. Removal only happens here — explicit prune. */ prune(): PruneItem[]; } /** Open the registry, or null when no writable common dir exists (AC-27). */ export declare function openRegistry(projectRoot: string): Registry | null; //# sourceMappingURL=registry.d.ts.map