fix(analysis): cfg.RESEARCH_BUCKET → cfg.S3_BUCKET + CLI smoke test#210
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inconfig.py(canonical name iscfg.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: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)
analysis/variant_cutover_gate.pyanalysis/horizon_battery.pyanalysis/triple_barrier_cutover_runner.pyAll replaced with
cfg.S3_BUCKET. Default bucket now resolves cleanly toalpha-engine-research.Chokepoint test (closes the bug CLASS at PR time)
tests/test_analysis_clis_invokable.py:test_analysis_cli_help_works— parametrizes every analysis CLI module with a top-levelmain()throughpython -m <module> --help; asserts exit 0 + non-empty usage line.argparse's--helpexits 0; any missing-attr error in argparse defaults surfaces as a non-zero exit code + stderr traceback.test_analysis_cli_list_covers_every_module_with_main— walksanalysis/*.pylooking for any module that defines a top-leveldef 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 usescfg.S3_BUCKETcorrectly and added to the parametrized list.Composes with
Test plan
pytest tests/test_analysis_clis_invokable.py -v— 5/5 passed.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.--helpnow exits 0 + prints a clean usage line with default bucketalpha-engine-research.Testsworkflow passes.🤖 Generated with Claude Code