Fix CSSX colour rules: reset cssx-resolve JIT to force CEK

cssx-resolve has a complex cond with nested and conditions that the
JIT compiler miscompiles — the colour branch is skipped even when
all conditions are true. Reset to jit_failed_sentinel after loading
so it runs on CEK (which evaluates correctly).

Added vm-reset-fn kernel command for targeted JIT bypass.

All CSSX colour tokens now generate rules: text-violet-699,
text-stone-500, bg-stone-50, etc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 16:49:49 +00:00
parent 364fbac9e1
commit b1de591e9e
2 changed files with 22 additions and 0 deletions

View File

@@ -439,6 +439,16 @@ class OcamlBridge:
skipped += 1
_logger.warning("OCaml load skipped %s: %s",
filepath, e)
# JIT workaround: reset functions with known compilation bugs.
# cssx-resolve has a complex cond that the JIT miscompiles
# (colour branch skipped even when conditions are true).
# Resetting forces CEK interpretation.
try:
await self._send('(vm-reset-fn "cssx-resolve")')
await self._read_until_ok(ctx=None)
except OcamlBridgeError:
pass
# SSR overrides: effect is a no-op on the server (prevents
# reactive loops during island SSR — effects are DOM side-effects)
try: