microsandbox-rb 0.9.1 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9a11efe93577fa841e3825418b7ea2bdd27cadd404d64f750ef060fa255d4bc
4
- data.tar.gz: 9ccca9426b0ddefed890528408775068244959e69400497c904ffb2d408c27a5
3
+ metadata.gz: d4f3171c79d1e74d8a86a8ace5b5b53a61e1bbbbf32b0e20f3c0bb183b5c9014
4
+ data.tar.gz: 56de5a8367c3a42ea28684410aa902336d9d965f6eac0fd581de699511b9cfe2
5
5
  SHA512:
6
- metadata.gz: 6cc9f1524466a9e910ee21aabcefbf62a8abfa79625d1bdd7a7a37fc634db018a8d8efa277613691d69b153fed22d1d5fcaf493ecbaac629b1b1a866e861461e
7
- data.tar.gz: c36aa8379159eead35e062c4f282a34deb3957dbf93a34ed48d395ef9e52c96a7f3343a145f24f3418fe25a5a8e1dfc64d23b8514845d80090a14161739e43c3
6
+ metadata.gz: 6db8b2a9bc3b4a1160893351efa894d5beb59ec878c9a103fb9317a32b3c879c9b6e0bebbd75ea157e75c1702b013672c78d1a0c65d925c4e210aa4e0d018f64
7
+ data.tar.gz: bc09f708ec77732a5fe91c96fd46cf369fd98dd0752ad380fcba821d34bb80779151886fa7c728e74d70684af1fe4bc76c53abc2ca45c0b22e9e5e5da600001e
data/CHANGELOG.md CHANGED
@@ -6,6 +6,117 @@ All notable changes to this gem are documented here. The format is based on
6
6
  microsandbox runtime it embeds; each release notes the upstream runtime tag it
7
7
  wraps, and the README's Versioning section keeps the full gem→runtime map.
8
8
 
9
+ ## [0.10.0] - 2026-07-09
10
+
11
+ Ruby bindings for the additive `v0.6.6` SDK surface (upstream #1099 / #1128),
12
+ bringing the gem to parity with the Python and Node SDKs, which already ship
13
+ this API. The embedded runtime tag is unchanged (`v0.6.6`); this is a pure
14
+ binding addition with no breaking change.
15
+
16
+ ### Added
17
+
18
+ - **Live sandbox modification** — `Sandbox#modify` and `SandboxHandle#modify`
19
+ plan or apply a change to a running (or stopped) sandbox without recreating
20
+ it: resize CPU/memory (`cpus:`, `max_cpus:`, `memory:`, `max_memory:`, MiB),
21
+ adjust `env:`/`remove_env:`, `labels:`/`remove_labels:`, and `workdir:`, and
22
+ rotate/remove secrets (`secrets:` keyed by name with mutually-exclusive
23
+ `env:`/`store:`/`value:` plus `placeholder:`/`allowed_hosts:`,
24
+ `remove_secrets:`). `policy:` selects `:no_restart` (default), `:next_start`,
25
+ or `:restart`; `dry_run: true` computes the plan without applying it. Returns
26
+ a typed `ModificationPlan` (`#sandbox`, `#status`, `#applied?`, `#policy`,
27
+ `#changes`, `#conflicts`, `#warnings`, `#resize_status`) whose nested entries
28
+ are frozen, symbol-keyed Hashes carrying the runtime's canonical snake_case
29
+ fields verbatim.
30
+ - **Health checks** — `Sandbox#ping` / `SandboxHandle#ping` return a
31
+ `PingResult` (`#name`, `#latency` in seconds, `#latency_ms`) confirming the
32
+ guest agent is reachable **without** refreshing the idle timer; `#touch`
33
+ returns a `TouchResult` (`#name`, `#activity_seq`) that explicitly refreshes
34
+ the idle-activity timer. On the handle, both raise `SandboxNotRunningError`
35
+ for a stopped sandbox (it is not started implicitly).
36
+ - **Create-time resource ceilings** — `Sandbox.create` accepts `max_cpus:` and
37
+ `max_memory:` (MiB), the boot-time maxima a later live `modify` can grow up
38
+ to (each defaults to its `cpus:`/`memory:` value and must be >= it).
39
+ - **`SandboxNotRunningError`** is now raised by the runtime's not-running guard
40
+ (the class already existed; the new core `SandboxNotRunning` variant is now
41
+ mapped to it instead of falling back to the base `Error`).
42
+
43
+ Deliberately **not** exposed, matching the Python and Node SDKs (both surface
44
+ these only through the CLI): `modify`'s `oci_upper_size` overlay-grow field, and
45
+ the `SandboxMetricsReport` / per-sandbox metrics-report helpers.
46
+
47
+ ## [0.9.3] - 2026-07-09
48
+
49
+ Adopts upstream runtime **`v0.6.3` → `v0.6.6`** (spanning upstream `v0.6.4` and
50
+ `v0.6.6`; `v0.6.5` was yanked upstream — its GitHub release was pulled and the
51
+ type-model refactor it shipped, #1014, was reverted in `v0.6.6`, #1143). The
52
+ upstream SDK crate's public API grew only *additive* surface (live
53
+ modify/resize, ping/touch — Ruby bindings for these land in the next minor),
54
+ so this is a pure runtime bump with no Ruby API change.
55
+
56
+ ### Fixed
57
+
58
+ - **Snapshot restore survives upstream tag republishes** (upstream #1130):
59
+ restore now pulls the OCI image by its pinned manifest digest
60
+ (`<repo>@sha256:…`) instead of re-resolving the mutable tag, fixing a fatal
61
+ `v0.6.3` regression where a republished base-image tag made existing
62
+ snapshots unrestorable.
63
+ - **Fragmented UDP and PMTU relay traffic is forwarded correctly** (upstream
64
+ #1086) by the sandbox network relay.
65
+ - **`exec` termination kills the whole process group, not just the direct
66
+ child** (upstream #1104): guest commands that spawn children (e.g. shell
67
+ pipelines) no longer leave orphaned grandchildren running after a kill.
68
+ - **Stop waits tolerate ephemeral cleanup** (upstream #1087, inherited in
69
+ `Sandbox#stop`/`SandboxHandle#wait_until_stopped`): if an ephemeral
70
+ sandbox's persisted state is cleaned up while a stop wait is in flight, the
71
+ wait now resolves to a synthetic `stopped` result instead of raising
72
+ `SandboxNotFoundError`. Persistent sandboxes are unaffected.
73
+ - **Filesystem snapshot `readdir` streams entries** (upstream #1133), fixing
74
+ unbounded memory growth (RSS leak) when listing very large directories.
75
+
76
+ ### Changed
77
+
78
+ - **Embedded runtime is now `v0.6.6`** (`Microsandbox::RUNTIME_VERSION` /
79
+ `Microsandbox.runtime_version`). Also inherited:
80
+ - `Sandbox.create`/`.start` persist an active-config snapshot of the booted
81
+ sandbox in the runtime database (upstream SDK behavior; groundwork for
82
+ live modification).
83
+ - The runtime's shutdown flush timeout can be overridden via the
84
+ `MSB_SHUTDOWN_FLUSH_TIMEOUT_MS` environment variable (upstream #1088).
85
+ - The prebuilt `msb` binary gains `modify`/`ping`/`restart`/`touch`
86
+ subcommands and `metrics --watch`; these are CLI-level for now — the
87
+ corresponding Ruby APIs (`#modify`, `#ping`, `#touch`) ship in the next
88
+ minor release.
89
+
90
+ ## [0.9.2] - 2026-07-08
91
+
92
+ Adopts upstream runtime **`v0.6.2` → `v0.6.3`**. No Ruby API change; the
93
+ native glue moves to the explicit-backend variants of a few SDK calls that
94
+ went "ambient config" upstream (#1091).
95
+
96
+ ### Fixed
97
+
98
+ - **DNS no longer advertises unreachable address families to the guest**
99
+ (upstream #1083): on hosts without a working IPv6 route the sandbox is
100
+ IPv4-only, but the DNS forwarder previously still returned real AAAA
101
+ records, so v6-preferring resolvers inside the guest (gRPC/c-ares
102
+ foremost) tried IPv6 first and failed with unreachable-network errors.
103
+ AAAA queries in a v4-only sandbox (and A queries in a v6-only one) now
104
+ synthesize an empty NOERROR answer, steering guests to the usable family.
105
+ Also normalizes IPv4-mapped IPv6 addresses for policy/rebind/resolved-
106
+ hostname checks.
107
+
108
+ ### Changed
109
+
110
+ - **Embedded runtime is now `v0.6.3`** (`Microsandbox::RUNTIME_VERSION` /
111
+ `Microsandbox.runtime_version`). Also inherited: upstream TLS interception
112
+ scopes upstream-certificate verification per destination (#1073).
113
+ - Native glue adapted to the upstream v0.6.3 SDK surface (#1091 restored
114
+ "ambient local config" as the public shape): `Image.get/list/inspect/
115
+ remove/prune` and `all_sandbox_metrics` now call the explicit
116
+ `*_local(backend, …)` variants, and the resolved-`msb`-path probe uses the
117
+ `LocalConfig#resolve_msb_path` method form. Behavior is identical — the
118
+ gem already held an explicit local backend at every call site.
119
+
9
120
  ## [0.9.1] - 2026-07-03
10
121
 
11
122
  Adopts upstream runtime **`v0.6.1` → `v0.6.2`**. The upstream SDK crate's public
data/Cargo.lock CHANGED
@@ -577,9 +577,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
577
577
 
578
578
  [[package]]
579
579
  name = "bytes"
580
- version = "1.11.1"
580
+ version = "1.12.0"
581
581
  source = "registry+https://github.com/rust-lang/crates.io-index"
582
- checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
582
+ checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593"
583
583
 
584
584
  [[package]]
585
585
  name = "bzip2"
@@ -2532,7 +2532,7 @@ checksum = "ae8e22120c32fb4d19ec55fba35015f57095cd95a2e3b732e44457f5915b2ee8"
2532
2532
  dependencies = [
2533
2533
  "num-integer",
2534
2534
  "num-traits",
2535
- "rand 0.10.1",
2535
+ "rand 0.10.2",
2536
2536
  "rand_core 0.10.1",
2537
2537
  ]
2538
2538
 
@@ -2975,8 +2975,8 @@ dependencies = [
2975
2975
 
2976
2976
  [[package]]
2977
2977
  name = "microsandbox"
2978
- version = "0.6.2"
2979
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
2978
+ version = "0.6.6"
2979
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
2980
2980
  dependencies = [
2981
2981
  "anyhow",
2982
2982
  "astral-tokio-tar",
@@ -3007,7 +3007,7 @@ dependencies = [
3007
3007
  "microsandbox-utils",
3008
3008
  "nix 0.31.3",
3009
3009
  "notify",
3010
- "rand 0.10.1",
3010
+ "rand 0.10.2",
3011
3011
  "reqwest",
3012
3012
  "russh",
3013
3013
  "russh-sftp",
@@ -3025,12 +3025,13 @@ dependencies = [
3025
3025
  "typed-builder",
3026
3026
  "which",
3027
3027
  "windows-sys 0.61.2",
3028
+ "zeroize",
3028
3029
  ]
3029
3030
 
3030
3031
  [[package]]
3031
3032
  name = "microsandbox-agent-client"
3032
- version = "0.6.2"
3033
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3033
+ version = "0.6.6"
3034
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3034
3035
  dependencies = [
3035
3036
  "ciborium",
3036
3037
  "microsandbox-protocol",
@@ -3042,8 +3043,8 @@ dependencies = [
3042
3043
 
3043
3044
  [[package]]
3044
3045
  name = "microsandbox-db"
3045
- version = "0.6.2"
3046
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3046
+ version = "0.6.6"
3047
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3047
3048
  dependencies = [
3048
3049
  "async-trait",
3049
3050
  "sea-orm",
@@ -3054,8 +3055,8 @@ dependencies = [
3054
3055
 
3055
3056
  [[package]]
3056
3057
  name = "microsandbox-filesystem"
3057
- version = "0.6.2"
3058
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3058
+ version = "0.6.6"
3059
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3059
3060
  dependencies = [
3060
3061
  "libc",
3061
3062
  "microsandbox-utils",
@@ -3067,8 +3068,8 @@ dependencies = [
3067
3068
 
3068
3069
  [[package]]
3069
3070
  name = "microsandbox-image"
3070
- version = "0.6.2"
3071
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3071
+ version = "0.6.6"
3072
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3072
3073
  dependencies = [
3073
3074
  "astral-tokio-tar",
3074
3075
  "async-compression",
@@ -3093,8 +3094,8 @@ dependencies = [
3093
3094
 
3094
3095
  [[package]]
3095
3096
  name = "microsandbox-metrics"
3096
- version = "0.6.2"
3097
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3097
+ version = "0.6.6"
3098
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3098
3099
  dependencies = [
3099
3100
  "chrono",
3100
3101
  "libc",
@@ -3105,8 +3106,8 @@ dependencies = [
3105
3106
 
3106
3107
  [[package]]
3107
3108
  name = "microsandbox-migration"
3108
- version = "0.6.2"
3109
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3109
+ version = "0.6.6"
3110
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3110
3111
  dependencies = [
3111
3112
  "sea-orm-migration",
3112
3113
  "serde_json",
@@ -3114,8 +3115,8 @@ dependencies = [
3114
3115
 
3115
3116
  [[package]]
3116
3117
  name = "microsandbox-network"
3117
- version = "0.6.2"
3118
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3118
+ version = "0.6.6"
3119
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3119
3120
  dependencies = [
3120
3121
  "base64",
3121
3122
  "bytes",
@@ -3131,6 +3132,7 @@ dependencies = [
3131
3132
  "libc",
3132
3133
  "lru",
3133
3134
  "microsandbox-protocol",
3135
+ "microsandbox-types",
3134
3136
  "microsandbox-utils",
3135
3137
  "msb_krun",
3136
3138
  "msb_krun_utils",
@@ -3152,12 +3154,13 @@ dependencies = [
3152
3154
  "tokio-rustls",
3153
3155
  "tracing",
3154
3156
  "windows-sys 0.61.2",
3157
+ "zeroize",
3155
3158
  ]
3156
3159
 
3157
3160
  [[package]]
3158
3161
  name = "microsandbox-protocol"
3159
- version = "0.6.2"
3160
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3162
+ version = "0.6.6"
3163
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3161
3164
  dependencies = [
3162
3165
  "chrono",
3163
3166
  "ciborium",
@@ -3171,8 +3174,8 @@ dependencies = [
3171
3174
 
3172
3175
  [[package]]
3173
3176
  name = "microsandbox-runtime"
3174
- version = "0.6.2"
3175
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3177
+ version = "0.6.6"
3178
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3176
3179
  dependencies = [
3177
3180
  "bytes",
3178
3181
  "chrono",
@@ -3198,24 +3201,26 @@ dependencies = [
3198
3201
  "tokio",
3199
3202
  "tracing",
3200
3203
  "windows-sys 0.61.2",
3204
+ "zeroize",
3201
3205
  ]
3202
3206
 
3203
3207
  [[package]]
3204
3208
  name = "microsandbox-types"
3205
- version = "0.6.2"
3206
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3209
+ version = "0.6.6"
3210
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3207
3211
  dependencies = [
3208
3212
  "chrono",
3209
3213
  "serde",
3210
3214
  "serde_json",
3211
3215
  "sha2 0.11.0",
3212
3216
  "thiserror 2.0.18",
3217
+ "zeroize",
3213
3218
  ]
3214
3219
 
3215
3220
  [[package]]
3216
3221
  name = "microsandbox-utils"
3217
- version = "0.6.2"
3218
- source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.2#e9043c89d3432a548908bb145581be4fa1e2e3d9"
3222
+ version = "0.6.6"
3223
+ source = "git+https://github.com/superradcompany/microsandbox?tag=v0.6.6#2367d506103f87fe733d7252c3202b278eadef88"
3219
3224
  dependencies = [
3220
3225
  "dirs",
3221
3226
  "libc",
@@ -3227,7 +3232,7 @@ dependencies = [
3227
3232
 
3228
3233
  [[package]]
3229
3234
  name = "microsandbox_rb"
3230
- version = "0.9.1"
3235
+ version = "0.10.0"
3231
3236
  dependencies = [
3232
3237
  "chrono",
3233
3238
  "futures",
@@ -3321,9 +3326,9 @@ dependencies = [
3321
3326
 
3322
3327
  [[package]]
3323
3328
  name = "msb_krun"
3324
- version = "0.1.19"
3329
+ version = "0.1.25"
3325
3330
  source = "registry+https://github.com/rust-lang/crates.io-index"
3326
- checksum = "c0fb3437734ef4103d3891d3cbd51a8726f196af350c68cb044a1860207c64d3"
3331
+ checksum = "70bc09516a8ed366b6f20504f434d619991dc879101462d86b24ae133937bd3b"
3327
3332
  dependencies = [
3328
3333
  "crossbeam-channel",
3329
3334
  "kvm-bindings",
@@ -3341,9 +3346,9 @@ dependencies = [
3341
3346
 
3342
3347
  [[package]]
3343
3348
  name = "msb_krun_arch"
3344
- version = "0.1.19"
3349
+ version = "0.1.25"
3345
3350
  source = "registry+https://github.com/rust-lang/crates.io-index"
3346
- checksum = "e25fe665643d66900ec9407ef0d3afdb5cd4ca97ad394c46b8243bfa6344bfc0"
3351
+ checksum = "0d63ddae3ce5ba871a2b90bad6d789bf43583b8e587620580376222aed65e96a"
3347
3352
  dependencies = [
3348
3353
  "kvm-bindings",
3349
3354
  "kvm-ioctls",
@@ -3356,15 +3361,15 @@ dependencies = [
3356
3361
 
3357
3362
  [[package]]
3358
3363
  name = "msb_krun_arch_gen"
3359
- version = "0.1.19"
3364
+ version = "0.1.25"
3360
3365
  source = "registry+https://github.com/rust-lang/crates.io-index"
3361
- checksum = "7e50dfac228ad088917f8ffb2920c4a56d762ebc5a90950ee7bf5414253b02aa"
3366
+ checksum = "b14a030e7cd5740010a9d6eedd1002d2d42cc1481670cfa22a4dc5a89143048f"
3362
3367
 
3363
3368
  [[package]]
3364
3369
  name = "msb_krun_cpuid"
3365
- version = "0.1.19"
3370
+ version = "0.1.25"
3366
3371
  source = "registry+https://github.com/rust-lang/crates.io-index"
3367
- checksum = "fd5221749c0224858b075b61f3f2a0964dbfe367093e9ee650b6b0e3d690c3b2"
3372
+ checksum = "f33e9fbcbf5e27657d62177689a499a0dd64d4321afde53463f17b66c1acc2d7"
3368
3373
  dependencies = [
3369
3374
  "kvm-bindings",
3370
3375
  "kvm-ioctls",
@@ -3373,9 +3378,9 @@ dependencies = [
3373
3378
 
3374
3379
  [[package]]
3375
3380
  name = "msb_krun_devices"
3376
- version = "0.1.19"
3381
+ version = "0.1.25"
3377
3382
  source = "registry+https://github.com/rust-lang/crates.io-index"
3378
- checksum = "4fee50bfdf1a1258e33bcf0ee8631bb805db79b8d442161ab63d700689a992a8"
3383
+ checksum = "ca9d5c0ea156c5253c18c880aa29f038e639e9f5526d93ebb848e60d46b2bdca"
3379
3384
  dependencies = [
3380
3385
  "bitflags 1.3.2",
3381
3386
  "capng",
@@ -3403,9 +3408,9 @@ dependencies = [
3403
3408
 
3404
3409
  [[package]]
3405
3410
  name = "msb_krun_hvf"
3406
- version = "0.1.19"
3411
+ version = "0.1.25"
3407
3412
  source = "registry+https://github.com/rust-lang/crates.io-index"
3408
- checksum = "3f2300bbe4dbd56bdc3ffc2384baf82e299fff8a45e844f41c4a0be64210ed47"
3413
+ checksum = "500d2d1d56525119b374ca622c351115eade0a75fb4ff8a16d1cc7117b29d169"
3409
3414
  dependencies = [
3410
3415
  "crossbeam-channel",
3411
3416
  "libloading",
@@ -3415,9 +3420,9 @@ dependencies = [
3415
3420
 
3416
3421
  [[package]]
3417
3422
  name = "msb_krun_kernel"
3418
- version = "0.1.19"
3423
+ version = "0.1.25"
3419
3424
  source = "registry+https://github.com/rust-lang/crates.io-index"
3420
- checksum = "3402b8879bd5b91f33d069fefa00fd0416f12cd660cfd7538da8e77201f2dda5"
3425
+ checksum = "836b43c16a0932baebf32b657f34153fd90f2e839a33e0002d54c6f91b4019b7"
3421
3426
  dependencies = [
3422
3427
  "msb_krun_utils",
3423
3428
  "vm-memory",
@@ -3425,9 +3430,9 @@ dependencies = [
3425
3430
 
3426
3431
  [[package]]
3427
3432
  name = "msb_krun_polly"
3428
- version = "0.1.19"
3433
+ version = "0.1.25"
3429
3434
  source = "registry+https://github.com/rust-lang/crates.io-index"
3430
- checksum = "da550bf268cb9217255ed152bfca9f61275a2796237fd180989958c7f54dc137"
3435
+ checksum = "6457213dc30bdb1a8bcb3ceba3a548f442fc913874f11b970745f779a6bf4842"
3431
3436
  dependencies = [
3432
3437
  "libc",
3433
3438
  "msb_krun_utils",
@@ -3435,18 +3440,18 @@ dependencies = [
3435
3440
 
3436
3441
  [[package]]
3437
3442
  name = "msb_krun_smbios"
3438
- version = "0.1.19"
3443
+ version = "0.1.25"
3439
3444
  source = "registry+https://github.com/rust-lang/crates.io-index"
3440
- checksum = "2c0737818e69346348f8ba2a7197cbec2336e807e5f7f094c80e0ca1635ca054"
3445
+ checksum = "91f33a174635431e57a0d59a4aed487599c2ff2ac9ca1ea2346626112a2499af"
3441
3446
  dependencies = [
3442
3447
  "vm-memory",
3443
3448
  ]
3444
3449
 
3445
3450
  [[package]]
3446
3451
  name = "msb_krun_utils"
3447
- version = "0.1.19"
3452
+ version = "0.1.25"
3448
3453
  source = "registry+https://github.com/rust-lang/crates.io-index"
3449
- checksum = "fb370035195bfd6d60e0b4ad8b0d68dcf9d138f144d033087a960117920a126e"
3454
+ checksum = "54d6f5ee4b160d020de8c91d9237a9592472ee6353b1b72cd08d51b2149c9433"
3450
3455
  dependencies = [
3451
3456
  "bitflags 1.3.2",
3452
3457
  "crossbeam-channel",
@@ -3460,9 +3465,9 @@ dependencies = [
3460
3465
 
3461
3466
  [[package]]
3462
3467
  name = "msb_krun_vmm"
3463
- version = "0.1.19"
3468
+ version = "0.1.25"
3464
3469
  source = "registry+https://github.com/rust-lang/crates.io-index"
3465
- checksum = "68e9f485f720981fda9071b2711d4f8406b6c67ebf6bfa2bb8e83f3cc6c2aaea"
3470
+ checksum = "816b34f9bf7eef3f101e84452e663cf9ac6e173377d5ff277192fb8c82cf3199"
3466
3471
  dependencies = [
3467
3472
  "bzip2",
3468
3473
  "crossbeam-channel",
@@ -3881,7 +3886,7 @@ dependencies = [
3881
3886
  "delegate",
3882
3887
  "futures",
3883
3888
  "log",
3884
- "rand 0.10.1",
3889
+ "rand 0.10.2",
3885
3890
  "sha2 0.11.0",
3886
3891
  "thiserror 2.0.18",
3887
3892
  "tokio",
@@ -4279,9 +4284,9 @@ dependencies = [
4279
4284
 
4280
4285
  [[package]]
4281
4286
  name = "quote"
4282
- version = "1.0.45"
4287
+ version = "1.0.46"
4283
4288
  source = "registry+https://github.com/rust-lang/crates.io-index"
4284
- checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
4289
+ checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
4285
4290
  dependencies = [
4286
4291
  "proc-macro2",
4287
4292
  ]
@@ -4331,9 +4336,9 @@ dependencies = [
4331
4336
 
4332
4337
  [[package]]
4333
4338
  name = "rand"
4334
- version = "0.10.1"
4339
+ version = "0.10.2"
4335
4340
  source = "registry+https://github.com/rust-lang/crates.io-index"
4336
- checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207"
4341
+ checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80"
4337
4342
  dependencies = [
4338
4343
  "chacha20",
4339
4344
  "getrandom 0.4.2",
@@ -4459,9 +4464,9 @@ dependencies = [
4459
4464
 
4460
4465
  [[package]]
4461
4466
  name = "reflink-copy"
4462
- version = "0.1.29"
4467
+ version = "0.1.30"
4463
4468
  source = "registry+https://github.com/rust-lang/crates.io-index"
4464
- checksum = "13362233b147e57674c37b802d216b7c5e3dcccbed8967c84f0d8d223868ae27"
4469
+ checksum = "d9dd7ab4af0363d5ccfd2838d782a28196cf32a5cc2e4fe3c5dc83f2be588b8b"
4465
4470
  dependencies = [
4466
4471
  "cfg-if",
4467
4472
  "libc",
@@ -4660,7 +4665,7 @@ dependencies = [
4660
4665
  "pkcs5",
4661
4666
  "pkcs8 0.11.0",
4662
4667
  "polyval",
4663
- "rand 0.10.1",
4668
+ "rand 0.10.2",
4664
4669
  "rand_core 0.10.1",
4665
4670
  "rsa 0.10.0-rc.18",
4666
4671
  "russh-cryptovec",
@@ -4766,9 +4771,9 @@ dependencies = [
4766
4771
 
4767
4772
  [[package]]
4768
4773
  name = "rustls"
4769
- version = "0.23.40"
4774
+ version = "0.23.41"
4770
4775
  source = "registry+https://github.com/rust-lang/crates.io-index"
4771
- checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b"
4776
+ checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f"
4772
4777
  dependencies = [
4773
4778
  "aws-lc-rs",
4774
4779
  "log",
@@ -5924,9 +5929,9 @@ dependencies = [
5924
5929
 
5925
5930
  [[package]]
5926
5931
  name = "time"
5927
- version = "0.3.49"
5932
+ version = "0.3.51"
5928
5933
  source = "registry+https://github.com/rust-lang/crates.io-index"
5929
- checksum = "711a53c2d47bbd818258c498c8dbfe186a2526c631495cfe7e078567f86b8469"
5934
+ checksum = "85c17d80feb7334b40c484e45ed1a5273dfd8bfda537c3be2e74a06a6686f327"
5930
5935
  dependencies = [
5931
5936
  "deranged",
5932
5937
  "num-conv",
@@ -5944,9 +5949,9 @@ checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
5944
5949
 
5945
5950
  [[package]]
5946
5951
  name = "time-macros"
5947
- version = "0.2.29"
5952
+ version = "0.2.30"
5948
5953
  source = "registry+https://github.com/rust-lang/crates.io-index"
5949
- checksum = "71c652a3727a9cbb9a02f707f530b618ce00d0ccd762009c8c23bd191df3c17d"
5954
+ checksum = "dcef1a61bdb119096e153208ec5cbec23944ce8bca13be5c7f60c634f7403935"
5950
5955
  dependencies = [
5951
5956
  "num-conv",
5952
5957
  "time-core",
@@ -7372,6 +7377,7 @@ version = "1.9.0"
7372
7377
  source = "registry+https://github.com/rust-lang/crates.io-index"
7373
7378
  checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
7374
7379
  dependencies = [
7380
+ "serde",
7375
7381
  "zeroize_derive",
7376
7382
  ]
7377
7383
 
data/README.md CHANGED
@@ -229,6 +229,55 @@ Microsandbox::Sandbox.create("obs", image: "public.ecr.aws/docker/library/alpine
229
229
  end
230
230
  ```
231
231
 
232
+ ### Live modification & health
233
+
234
+ Resize, reconfigure, or rotate secrets on a sandbox **without recreating it**,
235
+ and probe the guest agent's liveness. To leave headroom for a live CPU/memory
236
+ resize, reserve a ceiling at create time with `max_cpus:`/`max_memory:`:
237
+
238
+ ```ruby
239
+ Microsandbox::Sandbox.create("live", image: "public.ecr.aws/docker/library/alpine:latest",
240
+ cpus: 1, max_cpus: 4, memory: 512, max_memory: 2048) do |sb|
241
+ # Health check — does NOT refresh the idle timer:
242
+ ping = sb.ping # => Microsandbox::PingResult
243
+ ping.latency_ms # round-trip latency
244
+
245
+ # Explicitly refresh the idle-activity timer (resets any idle_timeout:):
246
+ sb.touch.activity_seq # => Microsandbox::TouchResult
247
+
248
+ # Preview a change without applying it:
249
+ plan = sb.modify(cpus: 2, memory: 1024, dry_run: true)
250
+ plan.applied? # => false
251
+ plan.changes # => [{ kind: "config", field: "cpus", ... }, ...]
252
+
253
+ # Live resize — applies to the running VM under the default :no_restart policy:
254
+ sb.modify(cpus: 2, memory: 1024)
255
+
256
+ # env/labels/workdir changes on a *running* sandbox require a restart, so the
257
+ # default :no_restart policy rejects the whole apply (it raises rather than
258
+ # partially applying). Persist them for the next start — or restart now —
259
+ # by saying so explicitly:
260
+ sb.modify(env: { "TIER" => "prod" }, remove_env: ["DEBUG"],
261
+ labels: { "role" => "worker" }, policy: :next_start) # or policy: :restart
262
+
263
+ # Rotating/removing an *existing* secret (or updating its allowed hosts) is
264
+ # live; *adding* a new secret is restart-required, like env. Specs are keyed
265
+ # by name; env:/store:/value: are mutually exclusive:
266
+ sb.modify(
267
+ secrets: { "API_KEY" => { env: "HOST_API_KEY", allowed_hosts: ["api.example.com"] } },
268
+ remove_secrets: ["OLD_TOKEN"],
269
+ )
270
+ end
271
+ ```
272
+
273
+ The apply is **all-or-nothing**: under a given `policy:` every planned change
274
+ must be applicable, or the whole `modify` raises — nothing is partially
275
+ applied. Use `dry_run: true` to inspect each change's `disposition` (`"live"`,
276
+ `"next start"`, `"requires restart"`) before committing.
277
+
278
+ `SandboxHandle` (from `Sandbox.get`/`list`) carries the same `#ping`/`#touch`/
279
+ `#modify`; on a stopped sandbox `#ping`/`#touch` raise `SandboxNotRunningError`.
280
+
232
281
  ### Streaming output
233
282
 
234
283
  For long-running commands, stream events as they arrive instead of waiting:
@@ -393,8 +442,8 @@ change diverged the two numbers — the gem version is **not** a reliable indica
393
442
  of the embedded runtime version. To learn which runtime a build wraps, ask it:
394
443
 
395
444
  ```ruby
396
- Microsandbox::VERSION # => "0.9.0" (the gem's own version)
397
- Microsandbox.runtime_version # => "v0.6.2" (the embedded upstream runtime tag)
445
+ Microsandbox::VERSION # => "0.10.0" (the gem's own version)
446
+ Microsandbox.runtime_version # => "v0.6.6" (the embedded upstream runtime tag)
398
447
  ```
399
448
 
400
449
  | Gem version | Upstream runtime | Notes |
@@ -412,6 +461,9 @@ Microsandbox.runtime_version # => "v0.6.2" (the embedded upstream runtime tag
412
461
  | `0.8.2` | `v0.5.10` | gem-only: redact secrets from errors, typed snapshot errors, panic-free durations, fat-gem loader + `extconf` preflight fixes, threading/streaming docs |
413
462
  | `0.9.0` | `v0.6.1` | adopts upstream `v0.6.0`+`v0.6.1` (zombie-runtime wait fix, secret substitution through CONNECT proxies, stale-sandbox cleanup); upstream public API is additive — no Ruby surface change |
414
463
  | `0.9.1` | `v0.6.2` | adopts upstream `v0.6.2` (faster image loads/pulls via early cache gate + zlib-rs); upstream API unchanged — no Ruby surface change |
464
+ | `0.9.2` | `v0.6.3` | adopts upstream `v0.6.3` (v4-only sandboxes stop advertising AAAA DNS answers — fixes guest gRPC/c-ares preferring unreachable IPv6; scoped upstream TLS verification); glue moves to `*_local` SDK variants — no Ruby surface change |
465
+ | `0.9.3` | `v0.6.6` | adopts upstream `v0.6.4`+`v0.6.6` (`v0.6.5` was yanked upstream): snapshot restore by pinned digest — fixes fatal restore-after-tag-republish bug, fragmented-UDP/PMTU relay fixes, exec kills the whole process group, ephemeral stop-wait tolerance, readdir RSS-leak fix; upstream API growth is additive-only — no Ruby surface change |
466
+ | `0.10.0` | `v0.6.6` | `v0.6.6` API parity: live `modify`/resize, `ping`/`touch`, create `max_cpus`/`max_memory` |
415
467
 
416
468
  **Going forward** — the gem version moves on its own semver track and no longer
417
469
  mirrors the upstream tag:
@@ -6,8 +6,8 @@ name = "microsandbox_rb"
6
6
  description = "Ruby SDK native extension for microsandbox — secure, fast microVM-based sandboxing."
7
7
  # Must equal Microsandbox::VERSION (lib/microsandbox/version.rb) — Native.version
8
8
  # returns this via env!("CARGO_PKG_VERSION") and version_spec.rb asserts equality.
9
- # The core-crate dependency below stays pinned at its own tag (v0.6.2).
10
- version = "0.9.1"
9
+ # The core-crate dependency below stays pinned at its own tag (v0.6.6).
10
+ version = "0.10.0"
11
11
  authors = ["Super Rad Company <development@superrad.company>"]
12
12
  repository = "https://github.com/superradcompany/microsandbox"
13
13
  license = "Apache-2.0"
@@ -35,8 +35,8 @@ rb-sys = "0.9"
35
35
  # `.cargo/config.toml.example`). "ssh" matches the feature set the Python/Node
36
36
  # SDKs ship with; default features add "prebuilt" (provisions msb + libkrunfw at
37
37
  # build time), "net", and "keyring".
38
- microsandbox = { git = "https://github.com/superradcompany/microsandbox", tag = "v0.6.2", default-features = true, features = ["ssh"] }
39
- microsandbox-network = { git = "https://github.com/superradcompany/microsandbox", tag = "v0.6.2" }
38
+ microsandbox = { git = "https://github.com/superradcompany/microsandbox", tag = "v0.6.6", default-features = true, features = ["ssh"] }
39
+ microsandbox-network = { git = "https://github.com/superradcompany/microsandbox", tag = "v0.6.6" }
40
40
 
41
41
  # Async core bridged to Ruby's synchronous API via a blocking tokio runtime.
42
42
  tokio = { version = "1", features = ["rt-multi-thread", "sync", "time"] }
@@ -17,6 +17,12 @@ fn class_name(err: &MicrosandboxError) -> &'static str {
17
17
  SandboxNotFound(_) => "SandboxNotFoundError",
18
18
  SandboxAlreadyExists(_) => "SandboxAlreadyExistsError",
19
19
  SandboxStillRunning(_) => "SandboxStillRunningError",
20
+ // v0.6.6 (#1099): the sandbox exists but isn't running. Raised by the
21
+ // handle's exec/attach/ping/touch not-running guards and the fs
22
+ // agent-endpoint lookup. The `SandboxNotRunningError` class already
23
+ // existed (mirroring the Python SDK); this wires the new core variant to
24
+ // it instead of letting it collapse to the base `Error`.
25
+ SandboxNotRunning(_) => "SandboxNotRunningError",
20
26
  ExecTimeout(_) => "ExecTimeoutError",
21
27
  ExecFailed(_) => "ExecFailedError",
22
28
  SandboxFsOps(_) => "FilesystemError",