Skip to content

feat(predictor): spot_train.sh --preflight-only (Friday shell-run dry path, no promotion)#175

Merged
cipher813 merged 1 commit into
mainfrom
feat/spot-train-preflight-only
May 18, 2026
Merged

feat(predictor): spot_train.sh --preflight-only (Friday shell-run dry path, no promotion)#175
cipher813 merged 1 commit into
mainfrom
feat/spot-train-preflight-only

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Owed-item #2 of ROADMAP "Friday shell-run — per-module dry-path activation" (P1).

Under the Friday shell_run, the PredictorTraining spot state must boot the spot, run import + lib-pin + ArcticDB/universe-freshness connectivity checks, then exit 0 — with NO weight training, NO weight promotion, and ZERO S3/config writes. Catches bootstrap-class breakage (lib-pin drift, sys.path, stale ArcticDB, SSM timeout, image gap) before the real Saturday PredictorTraining.

Flag name (verbatim, for the SF keystone follow-on): --preflight-only

Insertion point

New if [ "$MODE" = "preflight-only" ] branch placed after the bootstrap + deps run_ssm steps and before the # ── Smoke test section. It runs one new run_ssm "preflight-only" step then exit 0, short-circuiting before the smoke step (dry_run=True training) and before the full-training step (dry_run=False).

No-train / no-promote / no-write proof — steps SKIPPED under the flag

  • run_meta_training() is never invoked — the entire walk-forward + meta-model fit is skipped (it lives inside the smoke/full SSM steps that the exit 0 never reaches).
  • meta_trainer.py's if not dry_run: upload/promote block — the only weights/meta/* + manifest + dated-archive/{date}/ writer — is unreachable.
  • train_handler.main()'s training_summary_* write, triple-barrier cutover gate, training email, and health-status write all live after run_meta_training in main() — none are reached.
  • The probe does only: import alpha_engine_lib + the training package (no main() call), run the existing TrainingPreflight (env-var check + S3 bucket reachability — a head/list, no put_object), and a read-only ArcticDB list_symbols() + single read().tail(1) universe-freshness probe. No put_object, no upload_file, no download_from_arctic, no config/* write, zero external API (yfinance / Anthropic) calls.

Reuses an existing python dry path?

Partially, and deliberately. The repo's python dry_run=True (run_meta_training) still trains the full model and only skips S3 writes — it is a "train-but-don't-promote" smoke, NOT a bootstrap-only preflight, so it does not meet the zero-train/zero-API invariant this item requires. This change reuses the existing training/preflight.py::TrainingPreflight (env + S3 connectivity) instead of rebuilding one, and reuses store.arctic_reader._get_arctic for the read-only ArcticDB probe. No parallel preflight was built.

Tests

tests/test_spot_train_preflight_only.py (mirrors test_spot_train_aws_region.py static-analysis style — the SSM/EC2 path can't run in CI): flag parses; dedicated branch exists + exit 0; branch precedes smoke + full-training; step body references no train/promote/write tokens (run_meta_training(/train_main(/put_object/upload_file/download_from_arctic); reuses TrainingPreflight + imports alpha_engine_lib + read-only list_symbols(); keeps the #247 AWS_REGION export guard. SSM-transport path for normal modes unchanged.

bash -n clean. Full suite 1050 passed (8 new/sibling infra tests green). No new deps, no secrets.

🤖 Generated with Claude Code

… path, no promotion)

Owed-item #2 of ROADMAP "Friday shell-run — per-module dry-path
activation" (P1). Under the Friday shell_run, the PredictorTraining
spot state must boot, run import + lib-pin + ArcticDB/universe-
freshness connectivity checks, then exit 0 — with NO weight training,
NO weight promotion, and ZERO S3/config writes, to catch bootstrap-
class breakage (lib-pin drift, sys.path, stale ArcticDB, SSM timeout,
image gap) before the real Saturday PredictorTraining.

Flag name (verbatim, for the SF keystone follow-on): --preflight-only

Insertion point
  New `if [ "$MODE" = "preflight-only" ]` branch placed AFTER the
  bootstrap + deps run_ssm steps and BEFORE the `# ── Smoke test`
  section. It runs one new `run_ssm "preflight-only"` step then
  `exit 0`, short-circuiting before the smoke step (dry_run=True
  training) and before the full-training step (dry_run=False).

No-train / no-promote / no-write proof (steps SKIPPED under the flag)
  • run_meta_training() is NEVER invoked — the entire walk-forward +
    meta-model fit is skipped (it lives inside the smoke/full SSM
    steps that the exit 0 never reaches).
  • meta_trainer.py's `if not dry_run:` upload/promote block (the only
    weights/meta/* + manifest + dated-archive writer) is unreachable.
  • train_handler.main()'s training_summary write, triple-barrier
    cutover gate, training email, and health-status write all live
    AFTER run_meta_training in main() — none are reached.
  • The probe does only: import alpha_engine_lib + training package
    (no main() call), run the existing TrainingPreflight (env-var
    check + S3 bucket reachability — a head/list, no put_object),
    and a read-only ArcticDB `list_symbols()` + single `read().tail(1)`
    universe-freshness probe. No put_object, no upload_file, no
    download_from_arctic, no config write, zero external API
    (yfinance / Anthropic) calls.

Reuses existing python dry path?
  Partially. The repo's python `dry_run=True` (run_meta_training)
  still trains the full model and only skips S3 writes — it is a
  "train-but-don't-promote" smoke, NOT a bootstrap-only preflight, so
  it does not satisfy the zero-train/zero-API invariant. This change
  REUSES the existing training/preflight.py `TrainingPreflight`
  (env + S3 connectivity) rather than rebuilding one, and reuses
  store.arctic_reader._get_arctic for the read-only ArcticDB probe.
  No parallel preflight was built.

Tests
  tests/test_spot_train_preflight_only.py (mirrors
  test_spot_train_aws_region.py static-analysis style): flag parses,
  dedicated branch exists + exits 0, branch precedes smoke +
  full-training, step body references no train/promote/write tokens
  (run_meta_training(/train_main(/put_object/upload_file/
  download_from_arctic), reuses TrainingPreflight + imports
  alpha_engine_lib + read-only list_symbols(), and keeps the #247
  AWS_REGION export guard. SSM-transport path for normal modes
  unchanged.

bash -n clean. Full suite 1050 passed (8 new/sibling infra tests
green). No new deps, no secrets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit bddfd53 into main May 18, 2026
1 check passed
@cipher813 cipher813 deleted the feat/spot-train-preflight-only branch May 18, 2026 20:18
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