/** * saga.list — list all first-class Saga rows. * * Returns every row with `type='saga'`. Legacy `type='epic'` + `label='saga'` * rows were migrated by T10636/T10638 and are no longer part of the canonical * query path. * * Behaviour: * - All `type='saga'` rows are returned in `data.sagas`. * - If a legacy/corrupt row somehow carries `parentId != null`, a structured * `E_SAGA_INVARIANT_VIOLATION_I5` warning is surfaced instead of hiding it. * - When no row has a `parentId`, the `warnings` array is omitted entirely. * * Moved from `packages/cleo/src/dispatch/domains/tasks.ts::sagaList` per * AGENTS.md Package-Boundary Check (Saga T10113 / Epic T10208). * * @task T10117 — sagaList loud-filter + I5 warnings * @task T10124 * @task T10120 * @epic T10208 * @saga T10113 * @see ADR-073-above-epic-naming.md §1 — Task Hierarchy Charter * @see ADR-073-above-epic-naming.md §1.2 — invariant I5 */ import type { TaskRecord } from '@cleocode/contracts'; import { type EngineResult } from '../engine-result.js'; import { type CompactTask } from '../tasks/list.js'; import { E_SAGA_INVARIANT_VIOLATION_I5 } from './enforcement.js'; /** * Single I5-violation warning entry attached to `SagaListResult.warnings`. * * The shape is intentionally narrow: `code` is fixed, `sagaId` is the saga * that broke the invariant, and `offendingParentId` is the non-null * `parentId` value that must be cleared. * * @task T10117 */ export interface SagaInvariantI5Warning { /** Fixed warning code — `'E_SAGA_INVARIANT_VIOLATION_I5'`. */ code: typeof E_SAGA_INVARIANT_VIOLATION_I5; /** The saga task ID whose `parentId` violates invariant I5. */ sagaId: string; /** The non-null `parentId` value found on the saga row. */ offendingParentId: string; } /** Result payload for {@link sagaList}. */ export interface SagaListResult { /** Every `type='saga'` row, regardless of `parentId`. */ sagas: Array; /** Total count — always equal to `sagas.length`. */ total: number; /** * One entry per saga with a non-null `parentId`. Omitted entirely when no * violations were observed, so the envelope shape for a well-formed * dataset matches the pre-T10117 contract. */ warnings?: SagaInvariantI5Warning[]; } /** * List every first-class Saga, including corrupt legacy rows whose `parentId` * is non-null as structured warnings. * * Passes `limit: ${SAGA_LIST_HARD_LIMIT}` to the underlying `taskList` call. * The default `taskList` limit is 10 — small enough that a 19-saga repo * silently dropped 9 rows from the loud-include result that T10117 was * meant to expose. T10236 raised the cap so `cleo saga list` returns the * full set. If the cap is hit, a `truncated` warning is surfaced via * `pushWarning()` so consumers see the envelope is incomplete. * * @param projectRoot - Absolute path to the project root. */ export declare function sagaList(projectRoot: string): Promise>; //# sourceMappingURL=list.d.ts.map