Skip to content

feat(agent_schemas): RegimeLiteral to 3-class (v0.42.0) — Phase 1A#86

Merged
cipher813 merged 1 commit into
mainfrom
feat/regime-literal-3class-v0.42
May 28, 2026
Merged

feat(agent_schemas): RegimeLiteral to 3-class (v0.42.0) — Phase 1A#86
cipher813 merged 1 commit into
mainfrom
feat/regime-literal-3class-v0.42

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

Caution-regime retirement Phase 1A — lib chokepoint. Plan doc: alpha-engine-docs/private/caution-regime-retirement-260528.md.

  • RegimeLiteral: Literal["bull","neutral","bear","caution"]Literal["bull","neutral","bear"] (3-class Ang-Bekaert taxonomy)
  • Version bump 0.41.00.42.0
  • New tests pin caution rejection on MacroEconomistRawOutput + MacroCriticOutput.suggested_regime

Why

The 4-class taxonomy double-counted the rule-based macro-agent caution override: VIX, HY OAS, and SPY 30d return are already weighted into regime_intensity_z (META_FEATURE 13) consumed by the predictor L2 Ridge and the executor's Stage D' wires. Portfolio-protective hysteresis (risk_on/caution/risk_off) is a separate institutional pattern emitted by the predictor drawdown leg — Phases 2A-2D separate drawdown_tier from market_regime in the type system.

Today's trigger: L1019 FOCUS_LIST_GATING_ENABLED flip was blocked by 5/24 SF logs showing WARNING [focus_list] no factor scores computed for regime=caution — focus_list_by_team empty across all 6 sector teams. Root cause: alpha-engine-research/config.py:125 hardcoded {bull,bear,neutral} dropped the (absent) caution YAML block, leaving the agent with zero tickers on caution-regime cycles.

Composes with

  • feedback_no_bandaids_go_big_or_home (architectural fix vs config-block band-aid)
  • feedback_sota_institutional_default_no_shortcuts (3-class Ang-Bekaert is the institutional baseline)
  • feedback_lift_invariants_to_chokepoint_after_second_recurrence (lib RegimeLiteral is the chokepoint)
  • L2842 continuous-regime-conditioning arc (this is the natural categorical-side finishing move)
  • L924 drawdown-hysteresis arc (Phase 2 prereq cleanup before drawdown_regime_enabled flips)
  • L1074 forced-bear arc (sequenced after Phase 1+2)

Phasing

  • Phase 1A (THIS PR) — ae-lib RegimeLiteral to 3-class
  • Phase 1B — ae-research macro_agent retirement + lib pin v0.42
  • Phase 1C — ae-data signals.schema.json enum trim
  • Phase 1D — ae-config universe.yaml regime_guardrails trim + ROADMAP write-back
  • Phase 2A-D — predictor + executor + backtester + research type-system separation (drawdown_tiermarket_regime)
  • Phase 3A-B — dashboard + backtester observability cleanup + grandfather
  • Phase 4 — predictor diagnostics docstring sweep (P2 deferrable)

Phase 1 + Phase 2 MUST ship together to avoid drawdown-leg type-mismatch crash on the first SF after Phase 1.

Test plan

  • pytest tests/test_agent_schemas.py — 50 passing (was 48; +2 new pins)
  • Full lib suite — 901 → 903 passing
  • Auto-tag v0.42.0 publishes to GitHub Releases on merge
  • Downstream consumers pin v0.42 in Phase 1B/1C/1D PRs

🤖 Generated with Claude Code

Caution-regime retirement Phase 1A — lib chokepoint. Plan doc:
alpha-engine-docs/private/caution-regime-retirement-260528.md.

The 4-class taxonomy (bull/neutral/bear/caution) double-counted the
rule-based macro-agent "caution" override: VIX, HY OAS, and SPY 30d
return are already weighted into the continuous regime_intensity_z
META_FEATURE consumed by the predictor L2 Ridge and the executor's
Stage D' Wire 1/2/3/4/5 sites. Discretizing those signals into a
4th regime category was the band-aid; the continuous SOTA path is
already running.

Portfolio-protective hysteresis (risk_on/caution/risk_off) is a
separate institutional pattern emitted by the predictor drawdown
leg (alpha-engine-predictor/regime/drawdown.py); consumers compose
the two axes via most-protective override at decision time. The
arc Phase 2 separates drawdown_tier from market_regime in the type
system to prevent the vocabulary collision that today aliases the
drawdown leg's "caution" into the macro-regime label.

Changes:
- RegimeLiteral: Literal["bull","neutral","bear","caution"] →
  Literal["bull","neutral","bear"] with docstring naming the
  3-class Ang-Bekaert anchor + the separate drawdown_tier axis.
- Version bump 0.41.0 → 0.42.0 (pyproject + __init__).
- New tests pin caution rejection on MacroEconomistRawOutput +
  MacroCriticOutput.suggested_regime, and accept-all-3-classes
  smoke for forward-compat.

Suite: 901 → 903 passing.

Composes with feedback_no_bandaids_go_big_or_home (architectural fix,
not config-block band-aid), feedback_sota_institutional_default_no_shortcuts
(3-class Ang-Bekaert is the institutional baseline), and
feedback_lift_invariants_to_chokepoint_after_second_recurrence (lib
RegimeLiteral is the chokepoint for the cross-repo cascade).

Sequencing: Phases 1B-1D (research + data + config) consume this
v0.42.0 tag via pin-bump; Phases 2A-2D ship together with Phase 1
to avoid drawdown-leg type-mismatch crash on the first SF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 92929cb into main May 28, 2026
6 checks passed
@cipher813 cipher813 deleted the feat/regime-literal-3class-v0.42 branch May 28, 2026 18:44
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