import { type RunLogger } from "audit-tools/shared"; import { type AuditResult, type AuditTask } from "../../types.js"; import type { AuditHostIngestIssue } from "../../validation/ingestIssueCodes.js"; declare const WORKLOAD_CONTRACT_VERSION: "audit-host-workload/v1alpha1"; declare const RESULT_MAP_CONTRACT_VERSION: "audit-host-result-map/v1alpha1"; export interface AuditHostTask { readonly task_id: string; readonly unit_id: string; readonly pass_id: string; readonly lens: string; readonly file_paths: readonly string[]; readonly file_line_counts: Readonly>; readonly rationale: string; readonly priority: string; readonly complexity: string; readonly risk: string; readonly token_estimate: number; } export interface AuditHostWorkItem { readonly id: string; readonly lens: string; readonly metadata: { readonly complexity: string; readonly risk: string; readonly token_estimate: number; }; readonly prompt: { readonly sha256: string; readonly text: string; }; readonly scope: { readonly files: readonly string[]; readonly unit_ids: readonly string[]; }; readonly result_path: string; } export interface AuditHostWorkload { readonly contract_version: typeof WORKLOAD_CONTRACT_VERSION; readonly run_id: string; readonly work_items: readonly AuditHostWorkItem[]; } export interface AuditHostResultMapEntry { readonly work_item_id: string; readonly prompt_sha256: string; readonly result_path: string; } export interface AuditHostResultMap { readonly contract_version: typeof RESULT_MAP_CONTRACT_VERSION; readonly run_id: string; readonly entries: readonly AuditHostResultMapEntry[]; } export interface PreparedAuditHostHandoff { readonly workload: AuditHostWorkload; readonly result_map: AuditHostResultMap; readonly workload_path: string; readonly result_map_path: string; } /** * One ADVISORY validation finding on an ACCEPTED result. Deliberately not a * {@link SubmissionIssue}: an accepted result was never refused, so it must * never ride (or be recorded through) the rejection-classified channel — see * {@link AuditHostIngestSummary.validation_warnings}. */ export interface AuditHostValidationWarning { readonly work_item_id: string; readonly result_path: string; readonly message: string; } export interface AuditHostIngestSummary { readonly accepted_count: number; readonly accepted_results: readonly AuditResult[]; readonly accepted_results_path: string; readonly completed_work_item_ids: readonly string[]; /** * Every submission this ingest could not accept, classified. * * The four ways a submission used to fail — absent file, unparseable bytes, a * body that violates the result contract, and a conversion that yields * nothing — all collapsed into the same bare `null` and the same silent * `continue`. A host that never wrote its result and a host that wrote * garbage were indistinguishable to every caller, which is exactly the * measured drift P25 exists to make visible. */ readonly issues: readonly AuditHostIngestIssue[]; /** * Advisory validation findings on results that WERE accepted — a small * coverage-stat divergence, verification metadata on a non-verification * task. Never a refusal: they ride this separate channel precisely so the * rejection list stays rejections only, and no ledger records an acceptance * as one. */ readonly validation_warnings: readonly AuditHostValidationWarning[]; } export declare function prepareAuditHostHandoff(params: { readonly root: string; readonly artifactsDir: string; readonly runId: string; readonly tasks: readonly AuditHostTask[]; /** * Threaded into the shared lock substrate so its heartbeat, timeout and * stale-lock-reclaim events are recorded rather than lost. Optional: a caller * with no run log still gets the serialization, just not the telemetry. */ readonly logger?: RunLogger; }): Promise; export declare function ingestAuditHostResults(params: { readonly root: string; readonly artifactsDir: string; readonly runId: string; /** * The active audit-task manifest, REQUIRED: every task-known result is put * through the SAME per-result rules `validateAuditResults` applies to the * batch BEFORE it is written to the accepted pair; a task-unknown (orphan) * result passes through unvalidated, mirroring the batch gate's retention of * orphans. Requiring it here means no caller can silently regain * accept-without-validation by forgetting to pass the manifest. */ readonly auditTasks: readonly AuditTask[]; /** * Normalized path → actual line count, built from the repo manifest exactly as * {@link runAuditStep} builds it. Threads the line-count rules of the batch * gate into the accept decision; absent means those checks degrade to skips, * never to errors. */ readonly lineIndex?: Record; /** See {@link prepareAuditHostHandoff}'s `logger`. */ readonly logger?: RunLogger; }): Promise; /** * Remove accepted entries — the supported way back out of an acceptance. * * An accepted binding is skipped forever by {@link ingestAuditHostResults}, so * before this verb existed the only exit from a poisoned acceptance was editing * both files of the pair by hand. This runs under the SAME lock the writers use, * rewrites BOTH files together (they are one logical record), refuses a ledger * that fails the strict loader rather than truncating what it cannot validate, * records each removal on the shared submission ledger so a repaired run stays * distinguishable from a clean one, and invalidates the persisted step contract * — a stale live instruction may not survive a verb that mutates run state. */ export declare function dropAcceptedResults(params: { readonly root: string; readonly artifactsDir: string; readonly runId: string; /** Work items to drop. Required unless {@link dropAcceptedResults.all}. */ readonly workItemIds?: readonly string[]; /** Drop EVERY entry. */ readonly all?: boolean; /** See {@link prepareAuditHostHandoff}'s `logger`. */ readonly logger?: RunLogger; }): Promise<{ readonly dropped_work_item_ids: readonly string[]; }>; export {}; //# sourceMappingURL=hostHandoff.d.ts.map