feat(regime): executor drawdown-leg posture override (PR 4, gated default-off)#193
Merged
Conversation
…ault-off) PR 4 of the drawdown-regime arc — executor consumer. Mirrors the Stage-F forced-bear posture override. Gated drawdown_regime_enabled (risk.yaml, default false) → zero behavior change on merge. Plan: regime-drawdown-hysteresis-260518.md; ROADMAP config #230. - signal_reader.py: read_drawdown_substrate (regime/drawdown/latest.json, mirror of read_fast_signal) + extract_drawdown_effective_regime (handles the nested compose_effective_regime dict + a bare string; None/malformed → None ⇒ no override). - main.py planner: new "2b'''" block after the forced-bear block. UNGATED read every cycle (parallel-observe), GATED behavior. Override is MOST-PROTECTIVE (rank bull<neutral<caution<bear): drawdown "bear" forces bear, "caution" raises neutral/bull → caution but never lowers an already-bear posture (e.g. one forced_bear just set) — no downgrade. Flag off ⇒ counterfactual logged, no behavior change. Same try/except resilience as the forced-bear block. - risk.yaml.example: drawdown_regime_enabled: false + doc, sibling to regime_forced_bear_enabled (observe→promote gate, plan §5). - tests/test_regime_drawdown_executor.py: +17 — extract shape matrix (nested/bare/None/non-dict/missing/empty/non-string), canonical prefix read, None-artifact composes to None (⇒ no override). 17 targeted + 146 regime/signal_reader + 78 planner/risk_guard tests pass, zero failures; main.py compiles. Co-Authored-By: Claude Opus 4.7 (1M context) <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
PR 4 of the drawdown-regime arc — the executor consumer. Mirrors the Stage-F forced-bear posture override. Gated
drawdown_regime_enabled(risk.yaml, defaultfalse) → zero behavior change on merge. Reads theregime/drawdown/latest.jsonartifact predictor PR #177 already produces (no dependency on the predictor-veto PR #178). Plan:regime-drawdown-hysteresis-260518.md; ROADMAP alpha-engine-config #230 (P1).Changes
executor/signal_reader.py—read_drawdown_substrate(mirror ofread_fast_signal, canonicalregime/drawdownprefix) +extract_drawdown_effective_regime(handles the nestedcompose_effective_regimedict and a bare string;None/malformed →None⇒ no override).executor/main.pyplanner — new2b'''block after the forced-bear block. Ungated read every cycle (parallel-observe), gated behavior. The override is most-protective (rankbull<neutral<caution<bear): drawdownbearforces bear;cautionraises neutral/bull → caution but never lowers an already-bear posture (e.g. one a forced_bear override just set) — strictly no downgrade. Flag off ⇒ counterfactual logged, no behavior change. Same try/except resilience as the forced-bear block.config/risk.yaml.example—drawdown_regime_enabled: false+ doc, sibling toregime_forced_bear_enabled(observe→promote gate, plan §5).tests/test_regime_drawdown_executor.py(+17): extract-shape matrix, canonical-prefix read, None-artifact composes to None ⇒ no override (mirrorstest_regime_fast_signal_executor.py).Tests
17 targeted + 146 (
-k "regime or signal_reader or forced_bear or drawdown") + 78 (-k "main or planner or risk_guard or posture") pass, zero failures;main.py/signal_reader.pybyte-compile clean.Arc status
#176 ✅ · #177 ✅ · #178 ✅ (predictor-veto) · #this (executor posture) · remaining: research brief + macro prompt · dashboard observe panel · config EXPERIMENTS gate + SYSTEM_STATE/ROADMAP.
🤖 Generated with Claude Code