StocksGravity — Bullpen Governance, Frame-Tuning & Evaluation Rules (bullpen/rules.md)
This document codifies the governance rules for the /bullpen skill (cio_director / cio-strategist): defining strategy frames (spec.json & rules.md) for /advise and /operate, conducting post-trade retrospectives across all portfolios (portfolios/<id>/takeaways.md), and evaluating desk pipelines and algorithms (bullpen/takeaways.md).
Ultimate Goal (North Star Mandate): Every frame adjustment, retrospective, and algorithm proposal must optimize for maximizing net risk-adjusted profit (compounding after fees, churn, and cash drag; upside capture; payoff asymmetry) while minimizing permanent capital loss and drawdown within each portfolio's hard safety bounds. Defense without upside capture (chronic idle cash or premature winner-capping) is a failure mode equal to uncontained loss.
1. Non-Execution & Non-Chaining Boundary
- Zero Trade or Ledger Execution:
/bullpennever executes BUY/SELL transactions, never mutatesassets.json,transactions.json,orders.json,signals.json,advice.md, orstate.md, and never simulates or mirrors cash flows. - Zero Downstream Chaining:
/bullpennever calls/advise,/operate,/simulate-trade,/research, or/analyse. It strictly defines the strategic frame (spec.jsonandrules.md) and writes retrospective evaluations (takeaways.md) that future/adviseand/operateruns consume.
2. Portfolio Frame Governance (spec.json & rules.md)
| Portfolio Scope | Spec Edit Authority | Autonomy Level | /bullpen FrameAuthority | Where Takeaways & Frame Changes Are Recorded |
|---|---|---|---|---|
| Level 3 Funds | Bullpen (universe, trading, regimes) | Level 3 | Direct Frame Tuning: /bullpen directly updates portfolios/<bp_id>/spec.json and portfolios/<bp_id>/rules.md within hard safety bounds. | portfolios/<bp_id>/takeaways.md §3 (Applied Frame Adjustments) |
| Level 1 / 2 Funds | User only | Level 1 or Level 2 | Suggest-Only: /bullpen never mutates spec.json or rules.md directly. | portfolios/<id>/takeaways.md §3 (Proposed Frame Adjustments for User Review) |
Immutable Safety Bounds for Level 3 Frame Tuning
When /bullpen tunes spec.json on a Level 3 portfolio, it must obey these hard desk floors:
- Position & Sector Caps:
max_position_pct <= 50.0%;max_sector_pct <= 85.0%. - Stop-Loss & Cash Reserve Floors:
default_stop_loss_pct <= 25.0%;min_cash_reserve_pct >= 2.0%. - Regime Template Parity (
regimes.templates): Enabled dynamic regime templates are subject to identical ceilings (max_margin_leverage <= 1.5x,max_position_pct <= 50.0%,max_sector_pct <= 85.0%,default_stop_loss_pct <= 25.0%, non-marginmin_cash_reserve_pct >= 2.0%, margin cash floor>= -(max_margin_leverage - 1) * 100%). - Stop-Breach Triage Controls (
trading.exit_and_retention): Level 3/bullpenmay togglestop_breach_mode(HARD_STOP|ONE_TIME_WIDEN),stop_breach_action(DEFENSIVE_TRIM|FULL_CLEAR),defensive_trim_pct(20.0%–75.0%),defensive_trim_min_thesis_score(50–85),one_time_widen_min_thesis_score(65–90), andmax_widened_stop_loss_pct(5.0%–15.0%, strictly<= 1.5x default_stop_loss_pct). Non-overridable invariants: zero BUY adds on a breached/widened-stop position, max1non-trim widen per position lifetime (stop_widen_count <= 1), stop-blindThesis Scoregating, liveRSI-14 < 35,Net Score >= +5/8, Red Team strictlyCLEAR(noCAUTION/VETO), drawdown breaker inactive, and unconditional 14-daybreached_sinceliquidation. - Anti-Churn Turnover Guard (
trading.turnover_guard):enabled: true,max_rolling_7d_turnover_pct <= 50.0%,same_ticker_roundtrip_cooldown_hours >= 48.0h. - Red Team VETO & Consensus: Binding Forensic Red Team VETO is non-negotiable (
consensus_threshold >= 4). - Statistical Sample & Burn-In Discipline: Require
N >= 30independent bot-originated closed round trips post-inception (statistically_ready_for_tuning; seeded in-kind unwinds are excluded and reported separately viabullpen/lots.py) before tuning Level 3spec.jsonparameters on noisy short-term variance; require concrete trade evidence inportfolios/<id>/takeaways.mdshowing net improvement to profit capture or loss minimization. Manual Level 3 CIO frame edits enforce a 72h per-fund cooldown (automated[AUTO-RECONCILE]holdings-drivenuniverse.other_universescustody updates are logged and exempt). Before promoting any Level 3 strategy to real capital, pass the--healthPaper Burn-In Gate (>= 60NYSE trading days,>= 30originated round trips,slippage_bps > 0, benchmark-adjusted excess TWRR> 0AND MTM Profit Factor>= 1.25,0spec/reconciliation violations).
3. Post-Trade Retrospective Protocol (portfolios/<id>/takeaways.md)
Every active portfolio (both bp_* and non-bp_*) maintains a dedicated takeaways.md structured in three sections:
- §1 Post-Trade & Execution Scorecard:
- Cash-Flow-Invariant TWRR / Modified Dietz Return, Benchmark Excess Return, MTM Total-Return Profit Factor & Expectancy, Realized Win Rate, Payoff Ratio (Avg Win / Avg Loss), Cumulative Realized P&L, Unrealized Open P&L, Fee Drag, Rolling 7d Turnover, and Twin Return Comparison (where paired).
- Post-Exit Price Follow-Through Audit (per SELL fill,
bullpen/follow_through.py): measures the move from the fill price to the close 10 NYSE trading days after the exit day, net of the fund benchmark's move over the same window (5d reported alongside), so the verdict no longer depends on the day the report runs: - Protective Exits: 10d benchmark-excess
<= -3.0%. - Whipsaw / Premature Exits: 10d benchmark-excess
>= +3.0%. - Fills younger than 10 trading days are
PENDING, fills without price barsUNPRICED; neither counts. Every fill carries its exit trigger (stampedcontext.trigger, else inferred fromrationale) and lot origin (seeded vs originated). - Protective Wins (Good Exits): Asset continued declining (
<= -2.0%below exit price) after liquidation/trim, validating the stop or retention exit. - Whipsaw / Premature Exits (Sold the Bottom): Asset rebounded (
>= +3.0%above exit price) after a tight stop-out or low Holding Score trim, signaling stop distance or retention threshold miscalibration. - §2 Trade Lessons (What Worked vs. What Failed):
- Concrete ticker-level lessons highlighting effective entries/holds vs. premature stop-outs, over-trading churn, or unharvested surges.
- §3 Spec & Rules Frame Recommendations (
spec.json&rules.md): - Exact parameter recommendations (e.g.,
default_stop_loss_pct,holding_score_trim_threshold,holding_score_exit_threshold,min_entrance_score,max_rolling_7d_turnover_pct,asset_universe,harvest_exempt_tickers) — applied directly onbp_*funds and staged as proposals on non-bp_*funds. - Bounded Historical Data & Automatic Change Logging:
- Every
portfolios/<id>/takeaways.mdembeds a compact `marker. Wheneverspec.jsonis edited (or--log-changeis passed),sync_bullpen_registry.pyautomatically diffs the parameters and prepends a timestamped row to **### 📜 Applied Frame Change Log (Last 10)** inportfolios/<id>/takeaways.mdand **## 4. Recent CIO Frame Change Log (Last 15 Across Desk)** inbullpen/takeaways.md`. - Historical tables are strictly capped to prevent file bloat: Top 8 rows in the Post-Exit Follow-Through table, Last 10 rows in each portfolio's Frame Change Log, and Last 15 rows in the desk-wide Frame Change Log (older rows are automatically pruned on regeneration).
4. Pipeline & Suggestion Algorithm Evaluation (bullpen/takeaways.md)
bullpen/takeaways.md aggregates cross-portfolio telemetry to audit and improve the desk's suggestion algorithms (/research -> /analyse -> /advise -> /operate):
- §1 Cross-Portfolio & Twin Frame Synthesis: Measures whether Level 3 autonomous execution maximized net return and minimized drawdown vs. Level 1/2 reference twins (
fund_alpha,fund_beta,fund_gamma,fund_delta), decomposing the gap into upside capture, loss avoidance, turnover drag, cash drag, fee drag, and position weight divergence. - §2 Pipeline & Signal Hit-Rate Audit: Evaluates the empirical accuracy of
Entrance Scoreon BUY fills (upside capture & payoff ratio),Holding Score(< 30exit /< 40reduce) and Stop Breach triages on SELL fills (loss prevention vs whipsaw cost), raw technical entry gating, and 7d Turnover Guard behavior (churn prevention vs stranded-cash drag). - §3 Suggestion Algorithm & Pipeline Improvement Proposals: Maintains an evidence-backed backlog of formula and threshold improvements for
/adviseand/operateranked by expected net profit/loss impact.