Files
Robert Helewka a420af230b Migrate Amazon Connect TEI study to the Mercury Notebook Pattern
studies/202602_AmazonConnect -> studies/202602_TEI_Amazon_Connect,
rebuilt as pattern Variant 4 (TEI composite reproduction):

- teicalc/ self-contained engine (stdlib-only): Forrester's tables as
  the never-edited verbatim anchor, NPV/ROI/payback + risk adjustment
  transplanted from core/calculations, ClientDrivers overlay (contacts/
  agents/fixed driver map, growth re-base, identity at composite scale),
  scenario stress with core-identical semantics
- one deliverable notebook (business_case.ipynb): widget-pair sidebar
  drivers, published-vs-overlay KPI columns, cash-flow/waterfall/scenario
  charts, verification gate, backstage JSON data appendix
- gate + tests reproduce the published totals within PDF rounding:
  NPV $78.7M / ROI 342% / payback <6 months (engine $78,713,492 /
  342.48% / 0.7 months); 27 study tests, headless nbconvert green,
  stage simulation leak-free, exports carry the appendix
- old Athena workflow (00_provision..04_export, config.py, seed_data.py)
  deleted; git history preserves it; root test fixture repointed to
  teicalc.anchor
- docs: study README rewritten; root README points new studies at
  template/MercuryNotebook; pattern doc stale ctm-token-calculator paths
  now cite studies/202607_CTM_GenesysCX; Variant 4 cites this study as
  its realized reference

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 14:29:46 -04:00

48 lines
1.8 KiB
Markdown

# Mercury Notebook Template
Copy-me starting point for a Palladium study, per
[`docs/Mercury_Notebook_Pattern_V1-00.md`](../../docs/Mercury_Notebook_Pattern_V1-00.md).
The toy model is complete on purpose — every pattern mechanism (verbatim
anchor + contracted overlay, ramp mechanics, baseline-relative frame,
widget-pair reactivity, verification gate, backstage appendix, exports)
is present and runnable, so you replace math, not plumbing.
## Start a study
```bash
cp -r template/MercuryNotebook studies/YYYYMM_Client_EngagementName
cd studies/YYYYMM_Client_EngagementName
# 1. Rename the package (underscores only — dashes break Python imports):
# studylib/ → <yourstudy>lib/, then fix pyproject.toml + imports.
# 2. Replace studylib/model.py's toy domain with your math;
# re-pin tests/test_model.py with hand-checked numbers.
# 3. Rework notebooks/business_case.ipynb section by section —
# keep the widget-pair cells, gate cell, and appendix cell structure.
pip install -e ".[dev]"
```
## Run
| Task | Command |
|---|---|
| Tests | `pytest` |
| Serve (the stage) | `mercury --working-dir notebooks/` (run from project root so `config.toml` loads) |
| Analyst view (backstage) | `jupyter lab` |
| Headless check | `jupyter nbconvert --to notebook --execute --inplace notebooks/business_case.ipynb` |
| Export for LLMs | `python scripts/export_report.py` |
## What's here
```
studylib/model.py # ALL math — notebooks hold none
studylib/staging.py # on_stage()/backstage() — Mercury vs JupyterLab/nbconvert
notebooks/business_case.ipynb
scripts/export_report.py
tests/ # hand-checked pinned acceptance numbers
config.toml # Mercury theme (NTT DATA brand)
pyproject.toml # full toolchain as core deps — no requirements.txt
```
Reference implementation (a full multi-notebook study):
`studies/202607_CTM_GenesysCX/`.