Skip to content

fix(runtime): transition shapes when integrity flags change - #11015

Closed
proggeramlug wants to merge 2 commits into
PerryTS:mainfrom
proggeramlug:fix/10870-extensibility-shape
Closed

proggeramlug wants to merge 2 commits into
PerryTS:mainfrom
proggeramlug:fix/10870-extensibility-shape

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Publish a new ShapeId when Object.preventExtensions, Object.seal, or Object.freeze adds an integrity flag to a shaped object.
  • Avoid minting another ShapeId when the same operation is repeated without changing flags.
  • Add a keyless-object regression test so descriptor updates cannot hide a missing integrity transition.

Closes #10870.

Verification

  • RUST_TEST_THREADS=1 cargo test --profile perry-dev -p perry-runtime --lib object::shape_rules_tests -- --test-threads=1 (17 passed)
  • cargo fmt --all -- --check
  • bash scripts/check_file_size.sh
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Object.preventExtensions, Object.seal, and Object.freeze now correctly update an object’s shape when its integrity state changes.
    • Repeated calls that do not change the object’s integrity state no longer create unnecessary shape updates.
    • Improved consistency for keyless objects while preserving the shape of unaffected sibling objects.
  • Tests

    • Added coverage for integrity operations on keyless objects.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 11775644-ae31-4660-b8a5-9276997f3d09

📥 Commits

Reviewing files that changed from the base of the PR and between c7cbc3c and 8a52c60.

📒 Files selected for processing (3)
  • changelog.d/11015-integrity-shape-transition.md
  • crates/perry-runtime/src/object/object_ops_frozen.rs
  • crates/perry-runtime/src/object/shape_rules_tests.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The runtime now uses a shared helper to set integrity flags and transition object shape semantics when flags change. Freeze, seal, and preventExtensions use this helper. Tests cover keyless objects, sibling shapes, and repeated calls.

Changes

Integrity flag shape transitions

Layer / File(s) Summary
Centralize integrity flag transitions
crates/perry-runtime/src/object/object_ops_frozen.rs
The freeze, seal, and preventExtensions paths use set_integrity_flags. The helper updates integrity flags and transitions shape semantics when a requested flag is newly set.
Validate keyless object transitions
crates/perry-runtime/src/object/shape_rules_tests.rs, changelog.d/11015-integrity-shape-transition.md
Runtime tests verify shape changes, sibling isolation, and stable shapes on repeated integrity operations. The changelog records the behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8a52c

Integrity operations now update shape stamps when flags change, with coverage for the keyless-object case; no concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a useful summary, issue reference, and verification commands, but it omits the required Changes, Related issue, Test plan, Screenshots / output, and Checklist sections. The ve… Add the required template sections. Move the concrete modifications into Changes, place “Closes #10870” under Related issue, rename Verification to Test plan, and complete the required checklist items. Add Screenshots / output or state that…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main runtime change: transitioning shapes when integrity flags change.
Linked Issues check ✅ Passed The changes satisfy #10870. set_integrity_flags publishes a shape transition when an integrity flag changes, and it avoids a transition when all requested flags are already set. The helper replaces …
Out of Scope Changes check ✅ Passed The changed runtime code, regression test, and changelog entry directly support #10870. No unrelated change is shown. Focused source diff inspection was unavailable because required repository objects…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 …
Full details: Description check

Explanation

The description provides a useful summary, issue reference, and verification commands, but it omits the required Changes, Related issue, Test plan, Screenshots / output, and Checklist sections. The verification content also uses a non-template heading.

Resolution

Add the required template sections. Move the concrete modifications into Changes, place “Closes #10870” under Related issue, rename Verification to Test plan, and complete the required checklist items. Add Screenshots / output or state that it is not applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

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

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

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main in merge train 265 (#11108), released as v0.5.1648 at 9d26936298.

Cherry-picked from this PR's head 8a52c6012f and validated as one tree with 15 other PRs — CI 22/22 green, all 6 gap-suite shards. A train rebase gives the commits new SHAs, so GitHub cannot auto-close the source PR; closing by hand.

Nothing needed from you. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant