"""Auto-generated from LOOM_CONTRACT.md by contract_compiler.py vv1.1.0"""

from pydantic import BaseModel, Field
from datetime import datetime
from typing import List, Dict, Optional, Any

class OutcomeReceipt(BaseModel):
    """Observed outcome linked to prophecy."""

    # Standard receipt fields
    receipt_id: str
    receipt_type: str = "outcome.v1"
    loomdip: str = "pending"
    signature: str = "unsigned"
    valid_time: datetime = Field(default_factory=datetime.utcnow)
    tier: str = "SIGNED"

    # Outcome-specific fields
    outcome: float  # Actual result (0.0 or 1.0 for binary, or continuous)
    prophecy_ref: Optional[str] = None    # ProphecyReceipt ID (LOOM contract)
    decision_id: Optional[str] = None    # CouncilDecisionReceipt ID (genesis bridge)
    observed_at: datetime  # When outcome became known
    latency_seconds: Optional[float] = None    # Time between prophecy and outcome

    # Verification
    verified_by: Optional[str] = None    # Source that verified outcome
    verification_confidence: Optional[float] = None    # Confidence in outcome
    metadata: Optional[Dict[str, Any]] = None    # Additional context
