Compare commits

..

2 Commits

Author SHA1 Message Date
a0bbf74c01 HS-plan: log cluster 36b done +1 (call it-binding)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:14:32 +00:00
35f498ec80 hs: call command binds result to it via emit-set
call X then put it into Y was emitting (hs-win-call ...) without
wrapping in emit-set, so it remained nil. Wrap call result in
emit-set(the-result) so it/the-result are updated. Fixes +1 test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:14:02 +00:00
4 changed files with 2835 additions and 2719 deletions

View File

@@ -789,7 +789,8 @@
(cons (quote do) (map hs-to-sx body)))))))
(fn
(ast)
(let ((ast (if (and (dict? ast) (get ast :hs-ast)) (get ast :children) ast)))
(let
((ast (if (and (dict? ast) (get ast :hs-ast)) (get ast :children) ast)))
(cond
((nil? ast) nil)
((number? ast) ast)
@@ -910,7 +911,8 @@
(append
parts
(list
(hs-to-sx (hs-compile expr-src)))))
(hs-to-sx
(hs-compile expr-src)))))
(set! i (+ close 1))
(tpl-collect)))))
(let
@@ -1185,7 +1187,10 @@
((left (nth ast 1)) (right (nth ast 2)))
(if
(and (list? right) (= (first right) (quote query)))
(list (quote hs-matches?) (hs-to-sx left) (nth right 1))
(list
(quote hs-matches?)
(hs-to-sx left)
(nth right 1))
(list
(quote hs-matches?)
(hs-to-sx left)
@@ -1236,7 +1241,10 @@
(hs-to-sx (nth ast 1))
(hs-to-sx (nth ast 2))))
((= head (quote as))
(list (quote hs-coerce) (hs-to-sx (nth ast 1)) (nth ast 2)))
(list
(quote hs-coerce)
(hs-to-sx (nth ast 1))
(nth ast 2)))
((= head (quote in?))
(list
(quote hs-in?)
@@ -1313,19 +1321,27 @@
((= head (quote last))
(if
(> (len ast) 2)
(list (quote hs-last) (hs-to-sx (nth ast 2)) (nth ast 1))
(list
(quote hs-last)
(hs-to-sx (nth ast 2))
(nth ast 1))
(list (quote hs-query-last) (nth ast 1))))
((= head (quote add-class))
(let
((raw-tgt (nth ast 2)))
(if
(and (list? raw-tgt) (= (first raw-tgt) (quote query)))
(and
(list? raw-tgt)
(= (first raw-tgt) (quote query)))
(list
(quote for-each)
(list
(quote fn)
(list (quote _el))
(list (quote dom-add-class) (quote _el) (nth ast 1)))
(list
(quote dom-add-class)
(quote _el)
(nth ast 1)))
(list (quote hs-query-all) (nth raw-tgt 1)))
(list
(quote dom-add-class)
@@ -1345,7 +1361,11 @@
(map
(fn
(p)
(list (quote dom-set-style) tgt (first p) (nth p 1)))
(list
(quote dom-set-style)
tgt
(first p)
(nth p 1)))
pairs))))
((= head (quote multi-add-class))
(let
@@ -1381,7 +1401,10 @@
(quote set!)
(quote the-result)
(quote __hs-matched))
(list (quote set!) (quote it) (quote __hs-matched))
(list
(quote set!)
(quote it)
(quote __hs-matched))
(list
(quote for-each)
(list
@@ -1416,7 +1439,10 @@
(quote set!)
(quote the-result)
(quote __hs-matched))
(list (quote set!) (quote it) (quote __hs-matched))
(list
(quote set!)
(quote it)
(quote __hs-matched))
(list
(quote for-each)
(list
@@ -1436,13 +1462,17 @@
(cons
(quote do)
(map
(fn (cls) (list (quote dom-remove-class) target cls))
(fn
(cls)
(list (quote dom-remove-class) target cls))
classes))))
((= head (quote remove-class))
(let
((raw-tgt (nth ast 2)))
(if
(and (list? raw-tgt) (= (first raw-tgt) (quote query)))
(and
(list? raw-tgt)
(= (first raw-tgt) (quote query)))
(list
(quote for-each)
(list
@@ -1463,7 +1493,8 @@
(cond
((and (list? tgt) (= (first tgt) (quote array-index)))
(let
((coll (nth tgt 1)) (idx (hs-to-sx (nth tgt 2))))
((coll (nth tgt 1))
(idx (hs-to-sx (nth tgt 2))))
(emit-set
coll
(list (quote hs-splice-at!) (hs-to-sx coll) idx))))
@@ -1472,7 +1503,10 @@
((obj (nth tgt 1)) (prop (nth tgt 2)))
(emit-set
obj
(list (quote hs-dict-without) (hs-to-sx obj) prop))))
(list
(quote hs-dict-without)
(hs-to-sx obj)
prop))))
((and (list? tgt) (= (first tgt) (quote of)))
(let
((prop-ast (nth tgt 1)) (obj-ast (nth tgt 2)))
@@ -1669,8 +1703,13 @@
((and (or (= pos "end") (= pos "start")) (list? raw-tgt) (or (= (first raw-tgt) (quote local)) (= (first raw-tgt) (quote ref))))
(emit-set
raw-tgt
(list (quote hs-put-at!) val pos (hs-to-sx raw-tgt))))
(true (list (quote hs-put!) val pos (hs-to-sx raw-tgt))))))
(list
(quote hs-put-at!)
val
pos
(hs-to-sx raw-tgt))))
(true
(list (quote hs-put!) val pos (hs-to-sx raw-tgt))))))
((= head (quote if))
(if
(> (len ast) 3)
@@ -1833,7 +1872,10 @@
(list (quote fn) (list) (hs-to-sx (nth ast 1)))
(list (quote fn) (list) (hs-to-sx (nth ast 2)))))
((= head (quote fetch))
(list (quote hs-fetch) (hs-to-sx (nth ast 1)) (nth ast 2)))
(list
(quote hs-fetch)
(hs-to-sx (nth ast 1))
(nth ast 2)))
((= head (quote fetch-gql))
(list
(quote hs-fetch-gql)
@@ -1848,19 +1890,17 @@
(make-symbol raw-fn)
(hs-to-sx raw-fn)))
(args (map hs-to-sx (rest (rest ast)))))
(if
(and (list? raw-fn) (= (first raw-fn) (quote ref)))
(list
(quote hs-win-call)
(nth raw-fn 1)
(cons (quote list) args))
(cons fn-expr args))))
(let
((call-expr (if (and (list? raw-fn) (= (first raw-fn) (quote ref))) (list (quote hs-win-call) (nth raw-fn 1) (cons (quote list) args)) (cons fn-expr args))))
(emit-set (quote the-result) call-expr))))
((= head (quote return))
(let
((val (nth ast 1)))
(if
(nil? val)
(list (quote raise) (list (quote list) "hs-return" nil))
(list
(quote raise)
(list (quote list) "hs-return" nil))
(list
(quote raise)
(list (quote list) "hs-return" (hs-to-sx val))))))
@@ -1878,7 +1918,10 @@
(list (list (quote __hs-a) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-a))
(list
(quote set!)
(quote the-result)
(quote __hs-a))
(list (quote set!) (quote it) (quote __hs-a))
(quote __hs-a)))))
((= head (quote answer))
@@ -1889,7 +1932,10 @@
(list (list (quote __hs-a) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-a))
(list
(quote set!)
(quote the-result)
(quote __hs-a))
(list (quote set!) (quote it) (quote __hs-a))
(quote __hs-a)))))
((= head (quote answer-alert))
@@ -1900,7 +1946,10 @@
(list (list (quote __hs-a) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-a))
(list
(quote set!)
(quote the-result)
(quote __hs-a))
(list (quote set!) (quote it) (quote __hs-a))
(quote __hs-a)))))
((= head (quote __get-cmd))
@@ -1911,7 +1960,10 @@
(list (list (quote __hs-g) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-g))
(list
(quote set!)
(quote the-result)
(quote __hs-g))
(list (quote set!) (quote it) (quote __hs-g))
(quote __hs-g)))))
((= head (quote append!))
@@ -2202,7 +2254,10 @@
(list
(quote hs-is)
(hs-to-sx (nth ast 1))
(list (quote fn) (list) (hs-to-sx (nth (nth ast 2) 2)))
(list
(quote fn)
(list)
(hs-to-sx (nth (nth ast 2) 2)))
(nth ast 3)))
((= head (quote halt!))
(list (quote hs-halt!) (quote event) (nth ast 1)))

View File

@@ -4,7 +4,7 @@ Live tally for `plans/hs-conformance-to-100.md`. Update after every cluster comm
```
Baseline: 1213/1496 (81.1%)
Merged: 1307/1496 (87.4%) delta +94
Merged: 1308/1496 (87.4%) delta +95
Worktree: all landed
Target: 1496/1496 (100.0%)
Remaining: ~194 tests (clusters 17/29(partial)/31 blocked; 33/34 partial)
@@ -66,6 +66,7 @@ Remaining: ~194 tests (clusters 17/29(partial)/31 blocked; 33/34 partial)
| 33 | cookie API | partial | +4 |
| 34 | event modifier DSL | partial | +7 |
| 35 | namespaced `def` | done | +3 |
| 36b | `call` result binds to `it` | done | +1 | 35f498ec |
### Bucket E — subsystems (design docs landed, pending review + implementation)

View File

@@ -125,6 +125,8 @@ Orchestrator cherry-picks worktree commits onto `architecture` one at a time; re
35. **[done (+3)] namespaced `def`** — 3 tests. `def ns.foo() ...` creates `ns.foo`. Expected: +3.
36b. **[done (+1)] `call` result binds to `it`** — `call / call functions that return promises are waited on` (1 test). `call X then put it into Y` wasn't setting `it` because the `call` compiler branch emitted the call expression directly without `emit-set`. Fixed by wrapping in `emit-set (quote the-result) call-expr`. Expected: +1.
### Bucket E: subsystems (DO NOT LOOP — human-driven)
All five have design docs on their own worktree branches pending review + merge. After merge, status flips to `design-ready` and they become eligible for the loop.
@@ -175,6 +177,9 @@ Many tests are `SKIP (untranslated)` because `tests/playwright/generate-sx-tests
## Progress log
### 2026-04-26 — cluster 36b call result binds to it (done +1)
- **35f498ec** — `hs: call command binds result to it via emit-set (+1 test)`. `call X then put it into Y` compiled `call X` without `emit-set`, so `it` remained nil. Wrapped call-expr in `emit-set (quote the-result) ...` so both `it` and `the-result` are updated. Suite hs-upstream-call: 5/6 → 6/6. Smoke 0-195: 173/195 → 174/195.
### 2026-04-26 — cluster 7 put hyperscript reprocessing (done, final +1)
- **247bd85c** — `hs: register promiseAString/promiseAnInt as sync test fixtures (+1 test)`. Upstream test "waits on promises" calls `promiseAString()` via window global. OCaml run_tests.ml registers these as NativeFns returning "foo"/"42" synchronously; JS runner had no equivalent. Added `globalThis.promiseAString = () => 'foo'` and `globalThis.promiseAnInt = () => 42` to hs-run-filtered.js. Suite hs-upstream-put: 37/38 → 38/38 (fully done). Smoke 0-195: 173/195 unchanged.

View File

@@ -789,7 +789,8 @@
(cons (quote do) (map hs-to-sx body)))))))
(fn
(ast)
(let ((ast (if (and (dict? ast) (get ast :hs-ast)) (get ast :children) ast)))
(let
((ast (if (and (dict? ast) (get ast :hs-ast)) (get ast :children) ast)))
(cond
((nil? ast) nil)
((number? ast) ast)
@@ -910,7 +911,8 @@
(append
parts
(list
(hs-to-sx (hs-compile expr-src)))))
(hs-to-sx
(hs-compile expr-src)))))
(set! i (+ close 1))
(tpl-collect)))))
(let
@@ -1185,7 +1187,10 @@
((left (nth ast 1)) (right (nth ast 2)))
(if
(and (list? right) (= (first right) (quote query)))
(list (quote hs-matches?) (hs-to-sx left) (nth right 1))
(list
(quote hs-matches?)
(hs-to-sx left)
(nth right 1))
(list
(quote hs-matches?)
(hs-to-sx left)
@@ -1236,7 +1241,10 @@
(hs-to-sx (nth ast 1))
(hs-to-sx (nth ast 2))))
((= head (quote as))
(list (quote hs-coerce) (hs-to-sx (nth ast 1)) (nth ast 2)))
(list
(quote hs-coerce)
(hs-to-sx (nth ast 1))
(nth ast 2)))
((= head (quote in?))
(list
(quote hs-in?)
@@ -1313,19 +1321,27 @@
((= head (quote last))
(if
(> (len ast) 2)
(list (quote hs-last) (hs-to-sx (nth ast 2)) (nth ast 1))
(list
(quote hs-last)
(hs-to-sx (nth ast 2))
(nth ast 1))
(list (quote hs-query-last) (nth ast 1))))
((= head (quote add-class))
(let
((raw-tgt (nth ast 2)))
(if
(and (list? raw-tgt) (= (first raw-tgt) (quote query)))
(and
(list? raw-tgt)
(= (first raw-tgt) (quote query)))
(list
(quote for-each)
(list
(quote fn)
(list (quote _el))
(list (quote dom-add-class) (quote _el) (nth ast 1)))
(list
(quote dom-add-class)
(quote _el)
(nth ast 1)))
(list (quote hs-query-all) (nth raw-tgt 1)))
(list
(quote dom-add-class)
@@ -1345,7 +1361,11 @@
(map
(fn
(p)
(list (quote dom-set-style) tgt (first p) (nth p 1)))
(list
(quote dom-set-style)
tgt
(first p)
(nth p 1)))
pairs))))
((= head (quote multi-add-class))
(let
@@ -1381,7 +1401,10 @@
(quote set!)
(quote the-result)
(quote __hs-matched))
(list (quote set!) (quote it) (quote __hs-matched))
(list
(quote set!)
(quote it)
(quote __hs-matched))
(list
(quote for-each)
(list
@@ -1416,7 +1439,10 @@
(quote set!)
(quote the-result)
(quote __hs-matched))
(list (quote set!) (quote it) (quote __hs-matched))
(list
(quote set!)
(quote it)
(quote __hs-matched))
(list
(quote for-each)
(list
@@ -1436,13 +1462,17 @@
(cons
(quote do)
(map
(fn (cls) (list (quote dom-remove-class) target cls))
(fn
(cls)
(list (quote dom-remove-class) target cls))
classes))))
((= head (quote remove-class))
(let
((raw-tgt (nth ast 2)))
(if
(and (list? raw-tgt) (= (first raw-tgt) (quote query)))
(and
(list? raw-tgt)
(= (first raw-tgt) (quote query)))
(list
(quote for-each)
(list
@@ -1463,7 +1493,8 @@
(cond
((and (list? tgt) (= (first tgt) (quote array-index)))
(let
((coll (nth tgt 1)) (idx (hs-to-sx (nth tgt 2))))
((coll (nth tgt 1))
(idx (hs-to-sx (nth tgt 2))))
(emit-set
coll
(list (quote hs-splice-at!) (hs-to-sx coll) idx))))
@@ -1472,7 +1503,10 @@
((obj (nth tgt 1)) (prop (nth tgt 2)))
(emit-set
obj
(list (quote hs-dict-without) (hs-to-sx obj) prop))))
(list
(quote hs-dict-without)
(hs-to-sx obj)
prop))))
((and (list? tgt) (= (first tgt) (quote of)))
(let
((prop-ast (nth tgt 1)) (obj-ast (nth tgt 2)))
@@ -1669,8 +1703,13 @@
((and (or (= pos "end") (= pos "start")) (list? raw-tgt) (or (= (first raw-tgt) (quote local)) (= (first raw-tgt) (quote ref))))
(emit-set
raw-tgt
(list (quote hs-put-at!) val pos (hs-to-sx raw-tgt))))
(true (list (quote hs-put!) val pos (hs-to-sx raw-tgt))))))
(list
(quote hs-put-at!)
val
pos
(hs-to-sx raw-tgt))))
(true
(list (quote hs-put!) val pos (hs-to-sx raw-tgt))))))
((= head (quote if))
(if
(> (len ast) 3)
@@ -1833,7 +1872,10 @@
(list (quote fn) (list) (hs-to-sx (nth ast 1)))
(list (quote fn) (list) (hs-to-sx (nth ast 2)))))
((= head (quote fetch))
(list (quote hs-fetch) (hs-to-sx (nth ast 1)) (nth ast 2)))
(list
(quote hs-fetch)
(hs-to-sx (nth ast 1))
(nth ast 2)))
((= head (quote fetch-gql))
(list
(quote hs-fetch-gql)
@@ -1848,19 +1890,17 @@
(make-symbol raw-fn)
(hs-to-sx raw-fn)))
(args (map hs-to-sx (rest (rest ast)))))
(if
(and (list? raw-fn) (= (first raw-fn) (quote ref)))
(list
(quote hs-win-call)
(nth raw-fn 1)
(cons (quote list) args))
(cons fn-expr args))))
(let
((call-expr (if (and (list? raw-fn) (= (first raw-fn) (quote ref))) (list (quote hs-win-call) (nth raw-fn 1) (cons (quote list) args)) (cons fn-expr args))))
(emit-set (quote the-result) call-expr))))
((= head (quote return))
(let
((val (nth ast 1)))
(if
(nil? val)
(list (quote raise) (list (quote list) "hs-return" nil))
(list
(quote raise)
(list (quote list) "hs-return" nil))
(list
(quote raise)
(list (quote list) "hs-return" (hs-to-sx val))))))
@@ -1878,7 +1918,10 @@
(list (list (quote __hs-a) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-a))
(list
(quote set!)
(quote the-result)
(quote __hs-a))
(list (quote set!) (quote it) (quote __hs-a))
(quote __hs-a)))))
((= head (quote answer))
@@ -1889,7 +1932,10 @@
(list (list (quote __hs-a) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-a))
(list
(quote set!)
(quote the-result)
(quote __hs-a))
(list (quote set!) (quote it) (quote __hs-a))
(quote __hs-a)))))
((= head (quote answer-alert))
@@ -1900,7 +1946,10 @@
(list (list (quote __hs-a) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-a))
(list
(quote set!)
(quote the-result)
(quote __hs-a))
(list (quote set!) (quote it) (quote __hs-a))
(quote __hs-a)))))
((= head (quote __get-cmd))
@@ -1911,7 +1960,10 @@
(list (list (quote __hs-g) val))
(list
(quote begin)
(list (quote set!) (quote the-result) (quote __hs-g))
(list
(quote set!)
(quote the-result)
(quote __hs-g))
(list (quote set!) (quote it) (quote __hs-g))
(quote __hs-g)))))
((= head (quote append!))
@@ -2202,7 +2254,10 @@
(list
(quote hs-is)
(hs-to-sx (nth ast 1))
(list (quote fn) (list) (hs-to-sx (nth (nth ast 2) 2)))
(list
(quote fn)
(list)
(hs-to-sx (nth (nth ast 2) 2)))
(nth ast 3)))
((= head (quote halt!))
(list (quote hs-halt!) (quote event) (nth ast 1)))