REPRODUCIBLE DATA / BI ANALYSIS

Run from the extracted portfolio directory:
python3 analytics/run_analysis.py

Python 3 standard library only; no external packages or network access.
The script resolves paths relative to itself and recreates results/portfolio.sqlite,
CSV/JSON result sets and validation.json. The database is replaced only after
all 24 checks pass. Input fixtures are synthetic and deterministic (seed=124).

Data grains:
- Commerce: day x channel x landing-page category; 1,647 rows.
- SaaS: cohort x channel for signups (54 rows), and cohort x channel x week age
  for retention (486 rows). Do not sum the same cohort size across every age.
- Operations: day x region, one route per region-day; 364 rows.
Money is stored as integer USD cents. Rates use summed numerators/denominators.

Result scope:
- Commerce and operations: September 2026, all channels/regions.
- SaaS: 18 signup cohorts from June 1 through September 28; observations
  through October 4, 2026 inclusive. Fourteen cohorts are eligible for W4.
- Capacity scenarios: demand/capacity changes of 0/0, 10/0, 10/15, 50/15,
  and -20/50 percent. Each source row is rounded separately. Additional
  capacity is assumed to cost $2.50 per unit per day.

SQL files 00-11 cover the schema, metrics, scenarios, quality checks and extracts.
Parameter values are visible in run_analysis.py. Source data retains its original
category codes. The English UI maps labels; values and calculation logic do not
change. For example: Organic=Органика, Paid ads=Реклама, Partners=Партнёры;
Footwear=Обувь, Apparel=Одежда, Accessories=Аксессуары;
North=Север, South=Юг, West=Запад, Central=Центр.

The web dashboards load verified row extracts and compute filters in the browser.
SQLite is an offline analytical model, not a server connected to the website.
Raw event deduplication, ad spend, CAC/LTV, causal experiments and forecasting
are not modeled. Scenario cost excludes variable delivery cost and revenue.

--sync-dashboards is for the full authoring workspace only. It updates sibling
<project>/src/data.json files after reconciliation and requires a rebuild under
that project's AGENTS.md. The deployment archive contains the ready static
website, not the full protected runtime source checkout.
