import type { WorkspaceStatusSnapshot } from "./dashboard/dashboard-status.js";
import type { TaskEntity } from "./types.js";
/** Phase digits from `kit.currentPhaseNumber` when set (bootstrap / operator UX; not canonical over DB workspace status). */
export declare function configKitPhaseKeyFromEffective(effectiveConfig: Record<string, unknown> | undefined): string | null;
/** Parse leading digits from maintainer status YAML `current_kit_phase` (e.g. `"28"`). */
export declare function parseKitPhaseNumberFromYaml(phaseRaw: string | null | undefined): string | null;
/**
 * Infer stable phase key from free-text `task.phase` (e.g. "Phase 28 (foo)") or explicit `task.phaseKey`.
 */
export declare function inferTaskPhaseKey(task: Pick<TaskEntity, "phaseKey" | "phase">): string | null;
export type CanonicalPhaseResolution = {
    /** Normalized phase number string when resolvable (e.g. `"28"`). */
    canonicalPhaseKey: string | null;
    /** Where `canonicalPhaseKey` came from when set. */
    source: "workspace-status" | "config" | "none";
    configPhaseKey: string | null;
    /** Phase digits parsed from workspace status `current_kit_phase` (DB or YAML-derived snapshot). */
    workspaceStatusPhaseKey: string | null;
    /**
     * When both config and workspace status supply a phase number: true if equal, false if they disagree.
     * Informational only — canonical runtime phase is workspace status when its snapshot is present; config is a bootstrap hint.
     */
    configMatchesWorkspaceStatus: boolean | null;
};
/**
 * Precedence: workspace status `current_kit_phase` (when parseable) wins; otherwise `kit.currentPhaseNumber` as fallback seed.
 */
export declare function resolveCanonicalPhase(args: {
    effectiveConfig: Record<string, unknown> | undefined;
    workspaceStatus: WorkspaceStatusSnapshot | null;
}): CanonicalPhaseResolution;
/**
 * Leading integer segment of a phase key for ladder-style comparisons.
 * Returns `null` when the key has no leading digits (opaque / custom bucket).
 */
export declare function parseLeadingPhaseOrdinal(phaseKey: string | null | undefined): number | null;
/**
 * When true, numeric phase keys whose leading ordinal sorts strictly before workspace
 * current kit phase are rejected by assign-task-phase and upsert-phase-catalog-entry.
 * Default false — maintainers may bucket tasks to past phases while the workspace advances.
 */
export declare function phaseLadderBlocksBeforeCurrent(effectiveConfig: Record<string, unknown> | undefined): boolean;
/**
 * When set, numeric phase keys with leading ordinal in `[0, N]` are treated as delivered
 * for dashboard tags/roster (pre–delivery-evidence history). Omit or null disables.
 */
export declare function resolveLegacyDeliveredMaxOrdinal(effectiveConfig: Record<string, unknown> | undefined): number | null;
/** True when `phaseKey` leading ordinal is within the configured legacy delivered ceiling. */
export declare function isPhaseLegacyDeliveredByOrdinal(phaseKey: string, legacyDeliveredMaxOrdinal: number | null | undefined): boolean;
/**
 * How a task's target phase relates to the workspace's current kit phase
 * (authoritative "where we are" from `resolveCanonicalPhase`, not per-task `phaseKey` alone).
 */
export type PhaseScheduleRelation = "current" | "future" | "past" | "unknown";
export declare function resolvePhaseScheduleRelation(args: {
    taskPhaseKey: string | null;
    workspacePhaseKey: string | null;
}): PhaseScheduleRelation;
