fix(alpha): gate LiveSmall promotion on reconciliation truth - #64
Conversation
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
39a4f84 to
947c3d3
Compare
2c44a77 to
3bf93eb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c885ce70a4
ℹ️ 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".
| && (mode != AttributionMode::LiveSmall | ||
| || portfolio_snapshot_has_authoritative_truth(event)) |
There was a problem hiding this comment.
Wire the LiveSmall gate into the eligibility path
This gate only runs when some caller passes AttributionMode::LiveSmall, but the LiveSmall eligibility workflow never does: close_runtime_stages checks runtime_stage_is_healthy for Paper and Shadow, then advances LiveSmallEligible solely from live_small_eligibility_approval (rust_hft/alpha-harness/app/src/loop_control.rs lines 337, 354, and 371-390), and the existing e2e test even completes with no LiveSmall attribution events. As a result, missing or stale reconciliation metrics still do not block the actual LiveSmall promotion path unless that path is also changed to require a healthy LiveSmall stage.
Useful? React with 👍 / 👎.
| event | ||
| .metrics | ||
| .get(name) | ||
| .is_some_and(|value| value.is_finite() && *value >= 1.0) |
There was a problem hiding this comment.
Require exact truth flags for LiveSmall metrics
When a signed feedback producer emits a value above 1.0 for one of these boolean truth flags, such as a count or percentage instead of the normalized 0.0/1.0 coverage values used by the runtime producer, RuntimeAttributionEvent::validate only checks finiteness, so this helper treats the malformed metric as authoritative and can mark a LiveSmall snapshot healthy. Since these metrics are the fail-closed promotion evidence, require the exact complete value rather than accepting any value greater than it.
Useful? React with 👍 / 👎.
| .metrics | ||
| .get("venue_reconciliation_age_us") | ||
| .is_some_and(|value| { | ||
| value.is_finite() && *value >= 0.0 && *value <= MAX_RUNTIME_RECONCILIATION_AGE_US |
There was a problem hiding this comment.
Expire old LiveSmall snapshots at decision time
When LiveSmall health is evaluated after feedback was written, for example after importing a log and resuming the loop minutes later, this check still treats the snapshot as fresh forever because it only verifies the persisted venue_reconciliation_age_us value from observation time and never compares event.observed_at to the current decision time; runtime_attributions_for_mission returns all historical attribution events for the mission. A single once-fresh snapshot can therefore remain promotion evidence indefinitely, so the health gate needs a decision-time expiry or a current-time parameter instead of relying only on the recorded reconciliation age.
Useful? React with 👍 / 👎.
Change contract
Require fresh, authoritative account reconciliation evidence before a LiveSmall candidate can be considered runtime-healthy for promotion. Paper and Shadow retain their simulated-execution contract.
Out of scope
No account polling, runtime attribution producer, execution-risk policy, or rollout changes.
Dependencies and merge order
Depends on #62 because it emits the LiveSmall reconciliation truth this domain gate consumes. #62 is now merged; this PR targets
main.Focused validation
cargo test -p alpha-domainRollout / rollback
Fail closed: an incomplete, unhealthy, stale, or absent reconciliation snapshot blocks LiveSmall promotion. Revert this PR to return to the prior promotion criterion.
Scope exception
None.