writeonce/runtime/src
shoney.arickathil 4cf548d6a0 fix: copy-on-push closes the container double-free; line-buffer program output
The unsoundness is closed. All four MCP tools now answer correctly over HTTP
(get_running_crons, list_logs, tail_log -> ["info two","error three"],
search_log -> its match) where `tail_log` used to return
{"isError":true,"text":"tool failed: not a text value"}. corpus 71/0,
woc 565/0, wovm gates green, ASan clean on the container fixtures.

- builtin.c: multi_push, map_set (key AND value) and multi_set COPY a TEXT
  element into the container. The container's declared kinds already make it
  the owner of what it holds, so storing a caller-owned pointer gave one
  string two owners — `push(res, e.log_path)` freed a record's field out from
  under it. OWNED/GCREF elements still move (not copyable; the @gc escape
  keeps their counting), so `set`'s @gc gap is untouched and still recorded
- emit.ml: `drop_fresh_text` — after push/set and the `m[k] = v` / `m[i] = v`
  sugar, a value that was freshly BUILT (call result, `..` chain,
  interpolation) is dropped here, while a value read out of a place is left to
  its owner. That asymmetry is the point: before the copy the borrowed case
  double freed and the fresh case leaked
- obj.c: the runtime's output stream is line-buffered. A long-running program
  writing progress with `print` was invisible when stdout was a file or a pipe
  (full buffering), and a killed one lost its log entirely; byte-exact
  fixtures are unaffected
- scripts/log-watcher-accept.sh + `just log-watcher`: the acceptance test for
  the sample — compile, watch (alert), run (schedule), and three MCP checks.
  Hardened after it lied to me: a per-run port (a stale server on a fixed port
  answered for it), a connect-probe that fails loudly when OUR server did not
  come up, replies read by Content-Length rather than to EOF (the sample never
  closes), and kill -9 on teardown
- docs: the copy rule is in the builtin surface; the status board records the
  gap as closed and adds the new one — a blocking accept/read swallows SIGTERM,
  which belongs to the shard-actor runtime's event loop, not to a patch here

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 18:50:18 +02:00
..
.gitkeep feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
borrow.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
borrow.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
builtin.c fix: copy-on-push closes the container double-free; line-buffer program output 2026-08-14 18:50:18 +02:00
builtin.h feat: json encode/decode + as, .wob v2 class metadata — log-watcher compiles 2026-08-14 17:08:46 +02:00
CODE-LOGIC.md docs: status board on the compile-and-run milestone + CODE-LOGIC beside the code 2026-08-14 17:20:59 +02:00
cont.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
cont.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
gc.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
gc.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
json.c fix: net.Conn is a scalar, \r escape, map[k] is optional, interp node ids 2026-08-14 17:47:45 +02:00
loader.c fix: net.Conn is a scalar, \r escape, map[k] is optional, interp node ids 2026-08-14 17:47:45 +02:00
loader.h feat: json encode/decode + as, .wob v2 class metadata — log-watcher compiles 2026-08-14 17:08:46 +02:00
main.c feat: program mode (argv + exit code); reject + on Text; nil compares by word 2026-08-14 17:18:01 +02:00
obj.c fix: copy-on-push closes the container double-free; line-buffer program output 2026-08-14 18:50:18 +02:00
obj.h feat: nil literal + systems-stdlib text/container builtins 2026-08-14 16:43:38 +02:00
sysio.c feat: systems stdlib OS half — fs, time, env, net, proc 2026-08-14 16:54:31 +02:00
vm.c fix: nullable scalars need their own nil word; EQS accepts nil 2026-08-14 17:28:50 +02:00
vm.h feat: try/catch over the trap system (haxe-parity plan 8, Task 5) 2026-08-14 16:35:36 +02:00
wob.h fix: net.Conn is a scalar, \r escape, map[k] is optional, interp node ids 2026-08-14 17:47:45 +02:00