feat(regime): drawdown-leg predictor-veto clamp (PR 3, gated default-off)#178
Merged
Conversation
…off)
PR 3 of the drawdown-regime arc — first consumer. Mirrors the Stage-F
forced-bear veto clamp. Gated `drawdown_regime_enabled` (S3
predictor_params, default False) → zero behavior change on merge.
Plan: regime-drawdown-hysteresis-260518.md; ROADMAP config #230.
- get_veto_threshold: new drawdown_effective_regime param. When
drawdown_regime_enabled AND the composed daily drawdown effective
regime (ctx.drawdown_effective_regime, stamped by PR 2's daily stage)
is protective, clamp the veto threshold — bear → the same bear floor
as forced-bear (base-cap); caution → a milder floor (base-cap/2),
mirroring the discrete -0.20/-0.10 relationship.
- Refactored the clamp tail from the forced-bear early-return into a
single most-protective accumulator (min over {Wire4/discrete,
forced-bear, drawdown}). Behavior-preserving for every
currently-reachable state: with the drawdown flag off (always, today)
the return is identical to before; verified by the existing
forced-bear/Wire-4 tests + a new all-off regression test.
- Flag off ⇒ parallel-observe: the would-be clamp is logged (for the
promotion gate) without changing the threshold.
- call site passes ctx.drawdown_effective_regime (getattr default None).
- tests: +7 (TestDrawdownVetoClamp) — flag-off observe-only, bear/
caution floors, benign no-clamp, most-protective vs existing
threshold, composition with forced-bear, all-off regression.
361 veto/write_output/regime/daily_predict tests pass, zero failures.
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 3 of the drawdown-regime arc — the first consumer (predictor-side veto clamp). Gated
drawdown_regime_enabled(S3 predictor_params, defaultFalse) → zero behavior change on merge. Builds on #176 + #177 (merged). Plan:regime-drawdown-hysteresis-260518.md; ROADMAP alpha-engine-config #230 (P1).Changes (
inference/stages/write_output.py)get_veto_thresholdtakes a newdrawdown_effective_regimearg. Whendrawdown_regime_enabled=Trueand the composed daily drawdown effective regime (ctx.drawdown_effective_regime, stamped by PR 2's daily stage) is protective:bear→ the same bear floor as forced-bear (base − cap);caution→ a milder floor (base − cap/2), mirroring the discrete −0.20/−0.10 relationship.returninto a single most-protective accumulator (minover {Wire-4/discrete, forced-bear, drawdown}) so no clamp is half-honored. Behavior-preserving for every currently-reachable state — with the drawdown flag off (always, today) the return is identical to before; covered by the existing forced-bear/Wire-4 tests plus a new explicit all-off regression test.getattr(ctx, "drawdown_effective_regime", None).Tests
tests/test_veto_threshold.py→ newTestDrawdownVetoClamp(+7): flag-off observe-only, bear/caution floors, benign-regime no-clamp, most-protective vs an existing (bull-raised) threshold, composition with forced-bear (min wins), all-off regression. 361 tests pass (-k "veto or write_output or regime or drawdown or daily_predict"), zero failures — the accumulation refactor breaks no existing forced-bear/Wire-4 behavior.Arc status
#176 ✅ · #177 ✅ · #this (predictor-veto consumer) · next: executor
signal_readerposture override (alpha-engine repo, same gate) · then research brief / dashboard panel / config EXPERIMENTS gate.🤖 Generated with Claude Code