/** * Whether a paused phase left a decision open, read from the files it wrote * (pause-only-on-open-decisions). * * Requirements and design end by naming each open decision in their question file or by * writing "Nothing open" into the artifact. A pause after a phase that left nothing open is * skipped; every other shape — no artifact, no "Nothing open" line, a blank `[Answer]:`, a * question file with no tag at all, a phase with no such signal — waits for a person. A * wrong wait costs a person a minute; a wrong skip hides a decision (design D4). * * The same blank-answer test finds the decisions `aidlc autopilot status` prints under a * waiting item, so a pause and its card cannot disagree on what is open * (status-shows-open-decisions, design D1). Every field of a card is agent-written, so it is * cleaned and cut before it is printed. * * @module */ import type { PausePhase } from './stops.js'; /** The two files a pause is judged from, relative to the instance's state directory. */ export interface SignalFiles { artifact: string; questions: string; } /** The files a pause after `phase` is judged from; null when the phase has no signal (AC-5). */ export declare function signalFiles(phase: PausePhase): SignalFiles | null; /** * The files that show `phase` left nothing open, as names relative to `stateDir`; null when * it may have left a decision open or the evidence is missing (AC-1..AC-5). */ export declare function nothingOpen(read: (path: string) => string | null, stateDir: string, phase: PausePhase): string[] | null; /** The phases whose `-questions.md` a waiting item's card is read from, in lifecycle order. */ export declare const QUESTION_PHASES: readonly string[]; /** The longest one field of a card runs to (status-shows-open-decisions/AC-4). */ export declare const FIELD_MAX = 120; /** The most options a card lists before counting the rest (AC-4). */ export declare const OPTIONS_SHOWN = 4; export interface DecisionOption { /** `1`, `A`, … from the list marker or a leading bold marker; null for neither. */ marker: string | null; /** The option's first line as shown, bold markers dropped, cleaned and cut. */ text: string; /** The leading bold label (`One session`), for a recommendation that names it; null for none. */ label: string | null; } /** One question whose `[Answer]:` is blank, as a card shows it. Every string is cleaned and cut. */ export interface OpenDecision { /** The question file's name, relative to the state directory. */ file: string; question: string; why: string | null; options: DecisionOption[]; recommendation: string | null; /** Index into `options` of the one the recommendation names; null when it names none. */ recommended: number | null; } /** Agent text as one printable line: controls removed, whitespace runs to one space, cut (AC-4, AC-5). */ export declare function oneLine(text: string, max?: number): string; /** The open questions in one question file's text, in file order. */ export declare function parseOpenDecisions(file: string, text: string): OpenDecision[]; /** * `text` with the open question headed `question` answered: its blank `[Answer]:` line becomes * `[Answer]: `, every other byte kept. The heading is compared as `parseOpenDecisions` * shows it. Null when no open question has that heading — the file changed since it was read, * and writing into another section would answer the wrong question * (autopilot-watcher-asks-person/AC-21). */ export declare function writeAnswer(text: string, question: string, answer: string): string | null; /** A question a person did not answer: its `[Answer]:` names the unattended default. */ export interface DefaultedAnswer { file: string; question: string; /** The answer as written, cleaned and cut. */ answer: string; } /** Every question in one file answered with `(unattended default)`, in file order (AC-6). */ export declare function parseDefaultedAnswers(file: string, text: string): DefaultedAnswer[]; /** * Every open decision in the instance's question files, phase by phase. A file that is * absent or cannot be read is skipped (status-shows-open-decisions/AC-7). */ export declare function openDecisions(read: (path: string) => string | null, stateDir: string): OpenDecision[]; /** One decision as `status` prints it, under its item; `path` is the file to answer in (AC-2..AC-4). */ export declare function decisionCard(d: OpenDecision, path: string): string[]; /** `1 decision: ` or ` decisions: and more`; null for none (AC-9). */ export declare function decisionSummary(ds: readonly OpenDecision[]): string | null; //# sourceMappingURL=open-decisions.d.ts.map