Files
rose-ash/shared/static/wasm/sx/deps.sxbc.json
giles b274e428eb WASM kernel fixes: parse, env sync, iterative CEK, click delegation
Browser kernel:
- Add `parse` native fn (matches server: unwrap single, list for multiple)
- Restore env==global_env guard on _env_bind_hook (let bindings must not
  leak to _vm_globals — caused JIT CSSX "Not callable: nil" errors)
- Add _env_bind_hook call in env_set_id so set! mutations sync to VM globals
- Fire _vm_global_set_hook from OP_DEFINE so VM defines sync back to CEK env

CEK evaluator:
- Replace recursive cek_run with iterative while loop using sx_truthy
  (previous attempt used strict Bool true matching, broke in wasm_of_ocaml)
- Remove dead cek_run_iterative function

Web modules:
- Remove find-matching-route and parse-route-pattern stubs from
  boot-helpers.sx that shadowed real implementations from router.sx
- Sync boot-helpers.sx to dist/static dirs for bytecode compilation

Platform (sx-platform.js):
- Set data-sx-ready attribute after boot completes (was only in boot-init
  which sx-platform.js doesn't call — it steps through boot manually)
- Add document-level click delegation for a[sx-get] links as workaround
  for bytecoded bind-event not attaching per-element listeners (VM closure
  issue under investigation — bind-event runs but dom-add-listener calls
  don't result in addEventListener)

Tests:
- New test_kernel.js: 24 tests covering env sync, parse, route matching,
  host FFI/preventDefault, deep recursion
- New navigation test: "sx-get link fetches SX not HTML and preserves layout"
  (currently catches layout breakage after SPA swap — known issue)

Known remaining issues:
- JIT CSSX failures: closure-captured variables resolve to nil in VM bytecode
- SPA content swap via execute-request breaks page layout
- Bytecoded bind-event doesn't attach per-element addEventListener (root
  cause unknown — when listen-target guard appears to block despite element
  being valid)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:33:13 +00:00

1 line
13 KiB
JSON

{"magic":"SXBC","version":1,"hash":"e71dcede46ada0e7","module":{"bytecode":[51,1,0,128,0,0,5,51,3,0,128,2,0,5,51,5,0,128,4,0,5,51,7,0,128,6,0,5,51,9,0,128,8,0,5,51,11,0,128,10,0,5,51,13,0,128,12,0,5,51,15,0,128,14,0,5,51,17,0,128,16,0,5,51,19,0,128,18,0,5,51,21,0,128,20,0,5,51,23,0,128,22,0,5,51,25,0,128,24,0,5,51,27,0,128,26,0,5,51,29,0,128,28,0,5,51,31,0,128,30,0,5,51,33,0,128,32,0,5,51,35,0,128,34,0,5,51,37,0,128,36,0,50],"constants":[{"t":"s","v":"scan-refs"},{"t":"code","v":{"bytecode":[52,0,0,0,17,1,20,1,0,16,0,16,1,48,2,5,16,1,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"scan-refs-walk"}],"arity":1}},{"t":"s","v":"scan-refs-walk"},{"t":"code","v":{"bytecode":[16,0,52,1,0,1,1,2,0,52,0,0,2,33,56,0,20,3,0,16,0,48,1,17,2,16,2,1,5,0,52,4,0,2,33,31,0,16,1,16,2,52,7,0,2,52,6,0,1,33,12,0,20,8,0,16,1,16,2,49,2,32,1,0,2,32,1,0,2,32,67,0,16,0,52,1,0,1,1,9,0,52,0,0,2,33,14,0,51,11,0,1,1,16,0,52,10,0,2,32,37,0,16,0,52,1,0,1,1,12,0,52,0,0,2,33,20,0,51,13,0,1,0,1,1,16,0,52,14,0,1,52,10,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"symbol"},{"t":"s","v":"symbol-name"},{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,49,2,50],"constants":[{"t":"s","v":"scan-refs-walk"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"dict"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,52,1,0,2,18,1,49,2,50],"constants":[{"t":"s","v":"scan-refs-walk"},{"t":"s","v":"dict-get"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"keys"}],"arity":2}},{"t":"s","v":"transitive-deps-walk"},{"t":"code","v":{"bytecode":[16,1,16,0,52,1,0,2,52,0,0,1,33,126,0,20,2,0,16,1,16,0,48,2,5,20,3,0,16,2,16,0,48,2,17,3,16,3,52,5,0,1,1,6,0,52,4,0,2,6,34,14,0,5,16,3,52,5,0,1,1,7,0,52,4,0,2,33,25,0,51,9,0,1,1,1,2,20,10,0,16,3,52,11,0,1,48,1,52,8,0,2,32,43,0,16,3,52,5,0,1,1,12,0,52,4,0,2,33,26,0,51,9,0,1,1,1,2,20,10,0,20,13,0,16,3,48,1,48,1,52,8,0,2,32,1,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"island"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,49,3,50],"constants":[{"t":"s","v":"transitive-deps-walk"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"scan-refs"},{"t":"s","v":"component-body"},{"t":"s","v":"macro"},{"t":"s","v":"macro-body"}],"arity":3}},{"t":"s","v":"transitive-deps"},{"t":"code","v":{"bytecode":[52,0,0,0,17,2,16,0,1,2,0,52,1,0,2,33,5,0,16,0,32,9,0,1,2,0,16,0,52,3,0,2,17,3,20,4,0,16,3,16,2,16,1,48,3,5,51,6,0,1,3,16,2,52,5,0,2,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"transitive-deps-walk"},{"t":"s","v":"filter"},{"t":"code","v":{"bytecode":[16,0,18,0,52,1,0,2,52,0,0,1,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"="}],"arity":1,"upvalue-count":1}}],"arity":2}},{"t":"s","v":"compute-all-deps"},{"t":"code","v":{"bytecode":[51,1,0,1,0,20,2,0,16,0,48,1,52,0,0,2,50],"constants":[{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,2,0,1,1,3,0,52,1,0,2,6,34,14,0,5,16,1,52,2,0,1,1,4,0,52,1,0,2,33,19,0,20,5,0,16,1,20,6,0,16,0,18,0,48,2,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"island"},{"t":"s","v":"component-set-deps!"},{"t":"s","v":"transitive-deps"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"env-components"}],"arity":1}},{"t":"s","v":"scan-components-from-source"},{"t":"code","v":{"bytecode":[20,0,0,1,1,0,16,0,48,2,17,1,51,3,0,16,1,52,2,0,2,50],"constants":[{"t":"s","v":"regex-find-all"},{"t":"s","v":"\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)"},{"t":"s","v":"map"},{"t":"code","v":{"bytecode":[1,1,0,16,0,52,0,0,2,50],"constants":[{"t":"s","v":"str"},{"t":"s","v":"~"}],"arity":1}}],"arity":1}},{"t":"s","v":"components-needed"},{"t":"code","v":{"bytecode":[20,0,0,16,0,48,1,17,2,52,1,0,0,17,3,51,3,0,1,3,1,1,16,2,52,2,0,2,5,16,3,50],"constants":[{"t":"s","v":"scan-components-from-source"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,48,2,32,1,0,2,5,20,3,0,18,1,16,0,48,2,17,1,16,1,52,5,0,1,1,6,0,52,4,0,2,6,33,16,0,5,20,8,0,16,1,48,1,52,7,0,1,52,0,0,1,33,10,0,20,8,0,16,1,48,1,32,9,0,20,9,0,16,0,18,1,48,2,17,2,51,11,0,0,0,16,2,52,10,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"empty?"},{"t":"s","v":"component-deps"},{"t":"s","v":"transitive-deps"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}}],"arity":1,"upvalue-count":2}}],"arity":2}},{"t":"s","v":"page-component-bundle"},{"t":"code","v":{"bytecode":[20,0,0,16,0,16,1,49,2,50],"constants":[{"t":"s","v":"components-needed"}],"arity":2}},{"t":"s","v":"page-css-classes"},{"t":"code","v":{"bytecode":[20,0,0,16,0,16,1,48,2,17,2,52,1,0,0,17,3,51,3,0,1,1,1,3,16,2,52,2,0,2,5,51,4,0,1,3,20,5,0,16,0,48,1,52,2,0,2,5,16,3,50],"constants":[{"t":"s","v":"components-needed"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,2,0,1,1,3,0,52,1,0,2,33,19,0,51,5,0,0,1,20,6,0,16,1,48,1,52,4,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"component-css-classes"}],"arity":1,"upvalue-count":2}},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"scan-css-classes"}],"arity":2}},{"t":"s","v":"scan-io-refs-walk"},{"t":"code","v":{"bytecode":[16,0,52,1,0,1,1,2,0,52,0,0,2,33,55,0,20,3,0,16,0,48,1,17,3,16,1,16,3,52,4,0,2,33,31,0,16,2,16,3,52,4,0,2,52,5,0,1,33,12,0,20,6,0,16,2,16,3,49,2,32,1,0,2,32,1,0,2,32,71,0,16,0,52,1,0,1,1,7,0,52,0,0,2,33,16,0,51,9,0,1,1,1,2,16,0,52,8,0,2,32,39,0,16,0,52,1,0,1,1,10,0,52,0,0,2,33,22,0,51,11,0,1,0,1,1,1,2,16,0,52,12,0,1,52,8,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"symbol"},{"t":"s","v":"symbol-name"},{"t":"s","v":"contains?"},{"t":"s","v":"not"},{"t":"s","v":"append!"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,49,3,50],"constants":[{"t":"s","v":"scan-io-refs-walk"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"dict"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,52,1,0,2,18,1,18,2,49,3,50],"constants":[{"t":"s","v":"scan-io-refs-walk"},{"t":"s","v":"dict-get"}],"arity":1,"upvalue-count":3}},{"t":"s","v":"keys"}],"arity":3}},{"t":"s","v":"scan-io-refs"},{"t":"code","v":{"bytecode":[52,0,0,0,17,2,20,1,0,16,0,16,1,16,2,48,3,5,16,2,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"scan-io-refs-walk"}],"arity":2}},{"t":"s","v":"transitive-io-refs-walk"},{"t":"code","v":{"bytecode":[16,1,16,0,52,1,0,2,52,0,0,1,33,163,0,20,2,0,16,1,16,0,48,2,5,20,3,0,16,3,16,0,48,2,17,5,16,5,52,5,0,1,1,6,0,52,4,0,2,33,52,0,51,8,0,1,2,20,9,0,16,5,52,10,0,1,16,4,48,2,52,7,0,2,5,51,11,0,1,1,1,2,1,3,1,4,20,12,0,16,5,52,10,0,1,48,1,52,7,0,2,32,71,0,16,5,52,5,0,1,1,13,0,52,4,0,2,33,54,0,51,8,0,1,2,20,9,0,20,14,0,16,5,48,1,16,4,48,2,52,7,0,2,5,51,11,0,1,1,1,2,1,3,1,4,20,12,0,20,14,0,16,5,48,1,48,1,52,7,0,2,32,1,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"scan-io-refs"},{"t":"s","v":"component-body"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,18,2,18,3,49,5,50],"constants":[{"t":"s","v":"transitive-io-refs-walk"}],"arity":1,"upvalue-count":4}},{"t":"s","v":"scan-refs"},{"t":"s","v":"macro"},{"t":"s","v":"macro-body"}],"arity":5}},{"t":"s","v":"transitive-io-refs"},{"t":"code","v":{"bytecode":[52,0,0,0,17,3,52,0,0,0,17,4,16,0,1,2,0,52,1,0,2,33,5,0,16,0,32,9,0,1,2,0,16,0,52,3,0,2,17,5,20,4,0,16,5,16,4,16,3,16,1,16,2,48,5,5,16,3,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"transitive-io-refs-walk"}],"arity":3}},{"t":"s","v":"compute-all-io-refs"},{"t":"code","v":{"bytecode":[51,1,0,1,0,1,1,20,2,0,16,0,48,1,52,0,0,2,50],"constants":[{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,2,0,1,1,3,0,52,1,0,2,33,21,0,20,4,0,16,1,20,5,0,16,0,18,0,18,1,48,3,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"component-set-io-refs!"},{"t":"s","v":"transitive-io-refs"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"env-components"}],"arity":2}},{"t":"s","v":"component-io-refs-cached"},{"t":"code","v":{"bytecode":[16,0,1,1,0,52,0,0,2,33,5,0,16,0,32,9,0,1,1,0,16,0,52,2,0,2,17,3,20,3,0,16,1,16,3,48,2,17,4,16,4,52,5,0,1,1,6,0,52,4,0,2,6,33,36,0,5,20,9,0,16,4,48,1,52,8,0,1,52,7,0,1,6,33,16,0,5,20,9,0,16,4,48,1,52,10,0,1,52,7,0,1,33,10,0,20,9,0,16,4,49,1,32,11,0,20,11,0,16,0,16,1,16,2,49,3,50],"constants":[{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"not"},{"t":"s","v":"nil?"},{"t":"s","v":"component-io-refs"},{"t":"s","v":"empty?"},{"t":"s","v":"transitive-io-refs"}],"arity":3}},{"t":"s","v":"component-pure?"},{"t":"code","v":{"bytecode":[16,0,1,1,0,52,0,0,2,33,5,0,16,0,32,9,0,1,1,0,16,0,52,2,0,2,17,3,20,3,0,16,1,16,3,48,2,17,4,16,4,52,5,0,1,1,6,0,52,4,0,2,6,33,16,0,5,20,9,0,16,4,48,1,52,8,0,1,52,7,0,1,33,14,0,20,9,0,16,4,48,1,52,10,0,1,32,15,0,20,11,0,16,0,16,1,16,2,48,3,52,10,0,1,50],"constants":[{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"not"},{"t":"s","v":"nil?"},{"t":"s","v":"component-io-refs"},{"t":"s","v":"empty?"},{"t":"s","v":"transitive-io-refs"}],"arity":3}},{"t":"s","v":"render-target"},{"t":"code","v":{"bytecode":[16,0,1,1,0,52,0,0,2,33,5,0,16,0,32,9,0,1,1,0,16,0,52,2,0,2,17,3,20,3,0,16,1,16,3,48,2,17,4,16,4,52,6,0,1,1,7,0,52,5,0,2,52,4,0,1,33,6,0,1,8,0,32,72,0,20,9,0,16,4,48,1,17,5,16,5,1,8,0,52,5,0,2,33,6,0,1,8,0,32,45,0,16,5,1,10,0,52,5,0,2,33,6,0,1,10,0,32,27,0,20,11,0,16,0,16,1,16,2,48,3,52,4,0,1,33,6,0,1,8,0,32,3,0,1,10,0,50],"constants":[{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"env-get"},{"t":"s","v":"not"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"server"},{"t":"s","v":"component-affinity"},{"t":"s","v":"client"},{"t":"s","v":"component-pure?"}],"arity":3}},{"t":"s","v":"page-render-plan"},{"t":"code","v":{"bytecode":[20,0,0,16,0,16,1,48,2,17,3,52,1,0,0,17,4,52,2,0,0,17,5,52,2,0,0,17,6,52,2,0,0,17,7,51,4,0,1,1,1,2,1,4,1,5,1,7,1,6,16,3,52,3,0,2,5,1,5,0,16,7,1,6,0,16,5,1,7,0,16,4,1,8,0,16,6,65,4,0,50],"constants":[{"t":"s","v":"components-needed"},{"t":"s","v":"dict"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,48,3,17,1,18,2,16,0,16,1,52,1,0,3,5,16,1,1,3,0,52,2,0,2,33,33,0,20,4,0,18,3,16,0,48,2,5,51,6,0,0,4,20,7,0,16,0,18,0,18,1,48,3,52,5,0,2,32,9,0,20,4,0,18,5,16,0,49,2,50],"constants":[{"t":"s","v":"render-target"},{"t":"s","v":"dict-set!"},{"t":"s","v":"="},{"t":"s","v":"server"},{"t":"s","v":"append!"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"component-io-refs-cached"}],"arity":1,"upvalue-count":6}},{"t":"s","v":"io-deps"},{"t":"s","v":"server"},{"t":"s","v":"components"},{"t":"s","v":"client"}],"arity":3}},{"t":"s","v":"env-components"},{"t":"code","v":{"bytecode":[51,1,0,1,0,16,0,52,2,0,1,52,0,0,2,50],"constants":[{"t":"s","v":"filter"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,1,0,1,6,34,7,0,5,16,1,52,2,0,1,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"component?"},{"t":"s","v":"macro?"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"keys"}],"arity":1}}]}}