import type { MigrationProgress, Scope } from '@substrat-run/contracts'; import type { MigrationFrontier } from './scope-host.js'; /** * The fleet migration-progress computation (kernel-design §5.3, #49) — one pure * function shared by the reconciliation sweep's report and the control-plane * API's ops view, so the two can never disagree about what "487/500 migrated, * 13 pending, 0 failed" means. * * Everything here reads the DIRECTORY projection (`schemaVersion`, * `migrationFailure`) against the host's registered frontier — §5.4's "fleet * questions never fan out" made concrete: no scope is woken to answer it. */ /** * Consecutive failures after which a scope is FLAGGED — the "pages past a * threshold" line in §5.3. The sweep keeps retrying past it (recovery is a * patched forward release, which arrives on its own schedule); flagging is the * signal that a human should now be looking. */ export declare const MIGRATION_FLAG_THRESHOLD = 3; export type ScopeMigrationState = 'migrated' | 'pending' | 'failed'; /** * Classify one scope against the frontier, from the directory row alone. * A recorded failure wins: its `schemaVersion` is the count that landed before * the rollback, so it is behind by construction, and "failed" is the state an * operator must act on. */ export declare function scopeMigrationState(scope: Pick, frontier: MigrationFrontier): ScopeMigrationState; /** * The scopes the sweep and the progress view consider: live primaries. * Suspended/archived scopes are deliberate states the sweep must not disturb * (they re-migrate lazily if ever restored), and forks are ephemeral copies * pinned at their source's frontier — proactively migrating an archive would * change the very bytes it exists to preserve. */ export declare function migrationFleet(scopes: readonly Scope[]): Scope[]; export declare function migrationSummary(p: { release: string; total: number; migrated: number; pending: number; failed: number; }): string; /** * "release N: X/Y migrated, P pending, F failed" over the given directory * listing. `release` is the frontier total — the same count `schemaVersion` * holds, so the label and the comparison can never drift apart. Callers pass * the raw `listScopes` result; the live-primary filter is applied here so every * consumer counts the same fleet. */ export declare function migrationProgress(frontier: MigrationFrontier, scopes: readonly Scope[], opts?: { flagThreshold?: number; }): MigrationProgress; //# sourceMappingURL=migration-progress.d.ts.map