/** * Session-scope parent resolution and task creation with session scope. * * Provides resolveParentFromSession (3-mechanism parent resolution) and * addTaskWithSessionScope (creates a task with session-scope parent inheritance). * * Extracted from task-engine.ts as part of the T1566 engine-migration epic * (ADR-057, ADR-058). * * Per T9337 / Council 20260515T211404Z, the create-time verifier gate * (T9218 / ADR-070) is removed. Enforcement of the anti-scaffold-and-mark-done * invariant now lives entirely at `cleo complete` via the ADR-051 evidence-atom * Pre-Complete Gate Ritual (commit, files, tool, test-run, decision atoms). * * @task T1568 * @task T9337 * @epic T1566 * @adr ADR-057 * @adr ADR-058 * @adr ADR-051 */ import type { TaskRecord, TasksAddParams } from '@cleocode/contracts'; import { type EngineResult } from '../engine-result.js'; /** * Where a resolved parent came from. * * @remarks * T12136 (GH #1232/#1238) — `E_CLEO_DEPTH_EXCEEDED` named a parent the caller * had never mentioned, because it had been inherited from session state, and * the message read as though the caller had asked for it. An explicit argument * must always outrank an inference, and an inference that fires must be * visible in the output; this discriminant is what makes the second half * possible. * * @task T12136 */ export type ParentSource = 'explicit' | 'parent-search' | 'session-inference'; /** Result of {@link resolveParentFromSession}. */ export interface ParentResolution { /** The resolved parent ID, or `null` when none was determined. */ resolvedParent: string | null; /** Where {@link resolvedParent} came from. */ parentSource: ParentSource; /** * Present when the resolution was NOT a plain explicit parent — an * inference fired, was declined as stale, or the session lookup failed. * Safe to surface verbatim to the caller. */ inferenceNote?: string; /** Set when resolution failed outright (e.g. `--parent-search` matched nothing). */ error?: EngineResult; } /** * Resolve the parent task ID through 3 mechanisms in priority order (T090): * 1. Explicit --parent flag (already resolved by caller) * 2. --parent-search fuzzy title match * 3. Session-scoped epic inheritance (when session scope is epic:T###). Only * the caller's BOUND session counts (T12500); an unbound caller inherits * nothing and gets an `inferenceNote` saying why. * * @param projectRoot - Absolute path to the project root * @param params - Resolution parameters * @returns Resolved parent ID or null * * @task T1568 * @epic T1566 */ export declare function resolveParentFromSession(projectRoot: string, params: { parent?: string | null; parentSearch?: string; type?: string; }): Promise; /** * Create a new task with session-scope parent resolution. * * Replaces taskCreate from task-engine.ts. Wraps addTask with the 3-mechanism * parent resolution logic (explicit parent, parent-search, session epic scope). * * @param projectRoot - Absolute path to the project root * @param params - Task creation parameters * @returns EngineResult with the created task record and duplicate flag * * @task T1568 * @epic T1566 */ export declare function addTaskWithSessionScope(projectRoot: string, params: TasksAddParams): Promise>; //# sourceMappingURL=session-scope.d.ts.map