kobako 0.31.0-x86_64-linux → 0.32.0-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.githooks/linux-tests.sh +29 -0
  3. data/.release-please-manifest.json +1 -1
  4. data/CHANGELOG.md +125 -0
  5. data/README.md +2 -3
  6. data/ROADMAP.md +0 -1
  7. data/crates/kobako-runtime/CHANGELOG.md +90 -0
  8. data/crates/kobako-runtime/README.md +1 -1
  9. data/crates/kobako-transport/CHANGELOG.md +7 -0
  10. data/crates/kobako-transport/README.md +1 -1
  11. data/crates/kobako-wasmtime/CHANGELOG.md +47 -0
  12. data/crates/kobako-wasmtime/README.md +3 -3
  13. data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +13 -0
  14. data/data/kobako.wasm +0 -0
  15. data/lib/kobako/3.3/kobako.so +0 -0
  16. data/lib/kobako/3.4/kobako.so +0 -0
  17. data/lib/kobako/4.0/kobako.so +0 -0
  18. data/lib/kobako/catalog/handles.rb +9 -5
  19. data/lib/kobako/codec/decoder.rb +1 -1
  20. data/lib/kobako/codec/state.rb +2 -18
  21. data/lib/kobako/codec/value_budget.rb +4 -4
  22. data/lib/kobako/codec.rb +5 -6
  23. data/lib/kobako/errors.rb +4 -7
  24. data/lib/kobako/filesystem.rb +1 -1
  25. data/lib/kobako/fork.rb +42 -0
  26. data/lib/kobako/handle.rb +1 -2
  27. data/lib/kobako/sandbox.rb +17 -36
  28. data/lib/kobako/sandbox_options.rb +7 -9
  29. data/lib/kobako/usage.rb +4 -2
  30. data/lib/kobako/version.rb +1 -1
  31. data/lib/kobako.rb +2 -2
  32. data/sig/kobako/catalog/handles.rbs +2 -0
  33. data/sig/kobako/codec/state.rbs +0 -4
  34. data/sig/kobako/codec/value_budget.rbs +1 -1
  35. data/sig/kobako/codec.rbs +2 -2
  36. data/sig/kobako/errors.rbs +0 -3
  37. data/sig/kobako/fork.rbs +17 -0
  38. data/sig/kobako/runtime.rbs +2 -2
  39. data/sig/kobako/sandbox.rbs +3 -12
  40. data/sig/kobako/sandbox_options.rbs +0 -2
  41. metadata +5 -5
  42. data/lib/kobako/pool.rb +0 -162
  43. data/sig/core/thread.rbs +0 -6
  44. data/sig/kobako/pool.rbs +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 349a9a4d72fdda30a8ec987824cabd0451845ed83d6d2489bfa9ba1daa6ba031
4
- data.tar.gz: ee13fcee2b8efea97334552ba55a3cd7d74bf7e1368509efa8d7d2f72ba26d7b
3
+ metadata.gz: 2f86eb61fdc843ccefbf072be205dc3f305b21e218fd4ffa5726d194d0d7604d
4
+ data.tar.gz: 192c94b6e9201bacfb332a5eb7783324faed4072b11b91c46dff7a26509ce530
5
5
  SHA512:
6
- metadata.gz: af8f439b4da03a968a3fa0295745926f09742e5c44fa953330096f4c6a7947086ad4db4666d2bf7cef6fc3ebdf5cc58a980b5a3d9dce205a958a34e2979ee2c6
7
- data.tar.gz: b9d3d3cacd290e3dbda61b17a3cbb5ebbddebd2d961852445c341cd6c7cf142cb859b1450ff8fff5da6293c0fdd61cc8028bf30970d364e020065fbf8ae0e6a7
6
+ metadata.gz: f548a13faf8cc0ce261b29bfeade377e012e7635b09498ad901a5b4ebf02efc84d1fbfd6b7725072609f58a655edaad6cd6f27c26d612151fdb03ef8a5d3a42a
7
+ data.tar.gz: 466ff92cef12a45d5b778ae1ad60a1cdaee0a10292e4e269db331e4e24e6ece3231135771432b3a5e7121f0c064d974ca4f8e91c9e1cdbd6f186c0d73f07c16f
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+ # pre-push: run the tests only Linux compiles — the Mount differential probe
3
+ # against wasmtime-wasi — in a Linux container, as CI runs on ubuntu, since
4
+ # a macOS gate never builds them. `rake hooks:install` registers it.
5
+ set -euo pipefail
6
+
7
+ root="$(git rev-parse --show-toplevel)"
8
+
9
+ # Nothing to run in where docker is absent or stopped.
10
+ docker info >/dev/null 2>&1 || {
11
+ echo "[linux-tests] docker unavailable — skipping the Linux-only tests" >&2
12
+ exit 0
13
+ }
14
+
15
+ log="${TMPDIR:-/tmp}"
16
+ log="${log%/}/kobako-linux-tests.log"
17
+
18
+ # Named volumes keep the target and the registry between pushes, so a
19
+ # later run compiles only what changed.
20
+ toolchain=$(sed -nE 's/^channel *= *"([^"]+)".*/\1/p' "$root/rust-toolchain.toml")
21
+ echo "[linux-tests] running the Linux-only tests in rust:${toolchain}-slim" >&2
22
+ if ! docker run --rm -v "$root":/src:ro -v kobako-linux-target:/target \
23
+ -v kobako-linux-cargo:/usr/local/cargo/registry -e CARGO_TARGET_DIR=/target \
24
+ -w /src/crates "rust:${toolchain}-slim" \
25
+ cargo test -p kobako-wasmtime --lib differential >"$log" 2>&1; then
26
+ grep -E 'FAILED|panicked|left:|right:|error' "$log" | head -n 40 >&2
27
+ echo "[linux-tests] failed; full output: $log" >&2
28
+ exit 1
29
+ fi
@@ -1 +1 @@
1
- {".":"0.31.0","wasm/kobako-core":"0.21.0","wasm/kobako-mruby":"0.21.0","wasm/kobako-io":"0.21.0","wasm/kobako-json":"0.21.0","wasm/kobako-regexp":"0.21.0","wasm/kobako-baker":"0.21.0","crates/kobako-transport":"0.21.0","crates/kobako-codec":"0.21.0","crates/kobako-runtime":"0.21.0","crates/kobako-wasmtime":"0.21.0","crates/kobako":"0.21.0"}
1
+ {".":"0.32.0","wasm/kobako-core":"0.22.0","wasm/kobako-mruby":"0.22.0","wasm/kobako-io":"0.22.0","wasm/kobako-json":"0.22.0","wasm/kobako-regexp":"0.22.0","wasm/kobako-baker":"0.22.0","crates/kobako-transport":"0.22.0","crates/kobako-codec":"0.22.0","crates/kobako-runtime":"0.22.0","crates/kobako-wasmtime":"0.22.0","crates/kobako":"0.22.0"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,130 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.32.0](https://github.com/elct9620/kobako/compare/v0.31.0...v0.32.0) (2026-11-27)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **spec:** Kobako::Filesystem::Tmpfs.new without size: holds 4 MiB and 1025 entries instead of 64 MiB and 16385. Pass
9
+ * **wasmtime:** a guest no longer reads EINTR from a call its run's deadline or interrupt ended; the run ends there as a timeout or an interrupt.
10
+ * **runtime:** a listing, a walk, or a copy up in a run past its deadline or interrupted now answers EINTR mid-way instead of finishing.
11
+ * **runtime:** a reader may now take a free directory ahead of a writer already waiting for it, and a trylock fails while any thread waits, so calls on a contended directory land in another order.
12
+ * an invocation issuing its 1,000,001st Handle raises
13
+ * **runtime:** connection_limit now also counts name lookups, failed dials, and each further address an HTTP request dials, so a run reaches the default 50 sooner; a socket to a new name spends two. Raise connection_limit for a script that needs more.
14
+ * a Sandbox whose memory_limit is above 4 MiB, or nil, no longer accepts a guest payload of more than 262144 values; such a payload fails as it does under the default cap.
15
+ * **spec:** memory_limit measures the guest's own memory only. A Host App that relied on it to cap host-side buffers caps them through open_connection_limit and open_file_limit instead.
16
+ * **memcg:** a run whose start function, global initializers, table growth, or request grow past memory_limit now raises Kobako::MemoryLimitError, growth of several memories and the GC heap adds up, and Usage#memory_peak includes them. Raise memory_limit by that growth to keep the earlier headroom.
17
+ * **spec:** a run whose start function, global initializers, table growth, or request grow past memory_limit now raises Kobako::MemoryLimitError, and growth of several memories and the GC heap adds up. Raise memory_limit by that growth to keep the earlier headroom.
18
+ * **fork:** Kernel#fork, IO.popen("-") and Process.daemon raise RuntimeError while any Sandbox run is in progress on any Thread, where v0.31.0 forked. Fork before the runs start or once none is in progress, as a preforking server does before it serves, and retry a refused fork after the runs end.
19
+ * **spec:** on Windows, a lookup dropped before it answers keeps its place against `open_connection_limit` until the host's query finishes, so a script dropping lookups and asking again at the cap may see `EAI_AGAIN` a moment longer.
20
+ * **spec:** `open_file_limit` defaults to 16 instead of 1024. A script holding more files, sockets, or Overlay directories at once raises `Errno::EMFILE` sooner; pass `open_file_limit:` to `Sandbox.new` with the room the script needs.
21
+ * **spec:** a script that closes a TCP connection with bytes the peer has not read keeps that connection counted against `open_file_limit` until the peer reads them, so opening another file right away may raise `Errno::EMFILE`; with no open file left, the closed connection resets and its unsent bytes are lost.
22
+ * **filesystem:** `Kobako::Filesystem::Bind.new` raises `Errno::EMFILE` or `Errno::ENFILE` when the host is out of descriptors, where it raised `ArgumentError`; rescue `SystemCallError` for that case.
23
+ * **spec:** `Kobako::Filesystem::Bind.new` raises `Errno::EMFILE` or `Errno::ENFILE` when the host is out of descriptors, where it raised `ArgumentError`; rescue `SystemCallError` for that case. A path that cannot be opened for any other reason still raises `ArgumentError`.
24
+ * **spec:** An Overlay directory over N Bind Layers now takes N of `open_file_limit`, so a script holding such directories open meets the cap sooner; raise `open_file_limit` by the Layers each held directory spans. `Dir.glob` through a directory past the cap raises
25
+ * **gvl:** gvl: :hold no longer serializes guests across Threads. A guest that outlasts one quantum may overlap another Thread's run and use more than one core. A Host App that relied on :hold to run guests one at a time, such as two guests reading and writing one Tmpfs, serializes those calls itself, for example with a Mutex around Sandbox#eval. RUBY_THREAD_TIMESLICE, set before Ruby starts, lengthens the quantum on Ruby 3.4 and later.
26
+ * **spec:** gvl: :hold no longer serializes guests across Threads. A guest that outlasts one quantum may overlap another Thread's run and use more than one core. A Host App that relied on :hold to run guests one at a time, such as two guests reading and writing one Tmpfs, serializes those calls itself, for example with a Mutex around Sandbox#eval. RUBY_THREAD_TIMESLICE, set before Ruby starts, lengthens the quantum on Ruby 3.4 and later.
27
+ * **spec:** Usage#memory_peak can pass memory_limit by a write's permitted room as well as a network read, at most 68 KiB more per open connection. A Host App that allows memory_peak one read past memory_limit allows that margin too.
28
+ * **spec:** a guest's TRACE no longer carries a bound credential's value, where it was swapped in over HTTPS, and its source is not asked. A TRACE with a body raises Errno::EACCES where it was sent; send the body with another method.
29
+ * **spec:** a guest's HTTP request whose method is CONNECT now raises Errno::EACCES where it was sent. A script that needs a tunnel or raw bytes opens a TCPSocket to an endpoint declared with protocol: :tcp.
30
+ * **spec:** Usage#memory_peak can pass memory_limit by at most one network read per open connection, where it never did before. A Host App that checks memory_peak <= memory_limit allows that margin. Making a socket no longer answers ENOMEM for want of room for its buffers.
31
+ * **gvl:** a Service of a Sandbox releasing the GVL no longer takes interrupts the Host App's own Thread.handle_interrupt mask defers; it takes them as that mask allows, as under gvl: :hold. The warning a run releasing the GVL gave on the main Thread is gone.
32
+ * **sandbox:** `Kobako::Pool` and `Kobako::PoolTimeoutError` are removed. Share one `Kobako::Sandbox` across Threads instead; a Host App that needs a bound on concurrent runs or a checkout timeout keeps one of its own, such as a `Thread::SizedQueue` or the `connection_pool` gem.
33
+ * **vfs:** a guest now holds one preopen, `/`, at descriptor 3, instead of one per outermost Mount named by its path. A Guest Binary built on wasi-libc is unaffected; one that reads a Mount through descriptor 3 directly walks from `/` now, or the Host App mounts its Filesystem at `/`. `kobako_runtime::mount::outermost_of` is removed; a Wasm Driver opens `Cred::root` instead.
34
+ * **security:** a Sandbox whose nested mount path passes a host link, at its last name or above it, now fails each run with "stands nowhere: ELOOP" instead of standing where the link leads. Mount the directory the link leads to by its own path instead.
35
+
36
+ ### Features
37
+
38
+ * **gvl:** hand a run's wait on its guest to the Fiber scheduler ([cace4d4](https://github.com/elct9620/kobako/commit/cace4d4cfb2fb168b2e69ab26b0374e48975e6c2))
39
+ * **http:** stream a request body as the guest writes it ([ed2b571](https://github.com/elct9620/kobako/commit/ed2b571820d46b1fdfff577b3c8257fd7c63ce71))
40
+ * **sandbox:** count each Sandbox's runs waiting, read through Sandbox#stat ([5cce9fc](https://github.com/elct9620/kobako/commit/5cce9fcdd87907577845b9e5e196ea341858b272))
41
+ * **sandbox:** have a fork wait for the runs in progress, or raise where it cannot ([3c33928](https://github.com/elct9620/kobako/commit/3c3392818a0454cfd72fc720560afc32b0a04aa5))
42
+ * **sandbox:** remove Kobako::Pool, as Threads share one Sandbox ([f06ee29](https://github.com/elct9620/kobako/commit/f06ee2968231d1fb69334e46a878c42f161520ac))
43
+ * **vfs:** preopen the guest's root alone, beneath which every Mount stands ([2a6d18d](https://github.com/elct9620/kobako/commit/2a6d18d78814f0529b15e109bbcd50f8b372e51b))
44
+ * **wasmtime:** let a forked child on macOS run Sandboxes on any Thread ([a78375a](https://github.com/elct9620/kobako/commit/a78375a440614eb14dee722365702bb3bab5a23c))
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * **bench:** let go of the mount suite's Binds before removing their trees ([0bbf4d7](https://github.com/elct9620/kobako/commit/0bbf4d74fd7a95b19d2e2be117663a9302a0e9fc))
50
+ * **ext:** count a run waiting on a fork among a Sandbox's runs waiting ([332665a](https://github.com/elct9620/kobako/commit/332665a276014116232e668d5226706199dcf4e8))
51
+ * **ext:** let Ruby count the native memory its objects own ([f9099a8](https://github.com/elct9620/kobako/commit/f9099a89838179471f0e353eed03274575dc7495))
52
+ * **ext:** list a guest's thread idle before its caller hears the run ended ([d93f309](https://github.com/elct9620/kobako/commit/d93f309b4a5c60ffb1bb9b169ee91ca531441a05))
53
+ * **ext:** raise TrapError for a run the host has no thread for ([034e7ec](https://github.com/elct9620/kobako/commit/034e7ecd12e0aad46a2609f19702100b34c452ca))
54
+ * **filesystem:** collect garbage once before Bind.new gives up on descriptors ([effb018](https://github.com/elct9620/kobako/commit/effb018ca5205937d5f720ffb0abfb4a62afcbaa))
55
+ * **filesystem:** keep a Ruby Filesystem's directory listing as the VFS asks first ([5118802](https://github.com/elct9620/kobako/commit/5118802b71bbbe04f68d6f21dde91af13e877d0b))
56
+ * **fork:** drop the Binds' kept directories before a fork goes on ([c13dde5](https://github.com/elct9620/kobako/commit/c13dde5d3a38f85de8b0ad19b93c74012a884682))
57
+ * **fork:** raise for a fork while any run is in progress ([5dc6ee6](https://github.com/elct9620/kobako/commit/5dc6ee61837207681b0612ba9f63bd6cec1ae5cc))
58
+ * **guest:** free the lists the host hands the guest once they are read ([5830b96](https://github.com/elct9620/kobako/commit/5830b96ddd1c4cb31a73b6ba770f42eeabf4d09e))
59
+ * **gvl:** end a guest's thread left idle for ten seconds ([be70303](https://github.com/elct9620/kobako/commit/be70303952e19e994e00e9ab92c66e4a6b524a57))
60
+ * **gvl:** hand the GVL over each quantum while a run keeps it ([1e0d828](https://github.com/elct9620/kobako/commit/1e0d82802dbf1794744c2c724e013428bf4ca012))
61
+ * **gvl:** have a run on a Fiber a callback starts hold locks as that run ([723db42](https://github.com/elct9620/kobako/commit/723db4236131c95f140bef07e583e014e2ac8168))
62
+ * **gvl:** have the run's caller mark what the run pinned, rather than root it ([001c09f](https://github.com/elct9620/kobako/commit/001c09fc6c4272b92b843d138e4c39c9250fc614))
63
+ * **gvl:** hold what Ruby delivers while the guest runs, in either mode ([12b3067](https://github.com/elct9620/kobako/commit/12b306780be7bcbcce013d05d635c10b5cd47888))
64
+ * **gvl:** judge a run on another Fiber of the Thread as CRuby's Mutex does ([e63a23f](https://github.com/elct9620/kobako/commit/e63a23fcb5fbc2b6c28072c9e8122497f924eb06))
65
+ * **gvl:** keep a Service's throw on its target past Ruby the run calls ([a4cffb7](https://github.com/elct9620/kobako/commit/a4cffb72a1b118a69abf461946d0675864961300))
66
+ * **gvl:** run each guest on a thread of its own, served by its caller ([7710c21](https://github.com/elct9620/kobako/commit/7710c212552415eaa4dd683d54e20d5aad89de26))
67
+ * hold every guest payload to the Codec's own 262144 values ([f5ba51d](https://github.com/elct9620/kobako/commit/f5ba51dc682e4afefdee9023186ce85367c6c293))
68
+ * hold one invocation's Handle table to 1,000,000 entries ([7f37f5b](https://github.com/elct9620/kobako/commit/7f37f5b70b1c9befd45ea5913eac2efb8f290e09))
69
+ * **memcg:** charge every growth from the run's Store past what the binary declares ([44c7a8b](https://github.com/elct9620/kobako/commit/44c7a8bdc444b96a5d34a137a72b4e2f3c292d80))
70
+ * **net:** declare close on every request the proxy sends ([0ef6aa1](https://github.com/elct9620/kobako/commit/0ef6aa12eb1c5497e098570cdaf51c6b7cf7495e))
71
+ * **net:** move each request on the thread that waits for it ([425f82a](https://github.com/elct9620/kobako/commit/425f82abc5fc0b78774d0ae4e448a13a547bac29))
72
+ * **net:** shut a connection down as its exchange lets it go ([054e70a](https://github.com/elct9620/kobako/commit/054e70a2f467688297a9c640efb55cbd27e0553b))
73
+ * **runtime:** answer a name no DNS query carries before the lookup holds it ([6b50f3a](https://github.com/elct9620/kobako/commit/6b50f3ad92fc0557f9485cc517b4931e2ea0a11a))
74
+ * **runtime:** append through a Windows Bind in one step ([bcc692b](https://github.com/elct9620/kobako/commit/bcc692b788ea86e79af5416344c991c1ccc992f9))
75
+ * **runtime:** count only the guest's descriptors against the open-file cap ([b0deca2](https://github.com/elct9620/kobako/commit/b0deca26519684729f37bf288a6a40f28968f9d0))
76
+ * **runtime:** let a TCP socket hear a reset that follows its peer's FIN ([dac6ecb](https://github.com/elct9620/kobako/commit/dac6ecba588867e734e7797f4153e54a659edbe2))
77
+ * **runtime:** let the process's open connections start unbounded ([55c03c5](https://github.com/elct9620/kobako/commit/55c03c51e10ebab0415ace38640c8595f86a321f))
78
+ * **runtime:** promise a reset past the peer's FIN no sooner than a write ([5de137c](https://github.com/elct9620/kobako/commit/5de137c94efad7aa69f5486af099d2da5f72f699))
79
+ * **runtime:** reach a Windows Bind entry by any spelling its host folds ([0a38543](https://github.com/elct9620/kobako/commit/0a38543c42c73a8b0e9557f205ef663f925bf670))
80
+ * **runtime:** read a Windows Bind's link as a guest path ([f1f04f6](https://github.com/elct9620/kobako/commit/f1f04f689d2da83f148b741a2a4abdf232d161f1))
81
+ * **runtime:** remove a Windows Bind's link to a directory as itself ([f200e1e](https://github.com/elct9620/kobako/commit/f200e1ef157d1b12cc71c0f5efba42745a8e0738))
82
+ * **runtime:** serve a directory lock's waiters in turn, as Linux's rwsem ([4ab9bd0](https://github.com/elct9620/kobako/commit/4ab9bd0e2e134ce10a1bd87f3d4924e2acc4c8e5))
83
+ * **runtime:** spend connection_limit before each lookup and dial leaves the host ([f958a44](https://github.com/elct9620/kobako/commit/f958a44ad39b9b3870685fbe23d911f4c4c3fe33))
84
+ * **runtime:** stop a listing and a copy up between steps once the run is to stop ([b2aebca](https://github.com/elct9620/kobako/commit/b2aebca6a83499b4659c95be17a2f68202932d74))
85
+ * **runtime:** watch a socket for room only while a writer found none ([b7e1c4d](https://github.com/elct9620/kobako/commit/b7e1c4d9bcf53e8050dee44d7e68f726055a56ed))
86
+ * **sandbox:** refuse a run another Fiber starts while one on its Thread waits ([582795b](https://github.com/elct9620/kobako/commit/582795b80995fe94839e23462a5806ba6fd4f1f9))
87
+ * **sched:** let a wait go on through a wakeup that raises nothing ([cf7f484](https://github.com/elct9620/kobako/commit/cf7f484ca645be1a0c64b0f9530b6e39034d3db3))
88
+ * **sdk:** compile a Sandbox's snippets outside its registry lock ([023f647](https://github.com/elct9620/kobako/commit/023f6470b8036f89b444e461128d6dfc84b0e9f1))
89
+ * **security:** refuse a nested mount whose path passes a link ([71abead](https://github.com/elct9620/kobako/commit/71abead05818696ef9a2e2b9082bb871087cfa34))
90
+ * **test:** build the Rust oracles once before parallel_tests starts its processes ([5fe2bab](https://github.com/elct9620/kobako/commit/5fe2babf0586207e3dfbc20f52d1fc98b460d6bb))
91
+ * **test:** fail the Ruby suite when parallel_test selects no file ([11120e1](https://github.com/elct9620/kobako/commit/11120e16a42af051118c61edfee181ae5febcac3))
92
+ * **test:** let parallel_tests find the suite's files on Windows' command line ([12063ec](https://github.com/elct9620/kobako/commit/12063ec145342d1b0625c1d033c377e26d85937f))
93
+ * **test:** let Windows find the Ruby suite's files again ([0066ac9](https://github.com/elct9620/kobako/commit/0066ac91274aac6b3677ff98f2359576bf9504af))
94
+ * **test:** measure the GVL quantum once the guest's write returned ([98c3f3c](https://github.com/elct9620/kobako/commit/98c3f3cde94c89c6d85f5745ca01ba9d65a930cf))
95
+ * **vfs:** climb out of the walk's own Filesystem mounted again ([1cf46c2](https://github.com/elct9620/kobako/commit/1cf46c2ba61af87631208ae2aed0471b419bb531))
96
+ * **vfs:** keep each Filesystem's moves to the walks on it ([42062b9](https://github.com/elct9620/kobako/commit/42062b9c2f22e00f6317fa92ebd6abe2b3fd76b0))
97
+ * **vfs:** wake a name's waiters and a move's readers when a panic unwinds ([515343c](https://github.com/elct9620/kobako/commit/515343c71075517c7c4b9a05624df2ef733b62bc))
98
+ * **wasmtime:** answer random_get a page at a time into the guest's buffer ([d55aa1d](https://github.com/elct9620/kobako/commit/d55aa1da4082902e3b3f6b664b64ac50ee25d9b0))
99
+ * **wasmtime:** ask the OS for a permissive guest's entropy on each draw ([fcfaca4](https://github.com/elct9620/kobako/commit/fcfaca49d0067d1d372e24e680004d04cd0f41ee))
100
+ * **wasmtime:** end a run as a host call returns once the run is to stop ([f5840c6](https://github.com/elct9620/kobako/commit/f5840c687f91d18fb01bb426d577f9c4e208b277))
101
+ * **wasmtime:** fail a refused growth as memory.grow does, not by ending the run ([8cd50be](https://github.com/elct9620/kobako/commit/8cd50bed12c18ea0b906b3e2fe1d6310194e34f2))
102
+ * **wasmtime:** stop a guest that only computes once its run takes a fatal signal ([32990b6](https://github.com/elct9620/kobako/commit/32990b63cd6ae16c5d8a0e473a218d46d29c8919))
103
+
104
+
105
+ ### Performance Improvements
106
+
107
+ * **gvl:** spin before a guest's thread sleeps waiting for the next run ([5719de5](https://github.com/elct9620/kobako/commit/5719de5110e03563dbca6df4e7bf487b58de8c20))
108
+ * **test:** build the Rust oracles into the ext's target directory ([002e594](https://github.com/elct9620/kobako/commit/002e594eb5deea86fa5380e21a1c9433cb98a291))
109
+ * **wasmtime:** cache compiled Guest Binaries on disk on Windows too ([76ca86e](https://github.com/elct9620/kobako/commit/76ca86e3aab83d239e1d0b4ebbcd21e2aec14bf3))
110
+
111
+
112
+ ### Documentation
113
+
114
+ * **spec:** bound what the host holds for a run by counts, not its memory ([7d13f7e](https://github.com/elct9620/kobako/commit/7d13f7e710468ee2c41f8f2d9a34995088584c14))
115
+ * **spec:** charge a socket's buffers as they fill, past the limit by one read ([066bbb7](https://github.com/elct9620/kobako/commit/066bbb73073da88e557f73067c1e1629fdee92b6))
116
+ * **spec:** count a connection still closing as an open file of its invocation ([6c0a1c2](https://github.com/elct9620/kobako/commit/6c0a1c2bd261e79a7681b8f603d27b4240490f05))
117
+ * **spec:** count a run's memory from its Store, past what the binary declares ([c85722d](https://github.com/elct9620/kobako/commit/c85722d6c630d5bf5dce0a3702f575e5016c6667))
118
+ * **spec:** count each host directory an Overlay holds against the cap ([c38a813](https://github.com/elct9620/kobako/commit/c38a8131fae81c643d69ab04d84d9ed36520e198))
119
+ * **spec:** default the open-file cap to what leaves the Host App room ([82561d8](https://github.com/elct9620/kobako/commit/82561d8336a0b4d02ad488430a49a73f2517694b))
120
+ * **spec:** hand the GVL over each quantum while a run keeps it ([412cec6](https://github.com/elct9620/kobako/commit/412cec6e0f5502acb19a8c9b1f8fb858667caf19))
121
+ * **spec:** hold 4 MiB in a Tmpfs given no size of its own ([3d94256](https://github.com/elct9620/kobako/commit/3d94256ecedee7de6592ba6d1a47fea9cc8b2e6c))
122
+ * **spec:** hold a cancelled lookup's place until the host's query ends ([3c21b80](https://github.com/elct9620/kobako/commit/3c21b80790663bb6bdd430a62c38fd9f00cb4404))
123
+ * **spec:** keep a credential and content out of a TRACE ([6a3ea2b](https://github.com/elct9620/kobako/commit/6a3ea2b0a70ecfc7b4a292c77d0fe847932826b6))
124
+ * **spec:** keep the room an output stream permits, its memory counted ([d2c2254](https://github.com/elct9620/kobako/commit/d2c2254fa4905685ae35063cc47e0caaa2c51e70))
125
+ * **spec:** make a Bind while the host is out of descriptors as Dir.new does ([4d2d11b](https://github.com/elct9620/kobako/commit/4d2d11bcd5e365085ce9b551025f7b0d7d998b03))
126
+ * **spec:** refuse a CONNECT request unsent ([7852298](https://github.com/elct9620/kobako/commit/785229802adf81a7c3264b79e9eee88a5bdcb02d))
127
+
3
128
  ## [0.31.0](https://github.com/elct9620/kobako/compare/v0.30.0...v0.31.0) (2026-11-18)
4
129
 
5
130
 
data/README.md CHANGED
@@ -164,15 +164,14 @@ Kobako::Sandbox.new(timeout: 5.0, memory_limit: 10 * 1024 * 1024)
164
164
  | `timeout` | 60 s |
165
165
  | `memory_limit` | 4 MiB |
166
166
  | `stdout_limit`, `stderr_limit` | 1 MiB |
167
- | `open_file_limit` | 1024 |
167
+ | `open_file_limit` | 16 |
168
168
  | `open_connection_limit` | 6 |
169
169
  | `connection_limit` | 50 |
170
170
 
171
171
  ### Concurrency
172
172
 
173
173
  A Sandbox keeps nothing between runs, so Threads may share one. `gvl:
174
- :release` runs guest code in parallel. `Kobako::Pool` is deprecated, and the
175
- next release removes it.
174
+ :release` runs guest code in parallel.
176
175
 
177
176
  ```ruby
178
177
  sandbox = Kobako::Sandbox.new(gvl: :release).bind("KV::Lookup", lookup)
data/ROADMAP.md CHANGED
@@ -9,7 +9,6 @@ row below links a feature to its scenarios and to where its code starts.
9
9
  | ✅ [Sandbox](docs/spec/behavior/sandbox.md) | [lib/kobako/sandbox.rb](lib/kobako/sandbox.rb) |
10
10
  | ✅ [Service registration](docs/spec/behavior/services.md) | [lib/kobako/catalog/services.rb](lib/kobako/catalog/services.rb) |
11
11
  | ✅ [Runtime](docs/spec/behavior/runtime.md) | [lib/kobako/runtime.rb](lib/kobako/runtime.rb) |
12
- | ✅ [Pool](docs/spec/behavior/pool.md) | [lib/kobako/pool.rb](lib/kobako/pool.rb) |
13
12
  | ✅ [Extension](docs/spec/behavior/extension.md) | [lib/kobako/extension.rb](lib/kobako/extension.rb) |
14
13
  | ✅ [Outcome attribution](docs/spec/behavior/outcome.md) | [lib/kobako/outcome.rb](lib/kobako/outcome.rb) |
15
14
  | ✅ [Transport dispatch](docs/spec/behavior/transport-dispatch.md) | [lib/kobako/transport/dispatcher.rb](lib/kobako/transport/dispatcher.rb) |
@@ -1,5 +1,95 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.22.0](https://github.com/elct9620/kobako/compare/kobako-runtime-v0.21.0...kobako-runtime-v0.22.0) (2026-11-27)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **runtime:** vfs::cp_new_stat returns Result<Kstat, Errno> and vfs::ino_of returns Result<u64, Errno> in place of Kstat and u64; a Wasm Driver passes their EOVERFLOW to the guest.
9
+ * **runtime:** Tmpfs::new() and Tmpfs::DEFAULT_SIZE hold 4 MiB and 1025 entries instead of 64 MiB and 16385. Call
10
+ * **runtime:** a listing, a walk, or a copy up in a run past its deadline or interrupted now answers EINTR mid-way instead of finishing.
11
+ * **runtime:** a reader may now take a free directory ahead of a writer already waiting for it, and a trylock fails while any thread waits, so calls on a contended directory land in another order.
12
+ * **runtime:** connection_limit now also counts name lookups, failed dials, and each further address an HTTP request dials, so a run reaches the default 50 sooner; a socket to a new name spends two. Raise connection_limit for a script that needs more.
13
+ * **codec:** kobako-runtime drops Limits::value_budget; read kobako_codec::msgpack::codec::MAX_PAYLOAD_VALUES instead. A Sandbox whose memory_limit is above 4 MiB or None, or one built with_runtime, no longer accepts a guest payload of more than 262144 values.
14
+ * **runtime:** memory_limit measures the guest's own memory only; host buffers no longer answer ENOMEM or fail a request as internal.
15
+ * **memcg:** a run whose start function, global initializers, table growth, or request grow past memory_limit now raises Kobako::MemoryLimitError, growth of several memories and the GC heap adds up, and Usage#memory_peak includes them. Raise memory_limit by that growth to keep the earlier headroom.
16
+ * **net:** on Windows, a dropped lookup keeps its place against `open_connection_limit` until the host's query finishes.
17
+ * **runtime:** `Limits::default().open_file_limit` is `Some(16)` instead of `Some(1024)`; set `open_file_limit` for an invocation that holds more at once.
18
+ * **net:** a connection the guest closes with bytes the peer has not taken counts against `open_file_limit` until it closes, and resets when no open file is left for it.
19
+ * **filesystem:** an Overlay directory over N Bind Layers takes N of an invocation's `open_file_limit`; raise the limit by the Layers each held directory spans.
20
+ * **net:** TcpSock::send_room counts the Invocation's memory, and MemoryBudget::peak, and so Usage::memory_peak, can pass the limit by a permitted write as well as a forced read, at most 68 KiB more per open connection.
21
+ * **net:** net::send asks no CredentialSource for a TRACE and answers HttpError::Denied for one whose OutgoingRequest::body is not empty, where it swapped the value and sent the body.
22
+ * **net:** net::send answers HttpError::Denied for an OutgoingRequest whose method is CONNECT, where it sent one. A caller that needs a tunnel dials a TcpSock through an endpoint of Protocol::Tcp.
23
+ * **net:** MemoryBudget::peak, and so Usage::memory_peak, can pass the limit by one forced network read per open connection.
24
+ * **gvl:** a Service of a Sandbox releasing the GVL no longer takes interrupts the Host App's own Thread.handle_interrupt mask defers; it takes them as that mask allows, as under gvl: :hold. The warning a run releasing the GVL gave on the main Thread is gone.
25
+ * **vfs:** a FileOperations implementing iterate_shared must also return true from has_iterate_shared, or its listings answer NotADirectory.
26
+ * **vfs:** a guest now holds one preopen, `/`, at descriptor 3, instead of one per outermost Mount named by its path. A Guest Binary built on wasi-libc is unaffected; one that reads a Mount through descriptor 3 directly walks from `/` now, or the Host App mounts its Filesystem at `/`. `kobako_runtime::mount::outermost_of` is removed; a Wasm Driver opens `Cred::root` instead.
27
+ * **security:** a Sandbox whose nested mount path passes a host link, at its last name or above it, now fails each run with "stands nowhere: ELOOP" instead of standing where the link leads. Mount the directory the link leads to by its own path instead.
28
+
29
+ ### Features
30
+
31
+ * **http:** stream a request body as the guest writes it ([ed2b571](https://github.com/elct9620/kobako/commit/ed2b571820d46b1fdfff577b3c8257fd7c63ce71))
32
+ * **runtime:** tell how many datagrams a UDP socket holds unread ([48df527](https://github.com/elct9620/kobako/commit/48df52794238e2c13e27cc45f78e31e24101d82e))
33
+ * **sandbox:** have a fork wait for the runs in progress, or raise where it cannot ([3c33928](https://github.com/elct9620/kobako/commit/3c3392818a0454cfd72fc720560afc32b0a04aa5))
34
+ * **vfs:** preopen the guest's root alone, beneath which every Mount stands ([2a6d18d](https://github.com/elct9620/kobako/commit/2a6d18d78814f0529b15e109bbcd50f8b372e51b))
35
+ * **wasmtime:** bound what one host call copies out of the guest by memory_limit ([044090e](https://github.com/elct9620/kobako/commit/044090eef9430584d970b0bd0a773fd37ce61ffc))
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * **codec:** hold every guest payload to the Codec's own 262144 values ([1eee6ec](https://github.com/elct9620/kobako/commit/1eee6ecaf578687e9785753afa475d269d3fa750))
41
+ * **filesystem:** charge each host directory an Overlay holds to the caller ([437ada0](https://github.com/elct9620/kobako/commit/437ada00b268cf793cee8e7fadee1067dd0a4bf7))
42
+ * **filesystem:** let a process drop every directory its Binds keep ([ecd9756](https://github.com/elct9620/kobako/commit/ecd9756bbfb828930864c658a969f80fc9bbbe3f))
43
+ * **filesystem:** make way for a Bind's root when the host is out of descriptors ([ed7edd4](https://github.com/elct9620/kobako/commit/ed7edd40ea87e7ada687732eb28e6631e28b19a7))
44
+ * **filesystem:** share one bound on the directories Binds keep ([e7f2ff2](https://github.com/elct9620/kobako/commit/e7f2ff26fc50ee36ef31ac025363986f2a7ee99b))
45
+ * **fork:** tell a descendant apart from the ancestor whose pid it reuses ([15f6540](https://github.com/elct9620/kobako/commit/15f6540488a1a44a817a7f0349ca767a01fd0829))
46
+ * **gvl:** have a run on a Fiber a callback starts hold locks as that run ([723db42](https://github.com/elct9620/kobako/commit/723db4236131c95f140bef07e583e014e2ac8168))
47
+ * **gvl:** run each guest on a thread of its own, served by its caller ([7710c21](https://github.com/elct9620/kobako/commit/7710c212552415eaa4dd683d54e20d5aad89de26))
48
+ * **memcg:** charge every growth from the run's Store past what the binary declares ([44c7a8b](https://github.com/elct9620/kobako/commit/44c7a8bdc444b96a5d34a137a72b4e2f3c292d80))
49
+ * **net:** charge what a socket and an exchange hold as it arrives ([8c44cb4](https://github.com/elct9620/kobako/commit/8c44cb42b0bb996294715bd8eebe204707ea4c87))
50
+ * **net:** declare close on every request the proxy sends ([0ef6aa1](https://github.com/elct9620/kobako/commit/0ef6aa12eb1c5497e098570cdaf51c6b7cf7495e))
51
+ * **net:** draw each DNS query ID from the kernel ([99548ed](https://github.com/elct9620/kobako/commit/99548ed51cb73123a529072f49926b887a6a30e4))
52
+ * **net:** give a dropped lookup's place back at once on every host ([a8f8c4a](https://github.com/elct9620/kobako/commit/a8f8c4a9d9188fa9132571a5b279bca0e4130c3b))
53
+ * **net:** hold an open file for a socket still sending after its release ([d309bff](https://github.com/elct9620/kobako/commit/d309bff11cd22a323eef0695c19ef6db96532d2e))
54
+ * **net:** keep a lookup's place in a Windows query until its routine runs ([537b7f5](https://github.com/elct9620/kobako/commit/537b7f566abb75b46b18ee958141bdd2e717262b))
55
+ * **net:** keep an output stream's permit whole once its memory fills ([2b641cc](https://github.com/elct9620/kobako/commit/2b641ccee300a160d39c5edf691487d05ac4e365))
56
+ * **net:** move each request on the thread that waits for it ([425f82a](https://github.com/elct9620/kobako/commit/425f82abc5fc0b78774d0ae4e448a13a547bac29))
57
+ * **net:** never let a Windows lookup's completion wait on its cancel ([020673b](https://github.com/elct9620/kobako/commit/020673baaaf438e3bf62655101d43a87c0ee4760))
58
+ * **net:** refuse CONNECT at the L7 proxy ([8c69128](https://github.com/elct9620/kobako/commit/8c69128e6548037c8c66f7cb444db85585a43a70))
59
+ * **net:** shut a connection down as its exchange lets it go ([054e70a](https://github.com/elct9620/kobako/commit/054e70a2f467688297a9c640efb55cbd27e0553b))
60
+ * **net:** swap nothing into a TRACE and refuse one with content ([2135449](https://github.com/elct9620/kobako/commit/21354496a920c073bdafdb738538e273bf60a49a))
61
+ * **runtime:** answer a name no DNS query carries before the lookup holds it ([6b50f3a](https://github.com/elct9620/kobako/commit/6b50f3ad92fc0557f9485cc517b4931e2ea0a11a))
62
+ * **runtime:** append through a Windows Bind in one step ([bcc692b](https://github.com/elct9620/kobako/commit/bcc692b788ea86e79af5416344c991c1ccc992f9))
63
+ * **runtime:** count only the guest's descriptors against the open-file cap ([b0deca2](https://github.com/elct9620/kobako/commit/b0deca26519684729f37bf288a6a40f28968f9d0))
64
+ * **runtime:** default an invocation's open files to 16 ([c091b90](https://github.com/elct9620/kobako/commit/c091b90f2590e4a4746e482cd6d8e8c45e58bc5d))
65
+ * **runtime:** hand a socket what its event reported, so Windows hears a reset ([67874f7](https://github.com/elct9620/kobako/commit/67874f7e7a67604ab35c1fe8c123e17ab4f6092e))
66
+ * **runtime:** hold 4 MiB in a Tmpfs given no size of its own ([23ad4fe](https://github.com/elct9620/kobako/commit/23ad4feaca61f0c320fffe6f29021ced42b5601e))
67
+ * **runtime:** hold what the host keeps for a run by counts, not memory ([5428293](https://github.com/elct9620/kobako/commit/54282932e5f8a523d3d9e79275b846265102a22f))
68
+ * **runtime:** keep the reactor's repolls through an interrupted wait ([5275c77](https://github.com/elct9620/kobako/commit/5275c777e56241597ca8a6d469b1fdfe69be2258))
69
+ * **runtime:** let a TCP socket hear a reset that follows its peer's FIN ([dac6ecb](https://github.com/elct9620/kobako/commit/dac6ecba588867e734e7797f4153e54a659edbe2))
70
+ * **runtime:** let a write trylock pass a line nobody was handed, as mutex_trylock ([de510f5](https://github.com/elct9620/kobako/commit/de510f53e3bb451c7f840aa6373ccf88dc7fcb4d))
71
+ * **runtime:** let the process's open connections start unbounded ([55c03c5](https://github.com/elct9620/kobako/commit/55c03c51e10ebab0415ace38640c8595f86a321f))
72
+ * **runtime:** number a hermetic invocation's entries in the order it meets them ([4e23399](https://github.com/elct9620/kobako/commit/4e23399eca979ae4526735c72e34133907dceeb3))
73
+ * **runtime:** promise a reset past the peer's FIN no sooner than a write ([5de137c](https://github.com/elct9620/kobako/commit/5de137c94efad7aa69f5486af099d2da5f72f699))
74
+ * **runtime:** reach a Windows Bind entry by any spelling its host folds ([0a38543](https://github.com/elct9620/kobako/commit/0a38543c42c73a8b0e9557f205ef663f925bf670))
75
+ * **runtime:** read a Windows Bind's link as a guest path ([f1f04f6](https://github.com/elct9620/kobako/commit/f1f04f689d2da83f148b741a2a4abdf232d161f1))
76
+ * **runtime:** remove a Windows Bind's link to a directory as itself ([f200e1e](https://github.com/elct9620/kobako/commit/f200e1ef157d1b12cc71c0f5efba42745a8e0738))
77
+ * **runtime:** report a Windows Bind entry's times ([8584c90](https://github.com/elct9620/kobako/commit/8584c90e2f406edfeeb54477a330fd2f9937b602))
78
+ * **runtime:** serve a directory lock's waiters in turn, as Linux's rwsem ([4ab9bd0](https://github.com/elct9620/kobako/commit/4ab9bd0e2e134ce10a1bd87f3d4924e2acc4c8e5))
79
+ * **runtime:** set a time through a Windows Bind's descriptor opened to read ([397e0b5](https://github.com/elct9620/kobako/commit/397e0b52feec1d29a41212dfeb4227a4be4d8352))
80
+ * **runtime:** spend a poll budget on each step an HTTP connection takes ([efea22b](https://github.com/elct9620/kobako/commit/efea22b06ede0b27e98a03d174cfc7b4b23ae5f4))
81
+ * **runtime:** spend connection_limit before each lookup and dial leaves the host ([f958a44](https://github.com/elct9620/kobako/commit/f958a44ad39b9b3870685fbe23d911f4c4c3fe33))
82
+ * **runtime:** stand a poll on each wait queue once ([ad9c2b5](https://github.com/elct9620/kobako/commit/ad9c2b503c56b604d2ea6ee16d5676f3d9bce312))
83
+ * **runtime:** stop a listing and a copy up between steps once the run is to stop ([b2aebca](https://github.com/elct9620/kobako/commit/b2aebca6a83499b4659c95be17a2f68202932d74))
84
+ * **runtime:** watch a socket for room only while a writer found none ([b7e1c4d](https://github.com/elct9620/kobako/commit/b7e1c4d9bcf53e8050dee44d7e68f726055a56ed))
85
+ * **sched:** let a wait go on through a wakeup that raises nothing ([cf7f484](https://github.com/elct9620/kobako/commit/cf7f484ca645be1a0c64b0f9530b6e39034d3db3))
86
+ * **security:** refuse a nested mount whose path passes a link ([71abead](https://github.com/elct9620/kobako/commit/71abead05818696ef9a2e2b9082bb871087cfa34))
87
+ * **vfs:** climb out of the walk's own Filesystem mounted again ([1cf46c2](https://github.com/elct9620/kobako/commit/1cf46c2ba61af87631208ae2aed0471b419bb531))
88
+ * **vfs:** keep each Filesystem's moves to the walks on it ([42062b9](https://github.com/elct9620/kobako/commit/42062b9c2f22e00f6317fa92ebd6abe2b3fd76b0))
89
+ * **vfs:** refuse a listing of a file without iterate_shared before locking it ([34eb327](https://github.com/elct9620/kobako/commit/34eb3273cd537ccbd2b7a3592ece38da79d60d2f))
90
+ * **vfs:** wake a name's waiters and a move's readers when a panic unwinds ([515343c](https://github.com/elct9620/kobako/commit/515343c71075517c7c4b9a05624df2ef733b62bc))
91
+ * **wasmtime:** stop a guest that only computes once its run takes a fatal signal ([32990b6](https://github.com/elct9620/kobako/commit/32990b63cd6ae16c5d8a0e473a218d46d29c8919))
92
+
3
93
  ## [0.21.0](https://github.com/elct9620/kobako/compare/kobako-runtime-v0.20.0...kobako-runtime-v0.21.0) (2026-11-18)
4
94
 
5
95
 
@@ -36,7 +36,7 @@ Add the crate to an engine or a frontend that speaks the contract.
36
36
 
37
37
  ```toml
38
38
  [dependencies]
39
- kobako-runtime = "0.21.0" # x-release-please-version
39
+ kobako-runtime = "0.22.0" # x-release-please-version
40
40
  ```
41
41
 
42
42
  ## License
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.22.0](https://github.com/elct9620/kobako/compare/kobako-transport-v0.21.0...kobako-transport-v0.22.0) (2026-11-27)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **kobako-transport:** Synchronize kobako crates versions
9
+
3
10
  ## [0.21.0](https://github.com/elct9620/kobako/compare/kobako-transport-v0.20.0...kobako-transport-v0.21.0) (2026-11-18)
4
11
 
5
12
 
@@ -51,7 +51,7 @@ reaches the same types through `kobako-core`.
51
51
 
52
52
  ```toml
53
53
  [dependencies]
54
- kobako-transport = "0.21.0" # x-release-please-version
54
+ kobako-transport = "0.22.0" # x-release-please-version
55
55
  ```
56
56
 
57
57
  ## License
@@ -1,5 +1,52 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.22.0](https://github.com/elct9620/kobako/compare/kobako-wasmtime-v0.21.0...kobako-wasmtime-v0.22.0) (2026-11-27)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **runtime:** vfs::cp_new_stat returns Result<Kstat, Errno> and vfs::ino_of returns Result<u64, Errno> in place of Kstat and u64; a Wasm Driver passes their EOVERFLOW to the guest.
9
+ * **wasmtime:** a guest no longer reads EINTR from a call its run's deadline or interrupt ended; the run ends there as a timeout or an interrupt.
10
+ * **runtime:** memory_limit measures the guest's own memory only; host buffers no longer answer ENOMEM or fail a request as internal.
11
+ * **memcg:** a run whose start function, global initializers, table growth, or request grow past memory_limit now raises Kobako::MemoryLimitError, growth of several memories and the GC heap adds up, and Usage#memory_peak includes them. Raise memory_limit by that growth to keep the earlier headroom.
12
+ * **filesystem:** an Overlay directory over N Bind Layers takes N of an invocation's `open_file_limit`; raise the limit by the Layers each held directory spans.
13
+ * **net:** TcpSock::send_room counts the Invocation's memory, and MemoryBudget::peak, and so Usage::memory_peak, can pass the limit by a permitted write as well as a forced read, at most 68 KiB more per open connection.
14
+ * **vfs:** a FileOperations implementing iterate_shared must also return true from has_iterate_shared, or its listings answer NotADirectory.
15
+ * **vfs:** a guest now holds one preopen, `/`, at descriptor 3, instead of one per outermost Mount named by its path. A Guest Binary built on wasi-libc is unaffected; one that reads a Mount through descriptor 3 directly walks from `/` now, or the Host App mounts its Filesystem at `/`. `kobako_runtime::mount::outermost_of` is removed; a Wasm Driver opens `Cred::root` instead.
16
+
17
+ ### Features
18
+
19
+ * **http:** stream a request body as the guest writes it ([ed2b571](https://github.com/elct9620/kobako/commit/ed2b571820d46b1fdfff577b3c8257fd7c63ce71))
20
+ * **runtime:** tell how many datagrams a UDP socket holds unread ([48df527](https://github.com/elct9620/kobako/commit/48df52794238e2c13e27cc45f78e31e24101d82e))
21
+ * **vfs:** preopen the guest's root alone, beneath which every Mount stands ([2a6d18d](https://github.com/elct9620/kobako/commit/2a6d18d78814f0529b15e109bbcd50f8b372e51b))
22
+ * **wasmtime:** bound what one host call copies out of the guest by memory_limit ([044090e](https://github.com/elct9620/kobako/commit/044090eef9430584d970b0bd0a773fd37ce61ffc))
23
+ * **wasmtime:** let a forked child on macOS run Sandboxes on any Thread ([a78375a](https://github.com/elct9620/kobako/commit/a78375a440614eb14dee722365702bb3bab5a23c))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **filesystem:** charge each host directory an Overlay holds to the caller ([437ada0](https://github.com/elct9620/kobako/commit/437ada00b268cf793cee8e7fadee1067dd0a4bf7))
29
+ * **memcg:** charge every growth from the run's Store past what the binary declares ([44c7a8b](https://github.com/elct9620/kobako/commit/44c7a8bdc444b96a5d34a137a72b4e2f3c292d80))
30
+ * **net:** keep an output stream's permit whole once its memory fills ([2b641cc](https://github.com/elct9620/kobako/commit/2b641ccee300a160d39c5edf691487d05ac4e365))
31
+ * **net:** move each request on the thread that waits for it ([425f82a](https://github.com/elct9620/kobako/commit/425f82abc5fc0b78774d0ae4e448a13a547bac29))
32
+ * **runtime:** count only the guest's descriptors against the open-file cap ([b0deca2](https://github.com/elct9620/kobako/commit/b0deca26519684729f37bf288a6a40f28968f9d0))
33
+ * **runtime:** hold what the host keeps for a run by counts, not memory ([5428293](https://github.com/elct9620/kobako/commit/54282932e5f8a523d3d9e79275b846265102a22f))
34
+ * **runtime:** number a hermetic invocation's entries in the order it meets them ([4e23399](https://github.com/elct9620/kobako/commit/4e23399eca979ae4526735c72e34133907dceeb3))
35
+ * **vfs:** keep each Filesystem's moves to the walks on it ([42062b9](https://github.com/elct9620/kobako/commit/42062b9c2f22e00f6317fa92ebd6abe2b3fd76b0))
36
+ * **vfs:** refuse a listing of a file without iterate_shared before locking it ([34eb327](https://github.com/elct9620/kobako/commit/34eb3273cd537ccbd2b7a3592ece38da79d60d2f))
37
+ * **wasmtime:** answer random_get a page at a time into the guest's buffer ([d55aa1d](https://github.com/elct9620/kobako/commit/d55aa1da4082902e3b3f6b664b64ac50ee25d9b0))
38
+ * **wasmtime:** ask the OS for a permissive guest's entropy on each draw ([fcfaca4](https://github.com/elct9620/kobako/commit/fcfaca49d0067d1d372e24e680004d04cd0f41ee))
39
+ * **wasmtime:** end a run as a host call returns once the run is to stop ([f5840c6](https://github.com/elct9620/kobako/commit/f5840c687f91d18fb01bb426d577f9c4e208b277))
40
+ * **wasmtime:** fail a refused growth as memory.grow does, not by ending the run ([8cd50be](https://github.com/elct9620/kobako/commit/8cd50bed12c18ea0b906b3e2fe1d6310194e34f2))
41
+ * **wasmtime:** fail the caller when the host has no thread or room ([855734f](https://github.com/elct9620/kobako/commit/855734fcaf97cae11e80a6e9f83492bc2c292a2b))
42
+ * **wasmtime:** open a cached artifact on Windows as wasmtime maps one ([4be7e9b](https://github.com/elct9620/kobako/commit/4be7e9b8b371f3dc95490da024ca72fa1a0c7597))
43
+ * **wasmtime:** stop a guest that only computes once its run takes a fatal signal ([32990b6](https://github.com/elct9620/kobako/commit/32990b63cd6ae16c5d8a0e473a218d46d29c8919))
44
+
45
+
46
+ ### Performance Improvements
47
+
48
+ * **wasmtime:** cache compiled Guest Binaries on disk on Windows too ([76ca86e](https://github.com/elct9620/kobako/commit/76ca86e3aab83d239e1d0b4ebbcd21e2aec14bf3))
49
+
3
50
  ## [0.21.0](https://github.com/elct9620/kobako/compare/kobako-wasmtime-v0.20.0...kobako-wasmtime-v0.21.0) (2026-11-18)
4
51
 
5
52
 
@@ -11,11 +11,11 @@ contract surface.
11
11
  | Mechanic | What the driver holds |
12
12
  |---|---|
13
13
  | Compilation | process-wide Engine and compiled-Module caches |
14
- | Disk cache | AOT `.cwasm` artifacts on Unix, keyed by Guest Binary content and engine |
14
+ | Disk cache | AOT `.cwasm` artifacts in a user-private directory, keyed by content and engine |
15
15
  | Instantiation | a pre-linked `InstancePre` per guest path, a fresh instance per invocation |
16
16
  | Bounds | epoch-based wall-clock deadlines on setup and on each invocation, and the per-invocation linear-memory cap |
17
17
  | Ambient denial | under the default hermetic profile, frozen clocks and a constant RNG |
18
- | Filesystems | a preopen per outermost Mount, and its own capped descriptor table |
18
+ | Filesystems | one preopen, the root every Mount stands beneath, and its own capped descriptor table |
19
19
  | WASI 0.2 imports | the `wasi:sockets`, `wasi:http` client, `wasi:io`, and clock subscriptions a core module links, generated from `wit/` |
20
20
 
21
21
  Each invocation discards its Store once it ends, so nothing one leaves
@@ -29,7 +29,7 @@ Add the crate beside `kobako-runtime` to run a Guest Binary through its
29
29
 
30
30
  ```toml
31
31
  [dependencies]
32
- kobako-wasmtime = "0.21.0" # x-release-please-version
32
+ kobako-wasmtime = "0.22.0" # x-release-please-version
33
33
  ```
34
34
 
35
35
  ## License
@@ -392,6 +392,19 @@
392
392
 
393
393
 
394
394
 
395
+ ;;; Write high-quality random data into a buffer.
396
+ ;;; This function blocks when the implementation is unable to immediately
397
+ ;;; provide sufficient high-quality random data.
398
+ ;;; This function may execute slowly, so when large mounts of random data are
399
+ ;;; required, it's advisable to use this function to seed a pseudo-random
400
+ ;;; number generator, rather than to provide the random data directly.
401
+ (@interface func (export "random_get")
402
+ ;;; The buffer to fill with random data.
403
+ (param $buf (@witx pointer u8))
404
+ (param $buf_len $size)
405
+ (result $error (expected (error $errno)))
406
+ )
407
+
395
408
 
396
409
  ;;; Accept a new incoming connection.
397
410
  ;;; Note: This is similar to `accept` in POSIX.
data/data/kobako.wasm CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -8,8 +8,13 @@ module Kobako
8
8
  # One invocation's Handle table, mapping opaque ids to host objects. Each
9
9
  # invocation mints its own, so a Handle resolves only where it was issued.
10
10
  class Handles # :nodoc:
11
- # +next_id+ lets tests start near +Kobako::Handle::MAX_ID+ to reach
12
- # exhaustion without 2³¹ allocations.
11
+ # The most Handles one invocation issues, as wasmtime's ResourceTable
12
+ # holds at most 1,000,000 of what a host hands its guest: the table is
13
+ # kobako's own, so it stays bounded whatever a Service returns.
14
+ MAX_HANDLES = 1_000_000
15
+
16
+ # +next_id+ lets tests start near MAX_HANDLES to reach exhaustion
17
+ # without a million allocations.
13
18
  def initialize(next_id: 1)
14
19
  @entries = {} # : Hash[Integer, Kobako::Transport::Exposure]
15
20
  surfaces = {} # : Hash[Module, Set[Symbol]]
@@ -50,12 +55,11 @@ module Kobako
50
55
  private
51
56
 
52
57
  def ensure_capacity
53
- cap = Kobako::Handle::MAX_ID
54
- return unless @next_id > cap
58
+ return unless @next_id > MAX_HANDLES
55
59
 
56
60
  raise HandleExhaustedError,
57
61
  "Out of handle allocations: too many host objects were referenced " \
58
- "in a single invocation (limit #{cap})"
62
+ "in a single invocation (limit #{MAX_HANDLES})"
59
63
  end
60
64
 
61
65
  def require_bound(id)
@@ -13,7 +13,7 @@ module Kobako
13
13
  # from the decoded payload reports a broken invariant as
14
14
  # InvalidTypeError without its own Boundary.within.
15
15
  def self.decode(bytes)
16
- ValueBudget.assert_within(bytes, State.current.value_budget)
16
+ ValueBudget.assert_within(bytes, MAX_PAYLOAD_VALUES)
17
17
  value = FACTORY.load(bytes.b)
18
18
  validate_utf8(value)
19
19
  block_given? ? yield(value) : value
@@ -2,9 +2,8 @@
2
2
 
3
3
  module Kobako
4
4
  module Codec
5
- # Whether a Capability Handle crossed the decode in flight, and the
6
- # value budget a decode is held to, kept per thread so plain instance
7
- # variables stay sound.
5
+ # Whether a Capability Handle crossed the decode in flight, kept per
6
+ # thread so plain instance variables stay sound.
8
7
  class State # :nodoc:
9
8
  # Thread-local slot holding the calling thread's State.
10
9
  STATE_KEY = :__kobako_codec_state__
@@ -19,21 +18,6 @@ module Kobako
19
18
 
20
19
  def initialize
21
20
  @carried_handle = false
22
- @value_budget = nil
23
- end
24
-
25
- # The most values a decode on this thread may build, or nil for no
26
- # budget.
27
- attr_reader :value_budget
28
-
29
- # A nested invocation on the same thread restores the outer one's
30
- # budget when it returns.
31
- def within_value_budget(budget)
32
- outer = @value_budget
33
- @value_budget = budget
34
- yield
35
- ensure
36
- @value_budget = outer
37
21
  end
38
22
 
39
23
  # ExtTypes#unpack_handle is the sole chokepoint every Handle passes
@@ -5,9 +5,9 @@ require_relative "error"
5
5
  module Kobako
6
6
  module Codec
7
7
  # Counts the values a payload holds before the decoder builds any, so a
8
- # guest cannot make the host build more objects than it could hold in
9
- # its own memory. Every value takes at least one byte, so a payload no
10
- # longer than the budget, and holding no float, needs no count.
8
+ # short payload cannot make the host build a large value. Every value
9
+ # takes at least one byte, so a payload no longer than the budget, and
10
+ # holding no float, needs no count.
11
11
  #
12
12
  # A map key holding a NaN costs one more value for each such key the
13
13
  # map already holds, as a Ruby Hash compares it with each: every NaN
@@ -45,7 +45,7 @@ module Kobako
45
45
  private_constant :FLOAT_FORMATS, :FLOATS, :NAN_ENTRY
46
46
 
47
47
  def self.assert_within(bytes, budget)
48
- return if budget.nil? || within_by_size?(bytes, budget)
48
+ return if within_by_size?(bytes, budget)
49
49
 
50
50
  Count.new(bytes, budget).run
51
51
  end
data/lib/kobako/codec.rb CHANGED
@@ -19,16 +19,15 @@ module Kobako
19
19
  # packer.
20
20
  MAX_NESTING_DEPTH = 128
21
21
 
22
+ # The most values one guest payload may make the host build, whatever
23
+ # the memory cap, shared with the Rust +kobako_codec+ so both hosts
24
+ # refuse the same payload.
25
+ MAX_PAYLOAD_VALUES = 262_144
26
+
22
27
  # Answers the block's result with whether the decode carried a
23
28
  # Capability Handle, so a caller can skip an all-identity restore walk.
24
29
  def self.track_handles(&block)
25
30
  State.current.track_handles(&block)
26
31
  end
27
-
28
- # Holds every decode the block runs on this thread to +budget+ values,
29
- # or to none when +budget+ is nil.
30
- def self.within_value_budget(budget, &block)
31
- State.current.within_value_budget(budget, &block)
32
- end
33
32
  end
34
33
  end