import { type AutoCompactMode } from '../code/auto-compact-modes.js'; /** * The acceptance gate a batch runs, ONCE: the same three legs a single task * runs, in the same order. The batch mode amortizes the runs; it does not * choose a different gate. */ export declare const BATCH_ACCEPTANCE_GATE: readonly ["test", "tsc", "lint"]; /** One leg of the gate. */ export type BatchAcceptanceCheck = (typeof BATCH_ACCEPTANCE_GATE)[number]; /** * The command that produces the build artifacts two of the legs import. * Named here because it is the remedy a blocked leg offers. */ export declare const BATCH_GATE_BUILD_COMMAND = "pnpm build"; /** What one leg reported. */ export interface BatchCheckOutcome { readonly ok: boolean; /** * The leg's own output, in full: the artifact detector reads it, and a tail * of a failing `tsc` run can hold a genuine type error next to the * module-resolution errors. */ readonly output: string; } /** Runs one leg of the gate, injected so a test need not spend a suite's wall clock. */ export type BatchCheckRunner = (check: BatchAcceptanceCheck) => BatchCheckOutcome; /** One leg's result, as the verdict reports it. */ export interface BatchCheckResult { readonly name: BatchAcceptanceCheck; readonly ok: boolean; readonly detail: string; } /** * Which kind of breakage a red gate points at: `integration` (the batch * itself), `single-item` (one item, named in the failing detail), or * `unknown` (no evidence to attribute with). */ export type BatchAttribution = 'integration' | 'single-item' | 'unknown'; /** The verdict of the unified verification. */ export interface BatchVerificationResult { readonly gate: 'pass' | 'fail' | 'blocked'; readonly checks: readonly BatchCheckResult[]; readonly attribution: BatchAttribution; } /** * The shape of a failure that is an ARTIFACT problem, not a source problem. */ export type BatchArtifactShape = 'missing-workspace-dist' | 'build-prerequisite-refused'; /** The seam a caller may replace: how one leg is run. */ export interface BatchVerificationOptions { readonly runCheck?: BatchCheckRunner; } /** * Verify the whole batch against the acceptance gate, once. A malformed * progress record throws rather than reading as an empty batch: the record IS * the attribution's evidence, so losing it would turn a verdict into a guess. */ export declare function runBatchVerification(projectRoot: string, sessionId: string, batchId: string, options?: BatchVerificationOptions): BatchVerificationResult; /** * The notice shown when the batch reaches a phase boundary. * * The wording states what the SYSTEM is doing: compaction is running, this is * the moment its recovery cost is lowest, and the progress is already on * disk. It never asks the user for an action, because the zero-pause * contract makes compaction the system's job. The context ratio comes from * `buildContextVerdict` rather than from a second reading of the number, so * the occupancy shown and the tier the system acts on cannot disagree. */ export declare function buildPhaseBoundaryNotice(input: { readonly done: number; readonly total: number; readonly ratio?: number; readonly mode?: AutoCompactMode; }): string; /** * Is this leg's failure an ARTIFACT problem rather than a source problem? * * TWO SHAPES, and both are the repository's own. `missing-workspace-dist` is * the `tsc` leg's shape: every error it reported is a module-resolution * failure (TS2307 or TS7016) naming an internal workspace package, because * `tsc -p tsconfig.json` resolves the packages' subpath exports into their * `dist/` output, which no commit contains. That is the repository gate's * own rule (.husky/gate/repo.mjs), keyed on the PROPERTY rather than on one * spelling of the symptom: an absent build output says TS2307 and a missing * declaration file says TS7016, and both are the same problem. * * `build-prerequisite-refused` is the suite's shape: it refused to start * because the workspace build is stale, which is what the repository's own * test preflight does (tests/_global-setup/packages-build.ts). A run that * refused produced no results of its own, so a run that DID report results * is not this shape. */ export declare function detectArtifactFailure(output: string): BatchArtifactShape | null;