Commit Graph

1884 Commits

Author SHA1 Message Date
06a5b5b07c js-on-sx: Object.__callable__ returns this for new Object() no-args
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
js-new-call Object had set obj.__proto__ correctly, but then the
__callable__ returned a fresh (dict), which js-new-call's "use
returned dict over obj" rule honoured — losing the proto. Added
is-new check (this.__proto__ === Object.prototype) and return
this instead of a new dict when invoked as a constructor with
no/null args. Now new Object().__proto__ === Object.prototype.
built-ins/Object: 37/50 → 41/50. conformance.sh: 148/148.
2026-05-07 22:55:35 +00:00
2490c901bf js-on-sx: js-loose-eq unwraps Number and Boolean wrappers
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 31s
js-loose-eq only had a __js_string_value__ unwrap clause, so
Object(1.1) == 1.1 returned false. Added parallel clauses for
__js_number_value__ and __js_boolean_value__ in both directions.
Now new Number(5) == 5, Object(true) == true, etc.
built-ins/Object: 26/50 → 37/50. conformance.sh: 148/148.
2026-05-07 22:25:01 +00:00
27bfceb1aa js-on-sx: Object(value) wraps primitives in their wrapper class
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Per ES spec, Object('s') instanceof String, Object(42).constructor
=== Number, etc. Was passing primitives through as-is. Added cond
clauses to Object.__callable__ that dispatch by type and call
(js-new-call String/Number/Boolean (list arg)). The wrapper
constructors already store __js_*_value__ on this.
built-ins/Object: 16/50 → 26/50. conformance.sh: 148/148.
2026-05-07 22:08:49 +00:00
96a7541d70 js-on-sx: Object(null) and Object(undefined) return new empty object
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Per ES spec, Object(value) returns a new object when value is null
or undefined. Was returning the argument itself, breaking
Object(null).toString(). Added a cond clause to Object.__callable__
that detects nil/js-undefined and falls through to (dict).
built-ins/Object: 15/50 → 16/50. conformance.sh: 148/148.
2026-05-07 21:19:43 +00:00
42cce5e3fc js-on-sx: js-num-from-string uses string->number for exp-form
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
Was computing m * pow(10, e) for "1.2345e-3" forms; floating-point
multiplication introduced rounding (Number(".12345e-3") -
0.00012345 == 2.7e-20). The SX string->number primitive parses the
whole literal in one IEEE round, matching JS literal parsing. Falls
back to manual m * pow(10, e) only when string->number returns nil.
built-ins/Number: 42/50 → 43/50. conformance.sh: 148/148.
2026-05-07 20:47:29 +00:00
2d475f95d1 js-on-sx: constructors carry __proto__ = Function.prototype
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
Object/Array/Number/String/Boolean had no __proto__, so
Function.prototype mutations were invisible to them. Added a
post-init (begin (dict-set! ...)) at the end of runtime.sx
that wires each constructor to js-function-global.prototype.
Combined with the recent Object.prototype fallback, the chain
now terminates correctly: ctor → Function.prototype → Object.prototype.
built-ins/Number: 41/50 → 42/50, built-ins/String: 75/99 → 78/99,
built-ins/Array: 12/45 → 13/45. conformance.sh: 148/148.
2026-05-07 20:14:15 +00:00
11612a511b js-on-sx: js-neg preserves IEEE-754 negative zero
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s
JS -0 was returning rational integer 0; the (- 0 x) form loses the
sign-of-zero. Switched js-neg to (* -1 (exact->inexact (js-to-number a))),
which produces a float and preserves -0.0. Now 1/(-0) === -Infinity
and Math.asinh(-0) preserves the sign as required by the spec.
built-ins/Math: 41/45 → 42/45. conformance.sh: 148/148.
2026-05-07 19:11:30 +00:00
5f97e78d5f js-on-sx: js-div coerces divisor to inexact
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 55s
(js-div 1 0) with rational integer literals throws "rational: division
by zero" instead of producing Infinity. Wrapped the divisor in
(exact->inexact ...) so integer-by-zero now returns inf/-inf/nan
matching JS semantics. Hit by the harness's _isSameValue +0/-0 check
which calls (js-div 1 a) on JS literal arguments.
built-ins/Number: 37/50 → 41/50. built-ins/String: 77/99.
conformance.sh: 148/148.
2026-05-07 18:35:29 +00:00
f4b0ebf353 js-on-sx: js-to-string throws TypeError on non-primitive toString/valueOf
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s
Per ECMA, String(obj) should throw TypeError when both
obj.toString() and obj.valueOf() return objects. Was returning
"[object Object]" instead, silently swallowing the spec violation.
Replaced the inner fallback with (raise (js-new-call TypeError ...)).
Preserves the outer "[object Object]" for the case where there's
no toString lambda. Fixes S8.12.8_A1.
built-ins/String: 75/99 → 77/99 (canonical, best run).
conformance.sh: 148/148.
2026-05-07 17:44:30 +00:00
95fb5ef8ef js-on-sx: TypeError-on-not-callable uses type-of, not (str fn-val)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 56s
Formatting wrapper dicts with (str fn-val) recursively walks the
proto chain through SX inspect — for String/Number wrappers whose
prototype contains lambdas this hangs. Switched the message to
(type-of fn-val), e.g. "dict is not a function". Less specific
but always terminates.
built-ins/String: 73/99 → 75/99 (canonical). conformance.sh:
148/148.
2026-05-07 16:54:06 +00:00
843c3a7e5e js-on-sx: raise JS TypeError for non-callable callee, undefined()
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 59s
Calling a non-callable raised an OCaml-level Eval_error "Not callable"
that JS try/catch couldn't intercept. Added a (js-function? callable)
precheck in js-apply-fn that raises a TypeError instance via
(js-new-call TypeError (list msg)) so e instanceof TypeError is
true. Same swap for the undefined() branch in js-call-plain (was
raising a bare string). built-ins/String: 71/99 → 73/99 (canonical),
74/99 → 75/99 (isolated). conformance.sh: 148/148.
2026-05-07 15:58:16 +00:00
cf0ba8a02a js-on-sx: js-dict-get-walk falls back to Object.prototype
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s
Object literals didn't carry a __proto__ link, so ({}).toString()
couldn't reach Object.prototype.toString. Added a cond clause: if
the object has no __proto__ AND is not Object.prototype itself,
walk into Object.prototype. Now ({}).toString() works, override
of Object.prototype.toString propagates, and ({a:1}).hasOwnProperty
('a') returns true. built-ins/String: 69/99 → 71/99 (canonical),
71/99 → 74/99 (isolated). conformance.sh: 148/148.
2026-05-07 15:08:55 +00:00
4e554113a9 js-on-sx: js-new-call accepts list-typed constructor returns
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m1s
new Array(1,2,3) was returning an empty wrapper object because
js-new-call only honoured a non-undefined return when
(type-of ret) === "dict"; SX lists (representing JS arrays) were
silently discarded. Widened the check to accept "list" too.
Fixes new Array(1,2,3).length, String(new Array(1,2,3)), and any
constructor whose body returns a list. built-ins/String:
67/99 → 69/99 (canonical). conformance.sh: 148/148.
2026-05-07 14:24:52 +00:00
c81e3f3705 js-on-sx: js-num-from-string uses pow (float) for exponent
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m4s
js-pow-int 10 20 overflows int64 (10^20 > 2^63), so numeric literals
like 1e20 and 100000000000000000000 were parsing as
-1457092405402533888. The pow primitive uses float-domain
exponentiation and produces 1e+20 correctly. Single call swap in
js-num-from-string. built-ins/String (with --restart-every 1):
67/99 → 70/99. conformance.sh: 148/148.
2026-05-07 13:42:32 +00:00
66f13c95d5 js-on-sx: js-to-string emits comma-joined elements for SX lists
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m3s
String([1,2,3]) was returning "(1 2 3)" (the SX (str v) fallback in
js-to-string fell through for SX lists). Replaced the fallback with
a list-typed branch that delegates to (js-list-join v ","). Fixes
String(arr), "" + arr, and any implicit array-to-string coercion.
built-ins/String: 65/99 → 67/99. conformance.sh: 148/148.
2026-05-07 12:45:06 +00:00
081f934cad js-on-sx: lexer handles \uXXXX and \xXX string escapes
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m3s
read-string fell through to the literal-char branch for \u and \x,
silently stripping the backslash ("A".length returned 5 instead
of 1). Added js-hex-value helper and two cond clauses that read the
hex digits via js-peek + js-hex-digit?, compute the code point, and
emit it via char-from-code. Invalid escapes fall through to the
literal-char behaviour. built-ins/String (with --restart-every 1):
65/99 → 68/99. conformance.sh: 148/148.
2026-05-07 12:02:30 +00:00
89f1c0ccbe js-on-sx: bump test262 runner per-test timeout 5s→15s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 59s
With 4 parallel workers contending, the 5s default timed out 85/99
built-ins/String tests. Bumping to 15s yields 65/99 (65.7%) with
real failure modes now visible instead of "85x Timeout".
2026-05-07 07:57:23 +00:00
066ddcd6e1 js-on-sx: fix rational-zero-division in core constants + charCodeAt
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
(/ 0 0), (/ 1 0), (/ -1 0) throw "rational: division by zero" with
the OCaml binary's integer rational arithmetic. Replace with nan/inf
literals in js-nan-value, js-infinity-value, js-number-is-finite,
js-math-min, js-math-max. js-max-value-approx looped forever (rationals
never reach float infinity); replace with literal 1.7976931348623157e+308.
charCodeAt and string .length called missing unicode-len /
unicode-char-code-at primitives — switch to (len s) and
(char-code (char-at s idx)). conformance.sh: 0→148/148.
2026-05-06 21:02:58 +00:00
f93b13e861 briefing: push to origin/loops/js after each commit, fix branch ref
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s
2026-05-06 06:47:43 +00:00
97180b4aa3 js-on-sx: wrapper constructor-detection, Array.prototype.toString, >>> operator
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 11s
Number.__callable__ and String.__callable__ now check this.__proto__ ===
Number/String.prototype before writing wrapper slots, preventing false-positive
mutation when called as plain function. js-to-number extended to unwrap
wrapper dicts and call valueOf/toString for plain objects. Array.prototype.toString
replaced with a direct js-list-join implementation (eliminates infinite recursion
via js-invoke-method on dict-based arrays). >>> added to transpiler + runtime.

String test262 subset: 62→66/100. 529/530 unit, 147/148 slice.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:22:53 +00:00
ea63b6d9bb plans: log precision number-to-string iteration
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 14:42:44 +00:00
5d7f931cf1 js-on-sx: high-precision number-to-string via round-trip + digit extraction
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
- js-big-int-str-loop: extract decimal digits from integer-valued float
- js-find-decimal-k: find min decimal places k where round(n*10^k)/10^k == n
- js-format-decimal-digits: insert decimal point into digit string at position (len-k)
- js-number-to-string: if 6-sig-fig round-trip fails AND n in [1e-6, 1e21),
  use digit extraction for full precision (up to 17 sig figs)
- String(1.0000001)="1.0000001", String(1/3)="0.3333333333333333"
- String test262 subset: 58→62/100

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 14:42:32 +00:00
79f3e1ada2 plans: log String wrapper + number-to-string sci notation iteration
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 14:27:25 +00:00
4d00250233 js-on-sx: String wrapper objects + number-to-string sci notation expansion
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
- js-to-string: return __js_string_value__ for String wrapper dicts
- js-loose-eq: coerce String wrapper objects to primitive before compare
- String.__callable__: set __js_string_value__ + length on 'this' when called as constructor
- js-expand-sci-notation: new helper converts mantissa+exp to decimal or integer form
- js-number-to-string: expand 1e-06→0.000001, 1e+06→1000000; fix 1e+21 (was 1e21)
- String test262 subset: 45→58/100

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 14:27:13 +00:00
80c21cbabb js-on-sx: String fixes — fromCodePoint, multi-arg indexOf/split/lastIndexOf, matchAll, constructor, js-to-string dict
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
- String.fromCodePoint added (BMP + surrogate pairs)
- indexOf/lastIndexOf/split now accept optional second argument (fromIndex / limit)
- matchAll stub added to js-string-method and String.prototype
- String property else-branch now falls back to String.prototype (fixes 'a'.constructor === String)
- js-to-string for dict returns [object Object] instead of recursing into circular String.prototype.constructor structure
- js-list-take helper added for split limit

Scoreboard: String 42→43, timeouts 32→13, total 162→202/300 (54%→67.3%). 529/530 unit, 148/148 slice.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 13:41:58 +00:00
70f91ef3d8 plans: log Math methods iteration
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 12:47:27 +00:00
5f38e49ba4 js-on-sx: add missing Math methods (trig, log, hyperbolic, clz32, imul, fround)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 12:47:12 +00:00
0f9d361a92 plans: tick var hoisting, add progress log entry
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 12:19:07 +00:00
11315d91cc js-on-sx: var hoisting — hoist var names as undefined before funcdecls
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 12:18:42 +00:00
f16e1b69c0 js-on-sx: tick ASI checkbox, append progress log entry
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:53:45 +00:00
ae86579ae8 js-on-sx: ASI — :nl token flag + return restricted production (525/526 unit, 148/148 slice)
Lexer: adds :nl (newline-before) boolean to every token. scan! resets the flag
before each skip-ws! call; skip-ws! sets it true when it consumes \n or \r.
Parser: jp-token-nl? reads the flag; jp-parse-return-stmt stops before the
expression when a newline precedes it (return\n42 → return undefined). Four
new tests cover the restricted production and the raw flag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:53:33 +00:00
30d76537d1 sx-loops: each language runs in its own git worktree
Previous version ran all 7 claude sessions in the main working tree on
branch 'architecture'. That would race on git operations and cross-
contaminate commits between languages even though their file scopes
don't overlap. Now each session runs in /root/rose-ash-loops/<lang> on
branch loops/<lang>, created from the current architecture HEAD.

sx-loops-down.sh gains --clean to remove the worktrees; loops/<lang>
branches stay unless explicitly deleted.

Also: second Enter keystroke after the /loop command, since Claude's
input box sometimes interprets the first newline as a soft break.
2026-04-24 16:50:27 +00:00
d7070ee901 Local sx-loops tmux launcher: 7 claude sessions, one per language
sx-loops-up.sh spawns a tmux session 'sx-loops' with 7 windows (lua,
prolog, forth, erlang, haskell, js, hs). Each window runs 'claude'
and then /loop against its briefing at plans/agent-briefings/<x>-loop.md.
Optional arg is the interval (e.g. 15m); omit for model-self-paced.

Each loop does ONE iteration per fire: pick the first unchecked [ ] item,
implement, test, commit, tick, log — then stop. Commits push to
origin/loops/<lang> (safe; not main).

sx-loops-down.sh sends /exit to each window and kills the session.

Attach with: tmux a -t sx-loops
2026-04-24 16:43:40 +00:00
e67852ca96 Scheduled-loop infra: lockfile guard + release + fire log
- scripts/loop-guard.sh — atomic claim with 30-min staleness overtake,
  appends NDJSON event to .loop-logs/<lang>.ndjson. Exit 0 = go ahead,
  exit 1 = another run is live, skip.
- scripts/loop-release.sh — clear lock, log release with exit status.

Intended for 7 per-language /schedule routines firing every 15 minutes.
Lock detects overlap so tight cadences are safe; stale lock (>30 min)
overtaken automatically if an agent dies mid-run.
2026-04-24 16:39:17 +00:00
99753580b4 Recover agent-loop progress: lua/prolog/forth/erlang/haskell phases 1-2
Salvaged from worktree-agent-* branches killed during sx-tree MCP outage:
- lua: tokenizer + parser + phase-2 transpile (~157 tests)
- prolog: tokenizer + parser + unification (72 tests, plan update lost to WIP)
- forth: phase-1 reader/interpreter + phase-2 colon/VARIABLE (134 tests)
- erlang: tokenizer + parser (114 tests)
- haskell: tokenizer + parse tests (43 tests)

Cherry-picked file contents only, not branch history, to avoid pulling in
unrelated ocaml-vm merge commits that were in those branches' bases.
2026-04-24 16:03:00 +00:00
e274878052 HS-plan: log cluster 29 blocked
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:50:22 +00:00
a3d1c37c95 HS-plan: scoreboard — cluster 29 blocked, C=4 done + 1 blocked
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:47:25 +00:00
2b486976a6 HS-plan: mark cluster 29 blocked
sx-tree MCP file ops broken this session (Yojson Type_error "Expected
string, got null" on every file-based call — sx_read_subtree,
sx_find_all, sx_replace_by_pattern, sx_summarise, sx_pretty_print, even
sx_load_check on existing files works but summarise fails). Can't edit
integration.sx to add before:init/after:init dispatch. Additionally 4
of the 6 tests fundamentally require stricter parser error-rejection
(add - to currently parses to (set! nil ...); on click blargh end
accepts blargh as symbol expression) — out of single-cluster budget.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:46:55 +00:00
6e92a5ad66 HS-plan: claim cluster 29 hyperscript:before:init events
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:31:52 +00:00
2cd8e57694 HS-plan: log cluster 19 (pick regex + indices) done +13
Cluster 19 was implemented in 4be90bf2 but the plan/scoreboard rows
still marked it pending. Sync the plan state: mark done, add log entry,
bump merged total 1264 → 1277.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:31:11 +00:00
0f67021aa3 plans: briefings + roadmaps for lua, prolog, forth, erlang, haskell
Five new guest-language plans mirroring the js-on-sx / hs-loop pattern, each
with a phased roadmap (Progress log + Blockers), a self-contained agent
briefing for respawning a long-lived loop, and a shared restore-all.sh that
snapshots state across all seven language loops.

Briefings bake in the lessons from today's stall debugging: never call
sx_build (600s watchdog), only touch lib/<lang>/** + own plan file, commit
every feature, update Progress log on each commit, route shared-file
issues to Blockers rather than fixing them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:16:45 +00:00
81022784bc sx primitives: add regex-* (Re + Re.Pcre backed)
Adds regex-compile/test/exec/match-all/replace/replace-fn/split/source/flags.
Opaque dict handle {:__regex__ true :id :source :flags}; compiled Re.re
cached in a primitives-local table. Replacement supports $&, $1-$9, $$.
Flags: i (CASELESS), m (MULTILINE), s (DOTALL). g is a runtime flag handled
in replace. u (unicode) skipped for now.

Unblocks js-on-sx's regex-platform-override! hook — the JS RegExp shim can
now delegate to real regex instead of the substring stub.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:12:13 +00:00
4be90bf21f HS: pick regex + indices (+13 tests)
Implements cluster 19 — pick command extensions for hs-upstream-pick suite
(11/24 → 24/24, +13):

- Parser:
  - pick items/item EXPR to EXPR supports `start` and `end` keywords
  - pick match / pick matches accept `| <flag>` syntax after regex
  - pick item N without `to` still works (single-item slice)
- Runtime:
  - hs-pick-items / hs-pick-first / hs-pick-last now handle strings
    (not just lists) via slice
  - hs-pick-items resolves `start`/`end` sentinel strings and negative
    indices (len + N) at runtime
  - hs-pick-matches added (wraps regex-find-all, each match as a list)
  - hs-pick-regex-pattern handles (list pat flags) form; `i` flag
    transforms pattern to case-insensitive by replacing alpha chars with
    [aA] character classes (Re.Pcre has no inline-flag support)
- Generator:
  - extract_hs_expr now decodes JS string escape sequences (\" -> ",
    \\ -> \) instead of stripping all backslashes, then re-escapes for
    SX. Preserves regex escapes (\d, \s), CSS escapes, and lambda `\`
    syntax for String.raw template literals while still producing
    correct output for regular JS strings.

Smoke (0-195): 170/195 unchanged (no regressions).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:10:34 +00:00
b45a69b7a4 sx: format_number helper — defuse int_of_float overflow on huge floats
Shared formatter in sx_types.ml. Small integer-valued floats still print
as plain ints; floats outside safe-int range (|n| >= 1e16) now print as
%.17g (full precision) instead of silently wrapping to negative or 0.
Non-integer values keep %g 6-digit behavior — no existing SX tests regress.

Unblocks Number.MAX_VALUE / Math.pow(2,N) style tests in js-on-sx where
iterative float loops were collapsing to 0 at ~2^63.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:09:11 +00:00
8f202e03c2 js-on-sx: .constructor backlink on Number/String/Array/Object protos (+1)
Number.prototype.constructor === Number etc. Four dict-set! lines add
the backlink after each constructor dict is defined.

new String().constructor === String now returns true. Array literals
don't yet link to Array.prototype so [].constructor === Array is still
false — that would need a boxing refactor.

Unit 521/522, slice 148/148 unchanged.
Number 76/100 → 77/100 (+1). String variance-heavy under CPU load.
2026-04-24 14:18:18 +00:00
d865c4d58d HS: plan/scoreboard — fill in SHA 6c1da921 for cluster 28 2026-04-24 14:08:29 +00:00
6c1da9212a HS: ask/answer + prompt/confirm mock (+4 tests)
Wire up the `ask` and `answer` commands end-to-end:

- tokenizer.sx: register `ask` and `answer` as hs-keywords.

- parser.sx: cmd-kw? gains both; parse-cmd dispatches to new
  parse-ask-cmd (emits `(ask MSG)`) and parse-answer-cmd, which
  reads `answer MSG [with YES or NO]`. The with/or pair reads
  yes/no via parse-atom — parse-expr would collapse
  `"Yes" or "No"` into `(or "Yes" "No")` before match-kw "or"
  could fire. The no-`with` form emits `(answer-alert MSG)`.

- compiler.sx: three new cond branches (ask, answer, answer-alert)
  compile to a let that binds __hs-a, sets `the-result` and `it`,
  and returns the value — so `then put it into ...` works.

- runtime.sx: hs-ask / hs-answer / hs-answer-alert call
  window.prompt / confirm / alert via host-call + host-global.

- tests/hs-run-filtered.js: test-name-keyed globalThis.{alert,
  confirm,prompt}; __currentHsTestName is updated before each
  test. Host-set! for innerHTML/textContent now coerces JS
  null → "null" (browser behaviour) so `prompt → null` →
  `put it into #out` renders literal text "null", which the
  fourth test depends on.

Suite hs-upstream-askAnswer: 1/5 -> 5/5.
Smoke 0-195: 166/195 -> 170/195.
2026-04-24 14:08:25 +00:00
30fca2dd19 HS: plan/scoreboard — fill in SHA d7a88d85 for cluster 25 2026-04-24 13:54:52 +00:00
d7a88d85ae HS: parenthesized commands and features (+1 test)
Three parser additions so scripts like `(on click (log me) (trigger foo))`
parse into a single feature with both commands in its body:

1. parse-feat: new cond branch for `paren-open` — advance, recurse
   parse-feat, consume `paren-close`. Allows a feature like `(on click
   ...)` to be grouped in parens.

2. parse-cmd: two new cond branches — on `paren-close` return nil (so
   cl-collect terminates at an outer group close), and on `paren-open`
   advance / recurse / close. Allows single parenthesized commands like
   `(log me)`.

3. cl-collect: previously only recursed when the next token was a
   recognised command keyword (`cmd-kw?`), so after `(log me)` the
   sibling `(trigger foo)` would end the feature body and re-surface as
   a top-level feature. Extended the recursion predicate to also fire
   when the next token is `paren-open`.

Suite hs-upstream-core/parser: 9/14 -> 10/14.
Smoke 0-195: 165/195 -> 166/195.
2026-04-24 13:53:36 +00:00
9db703324d scoreboard: 162/300 (54.0%) wide, +48 over session baseline 2026-04-24 13:27:55 +00:00