Skip to content

fix(analysis): cfg.RESEARCH_BUCKET → cfg.S3_BUCKET + CLI smoke test#210

Merged
cipher813 merged 2 commits into
mainfrom
fix/variant-gate-cli-bucket-symbol
May 28, 2026
Merged

fix(analysis): cfg.RESEARCH_BUCKET → cfg.S3_BUCKET + CLI smoke test#210
cipher813 merged 2 commits into
mainfrom
fix/variant-gate-cli-bucket-symbol

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

Three diagnostic CLIs that gate L2878 Stages 1d / 2d / 3 cutover decisions all referenced cfg.RESEARCH_BUCKET, an attribute that has never been defined in config.py (canonical name is cfg.S3_BUCKET). The stale symbol was introduced 2026-05-10 via PR #117 (variant gate substrate) and copied into the two sibling CLIs since. The CLIs died at import time during the argparse default lookup before any user-facing message:

AttributeError: module 'config' has no attribute 'RESEARCH_BUCKET'

Programmatic API was unaffected — the bug only surfaced when an operator actually ran the CLI for the first time. Latent for 18 days. Caught 2026-05-28 during audit of what's actionable on L2878 mid-observation-soak: Sat 5/30 is the 3rd parallel-observation Saturday firing, and the operator was about to want these CLIs runnable for diagnostic IC-lift checks.

Sites fixed (7 across 3 files)

File Lines Form
analysis/variant_cutover_gate.py 503, 504 CLI default + help string
analysis/horizon_battery.py 266, 267 CLI default + help string
analysis/triple_barrier_cutover_runner.py 226 (docstring), 251 (runtime fallback), 347 (CLI help) Mixed

All replaced with cfg.S3_BUCKET. Default bucket now resolves cleanly to alpha-engine-research.

Chokepoint test (closes the bug CLASS at PR time)

tests/test_analysis_clis_invokable.py:

  1. test_analysis_cli_help_works — parametrizes every analysis CLI module with a top-level main() through python -m <module> --help; asserts exit 0 + non-empty usage line. argparse's --help exits 0; any missing-attr error in argparse defaults surfaces as a non-zero exit code + stderr traceback.

  2. test_analysis_cli_list_covers_every_module_with_main — walks analysis/*.py looking for any module that defines a top-level def main(; fails if a CLI is missing from the parametrized list. Catches the next "added a new analysis CLI but forgot to register it" recurrence.

Caught a 4th CLI (analysis/compare_modes.py) during test build; confirmed it already uses cfg.S3_BUCKET correctly and added to the parametrized list.

Composes with

  • [[feedback_lift_invariants_to_chokepoint_after_second_recurrence]] — three sibling sites = strong second-recurrence signal; lift to PR-time test rather than fix each in isolation.
  • L2878 — unblocks operator-driven diagnostic gate runs over the next 6 weeks of observation soak (Sat 5/30 → 6/06 → 6/13 → …).
  • [[feedback_no_silent_fails]] — the argparse-default crash was loud, just unreachable until first CLI invocation. The CI test makes the failure surface at PR time.

Test plan

  • pytest tests/test_analysis_clis_invokable.py -v — 5/5 passed.
  • Touched-test suite — pytest tests/test_variant_cutover_gate.py tests/test_triple_barrier_cutover_runner.py tests/test_triple_barrier_cutover_runner_wave3_readers.py tests/test_analysis_clis_invokable.py -q — 47/47 passed.
  • Manual CLI smoke — each of the 4 CLIs --help now exits 0 + prints a clean usage line with default bucket alpha-engine-research.
  • CI Tests workflow passes.

🤖 Generated with Claude Code

cipher813 and others added 2 commits May 28, 2026 15:05
Three diagnostic CLIs that gate L2878 Stages 1d / 2d / 3 cutover
decisions all referenced cfg.RESEARCH_BUCKET, an attribute that has
never been defined in config.py (canonical name is cfg.S3_BUCKET).
The stale symbol was introduced 2026-05-10 via PR #117 (variant gate
substrate) and copied into the two sibling CLIs since. The CLIs died
at import time during the argparse default lookup before any
user-facing message:

  AttributeError: module 'config' has no attribute 'RESEARCH_BUCKET'

Programmatic API was unaffected — the bug only surfaced when an
operator actually ran the CLI. Latent for 18 days. Caught 2026-05-28
during audit of what's actionable on L2878 mid-observation-soak:
Sat 5/30 is the 3rd parallel-observation Saturday firing, and the
operator was about to want these CLIs runnable for diagnostic
IC-lift checks.

Sites fixed (7 across 3 files):
  - analysis/variant_cutover_gate.py:503-504 (CLI default + help)
  - analysis/horizon_battery.py:266-267 (CLI default + help)
  - analysis/triple_barrier_cutover_runner.py:226 (docstring) + :251
    (runtime fallback) + :347 (CLI help)

Chokepoint test (closes the bug CLASS at PR time):
  - tests/test_analysis_clis_invokable.py — parametrizes every analysis
    CLI module with a top-level main() through `python -m <module>
    --help`, asserts exit 0 + non-empty usage line. argparse's --help
    exits 0; any missing-attr error surfaces non-zero.
  - Also walks analysis/*.py for any new main() definition and fails
    if a CLI is missing from the parametrize list — catches the next
    "added a new CLI but forgot to register" recurrence.
  - Caught a 4th CLI (analysis/compare_modes.py) during test build;
    confirmed already-correct (uses cfg.S3_BUCKET) and added to list.

Composes with:
  - [[feedback_lift_invariants_to_chokepoint_after_second_recurrence]]
    — three sibling sites = strong second-recurrence signal; lift to
    PR-time test rather than fix each in isolation.
  - L2878 — unblocks operator-driven diagnostic gate runs over the
    next 6 weeks of observation soak (Sat 5/30 → 6/06 → 6/13 → ...).
  - [[feedback_no_silent_fails]] — argparse-default crash WAS loud,
    just unreachable until first CLI invocation. CI test makes the
    failure surface at PR time.

Suite: +5 tests; touched-test suites all green (47 passed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 2332e9a into main May 28, 2026
1 check passed
@cipher813 cipher813 deleted the fix/variant-gate-cli-bucket-symbol branch May 28, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant