From d84cf1882ae38b7dba96452176eea40ef5bb6e90 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 26 Apr 2026 15:18:07 +0000 Subject: [PATCH] =?UTF-8?q?plan:=20tick=20Phase=203=20complete=20=E2=80=94?= =?UTF-8?q?=20dynamic-wind=20OCaml+JS=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- plans/agent-briefings/primitives-loop.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plans/agent-briefings/primitives-loop.md b/plans/agent-briefings/primitives-loop.md index 8e5c7e53..6794f587 100644 --- a/plans/agent-briefings/primitives-loop.md +++ b/plans/agent-briefings/primitives-loop.md @@ -112,10 +112,10 @@ Erlang `try...after` (currently uses double-nested guard workaround). - [x] Spec: implement `dynamic-wind` in `spec/evaluator.sx` such that the after-thunk fires on both normal return AND non-local exit (raise/call-cc escape). Must compose with `guard` — currently they don't interact. -- [ ] OCaml: wire `dynamic-wind` through the CEK machine with a `WindFrame` continuation. -- [ ] JS bootstrapper: update. +- [x] OCaml: wire `dynamic-wind` through the CEK machine with a `WindFrame` continuation. +- [x] JS bootstrapper: update. - [x] Tests: 20+ tests covering normal return, raise, call/cc escape, nested dynamic-winds. -- [ ] Commit: `spec: dynamic-wind + guard integration` +- [x] Commit: `spec: dynamic-wind + guard integration` --- @@ -663,6 +663,7 @@ Brief each language's loop agent (or do inline) after rebasing their branch onto _Newest first._ +- 2026-04-26: Phase 3 complete — OCaml+JS done. CallccContinuation gains winders-depth int; make_callcc_continuation/callcc_continuation_winders_len wired; wind-after/wind-return CekFrame fields fixed (cf_f=after-thunk, cf_extra=winders-len, cf_name=body-result); get_val + transpiler.sx updated. 8/8 dynamic-wind tests pass on OCaml; 235/235 (callcc+guard+do+r7rs) zero regressions. Committed 6602ec8c. - 2026-04-26: Phase 3 Spec+Tests done — dynamic-wind CEK implementation: wind-after/wind-return frames, *winders* stack, kont-unwind-to-handler, wind-escape-to. callcc frame stores winders-len in continuation; callcc-continuation? calls wind-escape-to before escape. 8/8 dynamic-wind tests pass (normal return, raise, call/cc, nested LIFO, guard ordering). 1948/2500 JS (+8). Zero regressions. Committed a9d5a108. - 2026-04-26: Phase 2 complete — Verify+Commit done. OCaml 4874/394, JS 1940/2500 (+60). No regressions. 6 JS-only failures are float≡int platform-inherent. Phase 2 fully landed across 4 commits. - 2026-04-26: Phase 2 JS bootstrapper done — integer?/float?/exact?/inexact? added (Number.isInteger); truncate/remainder/modulo/random-int/exact->inexact/inexact->exact/parse-number added. Fixed sx_server.ml epoch+blob+io-response protocol for Integer type. JS: 1940/2500 (+60). OCaml: 4874/394 baseline. 6 JS tests fail (JS float≡int platform limit). Committed b12a22e6.