From e9d58fb94d18af7585b3ead16b3ed1891831cadf Mon Sep 17 00:00:00 2001 From: FlyM1ss Date: Thu, 15 Oct 2026 17:38:55 -0400 Subject: [PATCH] docs: record that #638 shipped most of D19 Review widened P1: day_session_windows now ends an early close at 13:00 for aggregation, the open-stamped filter and the session-close fill. The plans and direction docs still assigned all of D19 to the engine rewrite. Mark it shipped except the close-stamped time_in_session, log the two review commits in the P1 plan, and strike the copy items 87ba5117 already fixed. Co-Authored-By: Claude Opus 5.5 --- ...2026-10-14-live-board-fixes-p1-early-close.md | 16 ++++++++++++---- .../plans/2026-10-14-live-board-fixes.md | 4 +++- .../specs/2026-10-14-atl-direction.md | 2 +- .../2026-10-14-atl-direction/context-brief.md | 2 +- .../engine-fix-cost-probe.md | 2 +- .../engine-live-board-reprice.md | 4 ++-- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/superpowers/plans/2026-10-14-live-board-fixes-p1-early-close.md b/docs/superpowers/plans/2026-10-14-live-board-fixes-p1-early-close.md index d6484659..2967de5d 100644 --- a/docs/superpowers/plans/2026-10-14-live-board-fixes-p1-early-close.md +++ b/docs/superpowers/plans/2026-10-14-live-board-fixes-p1-early-close.md @@ -1561,7 +1561,16 @@ Alpaca could not be checked, because the key in `dashboard/.env` answers 401 eve - An early close counts as one trading day. 252×6.5 annualisation is unchanged: two half days remove about 0.4% of session hours. - No bar-cache schema bump, because the filter runs after the fetch. - No stored curve changes, if P1 deploys before the 2026-11-27 13:30 ET settle. -- D19 stays with the engine rewrite. +- ~~D19 stays with the engine rewrite.~~ Superseded at review; see *Review commits* below. + +### Review commits (merged in #638, 2026-10-15) + +| Commit | Change | Why | +|---|---|---| +| `1acb75dc` | `sessions.day_session_windows`, the per-day owner read by `is_in_session`, `is_session_close` and `bar_aggregation.aggregate_bars`. US is decided by market name, not window shape. Drops `REGULAR_CLOSE_TIME` (the CodeQL note). | Only the open-stamped filter knew the 13:00 close. Aggregation still built a 13:30 bucket from 12:30–12:59 and nothing filled it, so a minute-source run lost its closing decision. Conformance T05 moves from D19/D8 to D2/D16. | +| `87ba5117` | `leaderboard/service.py` as-of and daily-window cutoffs read `session_close_time`. `_yahoo` accepts both New York zone spellings, logs `ERROR: yahoo.exchange_zone_missing` instead of silently skipping the restamp, and dedupes its ERRORs per (symbol, day). Live board copy names the 13:00 close (`leaderboard.js` v=38). | The board's own cutoffs still assumed 16:00, and a missing zone field was the silent path. | + +What remains of D19 is the close-stamped `time_in_session`, which still admits stamps to 16:00. It reaches close-stamped frames only (`vnpy_simulation`, test doubles). The dated post-deploy checks are issue #639. ### Open @@ -1580,15 +1589,14 @@ Alpaca could not be checked, because the key in `dashboard/.env` answers 401 eve - State the evidence gap. - Cite LEAN's note that ignoring varying close times "introduces look-ahead bias" (quantconnect.com/announcements/17380). - **Engine rewrite:** - - Read D19 from the same `session_close_time`, as zipline does with per-session masking. + - ~~Read D19 from the same `session_close_time`~~ Done in #638 (`day_session_windows`), except the close-stamped `time_in_session`. - Compute indicators on regular-hours bars. Today every path computes them on all-hours frames before filtering. LEAN defaults to regular hours, IBKR has `useRTH`, and TradingView pins sessions. - Stamp `early_close_sessions` into `agent_runs.metadata` beside `feed_provenance`. - **Live board:** - A nightly Alpaca calendar cross-check that only reports (`ERROR: live.calendar_mismatch`) and never overrides the rule. - A bar fingerprint in the checkpoint metadata, so a month replay can tell revised bars from model drift. - **Copy (owner-coordinated; P6 or a follow-up):** - - `app.html:1593` ("after the 16:00 ET cash close"). - - `js/leaderboard.js:776` ("after the 16:00 ET cash session"). This needs a cache-buster bump. + - ~~`app.html:1593` and `js/leaderboard.js:776`~~ Done in #638 (`87ba5117`, v=38). - The client-side session clocks (`js/admin-ticker.js:231`, `app.js:6793`, `home-page.js:1030`) hard-code 09:30–16:00 with no holidays. - A comment noting that `PIPELINE_DECISION_BARS_PER_TRADING_DAY = 7` is an upper bound. - **Context lake:** CLAUDE.md's "`_find_cached_run` reuses a row on `(mode, start_date, end_date, llm_model)` alone" and the matching comment at `service.py:2103` are stale. `_cache_match_rank` also ranks on recorded capital and strategy prompt. diff --git a/docs/superpowers/plans/2026-10-14-live-board-fixes.md b/docs/superpowers/plans/2026-10-14-live-board-fixes.md index 46c385b4..ef17ce06 100644 --- a/docs/superpowers/plans/2026-10-14-live-board-fixes.md +++ b/docs/superpowers/plans/2026-10-14-live-board-fixes.md @@ -100,6 +100,8 @@ These are the plan author's decisions from the 2026-10-14 mapping. Each per-PR f The close-stamped path stays untouched; D19 belongs to the engine rewrite. The conformance suite must show no XPASS. + *As shipped (#638, 2026-10-15):* review widened this. `sessions.day_session_windows` ends an early close at 13:00 for aggregation, the open-stamped filter and `is_session_close` alike, so most of D19 shipped with P1 and conformance T05 now fails as D2/D16 instead of D19/D8. Only the close-stamped `time_in_session` still admits stamps to 16:00; it reaches close-stamped frames only (`vnpy_simulation`, test doubles). `REGULAR_CLOSE_TIME` was dropped as unused. + *Deviation, recorded in P1:* the close **times** (`EARLY_CLOSE_TIME`, `REGULAR_CLOSE_TIME`, `session_close_time`) live in `sessions.py`, and only the **dates** live in the calendar. The reason is that `test_no_module_restates_the_session_bounds` forbids `time(13, 0)` / `time(16, 0)` anywhere else. *Amended 2026-10-15 after a prior-art scan (P1's last section).* Three changes: @@ -169,7 +171,7 @@ These are the five inputs the spec implies, no task originally exercised, and th - **The methodology page, and the subtitle link to it** (spec §4) belong to their own plan. The subtitle stays plain text here. - **Nemotron's Season 1 source.** This is an owner decision (below). - **#587** (a replay rewrites the month-to-date curve at every checkpoint) is perf only. P4's `live_from` makes the newcomers start on the 1st, so no replay happens. -- **The engine rewrite and everything it owns:** D19 close-stamped sessions, stop-loss/take-profit execution, fees and costs, Season 1. +- **The engine rewrite and everything it owns:** the close-stamped `time_in_session` remainder of D19 (#638 shipped the rest), stop-loss/take-profit execution, fees and costs, Season 1. - **User-facing docs outside P7 PR B:** see the follow-up list in the PR that adds this plan. - **A night lost to a total market-data failure reads "an internal error"** on the board. It reaches the attempt classifier as `RuntimeError('No market data returned…')`, and naming it properly needs a typed error raised in `live.py`. That is a follow-up issue, not part of P3. diff --git a/docs/superpowers/specs/2026-10-14-atl-direction.md b/docs/superpowers/specs/2026-10-14-atl-direction.md index 21506ac8..fba71eae 100644 --- a/docs/superpowers/specs/2026-10-14-atl-direction.md +++ b/docs/superpowers/specs/2026-10-14-atl-direction.md @@ -92,7 +92,7 @@ All three reports are estimates (±50%). They are not commitments. - No open-source engine is adopted, because adoption never pays back on this scope. This closes engine phase 1. - **Order of work:** 1. Option-neutral work first: - - the calendar (D19); + - the calendar (D19; mostly shipped in #638 on 2026-10-15, leaving only the close-stamped `time_in_session`); - fee tables; - P19 Sharpe and D20; - corporate actions; diff --git a/docs/superpowers/specs/2026-10-14-atl-direction/context-brief.md b/docs/superpowers/specs/2026-10-14-atl-direction/context-brief.md index 2e577c83..760550b7 100644 --- a/docs/superpowers/specs/2026-10-14-atl-direction/context-brief.md +++ b/docs/superpowers/specs/2026-10-14-atl-direction/context-brief.md @@ -88,7 +88,7 @@ ATL runs three surfaces on one legacy engine. My Agents backtests fail ATL's own | SEC 31 / TAF fees | Default in none checked [web, conf=med] | Owner chose dated SEC/TAF on, which would exceed the bar [gatherer-reported] | | Seeded determinism | Differentiator; Nautilus seeds the fill model only [web, conf=high] | Unproven | | Published "what we don't model" list | LEAN, Nautilus, Backtrader and Alpaca paper all have one [web, conf=high] | None. The cheapest gap to close | -| Early-close calendar | Not retrieved for any peer | Lacks (D19) | +| Early-close calendar | Not retrieved for any peer | Lacks (D19). Has it since #638 (2026-10-15) | Peers earn credibility by documenting assumptions that users can override, not by non-zero defaults [web, conf=high]. A defensible minimum for ATL is a methodology page plus fixes for D2, D10, D11 and D19 (inference). diff --git a/docs/superpowers/specs/2026-10-14-atl-direction/engine-fix-cost-probe.md b/docs/superpowers/specs/2026-10-14-atl-direction/engine-fix-cost-probe.md index 257a57e6..b83c6d5d 100644 --- a/docs/superpowers/specs/2026-10-14-atl-direction/engine-fix-cost-probe.md +++ b/docs/superpowers/specs/2026-10-14-atl-direction/engine-fix-cost-probe.md @@ -316,7 +316,7 @@ Where the two diverge: | Item | Likely days | |---|---| - | D19 calendar | 1.6 | + | D19 calendar (mostly shipped in #638, 2026-10-15) | 1.6 | | Dated US fee tables | 1.0 | | P19 Sharpe, risk-free rate, and server-side Sharpe for D20 | ≈5.5 | | Corporate-action sourcing and back-adjusted indicators | 4.0 | diff --git a/docs/superpowers/specs/2026-10-14-atl-direction/engine-live-board-reprice.md b/docs/superpowers/specs/2026-10-14-atl-direction/engine-live-board-reprice.md index 76d4dbe1..5603c24a 100644 --- a/docs/superpowers/specs/2026-10-14-atl-direction/engine-live-board-reprice.md +++ b/docs/superpowers/specs/2026-10-14-atl-direction/engine-live-board-reprice.md @@ -79,9 +79,9 @@ The Hyperliquid increment itself is unreconciled: +23.5 days red-team (ATL write ### Stage 0: start now, about 24 likely days, needed under every option -- **The probe's 15.35 days:** D19 calendar 1.6, fee tables 1.0, P19 Sharpe ≈5.5, corporate actions 4.0, fractional and fee persistence 2.25, INT-2 stamp 1.0. +- **The probe's 15.35 days:** D19 calendar 1.6 (mostly shipped in #638, 2026-10-15), fee tables 1.0, P19 Sharpe ≈5.5, corporate actions 4.0, fractional and fee persistence 2.25, INT-2 stamp 1.0. - **Leaderboard decision tape, 2.5. Do this first.** Tapes cannot be backfilled, and today no leaderboard bar is recorded. Audit, nof1-style per-model trade logs ("ModelChat") and differentials all depend on it. -- **Early closes on the live axis, about 1 (judgement). Deadline 2026-11-27.** `live.py:56` hardcodes seven hourly nodes. Write the half-day test first. Whether the effect is mis-stamped bars or empty nodes is unverified. +- **Early closes on the live axis, about 1 (judgement). Deadline 2026-11-27.** *Shipped in #638 (2026-10-15).* `live.py:56` hardcodes seven hourly nodes. Write the half-day test first. Whether the effect is mis-stamped bars or empty nodes is unverified. - **Carry trade memory in the snapshot, about 1 (judgement).** This is a live defect today. `restore_state` never restores `self.trades`, and `recent_trades` is built from it (`portfolio_manager.py:445`). So every nightly increment starts with an empty 24-hour memory. - **D12 disclaimer, 0.4.** The prompt advertises stop and take-profit orders that are ignored, on a public board. - **Leaderboard Sharpe on the P19 method, 1.5.**