from __future__ import annotations

from dataclasses import dataclass, field

from backend.services.artifact_models import ArtifactReference
from backend.services.generated_document.generated_document_metadata import GeneratedDocumentFormat
from backend.services.tool_source_artifacts.image_assets import SourceImageAsset


@dataclass(frozen=True)
class GeneratedDocumentRevisionSource:
    """Resolved editable source contract consumed by generated-document revision tools."""

    source_yaml: str
    document_format: GeneratedDocumentFormat
    filename: str | None
    lineage_id: str
    lineage_role: str
    source: ArtifactReference
    image_assets: list[SourceImageAsset] = field(default_factory=list)
