"""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 ReputationUpdateReceipt(BaseModel):
    """Reputation update based on council + genesis."""

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

    # Reputation-specific fields
    subject_id: str  # Actor whose reputation updated
    previous_reputation: float  # [0.0, 1.0] before update
    applied_delta: float  # [-1.0, +1.0] actual delta
    new_reputation: float  # [0.0, 1.0] after update, clamped
    council_decision_id: str  # Reference to council decision
    genesis_verification_id: str  # Reference to genesis verification
    genesis_confidence_factor: float  # 1.0 (verified) / 0.7 (unverifiable) / 0.0 (conflict)
    reason: str  # Explanation of update
