/** * Claim intervals as seen once an instance has finished. * * Why this exists (cost-capture-dirties-primary-after-close). A claim the session * never released stays open until the claim timeout, so for up to an hour after an * instance closed, capture kept crediting it with whatever the session did next and * appending `renew` events to its `sessions.ndjson` — and `cost sync`, reading the same * intervals, did the same. That usage was not the instance's work, and every write * landed in a tracked file of a finished instance, in the checkout releases run from. * * Clipping the interval, rather than filtering each write, is what keeps the two * consumers in agreement: capture, reconcile, backfill and recover all decide * attribution from these intervals, so one wrap covers all of them. */ import type { WorkflowTemplate } from '../core/types.js'; import type { ClaimInterval } from './types.js'; /** * The instance's completion moment in epoch ms, or null when it is not complete, * its completion time is unknown, or its state cannot be read. * * "Complete" is `completionInfo`'s answer, never a local one: maintenance-terminal * templates finish on maintenance *entry*, which "is the last phase complete?" gets * wrong. Null always means "behave as before" (AC-5, AC-6), so every failure is caught * here — this runs inside a session hook that must not throw. */ export declare function completionCutoff(projectRoot: string, instance: string, templates?: () => Map): number | null; /** * Intervals bounded by the completion moment. Unchanged when `cutoff` is null. * * `to` is clipped, not excluded, so a record *at* the moment still attributes — * containment is inclusive at both ends (AC-4). Every interval is closed: a finished * instance is never renewed, however its claim ended (AC-2). */ export declare function clipAtCompletion(intervals: ClaimInterval[], cutoff: number | null): ClaimInterval[]; /** * One template load per pass, shared across instances. `loadAllTemplates` reads the * built-in set plus project overrides from disk, and capture asks once per instance. */ export declare function lazyTemplates(projectRoot: string): () => Map; //# sourceMappingURL=completion.d.ts.map