Skip to content

Core: exhaustive selection oracle verifies production materialisation (V5c-3) - #533

Merged
lemone112 merged 2 commits into
mainfrom
v5c-3-exhaustive-selection-oracle
Aug 5, 2026
Merged

Core: exhaustive selection oracle verifies production materialisation (V5c-3)#533
lemone112 merged 2 commits into
mainfrom
v5c-3-exhaustive-selection-oracle

Conversation

@lemone112

@lemone112 lemone112 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

V5c-3 — exhaustive selection oracle

Roadmap V5c: «простой exhaustive oracle проверяет production pruning/selection».

RED (fd72d60): three oracle contract tests fail — the oracle does not exist.
GREEN: the oracle exists and agrees with production on every input.

The oracle is deliberately independent of production code paths:

  • reads only the authored tie groups (linear scan for ranks — never the admitted BTreeMap);
  • orders by quadratic selection sort over exhaustive pairwise dominance (never the production sort_by);
  • tie-break is the same authored law: canonical key bytes only — declaration order, payloads, usize positions never participate.

Contract:

  1. exhaustive_oracle_agrees_with_production_materialisation — oracle == select_order_v1 on a multi-group release with adversarial binding order;
  2. exhaustive_oracle_matches_production_over_every_binding_permutation — agreement under all 6 binding permutations of a tie-containing release;
  3. exhaustive_oracle_is_not_vacuous — the oracle discriminates: declaration order is not the authored order, a reversed release policy yields a reversed exhaustive order.

One visibility widening: SelectionCandidateKeyV1::as_bytes is now pub(crate) so the oracle can compare canonical key bytes (no pinned source-cone or clean-set receipt rebinding required — the file is outside both pinned inventories).

Verification (local)

  • cargo test -p labcolors-core --lib selection_release — 11/11 pass (8 prior + 3 oracle)
  • cargo clippy -p labcolors-core --all-targets -- -D warnings — clean
  • cargo fmt -p labcolors-core --check — clean
  • verify_point_support_surplus.py — PASS (no rebind)
  • verify_clean_set_receipt.py product — PRODUCT_IDENTITY_VERIFIED (no rebind)

Summary by CodeRabbit

  • Тесты
    • Добавлена исчерпывающая проверка ранжирования кандидатов.
    • Проверена корректность результатов при различных перестановках привязок.
    • Расширено покрытие политики выбора и ранжирования.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 16 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2a240904-7bc8-467f-a3f5-3737feddefd1

📥 Commits

Reviewing files that changed from the base of the PR and between 571adc3 and 4545032.

📒 Files selected for processing (2)
  • crates/labcolors-core/src/selection_release.rs
  • crates/labcolors-core/src/selection_release_tests.rs

Walkthrough

Метод SelectionCandidateKeyV1::as_bytes открыт внутри crate. Тесты добавляют независимый exhaustive oracle и проверяют production materialisation для разных рангов и перестановок кандидатов.

Changes

Проверка выбора кандидатов

Layer / File(s) Summary
Основа exhaustive oracle
crates/labcolors-core/src/selection_release.rs, crates/labcolors-core/src/selection_release_tests.rs
as_bytes получает видимость pub(crate). exhaustive_select вычисляет ранги и сортирует кандидатов по рангу и canonical key.
Проверка порядка кандидатов
crates/labcolors-core/src/selection_release_tests.rs
Тесты сравнивают oracle с production materialisation для нескольких рангов и всех перестановок binding-кандидатов. Дополнительный тест проверяет разрешение ties и отличие от declaration order.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Labpics-Team/lab-colors#320: Exhaustive oracle проверяет логику выбора кандидатов, введённую в этом PR.
  • Labpics-Team/lab-colors#531: Текущие изменения расширяют тесты и видимость метода в реализации selection_release.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: добавление exhaustive oracle для проверки production materialisation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v5c-3-exhaustive-selection-oracle

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

@lemone112
lemone112 force-pushed the v5c-3-exhaustive-selection-oracle branch from abd16e1 to 4545032 Compare August 5, 2026 10:51
@lemone112
lemone112 merged commit fd41783 into main Aug 5, 2026
10 checks passed
@lemone112
lemone112 deleted the v5c-3-exhaustive-selection-oracle branch August 5, 2026 13:18
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