Response Schema

Complete TypeScript schema for all API response types.

ReasoningResult

The primary response type from the /run endpoint.

typescript
interface ReasoningResult {
  status: "GROUND" | "BRIDGE" | "CONFLICT" | "PROVISIONAL";
  content: {
    answer: string;
    confidence: number;
    implication: string;
  };
  structure: {
    closest_shape: string;
    geometric_confidence: number;
    gap_score: number;
    fires: boolean;
  };
  bridge: {
    bridge: string;
    assumptions: string[];
    confidence: number;
  } | null;
  conflict: {
    conflict: boolean;
    message: string;
  };
  chain: {
    id: string;
    root: string;
    length: number;
    verified: boolean;
  };
  receipt: unknown;
  // ASI-only fields
  tier2?: unknown;
  persistence?: unknown;
  emergence?: unknown;
  library_stats?: unknown;
}

Session

typescript
interface Session {
  id: string;
  user_id: string;
  type: "reasoning" | "vantagepoint";
  title: string | null;
  chain_id: string | null;
  receipt_id: string | null;
  chain_root: string | null;
  turn_count: number;
  created_at: string;
  updated_at: string;
}

Turn

typescript
interface Turn {
  id: string;
  session_id: string;
  turn_index: number;
  input: string;
  status: "GROUND" | "BRIDGE" | "CONFLICT" | "PROVISIONAL";
  output: ReasoningResult;
  chain_hash: string | null;
  created_at: string;
}

Receipt

typescript
interface Receipt {
  id: string;
  session_id: string | null;
  session_type: "reasoning" | "vantagepoint";
  chain_id: string;
  chain_root: string;
  chain_length: number;
  verified: boolean;
  pruv_id: string | null;
  pdf_url: string | null;
  badge_svg: string | null;
  created_at: string;
}