Skip to content

feat(colors): add private observation update lifecycle - #571

Merged
lemone112 merged 11 commits into
mainfrom
feat/pr-e-observation-update
Aug 12, 2026
Merged

feat(colors): add private observation update lifecycle#571
lemone112 merged 11 commits into
mainfrom
feat/pr-e-observation-update

Conversation

@lemone112

@lemone112 lemone112 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Slice contract

PR E lifts runtime observation/update into the existing private Program artifact after PR D's static-first cut.

Included

  • ABI v2 carries an attachment-local observation stream, monotonic revision, and a bounded correlated point-sRGB8 scenario set.
  • The private artifact reuses the sealed Core admission/session path. Explicit Observed updates run a full re-resolve; explicit Unknown never fabricates a backdrop or certificate.
  • The same attachment-bound writer authority performs SetAll, RevokeAll, and exact replay. Rejected updates leave the committed Core/session and host publication unchanged.
  • Result receipts expose lifecycle kind plus stream/revision provenance.

Excluded

  • Incremental/partial re-resolve and incremental/full parity (PR F).
  • A second client (PR G).
  • Public exports or a second authoring root before C7c.
  • SelectionRelease/joint selection in the fixture; selection stays in Core.

RED list

  • Consumer had no explicit update operation (proved red before implementation).
  • Runtime stream/revision were not present in the private wire.
  • No private-artifact proof covered higher-revision full re-resolve, explicit Unknown, foreign/lower/conflicting revision rejection, exact replay, or retained publication after rejection.
  • PR D anti-regrowth and six-mutant contracts did not bind an update ABI/call edge.

Exit criteria

  • One sealed observation path admits only correlated non-empty scenarios or explicit Unknown.
  • Revision/order/conflict semantics remain deterministic through existing Session admission.
  • Explicit update performs full re-resolve and publishes only through the existing attachment-bound writer.
  • Rejected update leaves committed state/publication unchanged; exact replay is idempotent.
  • ABI is exact-length, little-endian, version-gated, and consumer/build allowlists are symmetric.
  • No public API, second client, SelectionRelease, joint-state, or incremental-diff surface added.
  • Canonical Linux WASM measurement captured and zero-headroom budget updated from run 31583435451 (318134 bytes).
  • Exact-head CI run 31584734108 is fully green. CodeRabbit findings were fixed in 51be60d; re-review was rate-limited, so its stale CHANGES_REQUESTED review remains a visible gate.

Local verification

Passed:

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo check -p labcolors-core --features private-fixture --tests
  • cargo test -p labcolors-core --lib --features private-fixture private_fixture::tests:: (19/19)
  • targeted anti-regrowth gate
  • node --test packages/colors/test/private-program-consumer.test.mjs packages/colors/test/private-program-mutation-contract.test.mjs (50/50)
  • wasm32 release compile with explicit unshared cfg

Environment-qualified:

  • Full WSL cargo suite exceeded two bounded waits; no green claim is made.
  • Canonical npm/release build correctly failed closed locally because pinned Binaryen is absent. The GitHub Linux worker is the canonical producer/measurement authority.

Budget cycle

This head intentionally leaves packages/colors/bench/private-program-wasm.json unchanged. The first GitHub Linux run must print the new observed raw bytes and fail the exact ratchet. A follow-up commit will copy only that real run's bytes/source into the zero-headroom budget, then the exact new head must rerun fully green.

Summary by CodeRabbit

  • ?????????? ??????????????????????

    • ?????????????????? ?????????????????? ???????????????????? ???? ABI v2 ?? ???????????????????? ???????????????????? ??????????????????.
    • ???????????????? ?????????? update ?????? ?????????????????? ????????????????????, ?????????????? ?? ??????????????.
    • ???????????????????? ?????????????????????????? ?????????????? ?????????????????? ?? ?????????? ????????????.
    • ???????????????????? ???????????? ???????????????? ??????????????????, ?????????? ?? ??????????????.
  • ??????????????????????

    • ?????????????? ???????????????? ?????????????????? ?? ???????????????? ?????????????? WASM.
    • ?????????????????????? ?? ???????????????????????? ???????????????????? ???????????? ???? ?????????????? ?????????????????????????????????? ??????????????????.
    • ?????????????????? ???????????????????? ????????????????, ?????????????????????? ???????????????? ?? ?????????????????????? ?????????????? WASM-??????????????????.

Remote verification

  • Initial canonical measurement: run 31574811224, 318085 bytes before review fixes.
  • Review-fix measurement: run 31583435451, 318134 bytes; zero-headroom budget source.
  • Final exact-head CI: run 31584734108; all required CI jobs green, including full Rust test, release:verify, real Chrome private browser proof, six-mutant proof, WASM budget, and Node 22 consumer floor.
  • Native conformance: run 31584734061 green.
  • CodeRabbit: substantive findings fixed; latest automated rerun was rate-limited, leaving the historical CHANGES_REQUESTED state unresolved.

lemone112 and others added 4 commits August 12, 2026 10:07
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@coderabbitai

coderabbitai Bot commented Aug 12, 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: 6 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: c0d37b2c-82ed-430b-8979-da27362db5ce

📥 Commits

Reviewing files that changed from the base of the PR and between 7705145 and 4356d5e.

📒 Files selected for processing (6)
  • crates/labcolors-core/src/private_fixture.rs
  • packages/colors/bench/private-program-wasm.json
  • packages/colors/private-program/consumer.js
  • packages/colors/test/private-program-consumer.test.mjs
  • packages/colors/test/private-program-mutation-contract.test.mjs
  • scripts/test-private-program-mutations.mjs

Walkthrough

Private fixture переведён с ABI v1 на ABI v2. Добавлены явные observation updates, stream, revision и lifecycle-состояния. JavaScript consumer получил метод update. WASM-экспорты, browser proof, mutation checks и тесты обновлены.

Changes

ABI v2 и observation updates

Layer / File(s) Summary
Wire-контракты и декодирование
crates/labcolors-core/src/private_fixture.rs
Request и update используют ABI v2, stream, revision и сценарии. Результат содержит state, stream и revision.
Lifecycle и WASM entrypoints
crates/labcolors-core/src/private_fixture.rs
Lifecycle сохраняет stream и обрабатывает observed/unknown updates через отдельный update-buffer.
Rust-тесты ABI и lifecycle
crates/labcolors-core/src/private_fixture.rs
Тесты проверяют revision, rejected и unknown updates, dispose и fixed-buffer isolation.
JavaScript consumer и browser flow
packages/colors/private-program/consumer.js, packages/colors/test/private-program-consumer.test.mjs, fixtures/private-program-browser/proof.mjs
Consumer получил update(updateBytes). Проверяются длины buffers, stream, state, revision и отсутствие certified output для unknown update.
Экспортные контракты и mutation checks
crates/labcolors-core/src/generic_boundary_tests.rs, scripts/*, packages/colors/test/*, packages/colors/bench/private-program-wasm.json
Allowlist экспортов, mutation checks, browser checks и WASM size policy синхронизированы с ABI v2.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant Consumer
  participant WasmFixture
  participant Attachment
  Browser->>Consumer: update(updateBytes)
  Consumer->>WasmFixture: update_v2(updateBytes)
  WasmFixture->>Attachment: apply observation update
  Attachment-->>WasmFixture: result_v2
  WasmFixture-->>Consumer: state, stream, revision
  Consumer-->>Browser: update receipt
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: добавление жизненного цикла обновлений приватных наблюдений в артефакт Program.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pr-e-observation-update

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

lemone112 and others added 2 commits August 12, 2026 10:38
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Measured by GitHub Actions run 31574811224: 318085 raw bytes on linux-x64 with zero headroom.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

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

Caution

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

⚠️ Outside diff range comments (4)
packages/colors/private-program/consumer.js (1)

259-283: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Проверяйте provenance результата перед возвратом receipt.

decodeReceipt возвращает stream и revision, но не сравнивает их с active attachment. update проверяет только stream входящего update. Ошибочный WASM может вернуть stale receipt или receipt другого stream с тем же output identity.

Храните последнюю принятую revision. Перед возвратом receipt проверяйте stream и monotonic revision. Добавьте hostile tests для чужого stream и rollback revision.

🤖 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 `@packages/colors/private-program/consumer.js` around lines 259 - 283, Update
decodeReceipt and its active-attachment state to retain the last accepted
revision, then validate the decoded stream against the active attachment and
require revision to be monotonic before returning the receipt. Reject receipts
from a different stream or with a rolled-back revision, and add hostile tests
covering both foreign-stream and revision-rollback receipts.
scripts/test-private-program-mutations.mjs (1)

229-236: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Проверяйте тип до нормализации CRLF.

При invalid source вызов source.replaceAll() выбрасывает обычный TypeError до предусмотренного fail. Объект new String(...) также может пройти нормализацию, хотя вход не является primitive string.

Сначала проверьте типы source, definition.search и definition.replacement. Затем нормализуйте CRLF. Добавьте test для applyExactMutation(null, definition).

Согласно coding guidelines: «invalid, unreachable, unsupported и incomplete context должны возвращаться типизированно».

Предлагаемое исправление
 export function applyExactMutation(source, definition) {
-  source = source.replaceAll("\r\n", "\n");
   if (
     typeof source !== "string" ||
     typeof definition?.search !== "string" ||
     typeof definition?.replacement !== "string"
   ) {
     fail("mutation source, search anchor, and replacement must be strings");
   }
+  source = source.replaceAll("\r\n", "\n");
🤖 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 `@scripts/test-private-program-mutations.mjs` around lines 229 - 236, В функции
applyExactMutation сначала проверьте, что source, definition.search и
definition.replacement являются primitive string, до вызова source.replaceAll;
затем нормализуйте CRLF только после успешной валидации. Добавьте тест для
applyExactMutation(null, definition), подтверждающий типизированный fail вместо
обычного TypeError, и сохраните существующую обработку корректных входных
данных.

Source: Coding guidelines

crates/labcolors-core/src/private_fixture.rs (2)

646-655: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Не возвращайте заглушки state/stream/revision из project_certified_render_v1.

Функция заполняет state: Ready, stream: 0, revision: 0 временными значениями. Корректность результата обеспечивается только тем, что project_attachment_commit_v2 сразу перезаписывает эти три поля (Line 630-632). Любой новый вызывающий получит молча неверную голову наблюдения.

Передавайте state, stream и revision параметрами, чтобы функция не могла вернуть недостроенный результат.

♻️ Предлагаемое изменение
 fn project_certified_render_v1(
     render: crate::program::attachment::AttachedRenderOutputV1<'_, HandoffPointSinkOutputIdV1>,
+    state: PrivateFixtureStateV2,
+    stream: u32,
+    revision: u64,
 ) -> Result<CertifiedPrivateFixtureResultV1, PrivateFixtureErrorV1> {
@@
     Ok(CertifiedPrivateFixtureResultV1 {
-        state: PrivateFixtureStateV2::Ready,
-        stream: 0,
-        revision: 0,
+        state,
+        stream,
+        revision,
         output: render.output().value(),

В project_attachment_commit_v2 (Line 629-632) вызов становится единственным источником значений:

-    let mut result = project_certified_render_v1(render)?;
-    result.state = state;
-    result.stream = stream;
-    result.revision = revision;
-    Ok(result)
+    project_certified_render_v1(render, state, stream, revision)
🤖 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/private_fixture.rs` around lines 646 - 655, Update
project_certified_render_v1 to accept state, stream, and revision as parameters
and populate those fields directly from the arguments instead of using Ready, 0,
and 0 placeholders. Update project_attachment_commit_v2 to pass the
authoritative values when calling it, ensuring every caller receives a fully
constructed CertifiedPrivateFixtureResultV1.

804-820: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

stream в complete_run дублирует источник истины.

Attachment уже создан с authored.stream в execute_private_fixture_v1 (Line 492). complete_run принимает stream отдельным параметром и сохраняет его в Active. Значения могут разойтись: сигнатура допускает любой stream, не связанный с attachment. Расхождение проявится позже как ложный UpdateRejected в update при корректном обновлении, либо как принятие обновления с чужим stream.

Перенесите stream в ExecutedPrivateFixtureV1, чтобы одно значение фиксировалось в момент создания attachment.

♻️ Предлагаемое изменение
 struct ExecutedPrivateFixtureV1<H>
 where
     H: HandoffPointSinkHostV1,
 {
+    stream: u32,
     attachment: HandoffAttachmentV1<H>,
     projection: Result<CertifiedPrivateFixtureResultV1, PrivateFixtureErrorV1>,
 }

Затем complete_run теряет параметр stream и читает executed.stream.

🤖 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/private_fixture.rs` around lines 804 - 820,
Перенесите поле stream в структуру ExecutedPrivateFixtureV1 и заполняйте его тем
же значением, которое используется при создании attachment в
execute_private_fixture_v1. Удалите параметр stream из complete_run и сохраняйте
в PrivateFixtureLifecycleV1::Active значение executed.stream, чтобы attachment и
состояние использовали единый источник истины.
🤖 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/private_fixture.rs`:
- Around line 1247-1259: В функции update_v2 обнулите экспортируемую ячейку
RESULT_V1 до вызова update_request_v2, сохранив публикацию staged_result после
возврата. Приведите порядок действий к контракту run_fixed_buffer_entry_v1:
очистка перед входом в хост, затем запись актуального результата после
завершения update_request_v2.
- Around line 397-437: Расширьте cfg-гейт у decode_update_v2 и связанных с ним
констант, включая PRIVATE_FIXTURE_UPDATE_V2_MAGIC, чтобы код был доступен при
тестовой сборке на нативной цели. Добавьте Rust-тесты для враждебных кадров,
проверяющие отклонение неверных magic, версии и длины, kind 1 с ненулевым reason
и kind 2 с ненулевым хвостом, а также сохраните успешные случаи для валидных
кадров.
- Around line 36-37: Добавьте комментарий непосредственно к MAX_SCENARIOS_V2,
объясняющий инвариант ограничения фикстуры двумя коррелированными сценариями и
то, что при увеличении лимита необходимо обновить wire-грамматику и ветвление в
apply_observed_update_v2.
- Around line 529-549: Replace the unreachable! branch in
apply_observed_update_v2 with a typed error for scenario counts outside
1..=MAX_SCENARIOS_V2, and propagate that error through attachment.update. Remove
the now-redundant map_err handling in execute_private_fixture_v1 and
apply_update_v2 while preserving existing valid one- and two-scenario behavior.
- Around line 1612-1681: Добавьте тесты для оставшихся ветвей update: вызов в
состоянии, отличном от Active, должен возвращать InvalidLifecycle; обновление с
чужим stream должно возвращать UpdateRejected и сохранять опубликованное
состояние; сценарий с двумя элементами должен покрыть ветвь len == 2 в
apply_observed_update_v2. В существующих и новых тестах замените хардкод stream
31 на valid_authored().stream, сохраняя authored как единый источник значения.
- Around line 259-273: Update read_scenarios_v2 so every ScenarioWireV2 slot
beyond len is validated as zero-valued, including both id and backdrop; return
PrivateFixtureErrorV1::InvalidAuthoredData when any unused slot is nonzero,
while preserving the existing validation and parsing for slots within len.
- Around line 604-625: Update the empty-render branch in the certified result
construction to derive admission from the mapped `state`/`StateKindV1` rather
than trusting the caller-provided `admit_empty_lifecycle` flag. Allow the
zero-valued result only for states whose contract permits no certified render,
and continue returning `MissingCertifiedOutput` for `Ready` or any other state
requiring a certificate; adjust `project_update_commit_v2` usage as needed so
the invariant is enforced at this boundary.

---

Outside diff comments:
In `@crates/labcolors-core/src/private_fixture.rs`:
- Around line 646-655: Update project_certified_render_v1 to accept state,
stream, and revision as parameters and populate those fields directly from the
arguments instead of using Ready, 0, and 0 placeholders. Update
project_attachment_commit_v2 to pass the authoritative values when calling it,
ensuring every caller receives a fully constructed
CertifiedPrivateFixtureResultV1.
- Around line 804-820: Перенесите поле stream в структуру
ExecutedPrivateFixtureV1 и заполняйте его тем же значением, которое используется
при создании attachment в execute_private_fixture_v1. Удалите параметр stream из
complete_run и сохраняйте в PrivateFixtureLifecycleV1::Active значение
executed.stream, чтобы attachment и состояние использовали единый источник
истины.

In `@packages/colors/private-program/consumer.js`:
- Around line 259-283: Update decodeReceipt and its active-attachment state to
retain the last accepted revision, then validate the decoded stream against the
active attachment and require revision to be monotonic before returning the
receipt. Reject receipts from a different stream or with a rolled-back revision,
and add hostile tests covering both foreign-stream and revision-rollback
receipts.

In `@scripts/test-private-program-mutations.mjs`:
- Around line 229-236: В функции applyExactMutation сначала проверьте, что
source, definition.search и definition.replacement являются primitive string, до
вызова source.replaceAll; затем нормализуйте CRLF только после успешной
валидации. Добавьте тест для applyExactMutation(null, definition),
подтверждающий типизированный fail вместо обычного TypeError, и сохраните
существующую обработку корректных входных данных.
🪄 Autofix

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: 93753bb4-1422-4eb5-a5b8-9fd99b747efe

📥 Commits

Reviewing files that changed from the base of the PR and between 67748ef and 7705145.

📒 Files selected for processing (11)
  • crates/labcolors-core/src/generic_boundary_tests.rs
  • crates/labcolors-core/src/private_fixture.rs
  • fixtures/private-program-browser/proof.mjs
  • packages/colors/bench/private-program-wasm.json
  • packages/colors/private-program/consumer.js
  • packages/colors/test/private-program-consumer.test.mjs
  • packages/colors/test/private-program-mutation-contract.test.mjs
  • packages/colors/test/release-contract.test.mjs
  • scripts/build-private-program.mjs
  • scripts/test-private-program-browser.mjs
  • scripts/test-private-program-mutations.mjs

Comment thread crates/labcolors-core/src/private_fixture.rs
Comment thread crates/labcolors-core/src/private_fixture.rs
Comment thread crates/labcolors-core/src/private_fixture.rs
Comment thread crates/labcolors-core/src/private_fixture.rs
Comment thread crates/labcolors-core/src/private_fixture.rs
Comment thread crates/labcolors-core/src/private_fixture.rs
Comment thread crates/labcolors-core/src/private_fixture.rs
lemone112 and others added 2 commits August 12, 2026 11:40
Bind the observed-to-Unknown mutant to the browser lifecycle assertion emitted by the ABI-v2 update path.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Close CodeRabbit findings by removing placeholder state, unifying stream ownership, validating result provenance, eliminating unreachable update states, and preserving typed mutation failures.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai Addressed the substantive findings in 51be60d: result provenance is stream/revision-bound, placeholder receipt fields are removed, stream ownership has one source, unused scenario slots and terminal state are fail-closed, update result is cleared before host entry, the unreachable branch is typed, and mutation input validation now precedes CRLF normalization. Targeted Rust/JS/clippy gates pass. Please re-review the current head.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

@lemone112 I will re-review the current head, including the changes in 51be60d.


🧠 Learnings used
Learnt from: lemone112
Repo: Labpics-Team/lab-colors PR: 482
File: crates/labcolors-core/src/session.rs:284-291
Timestamp: 2026-07-28T01:44:47.790Z
Learning: In `crates/labcolors-core`, `ProgramEvaluationArenaPoolV1::restore` may retain fail-closed `unreachable!` checks for invalid bounded arena slots and double returns: the return route is internally minted from a bounded observation slot and carries a move-only arena lease. `prepared_transition_unwind_returns_the_reusable_evaluation_arena` in `crates/labcolors-core/src/program_joint_integration_tests.rs` covers host unwind after `Session::prepare_update` and verifies that guard retirement restores the arena for a retry.

Learnt from: lemone112
Repo: Labpics-Team/lab-colors PR: 482
File: crates/labcolors-core/src/program_session.rs:0-0
Timestamp: 2026-07-27T22:59:38.332Z
Learning: In `crates/labcolors-core/src/program_session.rs`, `ProgramEvaluationArenaReturnV1` must derive its `ObservationArenaSlotV1` exclusively from the revision-bound `RevisionBoundObservationV1` during `ProgramReportV1::into_arena`. `ProgramEvaluationArenaLeaseV1` intentionally does not retain a duplicate slot, making a mismatched observation/arena return route unrepresentable.
⚠️ Action not completed

Review rate limited.

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 and others added 3 commits August 12, 2026 12:50
Measured by GitHub Actions run 31583435451: 318134 raw bytes on linux-x64 with zero headroom after review fixes.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Validate the total lifecycle/output result grammar and treat every uncertain post-WASM outcome as a poisoned lifecycle requiring cleanup.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Describe legacy-named request/result exports as ABI-v2 framed and identify the dedicated v2 update exports consistently.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai Blind-auditor F1/F2/F3 are closed in 1aa3f99 and 4356d5e. F1: exact state enum plus total Ready/no-output field invariants with hostile matrix tests. F2: traps, host failures, and post-commit receipt failures now use Core probe + poison cleanup; foreign-stream post-commit test proves no stale reuse. F3: mixed legacy-export/ABI-v2 wording corrected. Targeted JS 52/52, fmt, clippy -D warnings green. Please review current head.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

@lemone112 I will review the current head of #571.

I will verify the F1 state and output invariants, the F2 cleanup paths and stale-reuse prevention, and the F3 ABI wording. I will also consider the existing fail-closed arena-return invariants from the prior review context.


🧠 Learnings used
Learnt from: lemone112
Repo: Labpics-Team/lab-colors PR: 482
File: crates/labcolors-core/src/session.rs:284-291
Timestamp: 2026-07-28T01:44:47.790Z
Learning: In `crates/labcolors-core`, `ProgramEvaluationArenaPoolV1::restore` may retain fail-closed `unreachable!` checks for invalid bounded arena slots and double returns: the return route is internally minted from a bounded observation slot and carries a move-only arena lease. `prepared_transition_unwind_returns_the_reusable_evaluation_arena` in `crates/labcolors-core/src/program_joint_integration_tests.rs` covers host unwind after `Session::prepare_update` and verifies that guard retirement restores the arena for a retry.

Learnt from: lemone112
Repo: Labpics-Team/lab-colors PR: 482
File: crates/labcolors-core/src/program_session.rs:0-0
Timestamp: 2026-07-27T22:59:38.332Z
Learning: In `crates/labcolors-core/src/program_session.rs`, `ProgramEvaluationArenaReturnV1` must derive its `ObservationArenaSlotV1` exclusively from the revision-bound `RevisionBoundObservationV1` during `ProgramReportV1::into_arena`. `ProgramEvaluationArenaLeaseV1` intentionally does not retain a duplicate slot, making a mismatched observation/arena return route unrepresentable.
⚠️ Action not completed

Review rate limited.

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 merged commit 479769f into main Aug 12, 2026
10 checks passed
@lemone112
lemone112 deleted the feat/pr-e-observation-update branch August 12, 2026 11:38
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