Repository navigation
chore(codemode): bump psychoscript to 0.5.0 - #67613
Conversation
There was a problem hiding this comment.
Looks good. I installed 0.4.0 and ran the codemode tests (326 pass) and core's Code Mode tests (80 pass). tsc --noEmit is clean in both packages. I also ran a few programs through CodeMode.execute: the numeric default sort, the comparator error when sorting objects, JSON.parse on an already-parsed object, fn.toString(), and ArrayBuffer/BigInt all behave as described. Nothing in core, server or sdk persists snapshots, so the move to snapshot format 4 breaks no saved runs.
psychoscript now brings its own acorn 8.16.0 while codemode pins 8.15.0, so the lockfile has two acorn copies. That's harmless, since scan.ts only imports acorn's types.
Public API: unchanged.
39a27fe to
5ae5559
Compare
There was a problem hiding this comment.
Still looks good on 0.5.0. Codemode tests pass (326) and core's Code Mode tests pass (80), and tsc --noEmit is clean in both packages. I ran the changelog examples through CodeMode.execute and they behave as described, including Object.entries(...).sort() and Date sorts without a comparator working again.
Because built-in reuse is now on by default, I also checked isolation between runs: a run that changed Array.prototype, Math.max and JSON.stringify didn't affect the next run on the same runtime.
Public API: unchanged.
Bumps psychoscript, the Code Mode interpreter, from 0.3.0 to 0.5.0. Nothing in OpenCode needed changes; I want it for
Runtime.compile(a follow-up uses it to share one parse between the background check and the run) and for 0.5.0's perf work.Behavior changes models will see in
executeprograms (from the psychoscript changelog, 0.4.0 and 0.5.0):0.4.0 threw on a default sort over any object, arrays and Dates included; 0.5.0 narrowed that to plain objects and class instances, so sorting entries or dates without a comparator works again.
Also new:
ArrayBuffer, BigInt (a too-large BigInt literal now fails to parse), moreSymbolsupport, moreconsolemethods (assert,count,group,time, ...),Array.fromAsync, callable host functions with their own properties, fuel checks whennewandsuper()enter a constructor, long sparse arrays inmap/filter/etc., and RegExp, Uint8Array/Buffer and Promise fixes. None of OpenCode's tests depended on the old sort or JSON.parse behavior.0.5.0's perf work: a runtime hands untouched built-ins from one run to the next, runs of the same source share their parse and bytecode, callback built-ins (
map,filter,sort, ...) loop natively, plain host results and JSON copy directly, and a Bun process that has run many different programs no longer runs later ones 2-4x slower.I left the new
Runtime.makeoptions at their defaults.engineis only a warm-up hint and defaults to JavaScriptCore on Bun and V8 on Node, which is what OpenCode runs on.reusedefaults to on and only hands over built-ins no program changed, so isolation between runs stays the same.The snapshot format went to 4, so runs saved by 0.3.0 don't resume. Nothing in OpenCode persists snapshots:
toBytes/fromBytes/resumeare exported from@opencode/codemodebut nothing in core, server or sdk calls them, so no saved runs break.I ran the sort,
JSON.parseandtoStringexamples above throughCodeMode.executeon 0.5.0 and they behave as shown.Checks:
packages/codemode:bun test, 326 passpackages/core: Code Mode, automation, tool and job tests, 797 pass, 1 fail:ShellTool conditional process substitution > conditional substitutions respect alwaysfails locally withwait: pid ... is not a child of this shell, a bash issue unrelated to Code Modebun run checkat the rootbunx tsc -p tsconfig.build.json --noEmitinpackages/server,packages/sdk,packages/simulation