Skip to content

fix(id/world): bound the oversized-layout ViewAt fallback by presentation_bytes (#942) - #5061

Merged
dezren39 merged 1 commit into
mainfrom
queue/8051-942-viewat-fallback-bound
Nov 3, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/8051-942-viewat-fallback-bound

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #942 (queue task 8051).

PR #927's oversized-layout fallback in WorldCommand::ViewAt never checked its own result against presentation_bytes: the non-screen text path returned the fallback text unmodified, the cropped-screen serialization was returned unchecked, and the serialization-failure path (unwrap_or(fallback_text)) returned the original unchecked text. An over-limit fallback was therefore delivered as success on the very path added to enforce the limit (#811).

Changes:

  • pkgs/id/src/world/actor.rs — the fallback result is now bounded before return: a cropped screen is checked after serialization, non-screen text is checked as-is, and a serialization failure no longer returns the unchecked original. An over-limit (or unserializable) fallback increments view_failures and returns Err("world presentation exceeds N bytes"), matching the existing View/ViewAt error shape.
  • pkgs/id/src/world/tests.rs — regression tests: a non-screen fallback text over the limit and a cropped 120x50 fallback screen whose serialization exceeds the limit; both assert Err, program_healthy == true, and view_failures == 2 (oversized layout + bounded fallback).
  • pkgs/id/src/world_session/mod.rs — the Resize clamp verdict is documented at the clamp: accepting up to the transport bound (500x200) and clamping to 120x50 is intentional per F14.2, not a validation gap.

Verification (laptop worktree, origin/main 821c021):

  • cargo test -p id --lib oversized — 14 passed
  • cargo test -p id --lib world::tests — 164 passed, 0 failed
  • cargo fmt --check -p id reports pre-existing diffs across untouched files under the laptop rustfmt (version/config skew vs repo style); the touched code follows the surrounding file style and CI auto-format owns formatting.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 17:58
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T17:58:34.904099Z
We couldn’t complete this review. Comment @codex review to try again.
2a5736f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8edd643e-6969-482f-bde6-ddf54b98c494
Commits

Reviewing files that changed from the base of the PR and between 3e65e3f and 2a5736f.

Files selected for processing: 3
  • pkgs/id/src/world/actor.rs
  • pkgs/id/src/world/tests.rs
  • pkgs/id/src/world_session/mod.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Resume (task 8051, lane code-e): fresh check state — basic: production line limit (2500) now pass (was QUEUED at park), CodeRabbit skipping. PR is MERGEABLE/CLEAN; diff is exactly the packet scope (actor.rs +18/-3, tests.rs +106, world_session/mod.rs +5). Laptop targeted tests from the implementing attempt: cargo test -p id --lib oversized 14 passed; world::tests 164 passed.

Codex disposition: the Codex summary flag (has_unresolved_findings) accompanies a review run that failed with "You have reached your Codex usage limits" — there are zero inline Codex findings on this PR (verified via the review-comments API for head 2a5736fec). Nothing to fix or reply to per finding; the flag is the usage-limit failure, not a code finding. Merging under the standing criteria.

@dezren39
dezren39 merged commit 75f5f14 into main Nov 3, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/8051-942-viewat-fallback-bound branch November 3, 2026 18:56
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.

id(world): PR #927's oversized-layout fallback never checks its own result against presentation_bytes (#811)

1 participant