kobako 0.25.0-aarch64-linux → 0.26.0-aarch64-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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6b1af77d24fb13d4d331b5ee1ede3fbd2d981f3ad8df91796de97e9e320abd2
4
- data.tar.gz: e4305e4c7ad9845bf70d41b1d18f48465f82f37feff9fa85525a0443a622393b
3
+ metadata.gz: 0da2768b0825ee9390a7fa8b0ad607250c1e3414e2a087aa01e0a55c96d35c12
4
+ data.tar.gz: acfa3845f354764e12b8ede5d4c99a99da85338e7b6d4eb49c6ca57636e1e148
5
5
  SHA512:
6
- metadata.gz: b4feda43682dc0448fc1898ee173adad97664095bf3d175f9b9c6d525f272be82f91bd75baba54dc22f9a5ce7124209d2dc9a080be9ed29c5bade74176735d65
7
- data.tar.gz: 8e7775a4dd467b7f8d57f0158fa5667800f5296785fdcc0463380435d024ea3645b2abfd1c7499086f35009d287d2629a1b72059e2301278171491532df5d2a1
6
+ metadata.gz: 2f5e3091468ddc695bf76827b302964b10e310cac203f75d30d01f4548aaa2960148fef15256de3c9e512cbf3d73108fa62ad63b31653580801edef1c72b286c
7
+ data.tar.gz: f22415c61723f104638732c570e72ee468fb61c8d0ab4cca766a5822b6028ecaeb2e2ce6c85317390df7323c9d07f566d9f5beb5a0c7ad4931ffca416add0f92
@@ -1 +1 @@
1
- {".":"0.25.0","wasm/kobako-core":"0.15.0","wasm/kobako-mruby":"0.15.0","wasm/kobako-io":"0.15.0","wasm/kobako-json":"0.15.0","wasm/kobako-regexp":"0.15.0","wasm/kobako-baker":"0.15.0","crates/kobako-transport":"0.15.0","crates/kobako-codec":"0.15.0","crates/kobako-runtime":"0.15.0","crates/kobako-wasmtime":"0.15.0","crates/kobako":"0.15.0"}
1
+ {".":"0.26.0","wasm/kobako-core":"0.16.0","wasm/kobako-mruby":"0.16.0","wasm/kobako-io":"0.16.0","wasm/kobako-json":"0.16.0","wasm/kobako-regexp":"0.16.0","wasm/kobako-baker":"0.16.0","crates/kobako-transport":"0.16.0","crates/kobako-codec":"0.16.0","crates/kobako-runtime":"0.16.0","crates/kobako-wasmtime":"0.16.0","crates/kobako":"0.16.0"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.26.0](https://github.com/elct9620/kobako/compare/v0.25.0...v0.26.0) (2026-09-15)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **transport:** a #run argument or keyword value whose own nesting leaves the Run payload one level past the wire's 128-level bound used to reach the guest and fail there as Kobako::SandboxError "failed to decode the invocation arguments"; it is now refused by the host before the guest runs, still as Kobako::SandboxError, with a message naming the depth bound.
9
+ * **transport:** a Service answer nesting past 128 levels used to cross the host and fail in the guest's decoder, reaching the Host App as Kobako::Transport::Error; it is now refused at the host and reaches the Host App as Kobako::ServiceError, which guest code may rescue. A yield whose arguments nest past the bound — a single yielded value already at the bound does, since the arguments travel as one list — now raises Kobako::YieldValueError inside the Service at the yield instead of failing in the guest.
10
+
11
+ ### Bug Fixes
12
+
13
+ * **transport:** measure an entrypoint argument from the Run payload that carries it ([8f76912](https://github.com/elct9620/kobako/commit/8f76912f2290ec0d8484e8ac9a64cbb48409bf1d))
14
+ * **transport:** refuse a Service's over-deep value before the host writes it ([5594542](https://github.com/elct9620/kobako/commit/5594542c7160ae2f052025545a20bafabd7e51df))
15
+
16
+
17
+ ### Performance Improvements
18
+
19
+ * **codec:** walk into a value's members only where one could be a container ([a965136](https://github.com/elct9620/kobako/commit/a965136c989251b2ed991c2824214a017122430c))
20
+
3
21
  ## [0.25.0](https://github.com/elct9620/kobako/compare/v0.24.0...v0.25.0) (2026-09-14)
4
22
 
5
23
 
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.0](https://github.com/elct9620/kobako/compare/kobako-runtime-v0.15.0...kobako-runtime-v0.16.0) (2026-09-15)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **kobako-runtime:** Synchronize kobako crates versions
9
+
3
10
  ## [0.15.0](https://github.com/elct9620/kobako/compare/kobako-runtime-v0.14.0...kobako-runtime-v0.15.0) (2026-09-13)
4
11
 
5
12
 
@@ -26,7 +26,7 @@ map the neutral types onto their own language surface.
26
26
 
27
27
  ```toml
28
28
  [dependencies]
29
- kobako-runtime = "0.15.0" # x-release-please-version
29
+ kobako-runtime = "0.16.0" # x-release-please-version
30
30
  ```
31
31
 
32
32
  ## License
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.0](https://github.com/elct9620/kobako/compare/kobako-transport-v0.15.0...kobako-transport-v0.16.0) (2026-09-15)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **kobako-transport:** Synchronize kobako crates versions
9
+
3
10
  ## [0.15.0](https://github.com/elct9620/kobako/compare/kobako-transport-v0.14.0...kobako-transport-v0.15.0) (2026-09-13)
4
11
 
5
12
 
@@ -35,7 +35,7 @@ the golden vectors in this crate are derived from that document.
35
35
 
36
36
  ```toml
37
37
  [dependencies]
38
- kobako-transport = "0.15.0" # x-release-please-version
38
+ kobako-transport = "0.16.0" # x-release-please-version
39
39
  ```
40
40
 
41
41
  ## License
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.0](https://github.com/elct9620/kobako/compare/kobako-wasmtime-v0.15.0...kobako-wasmtime-v0.16.0) (2026-09-15)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **kobako-wasmtime:** Synchronize kobako crates versions
9
+
3
10
  ## [0.15.0](https://github.com/elct9620/kobako/compare/kobako-wasmtime-v0.14.0...kobako-wasmtime-v0.15.0) (2026-09-13)
4
11
 
5
12
 
@@ -24,7 +24,7 @@ SDK consumes the same surface.
24
24
 
25
25
  ```toml
26
26
  [dependencies]
27
- kobako-wasmtime = "0.15.0" # x-release-please-version
27
+ kobako-wasmtime = "0.16.0" # x-release-please-version
28
28
  ```
29
29
 
30
30
  ## License
data/data/kobako.wasm CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -31,23 +31,14 @@ module Kobako
31
31
  # same error: an integer outside i64..u64 (+RangeError+) and any
32
32
  # packer-internal +NoMethodError+.
33
33
  #
34
- # A value that nests without bound — a reference cycle necessarily
35
- # does — exhausts the packer's own recursion instead, which Ruby
36
- # reports outside +StandardError+. Mapping it keeps an unwritable
37
- # value a wire violation the dispatch boundary can answer, rather than
38
- # one that escapes every caller's rescue and traps the invocation.
39
- #
40
- # The refusal is spent once per thread: a thread that has absorbed one
41
- # such overflow aborts on the next instead of raising, and a Hash cycle
42
- # never reaches Ruby at all — the packer walks a Hash through C frames
43
- # that carry no stack guard. Bounding the walk before the packer is
44
- # handed the value is what would make the refusal repeatable.
34
+ # The caller bounds +value+'s nesting first (Nesting): the packer takes
35
+ # no depth limit and walks a list or map in frames that carry no stack
36
+ # guard, so a value nesting without end — a reference cycle necessarily
37
+ # does — exhausts the machine stack instead of raising.
45
38
  def self.encode(value)
46
39
  FACTORY.dump(value)
47
40
  rescue ::RangeError, ::NoMethodError => e
48
41
  raise UnsupportedTypeError, e.message
49
- rescue ::SystemStackError
50
- raise InvalidTypeError, "value nests deeper than this host can write (a reference cycle necessarily does)"
51
42
  end
52
43
  end
53
44
  end
@@ -95,7 +95,7 @@ module Kobako
95
95
  return unless depth > MAX_NESTING_DEPTH
96
96
 
97
97
  raise Kobako::SandboxError,
98
- "a #run argument nests deeper than #{MAX_NESTING_DEPTH} levels and " \
98
+ "a #run argument nests deeper than #{MAX_NESTING_DEPTH} levels within the Run payload and " \
99
99
  "cannot cross the sandbox boundary (possible reference cycle)"
100
100
  end
101
101
 
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "error"
4
+
5
+ module Kobako
6
+ module Codec
7
+ # The structural nesting bound
8
+ # ({docs/wire/payload-msgpack.md}[link:../../../docs/wire/payload-msgpack.md]
9
+ # § Structural Nesting Depth), checked before a value reaches the
10
+ # packer. The packer takes no depth limit and walks a list or map in
11
+ # frames that carry no stack guard, so a value it cannot finish — a
12
+ # reference cycle necessarily is one — must be refused before it is
13
+ # handed over.
14
+ module Nesting
15
+ # Raise InvalidTypeError when +value+ nests past MAX_NESTING_DEPTH; a
16
+ # value nested exactly to the bound passes.
17
+ def self.assert_within_bound!(value, depth = 0)
18
+ case value
19
+ when ::Array then assert_members_within_bound!(value, depth)
20
+ when ::Hash
21
+ assert_members_within_bound!(value.keys, depth)
22
+ assert_members_within_bound!(value.values, depth)
23
+ end
24
+ end
25
+
26
+ # Measure the members of one container at +depth+, each sitting one
27
+ # level deeper. A member is matched by class rather than asked about
28
+ # itself — it may be a BasicObject — and only one that could be a
29
+ # container is walked into.
30
+ def self.assert_members_within_bound!(members, depth)
31
+ return if members.empty?
32
+ if depth >= MAX_NESTING_DEPTH
33
+ raise InvalidTypeError,
34
+ "value nests deeper than #{MAX_NESTING_DEPTH} levels (a reference cycle necessarily does)"
35
+ end
36
+ return unless members.any?(::Enumerable)
37
+
38
+ members.grep(::Enumerable) { |member| assert_within_bound!(member, depth + 1) }
39
+ end
40
+ private_class_method :assert_members_within_bound!
41
+ end
42
+ end
43
+ end
data/lib/kobako/codec.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative "codec/error"
4
4
  require_relative "codec/utils"
5
5
  require_relative "codec/handle_walk"
6
+ require_relative "codec/nesting"
6
7
  require_relative "codec/state"
7
8
  require_relative "codec/ext_types"
8
9
  require_relative "codec/encoder"
@@ -29,8 +30,9 @@ module Kobako
29
30
  module Codec
30
31
  # The maximum structural nesting depth the wire represents (the
31
32
  # MessagePack ecosystem's bound), shared with the guest +kobako_codec+
32
- # so both sides cap identically. The host→guest wrap walk refuses a
33
- # +#run+ argument nesting past it — a reference cycle necessarily does.
33
+ # so both sides cap identically. The host refuses a value nesting past
34
+ # it — a reference cycle necessarily does — before handing it to the
35
+ # packer.
34
36
  MAX_NESTING_DEPTH = 128
35
37
 
36
38
  # Bracket a decode and return the block's result together with whether
@@ -236,6 +236,7 @@ module Kobako
236
236
  # known, instead of falling to the boundary's codec floor and reporting
237
237
  # as an exchange that produced no Service outcome.
238
238
  def encode_ok(value, handler)
239
+ Kobako::Codec::Nesting.assert_within_bound!(value)
239
240
  Kobako::Codec::Encoder.encode(value)
240
241
  rescue Kobako::Codec::UnsupportedTypeError
241
242
  encode_ok(wrap_as_handle(value, handler), handler)
@@ -54,10 +54,13 @@ module Kobako
54
54
  # invocation's table, sharing the same allocator the guest→host
55
55
  # return path uses. A wrapped leaf rides as ext 0x01 in its
56
56
  # original position (docs/wire/payload-msgpack.md § ext 0x01).
57
+ # The walk starts one level down, since +args+ and +kwargs+ ride
58
+ # inside the payload document the wire's nesting bound is counted
59
+ # from.
57
60
  def payload(handler)
58
61
  Payload::Arguments.new(
59
- args: Codec::HandleWalk.deep_wrap(args, handler),
60
- kwargs: Codec::HandleWalk.deep_wrap(kwargs, handler)
62
+ args: Codec::HandleWalk.deep_wrap(args, handler, 1),
63
+ kwargs: Codec::HandleWalk.deep_wrap(kwargs, handler, 1)
61
64
  ).encode
62
65
  end
63
66
 
@@ -94,11 +94,13 @@ module Kobako
94
94
 
95
95
  private
96
96
 
97
- # Encode what the Service is yielding. A value outside the wire type
98
- # set fails here, before the guest is re-entered, and is restated so
99
- # the Service reads a refusal of its own argument rather than a codec
100
- # class it never named.
97
+ # Encode what the Service is yielding. Arguments outside the wire
98
+ # type set, or nesting past the wire's bound as one list, fail here,
99
+ # before the guest is re-entered, and are restated so the Service
100
+ # reads a refusal of its own argument rather than a codec class it
101
+ # never named.
101
102
  def encode_args(args)
103
+ Kobako::Codec::Nesting.assert_within_bound!(args)
102
104
  Kobako::Codec::Encoder.encode(args)
103
105
  rescue Kobako::Codec::Error => e
104
106
  raise YieldValueError, "Service yielded a value the block cannot receive: #{e.message}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kobako
4
- VERSION = "0.25.0"
4
+ VERSION = "0.26.0"
5
5
  end
@@ -0,0 +1,9 @@
1
+ module Kobako
2
+ module Codec
3
+ module Nesting
4
+ def self.assert_within_bound!: (untyped value, ?Integer depth) -> void
5
+
6
+ def self.assert_members_within_bound!: (Array[untyped] members, Integer depth) -> void
7
+ end
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kobako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Aotokitsuruya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-14 00:00:00.000000000 Z
11
+ date: 2026-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -62,6 +62,7 @@ files:
62
62
  - lib/kobako/codec/error.rb
63
63
  - lib/kobako/codec/ext_types.rb
64
64
  - lib/kobako/codec/handle_walk.rb
65
+ - lib/kobako/codec/nesting.rb
65
66
  - lib/kobako/codec/state.rb
66
67
  - lib/kobako/codec/utils.rb
67
68
  - lib/kobako/context.rb
@@ -105,6 +106,7 @@ files:
105
106
  - sig/kobako/codec/error.rbs
106
107
  - sig/kobako/codec/ext_types.rbs
107
108
  - sig/kobako/codec/handle_walk.rbs
109
+ - sig/kobako/codec/nesting.rbs
108
110
  - sig/kobako/codec/state.rbs
109
111
  - sig/kobako/codec/utils.rbs
110
112
  - sig/kobako/context.rbs