/** * saga.detach — remove a Saga member by clearing its `parentId` containment edge. * * Idempotent: re-running against a member that is no longer parented to the Saga succeeds * with `removed: false`. Every invocation (whether or not it removed a row) * appends a single JSON line to `.cleo/audit/saga-detach.jsonl` so the * repair history is auditable — mirroring the append-only pattern used by * `appendContractViolation` in `audit.ts`. * * Primary use case: repair ADR-073 §1.2 invariant I7 violations (a saga * accidentally linked as a member of another saga — historical * T9831-nested-in-T9799 scenario). Dogfooded in the T10118 ship PR. * * @task T10118 * @saga T10113 — SG-SAGA-FIRST-CLASS * @epic T10209 — E-SAGA-ENFORCEMENT * @see ADR-073-above-epic-naming.md §1.2 */ import { type EngineResult } from '../engine-result.js'; /** Relative path within project root for the saga-detach audit log. */ export declare const SAGA_DETACH_AUDIT_FILE = ".cleo/audit/saga-detach.jsonl"; /** Default human-readable reason recorded when the caller does not supply one. */ export declare const SAGA_DETACH_DEFAULT_REASON = "ADR-073 I7 violation repair"; /** Input parameters for {@link detachSagaMember}. */ export interface DetachSagaMemberParams { /** Saga task ID whose member should be detached. */ sagaId: string; /** Member Epic task ID to detach. */ memberId: string; /** Optional human-readable reason recorded in the audit entry. */ reason?: string; } /** Result payload for {@link detachSagaMember}. */ export interface DetachResult { sagaId: string; memberId: string; /** True when an actual row was removed; false on idempotent no-op. */ removed: boolean; /** Reason recorded in the audit log entry. */ reason: string; /** ISO 8601 timestamp recorded in the audit log entry. */ timestamp: string; } /** * Clear the `parentId` edge between a Saga and a member Epic. * Idempotent — if the member is not parented to the Saga the call still * succeeds with `removed: false`. Always appends an entry to * `.cleo/audit/saga-detach.jsonl`. * * Used to repair an ADR-073 §1.2 invariant I7 violation (a nested-saga * relation that bypassed `sagaAdd`'s pre-T10118 add path). * * @param projectRoot - Absolute path to the project root. * @param params - sagaId + memberId of the containment edge to remove. * @returns EngineResult with `{ sagaId, memberId, removed, reason, timestamp }`. * * @example * ```typescript * const result = await detachSagaMember('/repo', { * sagaId: 'T9799', * memberId: 'T9831', * reason: 'ADR-073 I7 violation repair', * }); * // result.data.removed === true on first call, false on subsequent calls. * ``` */ export declare function detachSagaMember(projectRoot: string, params: DetachSagaMemberParams): Promise>; //# sourceMappingURL=detach.d.ts.map