import Foundation /// Matches `src/db/models.rs::Contract` (camelCase). struct Contract: Decodable, Identifiable, Hashable { let id: String let ownerId: String? let name: String let description: String? let contractType: String // "simple" | "specification" let phase: String // "research" | "specify" | "plan" | "execute" | "review" let status: String // "active" | "completed" | "archived" let supervisorTaskId: String? let autonomousLoop: Bool? let phaseGuard: Bool? let localOnly: Bool? let version: Int? let createdAt: Date? let updatedAt: Date? var isActive: Bool { status.lowercased() == "active" } }