Validation Responses

Ivorleaf exposes validation at the technical-analysis, workflow, and implementation-package layers. Check the structure that corresponds to the output you requested; there is no universal top-level validation property on TutorResponse.

Gate technical-session analysis

type Analysis = {
  confidence?: number;
  assumptions?: string[];
  unknowns?: string[];
  risks?: Array<{ severity?: string; description?: string }>;
  sources?: unknown[];
  validation_status?: {
    grounded?: boolean;
    official_documentation_used?: boolean;
    conflicting_sources_detected?: boolean;
    human_review_recommended?: boolean;
    validation_level?: "strong" | "moderate" | "limited";
  };
};

const analyses: Analysis[] = response.technical_analysis?.analyses ?? [];
const reviewRequired = analyses.some((analysis) =>
  analysis.validation_status?.human_review_recommended === true ||
  analysis.validation_status?.conflicting_sources_detected === true ||
  analysis.validation_status?.grounded !== true
);

if (reviewRequired) await routeToReviewer(response);
else await continueWorkflow(response.session_id);

The field names above are taken from the technical-analysis source implementation. technical_analysis remains an optional untyped object in the public OpenAPI model, so validate it at runtime.

Handle confidence

Confidence is a 01 number for each analysis packet. Do not create an undocumented universal cutoff. Combine it with validation_level, grounding, conflicts, risk severity, assumptions, and unknowns according to your own review policy.

Surface assumptions and unknowns

Show assumptions and unknowns next to generated content. Unknowns are not failures; they define facts the analysis could not establish. For implementation packages, inspect blocking_unknowns separately because those can block preparation or execution readiness.

Display sources

Present sources and citation_warnings together. official_documentation_used means an analysis source was marked official; it does not mean every returned source is official.

Workflow and package controls

For a validated workflow, check validation_summary.human_review_recommended. For an implementation package, check validation.human_review_required, human_review_reasons, and preparation status. Recommend and Continue also consult saved workflow risk and can skip continuation when review is required.

Log safely

Log session and validation identifiers, levels, booleans, risk categories, and warnings. Avoid logging API keys, full confidential prompts, or sensitive artifact content.