Commit graph

185 commits

Author SHA1 Message Date
James Long
2cdf6a67e8 refactor(codemode): write iterator helpers and Iterator.from as prelude generators; drop the Helper cursor and its kinds 2026-11-05 16:17:17 +00:00
James Long
6759bff034 test(codemode): cover prelude round trips, names, privacy, and failure locations 2026-11-05 15:44:38 +00:00
James Long
9cc8ec9b86 refactor(codemode): move iterator consumers, Iterator.from, the JSON reviver, and string replace callbacks to the prelude; drop Drain and consumers 2026-11-05 15:28:31 +00:00
James Long
d8504a97b0 refactor(codemode): move collection constructors, groupBy, forEach, getOrInsertComputed, and Set methods to the prelude 2026-11-05 15:20:57 +00:00
James Long
0bff057313 refactor(codemode): keep array callbacks and sort native, move Array.from iterables and toLocaleString to the prelude 2026-11-05 15:17:00 +00:00
James Long
1acdf4b478 refactor(codemode): add a Code Mode prelude for built-ins that call program code, starting with array callbacks 2026-11-05 15:11:36 +00:00
James Long
cac2611c68 fix(codemode): seal frame kinds so the snapshot build id doesn't depend on what was imported 2026-11-05 15:04:33 +00:00
James Long
dc08129e12 fix(codemode): report a durable call cancelled with its run to tool.after, and document suspend and resume hooks 2026-11-05 00:53:15 +00:00
James Long
edbeec8c2c feat(codemode): pass each tool call its idempotency key, at the tool and at both hooks 2026-11-05 00:53:15 +00:00
James Long
3eab346e2c feat(codemode): suspend and resume runs, with durable tool calls and idempotency keys 2026-11-05 00:53:15 +00:00
James Long
5ad0d06ab2 feat(codemode): save and restore a run's state as a snapshot, with a round-trip test mode 2026-11-05 00:53:15 +00:00
James Long
a9d9cb7a8d refactor(codemode): run JSON, Date, tool calls, search and extension calls as data frames and drop the host generator bridge 2026-11-05 00:53:14 +00:00
James Long
cd0478a46f test(codemode): check suspended generators and for await state is data 2026-11-05 00:53:14 +00:00
James Long
ad4fd72c55 refactor(codemode): run every job on the machine and drive it from a thin Effect loop
The machine now owns the scheduler: job queue, inbox, parked awaits, unhandled
rejections, and promise operations. An await cuts the stack at the innermost
async boundary (the program's frame or an async function's call frame) and
parks the frames on the promise as data. Host calls are HostCall records the
machine hands to the driver at its stops; blocking host work is a blocking
HostCall. The generator evaluator, runner.ts, and CODEMODE_EVALUATOR are gone.
2026-11-05 00:53:14 +00:00
James Long
1dd74883d6 refactor(codemode): keep the machine's hot paths free of per-evaluation closures 2026-11-05 00:53:14 +00:00
James Long
8a4479e1ef test(codemode): run the suite on both evaluators 2026-11-05 00:53:14 +00:00
James Long
90b228dfe8 refactor(codemode): keep Map, Set, iterators, weak collections and RegExp state as data 2026-11-05 00:53:14 +00:00
James Long
377875d6e5 refactor(codemode): make bound functions and resolvers data kinds 2026-11-05 00:53:14 +00:00
James Long
2daa79a85d refactor(codemode): name intrinsics deterministically 2026-11-05 00:53:14 +00:00
James Long
72d958271d refactor(codemode): number AST nodes with stable node ids 2026-11-05 00:53:14 +00:00
Aiden Cline
adcfc83d19
feat(codemode): let programs import globals by Node module name (#61151) 2026-11-01 21:52:57 -06:00
Aiden Cline
d9be7138b7
fix(codemode): copy extension results without trusting their own methods (#58031) 2026-10-29 21:56:25 -05:00
xjh
96c5c3a11a
fix(codemode): preserve null in text encoding (#57639) 2026-10-29 21:40:05 -05:00
Kit Langton
c24c5af3d8
feat(core): add Code Mode checks with static tool scanning to schedules (#60140) 2026-10-29 12:29:02 -07:00
Aiden Cline
ecc075a043
fix(codemode): visit inherited enumerable keys in for...in (#59933) 2026-10-28 23:44:28 -05:00
Aiden Cline
1c49e51303
fix(codemode): run extension before hooks before the host call (#60024) 2026-10-28 16:47:57 -05:00
Aiden Cline
711802c3a3
fix(codemode): let search be awaited or chained like a Promise (#59981) 2026-10-28 15:31:19 -05:00
Aiden Cline
a882cf98a0
feat(codemode): let extension globals return Effects (#59948) 2026-10-28 13:56:18 -05:00
Aiden Cline
c96d200de8
fix(codemode): report parse errors with a location and a hint (#59834) 2026-10-28 10:17:11 -05:00
Aiden Cline
2ed57439da
fix(codemode): explain a stalled program and point at the await that never settles (#59749) 2026-10-27 16:54:06 -05:00
Aiden Cline
e26f85bcd3
refactor(codemode): run programs on one job queue instead of a fiber per async call (#57976) 2026-10-27 12:13:30 -05:00
Rhys Sullivan
3b593dd5d2
fix(codemode): run each job to completion (#54276)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
2026-10-20 13:19:00 -05:00
Aiden Cline
db45c950a9
fix(codemode): honor Uint8Array.from mappers, compare byte searches without coercion, skip flatMap holes, and truncate fractional radixes (#57285)
Co-authored-by: r266-tech <r266-tech@users.noreply.github.com>
Co-authored-by: sdivyanshu90 <divyanshu74.80@gmail.com>
Co-authored-by: icearia0219 <133481415+icearia0219@users.noreply.github.com>
2026-10-20 00:16:55 -05:00
Kit Langton
1aae67e853
chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
Aiden Cline
5335347e80
feat(codemode): add WeakMap and WeakSet (#51257) 2026-09-25 00:15:19 -05:00
Aiden Cline
962c14a49c
fix(codemode): honor thisArg, program toString in computed keys, and ToPrimitive in String and Number arguments (#51264) 2026-09-24 23:46:15 -05:00
Aiden Cline
8061220b08
test(codemode): vendor every eligible test262 directory and bound unsupported globals (#51242) 2026-09-24 20:19:24 -05:00
Aiden Cline
e23d89c9a9
fix(codemode): destructure object patterns from primitives and convert Date components through ToPrimitive (#51239) 2026-09-24 19:32:19 -05:00
Aiden Cline
5256f30957
feat(codemode): honor program valueOf and toString in operators and conversions (#50837) 2026-09-24 18:45:48 -05:00
Aiden Cline
56262121ee
feat(codemode): bind this and arguments in functions, add Function.prototype.call, apply, and bind (#50831) 2026-09-24 16:34:46 -05:00
Aiden Cline
a16eedfed7
fix(codemode): make derived error constructors inherit from Error (#51045) 2026-09-24 14:03:10 -05:00
Aiden Cline
318a8c1aba
feat(codemode): add Object.freeze/seal/create/getPrototypeOf and structuredClone (#50834) 2026-09-24 00:50:54 -05:00
Aiden Cline
dc48655743
fix(codemode): compare with == by IsLooselyEqual and stop deep-walking operands for opaque references (#50830) 2026-09-24 00:36:41 -05:00
Aiden Cline
14a3311a61
feat(codemode): add Uint8Array callback methods and coerce indexOf start indexes (#50829) 2026-09-23 10:27:40 -05:00
Aiden Cline
68b28bdb98
fix(codemode): coerce match/search patterns, allow any for...in target, bind the last duplicate parameter (#50802) 2026-09-22 23:32:27 -05:00
Aiden Cline
17abc5906b
feat(codemode): add tagged templates and String.raw (#50791) 2026-09-22 21:25:21 -05:00
James Long
bf6788b94c
test(codemode): extend promise limit timeout (#50693) 2026-09-22 13:22:21 -04:00
Aiden Cline
9fdcb8da41
fix(codemode): coerce built-in arguments as in JS instead of requiring numbers and strings (#50492) 2026-09-21 23:04:04 -05:00
Aiden Cline
6f8c5ae0aa
fix(codemode): bind generator parameters at the call, not the first next() (#50489) 2026-09-21 22:42:10 -05:00
Aiden Cline
651529d64e
fix(codemode): coerce any value to a property key (#50479) 2026-09-21 21:35:20 -05:00