Brand Studio docs
Engineering manualSchema reference

Brand Studio selected-plan execution

Declared schema: schemas/selected-plan-execution.schema.json

Source: schemas/selected-plan-execution.schema.json. This is the complete declaration, including nested definitions and constraints. Its presence is not evidence that a runtime producer or consumer validates against it.

All schemas · Data structures and lineage

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mirrorfactory.com/schemas/selected-plan-execution.schema.json",
  "title": "Brand Studio selected-plan execution",
  "description": "The immutable, source-bound plan approved before any selected-plan dispatch.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "execution_contract",
    "rate_version",
    "domain",
    "market",
    "preset",
    "selection",
    "rows",
    "legs",
    "max_cost_usd",
    "price_kind",
    "customer_credit_price",
    "plan_hash"
  ],
  "properties": {
    "schema_version": {
      "const": "brand-studio-execution/v1"
    },
    "execution_contract": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "adapter_version",
        "source_sha256",
        "capability_ids"
      ],
      "properties": {
        "adapter_version": {
          "const": "selected-plan-dispatch/v1"
        },
        "source_sha256": {
          "$ref": "#/$defs/sha256"
        },
        "capability_ids": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "rate_version": {
      "type": "string",
      "minLength": 1
    },
    "domain": {
      "type": "string",
      "pattern": "^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "market": {
      "$ref": "#/$defs/market"
    },
    "preset": {
      "type": "string",
      "minLength": 1
    },
    "selection": {
      "$ref": "#/$defs/selection"
    },
    "rows": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/row"
      }
    },
    "legs": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "seo",
        "backlinks",
        "reviews",
        "website",
        "social",
        "site_evidence",
        "ads",
        "reputation"
      ],
      "properties": {
        "seo": {
          "$ref": "#/$defs/seoLeg"
        },
        "backlinks": {
          "$ref": "#/$defs/backlinksLeg"
        },
        "reviews": {
          "$ref": "#/$defs/reviewsLeg"
        },
        "website": {
          "$ref": "#/$defs/websiteLeg"
        },
        "social": {
          "$ref": "#/$defs/socialLeg"
        },
        "site_evidence": {
          "$ref": "#/$defs/siteEvidenceLeg"
        },
        "ads": {
          "$ref": "#/$defs/adsLeg"
        },
        "reputation": {
          "$ref": "#/$defs/reputationLeg"
        },
        "voice": {
          "$ref": "#/$defs/voiceLeg"
        },
        "accounting": {
          "$ref": "#/$defs/accountingLeg"
        }
      }
    },
    "max_cost_usd": {
      "$ref": "#/$defs/money"
    },
    "price_kind": {
      "const": "maximum_provider_cost_not_guaranteed_charge"
    },
    "customer_credit_price": {
      "$ref": "#/$defs/customerCreditPrice"
    },
    "plan_hash": {
      "$ref": "#/$defs/sha256"
    }
  },
  "$defs": {
    "sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "money": {
      "type": "number",
      "minimum": 0
    },
    "nullableString": {
      "type": [
        "string",
        "null"
      ]
    },
    "market": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "location_code",
        "language_code",
        "confirmed"
      ],
      "properties": {
        "location_code": {
          "type": "integer",
          "minimum": 1
        },
        "language_code": {
          "type": "string",
          "pattern": "^[a-z]{2}(?:-[a-z]{2})?$"
        },
        "confirmed": {
          "const": true
        }
      }
    },
    "group": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "included",
        "active_zero",
        "values"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "included": {
          "type": "boolean"
        },
        "active_zero": {
          "type": "boolean"
        },
        "values": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "itemSelection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "included",
        "groups",
        "options"
      ],
      "properties": {
        "included": {
          "type": "boolean"
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/group"
          }
        },
        "options": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          }
        }
      }
    },
    "selection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "preset",
        "basePreset",
        "aiEnabled",
        "plans",
        "items",
        "warnings"
      ],
      "properties": {
        "preset": {
          "type": "string",
          "minLength": 1
        },
        "basePreset": {
          "type": "string",
          "minLength": 1
        },
        "aiEnabled": {
          "type": "boolean"
        },
        "plans": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          }
        },
        "items": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "$ref": "#/$defs/itemSelection"
          }
        },
        "warnings": {
          "type": "array",
          "items": {}
        }
      }
    },
    "row": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "item_id",
        "status",
        "groups",
        "max_cost_usd"
      ],
      "properties": {
        "item_id": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "supported",
            "not_selected",
            "parked",
            "conditional_not_implemented",
            "unsupported"
          ]
        },
        "leg": {
          "type": [
            "string",
            "null"
          ]
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/group"
          }
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "rate_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "accountingLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "provider",
        "unit_cost_usd",
        "price_basis",
        "balance_requests",
        "history_requests",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "provider": {
          "const": "scrapecreators"
        },
        "unit_cost_usd": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "price_basis": {
          "$ref": "#/$defs/priceBasis"
        },
        "balance_requests": {
          "const": 2
        },
        "history_requests": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "priceBasis": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source",
        "verified_at"
      ],
      "properties": {
        "source": {
          "type": "string",
          "minLength": 1
        },
        "verified_at": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "legBaseProperties": {
      "type": "object",
      "properties": {
        "domain": {
          "type": "string",
          "minLength": 1
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "seoLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "own_rankings_limit",
        "ranking_pages_limit",
        "competitor_limit",
        "rival_rankings",
        "gap_groups",
        "confirmed_competitors",
        "keyword_ideas_limit",
        "serp_queries",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "own_rankings_limit": {
          "type": "integer",
          "minimum": 0
        },
        "ranking_pages_limit": {
          "type": "integer",
          "minimum": 0
        },
        "competitor_limit": {
          "type": "integer",
          "minimum": 0
        },
        "keyword_ideas_limit": {
          "type": "integer",
          "minimum": 0
        },
        "rival_rankings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/rivalGroup"
          }
        },
        "gap_groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/rivalGroup"
          }
        },
        "confirmed_competitors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/confirmedCompetitor"
          }
        },
        "serp_queries": {
          "type": "array",
          "maxItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "group_id",
              "query"
            ],
            "properties": {
              "group_id": {
                "type": "string"
              },
              "query": {
                "type": "string",
                "minLength": 2,
                "maxLength": 100
              }
            }
          }
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "rivalGroup": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "group_id",
        "limit",
        "domain"
      ],
      "properties": {
        "group_id": {
          "type": "string"
        },
        "limit": {
          "type": "integer",
          "minimum": 0
        },
        "domain": {
          "type": "string"
        }
      }
    },
    "confirmedCompetitor": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "domain",
        "reason",
        "source_url"
      ],
      "properties": {
        "domain": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "source_url": {
          "$ref": "#/$defs/nullableString"
        }
      }
    },
    "backlinksLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "summary",
        "backlinks_limit",
        "referring_domains_limit",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "summary": {
          "type": "boolean"
        },
        "backlinks_limit": {
          "type": "integer",
          "minimum": 0
        },
        "referring_domains_limit": {
          "type": "integer",
          "minimum": 0
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "reviewsLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "profiles",
        "maps_queries",
        "discovery",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "profiles": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "maps_queries": {
          "type": "array",
          "items": {}
        },
        "discovery": {
          "type": "boolean"
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "websiteLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "pages_limit",
        "map",
        "rendered",
        "screenshots_limit",
        "free_html",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "pages_limit": {
          "type": "integer",
          "minimum": 0
        },
        "map": {
          "type": "boolean"
        },
        "rendered": {
          "type": "boolean"
        },
        "screenshots_limit": {
          "type": "integer",
          "minimum": 0
        },
        "free_html": {
          "type": "boolean"
        },
        "sitemap": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "included",
            "cap"
          ],
          "properties": {
            "included": {
              "type": "boolean"
            },
            "cap": {
              "type": "integer",
              "const": 20000
            }
          }
        },
        "unit_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "price_basis": {
          "$ref": "#/$defs/priceBasis"
        },
        "urls": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string"
          }
        },
        "public_units": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "enum": [
              "wayback",
              "crt_sh"
            ]
          }
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "socialPlatform": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "profile_requests",
        "feed_requests",
        "detail_requests",
        "transcript_requests"
      ],
      "properties": {
        "profile_requests": {
          "type": "integer",
          "minimum": 0
        },
        "feed_requests": {
          "type": "integer",
          "minimum": 0
        },
        "detail_requests": {
          "type": "integer",
          "minimum": 0
        },
        "transcript_requests": {
          "type": "integer",
          "minimum": 0
        },
        "shorts_requests": {
          "type": "integer",
          "minimum": 0,
          "description": "YouTube Shorts pages (contract v7, sc_yt_shorts); present only when selected."
        }
      }
    },
    "socialLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "platforms",
        "profiles",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "platforms": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/socialPlatform"
          }
        },
        "unit_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "price_basis": {
          "$ref": "#/$defs/priceBasis"
        },
        "profiles": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "platform",
              "url"
            ],
            "properties": {
              "platform": {
                "type": "string"
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "siteEvidenceLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "items",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "item_id",
              "group_id",
              "limit"
            ],
            "properties": {
              "item_id": {
                "type": "string"
              },
              "group_id": {
                "type": "string"
              },
              "limit": {
                "type": "integer",
                "minimum": 0
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "device": {
                "enum": [
                  "desktop",
                  "mobile"
                ]
              }
            }
          }
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "reputationLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "items",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "items": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "enum": [
              "wikipedia",
              "wikidata",
              "news_rss",
              "app_store",
              "bluesky_public",
              "apple_podcasts",
              "twitch_public",
              "gdelt_public",
              "sec_public",
              "hacker_news_public"
            ]
          }
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "const": 0
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "voiceLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "requested",
        "model",
        "calls",
        "unit_cost_usd",
        "price_basis",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "requested": {
          "const": true
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "calls": {
          "const": 1
        },
        "unit_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "price_basis": {
          "$ref": "#/$defs/priceBasis"
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      },
      "description": "Contract v8 voice_tone: one bounded model call; present only when selected."
    },
    "adsLeg": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "platforms",
        "bindings",
        "domain",
        "market",
        "max_cost_usd",
        "plan_id"
      ],
      "properties": {
        "platforms": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        },
        "unit_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "price_basis": {
          "$ref": "#/$defs/priceBasis"
        },
        "domain": {
          "type": "string"
        },
        "market": {
          "$ref": "#/$defs/market"
        },
        "max_cost_usd": {
          "$ref": "#/$defs/money"
        },
        "plan_id": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "customerCreditPrice": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "credits",
        "basis",
        "tier",
        "byo_discount_resolved_at_reservation"
      ],
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": 0
        },
        "basis": {
          "const": "existing_hosted_tier_not_provider_dollars"
        },
        "tier": {
          "type": "integer",
          "minimum": 1
        },
        "byo_discount_resolved_at_reservation": {
          "const": true
        }
      }
    }
  }
}