kobako 0.30.0 → 0.31.0

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 (266) hide show
  1. checksums.yaml +4 -4
  2. data/.release-please-manifest.json +1 -1
  3. data/CHANGELOG.md +335 -0
  4. data/Cargo.lock +469 -11
  5. data/README.md +43 -3
  6. data/ROADMAP.md +1 -1
  7. data/crates/kobako-runtime/CHANGELOG.md +219 -0
  8. data/crates/kobako-runtime/Cargo.toml +51 -3
  9. data/crates/kobako-runtime/README.md +7 -4
  10. data/crates/kobako-runtime/src/cred.rs +124 -0
  11. data/crates/kobako-runtime/src/dispatch.rs +4 -5
  12. data/crates/kobako-runtime/src/endpoint/buffer.rs +153 -44
  13. data/crates/kobako-runtime/src/endpoint/dispatch.rs +80 -41
  14. data/crates/kobako-runtime/src/endpoint/invoke.rs +23 -36
  15. data/crates/kobako-runtime/src/endpoint.rs +137 -36
  16. data/crates/kobako-runtime/src/errno.rs +391 -0
  17. data/crates/kobako-runtime/src/error.rs +31 -10
  18. data/crates/kobako-runtime/src/filesystem/anon_inodes.rs +52 -0
  19. data/crates/kobako-runtime/src/filesystem/bind/lookup.rs +52 -14
  20. data/crates/kobako-runtime/src/filesystem/bind/walk.rs +19 -20
  21. data/crates/kobako-runtime/src/filesystem/bind.rs +437 -245
  22. data/crates/kobako-runtime/src/filesystem/overlay/file.rs +6 -6
  23. data/crates/kobako-runtime/src/filesystem/overlay/path.rs +43 -65
  24. data/crates/kobako-runtime/src/filesystem/overlay/stack/copy_up.rs +9 -16
  25. data/crates/kobako-runtime/src/filesystem/overlay/stack/dir.rs +47 -72
  26. data/crates/kobako-runtime/src/filesystem/overlay/stack/namei.rs +12 -12
  27. data/crates/kobako-runtime/src/filesystem/overlay/stack/readdir.rs +4 -7
  28. data/crates/kobako-runtime/src/filesystem/overlay/stack.rs +121 -37
  29. data/crates/kobako-runtime/src/filesystem/overlay.rs +302 -343
  30. data/crates/kobako-runtime/src/filesystem/pipe.rs +12 -9
  31. data/crates/kobako-runtime/src/filesystem/rdir.rs +15 -32
  32. data/crates/kobako-runtime/src/filesystem/tmpfs/seed.rs +32 -0
  33. data/crates/kobako-runtime/src/filesystem/tmpfs/tmpfile.rs +3 -3
  34. data/crates/kobako-runtime/src/filesystem/tmpfs/whiteout.rs +57 -35
  35. data/crates/kobako-runtime/src/filesystem/tmpfs/xattr.rs +2 -2
  36. data/crates/kobako-runtime/src/filesystem/tmpfs.rs +172 -160
  37. data/crates/kobako-runtime/src/filesystem/wrap.rs +36 -52
  38. data/crates/kobako-runtime/src/filesystem.rs +6 -3
  39. data/crates/kobako-runtime/src/fork.rs +96 -0
  40. data/crates/kobako-runtime/src/grant.rs +3 -0
  41. data/crates/kobako-runtime/src/hashtable.rs +4 -2
  42. data/crates/kobako-runtime/src/lib.rs +18 -7
  43. data/crates/kobako-runtime/src/limits.rs +195 -0
  44. data/crates/kobako-runtime/src/locking.rs +10 -0
  45. data/crates/kobako-runtime/src/memcg.rs +383 -0
  46. data/crates/kobako-runtime/src/mount.rs +67 -9
  47. data/crates/kobako-runtime/src/net/backends.rs +43 -0
  48. data/crates/kobako-runtime/src/net/connections.rs +179 -0
  49. data/crates/kobako-runtime/src/net/credential.rs +125 -0
  50. data/crates/kobako-runtime/src/net/egress.rs +160 -0
  51. data/crates/kobako-runtime/src/net/family.rs +181 -0
  52. data/crates/kobako-runtime/src/net/http.rs +2733 -0
  53. data/crates/kobako-runtime/src/net/lookup.rs +285 -0
  54. data/crates/kobako-runtime/src/net/mock.rs +251 -0
  55. data/crates/kobako-runtime/src/net/namespace.rs +1366 -0
  56. data/crates/kobako-runtime/src/net/reactor.rs +531 -0
  57. data/crates/kobako-runtime/src/net/resolv/darwin.rs +275 -0
  58. data/crates/kobako-runtime/src/net/resolv/stub/tests.rs +469 -0
  59. data/crates/kobako-runtime/src/net/resolv/stub.rs +536 -0
  60. data/crates/kobako-runtime/src/net/resolv/windows.rs +248 -0
  61. data/crates/kobako-runtime/src/net/resolv.rs +227 -0
  62. data/crates/kobako-runtime/src/net/socket.rs +870 -0
  63. data/crates/kobako-runtime/src/net/tcp.rs +1588 -0
  64. data/crates/kobako-runtime/src/net/tls.rs +58 -0
  65. data/crates/kobako-runtime/src/net/transport.rs +279 -0
  66. data/crates/kobako-runtime/src/net/udp.rs +1003 -0
  67. data/crates/kobako-runtime/src/net.rs +42 -0
  68. data/crates/kobako-runtime/src/network/builder.rs +177 -0
  69. data/crates/kobako-runtime/src/network/ruleset.rs +777 -0
  70. data/crates/kobako-runtime/src/network.rs +551 -0
  71. data/crates/kobako-runtime/src/policy.rs +16 -0
  72. data/crates/kobako-runtime/src/profile.rs +29 -144
  73. data/crates/kobako-runtime/src/runtime.rs +3 -5
  74. data/crates/kobako-runtime/src/sched.rs +130 -29
  75. data/crates/kobako-runtime/src/security/entry_policy.rs +22 -0
  76. data/crates/kobako-runtime/src/{vfs/cred.rs → security/hooks.rs} +52 -144
  77. data/crates/kobako-runtime/src/security/mount_policy.rs +158 -0
  78. data/crates/kobako-runtime/src/security.rs +101 -196
  79. data/crates/kobako-runtime/src/snapshot.rs +121 -2
  80. data/crates/kobako-runtime/src/vfs/attr.rs +5 -5
  81. data/crates/kobako-runtime/src/vfs/dentry.rs +143 -89
  82. data/crates/kobako-runtime/src/vfs/file.rs +199 -203
  83. data/crates/kobako-runtime/src/vfs/inode.rs +41 -45
  84. data/crates/kobako-runtime/src/vfs/kern_path.rs +38 -42
  85. data/crates/kobako-runtime/src/vfs/mount.rs +10 -9
  86. data/crates/kobako-runtime/src/vfs/namei.rs +829 -700
  87. data/crates/kobako-runtime/src/vfs/namespace.rs +162 -0
  88. data/crates/kobako-runtime/src/vfs/open_files.rs +69 -0
  89. data/crates/kobako-runtime/src/vfs/openat2.rs +3 -3
  90. data/crates/kobako-runtime/src/vfs/path.rs +6 -6
  91. data/crates/kobako-runtime/src/vfs/readdir.rs +6 -6
  92. data/crates/kobako-runtime/src/vfs/stat.rs +159 -23
  93. data/crates/kobako-runtime/src/vfs/super_block.rs +18 -14
  94. data/crates/kobako-runtime/src/vfs/utimes.rs +37 -27
  95. data/crates/kobako-runtime/src/vfs.rs +9 -6
  96. data/crates/kobako-runtime/src/wait.rs +356 -0
  97. data/crates/kobako-transport/CHANGELOG.md +31 -0
  98. data/crates/kobako-transport/Cargo.toml +1 -1
  99. data/crates/kobako-transport/README.md +3 -4
  100. data/crates/kobako-transport/src/abi.rs +78 -72
  101. data/crates/kobako-transport/src/envelope/bytes.rs +17 -6
  102. data/crates/kobako-transport/src/envelope/call.rs +32 -4
  103. data/crates/kobako-transport/src/envelope/error_record.rs +21 -0
  104. data/crates/kobako-transport/src/envelope/name.rs +99 -0
  105. data/crates/kobako-transport/src/envelope/outcome.rs +9 -9
  106. data/crates/kobako-transport/src/envelope/preamble.rs +24 -21
  107. data/crates/kobako-transport/src/envelope/reply.rs +27 -27
  108. data/crates/kobako-transport/src/envelope/unsupported.rs +10 -10
  109. data/crates/kobako-transport/src/envelope.rs +13 -8
  110. data/crates/kobako-wasmtime/CHANGELOG.md +161 -0
  111. data/crates/kobako-wasmtime/Cargo.toml +26 -7
  112. data/crates/kobako-wasmtime/README.md +3 -2
  113. data/crates/kobako-wasmtime/build/preview2.rs +1339 -0
  114. data/crates/kobako-wasmtime/build.rs +16 -0
  115. data/crates/kobako-wasmtime/src/abi.rs +17 -37
  116. data/crates/kobako-wasmtime/src/ambient.rs +33 -18
  117. data/crates/kobako-wasmtime/src/cache.rs +23 -15
  118. data/crates/kobako-wasmtime/src/config.rs +52 -68
  119. data/crates/kobako-wasmtime/src/driver.rs +48 -63
  120. data/crates/kobako-wasmtime/src/exports.rs +143 -17
  121. data/crates/kobako-wasmtime/src/guest.rs +12 -6
  122. data/crates/kobako-wasmtime/src/guest_binary.rs +14 -0
  123. data/crates/kobako-wasmtime/src/imports.rs +42 -18
  124. data/crates/kobako-wasmtime/src/instance_pre.rs +4 -4
  125. data/crates/kobako-wasmtime/src/invocation.rs +74 -12
  126. data/crates/kobako-wasmtime/src/lib.rs +5 -3
  127. data/crates/kobako-wasmtime/src/limiter.rs +70 -5
  128. data/crates/kobako-wasmtime/src/preview1/descriptors.rs +309 -0
  129. data/crates/kobako-wasmtime/src/preview1/differential/mount.rs +5 -15
  130. data/crates/kobako-wasmtime/src/preview1/differential.rs +27 -31
  131. data/crates/kobako-wasmtime/src/preview1/errno.rs +55 -66
  132. data/crates/kobako-wasmtime/src/preview1/fd.rs +327 -296
  133. data/crates/kobako-wasmtime/src/preview1/memory.rs +21 -12
  134. data/crates/kobako-wasmtime/src/preview1/mount_view/wrap.rs +34 -53
  135. data/crates/kobako-wasmtime/src/preview1/mount_view.rs +231 -217
  136. data/crates/kobako-wasmtime/src/preview1/path.rs +56 -121
  137. data/crates/kobako-wasmtime/src/preview1/poll.rs +244 -120
  138. data/crates/kobako-wasmtime/src/preview1/sock.rs +10 -8
  139. data/crates/kobako-wasmtime/src/preview1/testsuite.rs +5 -15
  140. data/crates/kobako-wasmtime/src/preview1.rs +46 -42
  141. data/crates/kobako-wasmtime/src/preview2/abi.rs +227 -0
  142. data/crates/kobako-wasmtime/src/preview2/error.rs +118 -0
  143. data/crates/kobako-wasmtime/src/preview2/filesystem.rs +122 -0
  144. data/crates/kobako-wasmtime/src/preview2/host.rs +3959 -0
  145. data/crates/kobako-wasmtime/src/preview2/http.rs +1503 -0
  146. data/crates/kobako-wasmtime/src/preview2/io.rs +315 -0
  147. data/crates/kobako-wasmtime/src/preview2/sockets.rs +379 -0
  148. data/crates/kobako-wasmtime/src/preview2/table.rs +305 -0
  149. data/crates/kobako-wasmtime/src/preview2.rs +57 -0
  150. data/crates/kobako-wasmtime/src/trap.rs +24 -9
  151. data/crates/kobako-wasmtime/src/wasi.rs +210 -81
  152. data/crates/kobako-wasmtime/wit/deps/cli.wit +233 -0
  153. data/crates/kobako-wasmtime/wit/deps/clocks.wit +162 -0
  154. data/crates/kobako-wasmtime/wit/deps/filesystem.wit +589 -0
  155. data/crates/kobako-wasmtime/wit/deps/http.wit +733 -0
  156. data/crates/kobako-wasmtime/wit/deps/io.wit +299 -0
  157. data/crates/kobako-wasmtime/wit/deps/random.wit +92 -0
  158. data/crates/kobako-wasmtime/wit/deps/sockets.wit +949 -0
  159. data/data/kobako.wasm +0 -0
  160. data/ext/kobako/Cargo.toml +1 -1
  161. data/ext/kobako/src/{runtime/errors.rs → errors.rs} +34 -26
  162. data/ext/kobako/src/{runtime/escape.rs → escape.rs} +42 -11
  163. data/ext/kobako/src/{runtime/filesystem → filesystem}/grants.rs +30 -26
  164. data/ext/kobako/src/{runtime/filesystem → filesystem}/ruby.rs +149 -168
  165. data/ext/kobako/src/{runtime/filesystem.rs → filesystem.rs} +24 -15
  166. data/ext/kobako/src/gvl.rs +306 -0
  167. data/ext/kobako/src/lib.rs +64 -3
  168. data/ext/kobako/src/network/mock.rs +187 -0
  169. data/ext/kobako/src/network.rs +591 -0
  170. data/ext/kobako/src/runtime/bridge.rs +30 -29
  171. data/ext/kobako/src/runtime/snapshot.rs +4 -4
  172. data/ext/kobako/src/runtime.rs +221 -143
  173. data/ext/kobako/src/wire.rs +42 -0
  174. data/lib/kobako/catalog/extensions.rb +14 -2
  175. data/lib/kobako/catalog/flags.rb +3 -5
  176. data/lib/kobako/catalog/grants.rb +5 -4
  177. data/lib/kobako/catalog/handles.rb +5 -27
  178. data/lib/kobako/catalog/mount.rb +11 -3
  179. data/lib/kobako/catalog/network.rb +35 -0
  180. data/lib/kobako/catalog/replacements.rb +28 -0
  181. data/lib/kobako/catalog/services.rb +5 -19
  182. data/lib/kobako/catalog/snippets.rb +3 -18
  183. data/lib/kobako/catalog.rb +3 -0
  184. data/lib/kobako/codec/{utils.rb → boundary.rb} +4 -2
  185. data/lib/kobako/codec/decoder.rb +4 -4
  186. data/lib/kobako/codec/ext_types.rb +3 -3
  187. data/lib/kobako/codec/handle_walk.rb +3 -43
  188. data/lib/kobako/codec/value_budget.rb +132 -40
  189. data/lib/kobako/codec.rb +1 -1
  190. data/lib/kobako/context.rb +24 -11
  191. data/lib/kobako/errors.rb +15 -12
  192. data/lib/kobako/extension.rb +3 -2
  193. data/lib/kobako/filesystem.rb +9 -2
  194. data/lib/kobako/handle.rb +2 -2
  195. data/lib/kobako/names.rb +28 -0
  196. data/lib/kobako/network.rb +210 -0
  197. data/lib/kobako/outcome.rb +7 -7
  198. data/lib/kobako/pool.rb +45 -23
  199. data/lib/kobako/runtime.rb +3 -2
  200. data/lib/kobako/sandbox.rb +92 -35
  201. data/lib/kobako/sandbox_options.rb +41 -106
  202. data/lib/kobako/transport/argument_wrap.rb +64 -0
  203. data/lib/kobako/transport/block_failure.rb +1 -1
  204. data/lib/kobako/transport/dispatcher.rb +6 -6
  205. data/lib/kobako/transport/exposure.rb +26 -15
  206. data/lib/kobako/transport/reflection.rb +21 -4
  207. data/lib/kobako/transport/run.rb +8 -23
  208. data/lib/kobako/transport/yielder.rb +2 -9
  209. data/lib/kobako/transport.rb +1 -0
  210. data/lib/kobako/version.rb +1 -1
  211. data/lib/kobako.rb +6 -2
  212. data/release-please-config.json +15 -0
  213. data/sig/core/thread.rbs +6 -0
  214. data/sig/kobako/catalog/extensions.rbs +2 -0
  215. data/sig/kobako/catalog/grants.rbs +7 -4
  216. data/sig/kobako/catalog/handles.rbs +0 -2
  217. data/sig/kobako/catalog/mount.rbs +3 -1
  218. data/sig/kobako/catalog/network.rbs +20 -0
  219. data/sig/kobako/catalog/replacements.rbs +14 -0
  220. data/sig/kobako/catalog/services.rbs +0 -4
  221. data/sig/kobako/catalog/snippets.rbs +0 -2
  222. data/sig/kobako/codec/{utils.rbs → boundary.rbs} +2 -2
  223. data/sig/kobako/codec/handle_walk.rbs +0 -6
  224. data/sig/kobako/codec/value_budget.rbs +47 -4
  225. data/sig/kobako/context.rbs +3 -1
  226. data/sig/kobako/errors.rbs +4 -4
  227. data/sig/kobako/filesystem.rbs +21 -3
  228. data/sig/kobako/network.rbs +115 -0
  229. data/sig/kobako/outcome.rbs +1 -1
  230. data/sig/kobako/pool.rbs +7 -3
  231. data/sig/kobako/runtime.rbs +32 -3
  232. data/sig/kobako/sandbox.rbs +19 -2
  233. data/sig/kobako/sandbox_options.rbs +29 -38
  234. data/sig/kobako/transport/argument_wrap.rbs +15 -0
  235. data/sig/kobako/transport/error.rbs +1 -1
  236. data/sig/kobako/transport/exposure.rbs +2 -4
  237. data/sig/kobako/transport/reflection.rbs +10 -0
  238. data/sig/kobako/transport/run.rbs +0 -2
  239. data/sig/kobako/transport/yielder.rbs +0 -3
  240. data/sig/kobako/transport.rbs +1 -1
  241. data/sig/kobako.rbs +13 -0
  242. metadata +84 -35
  243. data/crates/kobako-runtime/src/endpoint/capture.rs +0 -115
  244. data/crates/kobako-runtime/src/endpoint/memory_cap.rs +0 -238
  245. data/crates/kobako-runtime/src/filesystem/path.rs +0 -21
  246. data/crates/kobako-runtime/src/vfs/errno.rs +0 -153
  247. data/crates/kobako-runtime/tests/linux_baseline/calls.rs +0 -171
  248. data/crates/kobako-runtime/tests/linux_baseline/concurrent.rs +0 -276
  249. data/crates/kobako-runtime/tests/linux_baseline/kobako.rs +0 -323
  250. data/crates/kobako-runtime/tests/linux_baseline/linux-baseline-expected.txt +0 -16
  251. data/crates/kobako-runtime/tests/linux_baseline/linux.rs +0 -449
  252. data/crates/kobako-runtime/tests/linux_baseline/main.rs +0 -611
  253. data/crates/kobako-runtime/tests/linux_baseline/permissions.rs +0 -236
  254. data/crates/kobako-wasmtime/src/descriptors.rs +0 -200
  255. data/crates/kobako-wasmtime/tests/integration/compile_posture.rs +0 -43
  256. data/crates/kobako-wasmtime/tests/integration/guest_file.rs +0 -1085
  257. data/crates/kobako-wasmtime/tests/integration/main.rs +0 -29
  258. data/crates/kobako-wasmtime/tests/integration/preamble_flags.rs +0 -70
  259. data/crates/kobako-wasmtime/tests/integration/snippet_compile.rs +0 -95
  260. data/crates/kobako-wasmtime/tests/integration/support/mod.rs +0 -30
  261. data/crates/kobako-wasmtime/tests/integration/unanswered_call.rs +0 -86
  262. data/crates/kobako-wasmtime/tests/integration/unsupported_call.rs +0 -51
  263. data/ext/kobako/src/runtime/gvl.rs +0 -147
  264. data/lib/kobako/constant_name.rb +0 -8
  265. data/sig/kobako/constant_name.rbs +0 -3
  266. /data/ext/kobako/src/{runtime/pinned_value.rs → pinned_value.rs} +0 -0
@@ -49,7 +49,7 @@ impl Unsupported {
49
49
 
50
50
  #[cfg(test)]
51
51
  mod tests {
52
- use super::super::{CompileReply, Outcome, Reply, YieldReply};
52
+ use super::super::{CallReply, CompileReply, Outcome, YieldReply};
53
53
  use super::*;
54
54
 
55
55
  // @behavior WE-069
@@ -58,18 +58,18 @@ mod tests {
58
58
  let refusal = Unsupported::new("not served");
59
59
  assert_eq!(
60
60
  refusal.encode(),
61
- Reply::Unsupported(refusal.clone()).encode(),
61
+ CallReply::Unsupported(refusal.clone()).encode(),
62
62
  "an Unsupported encoded on its own must be the same answer every operation carries"
63
63
  );
64
64
  assert_eq!(
65
65
  (
66
- Reply::decode(&Reply::Unsupported(refusal.clone()).encode()),
66
+ CallReply::decode(&CallReply::Unsupported(refusal.clone()).encode()),
67
67
  YieldReply::decode(&YieldReply::Unsupported(refusal.clone()).encode()),
68
68
  CompileReply::decode(&CompileReply::Unsupported(refusal.clone()).encode()),
69
69
  Outcome::decode(&Outcome::Unsupported(refusal.clone()).encode()),
70
70
  ),
71
71
  (
72
- Ok(Reply::Unsupported(refusal.clone())),
72
+ Ok(CallReply::Unsupported(refusal.clone())),
73
73
  Ok(YieldReply::Unsupported(refusal.clone())),
74
74
  Ok(CompileReply::Unsupported(refusal.clone())),
75
75
  Ok(Outcome::Unsupported(refusal)),
@@ -84,9 +84,9 @@ mod tests {
84
84
  fn a_kind_this_reader_predates_still_delivers_its_message() {
85
85
  let bytes = [0x15, 9, 0, 0, 0, 1, b'm'];
86
86
  assert_eq!(
87
- Reply::decode(&bytes),
88
- Ok(Reply::Unsupported(Unsupported::new("m"))),
89
- "an Unsupported of an unknown kind through Reply::decode must read as the one \
87
+ CallReply::decode(&bytes),
88
+ Ok(CallReply::Unsupported(Unsupported::new("m"))),
89
+ "a Call's reply carrying an Unsupported of an unknown kind must read as the one \
90
90
  kind defined, its message intact"
91
91
  );
92
92
  }
@@ -96,9 +96,9 @@ mod tests {
96
96
  fn a_field_this_reader_predates_is_skipped() {
97
97
  let bytes = [0x15, 0, 0, 0, 0, 1, b'm', 0xff];
98
98
  assert_eq!(
99
- Reply::decode(&bytes),
100
- Ok(Reply::Unsupported(Unsupported::new("m"))),
101
- "an Unsupported carrying a trailing field through Reply::decode must skip it, \
99
+ CallReply::decode(&bytes),
100
+ Ok(CallReply::Unsupported(Unsupported::new("m"))),
101
+ "a Call's reply carrying an Unsupported with a trailing field must skip it, \
102
102
  its message intact"
103
103
  );
104
104
  }
@@ -10,7 +10,7 @@
10
10
  //! payload reaches its reader as a view rather than a copy. Every other
11
11
  //! message copies what it holds at decode.
12
12
  //!
13
- //! Every answer is exhaustive. Each arm is a tag byte the layout document
13
+ //! Every answer is exhaustive. Each arm is a tag byte the wire layout
14
14
  //! fixes, so an answer's set grows only with an ABI version — and when it
15
15
  //! does, a peer that has not been taught the new arm should fail to
16
16
  //! compile rather than fall into a wildcard and answer a message it
@@ -20,8 +20,8 @@
20
20
  //! Preamble skips an advisory record of a kind it does not know.
21
21
  //!
22
22
  //! This layer has one implementation, so its `golden_layout_*` tests are
23
- //! what hold it to the layout document. They spell each tag as the literal
24
- //! byte that document fixes, never as the constant beside it: a golden
23
+ //! what hold it to the wire layout. They spell each tag as the literal
24
+ //! byte the layout fixes, never as the constant beside it: a golden
25
25
  //! written from the constant compares the implementation to itself.
26
26
 
27
27
  pub(crate) mod bytes;
@@ -29,6 +29,7 @@ pub mod call;
29
29
  pub mod compile_reply;
30
30
  pub mod error_record;
31
31
  pub mod fault;
32
+ pub mod name;
32
33
  pub mod outcome;
33
34
  pub mod preamble;
34
35
  pub mod reply;
@@ -37,13 +38,17 @@ pub mod run;
37
38
  pub(crate) mod tag;
38
39
  pub mod unsupported;
39
40
 
40
- pub use call::{Call, Target};
41
+ pub use call::{Call, Target, MAX_HANDLE_ID};
41
42
  pub use compile_reply::CompileReply;
42
- pub use error_record::ErrorRecord;
43
+ pub use error_record::{
44
+ ErrorRecord, BOOT_ERROR, BYTECODE_ERROR, NO_SERVICE_ERROR, SANDBOX_ERROR,
45
+ SERVICE_ARGUMENT_ERROR, SERVICE_ERROR, TRANSPORT_ERROR, UNDEFINED_ENTRYPOINT_ERROR,
46
+ UNSUPPORTED_FLAG_ERROR,
47
+ };
43
48
  pub use fault::{Fault, FaultKind};
44
49
  pub use outcome::{Origin, Outcome, Panic};
45
50
  pub use preamble::{Bindings, Flag, Preamble, Snippet, Snippets};
46
- pub use reply::{Reply, YieldReply};
51
+ pub use reply::{CallReply, YieldReply};
47
52
  pub use request::{Downcall, UnknownTag, Upcall};
48
53
  pub use run::Run;
49
54
  pub use unsupported::Unsupported;
@@ -62,8 +67,8 @@ use std::fmt;
62
67
  pub struct DecodeError(&'static str);
63
68
 
64
69
  impl DecodeError {
65
- pub const fn new(reason: &'static str) -> Self {
66
- DecodeError(reason)
70
+ pub const fn new(message: &'static str) -> Self {
71
+ DecodeError(message)
67
72
  }
68
73
 
69
74
  pub fn message(&self) -> &str {
@@ -1,5 +1,166 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.21.0](https://github.com/elct9620/kobako/compare/kobako-wasmtime-v0.20.0...kobako-wasmtime-v0.21.0) (2026-11-18)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **transport:** kobako_transport::envelope::Reply is CallReply.
9
+ * **transport:** call Driver::from_file in place of Driver::new;
10
+ * **security:** call kobako_runtime::security::prepare_creds in place of prepare_creds_within.
11
+ * **vfs:** call Rdir::iterate_shared and File::is_readable, is_writable, is_append, is_nonblock, is_dsync, and is_sync in place of the bare names.
12
+ * **vfs:** call Iattr::for_size, Iattr::for_times, Kiocb::new, and get_anon_bdev in place of Iattr::size, Iattr::times, Kiocb::at, and
13
+ * **vfs:** call Inode::file_type and File::file_type in place of kind.
14
+ * **runtime:** match SetupError::GuestBinaryNotFound in place of
15
+ * **network:** open_connection_limit bounds what one invocation holds open at once, not what all of a Sandbox's invocations hold together.
16
+ * **transport:** a Guest Binary built against ABI 5 is refused at construction. Rebuild it against kobako-core, whose export_guest! emits the new names. kobako-transport drops ABI_VERSION as a u32, FRAME_LEN_SIZE, MAX_FRAME_LEN, pack_ptr_len, and unpack_ptr_len, and names the ABI through ABI_VERSION ("0.6.0"), GUEST_INTERFACE, HOST_INTERFACE, DOWNCALL, UPCALL, and PREAMBLE. kobako-core drops alloc; answer returns the return area's address.
17
+ * **sdk:** `kobako::Options` and `kobako_wasmtime::Config` read and set every cap through `limits`: write `options.limits.timeout = …` where `options.timeout = …` was written, and likewise for `setup_timeout`, `memory_limit`, `stdout_limit`, `stderr_limit`, `open_file_limit`, `open_connection_limit`, and `connection_limit`.
18
+ * **options:** SandboxOptions no longer defines the DEFAULT_* constants, and SandboxOptions.new requires every option; a Sandbox's defaults are unchanged and readable through Sandbox#options.
19
+ * **runtime:** `memory_limit` now bounds the guest's `memory.grow` and what the host holds for the run together, where a Filesystem written in Ruby had its directory listings counted against a limit of their own. A run that grew close to `memory_limit` and listed a large directory may now raise `Errno::ENOMEM` in the guest or `Kobako::MemoryLimitError`, and `Usage#memory_peak` includes the listings. Raise `memory_limit` by what those listings hold to keep the earlier headroom.
20
+ * **runtime:** `kobako_runtime::FilesystemError`, `kobako_runtime::vfs::FilesystemError`, and `kobako_runtime::filesystem::FilesystemError` are now `kobako_runtime::Errno`, also reachable as `kobako::Errno`. Rename the type in a Filesystem or security module; its variants are unchanged.
21
+
22
+ ### Features
23
+
24
+ * bound a guest's connections per Sandbox, per run, and per process ([7a4f869](https://github.com/elct9620/kobako/commit/7a4f8692cbc788a23c582b90112cd0275739d496))
25
+ * **io:** match patterns and change the working directory through Dir ([72cca2c](https://github.com/elct9620/kobako/commit/72cca2c400c20f6cb52d7fb0e4589fd366bf0878))
26
+ * **network:** route and refuse a Mock's dials by protocol, UDP included ([9e8b44d](https://github.com/elct9620/kobako/commit/9e8b44d425db205fe0bb2faccca0782acf1e1b4e))
27
+ * **runtime:** answer the guest's network from a table a test writes ([b3aba65](https://github.com/elct9620/kobako/commit/b3aba650760b8cff3113341500fa414b17f4dd76))
28
+ * **runtime:** make a Filesystem from its kind without wrapping it first ([e7eb8a0](https://github.com/elct9620/kobako/commit/e7eb8a00a37794226edce2aa7f1bdcab2ef6790b))
29
+ * **transport:** carry the Guest ABI in the Canonical ABI's core shape ([34b9560](https://github.com/elct9620/kobako/commit/34b956001a05e15fe29febd7098b2ceb054e1bab))
30
+ * **wasmtime:** answer a TCP socket's keep-alive-enabled from the socket ([0a78137](https://github.com/elct9620/kobako/commit/0a781371651f05196179c2c92cc22f6191e68062))
31
+ * **wasmtime:** answer a TCP socket's keepalive timing and buffer sizes ([5b248a3](https://github.com/elct9620/kobako/commit/5b248a3a58c7422c21e8a7bd31cb4f264ab5c3b6))
32
+ * **wasmtime:** answer hop limits and a UDP socket's buffer sizes ([3cf0a71](https://github.com/elct9620/kobako/commit/3cf0a71c28acfc2ac4cb7928f3e73b31b924fa90))
33
+ * **wasmtime:** answer wasi:sockets/udp with one peer a guest names ([e15500d](https://github.com/elct9620/kobako/commit/e15500d6268bb4b31c11367048731a64eaf91577))
34
+ * **wasmtime:** read the host's trust store as a Driver is built ([119ede5](https://github.com/elct9620/kobako/commit/119ede5439bb8c12523ef3607a64ee67cd45532d))
35
+ * **wasmtime:** stand the standard streams over preview2 streams ([768ba2b](https://github.com/elct9620/kobako/commit/768ba2b608e09915b3399108ffcca0d163004177))
36
+ * **wasmtime:** take the network's Protocol Family and Resolver from Config ([56cc53f](https://github.com/elct9620/kobako/commit/56cc53fa56cd987666f6b18b16e5264e314d8ef8))
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * answer an oversized datagram EMSGSIZE from the socket itself ([02317bc](https://github.com/elct9620/kobako/commit/02317bcc8e1ef86aa4b4a5e7a3b63b297cb6aeab))
42
+ * bound a guest's header list by size and charge it to its memory ([80c9ee2](https://github.com/elct9620/kobako/commit/80c9ee2523e0a3ad5de78e769a45136bcbcb6dc8))
43
+ * **core:** take no room for an empty list the host lowers ([f2fac23](https://github.com/elct9620/kobako/commit/f2fac236de645f69e479fa5bff97979005e344eb))
44
+ * **http:** answer a request whose name has no address with DNS-error ([295fe03](https://github.com/elct9620/kobako/commit/295fe036232e9256b2b3ce49f46168a51ce3f7e2))
45
+ * **http:** refuse an outgoing body finished with trailers ([c3c8f1b](https://github.com/elct9620/kobako/commit/c3c8f1b3b6277865f119c04065109a8cb4e1ab76))
46
+ * **http:** send the trailers an outgoing body finishes with ([7792bcc](https://github.com/elct9620/kobako/commit/7792bccbedff4758b2ec85bae344c45769997518))
47
+ * **io:** answer a script's socket addr at the guest's own virtual address ([6e8891a](https://github.com/elct9620/kobako/commit/6e8891a9b242849f1d1d9cea825ab47480b69b0e))
48
+ * **io:** answer each stream call with its own error, as CRuby's ([9f54696](https://github.com/elct9620/kobako/commit/9f54696635a4a0026c2555fcc6d0b6ab64b266e4))
49
+ * **io:** convert a number a file or socket call takes through to_int ([3da8767](https://github.com/elct9620/kobako/commit/3da8767e53b6c5d759b5a891357c6a3fe50ba01b))
50
+ * **io:** let the host judge a script's bind, as CRuby names it ([0ec0f80](https://github.com/elct9620/kobako/commit/0ec0f805b8a0c6caed0e4c7c25dd99c5cdaffd07))
51
+ * **io:** name every errno as CRuby does and build SystemCallError as it does ([487fcb6](https://github.com/elct9620/kobako/commit/487fcb67affc89b445296b6f482cec791f438ccd))
52
+ * **io:** raise Errno::ENFILE for a host out of open files in system ([894f8b2](https://github.com/elct9620/kobako/commit/894f8b253d29db6bddad205be45a94327e35f2e5))
53
+ * **io:** read a file's mode, names, lines, and seeks as CRuby does ([aeb0125](https://github.com/elct9620/kobako/commit/aeb01252708fecab8d5ed968866ca1b368670f0b))
54
+ * **io:** read a Float count or length the one way CRuby's NUM2LONG does ([794a529](https://github.com/elct9620/kobako/commit/794a529f3f9664f444d9c15e25964979daed429b))
55
+ * **io:** read a Float whence as the Integer it truncates to ([5386576](https://github.com/elct9620/kobako/commit/5386576297a76be3c14cc8ce87d1640cab75346e))
56
+ * **io:** read a socket stream's failure through network-error-code ([01761e1](https://github.com/elct9620/kobako/commit/01761e12d1e12484253611bb5ac2136ebff070f2))
57
+ * **io:** refuse a seek whence past C's int as CRuby's NUM2INT does ([972e3c8](https://github.com/elct9620/kobako/commit/972e3c8481eb6436b64da121dc21ad4555db933f))
58
+ * **io:** seek, putc, warn, and an unknown errno answer as CRuby's do ([86f8bff](https://github.com/elct9620/kobako/commit/86f8bffe826a01785edbdf6df142ae9353f30bac))
59
+ * judge a request's authority, path, and headers as wasmtime does ([903cc7b](https://github.com/elct9620/kobako/commit/903cc7b39217f3038de6bab5981ea37499f25e1c))
60
+ * make each guest socket and its file at creation, as socket() does ([fca4311](https://github.com/elct9620/kobako/commit/fca4311060be90df2ec79c1d21bb3a9a5b0b36ca))
61
+ * **net:** answer a host down by its own name until a WASI code groups it ([1ec6001](https://github.com/elct9620/kobako/commit/1ec60013934486bf54fe2fa2e6fb6785009d4af1))
62
+ * **net:** answer a host socket's errno as wasmtime-wasi does on every host ([293ea2c](https://github.com/elct9620/kobako/commit/293ea2cccabc6d63840e199e796af419e2687658))
63
+ * **net:** answer an IPv4-mapped address's lookup with its IPv4 address ([99f67c5](https://github.com/elct9620/kobako/commit/99f67c5da05bcc5d08222c8e505353475b68a93d))
64
+ * **net:** answer an unreachable request and a TLS alert as wasmtime-wasi-http does ([06bb9f9](https://github.com/elct9620/kobako/commit/06bb9f91c98bdb897853fc9fe0571ee20a6ee60d))
65
+ * **net:** answer EAGAIN on a shut UDP read, as non-blocking Linux does ([675376d](https://github.com/elct9620/kobako/commit/675376d971c721ca23a5bd581e7d83db59dc94aa))
66
+ * **net:** answer preview2 permits, options, and schemes as wasmtime-wasi ([3489166](https://github.com/elct9620/kobako/commit/3489166945852ca53626b82510f5c0a728cf0b26))
67
+ * **net:** bound an HTTP request by the timeouts request-options sets ([b0e35d8](https://github.com/elct9620/kobako/commit/b0e35d80a275ecb33679ff1967e05f476f155ce7))
68
+ * **net:** cancel a name lookup nobody waits for ([bf8c668](https://github.com/elct9620/kobako/commit/bf8c6682055f8993060de7c79c2d4af51a0bd111))
69
+ * **net:** deny a socket without a network as wasmtime-wasi does ([09b0e9a](https://github.com/elct9620/kobako/commit/09b0e9a2713bd76ab0aafeaa5d459566891154e6))
70
+ * **net:** hold a request's parts against memory while it is sent ([d1b642b](https://github.com/elct9620/kobako/commit/d1b642b1171d54b4c0d4cbc1ae6e8ff313b3dc89))
71
+ * **net:** hold a request's parts and a response's head against memory ([fbc93c5](https://github.com/elct9620/kobako/commit/fbc93c5d763396cb5b928801380ef3989ec931af))
72
+ * **net:** name a host socket's failure from its errno where std names none ([dddffa4](https://github.com/elct9620/kobako/commit/dddffa4bdc22575e3af4b27809662b04127aafc6))
73
+ * **net:** read a host the guest names as wasmtime-wasi's lookup does ([2defe86](https://github.com/elct9620/kobako/commit/2defe8666e9046179dab4ff8b74057e69c9ab10a))
74
+ * **net:** start a TCP socket's send buffer at Linux's default until it connects ([ea560c8](https://github.com/elct9620/kobako/commit/ea560c8ecdb0af143f94581ed10147bdc3e0359a))
75
+ * **net:** wait on a socket by its own flag, and reset a released one sent to ([9dbac06](https://github.com/elct9620/kobako/commit/9dbac065500e78c84a2ae000f06064f6f21b17f1))
76
+ * **network:** answer an endpoint the ruleset refuses as the Host App's argument ([1c6d710](https://github.com/elct9620/kobako/commit/1c6d710855495f874761eef1933f51c93a7a62b0))
77
+ * **network:** count each invocation's open connections apart ([dc426f6](https://github.com/elct9620/kobako/commit/dc426f60595b2df4ff508e7534ae37b7afed502c))
78
+ * **network:** read a Mock's names with the URL host parser ([a170e19](https://github.com/elct9620/kobako/commit/a170e197a85a1f7ca1dd6d00d62cb7dfa33b39b7))
79
+ * **network:** read a socket's own end at a virtual port, not the host's ([1ef8486](https://github.com/elct9620/kobako/commit/1ef84864b6f8106e25eaa5fd0abf7310d56835c6))
80
+ * **network:** refuse a Mock's dial with an errno that reads alike on every host ([3a7b705](https://github.com/elct9620/kobako/commit/3a7b705d82b195b4de1c54bc56fd04464dadba11))
81
+ * **network:** refuse a request whose method is not a token before any policy ([23a8e75](https://github.com/elct9620/kobako/commit/23a8e75d573b14610bdb048a0a3600017be0d69a))
82
+ * **runtime:** charge empty datagrams and virtual addresses ([9a4d9ba](https://github.com/elct9620/kobako/commit/9a4d9ba92cbd3ba5f7570f1693282202db43b6d9))
83
+ * **runtime:** charge the guest's growth and host-held memory to one budget ([f19659e](https://github.com/elct9620/kobako/commit/f19659ed93d0f5b0c1472dbc3bdbbb6815efbb4f))
84
+ * **runtime:** give a socket its virtual port as Linux's inet layer does ([2c80c02](https://github.com/elct9620/kobako/commit/2c80c027801b5a00501fb8141e8ebde53879a855))
85
+ * **runtime:** give each Invocation's outbound seam its own TLS sessions ([75119d8](https://github.com/elct9620/kobako/commit/75119d88a49f546a2d827a9476c5067d99bc02dd))
86
+ * **runtime:** give each real address its own virtual address and dial one destination ([71c1b8d](https://github.com/elct9620/kobako/commit/71c1b8d7c3ee5ee34f57e5f1a48b43619176d129))
87
+ * **runtime:** hold a socket's buffers against the Invocation's memory ([5d629a7](https://github.com/elct9620/kobako/commit/5d629a71f1940222dac36a57502030025575ef70))
88
+ * **runtime:** judge the guest's HTTP headers, binds, and peerless streams in the runtime ([bc3e024](https://github.com/elct9620/kobako/commit/bc3e024483e43d8b121cb67e661e06e99997f604))
89
+ * **runtime:** judge the request target the server reads ([9bc185e](https://github.com/elct9620/kobako/commit/9bc185e6f00375498f4d9119a34357e32d52279b))
90
+ * **runtime:** keep a deadline in a forked child with a ticker of its own ([030a3fa](https://github.com/elct9620/kobako/commit/030a3fa9360b93c0fcee4ba77c2f110ddf8d4b13))
91
+ * **runtime:** keep a failed growth in the memory peak ([2e2b986](https://github.com/elct9620/kobako/commit/2e2b986dfa47aff61f0c20ad9b63178bfccbd441))
92
+ * **runtime:** let an HTTP exchange go once nothing holds it ([2d78df9](https://github.com/elct9620/kobako/commit/2d78df98d11cdd8671629b1da2a5ac4b0b1862e7))
93
+ * **runtime:** name a host out of quota, links, or a busy program as Linux does ([6f5f816](https://github.com/elct9620/kobako/commit/6f5f816a6192dec2ea21c219a3a2f2497a6b2aac))
94
+ * **runtime:** refuse a second connect on a connecting or connected socket ([2949d40](https://github.com/elct9620/kobako/commit/2949d402303e11af2b4346a866fee754e1e00dbd))
95
+ * **runtime:** take the reactor before a TCP socket dials ([e056522](https://github.com/elct9620/kobako/commit/e0565227c357d05bca12610cd26d4aaac85b604a))
96
+ * **security:** make no Cred for a Mount that stands nowhere ([c2c6190](https://github.com/elct9620/kobako/commit/c2c619095eb452d19be1aab65941b7cb86b339dd))
97
+ * **vfs:** fail the run when a nested mount stands nowhere ([b6e44fa](https://github.com/elct9620/kobako/commit/b6e44fa43723831b2c7d37c64bbfea95f2086b83))
98
+ * **vfs:** place each mount as Linux's mount does, and open its preopen there ([a750bc7](https://github.com/elct9620/kobako/commit/a750bc75b3f1e8bcaf62ecaca1227fc0c92914c4))
99
+ * **vfs:** preopen only the outermost mounts and place the rest as Linux does ([7d21f34](https://github.com/elct9620/kobako/commit/7d21f348ab237497f4a509e464563f6c472a8a17))
100
+ * **wasmtime:** answer a connect, a short write, and a datagram's sender as wasmtime-wasi ([d1762d0](https://github.com/elct9620/kobako/commit/d1762d0a6f703c003cdb8bf00c81628f61ce2b6f))
101
+ * **wasmtime:** answer a file's preview1 calls on a socket's number as Linux does ([0ba90a0](https://github.com/elct9620/kobako/commit/0ba90a0b3369065865d6d1b5d3387217f5f37ca2))
102
+ * **wasmtime:** answer a lookup or request past the file limit ([82d9f34](https://github.com/elct9620/kobako/commit/82d9f344a1a322d3b3bb811a8bbf39b4f98ad21f))
103
+ * **wasmtime:** answer a socket's edges as wasmtime-wasi does ([2b80a61](https://github.com/elct9620/kobako/commit/2b80a61876c9eef18d8100df46b05033825b5b58))
104
+ * **wasmtime:** answer closed to a blocking flush of nothing once the send side shut ([284d5a0](https://github.com/elct9620/kobako/commit/284d5a0ba7d30ba022d27ba60ed6cc2d4fb0a3c9))
105
+ * **wasmtime:** answer new-socket-limit for a socket past the open file limit ([e45c8e8](https://github.com/elct9620/kobako/commit/e45c8e8a86003c47f69e251f0e87a77764ed2fa9))
106
+ * **wasmtime:** answer OVERFLOW for a file time a preview1 timestamp cannot hold ([a716dbf](https://github.com/elct9620/kobako/commit/a716dbf2152dc83945cdeaafc638c6f504fd3491))
107
+ * **wasmtime:** answer preview1 reads, writes, and polls on a socket's number ([5514429](https://github.com/elct9620/kobako/commit/5514429067d83e6f5775bff21a1f8ac09b70eff6))
108
+ * **wasmtime:** answer the non-blocking stream calls a guest bounds its waits with ([16ef908](https://github.com/elct9620/kobako/commit/16ef908947f5c94a37ee0f5370038936b2052e4a))
109
+ * **wasmtime:** answer the socket and stream edges as wasmtime answers them ([4f690ea](https://github.com/elct9620/kobako/commit/4f690ea29f45451982dee726c42dd178dc4ae880))
110
+ * **wasmtime:** answer three preview2 socket and stream steps as wasmtime-wasi ([702addd](https://github.com/elct9620/kobako/commit/702adddb0a2626117303bcfcc9d80eb4f0bf938e))
111
+ * **wasmtime:** answer three socket calls as wasmtime-wasi does ([e0b8c8b](https://github.com/elct9620/kobako/commit/e0b8c8b45d1b2e7b7152b6332c49b5248bd0253d))
112
+ * **wasmtime:** ask a stream for room before a blocking flush waits ([1dbf02b](https://github.com/elct9620/kobako/commit/1dbf02bdc8309344366f40245cad5a3198bcf74b))
113
+ * **wasmtime:** ask a UDP address only what wasmtime asks, and its size first ([934d2eb](https://github.com/elct9620/kobako/commit/934d2eb8b7034db263423b8ad925a56ea731b1f4))
114
+ * **wasmtime:** bound what one preview2 call lifts by its hostcall fuel ([99ebca7](https://github.com/elct9620/kobako/commit/99ebca726a803d2de0b12bfcbcf7382bf7ab1308))
115
+ * **wasmtime:** charge each preview2 handle to the Invocation's memory ([def575a](https://github.com/elct9620/kobako/commit/def575a581b777e1a4c7bcb3604d3036b01b6284))
116
+ * **wasmtime:** check a preview2 return area whole once the call returns ([9910dea](https://github.com/elct9620/kobako/commit/9910dea5e4e13056d9007b78d99f67486ebb0bdc))
117
+ * **wasmtime:** close a TCP input stream once its receive side shuts ([76d944a](https://github.com/elct9620/kobako/commit/76d944a966e152f9e16e9fc0d61b8765b65a7418))
118
+ * **wasmtime:** close an output stream once a call on it fails ([df6b96f](https://github.com/elct9620/kobako/commit/df6b96fc65e3fba8ad4bbf92edebbf35639547d2))
119
+ * **wasmtime:** count a socket, a lookup, or an exchange as one file ([b5633e4](https://github.com/elct9620/kobako/commit/b5633e4c1e2d1efba35ef4a9c3f7f97b2c1ea65e))
120
+ * **wasmtime:** derive preview1's errno from its name, and map two more to preview2 ([aabd599](https://github.com/elct9620/kobako/commit/aabd5997070291dbe5055ae6b075f85f890f674b))
121
+ * **wasmtime:** end a blocking flush on a hang-up as its pollable does ([272aeb8](https://github.com/elct9620/kobako/commit/272aeb893052954be8f2274186f6fab93a66f46e))
122
+ * **wasmtime:** end a run its host gave up at its next preview2 call ([0d1b324](https://github.com/elct9620/kobako/commit/0d1b32494c501ee346f50e39e8e38d7fb885dab9))
123
+ * **wasmtime:** give back the charge of a growth wasmtime then fails ([070c463](https://github.com/elct9620/kobako/commit/070c463e11428eb27465d6d9a9e7ba38b738249f))
124
+ * **wasmtime:** hand out only the datagrams of the peer a stream was made with ([88123ea](https://github.com/elct9620/kobako/commit/88123ea0f6f4d128ae7af8f43a9e0bf063c8c309))
125
+ * **wasmtime:** hold a socket's streams and pollables as its children ([0957eda](https://github.com/elct9620/kobako/commit/0957eda5a2159e402573ddfa7e2de5e941adea80))
126
+ * **wasmtime:** hold preview1's files in the preview2 resource table ([d447054](https://github.com/elct9620/kobako/commit/d447054dee66c3b234975ca6331dce3ed9a76d8e))
127
+ * **wasmtime:** judge a TCP socket's pollable by the connect under way as it is polled ([b89bccd](https://github.com/elct9620/kobako/commit/b89bccdba789d69dc7b69ad07a7176b0d310b963))
128
+ * **wasmtime:** lend a standard stream's handle to its descriptor ([74059ac](https://github.com/elct9620/kobako/commit/74059ac5a2651d2ffe8decc0b8feb528f49dad40))
129
+ * **wasmtime:** let a blocking flush of nothing succeed once a stream closes ([bc76ab7](https://github.com/elct9620/kobako/commit/bc76ab72fb104326cfffbd5d4d524a6d75d89887))
130
+ * **wasmtime:** make every pollable a child of what it watches ([48a0d2c](https://github.com/elct9620/kobako/commit/48a0d2c1cab25232baf29a9632e9b8a76413d236))
131
+ * **wasmtime:** number preview2 handles apart and reach no socket from preview1 ([adb0341](https://github.com/elct9620/kobako/commit/adb03410fd12804ccdaccd94748c6d1415417407))
132
+ * **wasmtime:** number preview2 handles from the descriptor space and trap a misnamed drop ([925a724](https://github.com/elct9620/kobako/commit/925a7244007e7fd72bec43f1b5dd5fa0d419dc84))
133
+ * **wasmtime:** permit a datagram send whenever its pollable is ready, and end a full flush on close ([8cf4961](https://github.com/elct9620/kobako/commit/8cf49612ee3af7ae5002ffa7b373a8b0579c2b78))
134
+ * **wasmtime:** poll an output stream ready only when it takes a write ([3247e0e](https://github.com/elct9620/kobako/commit/3247e0e80e5fee98e83e562b8fc99484d5863b8e))
135
+ * **wasmtime:** ready a closed output stream's pollable at once ([4ebd41a](https://github.com/elct9620/kobako/commit/4ebd41a90c5ee96f9e3ca90eea2fcb6246eb6ef5))
136
+ * **wasmtime:** refuse a negative read or write offset before the descriptor ([9b99512](https://github.com/elct9620/kobako/commit/9b995124380f0571b08c0cb68585c2acacf3d91a))
137
+ * **wasmtime:** refuse a short socket write whole, before any byte leaves ([5be1ec0](https://github.com/elct9620/kobako/commit/5be1ec027474376ecfcadce6d280891efe1a0afa))
138
+ * **wasmtime:** register an output stream's wait before reading its flush ([d3e9d11](https://github.com/elct9620/kobako/commit/d3e9d11ef993e18d9bbf9ceb49c0f3ec3039ec87))
139
+ * **wasmtime:** report RSYNC beside SYNC for a file opened to sync ([da46930](https://github.com/elct9620/kobako/commit/da46930be0a874bbdce2c6bccb85355a769b4912))
140
+ * **wasmtime:** reserve a producer's file once, where its limit is answered ([938ef0e](https://github.com/elct9620/kobako/commit/938ef0ea0b1531c7a5a0fe692d6b80d19dfbcc8d))
141
+ * **wasmtime:** round a keepalive time's part of a second up, as wasmtime's reaches the host ([31c5184](https://github.com/elct9620/kobako/commit/31c51843e4e6758179b05725334203915aa42611))
142
+ * **wasmtime:** spend a poll's fuel by the host's size of each subscription ([56cc303](https://github.com/elct9620/kobako/commit/56cc303bbef8f2bf03225de17d7ebab6ce384da9))
143
+ * **wasmtime:** trap a preview2 handle the guest does not hold as it is lifted ([f866c42](https://github.com/elct9620/kobako/commit/f866c4279ab54b581c0e827266c7b9ce75e4c371))
144
+ * **wasmtime:** trap and fail where the WIT says, and map errors as wasmtime-wasi does ([f8241ba](https://github.com/elct9620/kobako/commit/f8241baa1ebe9e399e6ce658f60d24e716b59522))
145
+ * **wasmtime:** trap on a misaligned preview2 return area ([6192d9e](https://github.com/elct9620/kobako/commit/6192d9e7db3d3f42ab2520b9a3a25d168bd341b6))
146
+ * **wasmtime:** trap on a preview2 list past the guest's memory before reading it ([7d9dc3c](https://github.com/elct9620/kobako/commit/7d9dc3ce63d8936053046cacaef4b31a6dadf86a))
147
+ * **wasmtime:** wait once per handle a poll lists more than once ([682fb21](https://github.com/elct9620/kobako/commit/682fb21b0623d015ebd5de4b1c78628eba99fef2))
148
+ * **wasmtime:** wait through preview2's poll from poll_oneoff ([760a280](https://github.com/elct9620/kobako/commit/760a28052853cbdb2dc9aa49cda2d1883744b86b))
149
+
150
+
151
+ ### Code Refactoring
152
+
153
+ * **options:** take every option's default from the runtime ([1982afe](https://github.com/elct9620/kobako/commit/1982afe89a987a269e1d8c42f69207e05f64ee40))
154
+ * **runtime:** name the errno type Errno at the crate root ([f608e31](https://github.com/elct9620/kobako/commit/f608e31e81d1be9ddc6bb2fc8f6a26e5acafced4))
155
+ * **runtime:** name the missing Guest Binary's setup failure after what is missing ([732b8be](https://github.com/elct9620/kobako/commit/732b8bece8e796bd36d5e350b623c5ab8db28349))
156
+ * **sdk:** hold a Sandbox's caps as the runtime's Limits ([9730d6a](https://github.com/elct9620/kobako/commit/9730d6a73fec595c2b75ac8981aeb655937045df))
157
+ * **security:** prepare an invocation's Cred as Linux's prepare_creds does ([e4f8f86](https://github.com/elct9620/kobako/commit/e4f8f86f3b25fd468f54dcc332e5767ac4ac9c32))
158
+ * **transport:** load a Driver from its file, and read an origin as a lookup that may miss ([4ec8d79](https://github.com/elct9620/kobako/commit/4ec8d792ddf14bb21cfd36437b64b2389ee6df89))
159
+ * **transport:** name a Call's reply CallReply beside YieldReply and CompileReply ([f34063e](https://github.com/elct9620/kobako/commit/f34063ee94edb723800b4a0670cf912aa1a445e0))
160
+ * **vfs:** build a change, a call, and a device number by the names Rust and Linux use ([f5710f8](https://github.com/elct9620/kobako/commit/f5710f82f0452d8aeb7dd8ee7cc2b822ae7c14fe))
161
+ * **vfs:** read an inode's or a file's type as file_type ([48150f7](https://github.com/elct9620/kobako/commit/48150f75263e9c195a8751ba8a9654c029162aa6))
162
+ * **vfs:** spell a rename, a listing, and an open file's flags as Linux and Rust do ([5bc0175](https://github.com/elct9620/kobako/commit/5bc01757679c2b68c77e22dd86e3dac9f001f4b5))
163
+
3
164
  ## [0.20.0](https://github.com/elct9620/kobako/compare/kobako-wasmtime-v0.19.0...kobako-wasmtime-v0.20.0) (2026-11-07)
4
165
 
5
166
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  [package]
17
17
  name = "kobako-wasmtime"
18
- version = "0.20.0"
18
+ version = "0.21.0"
19
19
  edition = "2021"
20
20
  # The toolchain this crate is built and tested on, the first whose stripped
21
21
  # Apple binary macOS 26 loads.
@@ -26,15 +26,18 @@ repository = "https://github.com/elct9620/kobako"
26
26
  readme = "README.md"
27
27
  keywords = ["wasm", "mruby", "sandbox", "wasi", "wasmtime"]
28
28
  categories = ["wasm", "virtualization"]
29
+ # The tests reach files only this repository holds, so a copy of the crate
30
+ # taken to customize builds without them.
31
+ exclude = ["tests/"]
29
32
 
30
33
  [dependencies]
31
34
  # The engine-neutral contract this crate implements. The version pin
32
35
  # rides the linked release group; the path keeps in-tree builds (and
33
36
  # the Ruby gem, which ships both crates) resolving locally.
34
- kobako-runtime = { version = "0.20.0", path = "../kobako-runtime" }
37
+ kobako-runtime = { version = "0.21.0", path = "../kobako-runtime" }
35
38
  # The fixed tier: the Envelope this driver shuttles and the ABI
36
39
  # values it drives the exports against.
37
- kobako-transport = { version = "0.20.0", path = "../kobako-transport" }
40
+ kobako-transport = { version = "0.21.0", path = "../kobako-transport" }
38
41
  # wasmtime — host-side embedder for kobako.wasm. We disable default-features
39
42
  # and opt back in only what kobako needs: a Cranelift-backed runtime that can
40
43
  # compile a pre-built wasm32-wasip1 module on the host triple, plus the `wat`
@@ -42,8 +45,9 @@ kobako-transport = { version = "0.20.0", path = "../kobako-transport" }
42
45
  # `cache` / `parallel-compilation` / `pooling` are intentionally off —
43
46
  # kobako runs short-lived synchronous sandboxes. `component-model` and
44
47
  # `async` still arrive through wasmtime-wasi's `p1`, which builds on `p2`;
45
- # kobako loads only core Modules, so none of that code is reached.
46
- wasmtime = { version = "50.0.0", default-features = false, features = [
48
+ # kobako loads only core Modules, so none of that code is reached. The floor
49
+ # is the first 50 release carrying the engine's security fixes.
50
+ wasmtime = { version = "50.0.1", default-features = false, features = [
47
51
  "cranelift",
48
52
  "runtime",
49
53
  "gc",
@@ -56,16 +60,31 @@ wasmtime = { version = "50.0.0", default-features = false, features = [
56
60
  # (args, environ, clocks, random); kobako answers every call that reads
57
61
  # its own descriptor table. `p1` is the only feature kobako asks for; it
58
62
  # enables `p2` itself, while `p0` and `p3` stay off.
59
- wasmtime-wasi = { version = "50.0.0", default-features = false, features = ["p1"] }
63
+ wasmtime-wasi = { version = "50.0.1", default-features = false, features = ["p1"] }
60
64
  # wiggle generates the preview1 calls kobako answers from `witx/`, as it
61
65
  # generates wasmtime-wasi's, so each takes its arguments and writes its answer
62
66
  # as wasmtime-wasi does. It rides wasmtime's release train.
63
- wiggle = { version = "50.0.0", default-features = false, features = ["wasmtime"] }
67
+ wiggle = { version = "50.0.1", default-features = false, features = ["wasmtime"] }
64
68
  # sha2 keys the on-disk compiled-module cache by Guest Binary content
65
69
  # (see cache.rs); a collision would load the wrong artifact, so the
66
70
  # hash must be cryptographic.
67
71
  sha2 = "0.11"
68
72
 
73
+ [dev-dependencies]
74
+ # wasmparser walks the bundled Guest Binary's code to witness what each ABI
75
+ # export can call; the version is the one wasmtime-environ already links.
76
+ wasmparser = "0.261.0"
77
+
78
+ [build-dependencies]
79
+ # build.rs generates the WASI 0.2 imports a Guest Binary links as a core
80
+ # module from `wit/`, as wiggle generates preview1's from `witx/`.
81
+ # wit-bindgen-core walks the Canonical ABI and re-exports the wit-parser
82
+ # it was built against.
83
+ wit-bindgen-core = "0.63.0"
84
+ # wit-parser reports a malformed `wit/` as `anyhow::Error`, which build.rs
85
+ # hands back to cargo.
86
+ anyhow = "1.0.102"
87
+
69
88
  # rustix reaches the cache directory through one descriptor, checked by
70
89
  # owner, so the unsafe artifact deserialize reads only what that
71
90
  # directory holds (see cache.rs); std has no `*at` calls.
@@ -15,7 +15,8 @@ contract surface.
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 Mount, and its own capped descriptor table |
18
+ | Filesystems | a preopen per outermost Mount, and its own capped descriptor table |
19
+ | WASI 0.2 imports | the `wasi:sockets`, `wasi:http` client, `wasi:io`, and clock subscriptions a core module links, generated from `wit/` |
19
20
 
20
21
  Each invocation discards its Store once it ends, so nothing one leaves
21
22
  behind reaches the next. The kobako Ruby gem's native ext is the first
@@ -28,7 +29,7 @@ Add the crate beside `kobako-runtime` to run a Guest Binary through its
28
29
 
29
30
  ```toml
30
31
  [dependencies]
31
- kobako-wasmtime = "0.20.0" # x-release-please-version
32
+ kobako-wasmtime = "0.21.0" # x-release-please-version
32
33
  ```
33
34
 
34
35
  ## License