{
 "about": "Frozen before any cost code: the five year-one architecture decisions, their options by category, the rule each one is decided by, the inputs each option's cost reads, how each option is costed, how the main drivers are picked and swept, what counts as a flip, the capacity check and the rule for a set that does not fit, the record template and the predictions. Inputs are in data/architecture-assumptions.json.",
 "horizon_months": 36,
 "cost_lines": {
  "people": "Recurring data team and engineering hours, and one-off build hours, at the loaded hourly rate.",
  "run": "What the option costs to run: platform, service or compute spending.",
  "switching": "One-off cost of moving off what exists today: migration hours and the months two systems run side by side.",
  "risk": "Expected cost of the failure named in the option: its chance a year times the hours or spending it costs.",
  "shortfall": "Cost of what the option leaves undone: late alerts, numbers that disagree, customer success time spent looking data up."
 },
 "conventions": [
  "Month m has year index (m minus 1) divided by 12, rounded down, so months 1 to 12 are year one (index 0).",
  "A run cost that follows data volume is its year-one value over 12 a month, times data_growth to the power of the year index; one that follows customers uses customer_growth the same way.",
  "One-off hours count in the decision's start month.",
  "Data team and engineering hours are both costed at rate; the capacity check counts engineering hours separately.",
  "Totals are not discounted. Costs before a decision's start month are the same for every option and are left out, except where an option below says otherwise."
 ],
 "decisions": [
  {
   "id": "warehouse", "number": 1, "title": "Where the data lives",
   "question": "Keep the managed cloud warehouse, or move to open table formats on object storage with a separate query engine?",
   "context": "The company already runs a managed cloud warehouse, and the plan keeps it in year one. A move would start once the analytics engineer is in place, in month 7.",
   "start_month": 7,
   "options": [
    {"id": "keep_managed", "label": "Keep the managed warehouse", "what": "Stay on the managed cloud warehouse; its bill grows with data volume.",
     "cost": "run: the warehouse in every month 1 to 36. people: wh_keep_upkeep_hours a month, data team, months 1 to 36."},
    {"id": "open_formats", "label": "Open table formats on object storage", "what": "Keep the tables in an open table format on object storage and query them with a separate engine the company runs.",
     "cost": "run: the managed warehouse in months 1 to 6, then wh_open_run_share of the managed cost for the same data from month 7. switching: wh_migration_hours_per_table times published_tables (data team) plus wh_migration_setup_hours (engineering), and the managed warehouse's run cost for wh_parallel_months from month 7. people: wh_keep_upkeep_hours a month, data team, months 1 to 6 plus the parallel months; wh_open_upkeep_hours a month, engineering, from the month after the parallel months. risk: wh_slip_probability times (three more months of the managed warehouse at its year-one monthly cost plus wh_slip_hours, data team)."}
   ],
   "rule": {"text": "Stay on the managed warehouse unless another option costs at least 25% less over three years, switching and risk included.", "default": "keep_managed", "hurdle": 0.25,
    "why": "A move carries risks the risk line does not price: skills the team lacks and the year-one plan waiting while it happens."},
   "inputs": ["rate", "data_growth", "warehouse_y1", "published_tables", "wh_keep_upkeep_hours", "wh_open_run_share", "wh_open_upkeep_hours", "wh_migration_hours_per_table", "wh_migration_setup_hours", "wh_parallel_months", "wh_slip_probability", "wh_slip_hours"],
   "owner": "Head of Data, with Finance on the bill",
   "trigger_observable": "the warehouse bill's growth over the last twelve months, read each quarter at the cost review"
  },
  {
   "id": "connector", "number": 2, "title": "How billing data comes in",
   "question": "Buy a managed connector for the billing system, or build one in-house?",
   "context": "Billing feeds monthly recurring revenue, the first number Finance signs. The plan already pays for managed connectors for billing, CRM and product data.",
   "start_month": 1,
   "options": [
    {"id": "buy", "label": "Buy a managed connector", "what": "Keep the managed connector; its price follows the billing rows it moves.",
     "cost": "run: ingestion_y1 times cn_billing_share, following customers, months 1 to 36. people: cn_buy_setup_hours once and cn_buy_upkeep_hours a month, data team. risk: cn_buy_incident_probability a year times cn_buy_incident_hours, data team, over three years."},
    {"id": "build", "label": "Build it in-house", "what": "Engineering writes and runs its own job that reads the billing system's API.",
     "cost": "switching: the managed connector's run cost for cn_parallel_months while the job is built. people: cn_build_hours (engineering) and cn_build_test_hours (data team) once; cn_build_upkeep_hours a month, engineering, after the parallel months. run: cn_build_run a year after the parallel months. risk: cn_build_incident_probability a year times cn_build_incident_hours, data team, after the parallel months."}
   ],
   "rule": {"text": "Buy unless building costs at least 20% less over three years, people hours included.", "default": "buy", "hurdle": 0.2,
    "why": "A connector someone else maintains keeps up with the billing system's changes; one the company builds lands on its scarcest person, the engineer."},
   "inputs": ["rate", "customer_growth", "ingestion_y1", "cn_billing_share", "cn_buy_setup_hours", "cn_buy_upkeep_hours", "cn_buy_incident_probability", "cn_buy_incident_hours", "cn_build_hours", "cn_build_test_hours", "cn_build_upkeep_hours", "cn_build_run", "cn_build_incident_probability", "cn_build_incident_hours", "cn_parallel_months"],
   "owner": "Head of Data, with the engineering lead",
   "trigger_observable": "the connector's yearly price at renewal, and the engineering hours any in-house job would need, logged when the billing API changes"
  },
  {
   "id": "trial_alert", "number": 3, "title": "How fast sales hears about an active trial",
   "question": "Tell sales that a trial account reached the activation signal from a nightly run, an hourly run, or an event stream?",
   "context": "Sales asks to hear in real time when a trial account reaches the activation signal (for example, a second teammate invited). The alert starts with the second quarter's work, in month 4.",
   "start_month": 4,
   "options": [
    {"id": "daily", "label": "Nightly batch", "what": "The alert comes from the nightly run; sales hears the next morning.",
     "cost": "people: ta_daily_build_hours once and ta_daily_upkeep_hours a month, data team. shortfall: every alert waits ta_delay_daily hours."},
    {"id": "hourly", "label": "Hourly batch", "what": "The models behind the alert run every hour on the existing scheduler.",
     "cost": "people: ta_hourly_build_hours (data team) and ta_hourly_build_eng_hours (engineering) once; ta_hourly_upkeep_hours a month, data team. run: ta_hourly_compute_share of the managed warehouse's run cost. shortfall: every alert waits ta_delay_hourly hours."},
    {"id": "stream", "label": "Event streaming", "what": "Product events flow through a managed streaming service and the alert fires within minutes.",
     "cost": "people: ta_stream_build_hours (data team) and ta_stream_build_eng_hours (engineering) once; ta_stream_upkeep_eng_hours a month, engineering. run: ta_stream_run_y1 a year, following data volume. shortfall: every alert waits ta_delay_stream hours."}
   ],
   "rule": {"text": "The option with the lowest three-year cost, counting what late alerts cost in lost conversions.", "default": null, "hurdle": 0,
    "why": "Sales' request is a cost of delay, so it is priced like any other cost."},
   "shortfall_formula": "alerts in a month: ta_trials_y1 over 12, following customers, times ta_activation_share. Each alert loses its wait in hours times ta_loss_per_hour times contract_value.",
   "inputs": ["rate", "data_growth", "customer_growth", "warehouse_y1", "contract_value", "ta_trials_y1", "ta_activation_share", "ta_loss_per_hour", "ta_delay_daily", "ta_delay_hourly", "ta_delay_stream", "ta_daily_build_hours", "ta_daily_upkeep_hours", "ta_hourly_build_hours", "ta_hourly_build_eng_hours", "ta_hourly_upkeep_hours", "ta_hourly_compute_share", "ta_stream_build_hours", "ta_stream_build_eng_hours", "ta_stream_upkeep_eng_hours", "ta_stream_run_y1"],
   "owner": "Head of Data, with the sales lead",
   "trigger_observable": "how much an hour of waiting lowers an activated trial's chance of converting, measured from the alerts' own timestamps after a quarter"
  },
  {
   "id": "semantic_layer", "number": 4, "title": "When the semantic layer comes",
   "question": "Build the semantic layer now, with the leadership assistant pilot, or wait for year two?",
   "context": "The plan pilots a leadership AI assistant in the second quarter, beside the BI tool. Both read the same metrics. The governance work certifies one definition per metric name during year one.",
   "start_month": 4,
   "options": [
    {"id": "now", "label": "Now, with the assistant pilot", "what": "Define the certified metrics once in a semantic layer from month 4; the assistant and the BI tool both read it.",
     "cost": "people: sl_hours_per_metric times metric_names (data team) and sl_setup_eng_hours (engineering) once in month 4; sl_upkeep_hours a month, data team, months 4 to 36. run: sl_run_y1 a year, months 4 to 36."},
    {"id": "later", "label": "Later, in year two", "what": "The assistant computes its own metrics from the models until month 13, when the layer is built.",
     "cost": "people: sl_hours_per_metric times metric_names times sl_metric_growth, plus sl_repoint_hours (data team), and sl_setup_eng_hours (engineering), once in month 13; sl_upkeep_hours a month, data team, months 13 to 36. run: sl_run_y1 a year, months 13 to 36. shortfall: sl_mismatches_per_month in months 4 to 12, each costing mismatch_harm plus sl_reconcile_hours of the data team."}
   ],
   "rule": {"text": "The option with the lowest three-year cost, counting what numbers that disagree between the assistant and the dashboards cost.", "default": null, "hurdle": 0,
    "why": "Either timing is reversible; the cost of two readers computing the same metric two ways is priced."},
   "inputs": ["rate", "metric_names", "mismatch_harm", "sl_hours_per_metric", "sl_setup_eng_hours", "sl_run_y1", "sl_upkeep_hours", "sl_metric_growth", "sl_repoint_hours", "sl_mismatches_per_month", "sl_reconcile_hours"],
   "owner": "Head of Data, with Finance for the revenue metrics",
   "trigger_observable": "the count of numbers that differ between the assistant and the dashboards each month, from the pilot's test questions"
  },
  {
   "id": "crm_sync", "number": 5, "title": "Getting account scores into the CRM",
   "question": "Leave customer success to read the health dashboard, build an in-house sync into the CRM, or buy a managed reverse sync?",
   "context": "Customer success works in the CRM, and the account health score and usage live in the warehouse. The sync would start once the analytics engineer is in place, in month 7.",
   "start_month": 7,
   "options": [
    {"id": "none", "label": "No sync", "what": "Customer success reads the health dashboard and copies what it needs into the CRM.",
     "cost": "shortfall: every customer success manager spends rs_cs_hours_per_week looking up and copying account data, at rs_cs_rate. Customer success managers: customers_y1, following customers, over rs_accounts_per_csm."},
    {"id": "in_house", "label": "In-house sync", "what": "Engineering writes a scheduled job that writes the scores into CRM fields.",
     "cost": "people: rs_inhouse_build_eng_hours (engineering) and rs_inhouse_build_hours (data team) once; rs_inhouse_upkeep_eng_hours a month, engineering. run: rs_inhouse_run a year. risk: rs_inhouse_incident_probability a year times rs_inhouse_incident_hours, data team. shortfall: rs_residual_share of the no-sync time."},
    {"id": "managed", "label": "Managed reverse sync", "what": "A managed service copies the scores from the warehouse into the CRM.",
     "cost": "people: rs_managed_setup_hours once and rs_managed_upkeep_hours a month, data team. run: rs_managed_y1 a year, following customers. shortfall: rs_residual_share of the no-sync time."}
   ],
   "rule": {"text": "No sync unless an option costs at least 10% less over three years, counting customer success time.", "default": "none", "hurdle": 0.1,
    "why": "Every sync is one more system that can write wrong data into the place customers' account teams work."},
   "inputs": ["rate", "customer_growth", "customers_y1", "rs_accounts_per_csm", "rs_cs_hours_per_week", "rs_cs_rate", "rs_residual_share", "rs_inhouse_build_eng_hours", "rs_inhouse_build_hours", "rs_inhouse_upkeep_eng_hours", "rs_inhouse_run", "rs_inhouse_incident_probability", "rs_inhouse_incident_hours", "rs_managed_y1", "rs_managed_setup_hours", "rs_managed_upkeep_hours"],
   "owner": "Head of Data, with the customer success lead",
   "trigger_observable": "engineering hours logged on the sync each month, and the managed service's quoted price at each yearly review"
  }
 ],
 "rule_mechanics": {
  "adjusted_cost": "A default option's three-year cost is multiplied by one minus its hurdle; every other option's cost is used as is.",
  "choice": "The option with the lowest adjusted cost. An exact tie goes to the option listed first.",
  "lead": "The chosen option's lead: the lowest adjusted cost among the other options minus the chosen option's adjusted cost. A decision flips where its lead would fall below zero, that is, where the rule picks a different option."
 },
 "sweep": {
  "one_at_a_time": "Every input a decision reads is moved alone to its low and to its high value, all others at base.",
  "main_drivers": "A decision's two main drivers are the two inputs whose move, at either end, changes the chosen option's lead the most in absolute terms. A tie keeps the order of the decision's inputs list.",
  "grid": "The two main drivers are moved together over 9 evenly spaced values each, from low to high inclusive, all other inputs at base: 81 points.",
  "flip_points": "Along each main driver, all others at base, the value where the choice changes, found by bisection between the base value and the end of the range where the choice differs; none when the choice is the same at both ends.",
  "classes": {
   "flips_alone": "Some input moved alone to its low or high value changes the choice.",
   "flips_together": "No single input does, but some point of the main drivers' grid does.",
   "holds": "No point of the sweep changes the choice."
  }
 },
 "capacity": {
  "engineering": "Engineering hours an option needs, one-off and monthly, are summed by year over the options chosen. Each year must fit within the engineer's spare hours: engineer_data_hours_per_month less engineer_governance_hours_per_month less engineer_source_fix_hours_per_month, times 12.",
  "data_team": "Data team hours the chosen options need in year one must fit within the data team's free hours in year one: each person's whole time less their request share and their governance share, month by month, from the month they start.",
  "shared_inputs": "Every decision reads its inputs from the one inputs block. No two inputs measure the same quantity (each input names what it measures, once), and every tied input recomputes from the file it is tied to.",
  "portfolio_rule": "If any year's engineering hours do not fit: for every decision, take the cheapest of its other options (by three-year cost, before any hurdle) that uses fewer engineering hours over the three years than its current pick; switch the decision whose switch adds the least three-year cost per engineering hour saved; repeat until every year fits or no switch is left. The result is reported beside the rules' own picks.",
  "flipped_set": "The flipped set gives every decision that flips anywhere in its sweep the other option that wins at the most sweep points (the 81 grid points and the one-at-a-time ends); decisions that hold keep their base choice. The capacity check and the portfolio rule are applied to it too.",
  "budget": "The chosen options' year-one run costs are compared with the plan's year-one budget lines they fall under: the warehouse line (the warehouse and any extra compute) and the ingestion line (the connectors). A run cost with no plan line is reported as spending the plan's budget leaves out."
 },
 "record_template": [
  "Decision <number>: <title>",
  "Status",
  "Context",
  "Options",
  "Decision rule, declared before costing",
  "Three-year cost, base case",
  "Decision",
  "What would flip it",
  "Reversal trigger",
  "Owner and review"
 ],
 "rounding": "Money on the page and in the records in thousands of US dollars, whole, halves up. Hours whole. Shares as whole percentages. Multiples to two decimals.",
 "predictions": [
  {"id": 1, "text": "In the base case the rules pick: keep the managed warehouse, buy the billing connector, an hourly batch for the trial alert, the semantic layer now, and an in-house CRM sync.",
   "test": "base choices equal warehouse keep_managed, connector buy, trial_alert hourly, semantic_layer now, crm_sync in_house"},
  {"id": 2, "text": "The connector decision flips when one input alone moves within its range.",
   "test": "connector class is flips_alone"},
  {"id": 3, "text": "With every other input at base, the warehouse decision does not flip for any data growth below 2 times a year.",
   "test": "along data_growth from base to high, all others at base, the first value where the choice changes is at least 2.0, or there is none"},
  {"id": 4, "text": "The nightly batch wins the trial alert at no point of its sweep.",
   "test": "daily is chosen at none of the trial alert's sweep points"},
  {"id": 5, "text": "The semantic layer and the CRM sync do not flip when any one input moves alone.",
   "test": "semantic_layer and crm_sync classes are not flips_alone"},
  {"id": 6, "text": "The base-case set fits the engineer's spare hours in every year; the flipped set does not.",
   "test": "base set fits in years one, two and three; the flipped set misses at least one year"}
 ]
}
