/** A formal contract extracted from source code (not LLM-generated). */ export interface ContractClaim { id: string; source: 'type_signature' | 'runtime_schema' | 'database_migration' | 'api_spec'; /** The file the contract was extracted from. */ sourceFile: string; /** Human-readable description of what the contract asserts. */ description: string; /** Machine-comparable assertion (e.g., "function pay returns Promise"). */ assertion: string; severity: 'critical' | 'high' | 'medium' | 'low'; } /** Result of verifying code against an extracted contract. */ export interface ContractVerification { contractId: string; verdict: 'PASS' | 'FAIL'; evidence: string; /** The contract that was checked. */ contract: ContractClaim; } /** Shape extracted from a Zod/io-ts/Yup schema. */ export interface SchemaShape { name: string; fields: Record; sourceFile: string; sourceLine: number; } /** Column extracted from a database migration. */ export interface MigrationColumn { table: string; column: string; type: string; nullable: boolean; sourceFile: string; } /** Stats for contract verification layer. */ export interface ContractStats { typeContractsExtracted: number; typeContractsVerified: number; schemaContractsExtracted: number; schemaContractsVerified: number; migrationContractsExtracted: number; migrationContractsVerified: number; smtProofsAttempted: number; smtProofsSucceeded: number; failures: ContractVerification[]; }