/**
 * Pure Run→Session fan-in helper per session-hierarchy.md §5.1.
 *
 * Extracted from `session/hierarchy/session.ts` on 2026-04-21 (ses_010 commit
 * 4) so the shape definition can live under `types/session/` while the
 * runtime helper stays in a feature folder — the type-layering rule
 * (`types/` = pure shapes, feature folders = runtime).
 *
 * The precedence (highest first) matches the pattern-doc table:
 *   1. Session-level states that do not fan in from Run status:
 *      - `locked` (handoff CAS window) — preserved verbatim
 *      - `awaiting_merge` (broadcast source post-fan-out, §5.4) — preserved
 *      - `archived` (retention tombstone, §12.3) — preserved
 *   2. Any Run `running` or `awaiting_subsession` → Session `active`.
 *      Delegation-in-flight is an active state of the parent — the parent
 *      Run is suspended waiting on the child's SessionSummaryMaterializer,
 *      and the session is NOT idle while that is pending.
 *   3. Any Run `awaiting_hitl` or `awaiting_hitl_resolution` → Session
 *      `awaiting_hitl`.
 *   4. All Runs `failed` and at least one Run present → Session `failed`.
 *   5. Otherwise (all runs terminal — succeeded/cancelled/failed mix, or no
 *      runs at all) → Session `idle`.
 *
 * `cancelled` does NOT surface a `failed` Session (§5.1 — "Cancellation is
 * not a terminal Session state"). Only `failed` runs drive the Session to
 * `failed` when every Run ended that way.
 */
import type { RunStatus } from '../../types/run/status.js';
import type { Session, SessionStatus } from '../../types/session/entity.js';
export declare function deriveStatus(session: Session, runs: readonly {
    status: RunStatus;
}[]): SessionStatus;
//# sourceMappingURL=derive.d.ts.map