/** * Concurrency detection: is another session working in this repository? * (AC-7, AC-8, AC-12, AC-13, AC-14) * * Primary signal: another session's non-stale claim in the claim store. * Pure reads — one directory listing plus YAML parses, no git subprocess * on the hot path (NFR-1). Branch-pattern / dirty-tree corroboration is * for reporting only and never blocks alone. * * Own-session exclusion (design F2): claims matching the resolved session * id are excluded, as are claims recorded from this worktree's own path. */ import { type ClaimStore } from './claim-store.js'; import { type ConcurrencyConfig, type Detection } from './types.js'; /** Load the `concurrency:` block from `.aidlc/config.yaml` (AC-13). */ export declare function loadConcurrencyConfig(projectRoot: string): ConcurrencyConfig; /** * Detect other live sessions holding claims in this repository (AC-7). * Staleness is `claim_timeout_minutes` — the one existing knob, no * parallel threshold (idea decision 4). * * Splits live claims by whether they SHARE this session's working directory * (automation-verdicts/AC-8). The gate exists because two sessions in one * checkout collide on git — one's `git add -A` stages what the other left on * disk, and creating a branch in place yanks the other session off its own. A * session in its own worktree, on its own branch, can do none of that. * * Before this, the check asked "is another session live?" while meaning "does * another session share my working directory?", and it got the one worktree * comparison it had backwards: it excluded claims recorded from THIS path and * blocked claims recorded from OTHER paths — so taking the gate's own * recommendation (option 1, "start in a separate worktree") made every later * start in the primary checkout hit the same block, and offered a worktree it * did not need. Observed 2026-09-03 while releasing `single-clack-prompt-seam`, * where none of the three offered options fit and the instance was created by * hand. * * @param primaryRoot - The primary checkout's copy of the project * (`primaryProjectRoot`), or null/undefined when the caller does not know. It is * compared with `projectRoot`, so it must name the same kind of directory: the * checkout's top would never match a project below the repository root * (repo-root-is-not-the-project/AC-4). A claim with no `worktree_path` was * recorded from the primary checkout; without knowing where that is we cannot * rule out that it is here, so it is treated as sharing. That is the fail-safe * direction and it is exactly today's behaviour. * * Passed in rather than resolved here to keep NFR-1: this function stays pure * reads — one directory listing plus YAML parses — and adds no git subprocess. */ export declare function detectConcurrency(store: ClaimStore, ownSessionId: string, timeoutMinutes: number, projectRoot: string, primaryRoot?: string | null, now?: Date): Detection; //# sourceMappingURL=detect.d.ts.map