From 2b2073cf56ee875d614de8eaa47bd45dd0fb151d Mon Sep 17 00:00:00 2001 From: giles Date: Mon, 29 Jun 2026 17:56:35 +0000 Subject: [PATCH] plan: record Phases 0-2 done (SX engine tests + Playwright trim); Phase 3 (console) remains Co-Authored-By: Claude Opus 4.8 --- plans/sx-native-engine-tests.md | 37 ++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/plans/sx-native-engine-tests.md b/plans/sx-native-engine-tests.md index f8226809..cceae937 100644 --- a/plans/sx-native-engine-tests.md +++ b/plans/sx-native-engine-tests.md @@ -133,8 +133,39 @@ for free (they already drive the tree, just don't print it). - **`hs-repeat-times`** bytecode test (architecture worktree): harness `host-new` stub bug masks a pre-existing `beingTold` resume-env bug. See the diagnosis in this session. +## Progress (2026-06-29) + +- **Phase 0 DONE** (commit 297bdc60) — `web/tests/test-relate-picker.sx`: relate→delete + row drives the real engine (process-elements → submit → mock fetch → delete swap) + against the OCaml runner's mock DOM, green. Mock-DOM completeness added to + `run_tests.ml`: `NodeList.item(i)` (so `dom-query-all` iterates) + a `DOMParser` + mock (so the empty-body `sx-swap=delete` HTML-response path works as in a browser). +- **Phase 1 DONE** (commit fe2da2d3) — same file, load / filter / paging / error-retry, + 5/5 green, zero harness noise. Modelled two browser natives the OCaml runner lacks: + `observe-intersection` (a recording stub the test fires to simulate the sentinel + scrolling into view) and synchronous-timer retry (stripped in the error test — + backoff math is a `test-engine.sx` concern). Mock-DOM: `firstChild`/`lastChild` + (so `children-to-fragment` drains a parsed fragment into innerHTML/outerHTML swaps; + also repaired one pre-existing web test). No web-suite regressions. + - **Key seam discovered:** a top-level `(define …)` override is seen by engine + library functions ONLY when the symbol lives in a *different* library than the + caller (cross-library late-binds through global; same-library resolves locally). + `fetch-request` (boot-helpers) overrides fine from a test; `handle-retry` + (orchestration, same lib as `do-fetch`) does NOT — hence the strip-attr approach. + - **harness-web.sx is NOT loaded** by the OCaml runner (only the JS runner), and its + assertions assume a different mock-element shape (`attrs`/`text`) than the OCaml + mock DOM (`attributes`/`textContent`). Assert through the engine's own `dom-*` + accessors instead. +- **Phase 2 DONE** (commit 98ff7a35) — Playwright trimmed 11 → 5 tests, both ephemeral + suites green (run-spa-check 3/3, run-picker-check 2/2). Kept: WASM boot + + content-addressed module loading (new `/sx/h/` assertion) + boosted nav swap + + back/re-boost (spa-check); bind-boost-form remove button + picker re-bind after a + boosted SPA nav (relate-picker). Deleted the populate/filter/paging/relate-delete/ + error-retry browser tests (now SX). +- **Phase 3 (stretch)** — the console platform — NOT STARTED. + ## Done-when -- `web/tests/test-relate-picker.sx` covers populate / filter / paging / relate-delete / +- [x] `web/tests/test-relate-picker.sx` covers populate / filter / paging / relate-delete / error-retry in SX, green under `sx_test host="ocaml"`. -- Playwright trimmed to the boot smoke; suite still green. -- (Stretch) the picker runs through a non-browser platform. +- [x] Playwright trimmed to the boot smoke; suite still green. +- [ ] (Stretch) the picker runs through a non-browser platform.