import type { TreePolicy } from "./tree.js"; import type { GoalTodoNode, GoalTodoStatus } from "./types.js"; export interface GoalTodoCompletionOptions { /** Graph validation bounds (depth/fanout); defaults to the zob caps. */ policy?: TreePolicy; /** * Node ids flagged review_no_ship by the caller's side state (zob stored * the flag on the node; pi-goals keeps nodes clean and injects flags). */ reviewNoShipIds?: readonly string[]; /** Mirror of zob requireEvidenceForCritical; defaults to true. */ requireEvidenceForCritical?: boolean; } /** One structured no-ship reason attached to a concrete TODO node. */ export interface GoalTodoCompletionBlocker { readonly todoId: string; readonly path: string; readonly title: string; readonly status: GoalTodoStatus; readonly reason: string; } export interface GoalTodoCompletionDiagnostics { readonly total: number; /** Required TODOs currently in an open status. */ readonly requiredOpen: number; /** * True only when the tree has nodes, no blocker exists, and no review * no-ship flag is set (required-vs-optional semantics: open OPTIONAL * TODOs never block). */ readonly completionReady: boolean; /** True when the blocker inventory is non-empty (e.g. blocked required). */ readonly hardNoShip: boolean; /** True when an injected reviewNoShip id matches a node. */ readonly reviewNoShip: boolean; /** hardNoShip || reviewNoShip || empty tree (D-E1). */ readonly effectiveNoShip: boolean; readonly blockers: readonly GoalTodoCompletionBlocker[]; } /** * Mirror of zob goalTodoCompletionDiagnostics over a pure node array: * * - a REQUIRED TODO in any open status (planned, ready, in_progress, * delegated, claim_returned, needs_review, needs_oracle, needs_user, * blocked) blocks; optional TODOs may stay open * - a done TODO with open REQUIRED children blocks (nested gating) * - done-or-skipped critical/factory/orchestration nodes need evidence * (evidenceRefs or validationCommands) when requireEvidenceForCritical * - graph validation issues (duplicates, missing parents, cycles, depth, * fanout) block with their validation message * * hardNoShip = blockers exist; reviewNoShip = injected flags; effectiveNoShip * = hard || review || empty tree; completionReady === !effectiveNoShip. */ export declare function evaluateGoalTodoCompletion(nodes: readonly GoalTodoNode[], options?: GoalTodoCompletionOptions): GoalTodoCompletionDiagnostics; /** * Render the blocker inventory as zob-style text lines for later tool output: * `todo '' <reason>` per blocker; empty array when clean. * Path-less synthetic blockers (the empty tree, GAP-4) render as their bare * reason — no `todo '' ` empty-title prefix (batch-#2 cosmetic fix). */ export declare function formatGoalTodoBlockers(diagnostics: GoalTodoCompletionDiagnostics): string[];