/** * saga.rollup — aggregate member Epic statuses for a Saga. * * Reads every member Epic via parent_id containment and tallies their * statuses into a structured counter (done/active/blocked/pending + * completionPct). After T10966, also includes deep task-level progress * and per-member-epic breakdowns. * * Returns an EngineResult; the dispatch layer wraps it in a LAFS envelope. * * Moved from `packages/cleo/src/dispatch/domains/tasks.ts::sagaRollup` per * AGENTS.md Package-Boundary Check (Saga T10113 / Epic T10208). * * @task T10124 * @task T10120 * @task T10638 — E10.W5 switch to parent_id containment * @task T10966 — Unify saga traversal and deep rollup Core semantics * @task T10967 — Define canonical saga traversal result * @epic T10208 * @epic T10965 — E-AGENT-DOGFOOD-CORE-ERGONOMICS * @see ADR-073-above-epic-naming.md §1 */ import { type EngineResult } from '../engine-result.js'; /** Input parameters for {@link sagaRollup}. */ export interface SagaRollupParams { /** Saga task ID whose members to roll up. */ sagaId: string; } /** Per-member-epic progress entry in the deep rollup. */ export interface SagaMemberEpicProgress { /** Epic task ID. */ id: string; /** Epic title. */ title: string; /** Epic status (done/active/blocked/pending). */ status: string; /** Total number of descendant tasks (all levels below the epic). */ descendantTaskCount: number; /** Number of descendant tasks with status 'done'. */ descendantDone: number; /** Number of descendant tasks with status 'active'. */ descendantActive: number; /** Number of descendant tasks with status 'blocked'. */ descendantBlocked: number; /** Number of descendant tasks with status 'pending'. */ descendantPending: number; /** Descendant completion percentage (0-100). */ descendantCompletionPct: number; } /** Result payload for {@link sagaRollup}. */ export interface SagaRollupResult { sagaId: string; /** Number of member Epics. */ total: number; /** Number of member Epics with status 'done'. */ done: number; /** Number of member Epics with status 'active'. */ active: number; /** Number of member Epics with status 'blocked'. */ blocked: number; /** Number of member Epics with status 'pending'. */ pending: number; /** Epic-level completion percentage (0-100). */ completionPct: number; /** Deep task-level progress across all member Epics. */ memberEpics?: SagaMemberEpicProgress[]; /** Total number of descendant tasks across all member Epics. */ totalDescendantTasks?: number; /** Total number of done descendant tasks. */ descendantDone?: number; /** Descendant task-level completion percentage (0-100). */ descendantCompletionPct?: number; } /** * Result payload for {@link sagaTraversal} — the canonical full traversal * for saga nodes, including epic breakdown, task-level progress, and * the ready frontier of immediately-actionable descendant tasks. */ export interface SagaTraversalResult extends SagaRollupResult { /** Task IDs on the ready frontier (no unmet deps, not done/cancelled). */ readyFrontier: string[]; /** Tasks that are blocked, with their blocker IDs. */ blockers: Array<{ taskId: string; title: string; blockedBy: string[]; }>; } /** * Compute completion rollup for a Saga over its member Epics. * * After T10966, also computes task-level (descendant) progress when * `includeTaskProgress` is true, returning per-epic breakdowns and * aggregate descendant counts. * * @param projectRoot - Absolute path to the project root. * @param params - sagaId of the Saga to roll up. * @param includeTaskProgress - When true, compute deep task-level progress. */ export declare function sagaRollup(projectRoot: string, params: SagaRollupParams, includeTaskProgress?: boolean): Promise>; /** * Canonical saga traversal — full structural walk including epics, * descendant tasks, the ready frontier, and blockers. * * This is the single entry point that agent orchestrators use to * understand a saga's full state. It combines epic-level rollup * (via {@link sagaRollup}) with the ready frontier (ready-to-execute * tasks across all members) and a blocker inventory. * * @param projectRoot - Absolute path to the project root. * @param sagaId - Saga task ID to traverse. * @returns EngineResult with {@link SagaTraversalResult}. * * @task T10966 — Unify saga traversal and deep rollup Core semantics * @task T10967 — Define canonical saga traversal result */ export declare function sagaTraversal(projectRoot: string, sagaId: string): Promise>; //# sourceMappingURL=rollup.d.ts.map