/** * Per-instance platform pin — read-only, resolved at report time. * * One instance is owned by one platform. That ownership is not stored: it is * *derived* from `sessions.ndjson`, which already records `agent` on every * claim, renew and release event. Nothing here writes, and nothing on the write * path consults it. * * The separation is the whole point (design DD-1). If the pin fed * `resolveAgent`, every event after the first would record the first platform, * the log could never hold two distinct values, and `{ kind: 'skipped' }` would * be unreachable. Worse, `sync.ts` resolves a provider from the recorded * `agent`, so a Codex session on a claude-code-pinned instance would have its * rollout parsed by the claude-code provider and priced at Claude rates. A * confidently wrong figure is strictly worse than a missing one. * * Requirements: agent-portability/AC-59, AC-8, AC-31, AC-33, AC-34 * Design: design.md A3 * * @module */ /** * Who owns an instance's cost, as far as its session log can say. * * `unpinned` and `skipped` are deliberately different states. `unpinned` means * nobody could tell (no event ever named a platform) and reports as * unattributed, exactly as it does today. `skipped` means two platforms worked * the instance, so no single set of rates applies and the cost is *unmeasured* — * which must never render as `$0.00` (AC-9, AC-10, AC-28). */ export type PinVerdict = { kind: 'pinned'; platform: string; } | { kind: 'skipped'; platforms: string[]; } | { kind: 'unpinned'; }; /** * Resolve which platform owns an instance's cost. * * Pure and uncached. `aidlc cost sync` walks every instance in one process, so a * memo keyed on anything less than the instance would hand the first instance's * answer to the second (AC-34) — the shape that made `resolveAgent`'s * `{root, home}` cache a hazard in the first draft of this design. * * A missing, empty, or wholly unparseable log yields `unpinned` rather than an * exception: `readSessionEvents` returns `[]` for all three (AC-33). */ export declare function resolvePin(projectRoot: string, instance: string): PinVerdict; /** Human-readable reason for a skipped verdict — names both platforms (AC-9). */ export declare function skipReason(verdict: PinVerdict): string | null; /** * How a verdict is labelled beside an instance name in `aidlc cost`. * * Extracted so the label is testable without spawning the CLI — this project has * enough subprocess tests already, and they are the ones that flake under load. * * Requirements: agent-portability/AC-56, agent-portability/AC-9 */ export declare function pinLabel(verdict: PinVerdict): string; //# sourceMappingURL=pin.d.ts.map