Architecture
The production dashboard is a static HTML/CSS/JavaScript application deployed through Cloudflare Pages. Inputs and calculations run in the browser; Chart.js is loaded from a CDN. A separate real, executable Python + SQLite pipeline ships with the website source under dashboards/benefits/analytics/. It independently validates published benchmark records and reproducible reference scenarios. The live dashboard does not call Python or SQL at runtime.
Data provenance and extraction
benchmark_inputs.csv records source, year, cohort, metric, units, published value, URL, and quality note. KFF 2024/2025 premiums and June 2026 BLS hourly employer expenditure values are transcribed as attributed reference data; this pipeline does not claim a live API or automated provider-price feed. model_scenarios.csv contains fictional employer inputs.
Python ETL and validation
run_pipeline.py uses Python standard-library csv, sqlite3, and json. It loads inputs, checks positive headcount, bounds percentage assumptions between 0 and 100, executes SQL, checks finite nonnegative component costs, verifies the total reconciles to components, and asserts that separate benefit contributions behave independently.
SQL modeling
schema.sql creates normalized reference and scenario tables. calculations.sql uses common table expressions, conditional aggregation, and explicit arithmetic to derive the two-year single premium average, mixed-cohort family premium proxy, enrolled headcount, annual health expense, category-specific dental/vision/life contributions, retirement contributions, and administrative cost. The SQL produces one row per scenario.
Calculation definitions
Health = employees × enrollment rate × weighted annual single/family premium × tier factor × employer share. Dental, vision, and life = employees × monthly premium × 12 × category-specific employer share. 401(k) = employees × assumed average salary × employer contribution rate × participation/eligibility assumption. Administration = employees × annual fee. These are simplified planning formulas, not actuarial or plan-document calculations.
Published output and reproducibility
Run python dashboards/benefits/analytics/run_pipeline.py from the extracted website folder. The script regenerates validated_reference.json and prints PASS checks. The reference scenario total is $549,104.00; the independent-shares scenario is $538,124.00. The output is packaged as an auditable artifact; it does not automatically override user-entered values in the browser.
Independent benchmark reconciliation
BLS June 2026 private-industry health $3.48/hour, life $0.05/hour, and defined-contribution retirement $1.17/hour annualize to $7,238.40, $104.00, and $2,433.60 per employee respectively at 2,080 hours. Comparing these directly with modeled category costs requires caution because survey populations, eligibility, and coverage definitions differ.
Testing, limitations and next steps
The offline pipeline verifies its fixture scenarios, SQL arithmetic, category independence, and JSON output. It is not an exhaustive equivalence test of all live JavaScript interactions. The model lacks employee-level census, age bands, geography, insurer quotes, claims experience, and detailed 401(k) match/vesting rules. Median salary multiplied by headcount is only a proxy for payroll; employer contribution calculations are most defensible with actual payroll or an arithmetic mean.
All example employers are fictional. Published national benchmarks are not carrier quotes or matched-company expenditure records. Financial results are illustrative and depend on workforce assumptions.