Commit c881a41
fix(eval): cljs-eval-wire throws :cljs-eval-empty on blank-with-no-error response
Closes #6 (defensive layer; root-cause investigation still requires
the live fixture).
The bug: \`scripts/eval-cljs.sh '(+ 1 2)'\` returned
{:ok? true, :value nil, :rfp.wire/value-fits? true, :reinjected? true}.
The {:ok? true} field is a false trust signal — there is no error,
but the actual return value is silently dropped.
Root cause path: shadow-cljs's nREPL response carries a blank :value
(no :err, no :ex), parse-cljs-eval-response correctly returns nil for
blank, cljs-eval-wire takes the trivial-passthrough branch and
synthesizes {:value nil :rfp.wire/value-fits? true}, eval-op emits
{:ok? true :value nil}. Each layer is locally correct; the stack
loses the distinction between "form returned nil" and "shadow gave
us no value at all."
Fix: in cljs-eval-wire, when parse returns nil AND the underlying
response has blank :value AND no :err AND no :ex, throw a structured
ex-info {:reason :cljs-eval-empty :raw-response <res> :hint ...}.
eval-op's existing try/catch surfaces it as
{:ok? false :reason :cljs-eval-empty :data {:raw-response ...}}.
Why surgical (in cljs-eval-wire, not parse-cljs-eval-response): the
sentinel probe (\`runtime-already-injected?\`) and other internal
callers legitimately treat nil-from-blank as "not present" — changing
parse-cljs-eval-response would ripple through every cljs-eval-value
call site.
Legitimate-nil shape (e.g. \`(prn :hi)\`) is unaffected — shadow
encodes that as :value "nil" (the EDN string), which parses to nil
without tripping the blank check.
4 deftests cover: blank-no-error → :cljs-eval-empty; legitimate
:value "nil" → passes through; blank with :ex set → existing
:eval-error path; blank with nil :err and nil :ex (the headline #6
shape) → :cljs-eval-empty.
Note: this closes the false-trust gap and surfaces \`:raw-response\`
for debugging, but does not identify *why* shadow returns blank for
the affected forms. Likely candidates flagged in the original report
(shadow 2.20.11 result-shape change; wire/return! per-shape behavior)
need verification against a live fixture and may be follow-ups.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0c09b67 commit c881a41
2 files changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
429 | 443 | | |
430 | 444 | | |
431 | 445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1026 | 1068 | | |
1027 | 1069 | | |
1028 | 1070 | | |
| |||
0 commit comments