writeonce/compiler/src
shoney.arickathil c793456fe3 feat(json): Bool encodes true/false; fraction/exponent decode fails honestly
Closes json's two documented fidelity limits (iteration 5 strictness):

- field_class gains WOB_FIELD_BOOL (a plain `Bool` field) and
  WOB_FIELD_NIL_BOOL (a `?Bool`: WO_NIL_SCALAR nil + bool encoding) — the
  kind byte alone cannot tell a Bool slot from an Int slot, so the metadata
  carries it. Emitter writes them (field_class_meta); loader whitelists
  them; json.c encodes `true`/`false` (and `null` for a ?Bool nil), decode's
  null/omitted-key pre-write covers NIL_BOOL.
- A JSON number with a fraction or exponent is MALFORMED for an Int field:
  the checked decode (`json.decode(t) as T`) yields nil for the whole
  document instead of silently truncating 3.7 to 3 — the language has no
  float, and corrupting data quietly was the one thing a "checked decode"
  must never do. Floats stay representable through a raw `json.Value` field.
- corpus: run/json-bool-fidelity pins the round-trip (true/false both ways,
  ?Bool null both ways, fraction AND exponent rejected).
- Board's two known-gap entries struck; format doc's field_class marker list
  extended.

Verified: oop-e2e 87/0; runtime test + test-iso OK; woc-test 540/0;
log-watcher 7/0; employee 8/0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 18:04:15 +02:00
..
ast.ml feat(compiler): update-through-row + delete statement (9b cont.) 2026-08-16 05:24:58 +02:00
CODE-LOGIC.md docs: CODE-LOGIC files reflect the 7b collector and inference pass 2026-08-19 17:12:52 +02:00
diag.ml feat: milestone 1 complete — .wob emitter, conformance corpus, single binary; GC redesign specced 2026-08-11 19:31:26 +02:00
disasm.ml feat: retire RC from the emitter and the format — .wob v4 (7b Phase 3b) 2026-08-19 17:07:43 +02:00
dump.ml feat: retire RC from the emitter and the format — .wob v4 (7b Phase 3b) 2026-08-19 17:07:43 +02:00
dune refactor(compiler): inference is one library pass, Gcinfer.infer 2026-08-18 19:00:11 +02:00
emit.ml feat(json): Bool encodes true/false; fraction/exponent decode fails honestly 2026-08-19 18:04:15 +02:00
gcinfer.ml fix(compiler): demand promotion targets the escaping projection's class 2026-08-18 19:07:10 +02:00
lexer.ml fix: net.Conn is a scalar, \r escape, map[k] is optional, interp node ids 2026-08-14 17:47:45 +02:00
owner.ml feat: retire RC from the emitter and the format — .wob v4 (7b Phase 3b) 2026-08-19 17:07:43 +02:00
parser.ml feat(compiler): doctrine reject rows — WO-E105 (iter 5 strictness) 2026-08-19 17:57:36 +02:00
token.ml feat: json encode/decode + as, .wob v2 class metadata — log-watcher compiles 2026-08-14 17:08:46 +02:00
types.ml feat(compiler): doctrine reject rows — WO-E105 (iter 5 strictness) 2026-08-19 17:57:36 +02:00