Priority 4 (MCP roadmap): option_minute_paths substrate + labeler outage fix#32
Merged
Conversation
…age fix Minute-path companion table (must-fix #6g / RM-002 / TF-14): - NEW profit_scout.option_minute_paths — per-minute option bars over each pool candidate's 3-trading-day excursion window. DDL + one-shot backfill (executed 2026-07-07: 144,448 bars / 2,675 contract-days back to 2026-04-13) + daily top-up via NEW forward-paper-trader POST /persist_minute_paths (reconciles the last 3 scan_dates each evening, DELETE-then-LOAD with the explicit schema, token-gated with POOL_LIQ_REFRESH_TOKEN, fully walled from the trader/labeler paths). - Unlocks MCP replay_contract + estimate_exit_rule exact first-crossing (heuristic_share 0.1045 -> 0.0) + trailing-rule scoring (gammarips-mcp PR #9). Classification: REALIZED TAPE — never a feature, never read by selection or the live trader (review-verified). PRODUCTION FIX folded in (discovered during this work): the labeler (/label_enriched_pool) had been failing since scan 2026-07-02 — the 07-02 enrichment autodetect landmine recurring in _write_shadow_records' staging load (all-NULL recommended_spread_pct autodetects to STRING vs the staging table's FLOAT). Load now binds the staging table's EXPLICIT schema; schema drift handled by Python-typed ADD COLUMNs instead of autodetect. RECOVERED: scans 07-01 (50 labeled) + 07-02 (50 labeled) re-run clean; substrate current again. See DECISIONS/2026-07-07-labeler-staging-autodetect-outage.md. gammarips-review: SHIP-WITH-FIXES, all applied (incl. incremental audit of the labeler fix: SHIP; atomicity preserved, existing columns type-pinned). Co-Authored-By: Claude Fable 5 <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.
What
Engine half of MCP Priority 4 (RM-002 + TF-14) — the minute-path companion table that was engine must-fix #6g:
profit_scout.option_minute_paths— per-minute option bars over each pool candidate's 3-trading-day excursion window. DDL + backfill executed 2026-07-07 (144,448 bars / 2,675 contract-days back to 2026-04-13; 419 contract-days legitimately empty = the no-print illiquid tail).POST /persist_minute_pathson forward-paper-trader — evening reconcile of the last 3 scan_dates (DELETE-then-LOAD, explicit schema, token-gated with the sharedPOOL_LIQ_REFRESH_TOKEN, fully walled from the trader/labeler paths). Cloud Scheduleroption-minute-paths-refreshdaily 17:40 ET.🚨 Production fix folded in
While building this I found the labeler (
/label_enriched_pool) had been failing every evening since scan 2026-07-02: the 07-02 enrichment autodetect landmine recurring in_write_shadow_records' staging load (all-NULLrecommended_spread_pctautodetects to STRING vs the staging table's FLOAT → every load 400'd; the substrate silently stalled at scan 06-30). Fixed by binding the staging table's explicit schema on the load; schema-drift tolerance preserved via Python-typedADD COLUMNs on staging (no autodetect anywhere). Recovered live: scans 07-01 + 07-02 re-labeled (50/50 each, clean atomic writes); deployed as revforward-paper-trader-00049-mjwahead of tonight's cron. Decision note:docs/DECISIONS/2026-07-07-labeler-staging-autodetect-outage.md.Review & verification
gammarips-review: SHIP-WITH-FIXES on the change-set (all applied) + incremental SHIP on the labeler fix (atomicity preserved; existing columns type-pinned by the LIKE-clone; bool-before-int inference order verified). Live: anonscan_datesoverride → 403; tokened run reconciled 3 windows; scheduler ENABLED. MCP consumer: gammarips-mcp PR #9 (replay_contract + exact first-crossing + trailing scoring, smoke 52/52).Stacked on #31.
🤖 Generated with Claude Code