ab-analysis-kit 0.1.2__tar.gz → 0.3.0__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.
Files changed (171) hide show
  1. {ab_analysis_kit-0.1.2/ab_analysis_kit.egg-info → ab_analysis_kit-0.3.0}/PKG-INFO +11 -8
  2. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/README.md +10 -7
  3. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0/ab_analysis_kit.egg-info}/PKG-INFO +11 -8
  4. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/ab_analysis_kit.egg-info/SOURCES.txt +5 -1
  5. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/__init__.py +1 -1
  6. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/cli.md +15 -4
  7. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/experiments.md +17 -3
  8. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/explore.md +5 -0
  9. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/metrics.md +10 -5
  10. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/overview.md +8 -4
  11. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/plan.md +5 -2
  12. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/validate.md +22 -7
  13. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-explore/SKILL.md +6 -0
  14. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-new-metric/SKILL.md +6 -2
  15. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-plan/SKILL.md +6 -3
  16. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-setup-project/SKILL.md +5 -3
  17. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-validate/SKILL.md +12 -5
  18. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/explore.py +27 -2
  19. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/init.py +12 -3
  20. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/plan.py +70 -18
  21. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/run.py +12 -0
  22. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/validate.py +47 -7
  23. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/main.py +43 -5
  24. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/compute/recompute_backend.py +21 -2
  25. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/__init__.py +2 -0
  26. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/experiment_config.py +72 -0
  27. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/project_config.py +3 -1
  28. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/validator.py +24 -0
  29. ab_analysis_kit-0.3.0/abkit/core/exposure_counting.py +95 -0
  30. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_exposures.py +95 -53
  31. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/tables.py +12 -7
  32. ab_analysis_kit-0.3.0/abkit/loaders/__init__.py +47 -0
  33. ab_analysis_kit-0.3.0/abkit/loaders/exposure_copy.py +300 -0
  34. ab_analysis_kit-0.3.0/abkit/loaders/exposure_loader.py +96 -0
  35. ab_analysis_kit-0.3.0/abkit/loaders/exposure_source.py +290 -0
  36. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/loaders/query_template.py +53 -0
  37. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/loaders/templates/abkit_assignment.jinja +11 -6
  38. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/pipeline/_types.py +4 -0
  39. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/pipeline/driver.py +95 -30
  40. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/planning/__init__.py +1 -1
  41. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/planning/sizing.py +1 -1
  42. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/reporting/builder.py +39 -2
  43. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/base.py +150 -1
  44. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/bootstrap.py +14 -7
  45. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/ci.py +10 -2
  46. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/paired_bootstrap.py +5 -5
  47. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/poisson_bootstrap.py +10 -10
  48. ab_analysis_kit-0.3.0/abkit/stats/effects.py +355 -0
  49. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/cuped_ttest.py +77 -13
  50. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/paired_cuped_ttest.py +3 -12
  51. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/paired_ttest.py +68 -15
  52. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/ratio_delta.py +84 -15
  53. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/ttest.py +56 -13
  54. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/ztest.py +87 -15
  55. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/power.py +20 -2
  56. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/samples.py +18 -5
  57. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/sequential/confidence_sequence.py +77 -3
  58. ab_analysis_kit-0.3.0/abkit/tuning/assets/explore.js +177 -0
  59. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/server.py +10 -4
  60. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/family.py +453 -3
  61. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/inject.py +70 -0
  62. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/runner.py +86 -10
  63. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/scoring.py +543 -3
  64. ab_analysis_kit-0.3.0/abkit/validate/vector_resample.py +503 -0
  65. ab_analysis_kit-0.1.2/abkit/loaders/__init__.py +0 -28
  66. ab_analysis_kit-0.1.2/abkit/loaders/exposure_loader.py +0 -121
  67. ab_analysis_kit-0.1.2/abkit/stats/effects.py +0 -141
  68. ab_analysis_kit-0.1.2/abkit/tuning/assets/explore.js +0 -177
  69. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/LICENSE +0 -0
  70. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/MANIFEST.in +0 -0
  71. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/ab_analysis_kit.egg-info/dependency_links.txt +0 -0
  72. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/ab_analysis_kit.egg-info/entry_points.txt +0 -0
  73. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/ab_analysis_kit.egg-info/requires.txt +0 -0
  74. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/ab_analysis_kit.egg-info/top_level.txt +0 -0
  75. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/__init__.py +0 -0
  76. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/_output.py +0 -0
  77. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/CLAUDE.section.md +0 -0
  78. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/methods.md +0 -0
  79. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/rules/project.md +0 -0
  80. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-feedback/SKILL.md +0 -0
  81. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/assets/claude/skills/abk-new-experiment/SKILL.md +0 -0
  82. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/__init__.py +0 -0
  83. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/_context.py +0 -0
  84. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/clean.py +0 -0
  85. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/init_claude.py +0 -0
  86. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/test_report.py +0 -0
  87. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/cli/commands/unlock.py +0 -0
  88. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/compute/__init__.py +0 -0
  89. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/discovery.py +0 -0
  90. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/method_config.py +0 -0
  91. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/metric_config.py +0 -0
  92. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/config/profile.py +0 -0
  93. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/core/__init__.py +0 -0
  94. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/core/interval.py +0 -0
  95. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/core/models.py +0 -0
  96. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/core/period_planner.py +0 -0
  97. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/__init__.py +0 -0
  98. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/_sql_manager.py +0 -0
  99. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/clickhouse_manager.py +0 -0
  100. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/__init__.py +0 -0
  101. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_aa_runs.py +0 -0
  102. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_base.py +0 -0
  103. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_experiments.py +0 -0
  104. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_maintenance.py +0 -0
  105. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_results.py +0 -0
  106. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_schema.py +0 -0
  107. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_tasks.py +0 -0
  108. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/_unit_state.py +0 -0
  109. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/internal_tables/manager.py +0 -0
  110. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/manager.py +0 -0
  111. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/mysql_manager.py +0 -0
  112. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/database/postgres_manager.py +0 -0
  113. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/loaders/metric_loader.py +0 -0
  114. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/__init__.py +0 -0
  115. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/base.py +0 -0
  116. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/branding.py +0 -0
  117. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/email.py +0 -0
  118. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/factory.py +0 -0
  119. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/mattermost.py +0 -0
  120. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/mock.py +0 -0
  121. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/slack.py +0 -0
  122. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/telegram.py +0 -0
  123. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/notify/webhook.py +0 -0
  124. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/pipeline/__init__.py +0 -0
  125. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/pipeline/analyze.py +0 -0
  126. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/pipeline/enrich.py +0 -0
  127. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/pipeline/readout.py +0 -0
  128. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/reporting/__init__.py +0 -0
  129. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/reporting/assets/report.js +0 -0
  130. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/reporting/calibration.py +0 -0
  131. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/reporting/html_report.py +0 -0
  132. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/__init__.py +0 -0
  133. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/accumulate.py +0 -0
  134. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/__init__.py +0 -0
  135. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/applier.py +0 -0
  136. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/engine.py +0 -0
  137. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/paired_post_normed_bootstrap.py +0 -0
  138. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/bootstrap/post_normed_bootstrap.py +0 -0
  139. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/correction.py +0 -0
  140. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/exceptions.py +0 -0
  141. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/factory.py +0 -0
  142. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/parametric/__init__.py +0 -0
  143. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/registry.py +0 -0
  144. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/result.py +0 -0
  145. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/rng.py +0 -0
  146. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/sequential/__init__.py +0 -0
  147. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/sequential/apply.py +0 -0
  148. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/sequential/mixture.py +0 -0
  149. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/stats/srm.py +0 -0
  150. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/__init__.py +0 -0
  151. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/config_writer.py +0 -0
  152. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/html.py +0 -0
  153. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/payload.py +0 -0
  154. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/recompute.py +0 -0
  155. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/tuning/session.py +0 -0
  156. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/utils/__init__.py +0 -0
  157. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/utils/datetime_utils.py +0 -0
  158. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/utils/env_interpolation.py +0 -0
  159. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/utils/json_utils.py +0 -0
  160. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/__init__.py +0 -0
  161. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/_types.py +0 -0
  162. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/load.py +0 -0
  163. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/panel.py +0 -0
  164. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/persistence.py +0 -0
  165. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/resample.py +0 -0
  166. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/result.py +0 -0
  167. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/abkit/validate/run_id.py +0 -0
  168. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/pyproject.toml +0 -0
  169. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/requirements.txt +0 -0
  170. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/setup.cfg +0 -0
  171. {ab_analysis_kit-0.1.2 → ab_analysis_kit-0.3.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ab-analysis-kit
3
- Version: 0.1.2
3
+ Version: 0.3.0
4
4
  Summary: A/B experiment analysis as declarative YAML + SQL
5
5
  Author: ab-analysis-kit authors
6
6
  License: MIT
@@ -76,22 +76,25 @@ stabilization chart), writes them to a clean warehouse table any BI can read, an
76
76
  gives you a local cockpit to tune the analysis and a harness to prove your method is
77
77
  actually calibrated.
78
78
 
79
- > **Status: `0.1.0` (Alpha) — the first release, prepared** (milestones **M1–M6**). The
79
+ > **Status: `0.3.0` (Alpha) — release-ready; `0.2.0` is the latest on PyPI**
80
+ > (milestones **M1–M8** shipped — M8 adds the no-copy assignment default + the
81
+ > opt-in incremental `_ab_exposures` copy). The
80
82
  > statistical core, the declarative config / DB / pipeline layer, the explore cockpit +
81
- > self-contained reports, `abk validate`, opt-in sequential analysis + `abk plan`, and the
82
- > DX layer (`abk init-claude`, docs site, Prefect scaffolding) are all shipped. The tagged
83
- > PyPI publish is the maintainer's pending step. Docs: [abkit.pipelab.dev](https://abkit.pipelab.dev).
83
+ > self-contained reports, `abk validate` (now numpy-vectorized — minutes → sub-seconds),
84
+ > opt-in sequential analysis + `abk plan`, and the DX layer (`abk init-claude`, docs site,
85
+ > Prefect scaffolding) are all shipped. Docs: [abkit.pipelab.dev](https://abkit.pipelab.dev).
84
86
 
85
87
  ## Install
86
88
 
87
- Once `0.1.0` is published to PyPI (a maintainer tags `v0.1.0`; until then install from
88
- source — `pip install -e ".[dev]"`):
89
-
90
89
  ```bash
91
90
  pip install ab-analysis-kit # Python 3.10+; add a DB extra for real data:
92
91
  pip install "ab-analysis-kit[clickhouse]" # or [postgres] / [mysql] / [all-db]
93
92
  ```
94
93
 
94
+ (`0.3.0`'s M8 no-copy default lands with its tag; until then `pip install
95
+ ab-analysis-kit` gets `0.2.0` — for the M8 behavior install from source:
96
+ `pip install -e ".[dev]"`.)
97
+
95
98
  `abk --version` and `abk --help` work with no database driver; you can even lint a
96
99
  config (`abk run --steps validate`) with no database at all. See the
97
100
  [getting-started guide](https://abkit.pipelab.dev) for the full first run.
@@ -11,22 +11,25 @@ stabilization chart), writes them to a clean warehouse table any BI can read, an
11
11
  gives you a local cockpit to tune the analysis and a harness to prove your method is
12
12
  actually calibrated.
13
13
 
14
- > **Status: `0.1.0` (Alpha) — the first release, prepared** (milestones **M1–M6**). The
14
+ > **Status: `0.3.0` (Alpha) — release-ready; `0.2.0` is the latest on PyPI**
15
+ > (milestones **M1–M8** shipped — M8 adds the no-copy assignment default + the
16
+ > opt-in incremental `_ab_exposures` copy). The
15
17
  > statistical core, the declarative config / DB / pipeline layer, the explore cockpit +
16
- > self-contained reports, `abk validate`, opt-in sequential analysis + `abk plan`, and the
17
- > DX layer (`abk init-claude`, docs site, Prefect scaffolding) are all shipped. The tagged
18
- > PyPI publish is the maintainer's pending step. Docs: [abkit.pipelab.dev](https://abkit.pipelab.dev).
18
+ > self-contained reports, `abk validate` (now numpy-vectorized — minutes → sub-seconds),
19
+ > opt-in sequential analysis + `abk plan`, and the DX layer (`abk init-claude`, docs site,
20
+ > Prefect scaffolding) are all shipped. Docs: [abkit.pipelab.dev](https://abkit.pipelab.dev).
19
21
 
20
22
  ## Install
21
23
 
22
- Once `0.1.0` is published to PyPI (a maintainer tags `v0.1.0`; until then install from
23
- source — `pip install -e ".[dev]"`):
24
-
25
24
  ```bash
26
25
  pip install ab-analysis-kit # Python 3.10+; add a DB extra for real data:
27
26
  pip install "ab-analysis-kit[clickhouse]" # or [postgres] / [mysql] / [all-db]
28
27
  ```
29
28
 
29
+ (`0.3.0`'s M8 no-copy default lands with its tag; until then `pip install
30
+ ab-analysis-kit` gets `0.2.0` — for the M8 behavior install from source:
31
+ `pip install -e ".[dev]"`.)
32
+
30
33
  `abk --version` and `abk --help` work with no database driver; you can even lint a
31
34
  config (`abk run --steps validate`) with no database at all. See the
32
35
  [getting-started guide](https://abkit.pipelab.dev) for the full first run.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ab-analysis-kit
3
- Version: 0.1.2
3
+ Version: 0.3.0
4
4
  Summary: A/B experiment analysis as declarative YAML + SQL
5
5
  Author: ab-analysis-kit authors
6
6
  License: MIT
@@ -76,22 +76,25 @@ stabilization chart), writes them to a clean warehouse table any BI can read, an
76
76
  gives you a local cockpit to tune the analysis and a harness to prove your method is
77
77
  actually calibrated.
78
78
 
79
- > **Status: `0.1.0` (Alpha) — the first release, prepared** (milestones **M1–M6**). The
79
+ > **Status: `0.3.0` (Alpha) — release-ready; `0.2.0` is the latest on PyPI**
80
+ > (milestones **M1–M8** shipped — M8 adds the no-copy assignment default + the
81
+ > opt-in incremental `_ab_exposures` copy). The
80
82
  > statistical core, the declarative config / DB / pipeline layer, the explore cockpit +
81
- > self-contained reports, `abk validate`, opt-in sequential analysis + `abk plan`, and the
82
- > DX layer (`abk init-claude`, docs site, Prefect scaffolding) are all shipped. The tagged
83
- > PyPI publish is the maintainer's pending step. Docs: [abkit.pipelab.dev](https://abkit.pipelab.dev).
83
+ > self-contained reports, `abk validate` (now numpy-vectorized — minutes → sub-seconds),
84
+ > opt-in sequential analysis + `abk plan`, and the DX layer (`abk init-claude`, docs site,
85
+ > Prefect scaffolding) are all shipped. Docs: [abkit.pipelab.dev](https://abkit.pipelab.dev).
84
86
 
85
87
  ## Install
86
88
 
87
- Once `0.1.0` is published to PyPI (a maintainer tags `v0.1.0`; until then install from
88
- source — `pip install -e ".[dev]"`):
89
-
90
89
  ```bash
91
90
  pip install ab-analysis-kit # Python 3.10+; add a DB extra for real data:
92
91
  pip install "ab-analysis-kit[clickhouse]" # or [postgres] / [mysql] / [all-db]
93
92
  ```
94
93
 
94
+ (`0.3.0`'s M8 no-copy default lands with its tag; until then `pip install
95
+ ab-analysis-kit` gets `0.2.0` — for the M8 behavior install from source:
96
+ `pip install -e ".[dev]"`.)
97
+
95
98
  `abk --version` and `abk --help` work with no database driver; you can even lint a
96
99
  config (`abk run --steps validate`) with no database at all. See the
97
100
  [getting-started guide](https://abkit.pipelab.dev) for the full first run.
@@ -53,6 +53,7 @@ abkit/config/profile.py
53
53
  abkit/config/project_config.py
54
54
  abkit/config/validator.py
55
55
  abkit/core/__init__.py
56
+ abkit/core/exposure_counting.py
56
57
  abkit/core/interval.py
57
58
  abkit/core/models.py
58
59
  abkit/core/period_planner.py
@@ -75,7 +76,9 @@ abkit/database/internal_tables/_tasks.py
75
76
  abkit/database/internal_tables/_unit_state.py
76
77
  abkit/database/internal_tables/manager.py
77
78
  abkit/loaders/__init__.py
79
+ abkit/loaders/exposure_copy.py
78
80
  abkit/loaders/exposure_loader.py
81
+ abkit/loaders/exposure_source.py
79
82
  abkit/loaders/metric_loader.py
80
83
  abkit/loaders/query_template.py
81
84
  abkit/loaders/templates/abkit_assignment.jinja
@@ -158,4 +161,5 @@ abkit/validate/resample.py
158
161
  abkit/validate/result.py
159
162
  abkit/validate/run_id.py
160
163
  abkit/validate/runner.py
161
- abkit/validate/scoring.py
164
+ abkit/validate/scoring.py
165
+ abkit/validate/vector_resample.py
@@ -10,7 +10,7 @@ from __future__ import annotations
10
10
 
11
11
  from typing import Any
12
12
 
13
- __version__ = "0.1.2"
13
+ __version__ = "0.3.0"
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.
@@ -70,7 +70,7 @@ to refresh this context.
70
70
 
71
71
  ```bash
72
72
  abk run [--select <exp>] [--exclude <sel>] [--steps validate,plan,load,compute] \
73
- [--from TS] [--to TS] [--full-refresh] [--workers N] \
73
+ [--from TS] [--to TS] [--full-refresh] [--resync-cohort] [--workers N] \
74
74
  [--report [PATH]] [--force] [--profile NAME]
75
75
  ```
76
76
 
@@ -88,6 +88,12 @@ are (re)computed, so re-running is idempotent.
88
88
  use with `--full-refresh`.
89
89
  - `--full-refresh` — re-open already-computed cutoffs in `[--from, --to)` and
90
90
  recompute them. Use after changing a metric query or a method param.
91
+ - `--resync-cohort` — copy mode only (`assignment.cohort_copy.enabled: true`):
92
+ delete the persisted `_ab_exposures` copy and rebuild it from the experiment
93
+ start through the same incremental engine — the recovery for late-arriving/
94
+ corrected assignment rows the watermark cannot heal. A documented no-op in
95
+ the direct (no-copy) default. Distinct from `--full-refresh` (results-window
96
+ recompute) — the two never overload each other.
91
97
  - `--workers N` (default 1) — worker threads across experiments (each gets its own
92
98
  DB connection).
93
99
  - `--report [PATH]` — after the run, emit a self-contained HTML readout per
@@ -124,8 +130,8 @@ re-run `abk run` afterward to recompute under the new config. Full reference:
124
130
 
125
131
  ```bash
126
132
  abk validate [--select <exp>] [--method <m>]... [--metric <m>] [--iterations N] \
127
- [--inject-effect PCT] [--scoring fpr|power|mde] [--report [PATH]] \
128
- [--force] [--profile NAME]
133
+ [--family-sweep] [--inject-effect PCT] [--scoring fpr|power|mde] \
134
+ [--report [PATH]] [--force] [--profile NAME]
129
135
  ```
130
136
 
131
137
  The A/A false-positive + power **matrix** — placebo label-permutation splits on
@@ -140,7 +146,12 @@ calibration chip.
140
146
  - `--method / -m` (repeatable) — score EXTRA registered methods beyond the declared
141
147
  comparison (the method-grid axis; see the selector model above).
142
148
  - `--metric` — validate only this metric (default: every declared comparison).
143
- - `--iterations / -n` (default 2000) — placebo A/A splits per cell.
149
+ - `--iterations / -n` — placebo A/A splits per cell (default: auto,
150
+ `max(2000, ⌈200/α⌉)` at each cell's effective alpha; an explicit N overrides
151
+ every cell).
152
+ - `--family-sweep` — also run the composed multi-metric FWER/FDR sweep (D9);
153
+ roughly doubles the cost. Opt-in since 0.2.0 (it used to auto-run whenever
154
+ `--metric` was omitted).
144
155
  - `--inject-effect PCT` — inject a relative effect (e.g. `0.05`) to measure
145
156
  power / achieved MDE / coverage.
146
157
  - `--scoring fpr|power|mde` (default `fpr`) — the objective for the "Recommended"
@@ -31,6 +31,11 @@ assignment: # READ-ONLY exposure source — abkit never ran
31
31
  added_filters: "" # optional extra SQL fragment (must start with AND)
32
32
  variants: [control, treatment] # FIRST is control (name_1); >= 2, unique
33
33
  expected_split: {control: 0.5, treatment: 0.5} # must cover every variant, sum to 1.0; drives SRM
34
+ # cohort_copy: # opt-in (default OFF): persist an incremental,
35
+ # enabled: true # append-only _ab_exposures copy instead of
36
+ # update_column: exposure_ts # re-reading the live source every invocation
37
+ # batch_interval: 1d # (grid-anchored closed-interval batches;
38
+ # maturity_delay: 0 # batch_intervals_per_round_trip: 30 — intervals, not rows)
34
39
 
35
40
  alpha: 0.05 # experiment-level significance (unset -> project default)
36
41
  correction: bonferroni # none | bonferroni | benjamini_hochberg (unset -> project default)
@@ -68,9 +73,18 @@ comparisons: # required — each binds one library metric to
68
73
  line and no verdict is trusted. Check SRM before believing any effect; fix the
69
74
  assignment query or randomization first.
70
75
  - The assignment SQL is a **read-only** source: it SELECTs `unit_key`, `variant`,
71
- and an exposure timestamp — abkit persists it once per run into `_ab_exposures`
72
- and never randomizes. Use `added_filters` (must start with `AND`) as the only
73
- escape hatch for extra WHERE conditions.
76
+ and an exposure timestamp — abkit never randomizes. By default
77
+ (`assignment.cohort_copy` unset) nothing is persisted: every
78
+ `abk run`/`plan`/`validate`/`explore` invocation re-renders and validates the
79
+ assignment SQL live and metric queries join a deduping subquery over it (the
80
+ no-copy cost/freshness tradeoff — never a stale row, at a render+validate
81
+ query each time). Set `assignment.cohort_copy.enabled: true` to persist an
82
+ append-only incremental copy into `_ab_exposures` instead (worth it for a
83
+ heavy multi-join or a mutating source; in copy mode the assignment SQL must
84
+ reference `{{ ab_added_filters }}` — the copy engine injects batch bounds
85
+ through it, and `abk run --resync-cohort` rebuilds a poisoned copy). Use
86
+ `added_filters` (must start with `AND`) as the only escape hatch for extra
87
+ WHERE conditions.
74
88
 
75
89
  ## Cumulative window, cadence & data_lag
76
90
 
@@ -23,6 +23,11 @@ name a configured **comparison** of that experiment (default: the main metric).
23
23
  — it never runs the pipeline, takes **no pipeline lock**, and never writes to
24
24
  the warehouse. Run `abk run --select <exp>` **first**: no computed rows ⇒ a
25
25
  friendly noop telling you to run first.
26
+ - **A broken live assignment source blocks the cockpit too** (M8): at
27
+ session-load explore resolves the cohort through the same
28
+ `build_cohort_backend` factory as `abk run` (the SRM chip's count source) —
29
+ in the default no-copy mode a source that empties or corrupts fails with a
30
+ clean, actionable error naming the fix, never a raw traceback.
26
31
  - Freshness is whatever the last `abk run` produced; the header shows the latest
27
32
  `end_ts` / watermark so staleness is visible. It is a **retuning** surface, not
28
33
  a live monitor.
@@ -82,15 +82,20 @@ live there once, so metric SQL describes only its own aggregation:
82
82
  {% import 'abkit_assignment.jinja' as ab %}
83
83
  ```
84
84
 
85
- - `{{ ab.exposed_units() }}` — `INNER JOIN`s the persisted `_ab_exposures`
86
- cohort (loaded once per run, deduped per dialect), and applies both the coarse
87
- `event_date` predicate and the precise half-open `event_time` window. Optional
88
- args override the fact-side column names: `ab.exposed_units('dt', 'ts')`.
85
+ - `{{ ab.exposed_units() }}` — `INNER JOIN`s the ONE `ab_cohort_source`
86
+ builtin: by default (`assignment.cohort_copy` unset) a live deduping subquery
87
+ over the rendered assignment SQL (re-validated every invocation); with
88
+ `cohort_copy.enabled: true` the persisted, append-only-copied `_ab_exposures`
89
+ table (`FINAL` on ClickHouse). Metric authors never choose between the two.
90
+ Either mode applies both the coarse `event_date` predicate and the precise
91
+ half-open `event_time` window. Optional args override the fact-side column
92
+ names: `ab.exposed_units('dt', 'ts')`.
89
93
  - `{{ ab.variant_col() }}` — the arm label from the cohort (project it `AS
90
94
  variant` and reference it in `columns.variant`).
91
95
  - `{{ ab.stratum_col() }}` — the stratum label, when stratifying.
92
96
 
93
- Config-lint asserts the rendered SQL joins `_ab_exposures`; a metric authored
97
+ Config-lint asserts the rendered SQL joins the cohort through the macro
98
+ (present identically in both cohort modes); a metric authored
94
99
  without the macro fails. Never hand-roll the assignment join or the window
95
100
  filter. `{{ data_database }}` is the data-location built-in on **every** dialect
96
101
  (on Postgres it resolves to the profile's `data_schema` value); there is no
@@ -25,9 +25,13 @@ pointing a **metric** (a separate reusable YAML + SQL) at a statistical
25
25
 
26
26
  Every `abk run` executes three stages per experiment:
27
27
 
28
- 1. **load** — persists the assignment cohort ONCE into `_ab_exposures`, then runs
29
- each metric's SQL against the source DB over the cumulative window (the macro
30
- joins the cohort). One row per unit in, additive aggregates out.
28
+ 1. **load** — resolves the assignment cohort once per run: by default
29
+ (`assignment.cohort_copy.enabled: false`) the assignment SQL is re-rendered
30
+ and validated live and nothing is persisted; with `cohort_copy.enabled:
31
+ true` an append-only, watermark-resumed incremental copy lands in
32
+ `_ab_exposures`. Then each metric's SQL runs against the source DB over the
33
+ cumulative window (the macro joins the cohort either way). One row per unit
34
+ in, additive aggregates out.
31
35
  2. **compute** — runs the configured statistical method (t/z-test, CUPED,
32
36
  ratio-delta, bootstrap) at each planned cutoff, gates SRM, and writes rows to
33
37
  `_ab_results` (the BI contract). Idempotent: already-computed cutoffs are
@@ -64,7 +68,7 @@ profile's `internal_database` / `internal_schema`, separate from the
64
68
  | Table | Holds |
65
69
  |---|---|
66
70
  | `_ab_results` | **The BI contract.** One row per `(experiment, metric, variant-pair, method_config_id, end_ts)` cumulative cutoff: effect, CI, p-value, per-arm stats, SRM flag, `insufficient_data`, `ci_kind`, `is_horizon`. Point BI here. |
67
- | `_ab_exposures` | The persisted assignment cohort (unit → variant → exposure_ts), loaded once per run; joined by every metric query and the SRM count source. |
71
+ | `_ab_exposures` | **Optional** — the persisted assignment cohort copy (unit → variant → exposure_ts), created/written only when `assignment.cohort_copy.enabled: true` (an append-only incremental copy; a routine run never deletes — `--resync-cohort` is the one exception). On the default no-copy path the table does not exist: metric queries and the SRM counts read the live assignment source instead. |
68
72
  | `_ab_experiments` | Informational experiment catalog (descriptions, variants, split, alpha, cadence, tags) for BI joins; the pipeline never reads it back for decisions. |
69
73
  | `_ab_aa_runs` | The `abk validate` A/A audit trail (per-cell FPR/power at the effective alpha); lights the explore calibration chip. Never pruned by `abk clean`. |
70
74
  | `_ab_tasks` | Pipeline run/lock bookkeeping — the atomic per-experiment lock (`abk unlock` clears a stale one). |
@@ -46,7 +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
+ | `--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 the cohort source — the persisted `_ab_exposures` copy under `assignment.cohort_copy.enabled`, otherwise (the default) a fresh snapshot of the live assignment source re-executed at invocation time (the documented no-copy cost/freshness tradeoff); without arrival data both are skipped. Must be `> 0`. |
50
50
  | `--profile` | Profile name (default: `profiles.yml` `default_profile`). |
51
51
 
52
52
  ## What it refuses (honest, never invented math)
@@ -91,7 +91,10 @@ the false-positive rate (enable sequential or coarsen the cadence).
91
91
 
92
92
  The footer look-count + cost-shape line is the pre-launch timing/cost companion.
93
93
  **Runtime and ASN** ship too: given a **unit-arrival rate** — derived read-only from
94
- `_ab_exposures` (distinct units per observed day, whole-cohort window, split to the
94
+ the cohort source (the persisted `_ab_exposures` copy under
95
+ `assignment.cohort_copy.enabled: true`, otherwise a live re-render + re-validation
96
+ of the assignment SQL at invocation time — the default no-copy cost/freshness
97
+ tradeoff; distinct units per observed day, whole-cohort window, split to the
95
98
  control arm) or supplied with `--arrival-rate <units/day>` — each sizable comparison
96
99
  also reports **runtime** (`days-to-required-N = required_n / rate` plus the horizon
97
100
  length) and, for a `sequential.enabled`, sequential-eligible comparison, the **ASN**
@@ -28,7 +28,9 @@ shuffle is in-memory only; it never touches the real assignment.
28
28
  labels destroys any true treatment effect → an **exact null** by construction (the
29
29
  standard permutation-A/A), while still exercising the real grid, cadence, cohort,
30
30
  and metric SQL.
31
- 3. **A/A (false-positive):** repeat N times (default 2000); each split runs the
31
+ 3. **A/A (false-positive):** repeat N times (default since 0.2.0: auto per cell,
32
+ `max(2000, ⌈200/α⌉)` at the cell's effective alpha — ≈4000 at 5%, ≈40000 at
33
+ 0.5%; `-n` overrides every cell, auto-N >100k warns but never caps); each split runs the
32
34
  candidate method(s) and records whether it *falsely* rejects H₀ at the effective
33
35
  α. **FPR** = share of placebo runs that flagged significance. The significance
34
36
  primitive is the readout's own **CI-excludes-zero** rule, not the raw `reject`
@@ -87,6 +89,9 @@ metrics under one shared assignment, corrected by two-tier Bonferroni (compute-t
87
89
  error rate** (any false rejection across the family) and **false-discovery rate**
88
90
  (mean false fraction among rejections) over one shared union-cohort placebo
89
91
  assignment per iteration, under the *same* composed rule the readout applies.
92
+ **Opt-in since 0.2.0 via `--family-sweep`** (it roughly doubles the run; before
93
+ 0.2.0 it always ran when `--metric` was omitted — a bare multi-metric run now
94
+ prints a one-release notice instead).
90
95
 
91
96
  On the complete null the two coincide (every rejection is false) and sit at the
92
97
  composed rule's **nominal rate** — ≈ α *per tier*, so ≈ 2α whole-family under the
@@ -104,7 +109,8 @@ family level. (Only `alpha_spending`/group-sequential stays a future item.)
104
109
 
105
110
  ```bash
106
111
  abk validate --select <exp> [--method <m>]... [--metric <m>] [--iterations N] \
107
- [--inject-effect <rel>] [--scoring fpr|power|mde] [--report] [--force] [--profile]
112
+ [--family-sweep] [--inject-effect <rel>] [--scoring fpr|power|mde] \
113
+ [--report] [--force] [--profile]
108
114
  ```
109
115
 
110
116
  | Flag | Meaning |
@@ -112,7 +118,8 @@ abk validate --select <exp> [--method <m>]... [--metric <m>] [--iterations N] \
112
118
  | `--select`, `-s` | Experiment selector (name / glob / `tag:<tag>` / `*`; repeatable, default all). |
113
119
  | `--method`, `-m` | **Extra** registered method(s) to score **beyond** the declared comparison — this is the method-grid axis (repeatable). NOT `--select`. |
114
120
  | `--metric` | Validate only this metric (default: every declared comparison). |
115
- | `--iterations`, `-n` | Placebo A/A splits per cell (default 2000). More = tighter FPR estimate, more cost. |
121
+ | `--iterations`, `-n` | Placebo A/A splits per cell (default: auto, `max(2000, ⌈200/α⌉)` per cell's effective alpha). An explicit N overrides every cell. |
122
+ | `--family-sweep` | Also run the composed multi-metric FWER/FDR sweep (D9) — roughly doubles the cost. Opt-in since 0.2.0. |
116
123
  | `--inject-effect` | Inject this **relative** effect (e.g. `0.05`) to measure power / achieved MDE / coverage. |
117
124
  | `--scoring` | `fpr` (default) / `power` / `mde` — the objective for the **"Recommended" row only**. All columns are always computed regardless. |
118
125
  | `--report` | Emit a self-contained HTML matrix report (best-effort). Bare → `reports/<exp>__validate.html`; a dir or `.html` path overrides. |
@@ -123,8 +130,13 @@ abk validate --select <exp> [--method <m>]... [--metric <m>] [--iterations N] \
123
130
  serialize behind nightly runs.
124
131
  - **Exits non-zero** on any cell/harness failure; `--report` is the one best-effort
125
132
  exception (a bake failure yellow-skips, never fails validation).
126
- - Reads the experiment's persisted cohort — run `abk run --select <exp>` at least
127
- once first so there is data to resample.
133
+ - Resolves the cohort itself via `build_cohort_backend` each invocation — in the
134
+ default no-copy mode it renders and validates the LIVE assignment source
135
+ directly (no prior `abk run` needed for the cohort); with
136
+ `assignment.cohort_copy.enabled: true` it reads the persisted,
137
+ incrementally-copied `_ab_exposures` table, so a prior copy-mode run must have
138
+ populated it. Either way the metric event data must already exist in the
139
+ source DB.
128
140
 
129
141
  ## Reading the matrix — the three classic failures
130
142
 
@@ -210,8 +222,11 @@ A/A is the expensive corner**. So:
210
222
  - **Not a config lint.** `abk validate` = the A/A statistical matrix; `abk run
211
223
  --steps validate` = the config/schema/SQL gate. Different purpose, different lock,
212
224
  different stage names — never conflate.
213
- - **Run the pipeline first.** validate resamples the experiment's persisted cohort —
214
- `abk run --select <exp>` must have persisted data or there is nothing to split.
225
+ - **The cohort is resolved live, not read from a prior run.** In the no-copy
226
+ default validate re-renders/validates the live assignment source itself, so
227
+ `abk run` is not a prerequisite for the cohort (the metric event data must
228
+ still exist). Only in copy mode (`assignment.cohort_copy.enabled: true`) does
229
+ it read what previous runs copied into `_ab_exposures`.
215
230
  - **Peeking FPR is the hazard, not the verdict.** It deliberately measures the
216
231
  optional-stopping trap the readout's stabilization rule defends against; a high
217
232
  peeking FPR on a low single-look FPR means "enable `sequential`", not "the method
@@ -40,6 +40,12 @@ need an experiment that has run at least once:
40
40
  - **A project root** contains `abkit_project.yml` and `profiles.yml`. If
41
41
  `profiles.yml` is still the `abk init` placeholder, set up the DB first with
42
42
  **`abk-setup-project`**.
43
+ - **A broken assignment source blocks the cockpit too** (M8): at session-load
44
+ explore re-validates the live assignment SQL (the SRM chip's count source,
45
+ same `build_cohort_backend` factory as `abk run`); a validation failure
46
+ raises a clean error naming the fix — repair the assignment SQL, or set
47
+ `assignment.cohort_copy.enabled: true` to explore the last persisted cohort
48
+ instead of the live source.
43
49
  - **No experiment or metric yet?** Hand off to **`abk-new-experiment`** (and
44
50
  **`abk-new-metric`**) to design the config first — never fabricate YAML/SQL here.
45
51
  - **Compute a series** (more cutoffs ⇒ a richer stabilization curve):
@@ -86,8 +86,12 @@ hand-roll the assignment join.
86
86
  {% import 'abkit_assignment.jinja' as ab %}
87
87
  ```
88
88
 
89
- - `{{ ab.exposed_units() }}` — `INNER JOIN`s the persisted `_ab_exposures`
90
- cohort and applies the window + exposure filters and dedup. Override fact-side
89
+ - `{{ ab.exposed_units() }}` — `INNER JOIN`s the assignment cohort through the
90
+ `ab_cohort_source` builtin and applies the window + exposure filters and
91
+ dedup. By default (no `cohort_copy`) that is a live deduping subquery over
92
+ the assignment SQL — no `_ab_exposures` table involved; with
93
+ `assignment.cohort_copy.enabled: true` it joins the persisted copy instead.
94
+ Metric authors never choose between the two. Override fact-side
91
95
  column names with args if needed: `ab.exposed_units('dt', 'ts')`.
92
96
  - `{{ ab.variant_col() }}` — the arm label (project it `AS variant`).
93
97
  - `{{ ab.stratum_col() }}` — the stratum label, only when stratifying.
@@ -59,7 +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
+ | `--arrival-rate` | Total units/day across arms, for the runtime (days-to-N) + always-valid ASN estimates (default: derived read-only from the cohort source — the persisted `_ab_exposures` copy in copy mode, otherwise a fresh re-execution of the live assignment SQL at invocation time; must be `> 0`) |
63
63
  | `--profile` | Profile name (default: `profiles.yml` `default_profile`) |
64
64
 
65
65
  `--mde` and `--alpha` are in the comparison's own units: a `relative` test type reads
@@ -144,8 +144,11 @@ this; tell the user the true requirement is lower.
144
144
 
145
145
  `abk plan` is planning-only. Sizing (required-N / MDE / power) is the core; **runtime /
146
146
  ASN** ship alongside it. If the user asks "how long", `abk plan` reports **runtime**
147
- (days-to-required-N) from a unit-arrival rate — derived read-only from `_ab_exposures`
148
- or supplied with `--arrival-rate <units/day>` — and, for a `sequential.enabled`,
147
+ (days-to-required-N) from a unit-arrival rate — derived read-only by re-executing
148
+ the cohort source at invocation time (the live assignment SQL in the default
149
+ no-copy mode — the documented cost/freshness tradeoff — or the persisted
150
+ `_ab_exposures` copy in copy mode) or supplied with `--arrival-rate <units/day>` —
151
+ and, for a `sequential.enabled`,
149
152
  sequential-eligible comparison, the **ASN** (the always-valid design's average sample
150
153
  number: expected stopping N under H1/H0, horizon-capped). Without an arrival rate both
151
154
  are SKIPPED with a reason (never invented); a fixed-horizon/resampling design shows
@@ -83,9 +83,11 @@ profile already models this pattern.
83
83
  Point **both** at the user's real databases (the placeholder ships examples):
84
84
 
85
85
  - `internal_database` — a dedicated database for abkit's own `_ab_*` tables
86
- (`_ab_results`, `_ab_exposures`, `_ab_tasks`, `_ab_aa_runs`), created
87
- automatically on first run. Keep it **separate** from analytics data, e.g.
88
- `abkit_internal`.
86
+ (`_ab_results`, `_ab_tasks`, `_ab_aa_runs`), created automatically on first
87
+ run. `_ab_exposures` is created there too, but only when the experiment sets
88
+ `assignment.cohort_copy.enabled: true` — the (default) no-copy mode never
89
+ writes it; metric SQL joins the live assignment source instead. Keep it
90
+ **separate** from analytics data, e.g. `abkit_internal`.
89
91
  - `data_database` — where the source/fact tables your metric queries read from
90
92
  live (and where the seed dataset loads).
91
93
 
@@ -36,14 +36,20 @@ schema, the sequential/composed columns, budget-band resolution).
36
36
  - A project root has `abkit_project.yml`; `profiles.yml` must point at the real
37
37
  warehouse (if it's still the `abk init` placeholder, use **`abk-setup-project`**
38
38
  first).
39
- - **The pipeline must have run at least once.** validate resamples the
40
- experiment's **persisted** cohort — if nothing is loaded there is nothing to
41
- split. Run `abk run --select <exp>` first if needed.
39
+ - **In the (default) no-copy mode no prior `abk run` is required** — validate
40
+ re-renders and validates the live assignment source itself (the same
41
+ `build_cohort_backend` factory every command uses) and splits it in memory;
42
+ an empty/not-yet-launched cohort fails loudly with a reason. Only in copy
43
+ mode (`assignment.cohort_copy.enabled: true`) does validate read the
44
+ persisted `_ab_exposures` copy, so `abk run --select <exp>` must have
45
+ populated it first. The metric event data must exist in the source DB either
46
+ way.
42
47
 
43
48
  ## Step 1 — Run validate
44
49
 
45
50
  ```bash
46
- abk validate --select <exp> # every declared comparison, default 2000 splits
51
+ abk validate --select <exp> # every declared comparison, auto N = max(2000, ceil(200/alpha)) per cell
52
+ abk validate --select <exp> --family-sweep # + the composed multi-metric FWER/FDR sweep (opt-in since 0.2.0)
47
53
  abk validate --select <exp> --metric <m> # one metric only
48
54
  abk validate --select <exp> --method z-test # score an EXTRA method beyond the declared one
49
55
  abk validate --select <exp> --iterations 500 # quick look (looser FPR estimate)
@@ -55,7 +61,8 @@ abk validate --select <exp> --inject-effect 0.05 # also measure power / achi
55
61
  | `--select`, `-s` | Experiment selector (name / glob / `tag:<tag>` / `*`; repeatable, default all). |
56
62
  | `--method`, `-m` | **Extra** registered method(s) to score **beyond** the declared comparison — the method-grid axis (repeatable). Not a selector. |
57
63
  | `--metric` | Validate only this metric (default: every declared comparison). |
58
- | `--iterations`, `-n` | Placebo A/A splits per cell (default 2000). More = tighter FPR, more cost. |
64
+ | `--iterations`, `-n` | Placebo A/A splits per cell (default: auto, `max(2000, ⌈200/α⌉)` at each cell's effective alpha). An explicit N overrides every cell. |
65
+ | `--family-sweep` | Also run the composed multi-metric FWER/FDR sweep — roughly doubles the cost. Opt-in since 0.2.0 (previously always ran when `--metric` was omitted). |
59
66
  | `--inject-effect` | Inject this **relative** effect (e.g. `0.05`) to measure power / achieved MDE / coverage. Without it, only FPR/peeking compute. |
60
67
  | `--scoring` | `fpr` (default) / `power` / `mde` — the objective for the **"Recommended" row only**. All columns compute regardless. |
61
68
  | `--report` | Emit a self-contained HTML matrix (best-effort). Bare → `reports/<exp>__validate.html`; a dir or `.html` path overrides. |
@@ -48,8 +48,9 @@ def run_explore(
48
48
  no_serve: bool,
49
49
  no_open: bool,
50
50
  ) -> None:
51
- from abkit.compute.recompute_backend import RecomputeBackend
51
+ from abkit.core.period_planner import generate_grid
52
52
  from abkit.database.internal_tables import InternalTablesManager
53
+ from abkit.loaders.exposure_source import ExposureLoadError, build_cohort_backend
53
54
  from abkit.reporting import build_report_payload
54
55
  from abkit.tuning import (
55
56
  RecomputeEngine,
@@ -133,7 +134,27 @@ def run_explore(
133
134
  metric_sql_by_name = {
134
135
  name: metrics_by_name[name].get_query_text(context.root) for name in configured_metrics
135
136
  }
136
- backend = RecomputeBackend(manager, experiment)
137
+ # the WP4 factory (the same grid parameters load_session enumerates):
138
+ # copy mode joins the persisted cohort, direct mode the live source
139
+ grid = generate_grid(
140
+ experiment.start_date,
141
+ experiment.end_date,
142
+ experiment.cadence_segments(),
143
+ tz=experiment.timezone,
144
+ limit=context.project.limits.max_looks,
145
+ )
146
+ try:
147
+ backend, cohort_snapshot = build_cohort_backend(manager, experiment, context.root, grid)
148
+ except ExposureLoadError as exc:
149
+ # direct mode validates the LIVE source at startup — a source
150
+ # that emptied or corrupted since the last run must fail the
151
+ # house way (ClickException → clean non-zero exit), never a
152
+ # raw traceback (the module-docstring rule)
153
+ raise click.ClickException(
154
+ f"cohort source failed validation: {exc} — fix the assignment "
155
+ "source, or set assignment.cohort_copy.enabled to explore the "
156
+ "last persisted cohort"
157
+ ) from exc
137
158
  session = load_session(
138
159
  experiment,
139
160
  metrics_by_name,
@@ -150,6 +171,10 @@ def run_explore(
150
171
  project=context.project,
151
172
  metric_configs=metrics_by_name,
152
173
  generated_at=now_utc_naive().strftime("%Y-%m-%d %H:%M UTC"),
174
+ # direct mode: reuse the factory's validated snapshot for the SRM
175
+ # chip (no second source execution); copy mode reads the persisted
176
+ # table inside the builder (cohort_snapshot is None)
177
+ cohort_counts=None if cohort_snapshot is None else cohort_snapshot.counts,
153
178
  )
154
179
  payload = build_explore_payload(session, engine, report_payload)
155
180
  if metric is not None:
@@ -163,6 +163,11 @@ assignment: # READ-ONLY exposure source — abkit never randomiz
163
163
  query_file: sql/example_assignment.sql
164
164
  variants: [control, treatment] # FIRST is control (name_1)
165
165
  expected_split: {control: 0.5, treatment: 0.5} # drives the SRM gate
166
+ # cohort_copy: # opt-in: persist an incremental, append-only
167
+ # enabled: true # _ab_exposures copy instead of re-reading the
168
+ # update_column: exposure_ts # live source every run — worth it for a
169
+ # batch_interval: 1d # heavy multi-join or a mutating source; see
170
+ # maturity_delay: 0 # docs/guides/experiments.md ("Persisting the cohort")
166
171
 
167
172
  alpha: 0.05
168
173
  correction: bonferroni # two-tier: main metric vs the rest (inspectable at run)
@@ -193,7 +198,8 @@ sql: |
193
198
  -- The window is PINNED-START / MOVING-END: ab_start_date never moves,
194
199
  -- ab_end_ts advances per cutoff — so every run aggregates from experiment
195
200
  -- start through the cutoff (the stabilization chart's points).
196
- -- ab.exposed_units() joins the persisted cohort (_ab_exposures), applies
201
+ -- ab.exposed_units() joins the assignment cohort (the LIVE source by
202
+ -- default, the persisted _ab_exposures copy under cohort_copy), applies
197
203
  -- the window + exposure filters and dedup — never re-implement those.
198
204
  SELECT
199
205
  {{ ab.variant_col() }} AS variant,
@@ -230,8 +236,11 @@ sql: |
230
236
 
231
237
  ASSIGNMENT_SQL = """\
232
238
  -- The assignment (exposure) source: one row per unit with its variant and
233
- -- first-exposure timestamp. abkit persists this ONCE per run into
234
- -- _ab_exposures; every metric query joins that cohort via the packaged macro.
239
+ -- first-exposure timestamp. By default abkit never persists this — every
240
+ -- metric query joins the LIVE assignment cohort via the packaged macro.
241
+ -- Set assignment.cohort_copy.enabled: true in the experiment YAML to persist
242
+ -- an incremental, append-only copy into _ab_exposures instead (worth it for
243
+ -- a heavy multi-join or a mutating source).
235
244
  SELECT
236
245
  user_id,
237
246
  variant,