{
  "analyticsEventContracts": {
    "add_payment_info": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "paywall_offer",
        "upsell_offer",
        "checkout"
      ],
      "automatic": false,
      "dedupeScope": "event-id",
      "owner": "named-helper",
      "publicName": "add_payment_info",
      "rawName": "add_payment_info",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType",
        "eventId"
      ]
    },
    "checkout_completed": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "paywall_offer",
        "upsell_offer",
        "checkout"
      ],
      "automatic": false,
      "dedupeScope": "event-id",
      "owner": "named-helper",
      "publicName": "checkout_completed",
      "rawName": "checkout_completed",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType",
        "eventId"
      ]
    },
    "checkout_started": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "paywall_offer",
        "upsell_offer",
        "checkout"
      ],
      "automatic": false,
      "dedupeScope": "event-id",
      "owner": "named-helper",
      "publicName": "checkout_started",
      "rawName": "checkout_started",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType",
        "eventId"
      ]
    },
    "email_captured": {
      "allowedStepIdentities": [
        "email-capture"
      ],
      "allowedStepTypes": [
        "form_input"
      ],
      "automatic": false,
      "dedupeScope": "logical-email-conversion",
      "owner": "transactional-server",
      "publicName": "email_captured",
      "rawName": "email_captured",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType",
        "projectId",
        "funnelEndUserId",
        "eventId"
      ]
    },
    "first_step_clicked": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": true,
      "dedupeScope": "step-visit",
      "owner": "controller",
      "publicName": "first_step_clicked",
      "rawName": "first_step_clicked",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType"
      ]
    },
    "first_step_viewed": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": true,
      "dedupeScope": "step-visit",
      "owner": "controller",
      "publicName": "first_step_viewed",
      "rawName": "first_step_viewed",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType"
      ]
    },
    "funnel_completed": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "purchase_completed"
      ],
      "automatic": false,
      "dedupeScope": "funnel-run",
      "owner": "terminal-helper",
      "publicName": "funnel_completed",
      "rawName": "funnel_completed",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType",
        "eventId"
      ]
    },
    "funnel_started": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": true,
      "dedupeScope": "funnel-run",
      "owner": "controller",
      "publicName": "funnel_started",
      "rawName": "funnel_start",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion"
      ]
    },
    "purchase_completed": {
      "allowedStepIdentities": [],
      "allowedStepTypes": [],
      "automatic": false,
      "dedupeScope": "provider-payment",
      "owner": "trusted-server",
      "publicName": "purchase_completed",
      "rawName": "purchase_completed",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "projectId",
        "funnelEndUserId",
        "eventId",
        "providerPaymentId",
        "purchaseKind"
      ]
    },
    "registration_completed": {
      "allowedStepIdentities": [],
      "allowedStepTypes": [],
      "automatic": false,
      "dedupeScope": "subscription-claim",
      "owner": "trusted-server",
      "publicName": "registration_completed",
      "rawName": "registration_completed",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "projectId",
        "funnelEndUserId",
        "eventId",
        "subscriptionClaimId"
      ]
    },
    "step_completed": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": true,
      "dedupeScope": "step-visit",
      "owner": "controller",
      "publicName": "step_completed",
      "rawName": "step_end",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType"
      ]
    },
    "step_engaged": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": false,
      "dedupeScope": "step-visit",
      "owner": "controller",
      "publicName": "step_engaged",
      "rawName": "step_engaged",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType",
        "durationMs"
      ]
    },
    "step_exited": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": true,
      "dedupeScope": "step-visit",
      "owner": "controller",
      "publicName": "step_exited",
      "rawName": "step_exit",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType"
      ]
    },
    "step_started": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": "any",
      "automatic": true,
      "dedupeScope": "step-visit",
      "owner": "controller",
      "publicName": "step_started",
      "rawName": "step_start",
      "requiredMetadata": [
        "funnelId",
        "funnelVersionId",
        "environment",
        "stepContractVersion",
        "stepId",
        "stepName",
        "stepType"
      ]
    }
  },
  "capabilityRules": {
    "browser-registration-completed": {
      "allowedStepIdentities": [],
      "allowedStepTypes": [],
      "requiredOwner": "trusted-subscription-claim-server"
    },
    "checkout": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "paywall_offer",
        "upsell_offer",
        "checkout"
      ],
      "requiredOwner": "named-payment-helpers"
    },
    "choice-write": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "single_step_choice",
        "single_step_choice_emoji",
        "multi_select_choice"
      ],
      "requiredOwner": "useStepChoices"
    },
    "email-capture": {
      "allowedStepIdentities": [
        "email-capture"
      ],
      "allowedStepTypes": [
        "form_input"
      ],
      "requiredOwner": "submitEmailCapture"
    },
    "hardcoded-navigation": {
      "allowedStepIdentities": [],
      "allowedStepTypes": [],
      "requiredOwner": "manifest-flow-controller"
    },
    "provider-direct-analytics": {
      "allowedStepIdentities": [],
      "allowedStepTypes": [],
      "requiredOwner": "analytics-adapter-outbox"
    },
    "subscription-handoff": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "subscription_handoff",
        "purchase_completed"
      ],
      "requiredOwner": "runtime-handoff-helper"
    },
    "subscription-management": {
      "allowedStepIdentities": "any",
      "allowedStepTypes": [
        "subscription_management",
        "cancellation_offer"
      ],
      "requiredOwner": "runtime-subscription-helpers"
    }
  },
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
  "deferrableDiagnosticCodes": [
    "FG-PARITY-001",
    "FG-REGISTRY-001",
    "FG-CONTENT-001",
    "FG-FLOW-001"
  ],
  "migrationGuide": "docs/funnelsgrove/migrations/step-contract-v3.md",
  "reservedStepContracts": {
    "email-capture": {
      "id": "email-capture",
      "match": "exact",
      "name": "email-capture",
      "type": "form_input",
      "unique": true
    },
    "manage-subscription": {
      "id": "manage-subscription",
      "kind": "manage-subscription",
      "match": "exact",
      "name": "manage-subscription",
      "type": "subscription_management",
      "unique": true
    },
    "paywall": {
      "id": "paywall",
      "kind": "paywall",
      "match": "exact",
      "name": "paywall",
      "primary": true,
      "type": "paywall_offer",
      "unique": true
    },
    "paywall-variant": {
      "idPattern": "^paywall-[a-z0-9-]+$",
      "kind": "paywall",
      "match": "pattern",
      "namePattern": "^paywall-[a-z0-9-]+$",
      "primary": false,
      "type": "paywall_offer",
      "unique": false
    },
    "subscription-started": {
      "id": "subscription-started",
      "kind": "subscription-handoff",
      "match": "exact",
      "name": "subscription-started",
      "type": "purchase_completed",
      "unique": true
    }
  },
  "schemaVersion": 1,
  "stepContractVersion": 3,
  "stepContracts": {
    "cancellation_offer": {
      "actionOwner": "step",
      "allowedCustomEvents": [],
      "allowedKinds": [
        "cancellation"
      ],
      "description": "A cancellation retention or downsell surface.",
      "family": "commerce",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "requiredKind": "cancellation",
      "terminal": false
    },
    "checkout": {
      "actionOwner": "step",
      "allowedCustomEvents": [
        "checkout_started",
        "add_payment_info",
        "checkout_completed"
      ],
      "allowedKinds": [],
      "description": "A dedicated payment-entry screen.",
      "family": "commerce",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "form_input": {
      "actionOwner": "either",
      "allowedCustomEvents": [
        "email_captured"
      ],
      "allowedKinds": [],
      "description": "Non-choice structured input, including reserved email capture.",
      "family": "form",
      "forbiddenCapabilities": [
        "choice-write",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "intro_hero": {
      "actionOwner": "shared-shell",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "description": "Opening promise or low-friction entry screen.",
      "family": "content",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "multi_select_choice": {
      "actionOwner": "either",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "choice": {
        "allowEmptyConfig": true,
        "cardinality": "many",
        "completion": "explicit",
        "presentation": "standard"
      },
      "description": "Multiple options are selected before explicit completion.",
      "family": "choice",
      "forbiddenCapabilities": [
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "paywall_offer": {
      "actionOwner": "step",
      "allowedCustomEvents": [
        "checkout_started",
        "add_payment_info",
        "checkout_completed"
      ],
      "allowedKinds": [
        "paywall"
      ],
      "analyticsRole": "paywall",
      "description": "A monetization offer that presents purchasable plans.",
      "family": "commerce",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "requiredKind": "paywall",
      "terminal": false
    },
    "progress_interstitial": {
      "actionOwner": "either",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "description": "Progress, calculation, loading, reveal, or transition screen.",
      "family": "transition",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "purchase_completed": {
      "actionOwner": "step",
      "allowedCustomEvents": [
        "funnel_completed"
      ],
      "allowedKinds": [
        "subscription-handoff"
      ],
      "analyticsRole": "purchase-completed",
      "description": "The canonical terminal shown after a verified initial purchase.",
      "family": "terminal",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "requiredKind": "subscription-handoff",
      "terminal": true
    },
    "single_step_choice": {
      "actionOwner": "step",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "choice": {
        "allowEmptyConfig": false,
        "cardinality": "one",
        "completion": "selection",
        "presentation": "standard"
      },
      "description": "Exactly one standard option is selected.",
      "family": "choice",
      "forbiddenCapabilities": [
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "single_step_choice_emoji": {
      "actionOwner": "step",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "choice": {
        "allowEmptyConfig": false,
        "cardinality": "one",
        "completion": "selection",
        "presentation": "emoji"
      },
      "description": "Exactly one emoji-led option is selected.",
      "family": "choice",
      "forbiddenCapabilities": [
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "social_proof": {
      "actionOwner": "shared-shell",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "description": "Testimonials, reviews, credibility, or evidence.",
      "family": "content",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "subscription_handoff": {
      "actionOwner": "step",
      "allowedCustomEvents": [],
      "allowedKinds": [
        "subscription-handoff"
      ],
      "description": "A non-terminal app, store, or deep-link handoff.",
      "family": "commerce",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "requiredKind": "subscription-handoff",
      "terminal": false
    },
    "subscription_management": {
      "actionOwner": "step",
      "allowedCustomEvents": [],
      "allowedKinds": [
        "manage-subscription"
      ],
      "description": "A screen for managing or inspecting an existing subscription.",
      "family": "commerce",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "requiredKind": "manage-subscription",
      "terminal": false
    },
    "summary_confirmation": {
      "actionOwner": "either",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "description": "A summary, review, or confirmation before the next action.",
      "family": "content",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    },
    "upsell_offer": {
      "actionOwner": "step",
      "allowedCustomEvents": [
        "checkout_started",
        "add_payment_info",
        "checkout_completed"
      ],
      "allowedKinds": [
        "upsell"
      ],
      "description": "A post-purchase or upgrade offer.",
      "family": "commerce",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "requiredKind": "upsell",
      "terminal": false
    },
    "value_prop_story": {
      "actionOwner": "shared-shell",
      "allowedCustomEvents": [],
      "allowedKinds": [],
      "description": "Benefit, explanation, motivation, or narrative value screen.",
      "family": "content",
      "forbiddenCapabilities": [
        "choice-write",
        "email-capture",
        "checkout",
        "subscription-management",
        "subscription-handoff",
        "hardcoded-navigation",
        "provider-direct-analytics",
        "browser-registration-completed"
      ],
      "terminal": false
    }
  },
  "supportedStepContractVersions": [
    1,
    2,
    3
  ]
}
