[PR #540] [MERGED] fix(replay): keep __proto__ own properties and reject symbol-keyed results #2062

Closed
opened 2026-10-16 21:13:51 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/540
Author: @morluto
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: cleanup/replay-projection-fidelity


📝 Commits (2)

  • e60a838 fix(replay): keep proto own properties and reject symbol-keyed results
  • f9e784b Merge origin/main into cleanup/replay-projection-fidelity

📊 Changes

2 files changed (+65 additions, -1 deletions)

View changed files

📝 src/replay/JavaScriptReplayWorker.ts (+18 -1)
📝 tests/boundary/providers/replay/javascriptReplayWorker.test.ts (+47 -0)

📄 Description

Two ways the replay result projection could silently change what a program did, both reproduced before fixing.

1. A __proto__ own property disappeared. The projector copies properties with output[key] = value. For the key __proto__ that is not an assignment — it is a prototype mutation, so the property vanished from the output entirely (verified: own keys [], prototype changed) and the digest described a program that never had that property. The projector now defines __proto__ as a real own property.

2. Symbol keys were dropped without a word. Object.getOwnPropertyDescriptors returns them but Object.entries omits them, so {a: 1, [Symbol('s')]: 2} projected to {a: 1} and returned outcome: "return" with a digest of a different object. Silently losing data is exactly what the rest of this projector refuses to do — accessors, proxies and unsupported prototypes all raise serialization_error. Symbol keys now do the same, so the caller learns the projection is incomplete instead of trusting a digest.

Tests: a symbol-keyed result asserts serialization_error with the reason, and an own-__proto__ object round-trips with the key intact. Both run through the compiled worker subprocess. Full suite green: 1925 passed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/540 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `cleanup/replay-projection-fidelity` --- ### 📝 Commits (2) - [`e60a838`](https://github.com/morluto/rea/commit/e60a838ed14e66389376c946cdad6a8ef1da4a63) fix(replay): keep __proto__ own properties and reject symbol-keyed results - [`f9e784b`](https://github.com/morluto/rea/commit/f9e784ba49544b95e94865e08399014934d098ae) Merge origin/main into cleanup/replay-projection-fidelity ### 📊 Changes **2 files changed** (+65 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/replay/JavaScriptReplayWorker.ts` (+18 -1) 📝 `tests/boundary/providers/replay/javascriptReplayWorker.test.ts` (+47 -0) </details> ### 📄 Description Two ways the replay result projection could silently change what a program did, both reproduced before fixing. **1. A `__proto__` own property disappeared.** The projector copies properties with `output[key] = value`. For the key `__proto__` that is not an assignment — it is a prototype mutation, so the property vanished from the output entirely (verified: own keys `[]`, prototype changed) and the digest described a program that never had that property. The projector now defines `__proto__` as a real own property. **2. Symbol keys were dropped without a word.** `Object.getOwnPropertyDescriptors` returns them but `Object.entries` omits them, so `{a: 1, [Symbol('s')]: 2}` projected to `{a: 1}` and returned `outcome: "return"` with a digest of a different object. Silently losing data is exactly what the rest of this projector refuses to do — accessors, proxies and unsupported prototypes all raise `serialization_error`. Symbol keys now do the same, so the caller learns the projection is incomplete instead of trusting a digest. Tests: a symbol-keyed result asserts `serialization_error` with the reason, and an own-`__proto__` object round-trips with the key intact. Both run through the compiled worker subprocess. Full suite green: 1925 passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:13:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2062
No description provided.