/** * The `/errors` route's `onError` — ONE implementation, used by both call sites. * * Exports: * TICK_FAILURE_TYPES — the body types that mean "tick failed" * buildScaffoldErrorRouter(ctx, runtimeHandles) → (scannerId, error) => void * * WHY THIS MODULE EXISTS: this routing decision used to be written twice — once * as `buildIntakeMount`'s `onScaffoldError` (which the only production caller * destructures away, so it ran in tests only) and once hand-copied into a closure * inside `initCore`, which is what the route actually installs. The copies drifted * the moment `mcp_error` was added to the list: the tested one counted it, the * live one dropped it, and the failure was self-concealing because the signal that * would have surfaced it IS the signal that was broken. Both sites now call this. */ import type { RuntimeHandle } from "../../runtime/run.js"; import type { IntakeContext } from "./intake-context.js"; /** * The `/errors` body types that mean "this tick failed" and are recorded as an * error-outcome run. Everything else the scaffold POSTs (`candidate_rejected`) is a * per-candidate note on an otherwise-OK tick and must not degrade the scanner. * * - `error` / `timeout` / `state_persist_failed` — scan() threw, overran, or its * state could not be committed (scaffold.py). * - `mcp_error` — an otherwise-`ok` tick in which one or more MCP tool calls failed * AND scan() produced no candidates (`scaffold.py:_classify_mcp_errors`): the * scaffold's own tally reclassifies the tick, because authored code swallows the * exception and would otherwise report `ok` forever while blind. MCP errors WITH * candidates stay `ok` — a partial read still produced work. The body carries * `error_type` (dominant) and `error_count`. */ export declare const TICK_FAILURE_TYPES: ReadonlySet; /** * Builds the `/errors` counterpart of `onAccepted`. Instead of an ingest it records * the failed tick into the owning runtime's scanner telemetry, so a scanner that * fails every tick stops rendering "healthy" — `consecutiveErrorCount` and * `lastRunStatus` move, and `scanner.runs{outcome=error}` becomes a real series. * * Resolves against the SHARED IntakeContext registry, so the route and the launcher * see the same in-process Map. */ export declare function buildScaffoldErrorRouter(ctx: IntakeContext, runtimeHandles: Map): (scannerId: string, error: Record) => void; //# sourceMappingURL=scaffold-error-router.d.ts.map