Expose combo regime diagnostics in runtime reports#103
Conversation
Co-Authored-By: Codex <noreply@openai.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e79950a54
ℹ️ 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".
| "rotation_pool_last_month": diagnostics.get("rotation_pool_last_month"), | ||
| "artifact_contract": dict(diagnostics.get("artifact_contract", {})), | ||
| "risk_flags": tuple(str(flag) for flag in decision.risk_flags), | ||
| "combo_diagnostics": { |
There was a problem hiding this comment.
Only emit combo diagnostics when combo metadata exists
When the active strategy is not the combo profile, or a combo decision lacks diagnostics['metadata']['combo'], combo_meta is {}, but this unconditional entry still returns a non-empty zero-filled combo_diagnostics map. execute_trend_rotation treats any non-empty map as real and persists it under report['diagnostics']['combo'], so legacy runtime reports will claim effective weights/regime values of 0/empty instead of omitting unavailable combo diagnostics; gate this on actual combo metadata or return {} when it is absent.
Useful? React with 👍 / 👎.
| sell_reasons = dict(strategy_plan["sell_reasons"]) | ||
| combo_diagnostics = dict(strategy_plan.get("combo_diagnostics", {})) | ||
| if combo_diagnostics: | ||
| report.setdefault("diagnostics", {})["combo"] = combo_diagnostics |
There was a problem hiding this comment.
Store diagnostics from the post-sell plan
When the sell leg changes balances or cash, this writes diagnostics.combo from the first strategy plan even though the function immediately resolves and executes a second post_sell_plan with the updated portfolio. For combo runs where fields such as gross_exposure are derived from current holdings, a cycle that rotates out positions can archive stale pre-sell diagnostics that disagree with the buy plan actually used; update the report from post_sell_plan after the second resolve.
Useful? React with 👍 / 👎.
Summary
Validation