Repository navigation
test: lock CodeMode 2.2.5 for-in deletion break - #5
Conversation
The pinned interpreter still snapshots keys deleted during for...in, including prototype keys, while inherited enumeration matches the host. Keep preflight rejection and assert that divergence on the real runtime. Co-authored-by: hyein.sophia.cho <hyein.sophia.cho@gmail.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
[Low impact] This test-only PR appears safe to merge.
|
Summary
No
@opencode/codemodeversion change. Main and npmlatestare both exact2.2.5. This only records the downstream break that still justifies rejectingfor...in.Published artifact
https://registry.npmjs.org/@opencode/codemode/-/codemode-2.2.5.tgz(sha512-oqZXynEO71nOpM9kOVacyRY6qOceYdk2p9Q0667kwSP4ZXgKSKtxV2HkI0iUBh3ci+TueO88BxIb2CgL1slpGw==), Effect4.0.6(single hoisted copy).Object.create({ p: 1 })plus ownayields["a", "p"].["a", "b", "c"]and prototype keys["p", "q"]. The same loops on Node omit the deleted keys (["a", "c"]and["p"]).ForInStatementbefore runtime construction or any host effect, including the prototype-deletion source. Admitted syntax was not expanded.Starting main SHA:
ca2e788b418c7843f02cf84046973aaea7d4e589. Test revision:00c27b15aa404804eb216ba4688866f7a31bd84a.Verification
npm teston Node v22.23.4, Linux x86_64, withoutPI_OPENCODE_SDK: 83 tests, 82 passed, 0 failed, 1 skipped (isolated real Pi SDK session). The Pi 0.99.0 / 1.3.0 / 1.4.0 matrix was not rerun. Hosted CI is still pending. This is not a live-model or performance check.Note
Low Risk
Only test and assertion changes; no production routing or runtime behavior is modified.
Overview
Test-only update documenting why
for...instays preflight-rejected for@opencode/codemode2.2.5—no dependency or routing logic changes.The for-in cases gain a fourth snippet that deletes a key on the prototype while iterating. route.test.js keeps asserting native routing with
unsupported-syntax:ForInStatementfor all four shapes.preflight.test.js adds helpers to run the same snippets in the installed CodeMode runtime and on the host, then compares results: inherited keys still match Node, but keys deleted mid-loop are still yielded in CodeMode (
["a","b","c"]/["p","q"]) whereas Node skips them—locking in the behavioral break that justifies continued rejection without widening admitted syntax.Reviewed by Cursor Bugbot for commit 00c27b1. Configure here.