Skip to content

feat(regime): drawdown de-risk leg in research brief + macro prompt (PR 4 / ROADMAP L99)#205

Merged
cipher813 merged 1 commit into
mainfrom
feat/regime-drawdown-research-surface
May 19, 2026
Merged

feat(regime): drawdown de-risk leg in research brief + macro prompt (PR 4 / ROADMAP L99)#205
cipher813 merged 1 commit into
mainfrom
feat/regime-drawdown-research-surface

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Plan: regime-drawdown-hysteresis-260518.md §6 item 4 — ROADMAP L99. PR 4 of the 6-PR ensemble-leg set. Producer arc (predictor #176/#177/#179 + ae #193) shipped+merged 2026-05-19; this is the research consumer surface (observe-mode, no behavior change).

What

  • agents/macro_agent.py — new _format_drawdown_leg(): renders the SPY tiered drawdown + book-vs-market excess as a continuous, market-grounded statement + the composed effective_regime (most-protective over the ensemble). HMM weeks_in_current_state reframed as a filter-stability diagnostic, explicitly NOT a market-duration statement (origin: the misleading "P(neutral)=1.00, 50 weeks in state").
  • graph/research_graph.py_build_regime_trend drops the "Weeks in State" column for a continuous SPY Drawdown + composed Effective column; Summary carries the continuous statement (SPY X% off trailing peak; book Y% off NAV HWM; Z pp deeper).

Fallbacks (tested)

Notes

Tests

+8 targeted; full suite 1372 passed. max_tokens lint allowlist line ref bumped 476→562 (critic call relocated by the insertion; unchanged 512 literal).

🤖 Generated with Claude Code

…R 4)

Plan regime-drawdown-hysteresis-260518.md §6 item 4 (ROADMAP L99). The
producer arc (predictor #176/#177/#179, ae #193) shipped 2026-05-19 and
now fills substrate["drawdown"] + substrate["effective_regime"] weekly;
this is the research consumer surface.

- agents/macro_agent.py: new _format_drawdown_leg() renders the SPY
  tiered drawdown + book-vs-market excess as a continuous,
  market-grounded statement plus the composed effective_regime
  (most-protective over the ensemble). The HMM "weeks_in_current_state"
  line is reframed as a filter-stability DIAGNOSTIC, explicitly NOT a
  market-duration statement (origin: the 2026-05-15 brief's misleading
  "P(neutral)=1.00, 50 weeks in state").
- graph/research_graph.py: _build_regime_trend drops the "Weeks in
  State" column for a continuous "SPY Drawdown" + composed "Effective"
  column, and the Summary line carries the continuous statement
  ("SPY X% off trailing peak; book Y% off NAV HWM; Z pp deeper").

Fallbacks (both tested):
- absent-key: no substrate["drawdown"] (pre-#176/#179) ⇒ the leg block
  is omitted entirely — byte-identical to the prior HMM-only path.
- portfolio-unavailable: drawdown.excess.available=False ⇒ SPY leg
  still renders; excess line states it is unavailable; never raises.

flag-name note: consumers/config use drawdown_regime_enabled (matches
shipped predictor #178 + ROADMAP/SYSTEM_STATE), not the plan doc's
stray L214 regime_drawdown_enabled spelling.

Tests: +8 (drawdown columns, continuous summary, absent-key, NAV
unavailable, macro-prompt leg rendering). max_tokens lint allowlist
line ref bumped 476→562 (critic call relocated, unchanged 512 literal).
Full suite 1372 passed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit c3a7026 into main May 19, 2026
1 check passed
@cipher813 cipher813 deleted the feat/regime-drawdown-research-surface branch May 19, 2026 17:54
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