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
@@ -9,15 +9,58 @@ module Kobako
9
9
 
10
10
  UINT: Hash[Integer, String]
11
11
 
12
- def self.assert_within: (String bytes, Integer? budget) -> void
12
+ FLOAT_FORMATS: Hash[Integer, String]
13
13
 
14
- private
14
+ FLOATS: Regexp
15
+
16
+ NAN_ENTRY: Integer
17
+
18
+ def self.assert_within: (String bytes, Integer budget) -> void
19
+
20
+ class Count
21
+ class OpenContainer < Struct[untyped]
22
+ attr_accessor held: Integer
23
+ attr_accessor keyed: bool
24
+ attr_accessor read: Integer
25
+ attr_accessor nan_keys: Integer
26
+ attr_accessor holds_nan: bool
27
+
28
+ def self.new: (Integer held, bool keyed, Integer read, Integer nan_keys, bool holds_nan) -> OpenContainer
29
+ end
30
+
31
+ @bytes: String
32
+ @budget: Integer
33
+ @remaining: Integer
34
+ @open: Array[OpenContainer]
35
+
36
+ @ended: bool
37
+
38
+ def initialize: (String bytes, Integer budget) -> void
39
+
40
+ def run: () -> void
15
41
 
16
- def self.step: (String bytes, Integer pos) -> [Integer?, Integer]
42
+ private
17
43
 
18
- def self.step_framed:(String bytes, Integer pos, Integer marker) -> [Integer?, Integer]
44
+ def count_value: (Integer pos, Integer children, bool keyed) -> void
45
+
46
+ def close_value: (bool holds_nan) -> void
47
+
48
+ def charge_key: (OpenContainer map) -> void
49
+
50
+ def spend: (Integer values) -> void
51
+
52
+ def nan?: (Integer pos) -> bool
53
+
54
+ def step: (Integer pos) -> [Integer?, Integer, bool]
55
+
56
+ def step_framed: (Integer pos, Integer marker) -> [Integer?, Integer, bool]
57
+
58
+ def uint: (Integer pos, Integer width) -> Integer
59
+ end
60
+
61
+ private
19
62
 
20
- def self.uint: (String bytes, Integer pos, Integer width) -> Integer
63
+ def self.within_by_size?: (String bytes, Integer budget) -> bool
21
64
  end
22
65
  end
23
66
  end
data/sig/kobako/codec.rbs CHANGED
@@ -2,6 +2,8 @@ module Kobako
2
2
  module Codec
3
3
  MAX_NESTING_DEPTH: Integer
4
4
 
5
+ MAX_PAYLOAD_VALUES: Integer
6
+
5
7
  # A value in the closed wire type set: the scalar leaves, a Capability Handle, and Array / Hash
6
8
  # containers of the same. The by-value payloads that cross the wire —
7
9
  # dispatch arguments and success values — inhabit this type; a Fault is
@@ -13,8 +15,6 @@ module Kobako
13
15
 
14
16
  def self.track_handles: [T] { () -> T } -> [T, bool]
15
17
 
16
- def self.within_value_budget: [T] (Integer? budget) { () -> T } -> T
17
-
18
18
  # The Handle allocator/resolver a wire walk works against: alloc
19
19
  # registers a non-wire-representable object and returns its Handle,
20
20
  # fetch resolves a wire Handle id back to the live object. The
@@ -2,7 +2,7 @@ module Kobako
2
2
  class Context
3
3
  type preamble = [Array[String], Array[Kobako::Catalog::Snippets::tuple], Array[Kobako::Catalog::Flags::tuple]]
4
4
 
5
- @mounts: Hash[String, Kobako::Catalog::Mount]?
5
+ @replacements: Kobako::Catalog::Replacements
6
6
 
7
7
  def initialize: (
8
8
  runtime: Kobako::Runtime,
@@ -16,6 +16,8 @@ module Kobako
16
16
 
17
17
  def mount: (String at, Kobako::Filesystem::mountable filesystem, ?access: Kobako::Filesystem::access) ?{ (String path, Kobako::Filesystem::access access) -> boolish } -> self
18
18
 
19
+ def network: (Symbol | String name, ?untyped entry) ?{ (Kobako::Network::Builder) -> void } -> self
20
+
19
21
  def lookup: (Symbol | String path) -> Kobako::Transport::Exposure
20
22
 
21
23
  def eval: (String code) ?{ (Kobako::Context) -> void } -> Kobako::Execution
@@ -21,18 +21,18 @@ module Kobako
21
21
  class SetupError < Error
22
22
  end
23
23
 
24
- class ModuleNotBuiltError < SetupError
24
+ class GuestBinaryNotFoundError < SetupError
25
25
  end
26
26
 
27
27
  module Diagnosable : Error
28
28
  attr_reader origin: String?
29
- attr_reader klass: String?
29
+ attr_reader class_name: String?
30
30
  attr_reader backtrace_lines: Array[String]?
31
31
 
32
32
  def initialize: (
33
33
  String message,
34
34
  ?origin: String?,
35
- ?klass: String?,
35
+ ?class_name: String?,
36
36
  ?backtrace_lines: Array[String]?
37
37
  ) -> void
38
38
  end
@@ -81,11 +81,8 @@ module Kobako
81
81
  ?name: Symbol?,
82
82
  ?available: Array[Symbol],
83
83
  ?origin: String?,
84
- ?klass: String?,
84
+ ?class_name: String?,
85
85
  ?backtrace_lines: Array[String]?
86
86
  ) -> void
87
87
  end
88
-
89
- class PoolTimeoutError < Error
90
- end
91
88
  end
@@ -4,14 +4,21 @@ module Kobako
4
4
 
5
5
  type access = :read | :read_write
6
6
 
7
+ def self.validate_mount: (untyped at, untyped access, untyped filesystem) -> nil
8
+
7
9
  # What a Filesystem written in Ruby answers to be mounted. One that
8
10
  # also answers _Listable lists its directories, and one answering
9
11
  # _Writable takes changes too; each method it lacks is refused alone.
12
+ # One answering _Exclusive vouches only the guest changes it.
10
13
  interface _Readable
11
14
  def open: (String path, Integer flags) -> _File
12
15
  def stat: (String path) -> _Stat
13
16
  end
14
17
 
18
+ interface _Exclusive
19
+ def exclusive?: () -> boolish
20
+ end
21
+
15
22
  interface _Listable
16
23
  def children: (String path) -> Array[String]
17
24
  end
@@ -58,8 +65,9 @@ module Kobako
58
65
 
59
66
  # What a Filesystem written in Ruby's +stat+ answers, as +File::Stat+
60
67
  # does; an +ino+ of zero names no identity. One that also answers
61
- # _StatDevice names the device its +ino+ belongs to, and _StatKind says
62
- # a special file is one.
68
+ # _StatDevice names the device its +ino+ belongs to, _StatKind says a
69
+ # special file is one, _StatTimes gives its times, and _StatLinks its
70
+ # count of names.
63
71
  interface _Stat
64
72
  def directory?: () -> boolish
65
73
  def size: () -> Integer
@@ -74,6 +82,16 @@ module Kobako
74
82
  def ftype: () -> String
75
83
  end
76
84
 
85
+ interface _StatTimes
86
+ def atime: () -> Time
87
+ def mtime: () -> Time
88
+ def ctime: () -> Time
89
+ end
90
+
91
+ interface _StatLinks
92
+ def nlink: () -> Integer
93
+ end
94
+
77
95
  class Tmpfs
78
96
  # A bare <tt>"path" => contents</tt> arrives as keywords, which RBS
79
97
  # cannot key by String; a Symbol keyword past +size+ and +nr_inodes+
@@ -82,7 +100,7 @@ module Kobako
82
100
  end
83
101
 
84
102
  class Bind
85
- def initialize: (String path) -> void
103
+ def initialize: (String path, ?exclusive: bool) -> void
86
104
  end
87
105
 
88
106
  class Overlay
@@ -0,0 +1,17 @@
1
+ module Kobako
2
+ module Fork
3
+ module Hook
4
+ def _fork: () -> Integer
5
+
6
+ def daemon: (?boolish nochdir, ?boolish noclose) -> 0
7
+ end
8
+
9
+ def self.around: [T] () { () -> T } -> T
10
+
11
+ def self.install: () -> void
12
+
13
+ def self.prepare: () -> void
14
+
15
+ def self.release: () -> void
16
+ end
17
+ end
@@ -0,0 +1,115 @@
1
+ module Kobako
2
+ module Network
3
+ type protocol = :http | :tcp | :udp
4
+
5
+ UNWRITTEN: Object
6
+
7
+ def self.normalize_endpoint: (untyped host, untyped port, Hash[Symbol, untyped] written) ->
8
+ [String, Integer, protocol, Array[Symbol | String | IPAddr], Array[HttpRule]]
9
+
10
+ def self.normalize_rule: (bool allow, untyped method, untyped path) -> [bool, String?, String]
11
+
12
+ def self.normalize_credential: (Symbol | String placement, untyped placeholder) -> String
13
+
14
+ def self.validate_name: (String name) -> nil
15
+
16
+ class Mock
17
+ def initialize: (?local_addresses: Array[String]?) -> void
18
+
19
+ def resolve: (String name, to: String | Array[String]) -> nil
20
+
21
+ def route: (String address, Integer port, to: [String, Integer], ?protocol: :tcp | :udp) -> nil
22
+
23
+ def refuse: (String address, Integer port, singleton(SystemCallError) errno, ?protocol: :tcp | :udp) -> nil
24
+
25
+ def hold: [T] (String name) { () -> T } -> T
26
+
27
+ def lookups: () -> Array[String]
28
+
29
+ def dialed_addresses: () -> Array[[String, Integer]]
30
+ end
31
+
32
+ class Endpoint < Data
33
+ attr_reader host: String
34
+ attr_reader port: Integer
35
+ attr_reader protocol: protocol
36
+ attr_reader addresses: Array[Symbol | String | IPAddr]
37
+ attr_reader rules: Array[HttpRule]
38
+
39
+ def self.new: (host: untyped, port: untyped, ?protocol: untyped, ?addresses: untyped, ?rules: untyped) -> Endpoint
40
+
41
+ def initialize: (host: untyped, port: untyped, ?protocol: untyped, ?addresses: untyped, ?rules: untyped) -> void
42
+ end
43
+
44
+ class Connection < Data
45
+ attr_reader host: String
46
+ attr_reader port: Integer
47
+ attr_reader protocol: protocol
48
+
49
+ def self.new: (host: String, port: Integer, protocol: protocol) -> Connection
50
+ end
51
+
52
+ class HttpRule
53
+ @allow: bool
54
+
55
+ def allow?: () -> bool
56
+ attr_reader method: String?
57
+ attr_reader path: String
58
+
59
+ def initialize: (allow: boolish, method: untyped, path: untyped) -> void
60
+ end
61
+
62
+ class Rules
63
+ @rules: Array[HttpRule]
64
+
65
+ def initialize: () -> void
66
+
67
+ def allow: (untyped method, untyped path) -> self
68
+
69
+ def deny: (untyped method, untyped path) -> self
70
+
71
+ def to_a: () -> Array[HttpRule]
72
+ end
73
+
74
+ class Credential
75
+ @source: ^(Request) -> String?
76
+
77
+ attr_reader placement: Symbol | String
78
+ attr_reader placeholder: String
79
+
80
+ def initialize: (Symbol | String placement, placeholder: untyped) ?{ (Request) -> String? } -> void
81
+
82
+ def value: (Request request) -> String?
83
+ end
84
+
85
+ class Request
86
+ attr_reader host: String
87
+ attr_reader port: Integer
88
+ attr_reader method: String
89
+ attr_reader scheme: String
90
+ attr_reader path: String
91
+ attr_reader header_names: Array[String]
92
+
93
+ def initialize: ([String, Integer] authority, String method, String scheme, String path, Array[String] header_names) -> void
94
+ end
95
+
96
+ class Builder
97
+ HOOKS: Array[Symbol]
98
+
99
+ @entry: untyped
100
+ @endpoints: Array[Endpoint]
101
+ @policies: Hash[Symbol, Array[^(untyped) -> boolish]]
102
+ @credentials: Array[Credential]
103
+
104
+ def initialize: (?untyped entry) -> void
105
+
106
+ def credential: (Symbol | String placement, placeholder: untyped) ?{ (Request) -> String? } -> self
107
+
108
+ def endpoint: (untyped host, port: untyped, ?protocol: untyped, ?addresses: untyped) ?{ (Rules) -> void } -> self
109
+
110
+ def policy: (Symbol hook) ?{ (untyped) -> boolish } -> self
111
+
112
+ def to_native: () -> [untyped, Array[Endpoint], Array[Credential], Hash[Symbol, Array[^(untyped) -> boolish]]]
113
+ end
114
+ end
115
+ end
@@ -12,7 +12,7 @@ module Kobako
12
12
 
13
13
  def self.panic_error: (panic_fields panic, Symbol? entrypoint) -> (SandboxError | ServiceError)
14
14
 
15
- def self.error_class: (String origin, String klass) -> (singleton(SandboxError) | singleton(ServiceError))
15
+ def self.error_class: (String origin, String class_name) -> (singleton(SandboxError) | singleton(ServiceError))
16
16
 
17
17
  def self.decode_value: (String payload) -> Kobako::Codec::wire_value
18
18
 
@@ -2,7 +2,30 @@ module Kobako
2
2
  class Runtime
3
3
  def self.default_path: () -> String
4
4
 
5
- def self.validate_mount: (untyped at, untyped access, untyped filesystem) -> nil
5
+ def self.default_options: () -> {
6
+ timeout: Float?,
7
+ setup_timeout: Float?,
8
+ memory_limit: Integer?,
9
+ stdout_limit: Integer?,
10
+ stderr_limit: Integer?,
11
+ open_file_limit: Integer?,
12
+ open_connection_limit: Integer?,
13
+ connection_limit: Integer?,
14
+ profile: Symbol,
15
+ gvl: Symbol,
16
+ network: nil
17
+ }
18
+
19
+ def self.normalize_caps: (Hash[Symbol, untyped] caps) -> {
20
+ timeout: Float?,
21
+ setup_timeout: Float?,
22
+ memory_limit: Integer?,
23
+ stdout_limit: Integer?,
24
+ stderr_limit: Integer?,
25
+ open_file_limit: Integer?,
26
+ open_connection_limit: Integer?,
27
+ connection_limit: Integer?
28
+ }
6
29
 
7
30
  def self.from_path: (
8
31
  String path,
@@ -12,15 +35,19 @@ module Kobako
12
35
  stdout_limit: Integer?,
13
36
  stderr_limit: Integer?,
14
37
  open_file_limit: Integer?,
38
+ open_connection_limit: Integer?,
39
+ connection_limit: Integer?,
15
40
  profile: Symbol,
16
- gvl: Symbol
41
+ gvl: Symbol,
42
+ network: Network::Mock?
17
43
  ) -> Runtime
18
44
 
19
45
  type setup = [
20
46
  Array[String],
21
47
  Array[Kobako::Catalog::Snippets::tuple],
22
48
  Array[Kobako::Catalog::Flags::tuple],
23
- Array[Kobako::Catalog::Mount::tuple]
49
+ Array[Kobako::Catalog::Mount::tuple],
50
+ Array[Kobako::Catalog::Network::tuple]
24
51
  ]
25
52
 
26
53
  def eval: (Kobako::Transport::dispatch_proc dispatch, setup setup, String source) -> Kobako::Snapshot
@@ -35,5 +62,7 @@ module Kobako
35
62
  def profile: () -> Symbol
36
63
 
37
64
  def compile: (Kobako::Context::preamble preamble) -> Array[String]?
65
+
66
+ def stat: () -> Hash[Symbol, Integer]
38
67
  end
39
68
  end
@@ -12,11 +12,14 @@ module Kobako
12
12
  def stdout_limit: () -> Integer?
13
13
  def stderr_limit: () -> Integer?
14
14
  def open_file_limit: () -> Integer?
15
+ def open_connection_limit: () -> Integer?
16
+ def connection_limit: () -> Integer?
15
17
  def profile: () -> Symbol
16
18
  def gvl: () -> Symbol
17
19
 
18
- # Every keyword beyond wasm_path forwards verbatim to
19
- # SandboxOptions.new (the caps + the profile floor).
20
+ # Every keyword beyond wasm_path lands on the runtime's defaults for
21
+ # SandboxOptions.new; the runtime judges the profile, the mode, and the
22
+ # floor.
20
23
  def initialize: (
21
24
  ?wasm_path: String?,
22
25
  **untyped options
@@ -28,6 +31,8 @@ module Kobako
28
31
 
29
32
  def mount: (String at, Kobako::Filesystem::mountable filesystem, ?access: Kobako::Filesystem::access) ?{ (String path, Kobako::Filesystem::access access) -> boolish } -> Kobako::Sandbox
30
33
 
34
+ def network: (Symbol | String name, ?untyped entry) ?{ (Kobako::Network::Builder) -> void } -> Kobako::Sandbox
35
+
31
36
  def preload: (code: String, name: Symbol | String) -> Kobako::Sandbox
32
37
  | (binary: String) -> Kobako::Sandbox
33
38
 
@@ -37,6 +42,9 @@ module Kobako
37
42
 
38
43
  def eval: (String code) ?{ (Kobako::Context) -> void } -> Kobako::Execution
39
44
 
45
+ def stat: () -> Hash[Symbol, Integer]
46
+ | (Symbol key) -> Integer
47
+
40
48
  private
41
49
 
42
50
  def build_runtime: () -> Kobako::Runtime
@@ -1,45 +1,43 @@
1
1
  module Kobako
2
2
  class SandboxOptions < Data
3
- DEFAULT_TIMEOUT_SECONDS: Float
4
- DEFAULT_SETUP_TIMEOUT_SECONDS: Float
5
- DEFAULT_MEMORY_LIMIT: Integer
6
- DEFAULT_OUTPUT_LIMIT: Integer
7
- DEFAULT_OPEN_FILE_LIMIT: Integer
8
- DEFAULT_PROFILE: Symbol
9
- PROFILES: Array[Symbol]
10
- GVL_MODES: Array[Symbol]
11
- DEFAULT_GVL: Symbol
12
- VALUE_BYTES: Integer
13
-
14
3
  attr_reader timeout: Float?
15
4
  attr_reader setup_timeout: Float?
16
5
  attr_reader memory_limit: Integer?
17
6
  attr_reader stdout_limit: Integer?
18
7
  attr_reader stderr_limit: Integer?
19
8
  attr_reader open_file_limit: Integer?
9
+ attr_reader open_connection_limit: Integer?
10
+ attr_reader connection_limit: Integer?
20
11
  attr_reader profile: Symbol
21
12
  attr_reader gvl: Symbol
13
+ attr_reader network: Network::Mock?
22
14
 
23
15
  def self.new: (
24
- ?timeout: (Float | Integer)?,
25
- ?setup_timeout: (Float | Integer)?,
26
- ?memory_limit: Integer?,
27
- ?stdout_limit: Integer?,
28
- ?stderr_limit: Integer?,
29
- ?open_file_limit: Integer?,
30
- ?profile: Symbol,
31
- ?gvl: Symbol
16
+ timeout: (Float | Integer)?,
17
+ setup_timeout: (Float | Integer)?,
18
+ memory_limit: Integer?,
19
+ stdout_limit: Integer?,
20
+ stderr_limit: Integer?,
21
+ open_file_limit: Integer?,
22
+ open_connection_limit: Integer?,
23
+ connection_limit: Integer?,
24
+ profile: Symbol,
25
+ gvl: Symbol,
26
+ network: Network::Mock?
32
27
  ) -> SandboxOptions
33
28
 
34
29
  def initialize: (
35
- ?timeout: (Float | Integer)?,
36
- ?setup_timeout: (Float | Integer)?,
37
- ?memory_limit: Integer?,
38
- ?stdout_limit: Integer?,
39
- ?stderr_limit: Integer?,
40
- ?open_file_limit: Integer?,
41
- ?profile: Symbol,
42
- ?gvl: Symbol
30
+ timeout: (Float | Integer)?,
31
+ setup_timeout: (Float | Integer)?,
32
+ memory_limit: Integer?,
33
+ stdout_limit: Integer?,
34
+ stderr_limit: Integer?,
35
+ open_file_limit: Integer?,
36
+ open_connection_limit: Integer?,
37
+ connection_limit: Integer?,
38
+ profile: Symbol,
39
+ gvl: Symbol,
40
+ network: Network::Mock?
43
41
  ) -> void
44
42
 
45
43
  def to_h: () -> {
@@ -49,20 +47,11 @@ module Kobako
49
47
  stdout_limit: Integer?,
50
48
  stderr_limit: Integer?,
51
49
  open_file_limit: Integer?,
50
+ open_connection_limit: Integer?,
51
+ connection_limit: Integer?,
52
52
  profile: Symbol,
53
- gvl: Symbol
53
+ gvl: Symbol,
54
+ network: Network::Mock?
54
55
  }
55
-
56
- def value_budget: () -> Integer?
57
-
58
- def enforce_floor: (Symbol declared) -> void
59
-
60
- private
61
-
62
- def normalize_timeout: ((Float | Integer)? timeout, String name) -> Float?
63
-
64
- def normalize_limit: (Integer? limit, String name) -> Integer?
65
-
66
- def normalize_choice: (untyped value, Array[Symbol] choices, String name) -> Symbol
67
56
  end
68
57
  end
@@ -0,0 +1,15 @@
1
+ module Kobako
2
+ module Transport
3
+ module ArgumentWrap
4
+ def self.wrap: (untyped value, Kobako::Codec::_HandleTable handles, ?Integer depth) -> untyped
5
+
6
+ private
7
+
8
+ def self.refuse_past_nesting: (Integer depth) -> void
9
+
10
+ def self.wrap_leaf: (untyped value, Kobako::Codec::_HandleTable handles) -> untyped
11
+
12
+ def self.wrap_hash: (Hash[untyped, untyped] hash, Kobako::Codec::_HandleTable handles, Integer depth) -> Hash[untyped, untyped]
13
+ end
14
+ end
15
+ end
@@ -7,7 +7,7 @@ module Kobako
7
7
  String message,
8
8
  ?diagnostic: String?,
9
9
  ?origin: String?,
10
- ?klass: String?,
10
+ ?class_name: String?,
11
11
  ?backtrace_lines: Array[String]?
12
12
  ) -> void
13
13
 
@@ -2,10 +2,6 @@ module Kobako
2
2
  module Transport
3
3
  class Exposure < Data
4
4
  PREDICATE: Symbol
5
- CLASS_OF: UnboundMethod
6
- SINGLETON_CLASS_OF: UnboundMethod
7
- SINGLETON_METHODS: UnboundMethod
8
- PRIVATE_METHODS: UnboundMethod
9
5
  CALLABLE: Set[Symbol]
10
6
  NOTHING: Set[Symbol]
11
7
 
@@ -17,6 +13,8 @@ module Kobako
17
13
 
18
14
  def self.of: (untyped object, ?Hash[Module, Set[Symbol]] surfaces) -> Exposure
19
15
 
16
+ def self.refused_class_of: (untyped object) -> Module?
17
+
20
18
  def initialize: (object: untyped, names: Set[Symbol]?) -> void
21
19
 
22
20
  def with: (?object: untyped, ?names: Set[Symbol]?) -> Exposure
@@ -3,6 +3,14 @@ module Kobako
3
3
  module Reflection
4
4
  GADGET_OWNERS: Array[Module]
5
5
  CALLABLE_ALLOW: Array[Symbol]
6
+ CLASS_OF: UnboundMethod
7
+ IS_A: UnboundMethod
8
+ SINGLETON_CLASS_OF: UnboundMethod
9
+ SINGLETON_METHODS: UnboundMethod
10
+ PRIVATE_METHODS: UnboundMethod
11
+ RESPOND_TO: UnboundMethod
12
+ PUBLIC_SEND: UnboundMethod
13
+ SEND: UnboundMethod
6
14
 
7
15
  def self.refusal: (Kobako::Transport::Exposure exposure, Symbol name) -> String?
8
16
 
@@ -24,6 +32,8 @@ module Kobako
24
32
 
25
33
  def self.lookup_class: (untyped target) -> Module
26
34
 
35
+ def self.module?: (untyped target) -> bool
36
+
27
37
  def self.ambient_owner?: (Module owner, untyped target) -> bool
28
38
  end
29
39
  end
@@ -13,8 +13,6 @@ module Kobako
13
13
 
14
14
  private
15
15
 
16
- def normalize_entrypoint: (Symbol | String target) -> Symbol
17
-
18
16
  def validate_args: (Array[untyped] args) -> void
19
17
 
20
18
  def validate_kwargs: (Hash[untyped, untyped] kwargs) -> void
@@ -5,7 +5,6 @@ module Kobako
5
5
  @break_tag: Symbol
6
6
  @handles: Kobako::Codec::_HandleTable
7
7
  @failure: Kobako::Transport::BlockFailure
8
- @active: bool
9
8
 
10
9
  def initialize: (Kobako::Transport::_GuestYielder guest_yielder, Symbol break_tag, Kobako::Codec::_HandleTable handles, Kobako::Transport::BlockFailure failure) -> void
11
10
 
@@ -13,8 +12,6 @@ module Kobako
13
12
 
14
13
  def to_proc: () -> Proc
15
14
 
16
- def invalidate: () -> void
17
-
18
15
  private
19
16
 
20
17
  def encode_args: (Array[untyped] args) -> String
@@ -2,7 +2,7 @@ module Kobako
2
2
  module Transport
3
3
  # The guest re-entry callable a dispatch hands to a Yielder: invoked
4
4
  # with the encoded yield args, it returns the decoded Yield Reply as an
5
- # +[arm, body, klass]+ triple.
5
+ # +[arm, body, class_name]+ triple.
6
6
  # The ext's Kobako::GuestYielder is the production conformer;
7
7
  # modelled structurally so the Transport layer needs no upward
8
8
  # dependency on Runtime.
data/sig/kobako.rbs CHANGED
@@ -1,2 +1,15 @@
1
1
  module Kobako
2
+ def self.to_name: (untyped name, String what) -> String
3
+
4
+ def self.to_constant_name: (untyped name, String what) -> Symbol
5
+
6
+ def self.constant_name?: (String name) -> bool
7
+
8
+ def self.constant_path?: (String path) -> bool
9
+
10
+ def self.reserved_path?: (String path) -> bool
11
+
12
+ def self.paths_collide?: (String path, String bound) -> bool
13
+
14
+ def self.max_handle_id: () -> Integer
2
15
  end