Skip to content

V1a: связать recheck с revision evidence - #355

Merged
lemone112 merged 4 commits into
mainfrom
agent/v1a-final-recheck
Jul 19, 2026
Merged

V1a: связать recheck с revision evidence#355
lemone112 merged 4 commits into
mainfrom
agent/v1a-final-recheck

Conversation

@lemone112

@lemone112 lemone112 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Что изменено

  • добавлен private revision-bound recheck одного уже заданного Paint по всем observed scenarios и occurrences;
  • PASS и FAIL теперь несут одну связанную цепочку physical binding + evaluator identity/release/capability + invocation;
  • Waiting, Stale, Infeasible, Verified и явный Hold разделены типами;
  • observation evidence связывается со stream, schema, revision и canonical scenario set;
  • G1a переведён на тот же sealed evaluator binder;
  • finite opacity допускается типом; переполнение и резервирование C×R проверяются до compositing.

Почему

До этого exact point occurrence можно было проверить локально, но нельзя было доказуемо переиспользовать результат относительно конкретной revision наблюдений. Ручная сборка metadata также позволяла расходиться success/failure evidence.

Границы

Это private proof foundation, не terminal certificate: selection, public/wire API, Pair/WCAG production path, session/output/render identities и transactional sink намеренно не добавлены. Они появятся только вместе с настоящими владельцами.

Проверки

  • fmt, workspace clippy -D warnings, rustdoc -D warnings — green;
  • core: 593 passed, 6 ignored;
  • bounded mutation: первый проход нашёл 3 реальных пробела Hold; после RED-тестов повтор 12 mutants = 11 caught, 1 unviable, 0 missed;
  • независимое архитектурное/API/numerical/performance review — APPROVE;
  • git diff --check — green.

Summary by CodeRabbit

  • Новые возможности

    • Добавлена проверка результатов с привязкой к версии наблюдений и сохранением доказательств.
    • Реализованы состояния ожидания, готовности и устаревания наблюдений.
    • Добавлена возможность безопасно повторно использовать подтверждённые результаты при неизменном контексте.
    • Усилена валидация прозрачности: значения вне диапазона и нечисловые значения отклоняются, а -0.0 канонизируется.
  • Исправления

    • Улучшено выявление несоответствий между ожидаемым и фактическим цветом.
    • Ошибки теперь сохраняют подробные сведения о проверке и исходных данных.
  • Тесты

    • Расширено покрытие проверок повторной верификации, устаревших результатов, дубликатов и граничных значений.

@coderabbitai

coderabbitai Bot commented Jul 19, 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: 52 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: eaddf3aa-b999-4b7c-880f-e1546f69cd85

📥 Commits

Reviewing files that changed from the base of the PR and between f0f3c6f and 50dcfb5.

📒 Files selected for processing (11)
  • crates/labcolors-core/src/analog.rs
  • crates/labcolors-core/src/appearance.rs
  • crates/labcolors-core/src/composition.rs
  • crates/labcolors-core/src/constraint_tests.rs
  • crates/labcolors-core/src/constraints/exact.rs
  • crates/labcolors-core/src/observation.rs
  • crates/labcolors-core/src/recheck.rs
  • crates/labcolors-core/src/recheck_tests.rs
  • crates/labcolors-core/src/semantic.rs
  • packages/colors/bench/wasm.json
  • scripts/check-wasm-size-budget.mjs

Walkthrough

PR изменяет контракты bound-evaluator, добавляет типизированный admission opacity, переводит exact alpha analog на bound evidence и вводит observation snapshot с revision-bound recheck, hold и reuse. Тесты покрывают состояния, provenance, канонический порядок и проверки контекста.

Changes

Bound evaluator и exact evidence

Layer / File(s) Summary
Контракт bound evaluator
crates/labcolors-core/src/constraints/*, crates/labcolors-core/src/constraint_tests.rs
Evaluator получил identity и capability, а assess теперь возвращает BoundVerdict с сохранёнными binding, provenance и outcome. Exact и WCAG evaluator адаптированы к новому контракту.
Admission opacity и alpha analog
crates/labcolors-core/src/composition.rs, crates/labcolors-core/src/appearance.rs, crates/labcolors-core/src/analog.rs, crates/labcolors-core/src/appearance_graph_tests.rs
Добавлены валидация и канонизация AdmittedOpacityV1; point-программа принимает admitted alpha, а ExactAlphaProgramV1 формирует evidence через bound assessment.

Observation и revision-bound recheck

Layer / File(s) Summary
Observation snapshot и recheck
crates/labcolors-core/src/observation.rs, crates/labcolors-core/src/recheck.rs, crates/labcolors-core/src/lib.rs, crates/labcolors-core/src/recheck_tests.rs, .cargo/mutants.toml
Добавлены состояния Waiting, Ready, Stale, fixed recheck с exact evidence, Infeasible/Verified outcomes, stale hold и revision-bound reuse с проверкой полного контекста.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок кратко и по делу отражает основную идею PR: связать recheck с revision evidence.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/v1a-final-recheck

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

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/labcolors-core/src/analog.rs`:
- Around line 277-286: Remove both tautological debug_assert_eq! checks around
VerifiedAlphaAnalogV1 construction: the comparison of
assessment.outcome().target() with actual(), and the comparison of
verified.evidence().actual with verified.assessment.outcome().actual(). Leave
the construction and surrounding logic unchanged unless an independent invariant
source such as occurrence.visible() is already available.

In `@crates/labcolors-core/src/recheck.rs`:
- Around line 171-181: Вынесите вычисление индексов поверхностей из двойного
цикла в recheck_ready: один раз сопоставьте каждый self.occurrences с индексом
schema до перебора set.cases(), а внутри цикла используйте сохранённые индексы.
Предпочтительно передайте уже проверенные индексы из recheck в recheck_ready,
чтобы убрать повторный binary_search и unreachable!; не добавляйте
unwrap_or/expect без явной обработки гарантированно валидного результата.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c7680827-36ba-4805-98a3-88cb98d0e40e

📥 Commits

Reviewing files that changed from the base of the PR and between cf69e10 and f0f3c6f.

📒 Files selected for processing (13)
  • .cargo/mutants.toml
  • crates/labcolors-core/src/analog.rs
  • crates/labcolors-core/src/appearance.rs
  • crates/labcolors-core/src/appearance_graph_tests.rs
  • crates/labcolors-core/src/composition.rs
  • crates/labcolors-core/src/constraint_tests.rs
  • crates/labcolors-core/src/constraints/exact.rs
  • crates/labcolors-core/src/constraints/mod.rs
  • crates/labcolors-core/src/constraints/wcag22.rs
  • crates/labcolors-core/src/lib.rs
  • crates/labcolors-core/src/observation.rs
  • crates/labcolors-core/src/recheck.rs
  • crates/labcolors-core/src/recheck_tests.rs

Comment thread crates/labcolors-core/src/analog.rs Outdated
Comment thread crates/labcolors-core/src/recheck.rs

Copy link
Copy Markdown
Collaborator Author

Исправлен точный size-gate без поднятия ратчета.

RCA: первая версия дублировала bytes финального occurrence в VerifiedAlphaAnalogV1 и ExactIdentityAssessmentV1, а typed-opacity проходил через старый live point path. Proof-carrier нормализован: authored routing отделён от physical certificate, exact PASS — sealed zero-size marker, opacity admitted один раз до exact program.

Локальный одинаковый build (Rust 1.96.0, wasm-pack 0.15.0, wasm-opt 117):

  • baseline: 387228 B;
  • прежний head: 387533 B (+305 B);
  • новый head: 387087 B (-141 B к baseline), gzip 169565 B.

Дополнительно независимое re-review поймало и закрыло доступный unit-конструктор PASS-marker; private tuple-конструктор охраняется anti-vacuum тестом.

Финальные локальные доказательства: fmt PASS; clippy -D warnings PASS; core lib 593/0/6; rustdoc -D warnings PASS; git diff check PASS; независимое review APPROVE.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

@lemone112 Принято. Учту нормализацию proof-carrier и однократный admission opacity при повторной проверке. Запускаю review обновлённого состояния PR #355.

🐇 ✅


✏️ Learnings added
Learnt from: lemone112
URL: https://github.com/Labpics-Team/lab-colors/pull/355

Timestamp: 2026-07-19T17:36:18.619Z
Learning: In `crates/labcolors-core`, the exact proof carrier separates authored routing from the physical certificate. Exact PASS is represented by a sealed zero-size marker (its tuple constructor is intentionally private and protected by an anti-vacuum test), and opacity must be admitted exactly once before entering the exact program rather than through the legacy live point path.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

Последний unresolved thread исправлен в d755963: индексы поверхностей fallible-bind один раз до case×requirement и до первой композиции; unreachable! удалён; RED→GREEN тест добавлен. @coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

@lemone112 Принято. Запускаю повторную проверку обновлённого состояния PR #355, включая раннее fallible-binding индексов поверхностей и регрессионный тест.


✏️ Learnings added
Learnt from: lemone112
URL: https://github.com/Labpics-Team/lab-colors/pull/355

Timestamp: 2026-07-19T17:45:28.900Z
Learning: In `crates/labcolors-core/src/recheck.rs`, surface indices must be fallibly bound exactly once before expanding case×requirement work and before the first composition; this avoids relying on `unreachable!` and ensures invalid surface bindings fail before evaluation.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

Canonical run 29697431855 measured the exact Linux x64 artifact at 387135 B, gzip 170555 B, SHA-256 90b174b17f5eee306c5fbd03edaab355f2807b28800ab0c3097fff1fffc07a57. The previous zero-headroom SSOT was 387276 B, so V1a reduced it by 141 B.

Commit 50dcfb5 moves the same exact ratchet downward (measurement source, raw/max bytes, basis, pinned budget-document SHA); no headroom was added. Targeted canonical-budget contract is GREEN.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

@lemone112 Принято. Запускаю review обновлённого состояния PR #355, включая пониженный zero-headroom ratchet, закреплённые measurement/budget-document provenance и canonical-budget contract.


✏️ Learnings added
Learnt from: lemone112
URL: https://github.com/Labpics-Team/lab-colors/pull/355

Timestamp: 2026-07-19T17:52:55.085Z
Learning: For PR `#355` in `Labpics-Team/lab-colors`, the canonical Linux x64 artifact budget is a zero-headroom ratchet: canonical run `29697431855` measured 387135 B raw (170555 B gzip; SHA-256 `90b174b17f5eee306c5fbd03edaab355f2807b28800ab0c3097fff1fffc07a57`), reducing the prior 387276 B SSOT by 141 B. Budget updates must preserve the exact measurement source, raw/max-byte basis, and pinned budget-document SHA; they must not add headroom.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lemone112
lemone112 marked this pull request as ready for review July 19, 2026 17:58
@lemone112
lemone112 merged commit 985d140 into main Jul 19, 2026
10 checks passed
@lemone112
lemone112 deleted the agent/v1a-final-recheck branch July 19, 2026 17:58
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