{
  "contract_id": "d15-asset-storage-contract",
  "version": "2026-09-10.1",
  "status": "verified_as_contract",
  "implementation_started": false,
  "live_external_download": false,
  "ai_transformation_in_scope": false,
  "input": ["ArticleSnapshot.images", "article_id", "revision_id", "resource_id", "run_id", "source_page_url", "rights_policy", "D14 delivery policy", "storage root", "idempotency key"],
  "lifecycle": ["IMAGE_DISCOVERED", "RIGHTS_PENDING", "FETCH_ALLOWED", "FETCHED", "VALIDATED", "OPTIMIZED", "READY_FOR_REVIEW", "APPROVED_FOR_ARTICLE"],
  "failure_statuses": ["NO_ACCESS", "BLOCKED", "UNSUPPORTED", "TOO_LARGE", "INVALID_CONTENT", "RIGHTS_REVIEW_REQUIRED", "REJECTED"],
  "rights_statuses": ["ALLOWED", "UNKNOWN", "REVIEW_REQUIRED", "REJECTED", "NO_ACCESS", "NOT_TESTED"],
  "asset_record_required": ["asset_id", "article_id", "revision_id", "resource_id", "run_id", "source_page_url", "source_url", "retrieved_at", "http_status", "content_type", "content_length", "source_sha256", "width", "height", "format", "source_storage_ref", "derivative_storage_refs", "role", "alt_text", "caption", "attribution", "rights_status", "asset_status", "pipeline_version", "evidence_ids", "warnings"],
  "security": ["redirect_private_ip_denied", "response_size_limit", "pixel_limit_before_decode", "magic_bytes_check", "active_content_rejected_or_sanitized", "raw_immutable", "credentials_absent"],
  "dedup_rule": "Same source_sha256 may deduplicate only with compatible article/resource/rights context; provenance records must remain.",
  "d14_delivery_policy": {
    "source_root": "content/image-source/",
    "optimizer": ["public-site/scripts/optimize-images.mjs", "public-site/scripts/optimize-one-image.mjs"],
    "component": "public-site/components/OptimizedImage.js",
    "formats": ["AVIF", "WebP"],
    "max_width": 2400,
    "statuses": ["READY", "REVIEW", "TOO_LARGE"],
    "budgets_kb": {"hero": {"target": 350, "review": 500}, "content": {"target": 250, "review": 400}, "card": {"target": 150, "review": 200}, "icon": {"target": 50, "review": 100}}
  },
  "fixtures": ["valid_jpeg_png_webp", "html_disguised_as_image", "redirect_private_ip", "oversized_or_pixel_bomb", "duplicate_hash_different_context", "missing_license", "corrupt_file", "exif_derivative_cleanup", "optimizer_budget_status", "failed_download_no_overwrite"],
  "rollback": "Switch article pointer to previous approved manifest; remove only temporary/rejected derivatives under retention policy; never delete or overwrite raw evidence.",
  "links": ["/docs/d15-writter-plan.html", "/docs/d15-extraction-evidence-contract.html", "/docs/d14-web-save-plan.html", "/public-site/IMAGE_POLICY.md", "/docs/IMAGE_GENERATION_STANDARD_Q11.md", "/docs/d11-rights-queue-contract.md"]
}
