bathos 0.4.0__tar.gz → 0.9.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 (156) hide show
  1. {bathos-0.4.0 → bathos-0.9.0}/.gitignore +1 -0
  2. {bathos-0.4.0 → bathos-0.9.0}/.readthedocs.yaml +0 -1
  3. {bathos-0.4.0 → bathos-0.9.0}/CHANGELOG.md +126 -2
  4. {bathos-0.4.0 → bathos-0.9.0}/CLAUDE.md +39 -37
  5. {bathos-0.4.0 → bathos-0.9.0}/PKG-INFO +17 -4
  6. {bathos-0.4.0 → bathos-0.9.0}/README.md +7 -1
  7. bathos-0.9.0/agent_assets/agents/experiment-runner.md +41 -0
  8. bathos-0.9.0/agent_assets/skills/using-bathos/SKILL.md +480 -0
  9. bathos-0.9.0/agent_assets/snippets/rules.md +67 -0
  10. {bathos-0.4.0 → bathos-0.9.0}/docs/source/conf.py +1 -1
  11. {bathos-0.4.0 → bathos-0.9.0}/docs/source/user-guide.rst +31 -0
  12. bathos-0.9.0/docs/superpowers/plans/2026-05-21-viz-suite-plan.md +2876 -0
  13. bathos-0.9.0/docs/superpowers/specs/2026-05-21-viz-suite-design.md +379 -0
  14. bathos-0.9.0/docs/telemetry-schema.md +433 -0
  15. {bathos-0.4.0 → bathos-0.9.0}/pyproject.toml +21 -2
  16. bathos-0.9.0/report.html +294 -0
  17. bathos-0.9.0/scripts/analysis/backfill_nlm_log.py +266 -0
  18. bathos-0.9.0/src/bathos/__init__.py +6 -0
  19. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/archive.py +30 -0
  20. bathos-0.9.0/src/bathos/campaigns.py +303 -0
  21. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/catalog.py +9 -0
  22. bathos-0.9.0/src/bathos/cite.py +65 -0
  23. bathos-0.9.0/src/bathos/classifier.py +455 -0
  24. bathos-0.9.0/src/bathos/cli.py +1655 -0
  25. bathos-0.9.0/src/bathos/cluster.py +147 -0
  26. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/compact.py +257 -6
  27. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/config.py +12 -6
  28. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/linter.py +161 -0
  29. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/mcp.py +420 -14
  30. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/migrate.py +35 -4
  31. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/new_experiment.py +7 -0
  32. bathos-0.9.0/src/bathos/postmortem.py +206 -0
  33. bathos-0.9.0/src/bathos/prereg.py +246 -0
  34. bathos-0.9.0/src/bathos/provenance.py +83 -0
  35. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/query.py +109 -43
  36. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/remote.py +4 -0
  37. bathos-0.9.0/src/bathos/rich_fmt.py +499 -0
  38. bathos-0.9.0/src/bathos/runner.py +428 -0
  39. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/schema.py +77 -1
  40. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/sidecar.py +85 -7
  41. bathos-0.9.0/src/bathos/sprint_audit.py +407 -0
  42. bathos-0.9.0/src/bathos/sync.py +290 -0
  43. bathos-0.9.0/src/bathos/telemetry.py +434 -0
  44. bathos-0.9.0/src/bathos/validate.py +221 -0
  45. bathos-0.9.0/src/bathos/verify.py +301 -0
  46. bathos-0.9.0/src/bathos/viz/__init__.py +3 -0
  47. bathos-0.9.0/src/bathos/viz/data.py +171 -0
  48. bathos-0.9.0/src/bathos/viz/html.py +233 -0
  49. bathos-0.9.0/src/bathos/viz/server.py +92 -0
  50. bathos-0.9.0/src/bathos/viz/static/VERSIONS.md +26 -0
  51. bathos-0.9.0/src/bathos/viz/static/alpine.min.js +5 -0
  52. bathos-0.9.0/src/bathos/viz/static/pico.min.css +4 -0
  53. bathos-0.9.0/src/bathos/viz/templates/_campaign.html +139 -0
  54. bathos-0.9.0/src/bathos/viz/templates/_run_detail.html +134 -0
  55. bathos-0.9.0/src/bathos/viz/templates/_runs.html +80 -0
  56. bathos-0.9.0/src/bathos/viz/templates/index.html +159 -0
  57. bathos-0.9.0/tests/test_bth_submit.py +319 -0
  58. {bathos-0.4.0 → bathos-0.9.0}/tests/test_campaigns.py +48 -0
  59. bathos-0.9.0/tests/test_campaigns_popper.py +377 -0
  60. bathos-0.9.0/tests/test_cite.py +108 -0
  61. bathos-0.9.0/tests/test_classifier.py +455 -0
  62. {bathos-0.4.0 → bathos-0.9.0}/tests/test_cli.py +39 -5
  63. {bathos-0.4.0 → bathos-0.9.0}/tests/test_cluster_workflow.py +22 -10
  64. {bathos-0.4.0 → bathos-0.9.0}/tests/test_compact.py +37 -31
  65. {bathos-0.4.0 → bathos-0.9.0}/tests/test_config.py +10 -0
  66. bathos-0.9.0/tests/test_gate_error_taxonomy.py +126 -0
  67. {bathos-0.4.0 → bathos-0.9.0}/tests/test_integration.py +5 -4
  68. bathos-0.9.0/tests/test_lineage_format.py +132 -0
  69. {bathos-0.4.0 → bathos-0.9.0}/tests/test_linter.py +4 -0
  70. bathos-0.9.0/tests/test_outputs.py +178 -0
  71. bathos-0.9.0/tests/test_postmortem.py +604 -0
  72. {bathos-0.4.0 → bathos-0.9.0}/tests/test_prereg.py +6 -6
  73. bathos-0.9.0/tests/test_provenance.py +165 -0
  74. {bathos-0.4.0 → bathos-0.9.0}/tests/test_query.py +55 -6
  75. bathos-0.9.0/tests/test_rich_fmt.py +134 -0
  76. {bathos-0.4.0 → bathos-0.9.0}/tests/test_runner.py +101 -0
  77. {bathos-0.4.0 → bathos-0.9.0}/tests/test_schema.py +81 -6
  78. {bathos-0.4.0 → bathos-0.9.0}/tests/test_sidecar.py +20 -0
  79. bathos-0.9.0/tests/test_sidecar_popper.py +379 -0
  80. bathos-0.9.0/tests/test_sprint_audit_signals.py +1252 -0
  81. {bathos-0.4.0 → bathos-0.9.0}/tests/test_sync.py +54 -31
  82. {bathos-0.4.0 → bathos-0.9.0}/tests/test_sync_project_filter.py +24 -16
  83. bathos-0.9.0/tests/test_telemetry.py +537 -0
  84. bathos-0.9.0/tests/test_threshold_lint.py +571 -0
  85. bathos-0.9.0/tests/test_verify.py +216 -0
  86. bathos-0.9.0/tests/test_viz_data.py +183 -0
  87. bathos-0.9.0/tests/test_viz_html.py +192 -0
  88. bathos-0.9.0/tests/test_viz_packaging.py +67 -0
  89. bathos-0.9.0/tests/test_viz_server.py +69 -0
  90. {bathos-0.4.0 → bathos-0.9.0}/uv.lock +575 -213
  91. bathos-0.4.0/src/bathos/__init__.py +0 -5
  92. bathos-0.4.0/src/bathos/campaigns.py +0 -161
  93. bathos-0.4.0/src/bathos/cli.py +0 -799
  94. bathos-0.4.0/src/bathos/prereg.py +0 -160
  95. bathos-0.4.0/src/bathos/runner.py +0 -240
  96. bathos-0.4.0/src/bathos/sprint_audit.py +0 -128
  97. bathos-0.4.0/src/bathos/sync.py +0 -129
  98. bathos-0.4.0/src/bathos/validate.py +0 -126
  99. {bathos-0.4.0 → bathos-0.9.0}/.agent/workspace.id +0 -0
  100. {bathos-0.4.0 → bathos-0.9.0}/.bth.toml +0 -0
  101. {bathos-0.4.0 → bathos-0.9.0}/.coverage +0 -0
  102. {bathos-0.4.0 → bathos-0.9.0}/.github/SECRETS.md +0 -0
  103. {bathos-0.4.0 → bathos-0.9.0}/.github/workflows/publish.yml +0 -0
  104. {bathos-0.4.0 → bathos-0.9.0}/.github/workflows/test.yml +0 -0
  105. {bathos-0.4.0 → bathos-0.9.0}/.python-version +0 -0
  106. {bathos-0.4.0 → bathos-0.9.0}/LICENSE +0 -0
  107. {bathos-0.4.0 → bathos-0.9.0}/agent_assets/docs/claude-code-integration.md +0 -0
  108. {bathos-0.4.0 → bathos-0.9.0}/agent_assets/docs/gemini-cli-integration.md +0 -0
  109. {bathos-0.4.0 → bathos-0.9.0}/agent_assets/using_bathos/SKILL.md +0 -0
  110. {bathos-0.4.0 → bathos-0.9.0}/docs/Makefile +0 -0
  111. {bathos-0.4.0 → bathos-0.9.0}/docs/source/api.rst +0 -0
  112. {bathos-0.4.0 → bathos-0.9.0}/docs/source/architecture.rst +0 -0
  113. {bathos-0.4.0 → bathos-0.9.0}/docs/source/contributing.rst +0 -0
  114. {bathos-0.4.0 → bathos-0.9.0}/docs/source/index.rst +0 -0
  115. {bathos-0.4.0 → bathos-0.9.0}/docs/source/slurm-integration.rst +0 -0
  116. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-15-bathos-v01-core.md +0 -0
  117. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-agent-onboarding-export.md +0 -0
  118. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-decorator.md +0 -0
  119. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-historical-migration.md +0 -0
  120. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-linter.md +0 -0
  121. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-remote-management.md +0 -0
  122. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-schema-versioning.md +0 -0
  123. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-skill-and-export-mcp.md +0 -0
  124. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-19-v02-feature-wiring.md +0 -0
  125. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-20-agentic-integrity-design.md +0 -0
  126. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/plans/2026-05-20-agentic-integrity-impl-plan.md +0 -0
  127. {bathos-0.4.0 → bathos-0.9.0}/docs/superpowers/specs/2026-05-15-bathos-design.md +0 -0
  128. {bathos-0.4.0 → bathos-0.9.0}/inventory.txt +0 -0
  129. {bathos-0.4.0 → bathos-0.9.0}/main.py +0 -0
  130. {bathos-0.4.0 → bathos-0.9.0}/praxia.toml +0 -0
  131. {bathos-0.4.0 → bathos-0.9.0}/scripts/benchmarks/.bth.toml +0 -0
  132. {bathos-0.4.0 → bathos-0.9.0}/scripts/experiments/.bth.toml +0 -0
  133. {bathos-0.4.0 → bathos-0.9.0}/scripts/slurm/_bth_env.sh +0 -0
  134. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/checker.py +0 -0
  135. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/decorators.py +0 -0
  136. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/export.py +0 -0
  137. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/git.py +0 -0
  138. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/init.py +0 -0
  139. {bathos-0.4.0 → bathos-0.9.0}/src/bathos/templates/_bth_env.sh +0 -0
  140. {bathos-0.4.0 → bathos-0.9.0}/tests/__init__.py +0 -0
  141. {bathos-0.4.0 → bathos-0.9.0}/tests/conftest.py +0 -0
  142. {bathos-0.4.0 → bathos-0.9.0}/tests/test_archive.py +0 -0
  143. {bathos-0.4.0 → bathos-0.9.0}/tests/test_catalog.py +0 -0
  144. {bathos-0.4.0 → bathos-0.9.0}/tests/test_checker.py +0 -0
  145. {bathos-0.4.0 → bathos-0.9.0}/tests/test_decorators.py +0 -0
  146. {bathos-0.4.0 → bathos-0.9.0}/tests/test_export.py +0 -0
  147. {bathos-0.4.0 → bathos-0.9.0}/tests/test_git.py +0 -0
  148. {bathos-0.4.0 → bathos-0.9.0}/tests/test_init.py +0 -0
  149. {bathos-0.4.0 → bathos-0.9.0}/tests/test_mcp_integration.py +0 -0
  150. {bathos-0.4.0 → bathos-0.9.0}/tests/test_mcp_server.py +0 -0
  151. {bathos-0.4.0 → bathos-0.9.0}/tests/test_migrate.py +0 -0
  152. {bathos-0.4.0 → bathos-0.9.0}/tests/test_new_experiment.py +0 -0
  153. {bathos-0.4.0 → bathos-0.9.0}/tests/test_remote.py +0 -0
  154. {bathos-0.4.0 → bathos-0.9.0}/tests/test_slurm_integration.py +0 -0
  155. {bathos-0.4.0 → bathos-0.9.0}/tests/test_sprint_audit.py +0 -0
  156. {bathos-0.4.0 → bathos-0.9.0}/tests/test_validate.py +0 -0
@@ -20,3 +20,4 @@ tmp/
20
20
  # Ephemeral caches and praxia state (do not commit)
21
21
  .fastembed_cache/
22
22
  .praxia/
23
+ .claude/
@@ -9,7 +9,6 @@ build:
9
9
  python: "3.12"
10
10
 
11
11
  python:
12
- version: "3.12"
13
12
  install:
14
13
  - method: pip
15
14
  path: .
@@ -7,11 +7,135 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ---
11
+
12
+ ## [0.9.0] - 2026-06-04
13
+
14
+ ### Added
15
+
16
+ - **`bth outputs list <run_id> [--live]`** — per-file listing of registered output artifacts (path, status, size, sha256) from the compact-time snapshot; `--live` re-stats from filesystem without writing back to catalog
17
+ - **`bth outputs summary [--project <slug>] [--since <period>]`** — aggregate output file counts, total bytes, and missing-file rate across all projects (or filtered); requires warm catalog (`bth compact` first)
18
+ - **`render_output_list` / `render_outputs_summary`** in `rich_fmt.py` — Rich-formatted output tables for the new commands
19
+ - **MCP mirrors** — `list_outputs(run_id, live=False)` and `outputs_summary(project=None, since=None)` in `mcp.py`
20
+ - **Scaffold two-phase comment** in `bth new-experiment` template — documents scalar-metrics (stdout JSON) vs. artifact-files (`--out` / `bth outputs`) distinction
21
+ - **`docs` optional extra** in `pyproject.toml` — `pip install bathos[docs]` installs Sphinx for building documentation; required by Read the Docs
22
+
23
+ ### Fixed
24
+
25
+ - **`output_metadata` key inconsistency** in `query.py` — `_filter_runs_by_output_file` was checking `metadata.output_files` as a warm-tier fallback key; corrected to `output_metadata`
26
+ - **`.readthedocs.yaml` invalid key** — removed `python.version` (not valid in RTD config v2; version already specified under `build.tools.python`)
27
+ - **`docs/source/conf.py` stale release string** — updated from `0.1.0` to `0.9.0`
28
+ - **`pyproject.toml` stale version** — bumped from `0.7.0` to `0.9.0` to match CHANGELOG
29
+
30
+ ### Notes
31
+
32
+ - Output metadata is a point-in-time snapshot captured once at first compact. Use `--live` for current filesystem state. Refresh-on-compact with change history is tracked as debt #71.
33
+
34
+ ---
35
+
36
+ ## [0.8.0] - 2026-06-02
37
+
38
+ ### Added
39
+
40
+ - **POPPER sequential campaigns** — `mode="sequential"` for `bth campaign create --sequential`; converts Campaign into an anytime-valid sequential test based on e-value products (arXiv 2502.09858)
41
+ - **`[popper]` sidecar block** — `null_pass_rate`, `alt_pass_rate`, `stopping_threshold` (all required); optional `[popper.weights]` per-label likelihood-ratio overrides
42
+ - **`compute_evalue()`** in `sidecar.py` — likelihood-ratio e-value per run: alt/null for pass-direction, (1-alt)/(1-null) for fail-direction, 1.0 hard default for marginal/error/unknown
43
+ - **`campaign_runs` schema extension** — `evalue REAL CHECK (evalue IS NULL OR evalue > 0)`, `seq_position INTEGER`
44
+ - **`campaigns` schema extension** — `stopping_threshold REAL`; schema v6
45
+ - **Threshold lock** — `stopping_threshold` locks after the first non-error run is added; `CampaignError` on mismatch with restart-via-parent instructions
46
+ - **`bth campaign conclude --force` / `--abort-if-below-threshold`** — soft and strict premature-stopping guards
47
+ - **`bth campaign review` POPPER table** — per-script E_n product, n_effective, n_excluded, threshold_met via `render_popper_summary()`
48
+ - **Sprint-audit signal 8** — `premature_stopping_rate`: fraction of concluded sequential campaigns where final E_n < stopping_threshold
49
+ - **`check_popper_adversarial()`** — Tier-2 lint advisory for POPPER sidecars missing `adversarial_check` in all outcome branches
50
+ - **`validate_popper_block()`** — structural validation: range checks, null≠alt guard, threshold < 10.0 WARNING, weight key/value constraints
51
+
52
+ ---
53
+
54
+ ## [0.7.0] - 2026-06-01
55
+
56
+ ### Added
57
+
58
+ - **`bth verify`** — catalog integrity command; `--tier cool/warm/archive/all`
59
+ - **`compact` transaction safety** — `BEGIN`/`COMMIT`/`ROLLBACK` wrapping; `PRAGMA integrity_check` on every DuckDB connect
60
+ - **`compact force_rebuild`** — removes existing `bathos.db` before compacting (corruption recovery)
61
+ - **Pre-migration `.bak` backup** — `bth migrate` writes a `.bak` before in-place rewrite
62
+ - **Archive SHA256 checksums** — per-file in `manifest.json`
63
+ - **`sync` truncation detection** — post-rsync check via `--itemize-changes`
64
+
65
+ ### Changed
66
+
67
+ - **`fastmcp` promoted to main dependency**
68
+
69
+ ---
70
+
71
+ ## [0.6.1] - 2026-06-01
72
+
73
+ ### Added
74
+
75
+ - **Sprint-audit threshold ADR** — domain rationale for all 7 signal thresholds; fixes `schema_overflow_rate` semantics
76
+ - **Tier-2 lint: `check_threshold_basis`** — warns for `regression_threshold` without `regression_threshold_basis`
77
+ - **`OutcomeSpec.source`** and **`Sidecar.regression_threshold_basis`** fields
78
+
79
+ ---
80
+
81
+ ## [0.6.0] - 2026-05-29
82
+
83
+ ### Added
84
+
85
+ - **`outcome="error"` first-class** — `GateErrorCode` / `GateErrorPayload` taxonomy (11 codes)
86
+ - **Pre-execution manifest** — `.bth.lock.toml` schema v5; content-hashes sidecar + script at run start
87
+ - **`adversarial_check` field** — per-outcome text field; Tier-2 lint enforcement in `--agent-mode`
88
+ - **`bth cite`** — structured run citations (BibTeX / plain text)
89
+ - **`bth lineage --format prov`** — W3C PROV-JSON 1.0 lineage export
90
+ - **Sprint-audit 7-signal extension** — `error_rate`, `bypass_explicit`, `bypass_in_agent_mode`, `outcome_entropy`, `unfired_branches`, `schema_overflow_rate`, `post_hoc_bias_flag`
91
+ - **Cluster submission** — `bth submit` via myxcel; `slurm_array_task_id` field; `ClusterConfig`
92
+ - **Schema v5** — `manifest_sha256`, `manifest_path`, `outcome_error_reason`, `adversarial_check_status`
93
+
94
+ ---
95
+
96
+ ## [0.5.0] - 2026-05-25
97
+
98
+ ### Added
99
+
100
+ - **Telemetry** — structured JSONL with 9 event surfaces; SLURM-safe per-process files; rides `bth sync`
101
+ - **`bth view`** — local FastAPI dashboard (`bathos[viz]`); read-only; 1000-run cap
102
+ - **`bth export --html`** — static HTML report from warm catalog
103
+ - **`bathos[viz]` optional extra** — FastAPI + Jinja2 + Alpine.js + Pico CSS (vendored MIT)
104
+ - **Rich formatters** (`rich_fmt.py`) — `render_runs_table`, `render_run_detail`, `render_campaign_table`, `render_campaign_review`
105
+
106
+ ---
107
+
108
+ ## [0.4.1] - 2026-05-21
109
+
110
+ ### Added
111
+
112
+ - **Postmortem tracking** — `*.bth.postmortem.toml` format for capturing experiment retrospectives; tracked in git (not gitignored); supports `[postmortem]`, `[decisions]`, `[asset_links]`, and `[anomalies]` sections
113
+ - **`bth postmortem validate <file>`** — CLI command to validate a postmortem TOML file; checks refutation consistency, asset path containment, sha256 checksums, and git drift; exits non-zero on violations with structured error output
114
+ - **`postmortem_scaffold` MCP tool** — scaffolds a new `*.bth.postmortem.toml` with pre-populated sections from the associated run record
115
+ - **`postmortem_validate` MCP tool** — validates a postmortem file, returning structured violations for agentic workflows
116
+ - **`postmortem_get` MCP tool** — retrieves postmortem data for a run by run ID or file path
117
+ - **Schema v4** — 10 new DuckDB columns for postmortem metadata; `compact` syncs postmortem data via both INSERT and UPDATE paths
118
+ - **`script_sha256`** — SHA-256 hash of the script file computed in `runner.py` at experiment launch and stored in the run record
119
+
10
120
  ### Fixed
11
121
 
12
- - **`bth sync` indefinite hang** — `sync_catalog()` now passes SSH options (`ConnectTimeout=10`, `BatchMode=yes`) to rsync so unreachable hosts fail in ≤10 s instead of blocking forever; adds `subprocess.run(timeout=120)` as a safety net; raises `RuntimeError` with actionable message on timeout; drops silent `--progress` flag (output was captured, not displayed)
122
+ - **`catalog_dir` tilde not expanded** — `load_project_config` now calls `.expanduser()` on `root` and `catalog_dir` paths; previously `Path("~/projects/asr/.bth/catalog")` was treated as a relative path starting with a literal `~`, causing `bth compact` to report "Compacted 0 runs", `bth sql` to report "No warm catalog", and `bth find` to stall — all despite the catalog existing at the correct absolute path
123
+ - **`bth sync` indefinite hang** — `sync_catalog()` now passes SSH options (`ConnectTimeout=10`, `BatchMode=yes`) to rsync so unreachable hosts fail in ≤10 s instead of blocking forever; adds `subprocess.run(timeout=120)` as a safety net; raises `RuntimeError` with actionable message on timeout
124
+ - **Parquet timestamp timezone-aware** — timestamps loaded from Parquet are now always timezone-aware (UTC) to prevent `TypeError` when comparing with aware datetimes in query functions
125
+
126
+ ---
127
+
128
+ ## [0.4.0] - 2026-05-21
129
+
130
+ ### Added
131
+
132
+ - **Per-project sync filtering** — `bth sync` now pushes/pulls only the current project's runs; output reports filtered count (e.g., `Pushed 47 runs (filtered 275 from other projects)`)
133
+ - **`bth migrate-to-project-subdirs`** — migrates flat cool-tier catalogs to the `runs/<slug>/run_<uuid>.parquet` layout
134
+ - **`sync_filter` config knob** — set `sync_filter = "none"` in `.bth.toml` to disable per-project filtering and sync all projects
135
+
136
+ ### Changed
13
137
 
14
- - **Parquet timestamp timezone-aware fix** — Ensure timestamps loaded from Parquet are timezone-aware (UTC) to avoid comparisons between naive and aware datetimes in query functions; prevents TypeError and incorrect filtering.
138
+ - **Cool-tier layout** — per-run Parquet fragments now stored at `runs/<slug>/run_<uuid>.parquet` instead of flat `runs/run_<uuid>.parquet`; old layout still readable, use `bth migrate-to-project-subdirs` to upgrade
15
139
 
16
140
  ---
17
141
 
@@ -10,21 +10,17 @@ bathos is a standalone experiment tracking CLI for a single researcher across 10
10
10
 
11
11
  ---
12
12
 
13
- ## Current Status (as of 2026-05-21)
13
+ ## Current Status (as of 2026-06-02)
14
14
 
15
- **v0.4.0: complete and merged to main.** 333 tests passing.
15
+ **Latest: v0.9 (bth outputs Phase 1) — 570 tests passing (4 skipped).**
16
16
 
17
- - Full design spec: `.praxia/specs/bathos-design.md`
18
- - v0.1 implementation plan: `.praxia/specs/bathos-v01-plan.md`
19
- - Backlog: items #124–142 in praxia DB (see below); #124–141 done
17
+ Full version history is in [`CHANGELOG.md`](CHANGELOG.md). Summary of current version:
20
18
 
21
- **Shipped in v0.2:** FastMCP server (#128), `@bth.experiment` decorator (#129), `bth check` (#130), SLURM `_bth_env.sh` (#131), `bth new-experiment` (#132), `uv tool` packaging (#133), `bth lint` (#134), `bth migrate` (#135), `bth sync` (#138), schema versioning v2 (#140), `bth archive` (#141), `bth remote` subcommands, `bth export`, `bth catalog-version`.
19
+ - POPPER e-value sequential campaigns (`mode="sequential"`, `[popper]` sidecar block, likelihood-ratio e-values, threshold lock, sprint-audit signal 8, Tier-2 lint advisory)
20
+ - Schema v6; campaign_runs gains `evalue` + `seq_position`; campaigns gains `stopping_threshold`
21
+ - `bth outputs list / summary` — per-file output catalog with `--live` re-stat; fix `output_metadata` key bug in query.py; MCP mirrors
22
22
 
23
- **Shipped in v0.3:** Agentic integrity gate (`--agent-mode`, `--no-sidecar`, `--derived-from`), lineage tracking (`bth lineage`), campaigns (`bth campaign` subcommands + MCP tools), sprint audit (`bth sprint-audit`), Tier-2 lint checks, schema v3 with campaign/lineage/integrity fields, `--campaign` flag on `bth run`.
24
-
25
- **Shipped in v0.4:** Per-project sync filtering — `bth sync` now pushes/pulls only the current project's runs (no cross-project contamination). Cool-tier layout changed to `runs/<slug>/run_<uuid>.parquet`. New command `bth migrate-to-project-subdirs` migrates flat catalogs. `sync_filter` config knob; `--no-project-filter` opt-out planned.
26
-
27
- **Remaining backlog:** #136 (bth-migrate praxia workflow), #137 (global instruction portability), #142 (results management design).
23
+ **Open backlog:** #137 (global instruction portability — deferred to praxia). Debt #71 (output_metadata refresh-on-compact + changelog).
28
24
 
29
25
  ---
30
26
 
@@ -146,46 +142,52 @@ src/bathos/
146
142
  linter.py # bth lint — Tier-1 and Tier-2 checks
147
143
  migrate.py # bth migrate — schema version upgrades
148
144
  new_experiment.py # bth new-experiment scaffold
149
- export.py # bth export — skill + MCP registration
145
+ export.py # bth export — skill + MCP registration (UNCHANGED — do not touch)
150
146
  validate.py # sidecar structural validation
151
147
  remote.py # bth remote subcommands
152
148
  sync.py # bth sync rsync wrapper
153
149
  archive.py # bth archive warm→cold export
154
- prereg.py # agentic integrity pre-registration gate
150
+ cite.py # bth cite — run citation generation
151
+ cluster.py # bth submit — ClusterConfig, resolve_cluster_config(), myxcel wrappers
155
152
  decorators.py # @bth.experiment provenance decorator
153
+ postmortem.py # bth postmortem — *.bth.postmortem.toml validation + MCP tools
154
+ prereg.py # agentic integrity pre-registration gate
155
+ provenance.py # W3C PROV-JSON lineage serialization
156
+ rich_fmt.py # Rich CLI formatters (base dep) — render_runs_table, render_run_detail, render_campaign_table, render_campaign_review
157
+ telemetry.py # structured JSONL telemetry (9 event surfaces, SLURM-safe per-process files)
158
+ verify.py # bth verify — catalog integrity checks (--tier cool/warm/archive/all)
159
+ viz/ # Optional extra: bathos[viz]
160
+ __init__.py
161
+ data.py # RunDisplay/CampaignDisplay TypedDicts; project_run(), project_campaign()
162
+ html.py # render_html_report(), export_html() — static HTML renderer
163
+ server.py # create_app(), run_server() — FastAPI local dashboard
164
+ templates/ # Jinja2 templates (SPA: index.html, _runs.html, _run_detail.html, _campaign.html)
165
+ static/ # Vendored Alpine.js + Pico CSS (both MIT); VERSIONS.md with checksums
156
166
  templates/
157
167
  _bth_env.sh # SLURM env helper template
158
168
  experiment.py # bth new-experiment script skeleton
159
169
  ```
160
170
 
171
+ ### Viz Suite Architecture (v0.5)
172
+
173
+ - `rich_fmt.py` is a **base dependency** — always imported by CLI, no viz/ imports
174
+ - `viz/` is an **optional extra** (`bathos[viz]`) — lazy-imported inside command bodies only
175
+ - `viz/data.py` consumes only `query.py` + `campaigns.py` — never imports `catalog.py` or `compact.py`
176
+ - `bth view` cap: query `limit=1001`, slice `[:1000]`, show sticky banner if count > 1000
177
+ - `bth export --html` warns to stderr if rendered HTML > 5 MB
178
+ - `bth view` is read-only; never triggers compaction
179
+ - `importlib.resources.files("bathos.viz")` used to load templates and static assets at runtime
180
+
161
181
  ---
162
182
 
163
- ## Backlog (praxia DB)
183
+ ## Open Backlog (praxia DB)
164
184
 
165
185
  | ID | Title | Priority | Depends on |
166
186
  |---|---|---|---|
167
- | 124 | Core schema + DuckDB catalog init | P1 | — |
168
- | 125 | `bth init` — dirs, .bth.toml, catalog bootstrap, SLURM config | P1 | 124 |
169
- | 126 | `bth run` — CLI wrapper, provenance capture | P1 | 124 |
170
- | 127 | `bth ls` / `show` / `find` / `sql` — query interface | P1 | 126 |
171
- | 128 | FastMCP server — mirrors CLI tool-for-tool | P1 ✓ done (v0.2) | 126, 127, 130 |
172
- | 129 | `@bth.experiment` — provenance decorator for Typer scripts | P2 ✓ done (v0.2) | 124 |
173
- | 130 | `bth check` — freshness/validity vs git HEAD | P2 ✓ done (v0.1/v0.2) | 126 |
174
- | 131 | SLURM `_bth_env.sh` integration | P2 ✓ done (v0.1) | 125, 126 |
175
- | 132 | `bth new-experiment` — Typer + sidecar scaffold | P2 ✓ done (v0.2) | 125 |
176
- | 133 | `uv tool` packaging + release | P3 ✓ done (v0.2) | 126–130 |
177
- | 134 | Script convention linter | P3 ✓ done (v0.2) | — |
178
- | 135 | `bth migrate` — Phase 1 mechanical (existing projects) | P2 ✓ done (v0.2) | 125 |
179
- | 136 | `bth-migrate` praxia workflow — agentic classification + git mv plan | P2 (not started) | 135 |
180
- | 137 | Global instruction portability (separate design session needed) | P2 (not started) | — |
181
- | 138 | `bth sync` — rsync cool-tier catalog to/from cluster remote | P2 ✓ done (v0.2) | 125, v0.1 done |
182
- | 139 | `bth compact` + warm-tier DuckDB (`bth sql` catalog queries) | P2 ✓ done (v0.1) | v0.1 done |
183
- | 140 | Schema versioning + extended provenance (hostname, slurm_job_id, metadata JSON, migrations) | P2 ✓ done (v0.2) | 139 |
184
- | 141 | `bth archive` — warm→cold partitioned Parquet export | P3 ✓ done (v0.2) | 139, 140 |
185
- | 142 | Results management — output convention, file-count utilities, direct management interface design | P2 (not started) | 139 |
186
-
187
- **Not yet backlogged:**
188
- - *(none — sidecar enforcement and outcome evaluation shipped in v0.2/v0.3)*
187
+ | 136 | `bth-migrate` praxia workflow — agentic classification + git mv plan | P2 | 135 |
188
+ | 137 | Global instruction portability (separate design session needed) | P2 | — |
189
+ | 142 | Results management — output convention, file-count utilities, direct management interface design | P2 | 139 |
190
+ | 143 | Threshold epistemic hygiene — sidecar lint + skill instructions to flag unjustified cutoffs | P2 | 134 |
189
191
 
190
192
  ---
191
193
 
@@ -212,4 +214,4 @@ src/bathos/
212
214
  - `BTH_PROJECT_SLUG` env var overrides `.bth.toml` lookup (used in SLURM jobs)
213
215
  - Outcome conditions are DuckDB SQL; validate they parse at `bth run` start before job runs
214
216
  - Content-hash sidecars at run time: store parsed declaration in run record or `declarations` table keyed by SHA256
215
- - `bth run` on a script in `scripts/experiments/` without a sidecar: warn but don't block in v0.1; enforce in v0.2
217
+ - `bth run` on a script in `scripts/experiments/` without a sidecar: enforced by default; pass `--no-sidecar` to bypass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bathos
3
- Version: 0.4.0
3
+ Version: 0.9.0
4
4
  Summary: Local-first, zero-server experiment tracking for researchers
5
5
  Project-URL: Homepage, https://github.com/mariellerossi/bathos
6
6
  Project-URL: Documentation, https://bathos.readthedocs.io
@@ -19,8 +19,10 @@ Classifier: Topic :: Scientific/Engineering
19
19
  Classifier: Topic :: System :: Monitoring
20
20
  Requires-Python: >=3.12
21
21
  Requires-Dist: duckdb>=1.0
22
+ Requires-Dist: fastmcp>=3.3.1
22
23
  Requires-Dist: pyarrow>=16
23
24
  Requires-Dist: pytz>=2026.2
25
+ Requires-Dist: rich>=13
24
26
  Requires-Dist: toml>=0.10
25
27
  Requires-Dist: tomlkit>=0.12
26
28
  Requires-Dist: typer>=0.12
@@ -30,8 +32,13 @@ Requires-Dist: pytest-json-report>=1.5; extra == 'dev'
30
32
  Requires-Dist: pytest-tmp-files>=0.0.2; extra == 'dev'
31
33
  Requires-Dist: pytest>=8; extra == 'dev'
32
34
  Requires-Dist: ruff>=0.6; extra == 'dev'
33
- Provides-Extra: mcp
34
- Requires-Dist: fastmcp<3.0,>=2.0; extra == 'mcp'
35
+ Provides-Extra: docs
36
+ Requires-Dist: sphinx>=7; extra == 'docs'
37
+ Provides-Extra: viz
38
+ Requires-Dist: fastapi>=0.110; extra == 'viz'
39
+ Requires-Dist: httpx>=0.28.1; extra == 'viz'
40
+ Requires-Dist: jinja2>=3.1; extra == 'viz'
41
+ Requires-Dist: uvicorn[standard]>=0.27; extra == 'viz'
35
42
  Description-Content-Type: text/markdown
36
43
 
37
44
  # bathos
@@ -50,7 +57,8 @@ Never lose track of what ran, what it produced, or whether results are still val
50
57
  ## Install
51
58
 
52
59
  ```bash
53
- uv tool install bathos
60
+ uv tool install bathos # base install (includes Rich CLI)
61
+ uv tool install 'bathos[viz]' # adds bth view + bth export --html
54
62
  ```
55
63
 
56
64
  ## Quick start
@@ -98,6 +106,8 @@ bth sql "SELECT project_slug, count(*) FROM runs GROUP BY 1"
98
106
  - `bth migrate` — upgrade cool-tier Parquet fragments to current schema version
99
107
  - `bth migrate-to-project-subdirs [--dry-run]` — move flat catalog runs into `runs/<slug>/` subdirs (v0.4+)
100
108
  - `bth export` — export the using-bathos skill and register MCP server
109
+ - `bth export --html [--out report.html] [--project slug] [--campaign id]` — self-contained HTML report (requires `bathos[viz]`)
110
+ - `bth view [--port 8080] [--project slug] [--no-open]` — local FastAPI dashboard (requires `bathos[viz]`)
101
111
 
102
112
  **`bth sync`** — Sync cool-tier catalog to/from cluster (v0.4+: per-project filtered)
103
113
  - `bth sync [<remote>]` — push only this project's runs to the remote (filtered by `project_slug`)
@@ -111,6 +121,9 @@ bth sql "SELECT project_slug, count(*) FROM runs GROUP BY 1"
111
121
  - `bth remote remove <name>` — remove a remote
112
122
  - `bth remote test <name>` — test SSH connectivity to a remote
113
123
 
124
+ **`bth postmortem`** — Retrospective tracking for completed experiments (v0.4.1+)
125
+ - `bth postmortem validate <file>` — validate a `*.bth.postmortem.toml` file (refutation consistency, asset checksums, git drift)
126
+
114
127
  **`bth campaign`** — Manage experiment campaigns (v0.3+)
115
128
  - `bth campaign create <id> --hypothesis <text>` — create a new campaign
116
129
  - `bth campaign add <run-id> --campaign <id>` — associate a run with a campaign
@@ -14,7 +14,8 @@ Never lose track of what ran, what it produced, or whether results are still val
14
14
  ## Install
15
15
 
16
16
  ```bash
17
- uv tool install bathos
17
+ uv tool install bathos # base install (includes Rich CLI)
18
+ uv tool install 'bathos[viz]' # adds bth view + bth export --html
18
19
  ```
19
20
 
20
21
  ## Quick start
@@ -62,6 +63,8 @@ bth sql "SELECT project_slug, count(*) FROM runs GROUP BY 1"
62
63
  - `bth migrate` — upgrade cool-tier Parquet fragments to current schema version
63
64
  - `bth migrate-to-project-subdirs [--dry-run]` — move flat catalog runs into `runs/<slug>/` subdirs (v0.4+)
64
65
  - `bth export` — export the using-bathos skill and register MCP server
66
+ - `bth export --html [--out report.html] [--project slug] [--campaign id]` — self-contained HTML report (requires `bathos[viz]`)
67
+ - `bth view [--port 8080] [--project slug] [--no-open]` — local FastAPI dashboard (requires `bathos[viz]`)
65
68
 
66
69
  **`bth sync`** — Sync cool-tier catalog to/from cluster (v0.4+: per-project filtered)
67
70
  - `bth sync [<remote>]` — push only this project's runs to the remote (filtered by `project_slug`)
@@ -75,6 +78,9 @@ bth sql "SELECT project_slug, count(*) FROM runs GROUP BY 1"
75
78
  - `bth remote remove <name>` — remove a remote
76
79
  - `bth remote test <name>` — test SSH connectivity to a remote
77
80
 
81
+ **`bth postmortem`** — Retrospective tracking for completed experiments (v0.4.1+)
82
+ - `bth postmortem validate <file>` — validate a `*.bth.postmortem.toml` file (refutation consistency, asset checksums, git drift)
83
+
78
84
  **`bth campaign`** — Manage experiment campaigns (v0.3+)
79
85
  - `bth campaign create <id> --hypothesis <text>` — create a new campaign
80
86
  - `bth campaign add <run-id> --campaign <id>` — associate a run with a campaign
@@ -0,0 +1,41 @@
1
+ # experiment-runner Agent Persona
2
+
3
+ **Role:** Orchestrate bathos experiments — run sidecars, manage campaigns, verify integrity.
4
+
5
+ The experiment-runner agent dispatches when a task requires executing or validating experiments tracked by bathos. It owns the full lifecycle: validating sidecars, launching runs with proper provenance capture, checking outcomes, and recording results.
6
+
7
+ ## Key Responsibilities
8
+
9
+ - **Sidecar validation:** Always validate the `.bth.toml` sidecar before running. Catch schema errors early.
10
+ - **Run invocation:** Use `bth run -- uv run python ...` (never plain `python`). Respect `--tag`, `--campaign`, `--agent-mode`.
11
+ - **Campaign management:** Create campaigns for related runs; use `bth campaign review` to assess outcomes.
12
+ - **Integrity gates:** Check derived-from lineage and outcome conditions match hypothesis.
13
+
14
+ ## MCP Tools
15
+
16
+ - `run` — Dispatch `bth run` with provenance
17
+ - `campaign_create` — Start a new campaign
18
+ - `campaign_review` — Inspect campaign outcomes
19
+ - `check` — Validate run freshness vs git HEAD
20
+
21
+ ## Key Constraints
22
+
23
+ - **Always `uv run python`:** Never bare `python` — relies on project `.venv` isolation
24
+ - **Validate sidecar first:** Run `bth lint <script>` before experiment launch
25
+ - **Respect outcome semantics:** Conditions are DuckDB SQL, not Python expressions
26
+ - **Don't call rsync:** Delegate sync to `bth sync` (owned by myxcel)
27
+ - **No `--no-sidecar` bypass:** Prefer fixing the sidecar
28
+
29
+ ## Dispatch Conditions
30
+
31
+ Invoke experiment-runner when:
32
+ - Setting up or running a new experiment batch
33
+ - Reviewing campaign results and deciding next steps
34
+ - Validating that sidecars and outcomes match requirements
35
+ - Troubleshooting a failed run's provenance
36
+
37
+ Do NOT dispatch if:
38
+ - The work is exploratory (no sidecar) — handle inline
39
+ - Only data analysis is needed (no experiment running) — use data-processor agent
40
+ - Syncing results across remotes — delegate to sync orchestration
41
+