export declare const CONSULTATION_CAPABILITIES: readonly ["strategy", "sourceReview"]; export declare const SOURCE_REVIEW_PHASES: readonly ["initial", "verification", "final"]; export type ConsultationCapability = typeof CONSULTATION_CAPABILITIES[number]; export declare const CONSULTATION_ROLE_POLICY: Readonly<{ readonly strategy: "dog-advisor"; readonly sourceReview: "dog-reviewer"; }>; export declare const STRATEGY_TRIGGERS: readonly ["architecture-choice", "cross-boundary-tradeoff", "material-uncertainty"]; export type StrategyTrigger = typeof STRATEGY_TRIGGERS[number]; export interface StrategyTriggerInput { readonly candidateId: string; readonly trigger?: StrategyTrigger; readonly callsForCandidate: number; readonly decisionAlreadyRecorded?: boolean; readonly mechanicalChange?: boolean; readonly sameTaskResume?: boolean; } /** Strategy is advisory, bounded to one call, and excluded when no design decision remains. */ export declare function shouldConsultStrategy(input: StrategyTriggerInput): boolean; export declare const SOURCE_REVIEW_RISK_TAGS: readonly ["security", "credential", "permission", "network", "public-api", "privacy", "transaction", "time", "timezone", "public-logic", "storage-compatibility", "package", "build", "release", "migration", "concurrency", "process-io", "write-gate", "authorization"]; export type SourceReviewRiskTag = typeof SOURCE_REVIEW_RISK_TAGS[number]; export declare function isSourceReviewRiskTag(value: unknown): value is SourceReviewRiskTag; export declare function requiresSourceReview(riskTags: readonly SourceReviewRiskTag[]): boolean; export type SourceReviewRequirement = "SKIP_LOW_RISK" | "WAIT_CANONICAL_VALIDATION" | "REVIEW_REQUIRED" | "REVIEW_TOO_LATE" | "RISK_TAGS_INVALID"; export interface SourceReviewRequirementInput { readonly riskTags: unknown; readonly canonicalValidationExit?: number; readonly stagingStarted: boolean; } /** Places required review strictly after canonical PASS and before staging. */ export declare function evaluateSourceReviewRequirement(input: SourceReviewRequirementInput): SourceReviewRequirement; export type ReviewAvailability = { readonly ok: true; } | { readonly ok: false; readonly code: "REVIEW_UNAVAILABLE"; }; export declare function evaluateReviewAvailability(required: boolean, available: boolean): ReviewAvailability; export interface StrategyConsultationRequest { readonly requestId: string; readonly candidateId: string; readonly capability: "strategy"; readonly agent: string; readonly question: string; readonly constraints: readonly string[]; readonly options: readonly string[]; } export interface ReviewArtifact { readonly schemaVersion: 1; readonly candidateId: string; readonly sourceFingerprint: string; readonly acceptance: readonly string[]; readonly changedLogicSummary: readonly string[]; readonly manifest: readonly string[]; readonly riskTags: readonly SourceReviewRiskTag[]; readonly riskBearingHunks: readonly string[]; readonly validation: { readonly command: string; readonly exit: 0; readonly fingerprint: string; }; readonly invariants: readonly string[]; } export interface SourceReviewConsultationRequest { readonly requestId: string; readonly candidateId: string; readonly capability: "sourceReview"; readonly agent: string; readonly artifact: ReviewArtifact; } export type ConsultationRequest = StrategyConsultationRequest | SourceReviewConsultationRequest; export interface StrategyConsultationResult { readonly requestId: string; readonly candidateId: string; readonly capability: "strategy"; readonly status: "completed"; readonly recommendation: string; readonly considerations: readonly string[]; } export interface UnavailableConsultationResult { readonly requestId: string; readonly candidateId: string; readonly capability: ConsultationCapability; readonly status: "unavailable"; } export type ReviewVerdictKind = "PASS" | "MUST_FIX" | "BLOCKED"; export type ReviewFindingSeverity = "major" | "medium"; export interface ReviewFinding { readonly severity: ReviewFindingSeverity; readonly path: string; readonly evidence: string; readonly requiredFix: string; } export interface ReviewVerdict { readonly verdict: ReviewVerdictKind; readonly sourceFingerprint: string; readonly findings: readonly ReviewFinding[]; } export interface SourceReviewConsultationResult { readonly requestId: string; readonly candidateId: string; readonly capability: "sourceReview"; readonly status: "completed"; readonly review: ReviewVerdict; } export type ConsultationResult = StrategyConsultationResult | SourceReviewConsultationResult | UnavailableConsultationResult; /** * Sole consultation transport boundary. The host supplies this adapter; core passes only the * provider-, model-, variant-, and transport-neutral request and result envelopes above. */ export interface ConsultationAdapter { consult(request: ConsultationRequest): Promise; } export declare const MAX_REVIEW_ARTIFACT_BYTES = 30720; export type ValidationResult = { readonly ok: true; readonly value: T; readonly bytes?: number; } | { readonly ok: false; readonly code: string; }; /** Strict bounded schema; unknown fields and opaque/raw payloads are rejected. */ export declare function validateReviewArtifact(value: unknown, maxBytes?: number): ValidationResult; export declare function validateReviewVerdict(value: unknown): ValidationResult; export interface ReviewGateInput { readonly phase: "initial" | "verification"; readonly candidateId: string; readonly currentSourceFingerprint: string; readonly artifact: unknown; readonly verdict: unknown; readonly reviewedFingerprints: readonly string[]; /** The configured budget applies independently to each explicit review phase. */ readonly maxCallsPerCandidate: number; readonly callsForPhase: number; readonly initialVerdict?: ReviewVerdictKind; readonly initialArtifact?: unknown; readonly remediationApplied?: boolean; readonly maxArtifactBytes?: number; } export type ReviewGateResult = { readonly ok: true; readonly permitStage: boolean; readonly verdict: ReviewVerdictKind; } | { readonly ok: false; readonly code: string; }; /** Enforces one initial review and, only after remediation, one verification review. */ export declare function evaluateReviewGate(input: ReviewGateInput): ReviewGateResult;