Repository navigation
fix(quant): harden forward shadow ledger, execution rules, portfolio accounting & allocator (Rounds 2-6) - #28
Merged
ZhuLinsen merged 1 commit intoNov 22, 2026
Conversation
ZhuLinsen
deleted the
fix/quant-execution-shadow-portfolio-and-allocator-rigor
branch
November 22, 2026 06:23
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
Rounds 2-6 of the AlphaEvo hardening & RSI audit program:
strategy_hash+market+market_rules, preserved backward-compatible SHA-256 verification for pre-upgrade commits, strictly excludedis_replayoutcomes from live promotion gates and CANARY/ACTIVE halt checks, prevented uncommitted orphan outcomes from qualifying when commit history exists, and enforced maturity-datestage_entered_as_offor CANARY dwell.RLock+fcntl.flock) across commits/verification/backfill/promotion, atomicmkstemp+fsync+os.replacewrites, monotonic disk persistence withhorizon_end_datecutoff views,MarketRuleCheckerbuy/stop/exit checks (including T+1 & gap-down open stop fills), wall-clock live commit causality (committed_at.date() + 1d), equal-weight CLI market proxy withopenintraday return preservation +observed_count/return_countguards, covered-only excess averages, and late-arriving benchmark enrichment.closefallback whenprev_closeis missing,301/689(20%) &920(30%) A-share boards, open-price limit checks fornext_open/breakout_high, sellable same-day TP fallback when intraday stop hits limit-down, and preserved unclosed terminalTradeSignals (exit_price=None) when T+1/limit-down/suspension blocks force-close.initial_capital, and MTM valuation of unclosed terminal holdings whenmarket_datais present._apply_weight_cap, guarded_build_causal_market_proxyagainstNaT& multi-day suspension gaps, and unified per-position MTM across closed and open holdings.Why
Addresses P0/P1 audit findings across forward shadow promotion integrity, historical execution lookahead, portfolio L0 gate accounting, and causal multi-strategy risk budgeting without modifying the frozen L0 Truth Kernel (
src/alphaevo/truth/,src/alphaevo/evaluator/metrics.py).Verification
ruff format --check src/ tests/unit/test_round2_to_6_quant_shadow_portfolio_rigor.py-> cleanruff check-> All checks passedmypy src/-> 0 errors across 135 source filespytest -q-> 1091 passed (including 7 comprehensive regression tests intests/unit/test_round2_to_6_quant_shadow_portfolio_rigor.py)git diff --name-only main -- src/alphaevo/truth/ src/alphaevo/evaluator/metrics.py-> empty (L0 untouched)gpt-6.2-sol)--sandbox read-onlycross-model audits completed and all concrete P1/P2 findings resolved.Risks
commits.jsonlpreserve backwards compatibility for unit tests directly injectingoutcomes.jsonl; production ledgers always writecommits.jsonl.Research & educational software only. Not investment advice.