Priority 1 (MCP roadmap): interval pool-liquidity snapshot#31
Merged
Conversation
…scovery (7 must-fixes) - Atomic staging->verify->tx-replace write path (collector + enrichment), schema-drift-safe - Close regime-lookahead leak (scan-date anchored features; entry-close -> oc_* telemetry) - Degraded/empty-pool fail-loud + freshness monitor - Uniqueness guard + per-scan_date Firestore lock + gated 06-10 source-dedup - Persist mom_60 point-in-time + scheduled underlying-bar cache - Opportunity surface (MFE/MAE) + interim 3-day label arm + label-semantics tags - Features-only view + safe view + column tagging + dbt features model + DATA-CONTRACTS - Fix unauth SQL-injection surface + degraded-day overwrite (review blockers) All gammarips-review SHIP. Phase A deployed (enrichment-trigger-00046-stt, forward-paper-trader-00048-tqc). Backfill/view scripts gated (dry-run->--confirm), not yet run. Live pick/ledger/_simulate_contract mechanics unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… pipeline (07-02) The Phase A atomic write path loaded staged rows with autodetect=True; the permanently-NULL recommended_spread_pct (no options quotes on this Polygon plan) inferred as STRING and clashed with the LIKE-cloned FLOAT, failing every enrichment load since 07-02 09:38 ET -> no candidates -> no pick, missed 10:00 entry. Fix: bind the load to the cloned live schema (schema=get_table(staging).schema, drop autodetect, keep ALLOW_FIELD_ADDITION); atomic stage->verify->tx-replace unchanged. Isolation-proven, gammarips-review SHIP, deployed enrichment-trigger-00047-t7t, verified end-to-end (scan 07-01 -> 50 candidates). Also lands Phase B backfill fixes (both gammarips-review SHIP): backfill_mom_60 _update moved the CTE into the UPDATE FROM-subquery (BQ rejects WITH...UPDATE); backfill_opportunity_surface _merge builds staging via CREATE TABLE AS SELECT <cols> WHERE FALSE + explicit-typed load (CREATE TABLE LIKE cloned REQUIRED entry_day and the subset autodetect load 500'd). Decision-doc 07-02 CORRECTION section + handoff (NEXT_SESSION_PROMPT -> MCP productization focus). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… .gemini Aligns the Claude Code harness + canonical docs to current reality and the owner-locked monetization direction (docs-only; no code/policy change). CLAUDE.md: new Mission (free human UI = SEO funnel, monetize MCP access = BYO-agent, sell opportunity surface not a return, primitives-not-a-pick); Current policy V6 -> V7.1 Tilted GIGO (same-day 10:00 entry / +40 / -30 / flat 15:45, live-OI floor 1000 @ 09:45); repo map (agent-arena DEAD, +signal-judge/signal-notifier, gammarips-mcp noted as separate-repo product); fixed dead agent-arena deploy cmd + earnings-window wording. README.md: full refresh (V4 whale-following -> V7.1 + product framing + current services). ARCHITECTURE/TRADING-STRATEGY/GLOSSARY/MODELS/DATA-CONTRACTS/TESTING: cohort 2026-06-26, live-OI floor DEPLOYED/1000, pick ~09:45 ET, enrichment score>=4 + spread-gate-retired + top-50 BULLISH, opportunity-surface + 3-day arm now LIVE, policy_version V7_1_TILTED_GIGO, agent-arena removed as live consumer. agents: engineer (drop agent-arena/V2/V3/V3_MECHANICS, add MCP scope + never-autodetect + owner-waivable-DoD), researcher (repoint signals_labeled_v1 -> enriched_option_outcomes/enriched_features_v1 + substrate leakage tags), review (+autodetect-staged-load check that would've caught the 07-02 outage). Deleted deprecated .gemini/ harness (Gemini CLI no longer used). Corrected incident timestamp UTC->ET (05:38 ET). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… privacy on every channel All deployed to prod 2026-07-03 with gammarips-review gates (BLOCK→fix→SHIP where noted). Decision doc: docs/DECISIONS/2026-07-03-pool-track-record-and- generator-depicking.md. Owner directive: "Run it… get us clean and consistent engine to webapp." - win-tracker (rev 00015+): NEW /pool_outcomes endpoint — whole-pool aggregates from enriched_option_outcomes → Firestore pool_outcomes/current for the public Track Record page. Sim-version-tag filtered (legacy NULL same-day cohort verified against the documented GIGO composite), honest V6-legacy 3d-arm labeling, opp-surface pinned to OPP_MFE_MAE_V1, 503 fail-loud on degraded substrate. Cron: pool-outcomes-refresh 17:20 ET. - enrichment-trigger (rev 00048): thesis prompt → thesis_v2_descriptive (no entry/target/stop voice, no "recommended", no scan-count quoting; FOCUS CONTRACT block; prompt_version stamped in traces). - overnight-report-generator (rev 00019): report_v3_descriptive (Pool Snapshot replaces Directional Calls; no trade-instruction voice on any horizon; no bullish-share/z-score prose; no internal field-name debris). - blog-generator (rev 00028): repositioned to free-site/Agent-Access; dead products forbidden at prompt level; webapp_visit paid-pitch regex learns "agent access"/$39. voice_rules exemplars updated (vendors into x-poster at ITS next deploy; RETIRED_ALIASES additions deliberately deferred). - signal-notifier (revs 00053, 00054): subscriber pick fan-out RETIRED (the pick is the operator's private signal — old code would have emailed it to every new Agent Access subscriber) and the WhatsApp/OpenClaw channel DEPRECATED to a hard no-op (owner call; env vars were already absent). Operator email path byte-identical. - forward-paper-trader + create_enriched_option_outcomes: comment-only — isolation notes updated to cite the 2026-07-03 read-path decision. - docs: 2026-07-02 service-auth-hardening decision note (was untracked), 2026-07-03 decision doc, NEXT_SESSION_PROMPT handoff. Also this session (other surfaces): webapp main = e4f2c983 (Track Record, six-item nav, Learn spine, de-picked emails), x-poster pick crons paused, Firestore blog triage (9 archived + 301s, 3 patched). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New signal-notifier module + endpoint that re-reads liquidity for the WHOLE current enriched pool every ~10 min during RTH (plus a pre-open pass) into the new profit_scout.pool_liquidity_snapshot table, so the MCP can serve decision-time liquidity cache-first (one call per shortlist instead of N upstream fetches at 10:00 ET). - pool_liquidity.py: full-snapshot fetch (OI/volume/last/day OHLC/IV/greeks + underlying-price fallback chain), explicit-schema insert_rows_json (no autodetect), fully fail-soft, HARD leakage wall — separate from the C1-walled _fetch_live_oi; never imported by run_notifier; table is TELEMETRY (as_of-keyed), never a feature. - /refresh_pool_liquidity: NYSE-day + 09:15-16:05 ET self-gate; token-gated via secret-mounted POOL_LIQ_REFRESH_TOKEN (hmac.compare_digest); force/ scan_date knobs refused without the token (review FIX-1); scan_date 400-validated; 120s min-interval spam guard. - Cloud Scheduler pool-liquidity-refresh: 2-52/10 9-16 * * 1-5 ET (offset clears the ~09:45 pick run on the same max-instances=1 service, FIX-2). - DDL: scripts/ledger_and_tracking/create_pool_liquidity_snapshot.py (executed 2026-07-07; partition DATE(as_of), cluster contract). - Docs: DECISIONS/2026-07-07-pool-liquidity-snapshot.md + DATA-CONTRACTS section (classification: TELEMETRY, never a feature; RM-001b NULL quote placeholders documented). gammarips-review: SHIP-WITH-FIXES — all 5 fixes applied. Verified live: rev signal-notifier-00055-sgn; anon force=403; tokened pass wrote 50/50; scheduler job ENABLED. MCP counterpart: gammarips-mcp PR #6. 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 (top commit —
1289e5a)The engine half of the MCP roadmap's Priority 1: liquidity you can check at any time (RM-006 / 1A):
signal-notifier/pool_liquidity.py— every ~10 min during RTH (plus a ~09:22 ET pre-open pass), re-fetches the full Polygon option snapshot for ALL ~50 current-pool contracts (OI, session volume, last trade, day OHLC, IV/greeks, underlying-price fallback chain) and appends one row per(contract, as_of)to the newprofit_scout.pool_liquidity_snapshottable. Explicit-schemainsert_rows_json— no load jobs, no autodetect (the 07-02 outage rule).POST /refresh_pool_liquidity— NYSE-day + 09:15–16:05 ET self-gate; token-gated via secret-mountedPOOL_LIQ_REFRESH_TOKEN(hmac.compare_digest);force/scan_daterefused without the token; 120s spam guard.pool-liquidity-refresh—2-52/10 9-16 * * 1-5ET (offset keeps passes clear of the ~09:45 pick run on the same max-instances=1 service).Leakage wall (the part that matters)
The table is TELEMETRY — never a feature: entry-day-live,
as_of-keyed, never joined intoenriched_features_v1/any as-of ≤ scan_date surface, never read by the tournament. The pick path's C1-walled_fetch_live_oiis untouched;run_notifiernever imports the new module (verified by review). Quote columns are NULL placeholders pending the RM-001b quote-feed purchase; the MCP omits them while NULL.Verification
gammarips-review: SHIP-WITH-FIXES — all 5 fixes applied (token gate fail-closed on force/scan_date, cron offset, scan_date 400,hmac.compare_digest, ET-date agg fallback).signal-notifier-00055-sgn: anonymousforce→ 403; tokened pass wrote 50/50 pool rows; scheduler job ENABLED.get_contract_snapshot+ newget_pool_liquidity), smoke 41/41.Note on the stack
This branch is based on the local
substrate-hardening-2026-07-01line (4 prior commits: substrate hardening 7 must-fixes, 07-02 enrichment autodetect fix, harness doc de-drift, coherence waves) which was never pushed — those commits appear in this PR because they are its base and are already live in prod. Merge order is: those first (they're in this PR), or merge this PR whole.🤖 Generated with Claude Code