import { z } from "zod"; import type { AccessDeclaration, StepStatus } from "audit-tools/shared"; import { type LaneSubmissionShortfall } from "./laneSubmissions.js"; export declare const STEP_CONTRACT_VERSION = "audit-code-step/v1alpha1"; export declare const StepKindSchema: z.ZodEnum<["dispatch_review", "design_review", "design_review_parallel", "design_review_contract", "design_review_conceptual", "charter_extraction", "charter_delta", "charter_clarification", "systemic_challenge", "confirm_intent", "intent_equivalence", "analyzer_install", "analyzer_consent", "edge_reasoning_dispatch", "critical_flow_fallback", "synthesis_narrative", "present_report", "blocked"]>; export type StepKind = z.infer; /** * Lightweight run-level orientation surfaced in the step contract so a host * resuming an in-flight audit knows where it stands without reading artifacts. */ export declare const StepProgressSchema: z.ZodObject<{ /** One-line, human-readable summary safe to show a resuming host. */ summary: z.ZodString; /** Pending review packets in the active dispatch run, when applicable. */ pending_packets: z.ZodOptional; /** Audit tasks covered by the pending packets. */ pending_tasks: z.ZodOptional; /** Audit tasks already completed before this run (skipped as done). */ completed_tasks: z.ZodOptional; /** Packets GRANTED for dispatch this pass (the emergent admission width). */ granted_count: z.ZodOptional; /** Verbatim host in-flight cap (declared env limit), or null. */ declared_cap: z.ZodOptional>; /** Total agents (packets) that will be launched this run. */ agent_count: z.ZodOptional; /** * True when `agent_count` exceeds the configured confirm threshold and the * loader should pause for user confirmation before fan-out (FINDING-012). */ confirmation_recommended: z.ZodOptional; /** Human-readable fan-out summary, e.g. "12 agents, max 4 concurrent (rolling)". */ dispatch_summary: z.ZodOptional; }, "strict", z.ZodTypeAny, { summary: string; pending_packets?: number | undefined; pending_tasks?: number | undefined; completed_tasks?: number | undefined; granted_count?: number | undefined; declared_cap?: number | null | undefined; agent_count?: number | undefined; confirmation_recommended?: boolean | undefined; dispatch_summary?: string | undefined; }, { summary: string; pending_packets?: number | undefined; pending_tasks?: number | undefined; completed_tasks?: number | undefined; granted_count?: number | undefined; declared_cap?: number | null | undefined; agent_count?: number | undefined; confirmation_recommended?: boolean | undefined; dispatch_summary?: string | undefined; }>; export type StepProgress = z.infer; export declare const StepArtifactSchema: z.ZodObject<{ contract_version: z.ZodLiteral<"audit-code-step/v1alpha1">; step_kind: z.ZodEnum<["dispatch_review", "design_review", "design_review_parallel", "design_review_contract", "design_review_conceptual", "charter_extraction", "charter_delta", "charter_clarification", "systemic_challenge", "confirm_intent", "intent_equivalence", "analyzer_install", "analyzer_consent", "edge_reasoning_dispatch", "critical_flow_fallback", "synthesis_narrative", "present_report", "blocked"]>; prompt_path: z.ZodString; status: z.ZodEnum<["ready", "blocked", "complete"]>; run_id: z.ZodNullable; /** Run-level orientation; omitted for steps that have no meaningful summary. */ progress: z.ZodOptional; /** Audit tasks covered by the pending packets. */ pending_tasks: z.ZodOptional; /** Audit tasks already completed before this run (skipped as done). */ completed_tasks: z.ZodOptional; /** Packets GRANTED for dispatch this pass (the emergent admission width). */ granted_count: z.ZodOptional; /** Verbatim host in-flight cap (declared env limit), or null. */ declared_cap: z.ZodOptional>; /** Total agents (packets) that will be launched this run. */ agent_count: z.ZodOptional; /** * True when `agent_count` exceeds the configured confirm threshold and the * loader should pause for user confirmation before fan-out (FINDING-012). */ confirmation_recommended: z.ZodOptional; /** Human-readable fan-out summary, e.g. "12 agents, max 4 concurrent (rolling)". */ dispatch_summary: z.ZodOptional; }, "strict", z.ZodTypeAny, { summary: string; pending_packets?: number | undefined; pending_tasks?: number | undefined; completed_tasks?: number | undefined; granted_count?: number | undefined; declared_cap?: number | null | undefined; agent_count?: number | undefined; confirmation_recommended?: boolean | undefined; dispatch_summary?: string | undefined; }, { summary: string; pending_packets?: number | undefined; pending_tasks?: number | undefined; completed_tasks?: number | undefined; granted_count?: number | undefined; declared_cap?: number | null | undefined; agent_count?: number | undefined; confirmation_recommended?: boolean | undefined; dispatch_summary?: string | undefined; }>>; /** Shell commands the host may run for this step. */ allowed_commands: z.ZodArray; /** * MCP tool names equivalent to `allowed_commands`, for hosts driving the * backend through the MCP adapter. Omitted when the step has no MCP * equivalents, so a shell host never has to guess which list entries are * tool names versus runnable commands. */ allowed_mcp_tools: z.ZodOptional>; stop_condition: z.ZodString; repo_root: z.ZodString; artifacts_dir: z.ZodString; artifact_paths: z.ZodRecord>; access: z.ZodOptional; write_paths: z.ZodArray; forbidden_patterns: z.ZodOptional>; }, "strict", z.ZodTypeAny, { read_paths: string[]; write_paths: string[]; forbidden_patterns?: string[] | undefined; }, { read_paths: string[]; write_paths: string[]; forbidden_patterns?: string[] | undefined; }>>; /** * What a PREVIOUS emission of this step's lanes is still owed, by lane and * issue code. Present only when something is actually outstanding, so an * automated consumer reads the shortfall off the contract instead of * diffing two identical-looking steps. */ submission_shortfall: z.ZodOptional, "many">; }, "strict", z.ZodTypeAny, { expected: number; accepted: number; outstanding: { message: string; submission_path: string; lane: string; submission_id: string; issue_code: string; }[]; }, { expected: number; accepted: number; outstanding: { message: string; submission_path: string; lane: string; submission_id: string; issue_code: string; }[]; }>>; }, "strict", z.ZodTypeAny, { status: "blocked" | "ready" | "complete"; contract_version: "audit-code-step/v1alpha1"; run_id: string | null; repo_root: string; artifacts_dir: string; artifact_paths: Record; step_kind: "blocked" | "design_review" | "charter_clarification" | "analyzer_consent" | "systemic_challenge" | "critical_flow_fallback" | "synthesis_narrative" | "design_review_contract" | "design_review_conceptual" | "intent_equivalence" | "charter_delta" | "dispatch_review" | "design_review_parallel" | "charter_extraction" | "confirm_intent" | "analyzer_install" | "edge_reasoning_dispatch" | "present_report"; prompt_path: string; allowed_commands: string[]; stop_condition: string; progress?: { summary: string; pending_packets?: number | undefined; pending_tasks?: number | undefined; completed_tasks?: number | undefined; granted_count?: number | undefined; declared_cap?: number | null | undefined; agent_count?: number | undefined; confirmation_recommended?: boolean | undefined; dispatch_summary?: string | undefined; } | undefined; allowed_mcp_tools?: string[] | undefined; access?: { read_paths: string[]; write_paths: string[]; forbidden_patterns?: string[] | undefined; } | undefined; submission_shortfall?: { expected: number; accepted: number; outstanding: { message: string; submission_path: string; lane: string; submission_id: string; issue_code: string; }[]; } | undefined; }, { status: "blocked" | "ready" | "complete"; contract_version: "audit-code-step/v1alpha1"; run_id: string | null; repo_root: string; artifacts_dir: string; artifact_paths: Record; step_kind: "blocked" | "design_review" | "charter_clarification" | "analyzer_consent" | "systemic_challenge" | "critical_flow_fallback" | "synthesis_narrative" | "design_review_contract" | "design_review_conceptual" | "intent_equivalence" | "charter_delta" | "dispatch_review" | "design_review_parallel" | "charter_extraction" | "confirm_intent" | "analyzer_install" | "edge_reasoning_dispatch" | "present_report"; prompt_path: string; allowed_commands: string[]; stop_condition: string; progress?: { summary: string; pending_packets?: number | undefined; pending_tasks?: number | undefined; completed_tasks?: number | undefined; granted_count?: number | undefined; declared_cap?: number | null | undefined; agent_count?: number | undefined; confirmation_recommended?: boolean | undefined; dispatch_summary?: string | undefined; } | undefined; allowed_mcp_tools?: string[] | undefined; access?: { read_paths: string[]; write_paths: string[]; forbidden_patterns?: string[] | undefined; } | undefined; submission_shortfall?: { expected: number; accepted: number; outstanding: { message: string; submission_path: string; lane: string; submission_id: string; issue_code: string; }[]; } | undefined; }>; export type StepArtifact = z.infer; /** * Write the audit step contract. Delegates to the shared `writeStepContract` * (drift-plan R3) — the single source for the steps/ filenames, mkdir, prompt * write, atomic current-step.json write, the forward-slash normalization of ALL * host-facing path fields, and the canonical-paths-win merge. Promoting the * writer to shared is what fixed audit-code's Windows path-separator drift: it * previously wrote `prompt_path` / `repo_root` / `artifacts_dir` / * `artifact_paths` with raw backslashes, while remediate-code normalized them. * Audit's optional fields (progress, allowed_mcp_tools, access) ride through * `extraFields` with the same conditional-omission semantics as before. */ /** * One-line scope echo rendered into EVERY step prompt from the persisted * `scope_summary.json` the intake executor writes. Previously the echo lived * only in the host loader instructions, keyed to "after the FIRST next-step * (the intake step)" — so a RESUMED run (which never re-runs intake) silently * skipped it (2026-08-05 friction, ambiguous_direction). Tool-rendered here, * fresh and resumed steps carry the same line and no host has to remember. * Lenient: no/malformed summary file → no line. */ export declare function scopeEchoLine(artifactsDir: string): string | null; export declare function writeCurrentStep(params: { artifactsDir: string; stepKind: StepKind; status: StepStatus; runId: string | null; allowedCommands: string[]; allowedMcpTools?: string[]; progress?: StepProgress; stopCondition: string; repoRoot: string; artifactPaths: Record; prompt: string; access?: AccessDeclaration; submissionShortfall?: LaneSubmissionShortfall; }): Promise; //# sourceMappingURL=steps.d.ts.map