writeonce/docs/plan
shoney.arickathil 065ac99224 feat: json encode/decode + as, .wob v2 class metadata — log-watcher compiles
docs/examples/log-watcher (1285 lines, 7 files) now compiles clean: 0
diagnostics, a 35KB .wob written. corpus 71/0, woc runtest 565/0, every wovm
unit gate green (both dispatch flavors).

- .wob v2: each class row gains three u32 per-field arrays — the field's NAME
  constant, the CLASS it refers to (or the json-raw marker), and a container
  field's ELEMENT kinds. json is then a runtime service driven by metadata
  instead of per-type generated code. loader/emitter/disassembler/test
  assembler all read and write v2; field-name constants are interned with the
  rest of the pool (interning during serialization silently loses them)
- runtime/src/json.c (new): encode by static kind + object headers + class
  table (nested records need no static knowledge); decode parses and BINDS
  straight into the target class — keys matched to field names, nested objects
  built as the field's class, arrays as a multi of the field's element kind,
  unknown keys skipped, absent keys nil. Malformed input is nil, never a trap
- `as`: `json.decode(text) as T` is the one cast this language has (WO-E403
  for any other `as`, and for a bare json.decode with no target type). Its
  result is `?T`, which is why the decode and the target are one instruction
- json.Value: a reserved type name for a value the source does not inspect —
  the raw JSON slice, kind TEXT, re-emitted verbatim by encode
- docs: 00-wob-format.md is now the v2 reference (class metadata, TRY/ENDTRY,
  the whole builtin surface, WO_T_IO); 08-builtin-surface.md documents the
  text/container builtins, the OS modules with their predeclared records, and
  json's two documented limits (Bool encodes 0/1, floats truncate)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 17:08:46 +02:00
..
compiler feat(compiler): let-type annotations, container literals, statics, pub(read) 2026-08-14 16:22:47 +02:00
done update msg 2026-08-12 15:16:29 +02:00
exploration docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
oop-vm feat: json encode/decode + as, .wob v2 class metadata — log-watcher compiles 2026-08-14 17:08:46 +02:00
05-hand-rolled-json.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
06-bespoke-error.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
07-inotify-content-watcher.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
08-sendfile-static-assets.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
09-concurrency-scaleout.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
10-storage-foundations.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
11-wal-and-recovery.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
12-engine-disk-cutover.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
13-class-model-live-pricing.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
14-mvc-ui-implementation.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
15-mcp-streamable-http.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
16-postgres-mirror.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
discarded.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
learnings.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00