kobako 0.30.0-aarch64-linux → 0.32.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.
Files changed (101) 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 +460 -0
  5. data/README.md +43 -4
  6. data/ROADMAP.md +1 -2
  7. data/crates/kobako-runtime/CHANGELOG.md +309 -0
  8. data/crates/kobako-runtime/README.md +7 -4
  9. data/crates/kobako-transport/CHANGELOG.md +38 -0
  10. data/crates/kobako-transport/README.md +3 -4
  11. data/crates/kobako-wasmtime/CHANGELOG.md +208 -0
  12. data/crates/kobako-wasmtime/README.md +4 -3
  13. data/crates/kobako-wasmtime/wit/deps/cli.wit +233 -0
  14. data/crates/kobako-wasmtime/wit/deps/clocks.wit +162 -0
  15. data/crates/kobako-wasmtime/wit/deps/filesystem.wit +589 -0
  16. data/crates/kobako-wasmtime/wit/deps/http.wit +733 -0
  17. data/crates/kobako-wasmtime/wit/deps/io.wit +299 -0
  18. data/crates/kobako-wasmtime/wit/deps/random.wit +92 -0
  19. data/crates/kobako-wasmtime/wit/deps/sockets.wit +949 -0
  20. data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +13 -0
  21. data/data/kobako.wasm +0 -0
  22. data/lib/kobako/3.3/kobako.so +0 -0
  23. data/lib/kobako/3.4/kobako.so +0 -0
  24. data/lib/kobako/4.0/kobako.so +0 -0
  25. data/lib/kobako/catalog/extensions.rb +14 -2
  26. data/lib/kobako/catalog/flags.rb +3 -5
  27. data/lib/kobako/catalog/grants.rb +5 -4
  28. data/lib/kobako/catalog/handles.rb +14 -32
  29. data/lib/kobako/catalog/mount.rb +11 -3
  30. data/lib/kobako/catalog/network.rb +35 -0
  31. data/lib/kobako/catalog/replacements.rb +28 -0
  32. data/lib/kobako/catalog/services.rb +5 -19
  33. data/lib/kobako/catalog/snippets.rb +3 -18
  34. data/lib/kobako/catalog.rb +3 -0
  35. data/lib/kobako/codec/{utils.rb → boundary.rb} +4 -2
  36. data/lib/kobako/codec/decoder.rb +5 -5
  37. data/lib/kobako/codec/ext_types.rb +3 -3
  38. data/lib/kobako/codec/handle_walk.rb +3 -43
  39. data/lib/kobako/codec/state.rb +2 -18
  40. data/lib/kobako/codec/value_budget.rb +133 -41
  41. data/lib/kobako/codec.rb +6 -7
  42. data/lib/kobako/context.rb +24 -11
  43. data/lib/kobako/errors.rb +18 -18
  44. data/lib/kobako/extension.rb +3 -2
  45. data/lib/kobako/filesystem.rb +10 -3
  46. data/lib/kobako/fork.rb +42 -0
  47. data/lib/kobako/handle.rb +2 -3
  48. data/lib/kobako/names.rb +28 -0
  49. data/lib/kobako/network.rb +210 -0
  50. data/lib/kobako/outcome.rb +7 -7
  51. data/lib/kobako/runtime.rb +3 -2
  52. data/lib/kobako/sandbox.rb +73 -35
  53. data/lib/kobako/sandbox_options.rb +42 -109
  54. data/lib/kobako/transport/argument_wrap.rb +64 -0
  55. data/lib/kobako/transport/block_failure.rb +1 -1
  56. data/lib/kobako/transport/dispatcher.rb +6 -6
  57. data/lib/kobako/transport/exposure.rb +26 -15
  58. data/lib/kobako/transport/reflection.rb +21 -4
  59. data/lib/kobako/transport/run.rb +8 -23
  60. data/lib/kobako/transport/yielder.rb +2 -9
  61. data/lib/kobako/transport.rb +1 -0
  62. data/lib/kobako/usage.rb +4 -2
  63. data/lib/kobako/version.rb +1 -1
  64. data/lib/kobako.rb +8 -4
  65. data/release-please-config.json +15 -0
  66. data/sig/kobako/catalog/extensions.rbs +2 -0
  67. data/sig/kobako/catalog/grants.rbs +7 -4
  68. data/sig/kobako/catalog/handles.rbs +2 -2
  69. data/sig/kobako/catalog/mount.rbs +3 -1
  70. data/sig/kobako/catalog/network.rbs +20 -0
  71. data/sig/kobako/catalog/replacements.rbs +14 -0
  72. data/sig/kobako/catalog/services.rbs +0 -4
  73. data/sig/kobako/catalog/snippets.rbs +0 -2
  74. data/sig/kobako/codec/{utils.rbs → boundary.rbs} +2 -2
  75. data/sig/kobako/codec/handle_walk.rbs +0 -6
  76. data/sig/kobako/codec/state.rbs +0 -4
  77. data/sig/kobako/codec/value_budget.rbs +48 -5
  78. data/sig/kobako/codec.rbs +2 -2
  79. data/sig/kobako/context.rbs +3 -1
  80. data/sig/kobako/errors.rbs +4 -7
  81. data/sig/kobako/filesystem.rbs +21 -3
  82. data/sig/kobako/fork.rbs +17 -0
  83. data/sig/kobako/network.rbs +115 -0
  84. data/sig/kobako/outcome.rbs +1 -1
  85. data/sig/kobako/runtime.rbs +32 -3
  86. data/sig/kobako/sandbox.rbs +10 -2
  87. data/sig/kobako/sandbox_options.rbs +29 -40
  88. data/sig/kobako/transport/argument_wrap.rbs +15 -0
  89. data/sig/kobako/transport/error.rbs +1 -1
  90. data/sig/kobako/transport/exposure.rbs +2 -4
  91. data/sig/kobako/transport/reflection.rbs +10 -0
  92. data/sig/kobako/transport/run.rbs +0 -2
  93. data/sig/kobako/transport/yielder.rbs +0 -3
  94. data/sig/kobako/transport.rbs +1 -1
  95. data/sig/kobako.rbs +13 -0
  96. metadata +25 -11
  97. data/crates/kobako-runtime/tests/linux_baseline/linux-baseline-expected.txt +0 -16
  98. data/lib/kobako/constant_name.rb +0 -8
  99. data/lib/kobako/pool.rb +0 -140
  100. data/sig/kobako/constant_name.rbs +0 -3
  101. data/sig/kobako/pool.rbs +0 -42
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.30.0
4
+ version: 0.32.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-11-07 00:00:00.000000000 Z
11
+ date: 2026-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.2
19
+ version: 1.8.6
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.8.2
29
+ version: 1.8.6
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'
@@ -39,6 +39,7 @@ executables: []
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
+ - ".githooks/linux-tests.sh"
42
43
  - ".release-please-manifest.json"
43
44
  - CHANGELOG.md
44
45
  - LICENSE
@@ -47,12 +48,18 @@ files:
47
48
  - SECURITY.md
48
49
  - crates/kobako-runtime/CHANGELOG.md
49
50
  - crates/kobako-runtime/README.md
50
- - crates/kobako-runtime/tests/linux_baseline/linux-baseline-expected.txt
51
51
  - crates/kobako-transport/CHANGELOG.md
52
52
  - crates/kobako-transport/README.md
53
53
  - crates/kobako-wasmtime/CHANGELOG.md
54
54
  - crates/kobako-wasmtime/README.md
55
55
  - crates/kobako-wasmtime/src/preview1/testsuite-expected.txt
56
+ - crates/kobako-wasmtime/wit/deps/cli.wit
57
+ - crates/kobako-wasmtime/wit/deps/clocks.wit
58
+ - crates/kobako-wasmtime/wit/deps/filesystem.wit
59
+ - crates/kobako-wasmtime/wit/deps/http.wit
60
+ - crates/kobako-wasmtime/wit/deps/io.wit
61
+ - crates/kobako-wasmtime/wit/deps/random.wit
62
+ - crates/kobako-wasmtime/wit/deps/sockets.wit
56
63
  - crates/kobako-wasmtime/witx/typenames.witx
57
64
  - crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx
58
65
  - data/kobako.wasm
@@ -67,9 +74,12 @@ files:
67
74
  - lib/kobako/catalog/grants.rb
68
75
  - lib/kobako/catalog/handles.rb
69
76
  - lib/kobako/catalog/mount.rb
77
+ - lib/kobako/catalog/network.rb
78
+ - lib/kobako/catalog/replacements.rb
70
79
  - lib/kobako/catalog/services.rb
71
80
  - lib/kobako/catalog/snippets.rb
72
81
  - lib/kobako/codec.rb
82
+ - lib/kobako/codec/boundary.rb
73
83
  - lib/kobako/codec/decoder.rb
74
84
  - lib/kobako/codec/encoder.rb
75
85
  - lib/kobako/codec/error.rb
@@ -77,19 +87,19 @@ files:
77
87
  - lib/kobako/codec/handle_walk.rb
78
88
  - lib/kobako/codec/nesting.rb
79
89
  - lib/kobako/codec/state.rb
80
- - lib/kobako/codec/utils.rb
81
90
  - lib/kobako/codec/value_budget.rb
82
- - lib/kobako/constant_name.rb
83
91
  - lib/kobako/context.rb
84
92
  - lib/kobako/errors.rb
85
93
  - lib/kobako/execution.rb
86
94
  - lib/kobako/extension.rb
87
95
  - lib/kobako/filesystem.rb
96
+ - lib/kobako/fork.rb
88
97
  - lib/kobako/handle.rb
98
+ - lib/kobako/names.rb
99
+ - lib/kobako/network.rb
89
100
  - lib/kobako/outcome.rb
90
101
  - lib/kobako/payload.rb
91
102
  - lib/kobako/payload/arguments.rb
92
- - lib/kobako/pool.rb
93
103
  - lib/kobako/runtime.rb
94
104
  - lib/kobako/sandbox.rb
95
105
  - lib/kobako/sandbox_options.rb
@@ -97,6 +107,7 @@ files:
97
107
  - lib/kobako/snippet/bytecode.rb
98
108
  - lib/kobako/snippet/source.rb
99
109
  - lib/kobako/transport.rb
110
+ - lib/kobako/transport/argument_wrap.rb
100
111
  - lib/kobako/transport/block_failure.rb
101
112
  - lib/kobako/transport/call.rb
102
113
  - lib/kobako/transport/dispatcher.rb
@@ -117,9 +128,12 @@ files:
117
128
  - sig/kobako/catalog/grants.rbs
118
129
  - sig/kobako/catalog/handles.rbs
119
130
  - sig/kobako/catalog/mount.rbs
131
+ - sig/kobako/catalog/network.rbs
132
+ - sig/kobako/catalog/replacements.rbs
120
133
  - sig/kobako/catalog/services.rbs
121
134
  - sig/kobako/catalog/snippets.rbs
122
135
  - sig/kobako/codec.rbs
136
+ - sig/kobako/codec/boundary.rbs
123
137
  - sig/kobako/codec/decoder.rbs
124
138
  - sig/kobako/codec/encoder.rbs
125
139
  - sig/kobako/codec/error.rbs
@@ -127,20 +141,19 @@ files:
127
141
  - sig/kobako/codec/handle_walk.rbs
128
142
  - sig/kobako/codec/nesting.rbs
129
143
  - sig/kobako/codec/state.rbs
130
- - sig/kobako/codec/utils.rbs
131
144
  - sig/kobako/codec/value_budget.rbs
132
- - sig/kobako/constant_name.rbs
133
145
  - sig/kobako/context.rbs
134
146
  - sig/kobako/errors.rbs
135
147
  - sig/kobako/execution.rbs
136
148
  - sig/kobako/extension.rbs
137
149
  - sig/kobako/filesystem.rbs
150
+ - sig/kobako/fork.rbs
138
151
  - sig/kobako/guest_yielder.rbs
139
152
  - sig/kobako/handle.rbs
153
+ - sig/kobako/network.rbs
140
154
  - sig/kobako/outcome.rbs
141
155
  - sig/kobako/payload.rbs
142
156
  - sig/kobako/payload/arguments.rbs
143
- - sig/kobako/pool.rbs
144
157
  - sig/kobako/runtime.rbs
145
158
  - sig/kobako/sandbox.rbs
146
159
  - sig/kobako/sandbox_options.rbs
@@ -149,6 +162,7 @@ files:
149
162
  - sig/kobako/snippet/bytecode.rbs
150
163
  - sig/kobako/snippet/source.rbs
151
164
  - sig/kobako/transport.rbs
165
+ - sig/kobako/transport/argument_wrap.rbs
152
166
  - sig/kobako/transport/block_failure.rbs
153
167
  - sig/kobako/transport/call.rbs
154
168
  - sig/kobako/transport/dispatcher.rbs
@@ -1,16 +0,0 @@
1
- # The differences from Linux known so far, one per line: the setup, then the
2
- # class a failure of tests/linux_baseline names, with what causes it after a `#`.
3
- # A line records a difference and settles nothing about it.
4
- overlay Rename from=g kobako=EXDEV linux=ok # a lower Layer's link is not copied up
5
- overlay Rename from=l kobako=EXDEV linux=ok # a lower Layer's link is not copied up
6
- overlay Rename from=n kobako=EXDEV linux=ok # a lower Layer's link is not copied up
7
- bind Utimes kobako=ENOTSUP linux=ok # a link keeps its own times
8
- overlay Utimes kobako=ENOTSUP linux=ok # a link keeps its own times
9
- policy Rename from=d kobako=EXDEV linux=ENOTDIR # a Policy answers for one path, not a tree
10
- policy Rename from=d kobako=EXDEV linux=ok # a Policy answers for one path, not a tree
11
- policy Rename from=n kobako=EXDEV linux=ENOTDIR # a Policy answers for one path, not a tree
12
- policy Rename from=n kobako=EXDEV linux=ok # a Policy answers for one path, not a tree
13
- policy Utimes kobako=EACCES linux=ok # a Policy judges a time as a change, where Landlock leaves it
14
- another-user Open kobako=EACCES linux=ok # a directory only readable or only searched: spelling a name and reading through it take more
15
- another-user Rename from=nor kobako=EACCES linux=ok # spelling a name in a directory only searched takes reading it
16
- another-user Stat kobako=EACCES linux=reg # spelling a name in a directory only searched takes reading it
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kobako
4
- # A bind-path segment, a snippet name and a #run entrypoint all take the
5
- # constant-name form, so they are refused alike. The guest interns each
6
- # one, and mruby holds a symbol of at most 65534 bytes.
7
- CONSTANT_NAME = /\A[A-Z]\w{0,65533}\z/ # :nodoc:
8
- end
data/lib/kobako/pool.rb DELETED
@@ -1,140 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "errors"
4
- require_relative "sandbox"
5
-
6
- module Kobako
7
- # A bounded set of warm, identically set-up Sandboxes, handed out to one
8
- # holder at a time. Every Sandbox it builds is kept: an invocation leaves
9
- # nothing behind, whatever ended it.
10
- class Pool
11
- # The default +checkout_timeout+: 5 seconds.
12
- DEFAULT_CHECKOUT_TIMEOUT_SECONDS = 5.0
13
-
14
- # Build a Pool of up to +slots+ Sandboxes, built on first demand with the
15
- # other keywords as Sandbox.new takes them. +checkout_timeout+ bounds how
16
- # many seconds #with waits, and +nil+ waits indefinitely. The block, if
17
- # given, sets up each Sandbox once, as with Sandbox#bind and
18
- # Sandbox#preload.
19
- #
20
- # Raises ArgumentError when +slots+ is not a positive Integer or
21
- # +checkout_timeout+ is not a positive finite number.
22
- def initialize(slots:, checkout_timeout: DEFAULT_CHECKOUT_TIMEOUT_SECONDS, **sandbox_options, &setup)
23
- validate_slots(slots)
24
- @slots = slots
25
- @checkout_timeout = normalize_checkout_timeout(checkout_timeout)
26
- @sandbox_options = sandbox_options
27
- @setup = setup
28
- @idle = [] # : Array[Kobako::Sandbox]
29
- @constructed = 0
30
- @mutex = Mutex.new
31
- @slot_freed = ConditionVariable.new
32
- end
33
-
34
- # Yield one exclusively-held Sandbox to the block and return the
35
- # block's value; the Sandbox returns to the pool however the block
36
- # exits. Raises PoolTimeoutError once every slot has stayed held past
37
- # +checkout_timeout+.
38
- def with
39
- sandbox = acquire
40
- begin
41
- yield sandbox
42
- ensure
43
- checkin(sandbox)
44
- end
45
- end
46
-
47
- private
48
-
49
- def acquire
50
- timeout = @checkout_timeout
51
- deadline = timeout && (monotonic_now + timeout)
52
- loop do
53
- action, sandbox = claim_or_wait(deadline)
54
- return sandbox if action == :idle && sandbox
55
- return construct_slot if action == :build
56
- end
57
- end
58
-
59
- # Waiting happens inside the lock (so a checkin can wake it);
60
- # construction happens outside (so a slow setup block never holds the
61
- # lock) — capacity is reserved here and released by +construct_slot+
62
- # on failure.
63
- def claim_or_wait(deadline)
64
- @mutex.synchronize do
65
- return [:idle, @idle.pop] unless @idle.empty?
66
-
67
- if @constructed < @slots
68
- @constructed += 1
69
- return [:build, nil]
70
- end
71
-
72
- await_slot(deadline)
73
- [:retry, nil]
74
- end
75
- end
76
-
77
- # Must run while holding +@mutex+.
78
- def await_slot(deadline)
79
- remaining = deadline && (deadline - monotonic_now)
80
- if remaining && remaining <= 0
81
- raise PoolTimeoutError,
82
- "no Sandbox returned within #{@checkout_timeout}s: all #{@slots} slots are held"
83
- end
84
-
85
- @slot_freed.wait(@mutex, remaining)
86
- end
87
-
88
- # A failed construction releases its reserved capacity so a later
89
- # checkout can retry.
90
- def construct_slot
91
- done = false
92
- sandbox = Sandbox.new(**@sandbox_options)
93
- @setup&.call(sandbox)
94
- done = true
95
- sandbox
96
- ensure
97
- release_capacity unless done
98
- end
99
-
100
- def checkin(sandbox)
101
- @mutex.synchronize do
102
- @idle.push(sandbox)
103
- @slot_freed.signal
104
- end
105
- end
106
-
107
- def release_capacity
108
- @mutex.synchronize do
109
- @constructed -= 1
110
- @slot_freed.signal
111
- end
112
- end
113
-
114
- # The wait deadline runs on the monotonic clock so a wall-clock jump
115
- # cannot stretch or cut the checkout wait.
116
- def monotonic_now
117
- Process.clock_gettime(Process::CLOCK_MONOTONIC)
118
- end
119
-
120
- def validate_slots(slots)
121
- return if slots.is_a?(Integer) && slots.positive?
122
-
123
- raise ArgumentError, "slots must be a positive Integer, got #{slots.inspect}"
124
- end
125
-
126
- def normalize_checkout_timeout(checkout_timeout)
127
- return nil if checkout_timeout.nil?
128
- unless checkout_timeout.is_a?(Numeric)
129
- raise ArgumentError, "checkout_timeout must be Numeric or nil, got #{checkout_timeout.inspect}"
130
- end
131
-
132
- seconds = checkout_timeout.to_f
133
- unless seconds.positive? && seconds.finite?
134
- raise ArgumentError, "checkout_timeout must be > 0 and finite (got #{checkout_timeout})"
135
- end
136
-
137
- seconds
138
- end
139
- end
140
- end
@@ -1,3 +0,0 @@
1
- module Kobako
2
- CONSTANT_NAME: Regexp
3
- end
data/sig/kobako/pool.rbs DELETED
@@ -1,42 +0,0 @@
1
- module Kobako
2
- class Pool
3
- DEFAULT_CHECKOUT_TIMEOUT_SECONDS: Float
4
-
5
- @slots: Integer
6
- @checkout_timeout: Float?
7
- @sandbox_options: Hash[Symbol, untyped]
8
- @setup: ^(Kobako::Sandbox) -> void | nil
9
- @idle: Array[Kobako::Sandbox]
10
- @constructed: Integer
11
- @mutex: Thread::Mutex
12
- @slot_freed: Thread::ConditionVariable
13
-
14
- def initialize: (
15
- slots: Integer,
16
- ?checkout_timeout: (Float | Integer)?,
17
- **untyped sandbox_options
18
- ) ?{ (Kobako::Sandbox) -> void } -> void
19
-
20
- def with: [T] () { (Kobako::Sandbox) -> T } -> T
21
-
22
- private
23
-
24
- def acquire: () -> Kobako::Sandbox
25
-
26
- def claim_or_wait: (Float? deadline) -> [Symbol, Kobako::Sandbox?]
27
-
28
- def await_slot: (Float? deadline) -> void
29
-
30
- def construct_slot: () -> Kobako::Sandbox
31
-
32
- def checkin: (Kobako::Sandbox sandbox) -> void
33
-
34
- def release_capacity: () -> void
35
-
36
- def monotonic_now: () -> Float
37
-
38
- def validate_slots: (untyped slots) -> void
39
-
40
- def normalize_checkout_timeout: ((Float | Integer)? checkout_timeout) -> Float?
41
- end
42
- end