Skip to content

O1b-2: переиспользовать runtime-арены Session - #482

Merged
lemone112 merged 11 commits into
mainfrom
agent/o1b2-reusable-arenas
Jul 28, 2026
Merged

O1b-2: переиспользовать runtime-арены Session#482
lemone112 merged 11 commits into
mainfrom
agent/o1b2-reusable-arenas

Conversation

@lemone112

@lemone112 lemone112 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Что изменено

  • Session заранее владеет ровно тремя связанными observation/report/output arena: previous + cause + prospective.
  • Observation materialization переиспользует плоские Vec-буферы; Program использует одну arena с покомпонентным максимумом selected/exhaustive ёмкости.
  • Evidence возвращает arena по move-only slot identity; abort, typed error и unwind не теряют слот.
  • Deferred retirement перенесён из Attachment внутрь Session и выполняется до следующего owner/admission/evaluator/sink этапа.
  • Публичный Rust/WASM/config API не изменён; private runtime cone закрыт hostile rustdoc-gate.

Почему

До среза каждый новый observed update создавал новый Rc<ObservationBackingV1> и отделял report/output buffers. Whole-update RED после warm-up зафиксировал AllocatorEvents { alloc: 9, realloc: 0, dealloc: 0 }. Простая отсрочка drop в Attachment скрывала момент освобождения, но не переиспользовала storage.

Общий закон — один логический slot на одну revision-bound пару observation+evaluation storage; минимум три слота выводится из автомата Failed(cause + previous) + prospective.

Влияние

После разогрева полный Attachment lifecycle — Ready/Failed/Ready, Unknown/Stale, ConfirmExact, три sink rejection и retry — выполняется с нулём alloc/alloc_zeroed/realloc/dealloc. Семантика lifecycle, численные результаты и публичная поверхность не меняются.

Проверки

  • cargo test --workspace --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo fmt --all -- --check
  • MSRV 1.85: cargo check --workspace --all-targets --locked
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
  • 11/11 hostile public-surface tests; rustdoc inventory public_items=155
  • allocator RED→GREEN и three-live-storage fingerprints
  • hostile evaluator unwind+retry; controlled mutant теряет slot и падает Plan(InternalInvariant)

Summary by CodeRabbit

  • Улучшения

    • Оптимизирована работа с наблюдениями и оценкой программы за счёт пула переиспользуемых арен: меньше выделений и более стабильное повторное использование памяти.
    • Повышена надёжность управления внутренними ресурсами при коммитах и подготовке обновлений.
  • Исправления

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

    • Расширены проверки reuse/strong-count, порядка освобождения и поведения после retry/commit.
  • Chores

    • Обновлены проверки публичной rustdoc-поверхности, контракты (хэши) и сценарии CI с изоляцией APT.

@coderabbitai

coderabbitai Bot commented Jul 27, 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: 27 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: f9a84ed9-4e0c-442e-a1f9-7275608529c0

📥 Commits

Reviewing files that changed from the base of the PR and between a05574d and 48cee4b.

📒 Files selected for processing (25)
  • .github/workflows/ci.yml
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.json
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256
  • crates/labcolors-core/contracts/point-support-reference-surplus-q55-bps-proof-v1.json
  • crates/labcolors-core/src/generic_boundary_tests.rs
  • crates/labcolors-core/src/joint_tests.rs
  • crates/labcolors-core/src/observation.rs
  • crates/labcolors-core/src/observation_tests.rs
  • crates/labcolors-core/src/point_support_tests.rs
  • crates/labcolors-core/src/program.rs
  • crates/labcolors-core/src/program/attachment.rs
  • crates/labcolors-core/src/program/attachment/support.rs
  • crates/labcolors-core/src/program/attachment/tests.rs
  • crates/labcolors-core/src/program_joint_integration_tests.rs
  • crates/labcolors-core/src/program_mixed_evaluator_tests.rs
  • crates/labcolors-core/src/program_point_causality_tests.rs
  • crates/labcolors-core/src/program_session.rs
  • crates/labcolors-core/src/program_session_tests.rs
  • crates/labcolors-core/src/session.rs
  • crates/labcolors-core/src/session_tests.rs
  • packages/colors/test/release-contract.test.mjs
  • scripts/test_point_support_surplus_source_binding.py
  • scripts/test_program_public_surface.py
  • scripts/verify_point_support_surplus.py
  • scripts/verify_program_public_surface.py

Walkthrough

Изменения переводят observation и program evaluation на переиспользуемые арены, переносят deferred retirement в Session, удаляют его хранение из Attachment, добавляют allocator lifecycle-тесты и расширяют проверки контрактов, public surface и CI.

Changes

Арены наблюдений

Layer / File(s) Summary
Пуловая материализация observation
crates/labcolors-core/src/observation.rs, crates/labcolors-core/src/observation_tests.rs, crates/labcolors-core/src/joint_tests.rs
ObservationArenaPoolV1 заполняет переиспользуемые Vec-буферы, проверяет canonical schema и передаётся в оба пути подготовки observation.
Проверки владения observation
crates/labcolors-core/src/point_support_tests.rs, crates/labcolors-core/src/generic_boundary_tests.rs
Тесты проверяют arena slots, strong counts canonical schema, стабильность backing pointers и ownership-инварианты.

Арены оценки программы

Layer / File(s) Summary
Evaluation arena pool и leases
crates/labcolors-core/src/program_session.rs
Отчёты используют move-only arena lease, а ProgramSessionPlan хранит пул evaluation arenas.
Evaluation и retirement
crates/labcolors-core/src/program_session.rs, crates/labcolors-core/src/program_joint_integration_tests.rs
Сканирование пишет в arena storage, leases возвращаются после retirement, а unwind и preflight failure проверяются как retryable сценарии.
Проверки storage и causality
crates/labcolors-core/src/program_session_tests.rs, crates/labcolors-core/src/program_mixed_evaluator_tests.rs, crates/labcolors-core/src/program_point_causality_tests.rs
Тесты проверяют lifetime арен, отсутствие retained outputs и раздельность storage для previous, cause и prospective состояний.

Жизненный цикл сессии

Layer / File(s) Summary
Guard и deferred retirement
crates/labcolors-core/src/session.rs, crates/labcolors-core/src/session_tests.rs, crates/labcolors-core/src/generic_boundary_tests.rs
PreparedSessionTransition использует guard, commit_deferred паркует retirement в Session, а подготовка сначала выполняет drain.
Attachment integration
crates/labcolors-core/src/program/attachment.rs, crates/labcolors-core/src/program/attachment/tests.rs
Attachment больше не содержит retired_session; commit и source guards проверяют новый deferred-retirement flow.

Allocator sink

Layer / File(s) Summary
Admission, prepare и install
crates/labcolors-core/src/program/attachment/support.rs
Добавлен однослотовый sink с проверками scope/epoch, staging intent-ов, rollback после swap и снятием busy в Drop.
Lifecycle и source guards
crates/labcolors-core/src/program/attachment/tests.rs
Тесты проверяют warmed lifecycle, typed prepare failures, отсутствие allocator traffic и per-update retired storage.

Контракты и validation

Layer / File(s) Summary
Observation storage invariant
crates/labcolors-core/src/program.rs
ObservationError::InternalInvariant проецируется в отдельную причину ObservationStorage.
Public-surface filtering
scripts/verify_program_public_surface.py, scripts/test_program_public_surface.py
Проверка утечек использует наборы запрещённых источников, директорий и модулей; добавлены проверки alias-ов и похожих имён модулей.
CI и проверочные артефакты
.github/workflows/ci.yml, packages/colors/test/release-contract.test.mjs, crates/labcolors-core/contracts/*, scripts/verify_point_support_surplus.py, scripts/test_point_support_surplus_source_binding.py
APT использует job-local sources, а receipt, proof hashes и source mutations обновлены вместе с изменёнными исходниками.

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 52.63% 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 Заголовок кратко и точно отражает основное изменение: переиспользование runtime-арен Session.
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/o1b2-reusable-arenas

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

@lemone112
lemone112 marked this pull request as ready for review July 27, 2026 21:58

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 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: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/labcolors-core/src/program_session.rs (1)

2550-2562: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Сделайте проверку preflight-отказа до раннего return. На warm-path capacity() >= capacity helper выходит без вызова injected_program_preflight_failure(), поэтому после первого commit счётчик reservation_index перестаёт продвигаться, и сценарии с fail_program_preflight_reservation_for_test(...) больше не попадают в ожидаемый слот.

🤖 Prompt for 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.

In `@crates/labcolors-core/src/program_session.rs` around lines 2550 - 2562,
Переместите проверку injected_program_preflight_failure() в
try_reserve_program_evaluation_buffer перед ранним return по условию
buffer.capacity() >= capacity. Сохраните возврат Ok(()) для warm-path после
выполнения проверки, чтобы reservation_index продолжал продвигаться и
fail_program_preflight_reservation_for_test(...) попадал в ожидаемый слот.
🤖 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/generic_boundary_tests.rs`:
- Around line 120-126: Update the gate in the generic boundary test around the
syntax, pool, and constructor scans to count the `ObservationBackingV1`
declaration separately, then assert that no `ObservationBackingV1{` literals
exist outside `ObservationArenaPoolV1::new`. Remove the fragile global
`syntax.matches(...).count() == 2` dependency while preserving the requirement
for exactly one production constructor using `Rc::new(ObservationBackingV1{`.

In `@crates/labcolors-core/src/observation.rs`:
- Around line 186-193: Уточните doc-комментарий над ObservedScenarioSet: явно
обозначьте, что пустое состояние создаётся методом empty() только для
прогретого, ещё не арендованного слота пула, тогда как канонический набор
связанных сценариев непуст.
- Around line 1104-1110: Update try_reserve_total so the reserve amount is
calculated without relying on an implicit capacity >= len invariant, or
explicitly document and validate that invariant before subtracting. Preserve the
existing ResourceExhausted mapping and successful no-op behavior when storage
already has sufficient capacity.

In `@crates/labcolors-core/src/program_session.rs`:
- Around line 2118-2129: Replace the unconditional unreachable! check in
into_arena with debug_assert_eq! for the observation and arena slots, then
continue returning the lease-backed arena after dropping observation. Preserve
restore’s existing double-return validation and avoid introducing a panic in the
retirement commit/rollback path.
- Around line 2641-2654: Replace the unconditional unreachable! check in
ProgramEvaluationArenaGuardV1::drop with debug_assert!, allowing cleanup during
unwinding without triggering a second panic; keep the lease restoration behavior
unchanged and preserve unconditional invariant enforcement in restore.

In `@crates/labcolors-core/src/program/attachment/support.rs`:
- Around line 548-552: В `prepare()` замените `unwrap_or_else(||
unreachable!(...))` при получении `self.shared.stamp` на возврат соответствующей
типизированной ошибки через `Self::Error`. Сохраните успешный путь с
существующим `base_stamp`, а отсутствие `stamp` должно завершать `prepare()`
контролируемым `Err` без паники.

In `@crates/labcolors-core/src/session.rs`:
- Around line 337-350: Усильте проверку deferred_retirement в
SessionBuilder::commit, чтобы она соответствовала безусловной проверке в
commit_deferred и не исчезала в release-сборке: замените
debug_assert!(deferred_retirement.is_none()) на эквивалентную обязательную
проверку с unreachable-поведением. Сохраните остальную последовательность
публикации перехода и retirement без изменений.
- Around line 237-255: Переименуйте активно используемые поля
DeferredSessionRetirement _retired_verified, _retired_violation,
_retired_raw_head и _displaced_placeholder, убрав ведущие подчёркивания, и
обновите все их обращения в retire_into и других местах реализации. Не
переименовывайте _owner, поскольку он по-прежнему нужен исключительно для
порядка drop.

In `@scripts/test_program_public_surface.py`:
- Around line 56-88: Добавьте в тестовый класс сценарий с синтетической
страницей внутри запрещённого модуля, например
`session/struct.SessionItem.html`, используя `write_all` и `write_item` по
аналогии с `test_arbitrary_session_alias_is_rejected_by_origin`. Вызовите
`program_public_surface` и проверьте, что такой путь фиксируется ровно как один
leak, покрывая ветку `_inside(page, module)`.

---

Outside diff comments:
In `@crates/labcolors-core/src/program_session.rs`:
- Around line 2550-2562: Переместите проверку
injected_program_preflight_failure() в try_reserve_program_evaluation_buffer
перед ранним return по условию buffer.capacity() >= capacity. Сохраните возврат
Ok(()) для warm-path после выполнения проверки, чтобы reservation_index
продолжал продвигаться и fail_program_preflight_reservation_for_test(...)
попадал в ожидаемый слот.
🪄 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: bf426cb7-e312-48de-80a8-67d359245ad4

📥 Commits

Reviewing files that changed from the base of the PR and between a05574d and 0fd5f07.

📒 Files selected for processing (20)
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.json
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256
  • crates/labcolors-core/src/generic_boundary_tests.rs
  • crates/labcolors-core/src/joint_tests.rs
  • crates/labcolors-core/src/observation.rs
  • crates/labcolors-core/src/observation_tests.rs
  • crates/labcolors-core/src/point_support_tests.rs
  • crates/labcolors-core/src/program.rs
  • crates/labcolors-core/src/program/attachment.rs
  • crates/labcolors-core/src/program/attachment/support.rs
  • crates/labcolors-core/src/program/attachment/tests.rs
  • crates/labcolors-core/src/program_joint_integration_tests.rs
  • crates/labcolors-core/src/program_mixed_evaluator_tests.rs
  • crates/labcolors-core/src/program_point_causality_tests.rs
  • crates/labcolors-core/src/program_session.rs
  • crates/labcolors-core/src/program_session_tests.rs
  • crates/labcolors-core/src/session.rs
  • crates/labcolors-core/src/session_tests.rs
  • scripts/test_program_public_surface.py
  • scripts/verify_program_public_surface.py

Comment thread crates/labcolors-core/src/generic_boundary_tests.rs Outdated
Comment thread crates/labcolors-core/src/observation.rs Outdated
Comment thread crates/labcolors-core/src/observation.rs
Comment thread crates/labcolors-core/src/program_session.rs Outdated
Comment thread crates/labcolors-core/src/program_session.rs
Comment thread crates/labcolors-core/src/program/attachment/support.rs Outdated
Comment thread crates/labcolors-core/src/session.rs
Comment thread crates/labcolors-core/src/session.rs
Comment thread scripts/test_program_public_surface.py

Copy link
Copy Markdown
Collaborator Author

Outside-diff finding a77c344ce42b581df8f18c93 устранён в 7a29bb0d61954285d3552059738fa3d64b7235db.

Fault-injection index теперь отражает логическую последовательность preflight-координат, а не случайную warm/cold topology: каждая ненулевая координата потребляет индекс до early return, нулевая не считается reservation, а injected OOM реализуется только там, где действительно нужен рост буфера. Это закреплено тремя helper-level mutation controls и end-to-end тестом warmed_program_preflight_still_visits_every_nonempty_coordinate, который прогревает реальную arena и доказывает посещение production call sites.

Exact-head evidence:

  • Rust workspace: 918 core tests passed, 6 ignored; весь workspace green;
  • Clippy/rustdoc/MSRV 1.85: PASS;
  • point-support verifier + 5 hostile tests: PASS;
  • clean-set full product+research replay + 31 hostile tests: PASS;
  • TypeScript + 264 JS tests + release reproduction: PASS.

@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: 1

🤖 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/program_session.rs`:
- Around line 2736-2745: Добавьте явные комментарии с обоснованием инвариантов
перед обоими вызовами unreachable! в ProgramEvaluationArenaV1::restore: слот,
полученный из observation, всегда валиден и находится в ограниченной арене, а
move-only arena не допускает повторного возврата. Сохраните текущую логику
restore и формулировки, согласованные с пояснением в соседнем Drop.
🪄 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: 69f8fd15-cc8b-4215-bfe2-979ffd997cf1

📥 Commits

Reviewing files that changed from the base of the PR and between 0fd5f07 and 6513089.

📒 Files selected for processing (15)
  • .github/workflows/ci.yml
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.json
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256
  • crates/labcolors-core/contracts/point-support-reference-surplus-q55-bps-proof-v1.json
  • crates/labcolors-core/src/generic_boundary_tests.rs
  • crates/labcolors-core/src/observation.rs
  • crates/labcolors-core/src/program/attachment/support.rs
  • crates/labcolors-core/src/program/attachment/tests.rs
  • crates/labcolors-core/src/program_joint_integration_tests.rs
  • crates/labcolors-core/src/program_session.rs
  • crates/labcolors-core/src/session.rs
  • packages/colors/test/release-contract.test.mjs
  • scripts/test_point_support_surplus_source_binding.py
  • scripts/test_program_public_surface.py
  • scripts/verify_point_support_surplus.py

Comment thread crates/labcolors-core/src/program_session.rs
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 28, 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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

541-572: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Сделайте выбор ALSA-пакета зависимым от VERSION_CODENAME.
В .github/workflows/ci.yml:572 сейчас всегда запрашивается libasound2t64, но на Ubuntu 22.04 (Jammy) доступен только libasound2; libasound2t64 появляется лишь начиная с Ubuntu 24.04 (Noble). На Jammy этот шаг уронит apt-get download, поэтому нужен выбор по codename или явный отказ для неподдерживаемых релизов.

🤖 Prompt for 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.

In @.github/workflows/ci.yml around lines 541 - 572, Update the Chrome
dependency download block using VERSION_CODENAME so Jammy requests libasound2
and Noble or later requests libasound2t64; preserve the existing libnspr4,
libnss3, and libgbm1 downloads, and explicitly reject unsupported codenames
before apt-get download.
🤖 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 `@packages/colors/test/release-contract.test.mjs`:
- Around line 524-530: Расширьте контрактные проверки для содержимого APT
sources в переменной active: добавьте assertions для обеих веток case "$ID"
(Debian и Ubuntu), подтверждающие официальные vendor URL, $VERSION_CODENAME и
signed-by=$DISTRO_KEYRING. Добавьте негативные проверки, которые отклоняют
подмену URL, keyring, suite и signed-by, чтобы изменения trusted sources не
проходили тест.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 541-572: Update the Chrome dependency download block using
VERSION_CODENAME so Jammy requests libasound2 and Noble or later requests
libasound2t64; preserve the existing libnspr4, libnss3, and libgbm1 downloads,
and explicitly reject unsupported codenames before apt-get download.
🪄 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: 905e8041-c3f5-4f97-a8b4-02ca11d3b391

📥 Commits

Reviewing files that changed from the base of the PR and between 6513089 and 1cf169c.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.json
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256
  • crates/labcolors-core/src/program_session.rs
  • packages/colors/test/release-contract.test.mjs

Comment thread packages/colors/test/release-contract.test.mjs
@lemone112

Copy link
Copy Markdown
Collaborator Author

Outside-diff finding 8aa02a834f0f117aa235e89e подтверждён и исправлен в 45e04d8e659621d95cd85af01f3fc9dbc8f660e1: Chrome gate выбирает libasound2 для debian:bookworm|ubuntu:jammy, libasound2t64 для debian:trixie|ubuntu:noble, а неизвестный $ID:$VERSION_CODENAME отклоняет до APT. Текущий self-hosted runner подтверждён логом как Debian trixie; shell extracted из YAML проходит bash -n. Matrix и fail-closed branch защищены hostile mutation contract.

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 28, 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.

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 29 minutes.

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 49 seconds.

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@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: 4

🤖 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/observation.rs`:
- Around line 322-340: Упростите materialize_into, убрав повторный вызов
Rc::get_mut для уже выбранного слота: после определения slot_index получите
единственную изменяемую ссылку на self.slots[slot_index] и используйте её для
materialize и клонирования. Удалите заведомо недостижимую обработку
InternalInvariant, сохранив текущую ошибку только для случая отсутствия
свободного слота.
- Around line 1106-1130: In the scenario-grouping loop within the visible
case-building flow, replace the scenarios.peek() condition followed by
scenarios.next().unwrap_or_else(...) with Peekable::next_if, consuming the next
ScenarioInput only when its bindings match the current bindings. Preserve
pushing the consumed id to set.provenance and remove the unnecessary
unreachable! handling.

In `@crates/labcolors-core/src/program/attachment/support.rs`:
- Around line 566-573: Уточните семантику
InMemoryPointSinkErrorV1::StampMismatch: задокументируйте, что ошибка
возвращается как при отсутствии ожидаемого patch, так и при несовпадении
patch.sink_output() с self.owned_scope[0]. Если вызывающим сторонам требуется
различать эти случаи, добавьте отдельный вариант ошибки и возвращайте его в
соответствующей ветке проверки.

In `@crates/labcolors-core/src/session.rs`:
- Around line 284-291: Update ProgramEvaluationArenaPoolV1::restore so
double-return and invalid-index checks cannot unconditionally panic when reached
through PendingSessionTransitionGuard::drop during unwinding. Return the
function’s existing typed unreachable/error context for these cases, optionally
retaining debug_assert! for invariant diagnostics, and leave normal arena
restoration unchanged.
🪄 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: f589a075-2c8e-4e6b-bad0-08fae7d17a18

📥 Commits

Reviewing files that changed from the base of the PR and between a05574d and 5d73168.

📒 Files selected for processing (25)
  • .github/workflows/ci.yml
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.json
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256
  • crates/labcolors-core/contracts/point-support-reference-surplus-q55-bps-proof-v1.json
  • crates/labcolors-core/src/generic_boundary_tests.rs
  • crates/labcolors-core/src/joint_tests.rs
  • crates/labcolors-core/src/observation.rs
  • crates/labcolors-core/src/observation_tests.rs
  • crates/labcolors-core/src/point_support_tests.rs
  • crates/labcolors-core/src/program.rs
  • crates/labcolors-core/src/program/attachment.rs
  • crates/labcolors-core/src/program/attachment/support.rs
  • crates/labcolors-core/src/program/attachment/tests.rs
  • crates/labcolors-core/src/program_joint_integration_tests.rs
  • crates/labcolors-core/src/program_mixed_evaluator_tests.rs
  • crates/labcolors-core/src/program_point_causality_tests.rs
  • crates/labcolors-core/src/program_session.rs
  • crates/labcolors-core/src/program_session_tests.rs
  • crates/labcolors-core/src/session.rs
  • crates/labcolors-core/src/session_tests.rs
  • packages/colors/test/release-contract.test.mjs
  • scripts/test_point_support_surplus_source_binding.py
  • scripts/test_program_public_surface.py
  • scripts/verify_point_support_surplus.py
  • scripts/verify_program_public_surface.py

Comment thread crates/labcolors-core/src/observation.rs
Comment thread crates/labcolors-core/src/observation.rs
Comment thread crates/labcolors-core/src/program/attachment/support.rs
Comment thread crates/labcolors-core/src/session.rs

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

Повторная проверка точного head 48cee4b: все четыре замечания предыдущего review адресованы; source receipts перепривязаны и локальные verifier/hostile gates зелёные.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

@lemone112, запускаю полную повторную проверку точного head 48cee4b, включая изменения, закрывающие предыдущие замечания, и обновлённые source receipts.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 27 minutes.

@lemone112
lemone112 merged commit 2404938 into main Jul 28, 2026
10 checks passed
@lemone112
lemone112 deleted the agent/o1b2-reusable-arenas branch July 28, 2026 01:50
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