Repository navigation
fix(id): include rendered views in world dev watch output (#8782) - #8792
Conversation
WatchReport gains initial_view + steps (per initial input, mirroring DevReport) and WatchCycle gains view (after a successful promotion), captured via DevSession::view() in run_dev_watch. Adds a serialization contract test and an e2e watch test over the Roc counter example (skips where the roc platform host is unbuilt, cf. #8152).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebbc3cfb3b
ℹ️ 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".
| let view = if promotion.outcome == PromotionOutcome::Promoted { | ||
| session.view().await? |
There was a problem hiding this comment.
Report rendering failures without terminating the watch session
If an edited candidate compiles and promotes successfully but its view traps, exhausts fuel, returns invalid UTF-8, or exceeds the presentation limit, this ? terminates the entire watch session instead of recording a cycle diagnostic and continuing to poll. These are recoverable rendering errors: world/actor.rs explicitly keeps the program healthy after a failed view. This also discards all accumulated report output because the CLI prints the report only when run_dev_watch returns successfully. Capture the rendering error in the cycle report and continue watching so the user can fix the rendering code without restarting the session.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed: the post-promotion view call no longer uses ?. A rendering failure is now captured on the cycle (detail: "view failed after promotion: ...", view: None) and the watch keeps polling; the promotion stands and the session last-good state is untouched, so the report is no longer discarded. The pre-cycle initial/steps view calls keep their ? deliberately: the run_dev_watch contract treats failures before the first poll (discovery, compile, fixture gate, launch) as session errors, and no cycle exists yet to carry that diagnostic. Tests on the new head: cargo test -p id-worlds --lib --features sandbox watch_report 2/2 and world_dev::watch_tests 10/10 pass. (Queue worker lane code-d, task 15038, resuming the PR from lane any-a.)
…ending the watch (#8782)
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dca307036
ℹ️ 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".
| }); | ||
| } | ||
| let mut session = DevSession::launch(&module, seed, initial_snapshot_id.clone()).await?; | ||
| let initial_view = session.view().await?; |
There was a problem hiding this comment.
Keep watching after an initial rendering failure
If the initial program launches successfully but its view traps or exceeds the presentation limit, this newly added ? exits before any polling occurs; the same happens at the new view call after each initial input. Unlike the now-fixed post-promotion path, these calls still prevent users from repairing rendering code through the watch session, and an initial view failure even prevents applying an input that could make the view render successfully. world/actor.rs explicitly keeps the program healthy after view failures, so capture these rendering errors as diagnostics and continue applying inputs and watching rather than terminating the session.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the new head: the initial view and the per-input step views now capture rendering failures the same way -- the diagnostic is recorded in the session last-failure (surfaced in the report as last_good.last_failure, the existing channel for recoverable session failures), the view is None, and the watch continues into polling, so an input or a later edit can repair the rendering code. Input application itself keeps ? (that is not a rendering failure). watch_tests 10/10 pass on the new head. (Queue worker lane code-d, task 15038.)
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Fixes #8782.
Watch output (
id world dev DIR --watch --input ...) carried no rendered views:WatchReportandWatchCycleinpkgs/id/crates/id-worlds/src/world_dev.rshad no view field andrun_dev_watchnever calledsession.view(), unlike the one-shot path — so--watch --inputusers had no way to observe the private scratch world, including UI-only edits (Codex P2 on merged PR #8647, comment 4537028877).Change (world_dev.rs only)
WatchReportgainsinitial_view(the view before any initial input, mirroringDevReport) andsteps(Vec<DevStep>: each initial input with its resulting view, mirroring the one-shot report).WatchCyclegainsview: the active world's rendered view after a cycle that promoted a new program;Nonefor cycles that did not promote.run_dev_watchcaptures the views via the existingDevSession::view(). The CLI already serializes the report as JSON, so the views appear in watch output with no CLI change.initial_view: nulland empty steps.Tests
watch_report_serializes_the_views_it_carries(always runs): constructs a watch report with views and asserts they appear in the serialized JSON underinitial_view,steps[].view, andcycles[].view— the exact output the CLI prints.watch_report_carries_views_after_inputs_and_promotion(oracle: the checked-in Roc counter renderscount=N): runs a real watch session over a copy of the counter example with twoincinputs and a comment-only source edit mid-watch; assertsinitial_viewshows count=0, the step after the inputs shows count=2, and the promoted cycle's view shows count=2. It skips where the roc toolchain or the built roc-world platform host is absent, like the existing world_compile tests — on this laptop it skips because host.wasm cannot be built with the installed zig 0.17 (already tracked: id(roc-world): platform host build.zig fails on installed Zig 0.17 (Optimize.Debug removed) — host.wasm cannot be built #8152); the capture points themselves are additionally covered here by the existing session tests (views after inputs, view after promotion).cargo test -p id-worlds --features sandbox --lib world_dev::— 27/27 pass (world_dev is behind thesandboxfeature).Task 15038 (lane any-b).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.