/** * fleet_status + the drift-aware verification memory (change: add-fleet-coordination-arc). * * Completes the coordination arc — plan_parallel_work (dispatch) → map_in_flight_conflicts (in * flight) → certify_merge (landing) — with the piece the arc was missing: continuity across a * moving base. When parallel agents each work off a base that advances under them, every verified * fact they hold ("this blast radius is clean", "this merge was certified compatible") silently * becomes suspect. This records each coordination verdict as a typed, anchored record carrying the * base commit it was proven against, and re-classifies it when the base moves — reusing the SAME * freshness lease `recheckCertificate` uses, so a verdict is never served fresh once its base moved * without the check. * * Deterministic, local, read-only against the graph. `fleet_status` composes the recorded verdicts * with the arc's conclusions, attributing each line to the tool that produced it; it references * those tools, it does not re-derive them. Live PR/branch harvesting and the CLI are follow-ups. * * Records end on the SAME evidence as peer-board entries, through the board's own batched decider * (`judgeLifecycle`): idle expiry, worktree removed, branch deleted, branch merged. A record does * not carry everything those predicates need, and a missing field never means "ended" — a record * with no `recordedAt` (every record written before this lifecycle existed) is NOT expired, an * unrecorded directory is not a removed worktree, and a `baseCommit` that is not a commit id leaves * the merged predicate unknown instead of handing peer text to git. `fleet_status` mirrors * `readBoard`: read-only, with ended records reported as a count and reasons, never as a live * verdict; the next `recordVerification` prunes them, as `pruneEnded` does for the board. */ import { memoryFreshness } from '../../decisions/anchor.js'; import type { StructuralAnchor } from '../../../types/index.js'; import type { EndReason, LifecycleSubject, LifecycleUnknown } from '../footprint-board.js'; /** The coordination verdicts whose currency the fleet tracks. */ export type CoordinationVerdict = 'blast-radius-clean' | 'surface-stable' | 'merge-compatible'; /** A verified coordination fact, anchored to the symbols it was proven over. */ export interface VerificationRecord { id: string; verdict: CoordinationVerdict; /** The branch/task this verdict belongs to (for lifecycle + attribution). */ branch: string; /** The base commit the verdict was proven against. */ baseCommit: string; /** The tool that produced the verdict. */ producedBy: string; anchors: StructuralAnchor[]; /** The analysis directory (canonical) that recorded it; set when records are shared by the clone. */ worktree?: string; /** * When the verdict was recorded (ISO). Optional: records written before the lifecycle existed * carry none, and are never expired by the idle rule — only reported as unknown for it. */ recordedAt?: string; /** * Whether `branch` really was a local branch of the clone when the verdict was recorded. Stamped * at write time; without it, a `branch` absent from the clone today proves nothing (the field is * also used for a task id), so the branch predicates report unknown rather than "deleted". */ branchWasLocalRef?: boolean; } export type RecordState = 'still-valid' | 'carried' | 'invalidated' | 'needs-reverification' | 'other-worktree'; export interface ClassifiedRecord { id: string; branch: string; verdict: CoordinationVerdict; producedBy: string; baseCommit: string; state: RecordState; reason: string; } /** * Map a memory-freshness aggregate to a record state. Pure. The anchor system carries a * moved-but-unchanged symbol at analyze, so a carried anchor already reads `fresh` here; a genuine * content drift is `drifted` → invalidated; a lost anchor is `orphaned` → needs-reverification. * Anything else is conservatively needs-reverification — a verdict is never served fresh by default. */ export declare function stateForFreshness(freshness: string, anchored: boolean): RecordState; /** Classify each record's currency against a freshness view. Pure over (records, view). */ export declare function classifyRecords(records: readonly VerificationRecord[], view: Parameters[1] | null, here?: string): ClassifiedRecord[]; /** * What the board's lifecycle predicates can read off a record. Pure, and deliberately partial: a * field the record does not carry is left out so its predicate reports `unknown`, never "ended". * * `worktree` on a record is the ANALYSIS directory, which may be a package inside the worktree, so * it is offered as the subject's `root` (must still exist) and not matched against the clone's * worktree list — that would read a monorepo package as a removed worktree. */ export declare function lifecycleSubjectFor(r: VerificationRecord): LifecycleSubject; /** Records still live, and those that ended with the board's reason, plus unknown predicates. */ export interface RecordLifecycle { live: Array<{ record: VerificationRecord; unknown: LifecycleUnknown[]; }>; ended: Array<{ id: string; branch: string; reason: EndReason; unknown: LifecycleUnknown[]; }>; /** How many live records left each predicate unevaluated, and why. */ unknown: Partial>; } /** * Record a verification verdict (coordination-scoped), shared by the clone's worktrees. Advisory. * Serialized by a lock next to the file; refuses to write over a records file it could not read. */ export declare function recordVerification(absDir: string, record: VerificationRecord, opts?: { now?: number; }): Promise; export interface FleetStatusInput { directory: string; /** In-flight branches to compose the arc for (attribution + the tools to run per branch). */ branches?: string[]; } /** * Compose the coordination arc into one readiness view: the recorded verdicts classified against * the current graph, plus the arc's tool references per in-flight branch. Each line is attributed * to its producing tool; the arc tools are referenced, not re-derived. */ export declare function handleFleetStatus(input: FleetStatusInput, opts?: { now?: number; }): Promise>; //# sourceMappingURL=fleet-coordination.d.ts.map