ab-analysis-kit 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ab_analysis_kit-0.1.0/ab_analysis_kit.egg-info → ab_analysis_kit-0.1.2}/PKG-INFO +1 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2/ab_analysis_kit.egg-info}/PKG-INFO +1 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/__init__.py +1 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/CLAUDE.section.md +2 -2
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/cli.md +1 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/explore.md +5 -3
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/metrics.md +3 -2
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/plan.md +1 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/project.md +27 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-explore/SKILL.md +7 -3
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-new-metric/SKILL.md +3 -2
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-plan/SKILL.md +1 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-setup-project/SKILL.md +4 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-validate/SKILL.md +2 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/validate.py +2 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/pipeline/driver.py +12 -1
- ab_analysis_kit-0.1.2/abkit/reporting/assets/report.js +151 -0
- ab_analysis_kit-0.1.2/abkit/tuning/assets/explore.js +177 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/server.py +27 -15
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/family.py +2 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/runner.py +11 -1
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/scoring.py +29 -0
- ab_analysis_kit-0.1.0/abkit/reporting/assets/report.js +0 -148
- ab_analysis_kit-0.1.0/abkit/tuning/assets/explore.js +0 -173
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/LICENSE +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/MANIFEST.in +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/README.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/ab_analysis_kit.egg-info/SOURCES.txt +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/ab_analysis_kit.egg-info/dependency_links.txt +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/ab_analysis_kit.egg-info/entry_points.txt +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/ab_analysis_kit.egg-info/requires.txt +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/ab_analysis_kit.egg-info/top_level.txt +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/_output.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/experiments.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/methods.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/overview.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/rules/validate.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-feedback/SKILL.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-new-experiment/SKILL.md +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/_context.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/clean.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/explore.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/init.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/init_claude.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/plan.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/run.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/test_report.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/commands/unlock.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/main.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/compute/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/compute/recompute_backend.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/discovery.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/experiment_config.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/method_config.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/metric_config.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/profile.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/project_config.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/config/validator.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/core/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/core/interval.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/core/models.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/core/period_planner.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/_sql_manager.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/clickhouse_manager.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_aa_runs.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_base.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_experiments.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_exposures.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_maintenance.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_results.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_schema.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_tasks.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/_unit_state.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/internal_tables/manager.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/manager.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/mysql_manager.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/postgres_manager.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/database/tables.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/loaders/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/loaders/exposure_loader.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/loaders/metric_loader.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/loaders/query_template.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/loaders/templates/abkit_assignment.jinja +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/base.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/branding.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/email.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/factory.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/mattermost.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/mock.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/slack.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/telegram.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/notify/webhook.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/pipeline/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/pipeline/_types.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/pipeline/analyze.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/pipeline/enrich.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/pipeline/readout.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/planning/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/planning/sizing.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/reporting/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/reporting/builder.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/reporting/calibration.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/reporting/html_report.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/accumulate.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/base.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/applier.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/bootstrap.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/ci.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/engine.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/paired_bootstrap.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/paired_post_normed_bootstrap.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/poisson_bootstrap.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/bootstrap/post_normed_bootstrap.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/correction.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/effects.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/exceptions.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/factory.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/cuped_ttest.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/paired_cuped_ttest.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/paired_ttest.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/ratio_delta.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/ttest.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/parametric/ztest.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/power.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/registry.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/result.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/rng.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/samples.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/sequential/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/sequential/apply.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/sequential/confidence_sequence.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/sequential/mixture.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/stats/srm.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/config_writer.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/html.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/payload.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/recompute.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/tuning/session.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/utils/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/utils/datetime_utils.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/utils/env_interpolation.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/utils/json_utils.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/__init__.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/_types.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/inject.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/load.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/panel.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/persistence.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/resample.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/result.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/validate/run_id.py +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/pyproject.toml +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/requirements.txt +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/setup.cfg +0 -0
- {ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/setup.py +0 -0
|
@@ -10,7 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
|
|
11
11
|
from typing import Any
|
|
12
12
|
|
|
13
|
-
__version__ = "0.1.
|
|
13
|
+
__version__ = "0.1.2"
|
|
14
14
|
|
|
15
15
|
#: Symbols re-exported lazily from ``abkit.stats`` (PEP 562) so importing
|
|
16
16
|
#: ``abkit`` for ``__version__`` (the CLI path) stays numpy-free and fast.
|
|
@@ -34,8 +34,8 @@ files are installed by `abk init-claude` and track the installed abkit version
|
|
|
34
34
|
| If the task is about… | Read |
|
|
35
35
|
|---|---|
|
|
36
36
|
| What abkit is, the `load → compute → readout` pipeline, the `_ab_*` tables, glossary | `.claude/rules/ab-analysis-kit/overview.md` |
|
|
37
|
-
| `abk` commands, `--select`/`--metric`/`--method` selectors, `--from`/`--to`, `--full-refresh`, locks, `abk clean` | `.claude/rules/ab-analysis-kit/cli.md` |
|
|
38
|
-
| `abkit_project.yml`, `profiles.yml`, DB connections, statistical defaults, two-tier alpha | `.claude/rules/ab-analysis-kit/project.md` |
|
|
37
|
+
| `abk` commands, `--select`/`--metric`/`--method` selectors, `--from`/`--to`, `--full-refresh`, locks, `abk clean`, `abk test-report` | `.claude/rules/ab-analysis-kit/cli.md` |
|
|
38
|
+
| `abkit_project.yml`, `profiles.yml`, DB connections, statistical defaults, two-tier alpha, `notification_channels` | `.claude/rules/ab-analysis-kit/project.md` |
|
|
39
39
|
| An experiment YAML: variants, comparisons, cadence/horizon, SRM, the sequential toggle | `.claude/rules/ab-analysis-kit/experiments.md` |
|
|
40
40
|
| A reusable metric YAML: `type` (sample/fraction/ratio), column roles, one-row-per-unit SQL, CUPED covariate | `.claude/rules/ab-analysis-kit/metrics.md` |
|
|
41
41
|
| Choosing/tuning the compute method (t/z/CUPED/ratio-delta/bootstrap), params, `method_config_id` identity | `.claude/rules/ab-analysis-kit/methods.md` |
|
|
@@ -17,6 +17,7 @@ task = one `abk` invocation), so a broken run fails the job instead of exiting 0
|
|
|
17
17
|
| `abk plan --select <exp>` | Read-only pre-launch sizing: required-N / achievable-MDE / power (see `plan.md`) |
|
|
18
18
|
| `abk unlock --select <exp>` | Clear a stuck pipeline / validate lock |
|
|
19
19
|
| `abk clean --select <exp>` | Prune internal rows that no longer match the config |
|
|
20
|
+
| `abk test-report <exp>` | Send a **mock** WIN readout through the configured notification channels — a connectivity smoke test (no lock, no warehouse read); `--channel <name>` (repeatable) / `--profile`; non-zero exit if any channel fails. See `project.md` `notification_channels` |
|
|
20
21
|
| `abk --version` | Show the installed abkit version |
|
|
21
22
|
|
|
22
23
|
## The two-level selector model (read this first)
|
|
@@ -39,13 +39,15 @@ name a configured **comparison** of that experiment (default: the main metric).
|
|
|
39
39
|
flag**. Pre-horizon fixed CIs render de-emphasized (peeking is not free).
|
|
40
40
|
- **Side rail (mode-aware, Basic / Advanced disclosure)** — the knobs, auto-derived
|
|
41
41
|
from the live method's `param_specs`. **Basic** shows the median-analyst surface
|
|
42
|
-
(
|
|
42
|
+
(the method picker — pick `cuped-t-test` for CUPED — plus `test_type` and `alpha`);
|
|
43
|
+
**Advanced** opens the full ~9-knob set:
|
|
43
44
|
covariate + `covariate_lookback`, stratification keys, bootstrap iterations,
|
|
44
45
|
`correction`, analysis unit (preview-only). Sidedness and winsorization are
|
|
45
46
|
**not** here — the stats core has no such params (two-sided p-values, no winsor).
|
|
46
47
|
- **Modes** — Tune (knobs lead) / Auto (run `validate` server-side, re-seed the
|
|
47
|
-
knobs, green the chip in place) /
|
|
48
|
-
|
|
48
|
+
knobs, green the chip in place) / Review (mark guardrail vs primary, confirm the
|
|
49
|
+
decision). *(Segment / heterogeneous-effects mode is a deferred placeholder — not
|
|
50
|
+
available in 0.1.0.)*
|
|
49
51
|
|
|
50
52
|
## Live recompute — one source of math truth
|
|
51
53
|
|
|
@@ -92,8 +92,9 @@ live there once, so metric SQL describes only its own aggregation:
|
|
|
92
92
|
|
|
93
93
|
Config-lint asserts the rendered SQL joins `_ab_exposures`; a metric authored
|
|
94
94
|
without the macro fails. Never hand-roll the assignment join or the window
|
|
95
|
-
filter. `{{ data_database }}`
|
|
96
|
-
the profile's
|
|
95
|
+
filter. `{{ data_database }}` is the data-location built-in on **every** dialect
|
|
96
|
+
(on Postgres it resolves to the profile's `data_schema` value); there is no
|
|
97
|
+
`{{ data_schema }}` built-in.
|
|
97
98
|
|
|
98
99
|
## CUPED covariate = a whole-day pre-period lookback
|
|
99
100
|
|
|
@@ -46,6 +46,7 @@ Without either, that comparison is reported **un-sizable — not guessed**. The
|
|
|
46
46
|
| `--power 0.8` | Target power. Default: the project statistics default. |
|
|
47
47
|
| `--alpha 0.05` | Experiment-level alpha *before* correction; the two-tier scheme still divides it. Default: experiment/project alpha. |
|
|
48
48
|
| `--baseline <spec>` | Greenfield baseline moments (repeatable; see above). |
|
|
49
|
+
| `--arrival-rate <units/day>` | Total units/day across arms, for the **runtime** (days-to-required-N) + always-valid **ASN** estimates. Default: derived read-only from `_ab_exposures`; without arrival data both are skipped. Must be `> 0`. |
|
|
49
50
|
| `--profile` | Profile name (default: `profiles.yml` `default_profile`). |
|
|
50
51
|
|
|
51
52
|
## What it refuses (honest, never invented math)
|
|
@@ -4,7 +4,9 @@ Two project-level files sit at the root of an abkit project:
|
|
|
4
4
|
`abkit_project.yml` (project settings + statistical defaults) and `profiles.yml`
|
|
5
5
|
(database connections). Both support environment-variable interpolation —
|
|
6
6
|
`{{ env_var('VAR') }}` and `${VAR}` — so **secrets stay out of YAML**. An
|
|
7
|
-
unresolved placeholder
|
|
7
|
+
unresolved placeholder is kept **verbatim** (never silently emptied) so a missing
|
|
8
|
+
variable is detectable rather than a blank connection; notification-channel secrets
|
|
9
|
+
are the exception (an unresolved one is actively rejected). `abk init
|
|
8
10
|
--db-type {clickhouse,postgres,mysql}` scaffolds both files (ClickHouse default).
|
|
9
11
|
|
|
10
12
|
A directory is an abkit project when it contains `abkit_project.yml`.
|
|
@@ -155,6 +157,30 @@ Keep the internal location **separate** from your analytics location so the
|
|
|
155
157
|
`_ab_*` tables don't clutter shared schemas. Override per run with
|
|
156
158
|
`abk run --profile prod`.
|
|
157
159
|
|
|
160
|
+
### `notification_channels` (optional — for `abk test-report`)
|
|
161
|
+
|
|
162
|
+
A top-level `notification_channels:` block in `profiles.yml`, keyed by channel
|
|
163
|
+
name, declares where readouts can be sent. Each entry has a `type`
|
|
164
|
+
(`slack` \| `mattermost` \| `webhook` \| `telegram` \| `email`) plus that
|
|
165
|
+
transport's fields (put secrets behind `env_var`/`${VAR}` — an unresolved
|
|
166
|
+
channel secret **is** rejected):
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
notification_channels:
|
|
170
|
+
team_slack:
|
|
171
|
+
type: slack
|
|
172
|
+
webhook_url: "${SLACK_WEBHOOK_URL}"
|
|
173
|
+
ops_telegram:
|
|
174
|
+
type: telegram
|
|
175
|
+
bot_token: "${TELEGRAM_BOT_TOKEN}"
|
|
176
|
+
chat_id: "-1001234567890"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`abk test-report <exp> [--channel <name>]... [--profile <p>]` sends a **mock**
|
|
180
|
+
WIN readout through them (no lock, no warehouse read, no stats) and prints a
|
|
181
|
+
per-channel ✓/✗, exiting non-zero if any channel fails — a connectivity/format
|
|
182
|
+
smoke test before wiring channels into an orchestrator.
|
|
183
|
+
|
|
158
184
|
## The two-tier alpha (why the effective alpha isn't the alpha you set)
|
|
159
185
|
|
|
160
186
|
`bonferroni` correction applies the legacy **two-tier** scheme keyed off each
|
{ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-explore/SKILL.md
RENAMED
|
@@ -99,8 +99,9 @@ fix the assignment before tuning anything else.
|
|
|
99
99
|
|
|
100
100
|
The rail defaults to **Basic** and reveals the rest under **Advanced**:
|
|
101
101
|
|
|
102
|
-
- **Basic** —
|
|
103
|
-
|
|
102
|
+
- **Basic** — the **method picker** (choose the `cuped-t-test` variant to turn on
|
|
103
|
+
CUPED), `test_type` (`relative` vs `absolute` effect), and **alpha**. These cover
|
|
104
|
+
the median analyst.
|
|
104
105
|
- **Advanced** — the CUPED **covariate + lookback** (`covariate_lookback`, a whole-
|
|
105
106
|
day window like `14d`), **stratification keys**, **bootstrap iterations**
|
|
106
107
|
(`n_samples` for a bootstrap method), the multiple-comparison **correction**
|
|
@@ -117,8 +118,11 @@ Two facts to keep straight while tuning:
|
|
|
117
118
|
|
|
118
119
|
- **Editing an identity param starts a NEW series.** `method_config_id` is a hash of
|
|
119
120
|
the method + its non-default **identity** params; changing `test_type`, CUPED, the
|
|
120
|
-
lookback,
|
|
121
|
+
lookback, or strata **orphans** the prior `_ab_results` rows.
|
|
121
122
|
`seed` is identity-**excluded**, so changing a bootstrap seed does *not* orphan.
|
|
123
|
+
The **correction** and **alpha** are experiment-level (never in `method_config_id`):
|
|
124
|
+
changing them re-derives the effective alpha and re-arms the calibration chip but
|
|
125
|
+
does **not** orphan the series.
|
|
122
126
|
- **Sequential is not a rail knob.** Peeking-safe (always-valid) CIs are the
|
|
123
127
|
experiment-level opt-in `sequential: {enabled: true}` in the YAML, not a method
|
|
124
128
|
param. Without it the readout **withholds** WIN/LOSE and FLAT before the planned horizon
|
|
@@ -91,8 +91,9 @@ hand-roll the assignment join.
|
|
|
91
91
|
column names with args if needed: `ab.exposed_units('dt', 'ts')`.
|
|
92
92
|
- `{{ ab.variant_col() }}` — the arm label (project it `AS variant`).
|
|
93
93
|
- `{{ ab.stratum_col() }}` — the stratum label, only when stratifying.
|
|
94
|
-
- `{{ data_database }}`
|
|
95
|
-
|
|
94
|
+
- `{{ data_database }}` is the single data-location built-in on every backend
|
|
95
|
+
(on Postgres it resolves to the profile's `data_schema` value; there is no
|
|
96
|
+
`{{ data_schema }}` built-in). Mind the dialect (ClickHouse vs Postgres vs MySQL).
|
|
96
97
|
|
|
97
98
|
A fraction metric (per-user conversion): `count = max(converted)`, `nobs = 1`:
|
|
98
99
|
|
{ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-plan/SKILL.md
RENAMED
|
@@ -59,6 +59,7 @@ Flags (confirm the live set with `abk plan --help`):
|
|
|
59
59
|
| `--power` | Target power (default: `statistics.power`, typically 0.8) |
|
|
60
60
|
| `--alpha` | Experiment-level significance **before** correction (default: experiment/project alpha) |
|
|
61
61
|
| `--baseline` | Baseline moments for a metric with no data (repeatable — Step 2) |
|
|
62
|
+
| `--arrival-rate` | Total units/day across arms, for the runtime (days-to-N) + always-valid ASN estimates (default: derived read-only from `_ab_exposures`; must be `> 0`) |
|
|
62
63
|
| `--profile` | Profile name (default: `profiles.yml` `default_profile`) |
|
|
63
64
|
|
|
64
65
|
`--mde` and `--alpha` are in the comparison's own units: a `relative` test type reads
|
|
@@ -164,7 +164,10 @@ self-contained HTML readout. The CLI exits **non-zero** on any failure.
|
|
|
164
164
|
|
|
165
165
|
- `internal_database must be set` / `data_database must be set` (CH/MySQL) or
|
|
166
166
|
`internal_schema` / `data_schema` (PG) → a Step 3 location field is blank or
|
|
167
|
-
missing.
|
|
167
|
+
missing. ClickHouse has no connect-target `database:` key (it uses
|
|
168
|
+
`internal_database`/`data_database`); for MySQL `database:` is an optional
|
|
169
|
+
connect-target and for Postgres it is required, but the location fields above
|
|
170
|
+
are still needed.
|
|
168
171
|
- `default_profile '<x>' not found` → Step 4: it names a profile that isn't
|
|
169
172
|
defined in `profiles.yml`.
|
|
170
173
|
- `Profiles file not found` → run from inside the project root (or pass the
|
{ab_analysis_kit-0.1.0 → ab_analysis_kit-0.1.2}/abkit/cli/assets/claude/skills/abk-validate/SKILL.md
RENAMED
|
@@ -91,7 +91,8 @@ The three classic failures to recognize:
|
|
|
91
91
|
## Step 3 — Act on the recommendation and budget bands
|
|
92
92
|
|
|
93
93
|
- The report/matrix marks a **★ "Recommended" row** with a one-line rationale
|
|
94
|
-
("
|
|
94
|
+
("highest power among methods with FPR within budget"; tiebreak: tightest
|
|
95
|
+
achieved MDE), plus a plain-language
|
|
95
96
|
per-method verdict and the peeking headline (e.g. *"nominal α 5%, real peeking
|
|
96
97
|
FPR 12.7%"*).
|
|
97
98
|
- **Budget bands** color FPR cells green (in-band) / red (out). The budget
|
|
@@ -189,8 +189,9 @@ def _validate_one(
|
|
|
189
189
|
now_iso=now_utc_naive().isoformat(),
|
|
190
190
|
extra_methods=extra_methods,
|
|
191
191
|
metric_filter=metric_filter,
|
|
192
|
+
progress=lambda line: renderer("score", line),
|
|
192
193
|
)
|
|
193
|
-
renderer("score", f"{len(result.cells)} cell(s)")
|
|
194
|
+
renderer("score", f"{len(result.cells)} cell(s) scored")
|
|
194
195
|
|
|
195
196
|
records = aa_run_records(result)
|
|
196
197
|
for record in records:
|
|
@@ -361,7 +361,13 @@ def run_experiment(
|
|
|
361
361
|
"show duplicate stabilization lines) — run `abk clean`"
|
|
362
362
|
)
|
|
363
363
|
|
|
364
|
-
|
|
364
|
+
# Heartbeat so a large pending series is not a silent multi-minute freeze
|
|
365
|
+
# (each look is one full-window warehouse query, + bootstrap resampling for
|
|
366
|
+
# bootstrap methods). Throttled to ~20 lines so a dense sub-day grid stays
|
|
367
|
+
# readable; the final look always prints.
|
|
368
|
+
n_pending = len(pending)
|
|
369
|
+
beat_every = max(1, n_pending // 20)
|
|
370
|
+
for look_index, cutoff in enumerate(pending, start=1):
|
|
365
371
|
loaded = backend.load_cutoff(comparison, metric, metric_sql, grid, cutoff)
|
|
366
372
|
outcomes = analyze_cutoff(
|
|
367
373
|
experiment,
|
|
@@ -394,6 +400,11 @@ def run_experiment(
|
|
|
394
400
|
),
|
|
395
401
|
)
|
|
396
402
|
outcome.results_written += tables.save_results(rows)
|
|
403
|
+
if n_pending > 1 and (look_index % beat_every == 0 or look_index == n_pending):
|
|
404
|
+
log(
|
|
405
|
+
f"LOOK {experiment.name}/{metric.name}: "
|
|
406
|
+
f"{look_index}/{n_pending} looks computed"
|
|
407
|
+
)
|
|
397
408
|
log(f"RESULT {experiment.name}/{metric.name}: " f"{outcome.results_written} rows total")
|
|
398
409
|
|
|
399
410
|
except BaseException as exc:
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";(()=>{var be={"--abk-page":"#f5f1e8","--abk-card":"#fbf9f3","--abk-ink":"#1b1916","--abk-ink-2":"#6e675b","--abk-muted":"#9a9384","--abk-border":"#e6e0d4","--abk-chart-bg":"#211e1a","--abk-chart-border":"#332f29","--abk-chart-ink":"#c9c2b4","--abk-chart-grid":"#9a9384","--abk-series-1":"#c9a6f0","--abk-series-2":"#8e76e0","--abk-st-good":"#1e9e6a","--abk-st-warn":"#e0a23b","--abk-st-serious":"#d6453d","--abk-st-critical":"#b23a6b","--abk-good-text":"#15774e","--abk-explore-accent":"#6a45c4"};function T(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()||be[e]||"#888"}function ze(e){let n=e.replace("#","").trim();n.length===3&&(n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]);let t=parseInt(n,16);return n.length!==6||Number.isNaN(t)?[137,135,129]:[t>>16&255,t>>8&255,t&255]}function H(e,n){let[t,a,d]=ze(e);return`rgba(${t},${a},${d},${n})`}function pe(e){let n=Math.max(1,window.devicePixelRatio||1),t=e.clientWidth||e.offsetWidth||0,a=e.clientHeight||e.offsetHeight||0;return e.width=Math.round(t*n),e.height=Math.round(a*n),n}function te(e,n,t,a){let d=()=>e.width-(n.l+n.r)*a,i=()=>e.height-(n.t+n.b)*a,p=()=>t.xmax-t.xmin||1,c=()=>t.vmax-t.vmin||1;return{px:u=>n.l*a+(u-t.xmin)/p()*d(),py:u=>e.height-n.b*a-(u-t.vmin)/c()*i(),xAt:u=>t.xmin+(u-n.l*a)/(d()||1)*p(),plotW:d,plotH:i}}function O(e,n,t){return{left:n.l*t,top:n.t*t,right:e.width-n.r*t,bottom:e.height-n.b*t}}var Z=Number.isFinite;function J(e,n,t,a,d,i,p,c,o,f,b,u,h){let s=n.length,x=Math.max(1,Math.round(p)),g=d-a||1,y=0;for(let v=0;v<s;v++){let M=t[v];!Z(M)||n[v]<a||n[v]>d||y++}e.strokeStyle=f,e.lineWidth=b*u,e.lineJoin="round",h&&e.setLineDash(h.map(v=>v*u)),e.beginPath();let C=[];if(y<=x){let v=_=>_>=0&&_<s&&Z(t[_])&&n[_]>=a&&n[_]<=d,M=!1;for(let _=0;_<s;_++){if(!v(_)){M=!1;continue}let L=c(n[_]),z=o(t[_]);if(!v(_-1)&&!v(_+1)){C.push([L,z]),M=!1;continue}M?e.lineTo(L,z):(e.moveTo(L,z),M=!0)}}else{let v=new Array(x).fill(null),M=new Array(x).fill(null);for(let L=0;L<s;L++){let z=t[L],V=n[L];if(!Z(z)||V<a||V>d)continue;let R=Math.floor((V-a)/g*(x-1));R=R<0?0:R>x-1?x-1:R,(v[R]===null||z<v[R])&&(v[R]=z),(M[R]===null||z>M[R])&&(M[R]=z)}let _=!1;for(let L=0;L<x;L++){if(M[L]===null){_=!1;continue}let z=i+L,V=o(M[L]),R=o(v[L]);_?e.lineTo(z,V):(e.moveTo(z,V),_=!0),e.lineTo(z,R)}}if(e.stroke(),h&&e.setLineDash([]),C.length>0){e.fillStyle=f,e.beginPath();for(let[v,M]of C)e.moveTo(v+Math.max(1.5,b)*u,M),e.arc(v,M,Math.max(1.5,b)*u,0,Math.PI*2);e.fill()}}function ue(e){let n=[],t=-1;for(let a=0;a<e.length;a++){let d=e[a];d.lo!==null&&d.hi!==null&&Z(d.lo)&&Z(d.hi)?t===-1&&(t=a):t!==-1&&(n.push([t,a-1]),t=-1)}return t!==-1&&n.push([t,e.length-1]),n}function fe(e,n,t,a,d,i,p,c,o,f){e.fillStyle=H(i,p);for(let[b,u]of t)if(b!==u){e.beginPath(),e.moveTo(a(n[b].x),d(n[b].hi));for(let h=b+1;h<=u;h++)e.lineTo(a(n[h].x),d(n[h].hi));for(let h=u;h>=b;h--)e.lineTo(a(n[h].x),d(n[h].lo));e.closePath(),e.fill()}e.strokeStyle=H(i,c),e.lineWidth=1*o,f&&e.setLineDash(f.map(b=>b*o));for(let[b,u]of t){if(b===u){let h=a(n[b].x),s=d(n[b].hi),x=d(n[b].lo),g=3*o;e.beginPath(),e.moveTo(h,s),e.lineTo(h,x),e.moveTo(h-g,s),e.lineTo(h+g,s),e.moveTo(h-g,x),e.lineTo(h+g,x),e.stroke();continue}for(let h of["hi","lo"]){e.beginPath();for(let s=b;s<=u;s++){let x=a(n[s].x),g=d(n[s][h]);s===b?e.moveTo(x,g):e.lineTo(x,g)}e.stroke()}}f&&e.setLineDash([])}function ie(e,n,t,a,d,i,p,c,o,f,b,u){e.font=`${11*b}px ui-monospace, Menlo, Consolas, monospace`,e.textBaseline="middle";for(let s=0;s<=4;s++){let x=a.vmin+(a.vmax-a.vmin)*s/4,g=i(x);e.strokeStyle=H(o,.1),e.lineWidth=1*b,e.beginPath(),e.moveTo(t.l*b,g),e.lineTo(n.width-t.r*b,g),e.stroke(),e.fillStyle=f,e.textAlign="right",e.fillText(E(x),(t.l-8)*b,g)}e.textBaseline="top";let h=c-p||1;for(let s=0;s<=5;s++){let x=p+h*s/5,g=d(x);e.fillStyle=f,e.textAlign=s===0?"left":s===5?"right":"center",e.fillText(u(x,h),g,n.height-(t.b-7)*b)}}function Q(e,n,t,a,d,i,p,c,o){let f=d(i),b=O(n,t,a);f<b.top-.5||f>b.bottom+.5||(e.strokeStyle=p,e.lineWidth=1.25*a,o&&e.setLineDash(o.map(u=>u*a)),e.beginPath(),e.moveTo(b.left,f),e.lineTo(b.right,f),e.stroke(),o&&e.setLineDash([]),c&&(e.fillStyle=p,e.textAlign="right",e.textBaseline="middle",e.font=`${10*a}px ui-monospace, Menlo, Consolas, monospace`,e.fillText(c,(t.l-8)*a,f)))}function we(e,n,t,a,d,i,p,c){let o=O(n,t,a),f=d(i);if(f<o.left-1||f>o.right+1)return;e.save(),e.strokeStyle=H(p,.7),e.lineWidth=1*a,e.setLineDash([4*a,4*a]),e.beginPath(),e.moveTo(f,o.top),e.lineTo(f,o.bottom),e.stroke(),e.setLineDash([]),e.fillStyle=H(p,.95),e.font=`${10*a}px ui-monospace, Menlo, Consolas, monospace`;let b=f+6*a+e.measureText(c).width<=o.right;e.textAlign=b?"left":"right",e.textBaseline="top",e.fillText(c,b?f+6*a:f-6*a,o.top+5*a),e.restore()}function me(e,n,t,a,d,i,p,c,o){let f=O(n,t,a),b=Math.max(f.left,Math.min(d(i),f.right)),u=Math.max(f.left,Math.min(d(p),f.right));u<=b&&u<f.left||(e.fillStyle=H(c,o),e.fillRect(b,f.top,Math.max(u-b,1*a),f.bottom-f.top))}function E(e){let n=Math.abs(e);return n>=1e3?e.toFixed(0):n>=10?e.toFixed(1):n>=1?e.toFixed(2):n>=.001||n===0?e.toFixed(3):e.toExponential(1)}function U(e){return(e>0?"+":"")+E(e)}function q(e){return e<.001?"<0.001":e.toFixed(3)}function ae(e,n){if(n<=2)return`${Math.round(e*24)}h`;let t=Math.round(e*10)/10;return`${Number.isInteger(t)?t.toFixed(0):t.toFixed(1)}d`}function re(e){return new Date(e).toISOString().slice(0,16).replace("T"," ")}function ee(e){return new Date(e).toISOString().slice(0,10)}var _e="<svg class='abk-logomark' viewBox='0 0 100 100' width='22' height='22' role='img' aria-label='abkit' focusable='false'><rect x='3' y='3' width='94' height='94' rx='26' fill='#6a45c4'/><g fill='none' stroke='#fbf9f3' stroke-width='9' stroke-linecap='round' stroke-linejoin='round'><polyline points='13 50 34 50'/><polyline points='34 50 86 27'/><polyline points='34 50 86 61'/></g><circle cx='86' cy='27' r='7' fill='#fbf9f3'/></svg>";function $e(){let e=document.createElement("div");e.className="abk-brand",e.innerHTML=_e;let n=document.createElement("span");return n.className="abk-wordmark",n.textContent="abkit",e.appendChild(n),e}var r="abk-report",F={l:56,r:16,t:14,b:28},Pe=864e5,B=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),oe=(e,n,t)=>Math.max(n,Math.min(t,e));function l(e,n,t){let a=document.createElement(e);return n&&(a.className=n),t!==void 0&&(a.textContent=t),a}var G=e=>e===null?NaN:e,K=(e,n=E)=>e===null?"\u2014":n(e);function Ee(e,n){Ue(),n.classList.add(r),n.innerHTML="";let t=l("div","abk-root");n.appendChild(t);let a=[];t.appendChild(Ae(e)),e.warnings.length>0&&t.appendChild(He(e.warnings)),t.appendChild(Xe(e));let d=Be(e,a);d&&t.appendChild(d);for(let p of e.metrics)t.appendChild(Oe(p,e,a));e.metrics.length===0&&t.appendChild(l("div","abk-empty","No comparisons configured for this experiment."));for(let p of a)p.resize();let i=0;window.addEventListener("resize",()=>{i||(i=requestAnimationFrame(()=>{i=0;for(let p of a)p.resize()}))})}function Re(e){return e%86400===0?e/86400+"d":e%3600===0?e/3600+"h":e%60===0?e/60+"min":e+"s"}function Ae(e){let n=l("div","abk-header");n.appendChild($e());let t=e.project?`${B(e.project)} \xB7 ${B(e.experiment)}`:B(e.experiment),d=`${e.period.end>0?`${ee(e.period.start)} \u2013 ${re(e.period.end)} UTC`:`${ee(e.period.start)} UTC \u2013 (no cutoffs yet)`} \xB7 horizon ${ee(e.period.horizon)} (UTC) \xB7 cadence ${Re(e.cadence_seconds)} \xB7 tz ${B(e.tz)}`+(e.generated_at?` \xB7 generated ${B(e.generated_at)}`:""),i=l("div","abk-h-top"),p=l("h1","abk-title");p.innerHTML=t,i.appendChild(p),i.appendChild(l("div","abk-meta",d)),n.appendChild(i),e.description&&n.appendChild(l("p","abk-desc",e.description)),n.appendChild(l("div","abk-arms",`arms: ${e.arms.join(" vs ")} \xB7 first = control`));let c=l("div","abk-chips");return c.appendChild(Ne(e)),c.appendChild(De(e)),e.look!==null&&e.cadence_seconds<86400&&c.appendChild(l("span","abk-chip abk-look",`look ${e.look.n} / ~${e.look.planned} planned`)),n.appendChild(c),n}function Ne(e){let n=e.srm,t=e.arms.reduce((d,i)=>d+(n.observed[i]||0),0),a=l("span","abk-chip abk-srm");if(n.flag){let d=e.arms.map(o=>t>0?((n.observed[o]||0)/t).toFixed(2):"0.00").join("/"),i=e.arms.map(o=>{var f;return((f=n.expected[o])!=null?f:0).toFixed(2)}).join("/"),p=n.pvalue===null?"p=\u2014":`p${n.pvalue<.001?"<0.001":"="+q(n.pvalue)}`,c=n.kind==="sequential_multinomial"?"anytime-valid":"\u03C7\xB2";a.classList.add("abk-srm-fail"),a.textContent=`SRM FAILED (observed ${d} vs expected ${i}, ${c} ${p}) \u2014 effects untrustworthy`,a.setAttribute("data-abk-srm","fail")}else t===0?(a.textContent="SRM \u2014 no exposure data",a.setAttribute("data-abk-srm","na")):(a.textContent=`SRM ok (p=${K(n.pvalue,q)})`,a.classList.add("abk-srm-ok"),a.setAttribute("data-abk-srm","ok"));return a}function De(e){let n=l("span","abk-chip abk-calibration"),t=e.calibration;if(t==null)return n.textContent="uncalibrated \u2014 run `abk validate` (M4)",n.setAttribute("data-abk-calibration","empty"),n;if(typeof t.fpr!="number")return n.textContent=t.headline||"A/A ran \u2014 no method measurable",n.setAttribute("data-abk-calibration","failed"),n;let a=typeof t.headline=="string"&&t.headline||`calibrated / FPR=${(t.fpr*100).toFixed(1)}%`;return n.textContent=a,n.classList.add("abk-calibrated"),n.setAttribute("data-abk-calibration","present"),n}function He(e){let n=l("div","abk-warnings");for(let t of e)n.appendChild(l("div","abk-warning",`\u26A0 ${t}`));return n}var I=e=>e==null||Number.isNaN(e)?"\u2014":`${(e*100).toFixed(1)}%`,Fe=["method","FPR","peeking FPR","peeking (AV)","power","achieved MDE","coverage","exaggeration","\u03B1","verdict"];function Be(e,n){var f;let t=e.calibration,a=t==null?void 0:t.matrix_rows,d=!!a&&a.length>0;if(!t||!d&&!t.family)return null;let i=l("section","abk-calibration-matrix"),p=l("div","abk-cal-head");if(p.appendChild(l("h2","abk-cal-title","A/A false-positive matrix")),t.headline&&p.appendChild(l("div","abk-cal-headline",t.headline)),i.appendChild(p),t.family){let b=Ve(t.family);b&&i.appendChild(b)}if(!d)return i;let c=[],o={};for(let b of a){let u=(f=b.metric)!=null?f:"\u2014";o[u]||(o[u]=[],c.push(u)),o[u].push(b)}for(let b of c)i.appendChild(Ie(b,o[b],n));return i}function Ve(e){var p,c;if(e.fwer==null&&e.fdr==null)return null;let n=l("div","abk-cal-family");n.setAttribute("data-abk-family",e.over_budget?"over":"ok");let t=(p=e.n_metrics)!=null?p:e.metrics?e.metrics.length:0,a=(c=e.correction)!=null?c:"composed";n.appendChild(l("div","abk-cal-family-title",`Composed multiple testing \xB7 ${a} \xB7 ${t} metrics`));let d=l("div","abk-cal-family-stats"),i=(o,f,b)=>{let u=l("span",b?"abk-cal-family-stat abk-cal-fpr-over":"abk-cal-family-stat");u.appendChild(l("span","abk-cal-family-l",o)),u.appendChild(l("span","abk-cal-family-v",f)),d.appendChild(u)};if(i("family-wise error",I(e.fwer),e.over_budget),i("false-discovery rate",I(e.fdr)),e.fwer_peeking!=null&&e.fwer_sequential!=null){let o=e.budget!=null&&e.fwer_peeking>e.budget;i("peeking \u2192 always-valid",`${I(e.fwer_peeking)} \u2192 ${I(e.fwer_sequential)}`,o)}return e.budget!=null&&i("budget",I(e.budget)),n.appendChild(d),e.verdict&&n.appendChild(l("div","abk-cal-family-verdict",e.verdict)),n}function Ie(e,n,t){var o,f,b,u,h;let a=l("div","abk-cal-metric");a.appendChild(l("div","abk-cal-metric-name",e));let d=l("table","abk-cal-table"),i=l("tr");for(let s of Fe)i.appendChild(l("th",void 0,s));d.appendChild(i);for(let s of n){let x=l("tr");s.recommended&&x.classList.add("abk-cal-rec"),s.status&&s.status!=="success"&&x.classList.add("abk-cal-failed"),x.setAttribute("data-abk-calibration-row",s.recommended?"recommended":"cell");let g=l("td");g.appendChild(l("span",void 0,(o=s.method)!=null?o:"\u2014")),s.recommended&&g.appendChild(l("span","abk-cal-badge","Recommended")),s.note&&g.appendChild(l("div","abk-cal-rationale",s.note)),x.appendChild(g);let y=s.over_budget?"abk-cal-fpr-over":s.fpr!==null&&s.fpr!==void 0?"abk-cal-fpr-ok":void 0,C=l("td",y,I(s.fpr));s.budget!==null&&s.budget!==void 0&&(C.title=`budget ${I(s.budget)}`),x.appendChild(C),x.appendChild(l("td",void 0,I(s.peeking_fpr)));let v=l("td","abk-cal-av",I(s.peeking_fpr_sequential));s.ci_width!=null&&s.ci_width_sequential!=null&&(v.title=`CI width ${E(s.ci_width)} \u2192 ${E(s.ci_width_sequential)} (always-valid)`),x.appendChild(v),x.appendChild(l("td",void 0,I(s.power))),x.appendChild(l("td",void 0,s.achieved_mde==null?"\u2014":E(s.achieved_mde))),x.appendChild(l("td",void 0,I(s.coverage))),x.appendChild(l("td",void 0,s.effect_exaggeration==null?"\u2014":U(s.effect_exaggeration))),x.appendChild(l("td",void 0,s.alpha==null?"\u2014":q(s.alpha)));let M=l("td","abk-cal-verdict",(f=s.verdict)!=null?f:"");s.recommended&&s.rationale&&M.appendChild(l("div","abk-cal-rationale",`recommended \u2014 ${s.rationale}`)),x.appendChild(M),d.appendChild(x)}a.appendChild(d);let p=s=>!!s.peeking_curve&&s.peeking_curve.length>1,c=(b=n.find(s=>s.recommended&&p(s)))!=null?b:n.find(p);if(c&&c.peeking_curve){let s=c.peeking_curve,x=c.peeking_curve_sequential&&c.peeking_curve_sequential.length>1?c.peeking_curve_sequential:null,g=(u=c.alpha)!=null?u:null,y=[{label:"cumulative FPR",colorVar:"--abk-series-1"},{label:"nominal \u03B1",colorVar:"--abk-st-warn"}];x&&y.splice(1,0,{label:"always-valid",colorVar:"--abk-series-2"}),a.appendChild(ne(`peeking FPR vs looks \xB7 ${(h=c.method)!=null?h:""}`,y,t,(C,v)=>We(C,v,s,g,x),x?"optional-stopping hazard (blue) vs the always-valid CI (green), which holds the false-positive rate near \u03B1 at every look":"optional-stopping hazard: cumulative false-positive rate as an analyst peeks at more looks"))}return a}function We(e,n,t,a,d=null){let i=Math.max(1,window.devicePixelRatio||1);if(e.width===0||e.height===0)return;let p=t.map(g=>g[0]),c=t.map(g=>g[1]),o=p.filter(g=>Number.isFinite(g)),f=0,b=Math.max(1,...o),u=0;for(let g of c)Number.isFinite(g)&&g>u&&(u=g);a!==null&&Number.isFinite(a)&&a>u&&(u=a),u<=0&&(u=1);let h={xmin:f,xmax:b,vmin:0,vmax:u*1.15},s=te(e,j,h,i);n.fillStyle=T("--abk-chart-bg"),n.fillRect(0,0,e.width,e.height),ie(n,e,j,h,s.px,s.py,f,b,T("--abk-chart-grid"),T("--abk-muted"),i,ae);let x=O(e,j,i);if(n.save(),n.beginPath(),n.rect(x.left,x.top,s.plotW(),s.plotH()),n.clip(),a!==null&&Number.isFinite(a)&&Q(n,e,j,i,s.py,a,H(T("--abk-st-warn"),.85),"",[4,3]),J(n,p,c,f,b,x.left,s.plotW(),s.px,s.py,T("--abk-series-1"),1.75,i),d){let g=d.map(C=>C[0]),y=d.map(C=>C[1]);J(n,g,y,f,b,x.left,s.plotW(),s.px,s.py,T("--abk-series-2"),1.75,i)}n.restore()}function Xe(e){let n=l("div","abk-verdicts");if(e.verdicts.length===0)return n.appendChild(l("div","abk-empty","No verdict yet \u2014 no main-metric results persisted. Run `abk run` first.")),n;for(let t of e.verdicts)n.appendChild(je(t));return n}function je(e){let n=e.verdict.toLowerCase(),t=l("div",`abk-verdict abk-verdict-${n}`);t.setAttribute("data-abk-verdict",e.verdict);let a=l("div","abk-verdict-head");if(a.appendChild(l("span","abk-verdict-word",e.verdict)),a.appendChild(l("span","abk-verdict-target",`${e.metric} \u2014 ${e.pair.c} vs ${e.pair.t}`)),e.weekly_cycle_pct!=null){let c=Math.round(e.weekly_cycle_pct*100),o=l("span","abk-chip abk-weekly-chip",`covers ${c}% of a weekly cycle`);o.setAttribute("data-abk-weekly","1"),o.title="day-of-week effects may not be represented",a.appendChild(o)}t.appendChild(a);let d=l("div","abk-verdict-stats"),i=(c,o)=>{let f=l("span","abk-stat");f.appendChild(l("span","abk-stat-l",c)),f.appendChild(l("span","abk-stat-v",o)),d.appendChild(f)};if(i("effect",e.effect===null?"\u2014":U(e.effect)),i("CI",e.lo===null||e.hi===null?"\u2014":`[${E(e.lo)}, ${E(e.hi)}]`),i("p",K(e.pvalue,q)),i("\u03B1",K(e.alpha,c=>String(c))),e.mde!==null&&i("MDE",E(e.mde)),e.min_effect!==null&&i("min effect",E(e.min_effect)),e.elapsed_days!==null&&i("elapsed",`${E(e.elapsed_days)}d${e.is_horizon?" (at horizon)":" (pre-horizon)"}`),t.appendChild(d),e.rationale.length>0){let c=l("ul","abk-rationale");for(let o of e.rationale)c.appendChild(l("li",void 0,o));t.appendChild(c)}let p=e.weekly_cycle_pct!=null?e.caveats.filter(c=>!c.includes("of a weekly cycle")):e.caveats;if(p.length>0){let c=l("ul","abk-caveats");for(let o of p)c.appendChild(l("li","abk-caveat",`\u26A0 ${o}`));t.appendChild(c)}if(e.guardrails.length>0){let c=l("ul","abk-guardrails");for(let o of e.guardrails){let f=l("li",o.regressed?"abk-guardrail abk-guardrail-regressed":"abk-guardrail",`guardrail ${o.metric} (${o.pair.c} vs ${o.pair.t}): `+(o.regressed?`REGRESSED \u2014 effect ${o.effect===null?"\u2014":U(o.effect)}, desired ${o.desired_direction}`:"ok"));c.appendChild(f)}t.appendChild(c)}return t}function Oe(e,n,t){let a=l("section","abk-metric"),d=l("div","abk-metric-head"),i=l("div","abk-metric-name-row");i.appendChild(l("h2","abk-metric-name",e.name)),e.main&&i.appendChild(l("span","abk-badge abk-badge-main","main")),e.guardrail&&i.appendChild(l("span","abk-badge abk-badge-guardrail","guardrail")),d.appendChild(i),e.description&&d.appendChild(l("p","abk-metric-desc",e.description));let p=e.method,c=JSON.stringify(p.params),o=`${p.name} \xB7 params ${c}`+(p.alpha!==null?` \xB7 \u03B1=${p.alpha}`:"")+` \xB7 id ${p.id.slice(0,12)}\u2026`;d.appendChild(l("div","abk-method",o));for(let b of e.warnings)d.appendChild(l("div","abk-warning",`\u26A0 ${b}`));a.appendChild(d);let f=b=>{for(let u of n.verdicts)if(u.metric===e.name&&u.pair.c===b.c&&u.pair.t===b.t)return u;return null};for(let b of e.pairs)a.appendChild(qe(e,b,n,f(b),t));return a}function qe(e,n,t,a,d){let i=l("div","abk-pair");if(t.arms.length>2&&i.appendChild(l("h3","abk-pair-title",`${n.c} vs ${n.t}`)),n.series.length===0)return i.appendChild(l("div","abk-empty","No persisted cutoffs for this pair yet \u2014 run `abk run` first.")),i;let c=[...n.series].sort((y,C)=>y.t-C.t),o=(t.period.horizon-t.period.start)/Pe,f=c[c.length-1],b=c.reduce((y,C)=>y+C.ins,0);f.hz===0&&(i.setAttribute("data-abk-prehorizon","1"),i.appendChild(l("div","abk-note abk-prehorizon",`pre-horizon \u2014 fixed CIs are dashed/de-emphasized and not peeking-valid; planned horizon ${ee(t.period.horizon)} (${E(o)}d)`))),b>0&&i.appendChild(l("div","abk-note abk-insufficient",`${b} insufficient-data cutoff${b===1?"":"s"} greyed \u2014 counts + SRM only, no inference`));let u=l("div","abk-chart abk-chart-main"),h=document.createElement("canvas");u.appendChild(h),i.appendChild(u);let s=l("div","abk-readout","hover for a cutoff readout \xB7 scroll to zoom \xB7 drag to pan \xB7 double-click to reset");i.appendChild(s);let x=Ge(h,c,o,t,y=>{s.innerHTML=y});x!==null?d.push(x):u.replaceChildren(l("div","abk-chart-fallback","chart unavailable (no canvas 2D context)"));let g=l("div","abk-minis");return g.appendChild(ne("variant means",[{label:n.c,colorVar:"--abk-series-1"},{label:n.t,colorVar:"--abk-series-2"}],d,(y,C)=>le(y,C,c,o,[{y:v=>G(v.v1),colorVar:"--abk-series-1"},{y:v=>G(v.v2),colorVar:"--abk-series-2"},{y:v=>G(v.cv1),colorVar:"--abk-series-1",dash:[3,3]},{y:v=>G(v.cv2),colorVar:"--abk-series-2",dash:[3,3]}]),c.some(y=>y.cv1!==null||y.cv2!==null)?"dashed = CUPED covariate mean":void 0)),g.appendChild(ne("pair MDE",[],d,(y,C)=>le(y,C,c,o,[{y:v=>G(v.mde),colorVar:"--abk-series-1"}],{includeZero:!0,refLine:a!==null&&a.min_effect!==null?{v:a.min_effect,label:"min effect",colorVar:"--abk-st-warn"}:void 0}))),g.appendChild(ne("p-value vs \u03B1",[],d,(y,C)=>le(y,C,c,o,[{y:v=>G(v.p),colorVar:"--abk-series-1"}],{includeZero:!0,refLine:e.method.alpha!==null?{v:e.method.alpha,label:`\u03B1=${e.method.alpha}`,colorVar:"--abk-st-critical"}:void 0}))),g.appendChild(ne("avg group size",[],d,(y,C)=>le(y,C,c,o,[{y:v=>(v.s1+v.s2)/2,colorVar:"--abk-series-1"}],{includeZero:!0}))),i.appendChild(g),i.appendChild(Ke(c)),i}function Ge(e,n,t,a,d){let i=e.getContext("2d");if(!i)return null;let p=n.map(m=>m.ed===null?NaN:m.ed),c=n.map(m=>G(m.e)),o=m=>m.hz===1&&m.t>=a.period.horizon,f=n.findIndex(o),b=(m,k)=>({x:p[k],lo:m.lo,hi:m.hi}),u=[],h=[];n.forEach((m,k)=>{Number.isNaN(p[k])||(f===-1||k<f?u.push(b(m,k)):h.push(b(m,k)))}),f!==-1&&u.length>0&&h.length>0&&h.unshift(u[u.length-1]);let s=p.filter(m=>!Number.isNaN(m)),x=[];for(let m=1;m<s.length;m++)x.push(s[m]-s[m-1]);x.sort((m,k)=>m-k);let g=x.length>0?x[Math.floor(x.length/2)]:a.cadence_seconds/86400,y=m=>{let k=[];return n.forEach((w,$)=>{if(!m(w)||Number.isNaN(p[$]))return;let P=p[$]-g/2,S=p[$]+g/2,D=k[k.length-1];D&&P<=D[1]?D[1]=S:k.push([P,S])}),k},C=y(m=>m.ins===1),v=y(m=>m.blk===1&&m.ins===0),M=f!==-1&&n[f].ed!==null?n[f]:void 0,_=M!==void 0?M.ed:t,L=0,z=Math.max(_,t,...s,1),V=z-L||1,R=Math.min(Math.max(a.cadence_seconds/86400,V/200),V),ke=0,he=1;(function(){let k=1/0,w=-1/0,$=S=>{S!==null&&Number.isFinite(S)&&(S<k&&(k=S),S>w&&(w=S))};for(let S of n)$(S.e),$(S.lo),$(S.hi);(!Number.isFinite(k)||!Number.isFinite(w))&&(k=-1,w=1),k>0&&(k=0),w<0&&(w=0),w<=k&&(w=k+1);let P=(w-k)*.06;ke=k-P,he=w+P})();let N=L,W=z,A=1,Y=null,xe=()=>({xmin:N,xmax:W,vmin:ke,vmax:he}),Me=()=>te(e,F,xe(),A);function se(m,k){let w=k-m;if(w<R){let $=(m+k)/2;m=$-R/2,k=$+R/2,w=R}w>=V&&(m=L,k=z),m<L&&(k+=L-m,m=L),k>z&&(m-=k-z,k=z),N=oe(m,L,z),W=oe(k,L,z),ce()}let de=0;function ge(){de===0&&(de=requestAnimationFrame(ce))}function ce(){if(de=0,e.width===0||e.height===0)return;let m=Me(),k=T("--abk-chart-grid"),w=T("--abk-chart-ink"),$=T("--abk-series-1");i.fillStyle=T("--abk-chart-bg"),i.fillRect(0,0,e.width,e.height),ie(i,e,F,xe(),m.px,m.py,N,W,k,T("--abk-muted"),A,ae),Q(i,e,F,A,m.py,0,H(w,.6),""),i.save(),i.beginPath();let P=O(e,F,A);i.rect(P.left,P.top,m.plotW(),m.plotH()),i.clip();for(let[S,D]of C)D<N||S>W||me(i,e,F,A,m.px,S,D,T("--abk-muted"),.22);for(let[S,D]of v)D<N||S>W||me(i,e,F,A,m.px,S,D,T("--abk-st-critical"),.05);fe(i,u,ue(u),m.px,m.py,$,.07,.28,A,[4,4]),fe(i,h,ue(h),m.px,m.py,$,.13,.4,A),J(i,p,c,N,W,P.left,m.plotW(),m.px,m.py,$,2,A),we(i,e,F,A,m.px,_,k,"planned horizon \u2192"),Y!==null&&Se(m,P.top,m.plotH()),i.restore()}function Le(m){let k=-1,w=1/0;for(let $=0;$<p.length;$++){if(Number.isNaN(p[$]))continue;let P=Math.abs(p[$]-m);P<w&&(w=P,k=$)}return k}function Se(m,k,w){let $=Le(Y);if($<0)return;let P=p[$];if(P<N||P>W)return;let S=m.px(P);i.strokeStyle=H(T("--abk-chart-grid"),.45),i.lineWidth=1*A,i.setLineDash([2*A,2*A]),i.beginPath(),i.moveTo(S,k),i.lineTo(S,k+w),i.stroke(),i.setLineDash([]);let D=c[$];if(Number.isFinite(D)){let Ce=m.py(D);i.fillStyle=T("--abk-chart-bg"),i.beginPath(),i.arc(S,Ce,4*A,0,Math.PI*2),i.fill(),i.strokeStyle=T("--abk-series-1"),i.lineWidth=2*A,i.beginPath(),i.arc(S,Ce,4*A,0,Math.PI*2),i.stroke()}Te($)}function Te(m){let k=n[m],w=`<span class="abk-ro-t">${B(re(k.t))} (${k.ed===null?"\u2014":E(k.ed)+"d"})</span>`;if(k.ins===1)w+=`<span class="abk-ro-flag abk-insufficient">insufficient data \u2014 n\u2081=${k.s1}, n\u2082=${k.s2} \xB7 SRM ${k.blk===1?"FAILED":"ok"}</span>`;else{w+=`<span>effect ${k.e===null?"\u2014":B(U(k.e))}`,k.lo!==null&&k.hi!==null&&(w+=` [${B(E(k.lo))}, ${B(E(k.hi))}]`),w+="</span>",w+=`<span>p ${k.p===null?"\u2014":B(q(k.p))}</span>`,w+=`<span>n\u2081=${k.s1} n\u2082=${k.s2}</span>`,k.mde!==null&&(w+=`<span>MDE ${B(E(k.mde))}</span>`);let $=[];o(k)?$.push("at horizon"):$.push("pre-horizon"),k.blk===1&&$.push("SRM-blocked"),$.length>0&&(w+=`<span class="abk-ro-flag">${B($.join(" \xB7 "))}</span>`)}d(w)}function ve(m){let k=e.getBoundingClientRect(),w=(m-k.left-F.l)/(k.width-(F.l+F.r)||1);return N+oe(w,0,1)*(W-N)}e.addEventListener("wheel",m=>{m.preventDefault();let k=ve(m.clientX),w=W-N,$=oe(w*Math.pow(1.0015,m.deltaY),R,V),P=(k-N)/(w||1);se(k-P*$,k-P*$+$)},{passive:!1});let X=null;return e.addEventListener("mousedown",m=>{X={x:m.clientX,vMin:N,vMax:W},e.style.cursor="grabbing"}),window.addEventListener("mousemove",m=>{if(!X)return;let k=e.getBoundingClientRect(),w=(X.vMax-X.vMin)/(k.width-(F.l+F.r)||1),$=(m.clientX-X.x)*w;se(X.vMin-$,X.vMax-$)}),window.addEventListener("mouseup",()=>{X&&(X=null,e.style.cursor="crosshair")}),e.addEventListener("mousemove",m=>{X||(Y=ve(m.clientX),ge())}),e.addEventListener("mouseleave",()=>{Y!==null&&(Y=null,d("hover for a cutoff readout \xB7 scroll to zoom \xB7 drag to pan \xB7 double-click to reset"),ge())}),e.addEventListener("dblclick",()=>se(L,z)),e.style.cursor="crosshair",{resize(){A=pe(e),ce()}}}function ne(e,n,t,a,d){let i=l("div","abk-mini"),p=l("div","abk-mini-head");p.appendChild(l("span","abk-mini-title",e));for(let b of n){let u=l("span","abk-legend-item"),h=l("span","abk-swatch");h.style.background=T(b.colorVar),u.appendChild(h),u.appendChild(l("span",void 0,b.label)),p.appendChild(u)}i.appendChild(p),d&&i.appendChild(l("div","abk-mini-note",d));let c=l("div","abk-chart abk-chart-mini"),o=document.createElement("canvas");c.appendChild(o),i.appendChild(c);let f=o.getContext("2d");return f?(t.push({resize(){pe(o),a(o,f)}}),i):(c.replaceChildren(l("div","abk-chart-fallback","chart unavailable")),i)}var j={l:48,r:10,t:8,b:22};function le(e,n,t,a,d,i={}){let p=Math.max(1,window.devicePixelRatio||1);if(e.width===0||e.height===0)return;let c=t.map(C=>C.ed===null?NaN:C.ed),o=c.filter(C=>!Number.isNaN(C)),f=0,b=Math.max(a,...o,1),u=1/0,h=-1/0;for(let C of d)for(let v of t){let M=C.y(v);Number.isFinite(M)&&(M<u&&(u=M),M>h&&(h=M))}i.refLine&&(u=Math.min(u,i.refLine.v),h=Math.max(h,i.refLine.v)),(!Number.isFinite(u)||!Number.isFinite(h))&&(u=0,h=1),i.includeZero&&(u>0&&(u=0),h<0&&(h=0)),h<=u&&(h=u+1);let s=(h-u)*.08,x={xmin:f,xmax:b,vmin:u-s,vmax:h+s},g=te(e,j,x,p);n.fillStyle=T("--abk-chart-bg"),n.fillRect(0,0,e.width,e.height),ie(n,e,j,x,g.px,g.py,f,b,T("--abk-chart-grid"),T("--abk-muted"),p,ae);let y=O(e,j,p);n.save(),n.beginPath(),n.rect(y.left,y.top,g.plotW(),g.plotH()),n.clip(),i.refLine&&Q(n,e,j,p,g.py,i.refLine.v,H(T(i.refLine.colorVar),.85),"",[4,3]);for(let C of d){let v=t.map(M=>C.y(M));J(n,c,v,f,b,y.left,g.plotW(),g.px,g.py,T(C.colorVar),1.5,p,C.dash)}if(n.restore(),i.refLine&&i.refLine.label){Q(n,e,j,p,g.py,i.refLine.v,"rgba(0,0,0,0)",""),n.fillStyle=H(T(i.refLine.colorVar),.95),n.font=`${9*p}px ui-monospace, Menlo, Consolas, monospace`,n.textAlign="left",n.textBaseline="bottom";let C=g.py(i.refLine.v);C>y.top&&C<y.bottom&&n.fillText(i.refLine.label,y.left+4*p,C-2*p)}}function Ke(e){let n=document.createElement("details");n.className="abk-audit";let t=l("summary",void 0,`results table (${e.length} cutoffs)`);n.appendChild(t);let a=l("div","abk-audit-scroll"),d=document.createElement("table"),i=document.createElement("thead"),p=document.createElement("tr");for(let o of["cutoff (UTC)","d","effect","CI","p","reject","n\u2081","n\u2082","value\u2081","value\u2082","MDE","flags"])p.appendChild(l("th",void 0,o));i.appendChild(p),d.appendChild(i);let c=document.createElement("tbody");for(let o of e){let f=document.createElement("tr");o.ins===1&&(f.className="abk-insufficient");let b=[re(o.t),o.ed===null?"\u2014":E(o.ed),o.e===null?"\u2014":U(o.e),o.lo===null||o.hi===null?"\u2014":`[${E(o.lo)}, ${E(o.hi)}]`,K(o.p,q),o.rj===null?"\u2014":o.rj===1?"\u2713":"\u2717",String(o.s1),String(o.s2),K(o.v1),K(o.v2),K(o.mde),[o.hz===1?"horizon":"",o.blk===1?"SRM":"",o.ins===1?"insufficient":""].filter(Boolean).join(" \xB7 ")||"\u2014"];for(let u of b)f.appendChild(l("td",void 0,u));c.appendChild(f)}return d.appendChild(c),a.appendChild(d),n.appendChild(a),n}var ye=!1;function Ue(){if(ye)return;ye=!0;let n=`
|
|
2
|
+
:where(:root){${Object.entries(be).map(([a,d])=>`${a}:${d}`).join(";")};
|
|
3
|
+
--abk-sans:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
|
|
4
|
+
--abk-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}
|
|
5
|
+
.${r}{font-family:var(--abk-sans);color:var(--abk-ink);background:var(--abk-page);}
|
|
6
|
+
.${r} *{box-sizing:border-box;}
|
|
7
|
+
.${r} .abk-root{max-width:1100px;margin:0 auto;padding:20px 18px 48px;}
|
|
8
|
+
/* header ------------------------------------------------------------------ */
|
|
9
|
+
.${r} .abk-header{margin-bottom:16px;padding-left:12px;border-left:3px solid var(--abk-series-1);}
|
|
10
|
+
.${r} .abk-brand{display:flex;align-items:center;gap:8px;margin-bottom:10px;}
|
|
11
|
+
.${r} .abk-logomark{width:22px;height:22px;border-radius:6px;display:block;}
|
|
12
|
+
.${r} .abk-wordmark{font:700 15px var(--abk-sans);color:var(--abk-explore-accent);letter-spacing:-0.01em;}
|
|
13
|
+
.${r} .abk-h-top{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;}
|
|
14
|
+
.${r} .abk-title{font-size:21px;font-weight:700;margin:0;letter-spacing:-0.01em;}
|
|
15
|
+
.${r} .abk-meta{font-size:12px;color:var(--abk-ink-2);font-family:var(--abk-mono);}
|
|
16
|
+
.${r} .abk-desc{margin:8px 0 0;font-size:13px;color:var(--abk-ink-2);max-width:760px;line-height:1.5;}
|
|
17
|
+
.${r} .abk-arms{margin-top:6px;font-size:12px;color:var(--abk-ink-2);font-family:var(--abk-mono);}
|
|
18
|
+
/* chips -------------------------------------------------------------------- */
|
|
19
|
+
.${r} .abk-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
|
|
20
|
+
.${r} .abk-chip{display:inline-flex;align-items:center;gap:7px;padding:5px 11px;
|
|
21
|
+
background:var(--abk-card);border:1px solid var(--abk-border);border-radius:10px;
|
|
22
|
+
font-size:12px;font-family:var(--abk-mono);color:var(--abk-ink-2);}
|
|
23
|
+
.${r} .abk-srm-ok{border-color:var(--abk-st-good);}
|
|
24
|
+
.${r} .abk-srm-fail{background:var(--abk-st-critical);border-color:var(--abk-st-critical);
|
|
25
|
+
color:var(--abk-card);font-weight:700;}
|
|
26
|
+
.${r} .abk-calibration{border-style:dashed;}
|
|
27
|
+
.${r} .abk-calibrated{border-style:solid;border-color:var(--abk-st-good);}
|
|
28
|
+
.${r} .abk-weekly-chip{padding:2px 9px;font-size:11px;align-self:center;
|
|
29
|
+
border-color:var(--abk-st-warn);color:var(--abk-ink);
|
|
30
|
+
background:color-mix(in srgb, var(--abk-st-warn) 12%, transparent);}
|
|
31
|
+
/* warnings / notes ---------------------------------------------------------- */
|
|
32
|
+
.${r} .abk-warnings{margin:10px 0;}
|
|
33
|
+
.${r} .abk-warning{font-size:12px;color:var(--abk-ink);
|
|
34
|
+
background:color-mix(in srgb, var(--abk-st-warn) 14%, transparent);
|
|
35
|
+
border:1px solid var(--abk-st-warn);border-radius:8px;padding:6px 10px;margin:4px 0;}
|
|
36
|
+
.${r} .abk-note{font-size:12px;font-family:var(--abk-mono);border-radius:8px;
|
|
37
|
+
padding:5px 10px;margin:6px 0;border:1px dashed var(--abk-border);color:var(--abk-ink-2);}
|
|
38
|
+
.${r} .abk-note.abk-insufficient{background:color-mix(in srgb, var(--abk-muted) 12%, transparent);}
|
|
39
|
+
/* verdicts ------------------------------------------------------------------ */
|
|
40
|
+
.${r} .abk-verdicts{display:flex;flex-direction:column;gap:10px;margin:14px 0 22px;}
|
|
41
|
+
.${r} .abk-verdict{background:var(--abk-card);border:1px solid var(--abk-border);
|
|
42
|
+
border-left-width:4px;border-radius:10px;padding:12px 14px;}
|
|
43
|
+
.${r} .abk-verdict-win{border-left-color:var(--abk-st-good);}
|
|
44
|
+
.${r} .abk-verdict-lose{border-left-color:var(--abk-st-critical);}
|
|
45
|
+
.${r} .abk-verdict-flat{border-left-color:var(--abk-ink-2);}
|
|
46
|
+
.${r} .abk-verdict-inconclusive{border-left-color:var(--abk-st-warn);}
|
|
47
|
+
.${r} .abk-verdict-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 12px;}
|
|
48
|
+
.${r} .abk-verdict-word{font-size:17px;font-weight:800;letter-spacing:0.02em;}
|
|
49
|
+
.${r} .abk-verdict-win .abk-verdict-word{color:var(--abk-good-text);}
|
|
50
|
+
.${r} .abk-verdict-lose .abk-verdict-word{color:var(--abk-st-critical);}
|
|
51
|
+
.${r} .abk-verdict-flat .abk-verdict-word{color:var(--abk-ink-2);}
|
|
52
|
+
.${r} .abk-verdict-inconclusive .abk-verdict-word{color:var(--abk-ink-2);}
|
|
53
|
+
.${r} .abk-verdict-target{font-size:13px;color:var(--abk-ink-2);font-family:var(--abk-mono);}
|
|
54
|
+
.${r} .abk-verdict-stats{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:8px;}
|
|
55
|
+
.${r} .abk-stat{display:inline-flex;gap:6px;font-size:12px;font-family:var(--abk-mono);}
|
|
56
|
+
.${r} .abk-stat-l{color:var(--abk-muted);}
|
|
57
|
+
.${r} .abk-stat-v{color:var(--abk-ink);font-weight:600;}
|
|
58
|
+
.${r} .abk-rationale{margin:8px 0 0;padding-left:20px;font-size:13px;color:var(--abk-ink-2);line-height:1.5;}
|
|
59
|
+
.${r} .abk-caveats{margin:8px 0 0;padding-left:20px;list-style:none;}
|
|
60
|
+
.${r} .abk-caveat{font-size:12.5px;color:var(--abk-ink);
|
|
61
|
+
background:color-mix(in srgb, var(--abk-st-warn) 14%, transparent);
|
|
62
|
+
border-radius:6px;padding:4px 8px;margin:3px 0;}
|
|
63
|
+
.${r} .abk-guardrails{margin:8px 0 0;padding-left:20px;font-size:12.5px;color:var(--abk-ink-2);}
|
|
64
|
+
.${r} .abk-guardrail-regressed{color:var(--abk-st-critical);font-weight:600;}
|
|
65
|
+
/* A/A calibration matrix (M4) ------------------------------------------------ */
|
|
66
|
+
.${r} .abk-calibration-matrix{margin:18px 0 26px;}
|
|
67
|
+
.${r} .abk-cal-head{margin-bottom:10px;}
|
|
68
|
+
.${r} .abk-cal-title{font-size:16px;font-weight:700;margin:0;}
|
|
69
|
+
.${r} .abk-cal-headline{margin-top:4px;font-size:12.5px;font-family:var(--abk-mono);color:var(--abk-ink-2);}
|
|
70
|
+
.${r} .abk-cal-family{margin:12px 0;padding:10px 12px;border:1px solid var(--abk-border);
|
|
71
|
+
border-radius:6px;background:var(--abk-card);}
|
|
72
|
+
.${r} .abk-cal-family[data-abk-family="over"]{border-color:var(--abk-st-critical);
|
|
73
|
+
background:color-mix(in srgb, var(--abk-st-critical) 6%, transparent);}
|
|
74
|
+
.${r} .abk-cal-family-title{font-size:13px;font-weight:600;color:var(--abk-ink);}
|
|
75
|
+
.${r} .abk-cal-family-stats{margin-top:6px;display:flex;flex-wrap:wrap;gap:16px;
|
|
76
|
+
font-family:var(--abk-mono);font-size:12px;}
|
|
77
|
+
.${r} .abk-cal-family-l{color:var(--abk-muted);margin-right:6px;}
|
|
78
|
+
.${r} .abk-cal-family-v{color:var(--abk-ink);font-weight:600;}
|
|
79
|
+
.${r} .abk-cal-family-verdict{margin-top:6px;font-size:12px;font-family:var(--abk-mono);color:var(--abk-ink-2);}
|
|
80
|
+
.${r} .abk-cal-metric{margin:14px 0;}
|
|
81
|
+
.${r} .abk-cal-metric-name{font-size:13px;font-weight:600;margin:0 0 6px;color:var(--abk-ink);}
|
|
82
|
+
.${r} .abk-cal-table{width:100%;border-collapse:collapse;font-size:12px;font-family:var(--abk-mono);}
|
|
83
|
+
.${r} .abk-cal-table th,.${r} .abk-cal-table td{border:1px solid var(--abk-border);
|
|
84
|
+
padding:5px 8px;text-align:left;vertical-align:top;}
|
|
85
|
+
.${r} .abk-cal-table th{background:var(--abk-card);color:var(--abk-ink-2);font-weight:600;white-space:nowrap;}
|
|
86
|
+
.${r} .abk-cal-rec{background:color-mix(in srgb, var(--abk-st-good) 8%, transparent);}
|
|
87
|
+
.${r} .abk-cal-rec td{font-weight:600;}
|
|
88
|
+
.${r} .abk-cal-fpr-over{color:var(--abk-st-critical);font-weight:700;}
|
|
89
|
+
.${r} .abk-cal-fpr-ok{color:var(--abk-good-text);}
|
|
90
|
+
.${r} .abk-cal-failed td{color:var(--abk-muted);font-style:italic;}
|
|
91
|
+
.${r} .abk-cal-badge{display:inline-block;font-size:10px;padding:1px 6px;border-radius:6px;
|
|
92
|
+
background:var(--abk-st-good);color:var(--abk-card);margin-left:6px;font-weight:700;letter-spacing:0.02em;}
|
|
93
|
+
.${r} .abk-cal-verdict{max-width:360px;white-space:normal;}
|
|
94
|
+
.${r} .abk-cal-rationale{font-size:11px;color:var(--abk-ink-2);margin-top:2px;font-style:normal;}
|
|
95
|
+
/* metric sections ------------------------------------------------------------ */
|
|
96
|
+
.${r} .abk-metric{margin:26px 0;}
|
|
97
|
+
.${r} .abk-metric-name-row{display:flex;align-items:baseline;gap:10px;}
|
|
98
|
+
.${r} .abk-metric-name{font-size:16px;font-weight:700;margin:0;}
|
|
99
|
+
.${r} .abk-badge{font-size:10px;font-family:var(--abk-mono);text-transform:uppercase;
|
|
100
|
+
letter-spacing:0.06em;padding:2px 7px;border-radius:8px;border:1px solid var(--abk-border);color:var(--abk-ink-2);}
|
|
101
|
+
.${r} .abk-badge-main{border-color:var(--abk-series-1);color:var(--abk-series-1);}
|
|
102
|
+
.${r} .abk-badge-guardrail{border-color:var(--abk-st-serious);color:var(--abk-st-serious);}
|
|
103
|
+
.${r} .abk-metric-desc{margin:4px 0 0;font-size:12.5px;color:var(--abk-ink-2);max-width:760px;}
|
|
104
|
+
.${r} .abk-method{margin-top:4px;font-size:11.5px;color:var(--abk-muted);font-family:var(--abk-mono);
|
|
105
|
+
overflow-wrap:anywhere;}
|
|
106
|
+
.${r} .abk-pair{margin:12px 0 20px;}
|
|
107
|
+
.${r} .abk-pair-title{font-size:13px;font-weight:600;margin:10px 0 6px;color:var(--abk-ink-2);
|
|
108
|
+
font-family:var(--abk-mono);}
|
|
109
|
+
/* charts ---------------------------------------------------------------------- */
|
|
110
|
+
.${r} .abk-chart{position:relative;width:100%;background:var(--abk-chart-bg);
|
|
111
|
+
border:1px solid var(--abk-chart-border);border-radius:12px;overflow:hidden;}
|
|
112
|
+
.${r} .abk-chart canvas{width:100%;height:100%;display:block;}
|
|
113
|
+
.${r} .abk-chart-main{height:340px;margin-top:8px;}
|
|
114
|
+
.${r} .abk-chart-mini{height:150px;}
|
|
115
|
+
.${r} .abk-chart-fallback{color:var(--abk-chart-ink);font-size:12px;padding:20px;
|
|
116
|
+
font-family:var(--abk-mono);}
|
|
117
|
+
.${r} .abk-readout{min-height:20px;margin-top:6px;font-size:11px;color:var(--abk-ink-2);
|
|
118
|
+
font-family:var(--abk-mono);display:flex;flex-wrap:wrap;gap:4px 14px;align-items:center;}
|
|
119
|
+
.${r} .abk-ro-t{font-weight:700;color:var(--abk-ink);}
|
|
120
|
+
.${r} .abk-ro-flag{color:var(--abk-muted);}
|
|
121
|
+
.${r} .abk-readout .abk-insufficient{color:var(--abk-ink);
|
|
122
|
+
background:color-mix(in srgb, var(--abk-muted) 16%, transparent);
|
|
123
|
+
border-radius:6px;padding:2px 6px;}
|
|
124
|
+
/* small multiples -------------------------------------------------------------- */
|
|
125
|
+
.${r} .abk-minis{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
|
|
126
|
+
gap:10px;margin-top:10px;}
|
|
127
|
+
.${r} .abk-mini-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-bottom:4px;}
|
|
128
|
+
.${r} .abk-mini-title{font-size:11px;font-weight:600;color:var(--abk-muted);
|
|
129
|
+
font-family:var(--abk-mono);letter-spacing:0.06em;}
|
|
130
|
+
.${r} .abk-legend-item{display:inline-flex;align-items:center;gap:5px;font-size:11px;
|
|
131
|
+
color:var(--abk-ink-2);font-family:var(--abk-mono);}
|
|
132
|
+
.${r} .abk-swatch{width:10px;height:10px;border-radius:2px;display:inline-block;}
|
|
133
|
+
.${r} .abk-mini-note{font-size:10.5px;color:var(--abk-muted);font-family:var(--abk-mono);
|
|
134
|
+
margin-bottom:4px;}
|
|
135
|
+
/* audit table -------------------------------------------------------------------- */
|
|
136
|
+
.${r} .abk-audit{margin-top:10px;}
|
|
137
|
+
.${r} .abk-audit summary{font-size:12px;color:var(--abk-ink-2);cursor:pointer;
|
|
138
|
+
font-family:var(--abk-mono);}
|
|
139
|
+
.${r} .abk-audit-scroll{overflow-x:auto;margin-top:8px;}
|
|
140
|
+
.${r} .abk-audit table{border-collapse:collapse;font-size:11.5px;font-family:var(--abk-mono);
|
|
141
|
+
min-width:720px;font-variant-numeric:tabular-nums;}
|
|
142
|
+
.${r} .abk-audit th{text-align:left;color:var(--abk-muted);font-weight:600;
|
|
143
|
+
border-bottom:1px solid var(--abk-border);padding:4px 10px 4px 0;white-space:nowrap;}
|
|
144
|
+
.${r} .abk-audit td{border-bottom:1px solid var(--abk-border);padding:4px 10px 4px 0;
|
|
145
|
+
white-space:nowrap;color:var(--abk-ink-2);}
|
|
146
|
+
.${r} .abk-audit tr.abk-insufficient td{color:var(--abk-muted);
|
|
147
|
+
background:color-mix(in srgb, var(--abk-muted) 8%, transparent);}
|
|
148
|
+
/* empty states --------------------------------------------------------------------- */
|
|
149
|
+
.${r} .abk-empty{font-size:13px;color:var(--abk-ink-2);background:var(--abk-card);
|
|
150
|
+
border:1px dashed var(--abk-border);border-radius:10px;padding:14px;}
|
|
151
|
+
`,t=document.createElement("style");t.setAttribute("data-abk-report",""),t.textContent=n,document.head.appendChild(t)}window.__ABK_REPORT__={render:Ee};})();
|