{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/locus-report/json-schema/locus-report-property-update-diagnostic-schema.json",
  "title": "PropertyUpdateDiagnostic",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/locus-report-openapi.json#/components/schemas/PropertyUpdateDiagnostic",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "const": "property_update_diagnostic"
    },
    "charged": {
      "type": "boolean",
      "const": false
    },
    "status": {
      "type": "string",
      "enum": [
        "insufficient_current_context",
        "clarification_required"
      ]
    },
    "message": {
      "type": "string"
    },
    "findingCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "recommendedRadiusMeters": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "requestedAddress": {
      "type": "string"
    },
    "matchedAddress": {
      "type": "string"
    },
    "matchedParcelId": {
      "type": "string"
    },
    "recommendedAction": {
      "type": "string",
      "enum": [
        "retry_with_larger_radius_or_choose_another_workflow",
        "confirm_subject_before_payment"
      ]
    },
    "retryInput": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "minLength": 5,
          "maxLength": 240,
          "description": "One US street address. Locus preflights official-record coverage before payment."
        },
        "radiusMeters": {
          "default": 1500,
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 10000
        },
        "lookbackDays": {
          "default": 365,
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 3650
        },
        "focus": {
          "description": "Emphasize these finding families in the video scene ordering. The aerial subject opening and report/QR closing scenes are unaffected.",
          "maxItems": 3,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "development",
              "zoning",
              "environment",
              "market",
              "infrastructure"
            ]
          }
        },
        "brand": {
          "description": "Optional brokerage branding for the property-update video, proof-gated HTML view, and PDF, and for the returned emailPackage: a logo (HTTPS `logo` or inline `logoDataUri`), brokerage and agent details, colors, and `preparedFor`, in any combination. It does not change the canonical JSON report or its hash.",
          "type": "object",
          "properties": {
            "name": {
              "description": "Agent, team, or preparer name as it should appear.",
              "type": "string",
              "minLength": 2,
              "maxLength": 80,
              "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
            },
            "organization": {
              "description": "Brokerage or company name.",
              "type": "string",
              "minLength": 2,
              "maxLength": 120,
              "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
            },
            "license": {
              "description": "License identifier exactly as it must appear, e.g. \"NC Lic. 123456\".",
              "type": "string",
              "minLength": 2,
              "maxLength": 60,
              "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
            },
            "phone": {
              "description": "Business phone, digits and separators only.",
              "type": "string",
              "minLength": 7,
              "maxLength": 32,
              "pattern": "^[0-9()+.\\- ]+$"
            },
            "email": {
              "description": "Business email. Used as the reply-to address in the returned emailPackage.",
              "type": "string",
              "maxLength": 120,
              "pattern": "^[^\\s@<>]{1,64}@[^\\s@<>]{1,120}\\.[A-Za-z]{2,24}$"
            },
            "website": {
              "description": "Website shown as text only.",
              "type": "string",
              "maxLength": 120,
              "pattern": "^(?:https?:\\/\\/)?[A-Za-z0-9-]+(?:\\.[A-Za-z0-9-]+)+(?:\\/[A-Za-z0-9._~\\/-]*)?$"
            },
            "primaryColor": {
              "description": "Hex color (#RRGGBB) for links, marks, and buttons.",
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            "accentColor": {
              "description": "Hex color (#RRGGBB) for highlights.",
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            "preparedFor": {
              "description": "Your own label for the client or recipient, e.g. \"the Rivera family\". Shown as written; Locus never looks it up.",
              "type": "string",
              "minLength": 2,
              "maxLength": 120,
              "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
            },
            "contact": {
              "description": "The same contact fields nested, as accepted by locus-property-flyer. A top-level field wins.",
              "type": "object",
              "properties": {
                "name": {
                  "description": "Agent, team, or preparer name as it should appear.",
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 80,
                  "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
                },
                "organization": {
                  "description": "Brokerage or company name.",
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 120,
                  "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
                },
                "license": {
                  "description": "License identifier exactly as it must appear, e.g. \"NC Lic. 123456\".",
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 60,
                  "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
                },
                "phone": {
                  "description": "Business phone, digits and separators only.",
                  "type": "string",
                  "minLength": 7,
                  "maxLength": 32,
                  "pattern": "^[0-9()+.\\- ]+$"
                },
                "email": {
                  "description": "Business email. Used as the reply-to address in the returned emailPackage.",
                  "type": "string",
                  "maxLength": 120,
                  "pattern": "^[^\\s@<>]{1,64}@[^\\s@<>]{1,120}\\.[A-Za-z]{2,24}$"
                },
                "website": {
                  "description": "Website shown as text only.",
                  "type": "string",
                  "maxLength": 120,
                  "pattern": "^(?:https?:\\/\\/)?[A-Za-z0-9-]+(?:\\.[A-Za-z0-9-]+)+(?:\\/[A-Za-z0-9._~\\/-]*)?$"
                }
              },
              "additionalProperties": false
            },
            "logoDataUri": {
              "description": "Inline PNG, JPEG, or WebP logo as a base64 data URI, 512 KB or less. SVG and remote URLs are rejected.",
              "type": "string",
              "maxLength": 700000,
              "pattern": "^data:image\\/(?:png|jpeg|webp);base64,[A-Za-z0-9+\\/]+={0,2}$"
            },
            "logo": {
              "description": "Optional caller-authorized logo fetched from an HTTPS URL. When both are sent, this wins over logoDataUri.",
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "const": "brand_logo",
                  "description": "Declares a raster brand mark that replaces visible Locus branding in the requested flyer or video."
                },
                "url": {
                  "type": "string",
                  "maxLength": 2048,
                  "pattern": "^https:\\/\\/",
                  "description": "HTTPS URL for a caller-authorized PNG, JPEG, or WebP logo. The API fetches and embeds it; renderers never fetch this URL."
                },
                "sourceName": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 120
                },
                "rightsConfirmed": {
                  "type": "boolean",
                  "const": true
                },
                "rightsBasis": {
                  "type": "string",
                  "enum": [
                    "owned_by_requester",
                    "licensed_for_marketing",
                    "public_domain"
                  ]
                },
                "rightsHolder": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 160
                },
                "permittedUse": {
                  "type": "string",
                  "const": "commercial_marketing"
                },
                "attestedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "privacyReviewed": {
                  "type": "boolean",
                  "const": true,
                  "description": "Requester confirms the logo contains no unnecessary personal information."
                }
              },
              "required": [
                "role",
                "url",
                "sourceName",
                "rightsConfirmed",
                "rightsBasis",
                "rightsHolder",
                "permittedUse",
                "attestedAt",
                "privacyReviewed"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "searchHighlights": {
          "description": "Optional cited findings gathered during a prior parcel or property search to feature as visual highlight cards in the video. Each is shown as supplied by the preparer with its source. Must cite official sources; no scores, rankings, valuations, or safe/unsafe verdicts.",
          "maxItems": 4,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "eyebrow": {
                "description": "Optional short category label, e.g. 'Flood zone' or 'Zoning'.",
                "type": "string",
                "minLength": 2,
                "maxLength": 48,
                "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
              },
              "title": {
                "type": "string",
                "minLength": 3,
                "maxLength": 72,
                "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
              },
              "metric": {
                "description": "Optional standout figure or badge (e.g. '0.42 ac · R-4', '$412,000', 'Zone X (unshaded)').",
                "type": "string",
                "minLength": 1,
                "maxLength": 40,
                "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
              },
              "detail": {
                "type": "string",
                "minLength": 4,
                "maxLength": 160,
                "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
              },
              "sourceName": {
                "type": "string",
                "minLength": 2,
                "maxLength": 80,
                "pattern": "^[^\\x00-\\x1F\\x7F<>]*$",
                "description": "The official source this finding came from, shown on the card."
              },
              "sourceUrl": {
                "type": "string",
                "maxLength": 500,
                "pattern": "^https?:\\/\\/"
              },
              "recordId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "pattern": "^[^\\x00-\\x1F\\x7F<>]*$"
              }
            },
            "required": [
              "title",
              "detail",
              "sourceName"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "address",
        "radiusMeters",
        "lookbackDays"
      ],
      "additionalProperties": false
    },
    "alternativeTools": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tool": {
            "type": "string",
            "enum": [
              "locus-local-trend-brief",
              "locus-place-report"
            ]
          },
          "endpoint": {
            "type": "string",
            "enum": [
              "/api/locus-local-trend-brief",
              "/api/locus-place-report"
            ]
          },
          "requiresPayment": {
            "type": "boolean",
            "const": true
          },
          "reason": {
            "type": "string"
          },
          "availableForPlace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string",
                "const": "varies"
              }
            ],
            "description": "Shared lane-availability result for the resolved place; false means do not call this route here."
          },
          "coverageNote": {
            "type": "string"
          },
          "inputHint": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "place": {
                    "type": "string"
                  },
                  "intent": {
                    "type": "string",
                    "const": "homebuyer_due_diligence"
                  },
                  "lookbackMonths": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60
                  }
                },
                "required": [
                  "place",
                  "intent",
                  "lookbackMonths"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "radiusMeters": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 2000
                  },
                  "lookbackDays": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 3650
                  }
                },
                "required": [
                  "address",
                  "radiusMeters",
                  "lookbackDays"
                ],
                "additionalProperties": false
              }
            ],
            "description": "Schema-safe request fields for the named alternative; preflight and authorize it as a separate paid call."
          }
        },
        "required": [
          "tool",
          "endpoint",
          "requiresPayment",
          "reason",
          "availableForPlace",
          "inputHint"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "kind",
    "charged",
    "status",
    "message",
    "findingCount",
    "recommendedAction"
  ],
  "additionalProperties": false
}