{
 "fixture_version": 3,
 "as_of": "2026-11-01",
 "note": "Run: python3 -I \"$SKILL_DIR/scripts/check_fixture.py\" \"$SKILL_DIR/assets/regression-fixture.json\". All names, IDs and values are fictional.",
 "cases": [
  {
   "id": "R01",
   "title": "Options 'EMEA' and 'emea ' on one property",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "fields": [
    {
     "object": "contacts",
     "custom": true,
     "description": "",
     "usages": 3,
     "fill_rate": 0.5,
     "type": "enumeration",
     "field_type": "select",
     "type_family": "enum",
     "options": [
      {
       "label": "EMEA",
       "value": "EMEA",
       "raw": "EMEA"
      },
      {
       "label": "emea",
       "value": "emea",
       "raw": "emea "
      },
      {
       "label": "NA",
       "value": "NA",
       "raw": "NA"
      }
     ],
     "name": "region"
    }
   ],
   "expect": [
    {
     "rule": "FLD-07",
     "status": "FAIL",
     "contains": "emea"
    }
   ]
  },
  {
   "id": "R02",
   "title": "plan and current_plan both written and used",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "fields": [
    {
     "object": "companies",
     "custom": true,
     "description": "",
     "usages": 3,
     "fill_rate": 0.7,
     "type": "string",
     "field_type": "text",
     "type_family": "enum",
     "options": [],
     "name": "plan"
    },
    {
     "object": "companies",
     "custom": true,
     "description": "",
     "usages": 2,
     "fill_rate": 0.6,
     "type": "string",
     "field_type": "text",
     "type_family": "enum",
     "options": [],
     "name": "current_plan"
    }
   ],
   "expect": [
    {
     "rule": "FLD-04",
     "status": "FAIL",
     "contains": "current_plan"
    }
   ]
  },
  {
   "id": "R03",
   "title": "0% fill with 3 usages is not unused",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "fields": [
    {
     "object": "contacts",
     "custom": true,
     "description": "",
     "usages": 3,
     "fill_rate": 0.0,
     "type": "string",
     "field_type": "text",
     "type_family": "text",
     "options": [],
     "name": "legacy_flag",
     "created_at": "2024-01-01"
    }
   ],
   "expect": [
    {
     "rule": "FLD-05",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R04",
   "title": "0% fill created 30 days ago is not flagged",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "fields": [
    {
     "object": "contacts",
     "custom": true,
     "description": "",
     "usages": 0,
     "fill_rate": 0.0,
     "type": "string",
     "field_type": "text",
     "type_family": "text",
     "options": [],
     "name": "new_flag",
     "created_at": "2026-10-02"
    }
   ],
   "expect": [
    {
     "rule": "FLD-05",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R05",
   "title": "renewal_date stored as text with 0 usages",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "fields": [
    {
     "object": "contacts",
     "custom": true,
     "description": "",
     "usages": 0,
     "fill_rate": 0.1,
     "type": "string",
     "field_type": "text",
     "type_family": "text",
     "options": [],
     "name": "renewal_date"
    }
   ],
   "expect": [
    {
     "rule": "FLD-07",
     "status": "WARN",
     "contains": "renewal_date"
    }
   ]
  },
  {
   "id": "R06",
   "title": "Salesforce open stage at 100% that is not won",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "pipelines": [
     {
      "id": "p1",
      "label": "Fixture pipeline",
      "stages": [
       {
        "id": "a",
        "label": "Proposal",
        "order": 1,
        "type": "open",
        "probability": 0.5
       },
       {
        "id": "b",
        "label": "Contract signed",
        "order": 2,
        "type": "open",
        "probability": 1.0
       },
       {
        "id": "won",
        "label": "Won",
        "order": 9,
        "type": "won",
        "probability": 1.0
       },
       {
        "id": "lost",
        "label": "Lost",
        "order": 10,
        "type": "lost",
        "probability": 0.0
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "PIPE-03",
     "status": "FAIL",
     "contains": "Contract signed"
    }
   ]
  },
  {
   "id": "R07",
   "title": "Salesforce lost stage at 20%",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "pipelines": [
     {
      "id": "p1",
      "label": "Fixture pipeline",
      "stages": [
       {
        "id": "a",
        "label": "Proposal",
        "order": 1,
        "type": "open",
        "probability": 0.5
       },
       {
        "id": "won",
        "label": "Won",
        "order": 9,
        "type": "won",
        "probability": 1.0
       },
       {
        "id": "lost",
        "label": "Lost",
        "order": 10,
        "type": "lost",
        "probability": 0.2
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "PIPE-03",
     "status": "FAIL",
     "contains": "lost stage"
    }
   ]
  },
  {
   "id": "R08",
   "title": "Open-stage probabilities decrease",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "pipelines": [
     {
      "id": "p1",
      "label": "Fixture pipeline",
      "stages": [
       {
        "id": "a",
        "label": "Discovery",
        "order": 1,
        "type": "open",
        "probability": 0.6
       },
       {
        "id": "b",
        "label": "Proposal",
        "order": 2,
        "type": "open",
        "probability": 0.4
       },
       {
        "id": "won",
        "label": "Won",
        "order": 9,
        "type": "won",
        "probability": 1.0
       },
       {
        "id": "lost",
        "label": "Lost",
        "order": 10,
        "type": "lost",
        "probability": 0.0
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "PIPE-03",
     "status": "WARN",
     "contains": "decrease"
    }
   ]
  },
  {
   "id": "R09",
   "title": "Two enabled workflows set hs_lead_status to NEW and IN_PROGRESS",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "config": {
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hs_lead_status",
      "class": "routing"
     }
    ]
   },
   "automations": [
    {
     "id": "1",
     "name": "Fixture A",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [
      {
       "field": "hs_lead_status",
       "op": "set",
       "value": "NEW"
      }
     ],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    },
    {
     "id": "2",
     "name": "Fixture B",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [
      {
       "field": "hs_lead_status",
       "op": "set",
       "value": "IN_PROGRESS"
      }
     ],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "expect": [
    {
     "rule": "AUTO-03",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R10",
   "title": "The same pair with one disabled",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "config": {
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hs_lead_status",
      "class": "routing"
     }
    ]
   },
   "automations": [
    {
     "id": "1",
     "name": "Fixture A",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [
      {
       "field": "hs_lead_status",
       "op": "set",
       "value": "NEW"
      }
     ],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    },
    {
     "id": "2",
     "name": "Fixture B",
     "object": "contacts",
     "layer": "workflow",
     "enabled": false,
     "writes": [
      {
       "field": "hs_lead_status",
       "op": "set",
       "value": "IN_PROGRESS"
      }
     ],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "expect": [
    {
     "rule": "AUTO-03",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R11",
   "title": "Workflow filter on option 'apac' that no longer exists",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "fields": [
    {
     "object": "contacts",
     "custom": true,
     "description": "",
     "usages": 1,
     "fill_rate": 0.5,
     "type": "string",
     "field_type": "text",
     "type_family": "enum",
     "options": [
      {
       "label": "EMEA",
       "value": "EMEA",
       "raw": "EMEA"
      },
      {
       "label": "NA",
       "value": "NA",
       "raw": "NA"
      },
      {
       "label": "LATAM",
       "value": "LATAM",
       "raw": "LATAM"
      }
     ],
     "name": "region"
    },
    {
     "object": "contacts",
     "custom": true,
     "description": "",
     "usages": 1,
     "fill_rate": 0.5,
     "type": "string",
     "field_type": "text",
     "type_family": "enum",
     "options": [
      {
       "label": "emea",
       "value": "emea",
       "raw": "emea"
      },
      {
       "label": "na",
       "value": "na",
       "raw": "na"
      },
      {
       "label": "apac",
       "value": "apac",
       "raw": "apac"
      }
     ],
     "name": "routing_queue"
    }
   ],
   "automations": [
    {
     "id": "1",
     "name": "APAC routing",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [
      {
       "field": "routing_queue",
       "op": "set",
       "value": "apac"
      }
     ],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [
      {
       "property": "region",
       "values": [
        "apac"
       ]
      }
     ],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "expect": [
    {
     "rule": "AUTO-04",
     "status": "FAIL",
     "contains": "apac"
    }
   ]
  },
  {
   "id": "R12",
   "title": "Workflow re-enrols on the field it sets",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "automations": [
    {
     "id": "1",
     "name": "Score refresh",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [
      {
       "field": "lead_score_band",
       "op": "set",
       "value": "A"
      }
     ],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": true,
      "trigger_fields": [
       "lead_score_band"
      ]
     }
    }
   ],
   "expect": [
    {
     "rule": "AUTO-05",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R13",
   "title": "Delete contact action with no decision",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "automations": [
    {
     "id": "1",
     "name": "Bounce cleanup",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [
      "0-18224765"
     ],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R14",
   "title": "Delete contact action with a cited decision, not yet tested",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "decisions": {
     "items": [
      {
       "id": "D-2026-05-01",
       "date": "2026-05-01",
       "topic": "Bounce deletion"
      }
     ]
    }
   },
   "automations": [
    {
     "id": "1",
     "name": "Bounce cleanup",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [
      "0-18224765"
     ],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "decision_ref": "D-2026-05-01"
    }
   ],
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "WARN"
    }
   ]
  },
  {
   "id": "R15",
   "title": "Integration creates companies matched on domain",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "objects": [
     {
      "name": "companies",
      "unique_keys": [
       "acme_account_id"
      ]
     }
    ],
    "integrations": [
     {
      "name": "Signup sync",
      "objects": [
       "companies"
      ],
      "creates_records": [
       "companies"
      ],
      "match_key": "domain"
     }
    ]
   },
   "expect": [
    {
     "rule": "OBJ-02",
     "status": "FAIL",
     "contains": "domain"
    }
   ]
  },
  {
   "id": "R16",
   "title": "Integration creates companies matched on a unique key",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "objects": [
     {
      "name": "companies",
      "unique_keys": [
       "acme_account_id"
      ]
     }
    ],
    "integrations": [
     {
      "name": "Signup sync",
      "objects": [
       "companies"
      ],
      "creates_records": [
       "companies"
      ],
      "match_key": "acme_account_id",
      "searches_before_create": true
     }
    ]
   },
   "expect": [
    {
     "rule": "OBJ-02",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R17",
   "title": "Privileged agency account",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "users": [
     {
      "id": "user-01",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     },
     {
      "id": "user-02",
      "active": true,
      "privileged": true,
      "account_type": "agency"
     },
     {
      "id": "user-03",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-04",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-05",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-06",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-07",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-08",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-09",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-10",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-11",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-12",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-13",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-14",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-15",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-16",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-17",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-18",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-19",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-01",
     "status": "FAIL",
     "contains": "agency"
    }
   ]
  },
  {
   "id": "R18",
   "title": "Four privileged of 50 active users",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "users": [
     {
      "id": "user-01",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     },
     {
      "id": "user-02",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     },
     {
      "id": "user-03",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     },
     {
      "id": "user-04",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     },
     {
      "id": "user-05",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-06",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-07",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-08",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-09",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-10",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-11",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-12",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-13",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-14",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-15",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-16",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-17",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-18",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-19",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-20",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-21",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-22",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-23",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-24",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-25",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-26",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-27",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-28",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-29",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-30",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-31",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-32",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-33",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-34",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-35",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-36",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-37",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-38",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-39",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-40",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-41",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-42",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-43",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-44",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-45",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-46",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-47",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-48",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-49",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     },
     {
      "id": "user-50",
      "active": true,
      "privileged": false,
      "account_type": "employee"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-01",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R19",
   "title": "Integration on a named employee's login",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Zap",
      "identity_type": "personal",
      "identity": "user-04"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-02",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R20",
   "title": "Salesforce daily API at 0.69",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "api_capacity": {
     "salesforce_daily": {
      "used": 6900,
      "max": 10000
     }
    }
   },
   "expect": [
    {
     "rule": "INT-04",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R21",
   "title": "Salesforce daily API at 0.70",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "api_capacity": {
     "salesforce_daily": {
      "used": 7000,
      "max": 10000
     }
    }
   },
   "expect": [
    {
     "rule": "INT-04",
     "status": "WARN"
    }
   ]
  },
  {
   "id": "R22",
   "title": "Salesforce daily API at 0.90",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "api_capacity": {
     "salesforce_daily": {
      "used": 9000,
      "max": 10000
     }
    }
   },
   "expect": [
    {
     "rule": "INT-04",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R23",
   "title": "Reconciliation difference of 0.9%",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "reporting": {
     "reconciliations": [
      {
       "metric": "Pipeline value",
       "dashboard_value": 100900,
       "record_list_value": 100000
      }
     ]
    }
   },
   "expect": [
    {
     "rule": "REP-02",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R24",
   "title": "Reconciliation difference of 1.1%",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "reporting": {
     "reconciliations": [
      {
       "metric": "Pipeline value",
       "dashboard_value": 101100,
       "record_list_value": 100000
      }
     ]
    }
   },
   "expect": [
    {
     "rule": "REP-02",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R25",
   "title": "Zero denominator on a ratio rule",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "counts": {
     "open_deals_without_company": {
      "numerator": 0,
      "denominator": 0,
      "population": "open_deals"
     }
    }
   },
   "expect": [
    {
     "rule": "OBJ-04",
     "status": "NOT CHECKED"
    }
   ]
  },
  {
   "id": "R26",
   "title": "Two automated writers that agree today and no precedence rule",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "critical_fields": [
     {
      "object": "companies",
      "field": "industry",
      "class": "routing",
      "observed_writers": [
       "integration:enrichco",
       "integration:clay"
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "FLD-02",
     "status": "FAIL",
     "contains": "precedence"
    }
   ]
  },
  {
   "id": "R27",
   "title": "Flip-flops on 2 of 400 records changed",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "precedence_rule": "rotation wins; enrichment never writes owner"
     }
    ]
   },
   "history": [
    {
     "object": "contacts",
     "field": "hubspot_owner_id",
     "records_changed": 400,
     "flip_flop_records": 2,
     "flip_flop_rate": 0.005,
     "changes_by_writer": {
      "workflow:inbound-rotation": 380,
      "user": 30
     }
    }
   ],
   "expect": [
    {
     "rule": "FLD-02",
     "status": "WARN"
    }
   ]
  },
  {
   "id": "R28",
   "title": "A gate NOT CHECKED gives Not assessable",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "coverage": {
     "users": {
      "status": "unavailable",
      "reason": "no access to Users & Teams"
     }
    }
   },
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "ACC-01",
     "status": "NOT CHECKED"
    }
   ]
  },
  {
   "id": "R29",
   "title": "A downgrade without a decision reference is rejected",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Zap",
      "identity_type": "personal"
     }
    ],
    "manual_results": [
     {
      "rule": "ACC-02",
      "status": "WARN",
      "finding": "agency says it is temporary"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-02",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R30",
   "title": "Flow writes unknown because only FlowDefinitionView was read",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    }
   },
   "automations": [
    {
     "id": "Account_Type_Sync",
     "name": "Account Type Sync",
     "object": "accounts",
     "layer": "process_builder",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "writes_known": false
    },
    {
     "id": "Account_Type_From_Billing",
     "name": "Account Type From Billing",
     "object": "accounts",
     "layer": "flow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "writes_known": false
    }
   ],
   "expect": [
    {
     "rule": "AUTO-03",
     "status": "NOT CHECKED"
    }
   ]
  },
  {
   "id": "R31",
   "title": "An automated writer reverses a person's change on 2 of 3 records",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "critical_fields": [
     {
      "object": "accounts",
      "field": "Type",
      "class": "routing",
      "precedence_rule": "billing middleware owns Type for paying accounts"
     }
    ]
   },
   "history": [
    {
     "object": "accounts",
     "field": "Type",
     "records_changed": 3,
     "flip_flop_records": 2,
     "automated_flip_flop_records": 0,
     "human_reversal_records": 2,
     "changes_by_writer": {
      "integration:billing-middleware": 5,
      "user:sales-rep": 2
     }
    }
   ],
   "expect": [
    {
     "rule": "FLD-02",
     "status": "WARN",
     "contains": "reversing a person's change"
    }
   ]
  },
  {
   "id": "R32",
   "title": "One flip-flop between automated writers among 3 records changed",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "precedence_rule": "rotation wins; enrichment never writes owner"
     }
    ]
   },
   "history": [
    {
     "object": "contacts",
     "field": "hubspot_owner_id",
     "records_changed": 3,
     "flip_flop_records": 1,
     "automated_flip_flop_records": 1,
     "human_reversal_records": 0,
     "changes_by_writer": {
      "workflow:inbound-rotation": 3,
      "integration:enrichco": 2
     }
    }
   ],
   "expect": [
    {
     "rule": "FLD-02",
     "status": "FAIL",
     "contains": "between automated writers"
    }
   ]
  },
  {
   "id": "R33",
   "title": "A workflow and an integration write a same-named field on different objects",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Account sync",
      "objects": [
       "companies"
      ],
      "fields_written": [
       "companies.hubspot_owner_id"
      ],
      "direction": "into_crm"
     }
    ]
   },
   "automations": [
    {
     "id": "1101",
     "name": "Contact rotation",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [
      {
       "field": "hubspot_owner_id",
       "overwrite": false,
       "available_only": null
      }
     ],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "expect": [
    {
     "rule": "AUTO-09",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R34",
   "title": "HubSpot pipeline with two 100% stages, Contract signed and Closed won",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "pipelines": [
     {
      "id": "p1",
      "label": "Fixture pipeline",
      "stages": [
       {
        "id": "a",
        "label": "Proposal",
        "order": 1,
        "type": "open",
        "probability": 0.5
       },
       {
        "id": "b",
        "label": "Contract signed",
        "order": 2,
        "type": "won",
        "probability": 1.0
       },
       {
        "id": "won",
        "label": "Closed won",
        "order": 3,
        "type": "won",
        "probability": 1.0
       },
       {
        "id": "lost",
        "label": "Closed lost",
        "order": 4,
        "type": "lost",
        "probability": 0.0
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "PIPE-03",
     "status": "FAIL",
     "contains": "2 won stages"
    }
   ]
  },
  {
   "id": "R35",
   "title": "HubSpot stage recorded as open at 100% is read as a won stage",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "pipelines": [
     {
      "id": "p1",
      "label": "Fixture pipeline",
      "stages": [
       {
        "id": "a",
        "label": "Proposal",
        "order": 1,
        "type": "open",
        "probability": 0.5
       },
       {
        "id": "b",
        "label": "Contract signed",
        "order": 2,
        "type": "open",
        "probability": 1.0
       },
       {
        "id": "won",
        "label": "Closed won",
        "order": 3,
        "type": "won",
        "probability": 1.0
       },
       {
        "id": "lost",
        "label": "Closed lost",
        "order": 4,
        "type": "lost",
        "probability": 0.0
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "PIPE-03",
     "status": "FAIL",
     "contains": "won stages"
    },
    {
     "rule": "PIPE-03",
     "status": "FAIL",
     "contains": "recorded as open"
    }
   ]
  },
  {
   "id": "R36",
   "title": "Owner and consent fields with no history keep the automation verdict Not assessable",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "coverage": {
     "integrations": {
      "status": "complete"
     },
     "users": {
      "status": "complete"
     }
    },
    "objects": [
     {
      "name": "contacts",
      "unique_keys": [
       "email",
       "hs_object_id"
      ]
     }
    ],
    "integrations": [],
    "users": [
     {
      "id": "user-01",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     }
    ],
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "permitted_writers": [
       "workflow:inbound-rotation",
       "user"
      ],
      "precedence_rule": "rotation owns first assignment; people own changes after that"
     },
     {
      "object": "contacts",
      "field": "newsletter_opt_in",
      "class": "consent",
      "permitted_writers": [
       "form:preference-centre",
       "user"
      ],
      "observed_writers": [
       "form:preference-centre"
      ]
     }
    ],
    "lifecycle": {
     "field": "lifecyclestage",
     "writers": [
      {
       "writer": "setting:deal-won",
       "kind": "setting",
       "sets": [
        "customer"
       ],
       "customer_evidence_documented": true
      }
     ],
     "precedence_rule": "only the deal-won setting sets Customer",
     "precedence_tested": true
    }
   },
   "automations": [
    {
     "id": "1003",
     "name": "Inbound rotation",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [
      {
       "field": "hubspot_owner_id",
       "overwrite": false,
       "available_only": null
      }
     ],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "FLD-02",
     "status": "NOT CHECKED",
     "contains": "no history"
    },
    {
     "rule": "FLD-03",
     "status": "NOT CHECKED",
     "contains": "no history"
    },
    {
     "rule": "OBJ-02",
     "status": "PASS"
    },
    {
     "rule": "LIFE-03",
     "status": "PASS"
    },
    {
     "rule": "AUTO-03",
     "status": "PASS"
    },
    {
     "rule": "AUTO-06",
     "status": "PASS"
    },
    {
     "rule": "ACC-01",
     "status": "PASS"
    },
    {
     "rule": "ACC-02",
     "status": "PASS"
    },
    {
     "rule": "INT-01",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R37",
   "title": "A departed person whose account is still active owns open deals",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "users": [
     {
      "id": "user-01",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     },
     {
      "id": "user-40",
      "active": true,
      "privileged": false,
      "account_type": "former_employee",
      "open_deals_owned": 5
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-03",
     "status": "FAIL",
     "contains": "still active"
    }
   ]
  },
  {
   "id": "R38",
   "title": "An unclassified workflow action is named, and AUTO-06 passes only among classified actions",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "automations": [
    {
     "id": "1201",
     "name": "Partner app sync",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "unknown_action_types": [
      "1-2345678"
     ]
    }
   ],
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "PASS",
     "contains": "among classified actions"
    },
    {
     "rule": "AUTO-03",
     "status": "PASS",
     "contains": "1-2345678"
    }
   ]
  },
  {
   "id": "R39",
   "title": "History names the rotation workflow by its ID; it counts as one writer, not two",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "permitted_writers": [
       "workflow:inbound-rotation",
       "user"
      ]
     }
    ]
   },
   "automations": [
    {
     "id": "585051946",
     "name": "Inbound rotation",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [
      {
       "field": "hubspot_owner_id",
       "overwrite": false,
       "available_only": null
      }
     ],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     }
    }
   ],
   "history": [
    {
     "object": "contacts",
     "field": "hubspot_owner_id",
     "records_changed": 3,
     "flip_flop_records": 0,
     "automated_flip_flop_records": 0,
     "human_reversal_records": 0,
     "changes_by_writer": {
      "workflow:585051946": 3,
      "user": 1
     }
    }
   ],
   "expect": [
    {
     "rule": "FLD-02",
     "status": "PASS",
     "contains": "workflow:inbound-rotation"
    }
   ]
  },
  {
   "id": "R40",
   "title": "Writers listed in a generic field export count for FLD-02",
   "inventory": {
    "meta": {
     "crm": "pipedrive"
    },
    "critical_fields": [
     {
      "object": "deals",
      "field": "owner_id",
      "class": "ownership"
     }
    ]
   },
   "fields": [
    {
     "object": "deals",
     "name": "owner_id",
     "type": "user",
     "type_family": "reference",
     "custom": false,
     "writers": [
      "automation:round-robin",
      "integration:enrichco"
     ]
    }
   ],
   "expect": [
    {
     "rule": "FLD-02",
     "status": "FAIL",
     "contains": "precedence"
    }
   ]
  },
  {
   "id": "R41",
   "title": "Opportunities with amounts readable by every user through a Public Read/Write default",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "decisions": {
     "restricted_fields": [
      "Amount"
     ],
     "items": []
    },
    "record_access": [
     {
      "object": "opportunities",
      "holds_restricted_records": true,
      "default_access": "Public Read/Write",
      "readable_outside_approved": true,
      "via": "org-wide default Public Read/Write",
      "confirmed": true,
      "decision_ref": ""
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-05",
     "status": "FAIL",
     "contains": "org-wide default"
    }
   ]
  },
  {
   "id": "R42",
   "title": "A Salesforce critical field with history tracking off cannot pass FLD-02",
   "inventory": {
    "meta": {
     "crm": "salesforce"
    },
    "critical_fields": [
     {
      "object": "accounts",
      "field": "Type",
      "class": "routing",
      "permitted_writers": [
       "integration:billing-middleware"
      ],
      "observed_writers": [
       "integration:billing-middleware"
      ],
      "precedence_rule": "billing middleware owns Type",
      "history_tracked": false
     }
    ]
   },
   "expect": [
    {
     "rule": "FLD-02",
     "status": "NOT CHECKED",
     "contains": "tracking is off"
    }
   ]
  },
  {
   "id": "R43",
   "title": "A template hint left in identity_type stops the run instead of passing ACC-02",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Zap",
      "owner": "RevOps lead",
      "identity_type": "personal | dedicated | private_app | service_key | oauth_app | integration_user"
     }
    ]
   },
   "expect_error": "identity_type"
  },
  {
   "id": "R44",
   "title": "An integration with no identity type recorded leaves ACC-02 NOT CHECKED",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Zap",
      "owner": "RevOps lead"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-02",
     "status": "NOT CHECKED",
     "contains": "identity_type not recorded"
    }
   ]
  },
  {
   "id": "R45",
   "title": "Every automation gate passes, with history for both critical fields: Ready to automate (the base for R46 to R50 and R57)",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "coverage": {
     "integrations": {
      "status": "complete"
     },
     "users": {
      "status": "complete"
     }
    },
    "objects": [
     {
      "name": "contacts",
      "unique_keys": [
       "email",
       "hs_object_id"
      ]
     }
    ],
    "integrations": [],
    "users": [
     {
      "id": "user-01",
      "active": true,
      "privileged": true,
      "account_type": "employee"
     }
    ],
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "permitted_writers": [
       "workflow:inbound-rotation",
       "user"
      ],
      "precedence_rule": "rotation owns first assignment; people own changes after that"
     },
     {
      "object": "contacts",
      "field": "newsletter_opt_in",
      "class": "consent",
      "permitted_writers": [
       "form:preference-centre",
       "user"
      ],
      "observed_writers": [
       "form:preference-centre"
      ]
     }
    ],
    "lifecycle": {
     "field": "lifecyclestage",
     "writers": [
      {
       "writer": "setting:deal-won",
       "kind": "setting",
       "sets": [
        "customer"
       ],
       "customer_evidence_documented": true
      }
     ],
     "precedence_rule": "only the deal-won setting sets Customer",
     "precedence_tested": true
    }
   },
   "automations": [
    {
     "id": "1003",
     "name": "Inbound rotation",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [
      {
       "field": "hubspot_owner_id",
       "overwrite": false,
       "available_only": null
      }
     ],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "writes_known": true,
     "actions_known": true,
     "refs_known": true
    }
   ],
   "history": [
    {
     "object": "contacts",
     "field": "hubspot_owner_id",
     "records_changed": 5,
     "flip_flop_records": 0,
     "automated_flip_flop_records": 0,
     "human_reversal_records": 0,
     "changes_by_writer": {
      "workflow:inbound-rotation": 4,
      "user": 1
     },
     "window_days": 30
    },
    {
     "object": "contacts",
     "field": "newsletter_opt_in",
     "records_changed": 3,
     "flip_flop_records": 0,
     "automated_flip_flop_records": 0,
     "human_reversal_records": 0,
     "changes_by_writer": {
      "form:preference-centre": 3
     },
     "window_days": 30
    }
   ],
   "expect_verdict": {
    "automation": "Ready to automate"
   },
   "expect": [
    {
     "rule": "OBJ-02",
     "status": "PASS"
    },
    {
     "rule": "FLD-02",
     "status": "PASS"
    },
    {
     "rule": "FLD-03",
     "status": "PASS"
    },
    {
     "rule": "LIFE-03",
     "status": "PASS"
    },
    {
     "rule": "AUTO-03",
     "status": "PASS"
    },
    {
     "rule": "AUTO-06",
     "status": "PASS"
    },
    {
     "rule": "ACC-01",
     "status": "PASS"
    },
    {
     "rule": "ACC-02",
     "status": "PASS"
    },
    {
     "rule": "INT-01",
     "status": "PASS"
    }
   ]
  },
  {
   "id": "R46",
   "title": "A WARN gate with an owner but a critical field without history stays Not assessable",
   "extends": "R45",
   "inventory": {
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "permitted_writers": [
       "workflow:inbound-rotation",
       "user"
      ],
      "precedence_rule": "rotation owns first assignment; people own changes after that",
      "observed_writers": [
       "import"
      ]
     },
     {
      "object": "contacts",
      "field": "newsletter_opt_in",
      "class": "consent",
      "permitted_writers": [
       "form:preference-centre",
       "user"
      ],
      "observed_writers": [
       "form:preference-centre"
      ]
     }
    ],
    "gate_owners": {
     "FLD-02": {
      "owner": "RevOps lead",
      "date": "2026-11-20"
     }
    }
   },
   "history": [
    {
     "object": "contacts",
     "field": "newsletter_opt_in",
     "records_changed": 3,
     "flip_flop_records": 0,
     "automated_flip_flop_records": 0,
     "human_reversal_records": 0,
     "changes_by_writer": {
      "form:preference-centre": 3
     },
     "window_days": 30
    }
   ],
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "FLD-02",
     "status": "WARN",
     "contains": "no history"
    }
   ]
  },
  {
   "id": "R47",
   "title": "One automation read and one flow whose writes and actions are unknown: the rules that need them are NOT CHECKED",
   "extends": "R45",
   "automations": [
    {
     "id": "1003",
     "name": "Inbound rotation",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [
      {
       "field": "hubspot_owner_id",
       "overwrite": false,
       "available_only": null
      }
     ],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "writes_known": true,
     "actions_known": true,
     "refs_known": true
    },
    {
     "id": "Lead_Cleanup",
     "name": "Lead cleanup",
     "object": "contacts",
     "layer": "flow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "writes_known": false,
     "actions_known": false,
     "refs_known": false
    }
   ],
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "AUTO-03",
     "status": "NOT CHECKED",
     "contains": "Lead cleanup"
    },
    {
     "rule": "AUTO-06",
     "status": "NOT CHECKED",
     "contains": "Lead cleanup"
    },
    {
     "rule": "LIFE-05",
     "status": "NOT CHECKED",
     "contains": "Lead cleanup"
    }
   ]
  },
  {
   "id": "R48",
   "title": "An unclassified action keeps the automation verdict Not assessable while AUTO-06 passes among classified actions",
   "extends": "R45",
   "automations": [
    {
     "id": "1003",
     "name": "Inbound rotation",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [
      {
       "field": "hubspot_owner_id",
       "overwrite": false,
       "available_only": null
      }
     ],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "writes_known": true,
     "actions_known": true,
     "refs_known": true
    },
    {
     "id": "1201",
     "name": "Partner app sync",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "writes_known": true,
     "actions_known": true,
     "refs_known": true,
     "unknown_action_types": [
      "1-1234567"
     ]
    }
   ],
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "PASS",
     "contains": "among classified actions"
    }
   ]
  },
  {
   "id": "R49",
   "title": "HubSpot workflow summaries from the v4 list endpoint carry no actions: AUTO-03 and AUTO-06 are NOT CHECKED",
   "extends": "R45",
   "automations": [],
   "hubspot_flows": {
    "results": [
     {
      "id": "2001",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "revisionId": "4"
     },
     {
      "id": "2002",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "revisionId": "9"
     }
    ]
   },
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "AUTO-03",
     "status": "NOT CHECKED",
     "contains": "2001"
    },
    {
     "rule": "AUTO-06",
     "status": "NOT CHECKED",
     "contains": "actions unknown"
    }
   ]
  },
  {
   "id": "R50",
   "title": "Hand-entered Pipedrive automations with nothing recorded about their writes or actions are NOT CHECKED, not passed",
   "extends": "R45",
   "inventory": {
    "meta": {
     "crm": "pipedrive"
    }
   },
   "automations": [
    {
     "id": "pd-1",
     "name": "Deal won follow-up",
     "object": "deals",
     "enabled": true,
     "owner": "Sales ops"
    },
    {
     "id": "pd-2",
     "name": "Stale deal cleanup",
     "object": "deals",
     "enabled": true
    }
   ],
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "AUTO-03",
     "status": "NOT CHECKED"
    },
    {
     "rule": "AUTO-06",
     "status": "NOT CHECKED",
     "contains": "Stale deal cleanup"
    }
   ]
  },
  {
   "id": "R51",
   "title": "Delete contact under a decision reference that matches no recorded decision",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "automations": [
    {
     "id": "1",
     "name": "Bounce cleanup",
     "object": "contacts",
     "layer": "workflow",
     "enabled": true,
     "writes": [],
     "owner_writes": [],
     "consent_actions": [],
     "destructive_actions": [
      "0-18224765"
     ],
     "credit_actions": [],
     "filter_refs": [],
     "reenrollment": {
      "enabled": false,
      "trigger_fields": []
     },
     "decision_ref": "D-2026-99",
     "tested": true
    }
   ],
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "FAIL",
     "contains": "not a dated entry"
    }
   ]
  },
  {
   "id": "R52",
   "title": "A downgrade citing a decision that is not recorded is rejected",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Zap",
      "identity_type": "personal"
     }
    ],
    "manual_results": [
     {
      "rule": "ACC-02",
      "status": "WARN",
      "finding": "agency says it is temporary",
      "decision": "D-2026-77"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-02",
     "status": "FAIL"
    }
   ]
  },
  {
   "id": "R53",
   "title": "A downgrade citing a dated decision is accepted and says so",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "integrations": [
     {
      "name": "Zap",
      "identity_type": "personal"
     }
    ],
    "decisions": {
     "items": [
      {
       "id": "D-2026-10-20",
       "date": "2026-10-20",
       "topic": "Zap moves to a dedicated identity by 2026-12-01",
       "rules": [
        "ACC-02"
       ]
      }
     ]
    },
    "manual_results": [
     {
      "rule": "ACC-02",
      "status": "WARN",
      "finding": "temporary until the move",
      "decision": "D-2026-10-20"
     }
    ]
   },
   "expect": [
    {
     "rule": "ACC-02",
     "status": "WARN",
     "contains": "downgraded from FAIL"
    }
   ]
  },
  {
   "id": "R54",
   "title": "A headline number whose record list value is missing raises 'reconciliation not run'",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    },
    "reporting": {
     "headline_numbers": [
      "Pipeline value",
      "New customers"
     ],
     "reconciliations": [
      {
       "metric": "Pipeline value",
       "dashboard_value": 100500,
       "record_list_value": 100000
      },
      {
       "metric": "New customers",
       "dashboard_value": 42,
       "record_list_value": null
      }
     ]
    }
   },
   "expect": [
    {
     "rule": "REP-02",
     "status": "WARN",
     "contains": "reconciliation not run for New customers"
    }
   ]
  },
  {
   "id": "R55",
   "title": "A rotate-owner action with no overwrite key is noted as unconfirmed, not read as protecting owners",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "hubspot_flows": {
    "results": [
     {
      "id": "3001",
      "name": "Inbound rotation",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "enrollmentCriteria": {
       "shouldReEnroll": false
      },
      "actions": [
       {
        "actionId": "1",
        "actionTypeId": "0-11",
        "fields": {
         "user_ids": [
          "owner-11",
          "owner-12"
         ]
        }
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "AUTO-07",
     "status": "PASS",
     "contains": "no overwrite setting"
    }
   ]
  },
  {
   "id": "R56",
   "title": "A workflow that texts contacts is listed as unclassified, with the action named",
   "inventory": {
    "meta": {
     "crm": "hubspot"
    }
   },
   "hubspot_flows": {
    "results": [
     {
      "id": "3101",
      "name": "Event reminder",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "enrollmentCriteria": {
       "shouldReEnroll": false
      },
      "actions": [
       {
        "actionId": "1",
        "actionTypeId": "0-40900952",
        "fields": {}
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "PASS",
     "contains": "among classified actions"
    },
    {
     "rule": "AUTO-03",
     "status": "PASS",
     "contains": "0-40900952 Send SMS message"
    }
   ]
  },
  {
   "id": "R57",
   "title": "A consent field with no register entry and no history keeps an owned FLD-03 WARN Not assessable",
   "extends": "R45",
   "inventory": {
    "critical_fields": [
     {
      "object": "contacts",
      "field": "hubspot_owner_id",
      "class": "ownership",
      "permitted_writers": [
       "workflow:inbound-rotation",
       "user"
      ],
      "precedence_rule": "rotation owns first assignment; people own changes after that"
     },
     {
      "object": "contacts",
      "field": "newsletter_opt_in",
      "class": "consent",
      "observed_writers": [
       "form:preference-centre"
      ]
     }
    ],
    "gate_owners": {
     "FLD-03": {
      "owner": "privacy owner",
      "date": "2026-11-20"
     }
    }
   },
   "history": [
    {
     "object": "contacts",
     "field": "hubspot_owner_id",
     "records_changed": 5,
     "flip_flop_records": 0,
     "automated_flip_flop_records": 0,
     "human_reversal_records": 0,
     "changes_by_writer": {
      "workflow:inbound-rotation": 4,
      "user": 1
     },
     "window_days": 30
    }
   ],
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "FLD-03",
     "status": "WARN",
     "contains": "no history"
    }
   ]
  },
  {
   "id": "R58",
   "title": "An event trigger filters on the event's hs_form_id, HubSpot's own example: not a broken reference, and 0-13 is neutral",
   "extends": "R45",
   "fields": [
    {
     "object": "contacts",
     "name": "hubspot_owner_id",
     "type": "enumeration",
     "field_type": "select",
     "type_family": "reference",
     "options": [],
     "custom": false,
     "description": "Owner",
     "fill_rate": 0.9,
     "usages": 3
    }
   ],
   "hubspot_flows": {
    "results": [
     {
      "id": "3201",
      "name": "Contact us form",
      "isEnabled": true,
      "flowType": "WORKFLOW",
      "type": "CONTACT_FLOW",
      "objectTypeId": "0-1",
      "revisionId": "18",
      "actions": [
       {
        "actionId": "4",
        "actionTypeVersion": 0,
        "actionTypeId": "0-1",
        "connection": {
         "edgeType": "STANDARD",
         "nextActionId": "5"
        },
        "fields": {
         "delta": "1440",
         "time_unit": "MINUTES"
        },
        "type": "SINGLE_CONNECTION"
       },
       {
        "actionId": "5",
        "actionTypeVersion": 0,
        "actionTypeId": "0-13",
        "fields": {
         "operation": "ADD",
         "list_id": "178"
        },
        "type": "SINGLE_CONNECTION"
       }
      ],
      "enrollmentCriteria": {
       "shouldReEnroll": false,
       "type": "EVENT_BASED",
       "listMembershipFilterBranches": [],
       "eventFilterBranches": [
        {
         "filterBranches": [],
         "filters": [
          {
           "property": "hs_form_id",
           "operation": {
            "operator": "IS_ANY_OF",
            "includeObjectsWithNoValueSet": false,
            "values": [
             "00000000-0000-0000-0000-000000000000"
            ],
            "operationType": "ENUMERATION"
           },
           "filterType": "PROPERTY"
          }
         ],
         "eventTypeId": "4-1639801",
         "operator": "HAS_COMPLETED",
         "filterBranchType": "UNIFIED_EVENTS",
         "filterBranchOperator": "AND"
        }
       ]
      }
     }
    ]
   },
   "expect_verdict": {
    "automation": "Ready to automate"
   },
   "expect": [
    {
     "rule": "AUTO-04",
     "status": "PASS",
     "contains": "were not resolved"
    }
   ]
  },
  {
   "id": "R59",
   "title": "An association branch filters on a deal property inside a contact flow: not a broken reference",
   "extends": "R45",
   "fields": [
    {
     "object": "contacts",
     "name": "hubspot_owner_id",
     "type": "enumeration",
     "field_type": "select",
     "type_family": "reference",
     "options": [],
     "custom": false,
     "description": "Owner",
     "fill_rate": 0.9,
     "usages": 3
    }
   ],
   "hubspot_flows": {
    "results": [
     {
      "id": "3202",
      "name": "Open deal check",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "type": "CONTACT_FLOW",
      "actions": [],
      "enrollmentCriteria": {
       "shouldReEnroll": false,
       "type": "LIST_BASED",
       "listFilterBranch": {
        "filterBranchType": "OR",
        "filters": [],
        "filterBranches": [
         {
          "filterBranchType": "AND",
          "filters": [
           {
            "filterType": "PROPERTY",
            "property": "hubspot_owner_id",
            "operation": {
             "operator": "HAS_PROPERTY",
             "operationType": "ALL_PROPERTY"
            }
           }
          ],
          "filterBranches": [
           {
            "filterBranchType": "ASSOCIATION",
            "objectTypeId": "0-3",
            "operator": "IN_LIST",
            "filters": [
             {
              "filterType": "PROPERTY",
              "property": "dealstage",
              "operation": {
               "operator": "IS_ANY_OF",
               "values": [
                "closedwon"
               ],
               "operationType": "ENUMERATION"
              }
             }
            ],
            "filterBranches": []
           }
          ]
         }
        ]
       }
      }
     }
    ]
   },
   "expect": [
    {
     "rule": "AUTO-04",
     "status": "PASS",
     "contains": "were not resolved"
    }
   ]
  },
  {
   "id": "R60",
   "title": "Edit record on an associated record counts as a writer of that field, and is not a write to a missing field",
   "extends": "R45",
   "fields": [
    {
     "object": "contacts",
     "name": "hubspot_owner_id",
     "type": "enumeration",
     "field_type": "select",
     "type_family": "reference",
     "options": [],
     "custom": false,
     "description": "Owner",
     "fill_rate": 0.9,
     "usages": 3
    }
   ],
   "hubspot_flows": {
    "results": [
     {
      "id": "3203",
      "name": "Deal owner copy",
      "isEnabled": true,
      "objectTypeId": "0-3",
      "type": "PLATFORM_FLOW",
      "enrollmentCriteria": {
       "shouldReEnroll": false
      },
      "actions": [
       {
        "actionId": "1",
        "actionTypeId": "0-5",
        "type": "SINGLE_CONNECTION",
        "fields": {
         "property_name": "hubspot_owner_id",
         "association": {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 3
         },
         "value": {
          "type": "STATIC_VALUE",
          "staticValue": "27"
         }
        }
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "FLD-02",
     "status": "WARN",
     "contains": "workflow:deal-owner-copy"
    }
   ]
  },
  {
   "id": "R61",
   "title": "Create record's properties are writes on the created object: a second automated writer of deal stage",
   "extends": "R45",
   "inventory": {
    "critical_fields": [
     {
      "object": "deals",
      "field": "dealstage",
      "class": "stage",
      "observed_writers": [
       "integration:billing-sync"
      ]
     }
    ]
   },
   "hubspot_flows": {
    "results": [
     {
      "id": "3204",
      "name": "Deal from demo",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "type": "CONTACT_FLOW",
      "enrollmentCriteria": {
       "shouldReEnroll": false
      },
      "actions": [
       {
        "actionId": "1",
        "actionTypeId": "0-14",
        "type": "SINGLE_CONNECTION",
        "fields": {
         "object_type_id": "0-3",
         "properties": [
          {
           "targetProperty": "dealstage",
           "value": {
            "type": "STATIC_VALUE",
            "staticValue": "discovery"
           }
          },
          {
           "targetProperty": "dealname",
           "value": {
            "type": "STATIC_VALUE",
            "staticValue": "Demo request"
           }
          }
         ]
        }
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "FLD-02",
     "status": "FAIL",
     "contains": "workflow:deal-from-demo"
    }
   ]
  },
  {
   "id": "R62",
   "title": "An action with no actionTypeId that is not a branch is listed as unclassified, never dropped",
   "extends": "R45",
   "hubspot_flows": {
    "results": [
     {
      "id": "3205",
      "name": "Custom sync",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "type": "CONTACT_FLOW",
      "enrollmentCriteria": {
       "shouldReEnroll": false
      },
      "actions": [
       {
        "actionId": "1",
        "type": "CUSTOM_CODE",
        "sourceCode": "exports.main = async () => {}"
       },
       {
        "actionId": "2",
        "type": "LIST_BRANCH",
        "listBranches": [],
        "defaultBranchName": "none"
       }
      ]
     }
    ]
   },
   "expect_verdict": {
    "automation": "Not assessable"
   },
   "expect": [
    {
     "rule": "AUTO-06",
     "status": "PASS",
     "contains": "among classified actions"
    },
    {
     "rule": "AUTO-03",
     "status": "PASS",
     "contains": "CUSTOM_CODE"
    }
   ]
  },
  {
   "id": "R63",
   "title": "Re-enrolment on a property change event: the property is not in the definition, so AUTO-05 is NOT CHECKED, not passed",
   "extends": "R45",
   "hubspot_flows": {
    "results": [
     {
      "id": "3206",
      "name": "Region change",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "type": "CONTACT_FLOW",
      "actions": [],
      "enrollmentCriteria": {
       "shouldReEnroll": true,
       "type": "EVENT_BASED",
       "listMembershipFilterBranches": [],
       "eventFilterBranches": [
        {
         "filterBranches": [],
         "filters": [],
         "eventTypeId": "4-655002",
         "operator": "HAS_COMPLETED",
         "filterBranchType": "UNIFIED_EVENTS",
         "filterBranchOperator": "AND"
        }
       ]
      }
     }
    ]
   },
   "expect": [
    {
     "rule": "AUTO-05",
     "status": "NOT CHECKED",
     "contains": "property change event"
    }
   ]
  },
  {
   "id": "R64",
   "title": "A form that sets Sales Qualified Lead directly",
   "extends": "R45",
   "inventory": {
    "forms": [
     {
      "id": "f1",
      "name": "Contact sales",
      "public": true,
      "sets_lifecycle": "salesqualifiedlead"
     }
    ]
   },
   "expect": [
    {
     "rule": "LIFE-04",
     "status": "WARN",
     "contains": "salesqualifiedlead"
    }
   ]
  },
  {
   "id": "R65",
   "title": "An empty static value clears lifecycle: LIFE-05 reads it as a clear, not a dynamic set",
   "extends": "R45",
   "hubspot_flows": {
    "results": [
     {
      "id": "3207",
      "name": "Recycle",
      "isEnabled": true,
      "objectTypeId": "0-1",
      "type": "CONTACT_FLOW",
      "enrollmentCriteria": {
       "shouldReEnroll": false
      },
      "actions": [
       {
        "actionId": "1",
        "actionTypeId": "0-5",
        "type": "SINGLE_CONNECTION",
        "fields": {
         "property_name": "lifecyclestage",
         "value": {
          "type": "STATIC_VALUE",
          "staticValue": ""
         }
        }
       }
      ]
     }
    ]
   },
   "expect": [
    {
     "rule": "LIFE-05",
     "status": "FAIL",
     "contains": "clears or lowers lifecycle"
    }
   ]
  },
  {
   "id": "R66",
   "title": "A flow on an object with no fields data is not read as filtering on missing fields",
   "extends": "R45",
   "fields": [
    {
     "object": "contacts",
     "name": "hubspot_owner_id",
     "type": "enumeration",
     "field_type": "select",
     "type_family": "reference",
     "options": [],
     "custom": false,
     "description": "Owner",
     "fill_rate": 0.9,
     "usages": 3
    }
   ],
   "hubspot_flows": {
    "results": [
     {
      "id": "3208",
      "name": "Workspace review",
      "isEnabled": true,
      "objectTypeId": "2-12345",
      "type": "PLATFORM_FLOW",
      "actions": [],
      "enrollmentCriteria": {
       "shouldReEnroll": false,
       "type": "LIST_BASED",
       "listFilterBranch": {
        "filterBranchType": "OR",
        "filters": [],
        "filterBranches": [
         {
          "filterBranchType": "AND",
          "filterBranches": [],
          "filters": [
           {
            "filterType": "PROPERTY",
            "property": "workspace_plan",
            "operation": {
             "operator": "IS_ANY_OF",
             "values": [
              "pro"
             ],
             "operationType": "ENUMERATION"
            }
           }
          ]
         }
        ]
       }
      }
     }
    ]
   },
   "expect": [
    {
     "rule": "AUTO-04",
     "status": "PASS",
     "contains": "objects with no fields data"
    }
   ]
  },
  {
   "id": "R67",
   "title": "Customers without evidence at 6%: LIFE-06 fails above 5%, the same line as the hygiene audit's L01",
   "extends": "R45",
   "inventory": {
    "counts": {
     "customers_without_evidence": {
      "numerator": 6,
      "denominator": 100,
      "population": "customers"
     }
    }
   },
   "expect": [
    {
     "rule": "LIFE-06",
     "status": "FAIL",
     "contains": "fail above 5%"
    }
   ]
  }
 ],
 "history_cases": [
  {
   "id": "H01",
   "title": "Salesforce Owner history with an ID row and a name row per change",
   "format": "salesforce",
   "object": "accounts",
   "writer_map": {
    "005XX0000000INT": "integration:billing-middleware",
    "005XX0000000MID": "integration:territory-sync"
   },
   "rows": [
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "DataType": "EntityId",
     "OldValue": "",
     "NewValue": "005XX0000000AE1",
     "CreatedDate": "2026-10-05T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "DataType": "Text",
     "OldValue": "",
     "NewValue": "Rep One",
     "CreatedDate": "2026-10-05T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "DataType": "EntityId",
     "OldValue": "005XX0000000AE1",
     "NewValue": "005XX0000000AE2",
     "CreatedDate": "2026-10-06T07:00:00.000+0000",
     "CreatedById": "005XX0000000MID"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "DataType": "Text",
     "OldValue": "Rep One",
     "NewValue": "Rep Two",
     "CreatedDate": "2026-10-06T07:00:00.000+0000",
     "CreatedById": "005XX0000000MID"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "DataType": "EntityId",
     "OldValue": "005XX0000000AE2",
     "NewValue": "005XX0000000AE1",
     "CreatedDate": "2026-10-07T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "DataType": "Text",
     "OldValue": "Rep Two",
     "NewValue": "Rep One",
     "CreatedDate": "2026-10-07T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    }
   ],
   "expect": {
    "status": "FAIL",
    "changes": 3,
    "records_changed": 1,
    "automated_flip_flop_records": 1,
    "note_contains": "name rows"
   }
  },
  {
   "id": "H02",
   "title": "The same Owner history exported without a DataType column",
   "format": "salesforce",
   "object": "accounts",
   "writer_map": {
    "005XX0000000INT": "integration:billing-middleware",
    "005XX0000000MID": "integration:territory-sync"
   },
   "rows": [
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "OldValue": "",
     "NewValue": "005XX0000000AE1",
     "CreatedDate": "2026-10-05T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "OldValue": "",
     "NewValue": "Rep One",
     "CreatedDate": "2026-10-05T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "OldValue": "005XX0000000AE1",
     "NewValue": "005XX0000000AE2",
     "CreatedDate": "2026-10-06T07:00:00.000+0000",
     "CreatedById": "005XX0000000MID"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "OldValue": "Rep One",
     "NewValue": "Rep Two",
     "CreatedDate": "2026-10-06T07:00:00.000+0000",
     "CreatedById": "005XX0000000MID"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "OldValue": "005XX0000000AE2",
     "NewValue": "005XX0000000AE1",
     "CreatedDate": "2026-10-07T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    },
    {
     "AccountId": "001XX000000BBB1",
     "Field": "Owner",
     "OldValue": "Rep Two",
     "NewValue": "Rep One",
     "CreatedDate": "2026-10-07T07:00:00.000+0000",
     "CreatedById": "005XX0000000INT"
    }
   ],
   "expect": {
    "status": "FAIL",
    "changes": 3,
    "records_changed": 1,
    "note_contains": "no DataType column"
   }
  },
  {
   "id": "H03",
   "title": "Acme owner history: 4 flip-flops, 3 between automated writers",
   "format": "generic",
   "file": "example-acme-owner-history.csv",
   "expect": {
    "status": "FAIL",
    "records_changed": 12,
    "flip_flop_records": 4,
    "automated_flip_flop_records": 3,
    "human_reversal_records": 1
   }
  },
  {
   "id": "H04",
   "title": "Salesforce vignette with the writer map: the middleware reverses a rep's change",
   "format": "salesforce",
   "object": "accounts",
   "file": "example-salesforce-field-history.csv",
   "writer_map_file": "example-salesforce-writer-map.csv",
   "expect": {
    "status": "WARN",
    "flip_flop_records": 2,
    "human_reversal_records": 2
   }
  },
  {
   "id": "H05",
   "title": "The same vignette without the writer map: unmapped user IDs count as automated",
   "format": "salesforce",
   "object": "accounts",
   "file": "example-salesforce-field-history.csv",
   "expect": {
    "status": "FAIL",
    "automated_flip_flop_records": 2,
    "note_contains": "not in the writer map"
   }
  },
  {
   "id": "H06",
   "title": "Attio vignette: an app replaces a member's multi-value entries",
   "format": "attio",
   "file": "example-attio-history.json",
   "expect": {
    "status": "WARN",
    "human_reversal_records": 1,
    "note_contains": "raw ID"
   }
  },
  {
   "id": "H07",
   "title": "HubSpot's wide export with repeated headers: every revision is read, not the oldest alone",
   "writer_map": {
    "Workflow 1003": "workflow:inbound-rotation",
    "EnrichCo": "integration:enrichco",
    "rep.a@example.com": "user:sales-rep"
   },
   "format": "hubspot",
   "file": "example-hubspot-owner-history-wide.csv",
   "object": "contacts",
   "field": "hubspot_owner_id",
   "group": "value,time,source",
   "expect": {
    "status": "FAIL",
    "records_changed": 3,
    "changes": 8,
    "flip_flop_records": 2,
    "automated_flip_flop_records": 1,
    "human_reversal_records": 1
   }
  },
  {
   "id": "H08",
   "title": "The same export with no writer map: sources stay hashed and count as automated",
   "format": "hubspot",
   "file": "example-hubspot-owner-history-wide.csv",
   "object": "contacts",
   "field": "hubspot_owner_id",
   "group": "value,time,source",
   "expect": {
    "status": "FAIL",
    "flip_flop_records": 2,
    "automated_flip_flop_records": 2,
    "note_contains": "hashed source text"
   }
  },
  {
   "id": "H09",
   "title": "A wide export without --group stops, never reads one group as the whole history",
   "format": "hubspot",
   "file": "example-hubspot-owner-history-wide.csv",
   "object": "contacts",
   "field": "hubspot_owner_id",
   "expect_error": "not one change per row"
  },
  {
   "id": "H10",
   "title": "A wide export with no source column stops: without writers no flip-flop can show",
   "format": "hubspot",
   "file": "example-hubspot-owner-history-wide.csv",
   "object": "contacts",
   "field": "hubspot_owner_id",
   "group": "value,time,skip",
   "expect_error": "Include Source Information"
  },
  {
   "id": "H11",
   "title": "A history with no writer on any row stops instead of passing",
   "format": "generic",
   "rows": [
    {
     "object": "contacts",
     "record_id": "1",
     "field": "hubspot_owner_id",
     "changed_at": "2026-10-20T09:00:00Z",
     "value": "a",
     "writer": ""
    }
   ],
   "expect_error": "no row names a writer"
  }
 ]
}
