Skip to content

fix(alpha): gate LiveSmall promotion on reconciliation truth - #64

Merged
proerror77 merged 5 commits into
mainfrom
codex/alpha-runtime-promotion-gate
Jul 16, 2026
Merged

proerror77 merged 5 commits into
mainfrom
codex/alpha-runtime-promotion-gate

Conversation

@proerror77

@proerror77 proerror77 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

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-domain

Rollout / 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.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c90672a1-cad1-468c-bf8d-3a945c212050

📥 Commits

Reviewing files that changed from the base of the PR and between a9b824a and c885ce7.

📒 Files selected for processing (1)
  • rust_hft/alpha-harness/domain/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/alpha-runtime-promotion-gate

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proerror77
proerror77 force-pushed the codex/runtime-health-readiness branch from 39a4f84 to 947c3d3 Compare July 16, 2026 06:02
@proerror77
proerror77 force-pushed the codex/alpha-runtime-promotion-gate branch from 2c44a77 to 3bf93eb Compare July 16, 2026 06:02
@proerror77
proerror77 changed the base branch from codex/runtime-health-readiness to main July 16, 2026 08:00
@proerror77
proerror77 marked this pull request as ready for review July 16, 2026 08:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1360 to +1361
&& (mode != AttributionMode::LiveSmall
|| portfolio_snapshot_has_authoritative_truth(event))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@proerror77
proerror77 merged commit afcc97c into main Jul 16, 2026
21 checks passed
@proerror77
proerror77 deleted the codex/alpha-runtime-promotion-gate branch July 16, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant