import { type ResultEnvelope } from 'peaks-loop-shared/result'; import type { RequestArtifactRole, RequestArtifactState, transitionRequestArtifact } from '../../services/artifacts/request-artifact-service.js'; import { type CodegraphAutorefreshResult } from '../../services/codegraph/codegraph-autorefresh.js'; import type { RequestTransitionOptions } from './request-command-options.js'; export type TransitionResult = NonNullable>>; export type TransitionHooks = { preCompact: ResultEnvelope | null; codegraphRefresh: CodegraphAutorefreshResult | null; codegraphWarning: string | null; }; type PrdHandoffContext = { role: RequestArtifactRole; newState: RequestArtifactState; requestId: string; options: RequestTransitionOptions; result: TransitionResult; }; /** * The RD → QA slice-complete boundary. Set only for rd:qa-handoff; null * otherwise. Best-effort and fail-silent — never blocks the transition. * * When transitioning across the RD → QA boundary (rd:qa-handoff), check the * active session's context-fill ratio. If it is in the 0.85–0.95 pre-compact * zone, write a checkpoint BEFORE the transition completes and attach * `preCompactCheckpoint: true` to the response envelope. The LLM remains the * decision-maker; this hook only surfaces the signal. At ratio ≥ 0.95 the * auto-compact orchestrator ASKS the harness to compact and reports that it is * waiting; it does not refuse anything, because peaks-loop has no executor for * a running session and a refusal it cannot enforce only deadlocked the runner. * * A2 (2026-09-17): never BLOCKING is kept; never VISIBLE is not. A non-refresh * while a codegraph store is in use becomes a warning line beside the * transition's own notes. See `codegraphRefreshNotice` for why * `no-codegraph-dir` stays silent. */ export declare function collectQaHandoffHooks(role: RequestArtifactRole, newState: RequestArtifactState, sessionId: string, project: string): Promise; /** * Only fires when the handoff is missing; existing handoffs are not * overwritten. Post-step after peaks-prd's businessGoal artifact transitions to * `handed-off` (the canonical "complete" state in the prd state machine). The * trigger is fire-and-forget: failure NEVER blocks the transition. */ export declare function buildPrdHandoffResult(ctx: PrdHandoffContext): Promise | null>; /** * The pre-compact signal rendered into the final envelope's `nextActions`. * `null` when the hook did not trigger (zone is not pre-compact OR the * transition is not a slice boundary). */ export declare function preCompactNote(preCompact: ResultEnvelope | null): string | null; export {};