Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe71dcfa21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif holdings.get(sym, 0) > 0: | ||
| merged_targets[sym] = held_val |
There was a problem hiding this comment.
Preserve explicit zero-weight exits while expansion is paused
When expansion_paused=True, a held symbol explicitly assigned weight zero is restored to its current market value here because the earlier positive-weight filters omit it from merged_targets. Consequently, the order planner never receives the exit: buying 350 VTI shares in one step and setting bucket_a_weights={"VTI": 0.0} in the next paused step leaves all 350 shares held. Preserve explicit zero targets separately from missing targets so the pause blocks new buys without suppressing requested exits and distorting shadow results.
Useful? React with 👍 / 👎.
| card_type=CARD_TYPE_BAYESIAN_DECAY, | ||
| severity=sev, | ||
| title=f"{rep.bucket_id} performance check: {rep.overall_status}", | ||
| summary=f"Recent {primary} quarters weakened. {action_hint} Strategy rules stay unchanged.", |
There was a problem hiding this comment.
Attribute Bayesian alerts to the governing observation source
When an insufficient-sample LIVE channel is healthy but PAPER has a RED alert, evaluate_bucket_bayesian_confidence deliberately retains primary_source="LIVE" while taking the overall status, action, and reasons from PAPER. This summary then incorrectly tells the owner that LIVE quarters weakened, and the card includes no governing-source evidence to correct that attribution. This occurs with the observations already covered by test_insufficient_live_sample_does_not_mask_paper_red_alert; carry the governing source into the report/card or describe the alert without attributing it to the primary channel.
Useful? React with 👍 / 👎.
| raw_d_usd = budget_d * w | ||
| capped_d_usd = min(raw_d_usd, d_cap) if d_cap > 0.0 else raw_d_usd | ||
| merged_targets[sym] = merged_targets.get(sym, 0.0) + capped_d_usd |
There was a problem hiding this comment.
Preserve passive-breach handling when capping Bucket D targets
When a Bucket D-only holding appreciates above its 2% NAV cap, pre-capping its target dollars here turns the passive breach into an explicit trim before compute_merged_whole_share_orders can apply its existing block-adds-but-allow-holding behavior. For example, with $60,000 initial capital, a 10% Bucket D budget, and an unchanged 100% sleeve signal, the ledger initially buys 12 shares at $100 and then sells six when the price rises to $200; passing the uncapped signal target and the same cap directly to the planner retains all 12 shares and blocks additions. Preserve the original target for passive-breach evaluation while enforcing the cap on new purchases, otherwise the shadow ledger introduces unintended sales, fees, and return differences.
Useful? React with 👍 / 👎.
AI Code Review (gemini /
|
Summary
Adds three pure-offline, zero-I/O governance modules to
quant_platform_kit.risk:bayesian_confidence_monitor.py: quarterly source-separated (SHADOW/PAPER/LIVE) conjugate Normal-Normal + Beta-Binomial strategy decay monitor with immutableparameter_mutation_allowed=Falseandauto_execution_allowed=False.multi_tier_shadow_ledger.py: simultaneous read-only multi-tier shadow ledger ($1.5k,$15k,$50k+ modeled monthly contributions) built onbucket_capital_ladderandbenchmark_dca_and_regime.sentinel_decision_cards.py: read-only Layer 3 web-console decision-card builder with strict evidence sanitization, hard$50kBucket D floor enforcement, and immutablerequires_owner_signoff=True/auto_execute=False.Risk & Rollback
Verification
uv run ruff checkpassed with 0 issues across all new modules, exports, and tests.uv run pytest tests/test_bucket_capital_ladder.py tests/test_bayesian_confidence_monitor.py tests/test_multi_tier_shadow_ledger.py tests/test_sentinel_decision_cards.py: 20 passed.gpt-6.2-astraaudit completed; all P1 and P2 findings fixed and covered by regression tests.AI assistance
Drafted and audited with AI assistance (Antigravity + local
gpt-6.2-astrareview); all tests and lint checks verified locally.