import { z } from "zod"; export declare const INTAKE_SOURCE_MANIFEST_SCHEMA_VERSION: "remediate-code-intake-source-manifest/v1alpha1"; export declare const INTAKE_SUMMARY_SCHEMA_VERSION: "remediate-code-intake-summary/v1alpha1"; export declare const INTAKE_CLARIFICATION_SCHEMA_VERSION: "remediate-code-intake-clarifications/v1alpha1"; export type IntakeSourceType = "document" | "conversation" | "structured_audit"; export interface IntakeSource { type: IntakeSourceType; path: string; label?: string; } export interface IntakeSourceManifest { schema_version: typeof INTAKE_SOURCE_MANIFEST_SCHEMA_VERSION; created_from: "input" | "default_candidates" | "conversation" | "mixed"; sources: IntakeSource[]; } export declare const IntakeOpenQuestionSchema: z.ZodObject<{ id: z.ZodString; question: z.ZodString; category: z.ZodOptional; blocking: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; question: string; category?: string | undefined; blocking?: boolean | undefined; }, { id: string; question: string; category?: string | undefined; blocking?: boolean | undefined; }>; export type IntakeOpenQuestion = z.infer; export declare const IntakeSummarySchema: z.ZodObject<{ schema_version: z.ZodLiteral<"remediate-code-intake-summary/v1alpha1">; ready: z.ZodBoolean; source_type: z.ZodEnum<["structured_audit", "documents", "conversation", "mixed"]>; goals: z.ZodArray; non_goals: z.ZodArray; constraints: z.ZodArray; affected_files: z.ZodArray; }, "strip", z.ZodTypeAny, { path: string; reason?: string | undefined; }, { path: string; reason?: string | undefined; }>, "many">; open_questions: z.ZodArray; blocking: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; question: string; category?: string | undefined; blocking?: boolean | undefined; }, { id: string; question: string; category?: string | undefined; blocking?: boolean | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { affected_files: { path: string; reason?: string | undefined; }[]; schema_version: "remediate-code-intake-summary/v1alpha1"; ready: boolean; source_type: "conversation" | "structured_audit" | "mixed" | "documents"; goals: string[]; non_goals: string[]; constraints: string[]; open_questions: { id: string; question: string; category?: string | undefined; blocking?: boolean | undefined; }[]; }, { affected_files: { path: string; reason?: string | undefined; }[]; schema_version: "remediate-code-intake-summary/v1alpha1"; ready: boolean; source_type: "conversation" | "structured_audit" | "mixed" | "documents"; goals: string[]; non_goals: string[]; constraints: string[]; open_questions: { id: string; question: string; category?: string | undefined; blocking?: boolean | undefined; }[]; }>; export type IntakeSummary = z.infer; /** * Validate a raw parsed `intake-summary.json` payload against * {@link IntakeSummarySchema}, throwing a legible Error when the shape does * not conform — the read-time refusal for CP-NODE-2 invariants[11]'s * 'unvalidated intake artifacts' defect class. Before this, `readIntakeArtifacts` * read the file through `readOptionalJsonFile`, a bare `JSON.parse(content) * as T` assertion with zero runtime shape checking (src/shared/io/json.ts), so * a structurally malformed summary — e.g. `ready: "yes"` (a truthy STRING, not * a boolean, so `Boolean(summary.ready)` in `isIntakeReady` silently accepted * it) or a non-array `goals` — was trusted verbatim. The thrown Error's * message becomes the caller's refusal reason: `readIntakeArtifacts` and its * callers run inside `runWithBlockedStepBackstop` (src/shared/io/stepContractWriter.ts), * which turns any throw into a `blocked` step contract naming the cause * verbatim — the mechanism this validation deliberately relies on instead of * degrading silently to `undefined` (contrast the sibling clarification-file * JSON-parse-failure branch a few lines below, which intentionally DOES * degrade to absent because `resolveIntakeStep` re-prompts for it downstream; * `intake-summary.json` has no such re-synthesis path, so silence there would * strand the run on unvalidated data instead). */ export declare function validateIntakeSummary(raw: unknown, path: string): IntakeSummary; export declare function intakePaths(artifactsDir: string): { dir: string; sourceManifest: string; conversationStart: string; summary: string; clarificationResolution: string; brief: string; extractedPlan: string; intentCheckpoint: string; findingsDigest: string; findingEnumeration: string; riskSignal: string; }; /** * Build a document source manifest from an ordered list of input paths. * * The paths are the first-wins-deduped UNION of every supplied `--input` (the * CLI accumulates repeats into a string[]): duplicates that resolve to the same * absolute path collapse to their first occurrence, preserving input order, and * the surviving sources get order-stable `input-NN` labels (01, 02, …). Dedup is * keyed on the resolved absolute path so `./a.md` and `a.md` (same file) are one * source, while distinct files stay distinct. */ export declare function buildDocumentSourceManifest(paths: string[], createdFrom: IntakeSourceManifest["created_from"]): IntakeSourceManifest; export declare function buildStructuredAuditSourceManifest(path: string, createdFrom: IntakeSourceManifest["created_from"]): IntakeSourceManifest; export declare function buildConversationSourceManifest(conversationPath: string): IntakeSourceManifest; /** * Build the manifest for a run supplied with BOTH `--input` and `--guidance-file`: * the input manifest's sources plus the conversation-start guidance doc. Precedence * may order sources, never evict one — the guidance file must be listed or the * synthesize_intake worker ("read only the listed source files") never sees it. */ export declare function buildMixedSourceManifest(inputSourceManifest: IntakeSourceManifest, conversationPath: string): IntakeSourceManifest; /** * True when a manifest's source set was fixed by an explicit `--input` — alone * (`"input"`) or alongside a guidance file (`"mixed"`). Input-bound manifests are * user-chosen: a bare next-step must never re-derive them from default candidates, * and re-passing the same `--input` must resume rather than conflict. */ export declare function manifestIsInputBound(manifest: IntakeSourceManifest): boolean; export declare function sourceManifestsEquivalent(a: IntakeSourceManifest | undefined, b: IntakeSourceManifest | undefined): boolean; export declare function resolveManifestSources(root: string, manifest: IntakeSourceManifest): { resolved: IntakeSource[]; missing: IntakeSource[]; }; export declare function blockingIntakeQuestions(summary: IntakeSummary | undefined): IntakeOpenQuestion[]; export declare function intakeSummaryContentErrors(summary: IntakeSummary): string[]; export declare function isIntakeReady(summary: IntakeSummary | undefined): boolean; export interface ClarificationValidationResult { valid: boolean; errors: string[]; } /** * Validate the `intake-clarifications.json` file against the IntakeClarifications * schema. Returns valid=true when the file is well-formed and addresses at least * one blocking question (if blocking questions exist). Returns valid=false with * error details when the resolution is malformed or fails to address blocking * questions. */ export declare function validateClarificationResolution(resolution: unknown, blockingQuestions: IntakeOpenQuestion[], allQuestions?: IntakeOpenQuestion[]): ClarificationValidationResult; export declare function readIntakeArtifacts(artifactsDir: string): Promise<{ manifest?: IntakeSourceManifest; conversationStart?: string; summary?: IntakeSummary; clarificationResolution?: unknown; brief?: string; }>; //# sourceMappingURL=intake.d.ts.map