writeonce/runtime/src
shoney.arickathil b74e13d21e feat(db): durable:false skips the WAL append and replay
Task 4 of docs/superpowers/plans/2026-08-26-table-residency.md — the first
behavioural change in the iteration.

- db.c: one predicate, `table_is_durable`, gating the three EXISTING mutation
  sites. Kept as a function rather than an inlined condition so
  database/src/CODE-LOGIC.md's "nothing else may mutate storage" claim keeps
  holding — the choke points stayed three
- the ack contract is untouched for durable tables: RAM applied, record
  staged, one commit before the ack, and a failed commit still removes the row
- replay: a log holding records for a class the image now declares volatile is
  a real migration case, not corruption. apply_record returns -2 (distinct
  from -1), wo_wal_replay_ex reports the class id, and main.c names it and
  exits 2. `wo_wal_replay` stays as the NULL wrapper, so all 156 WAL unit
  checks are untouched
- measured, not asserted: 50 inserts wrote 1500 WAL bytes into a durable
  table and ZERO into a volatile one. The file's SIZE proves nothing (it is
  fallocate'd to 1 MiB up front), so the gate measures the non-zero prefix

BUG I INTRODUCED AND CAUGHT: the mismatch message first printed the class name
with %s, but wo_str.data is `char data[]` with NO NUL terminator (obj.h) — a
buffer over-read. Now %.*s with the explicit length, and re-verified under
ASan.

New gate `just residency` (8 checks), because everything above was otherwise
a one-off manual measurement: restart behaviour, the zero-byte write path, the
mismatch refusal (exit 2, names the class, NOT reported as corruption), and
both compile-time refusals. Its own first run failed two checks for a bug in
the script rather than the feature — `woc | grep` under `set -o pipefail`
returns woc's exit 1 even when grep matches, since woc exits 1 whenever it
reports diagnostics. Captures first now, with the reason noted inline.

Also new: corpus run/table-volatile-inprocess pins that a volatile table is a
FULL table in-process — same @unique enforcement, same index probe, same query
surface. Only survival differs, and that is unobservable from inside one
process.

Gates: woc-test 557/0, 18 runtime suites 0 fail, cli_smoke OK, oop-e2e 119/0
(was 118), residency 8/0, employee 8/0, db-actor 8/0, site 21/0, ASan clean on
the new replay path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 08:23:49 +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 feat: iteration 35 — net seams + the serving slice (fiber-per-connection) 2026-08-23 08:04:32 +02:00
builtin.h feat: iterations 19 + 17 — Float/Bytes scalars (.wob v5), library kind + internal/ 2026-08-20 19:24:15 +02:00
CODE-LOGIC.md docs: audit all markdown against the code, fix findings, flatten status folders 2026-08-26 19:20:22 +02:00
cont.c feat: cross-shard actors — placement, envelopes, home-routed frees, WO-E222 (arc T6) 2026-08-20 12:06:13 +02:00
cont.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
crypto.c feat: iteration 34 — digest builtins sha1/sha256/hmac_sha256 (ids 85-87) 2026-08-23 00:42:43 +02:00
crypto.h feat: iteration 34 — digest builtins sha1/sha256/hmac_sha256 (ids 85-87) 2026-08-23 00:42:43 +02:00
gc.c feat: iterations 19 + 17 — Float/Bytes scalars (.wob v5), library kind + internal/ 2026-08-20 19:24:15 +02:00
gc.h feat(runtime): incremental tri-color mark-sweep replaces RC (7b Phase 3a) 2026-08-19 16:52:48 +02:00
json.c feat: iterations 19 + 17 — Float/Bytes scalars (.wob v5), library kind + internal/ 2026-08-20 19:24:15 +02:00
loader.c feat(wob): v7 — class descriptor carries durability and residency 2026-08-26 23:22:26 +02:00
loader.h feat: secondary indexes + @unique trap (iteration 9, Task 4; wob v3) 2026-08-15 12:57:32 +02:00
main.c feat(db): durable:false skips the WAL append and replay 2026-08-27 08:23:49 +02:00
obj.c feat: iterations 19 + 17 — Float/Bytes scalars (.wob v5), library kind + internal/ 2026-08-20 19:24:15 +02:00
obj.h feat: iterations 19 + 17 — Float/Bytes scalars (.wob v5), library kind + internal/ 2026-08-20 19:24:15 +02:00
park.c feat: iteration 35 — net seams + the serving slice (fiber-per-connection) 2026-08-23 08:04:32 +02:00
park.h feat: arc stage 3 T7 — transparent DB actor (WO_T_DB hole closed) 2026-08-21 13:10:26 +02:00
sysio.c feat: TE rejection + listen backlog 1024 + the 1k soak gate 2026-08-23 08:23:55 +02:00
vm.c feat: iteration 35 — net seams + the serving slice (fiber-per-connection) 2026-08-23 08:04:32 +02:00
vm.h feat: iteration 35 — net seams + the serving slice (fiber-per-connection) 2026-08-23 08:04:32 +02:00
wob.h feat(wob): v7 — class descriptor carries durability and residency 2026-08-26 23:22:26 +02:00