import type { ExecutionStore } from './execution-store.js'; import type { InitiativeRecordRuntime } from './initiative-record-runtime.js'; /** The five terminal outcomes a linked Execution can reach, normalized from the outbox row's * `state` plus (for `state: 'complete'`) the terminal envelope's own `execution.status`. */ export type ExecutionOutcomeStatus = 'completed' | 'done_with_concerns' | 'failed' | 'cancelled' | 'interrupted'; /** * The Task transition + outcome a given `ExecutionOutcomeStatus` requires (SPEC-003 Phase B, * frozen FR-9 transition matrix — TRANSCRIPTION, not design). A failed Execution NEVER produces * a Task status of `failed`: it moves the Task to `blocked` instead, leaving it open for a * human or a retried Execution to resolve. `cancelled`/`interrupted` both reopen the Task — * neither is a verdict on the work, just "this attempt did not finish." */ export declare function terminalTaskUpdate(status: ExecutionOutcomeStatus): { transition: 'completed' | 'blocked' | 'open'; outcome: 'succeeded' | 'succeeded_with_concerns' | undefined; }; export interface InitiativeLinkerDeps { store: ExecutionStore; initiativeRuntime: InitiativeRecordRuntime; /** Diagnostics sink for a row that failed to fully replay — names `outbox_id` (the execution * id) and the error. Defaults to stderr, matching every other application-layer diagnostic * line in this codebase (`[mma] event=... `). */ log?: (line: string) => void; } /** Consumes `ExecutionStore`'s linkage outbox — see the module doc above. */ export declare class InitiativeLinker { private readonly store; private readonly runtime; private readonly log; constructor(deps: InitiativeLinkerDeps); /** * Replays every unconsumed outbox row, oldest first. A row that fails partway leaves * `consumed_at` unset — it is retried on the NEXT call (a later terminal execution, or the * next boot) — and this method itself never throws: one row's failure is logged and replay * continues with the rest, so a single bad row can never block every other row behind it. */ replayOutbox(): void; private replayRow; /** * Initiative-only linkage replay (SPEC-003 B6 defect 1): no Task was named at admission, so * this records execution-result Evidence (and, for a write route that landed a commit, commit * Evidence) directly against the Initiative — no Task registration, no Task transition, because * there is no Task. * * `evidence_link`'s `EvidenceLinkTargetType` union (`requirement | acceptance_criterion | * decision | verification_run | task`) has no `'initiative'` member — an EvidenceLink from * Initiative-scoped Evidence has no representable target, so BOTH link steps (`execution_link`, * `commit_link`) are skipped here, deliberately, for every Initiative-only row. The Evidence * itself is still created (`evidence_add` takes an `initiative_id` directly, independent of any * Task), so the work is still durably recorded — just not additionally cross-linked. */ private replayInitiativeOnlyRow; } //# sourceMappingURL=initiative-linker.d.ts.map