# Architecture decisions, costed (design, declared before any cost code runs)

A fourth page of the first-year plan, `architecture-decisions.html`. The plan page gives a year-one budget, the hires in
order and a table of tool choices with the signal that would change each one. The operating standards page decides what
the team works on and how much it checks. The data governance page writes the governance standards as checks. None of
them says how a first Head of Data decides an architecture question, what each option costs over more than one year,
or how far an assumption can move before the choice changes. This round adds that: five year-one decisions written as
decision records in one fixed template, each decided by a rule stated before any cost is computed, each option costed
over three years from labelled assumptions tied to the study's existing staffing and volumes, every input swept, and a
check that the five decisions fit together. The plan, its assumptions and the three published pages stay as they are;
the plan page gains one sentence linking to the new page.

## The question

For the study's illustrative company, which year-one architecture decisions should a first Head of Data make, how should
each be recorded and decided, and how sensitive is each decision's cost ranking to the assumptions that drive it?

## What is declared, and by whom

Everything below is written for this page. Nothing comes from an employer, a vendor's price list or an outside dataset.

- `architecture/protocol.json` (frozen): the five decisions, their options by category, the rule each is decided by, how
  each option is costed, how the main drivers are picked and swept, what counts as a flip, the capacity check, the rule
  for a set of choices that does not fit, the record template and six predictions.
- `data/architecture-assumptions.json`: every input with a low, a base and a high value and what it measures. An input
  tied to another file (the hourly rate, the warehouse and connector lines, the contract value and customer count, the
  published table and metric counts, the harm of a wrong number, the engineer's and the data team's time) is read from
  the plan, the operating standards or the governance assumptions, and a test recomputes it from there. Every other
  input is new and labelled so.

The decisions, the rules, the assumptions and the predictions have one author, me. The rankings therefore show what my
assumptions imply, not what these options cost at a real company. The page says so at the headline.

## The five decisions

Options are categories, never products.

1. **Where the data lives.** Keep the managed cloud warehouse, or move to open table formats on object storage with a
   separate query engine. Rule: stay unless another option costs at least 25% less over three years.
2. **How billing data comes in.** Buy a managed connector, or build one in-house. Rule: buy unless building costs at
   least 20% less.
3. **How fast sales hears about an active trial.** A nightly batch, an hourly batch on the existing scheduler, or event
   streaming. Rule: lowest three-year cost, counting what late alerts cost in lost conversions.
4. **When the semantic layer comes.** Now, with the leadership assistant pilot in month 4, or in year two. Rule: lowest
   three-year cost, counting what numbers that disagree between the assistant and the dashboards cost.
5. **Getting account scores into the CRM.** No sync, an in-house sync job, or a managed reverse sync. Rule: no sync
   unless an option costs at least 10% less, counting customer success time.

The hurdles stand for risks a cost line cannot price (skills a move needs, a system the scarcest person must keep
alive). They are declared here, before any cost exists, and the page reports where a hurdle, not the costs, decides.

## Costing

Each option's three-year cost is the sum of five lines: people (one-off and recurring hours at the loaded rate), run
(platform, service or compute spending), switching (migration hours and months of two systems side by side), risk (the
chance a year of a named failure times what it costs) and shortfall (what the option leaves undone: late alerts,
disagreeing numbers, customer success time). The protocol gives each option's lines in words; the code follows them.
Run costs that follow data volume grow by the data growth multiple each year, and those that follow customers by the
customer growth multiple. Data team and engineering hours cost the same loaded rate, the analytics engineer's from the
plan, because the plan does not cost its engineer. Nothing is discounted.

## Sweeps

- **Every input alone.** Each input a decision reads moves to its low and to its high value with the others at base.
- **Two main drivers together.** The two inputs whose move changes the chosen option's lead the most are that decision's
  main drivers, picked by that rule rather than by me, and they move together over a 9 by 9 grid from low to high.
- **Flip points.** Along each main driver, with the others at base, bisection finds the value where the choice changes.
- **Classes.** A decision *flips alone* if one input moved alone changes its choice, *flips together* if only the
  grid does, and *holds* if nothing in the sweep does.

## Checks

- **Replay.** Re-running the cost code gives the results file byte for byte; its hash is pinned in the test.
- **Each decision follows from its rule and inputs.** A rule check written separately from the cost code re-applies each
  declared rule to the stored option costs at the base case and at every sweep point and must get the stored choice. A
  stored choice changed on purpose must fail it. This is a consistency check between two things I wrote from the same
  rules, not a test of the assumptions, and the page calls it that.
- **No contradictory volumes or staffing.** Every decision reads one shared block of inputs; no two inputs measure the
  same quantity; every tied input recomputes from its source file. A duplicated quantity and a changed tied value, each
  planted on purpose, must fail.
- **The five fit together.** The chosen options' engineering hours, summed by year, must fit inside the engineer's spare
  hours: the plan's day a week less the governance hours and an assumed allowance for source-system fixes. Year-one data
  team hours must fit inside each person's time left after requests and governance. If the engineering hours do not
  fit, the protocol's portfolio rule switches the decision that saves engineering hours most cheaply until they do.
  The same check runs on the flipped set, where every decision that can flip takes its most frequent other winner.
- **Budget.** The chosen options' year-one run costs are compared with the plan's warehouse and ingestion lines;
  anything without a plan line is reported as spending the plan leaves out.

## Predictions, written before any cost code exists

1. 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.
2. The connector decision flips when one input alone moves within its range.
3. With every other input at base, the warehouse decision does not flip for any data growth below 2 times a year.
4. The nightly batch wins the trial alert at no point of its sweep.
5. The semantic layer and the CRM sync do not flip when any one input moves alone.
6. The base-case set fits the engineer's spare hours in every year; the flipped set does not.

The results file scores each prediction.

## Page

`architecture-decisions.html`, in the style of the governance page. The h1 leads with which decisions flip under
plausible assumptions and which hold, and carries its condition (assumed costs, an invented company). First screen: the
choice per decision, what drives the ones that flip, and the main limit. Then one chart (each decision's lead under its
rule at base and across its sweep, hover readout per decision), a worked example (one full decision record, the code's
own output), where each ranking flips, whether the five fit together, what a team should do with it, the record
template as copyable text, limits, where AI fits, the copy-paste prompt in the site frame, and method and checks. The
five records are also published as files.

Every number on the page is listed in `data/architecture-page-numbers.json` with the rule that recomputes it from the
results, the assumptions or the protocol; a test finds any number no rule produced and plants one to prove it can.

## Limits declared before the run

Illustrative company; every cost is an assumption and the rankings follow from them; options are categories, not
products, so no price is a quote; one author for the decisions, rules, assumptions and predictions; the cost model is
linear in volume and ignores discounting; the engineer is costed at the analytics engineer's rate; no claim of having
made these decisions in a job.
