/** * Orchestrate Query Operations * * Status, analyze, ready, next, waves, context, and validate wrappers * migrated from packages/cleo/src/dispatch/engines/orchestrate-engine.ts. * * @task T1570 * @task T4478 * @task T1858 */ import type { OrchestrateReportParams, Task } from '@cleocode/contracts'; import { type EngineResult } from '../engine-result.js'; import { type DataAccessor } from '../store/data-accessor.js'; import type { DepGraphIssue } from '../tasks/dep-graph-validator.js'; /** * Project-relative path for the orchestrate deps-validate bypass audit log. * * @task T1858 */ export declare const ORCHESTRATE_DEPS_BYPASS_AUDIT_FILE = ".cleo/audit/orchestrate-deps-bypass.jsonl"; /** * A single audit entry written to {@link ORCHESTRATE_DEPS_BYPASS_AUDIT_FILE} * when `--ignore-deps-validate` is used on `cleo orchestrate ready`. * * @task T1858 */ export interface OrchestrateDepsAuditEntry { /** ISO-8601 timestamp of the bypass. */ ts: string; /** The epic ID passed to `cleo orchestrate ready`. */ epicId: string; /** Where the bypass originated: 'cli' (flag) or 'sentient' (programmatic). */ source: 'cli' | 'sentient'; /** Number of dep-graph issues that were bypassed. */ issueCount: number; /** The actual issues that were bypassed (may be empty when valid). */ issues: Pick[]; } /** * Append one {@link OrchestrateDepsAuditEntry} to * `.cleo/audit/orchestrate-deps-bypass.jsonl`. * * Errors are swallowed: an audit-write failure MUST NOT change the ready-set * response (follows the same pattern as `appendContractViolation` / * `appendWorkerMismatchAudit`). * * @param projectRoot - Absolute project root path. * @param entry - Audit entry to append. * * @internal * @task T1858 */ export declare function appendDepsValidateBypassAudit(projectRoot: string, entry: OrchestrateDepsAuditEntry): void; export type { EngineResult }; /** * Traversal mode for {@link orchestrateReady} and {@link orchestrateWaves}. * * @deprecated Since T10966 — after T10638, sagas use `type='saga'` with * `parent_id` containment. The saga walk is equivalent to the parent walk * (both use `parentId` filtering). All three values now resolve to the * same auto-detect behavior. The `via` option is retained for backward * compatibility but no longer changes behavior. Use the default (omit * `via`) to always get the correct saga-aware walk. * * @task T10638 — E10.W5 merge saga/parent walk paths * @task T10966 — Unify saga traversal and deep rollup Core semantics * @task T10968 — Deprecate dual via semantics */ export type OrchestrateTraversal = 'parent' | 'saga' | 'both'; /** * Extract member-Epic IDs from a saga via `parent_id` containment. * * @deprecated Since T10966 — use {@link resolveSagaMemberIds} from * `../sagas/storage.js` instead. That version includes `isSagaShape` * type-checking and returns `null` for non-saga tasks. This function * is retained for backward compatibility only. * * @param accessor - Data accessor for task lookups. * @param sagaId - The saga task ID. * @returns List of member Epic IDs. * * @task T10638 — E10.W5 switch to parent_id containment * @task T10968 — Deprecate dual via semantics */ export declare function resolveSagaMembers(accessor: DataAccessor, sagaId: string): Promise; /** * Load all tasks from task data. * * @param projectRoot - Optional project root path. Defaults to resolved root. * @returns Array of all tasks, empty on error. */ export declare function loadTasks(projectRoot?: string): Promise; /** * orchestrate.status - Get orchestrator status * * @param epicId - Optional epic id to scope status to a single epic. * @param projectRoot - Optional project root path. * @returns Engine result with status data. * @task T4478 */ export declare function orchestrateStatus(epicId?: string, projectRoot?: string): Promise; /** * orchestrate.analyze - Dependency analysis * * @param epicId - Epic to analyze (required unless mode is 'critical-path'). * @param projectRoot - Optional project root path. * @param mode - Analysis mode. Use 'critical-path' to delegate to orchestrateCriticalPath. * @returns Engine result with analysis data. * @task T4478 */ export declare function orchestrateAnalyze(epicId?: string, projectRoot?: string, mode?: string): Promise; /** * Options for {@link orchestrateReady}. * * @task T1858 */ export interface OrchestrateReadyOptions { /** * When true, skip the dep-graph validation pre-check and proceed with * advertising the ready set regardless of graph health. The bypass is * audit-logged to `.cleo/audit/orchestrate-deps-bypass.jsonl`. * * CLI-only: programmatic callers (sentient tick, worktree-dispatch) MUST * NOT pass this flag. Bypass logic lives here so the sentinel is enforced * at the call-site closest to the source of truth. */ ignoreDepsValidate?: boolean; /** * Traversal mode for resolving the epic's children (ADR-073 / gh-390). * * @deprecated Since T10966 — sagas are auto-detected via `isSagaShape`. * All three values now produce the same behavior (auto-detect + saga walk * when applicable). Omit this field to get the default correct behavior. * * @bug gh-390 * @adr ADR-073 * @task T9839 * @task T10968 — Deprecate dual via semantics */ via?: OrchestrateTraversal; } /** * orchestrate.ready - Get parallel-safe tasks (ready to execute) * * Before advertising the ready set, runs dep-graph validation over the epic's * children and respects `LifecycleConfig.mode`: * * - `strict` — if `!valid`, refuse with `E_DEP_GRAPH_INVALID` + issues * - `advisory` — if `!valid`, warn in the response but proceed * - `off` — skip validation entirely * * The `opts.ignoreDepsValidate` flag (CLI-only, audit-logged) bypasses the * check regardless of mode. * * @param epicId - Epic to find ready tasks for. * @param projectRoot - Optional project root path. * @param opts - Optional behaviour flags (see {@link OrchestrateReadyOptions}). * @returns Engine result with ready tasks data. * @task T4478 * @task T1858 */ export declare function orchestrateReady(epicId: string, projectRoot?: string, opts?: OrchestrateReadyOptions): Promise; /** * orchestrate.next - Next task to spawn * * @param epicId - Epic to find the next task in. * @param projectRoot - Optional project root path. * @returns Engine result with next task data. * @task T4478 */ export declare function orchestrateNext(epicId: string, projectRoot?: string): Promise; /** * Options for {@link orchestrateWaves}. * * @deprecated Since T10966 — the `via` field is retained for backward * compatibility only. Sagas are auto-detected via `isSagaShape`; all * callers get the correct saga-aware walk regardless of `via` value. * * @bug gh-390 * @adr ADR-073 * @task T9839 * @task T10968 — Deprecate dual via semantics */ export interface OrchestrateWavesOptions { /** * Traversal mode for resolving the epic's children — see * {@link OrchestrateTraversal}. Default is auto-detect. * * @deprecated Since T10966 — no longer changes behavior. * Sagas are auto-detected via `isSagaShape`. * * @bug gh-390 * @adr ADR-073 * @task T9839 * @task T10968 — Deprecate dual via semantics */ via?: OrchestrateTraversal; } /** * orchestrate.waves - Compute dependency waves * * For regular epics the wave plan is `getEnrichedWaves(epicId)`. For sagas * (Epics labeled `'saga'`, ADR-073), per-member wave plans are computed and * merged by wave index: wave N across all members becomes one unified wave N. * Members of unequal depth contribute to the trailing waves (longest tail * wins). Task IDs are deduplicated; per-wave order preserves the per-member * sort. * * @param epicId - Epic to compute waves for. * @param projectRoot - Optional project root path. * @param _opts - Deprecated traversal options (ignored since T10966). * @returns Engine result with wave data. * @task T4478 * @bug gh-390 * @adr ADR-073 */ export declare function orchestrateWaves(epicId: string, projectRoot?: string, _opts?: OrchestrateWavesOptions): Promise; /** * orchestrate.context - Context usage check * * @param epicId - Optional epic to scope context estimate to. * @param projectRoot - Optional project root path. * @returns Engine result with context estimate data. * @task T4478 */ export declare function orchestrateContext(epicId?: string, projectRoot?: string): Promise; /** * orchestrate.validate - Validate spawn readiness for a task * * @param taskId - Task to validate. * @param projectRoot - Optional project root path. * @returns Engine result with validation data. * @task T4478 */ export declare function orchestrateValidate(taskId: string, projectRoot?: string): Promise; /** * orchestrate.report — Grouped readiness report * * Classifies every non-done, non-cancelled child task of an epic into one of * five readiness groups: ready, blocked (has unmet deps), blockedBy (lists * specific blocker IDs), gateBlocked (gates like implemented/testsPassed/ * qaPassed not satisfied), or invalid (structural issues like missing * dependencies or circular chains). * * Supports pagination via `page` and `pageSize`. Aligns its ready-group * frontier with `orchestrate.ready` / `orchestrate.next`. * * @param epicId - Epic to compute the report for. * @param projectRoot - Optional project root path. * @param params - Pagination options. * @returns Engine result with grouped readiness report. * @task T10631 */ export declare function orchestrateReport(epicId: string, projectRoot?: string, params?: OrchestrateReportParams): Promise; //# sourceMappingURL=query-ops.d.ts.map