Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
31d1472
fix(blaze): persist backend PID handoff
WeissonHan Jul 30, 2026
328fd10
fix(blaze): persist backend PID handoff
WeissonHan Jul 30, 2026
9586e69
fix(blaze): reject incomplete sandbox resets
WeissonHan Jul 30, 2026
b9127d1
fix(blaze): reject incomplete checkpoints
WeissonHan Jul 30, 2026
a26c7cf
feat(blaze): manage isolated VM network slots
WeissonHan Jul 30, 2026
0a82000
docs(blaze): explain isolated VM networking
WeissonHan Jul 30, 2026
b216579
fix(blaze): stop on corrupt sandbox state
WeissonHan Jul 30, 2026
42ff6dd
fix(blaze): reclaim inactive operation locks
WeissonHan Jul 30, 2026
0704ed9
fix(blaze): drain daemon connection tasks
WeissonHan Jul 30, 2026
9ffc46e
fix(blaze): release runtimes during shutdown
WeissonHan Jul 30, 2026
a12188e
fix(blaze): bound HTTP request bodies
WeissonHan Jul 30, 2026
90f7737
fix(blaze): prevent daemon socket takeover
WeissonHan Jul 30, 2026
1607ee1
fix(blaze): publish lifecycle owners atomically
WeissonHan Jul 30, 2026
3cc1561
fix(blaze): reject linked storage artifacts
WeissonHan Jul 30, 2026
ad7191b
feat(blaze): journal sandbox ownership changes
WeissonHan Jul 29, 2026
52e927f
feat(blaze): manage recoverable sandboxes
WeissonHan Jul 29, 2026
9f11db3
feat(blaze): expose sandbox lifecycle routes
WeissonHan Jul 29, 2026
b4c973e
docs(blaze): describe managed sandboxes
WeissonHan Jul 29, 2026
2a0a6a3
feat(blaze): define sandbox guest protocol
WeissonHan Jul 30, 2026
9dfe67f
feat(blaze): implement sandbox guest operations
WeissonHan Jul 30, 2026
37e936b
docs(blaze): describe sandbox guest operations
WeissonHan Jul 30, 2026
76b078a
feat(blaze): inventory owned file slots
WeissonHan Jul 30, 2026
0b461e1
feat(blaze): refill warm runtime slots
WeissonHan Jul 30, 2026
c968a7f
docs(blaze): document runtime slot ownership
WeissonHan Jul 30, 2026
1b45971
feat(blaze): define checkpoint records
WeissonHan Jul 31, 2026
1c609d8
feat(blaze): journal checkpoint progress
WeissonHan Jul 31, 2026
6832c45
feat(blaze): capture sandbox checkpoints
WeissonHan Jul 31, 2026
5804993
feat(blaze): prune checkpoint history
WeissonHan Jul 31, 2026
0df7f3e
feat(blaze): capture Firecracker state
WeissonHan Jul 31, 2026
b0d2d7d
feat(blaze): journal checkpoint restores
WeissonHan Jul 31, 2026
a179908
feat(blaze): stage recoverable rootfs restores
WeissonHan Jul 31, 2026
1f3b685
feat(blaze): restore sandbox checkpoints
WeissonHan Jul 31, 2026
86c345e
feat(blaze): hibernate and resume sandboxes
WeissonHan Jul 31, 2026
5539bd8
docs(blaze): explain sandbox hibernation
WeissonHan Jul 31, 2026
2591e13
feat(blaze): synchronize running sandbox storage
WeissonHan Jul 31, 2026
515b5e2
docs(blaze): explain storage synchronization
WeissonHan Jul 31, 2026
625709b
feat(blaze): publish runtime artifact catalog
WeissonHan Jul 31, 2026
638f744
docs(blaze): explain runtime artifact catalog
WeissonHan Jul 31, 2026
9743322
Merge branch 'feature/blaze/vm-networking' into integration/blaze/p3-…
WeissonHan Jul 31, 2026
b8a370c
Merge branch 'feature/blaze/managed-lifecycle-v2' into integration/bl…
WeissonHan Jul 31, 2026
23a6a90
Merge branch 'feature/blaze/warm-runtime-capacity-v2' into integratio…
WeissonHan Jul 31, 2026
0924124
Merge branch 'feature/blaze/sandbox-hibernation-v2' into integration/…
WeissonHan Jul 31, 2026
c90d83e
Merge branch 'feature/blaze/checkpoint-prune-v2' into integration/bla…
WeissonHan Jul 31, 2026
2a4ecb1
Merge branch 'feature/blaze/storage-synchronization-v2' into integrat…
WeissonHan Jul 31, 2026
d6fe17d
Merge branch 'feature/blaze/runtime-templates-v2' into integration/bl…
WeissonHan Jul 31, 2026
33f1a64
fix(blaze): preserve network slot on restore
WeissonHan Jul 31, 2026
828f73d
chore(blaze): bump version to 0.4.0
WeissonHan Jul 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/user-guide/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ANOLISA provides a complete server-side runtime for AI Agent workloads. Componen
│ anolisa-cli · cosh · os-skills │
├──────────────────────────────────┬─────────────────────────────────┤
│ Token Saving │ Runtime │
│ tokenless · agent-memory │ skillfs · ws-ckpt
│ tokenless · agent-memory │ blaze · skillfs · ws-ckpt │
├──────────────────────────────────┼─────────────────────────────────┤
│ Agent Observability │ Agent Security │
│ agentsight │ agent-sec-core │
Expand Down Expand Up @@ -68,6 +68,7 @@ ANOLISA provides a complete server-side runtime for AI Agent workloads. Componen

| Document | Component | Description |
|----------|-----------|-------------|
| [Blaze Runtime Slots](runtime/blaze/QUICKSTART.md) | blaze | Bounded background storage slots with optional backend prefork |
| [Workspace Checkpoints](runtime/ws-ckpt.md) | ws-ckpt | Instant snapshot/rollback via btrfs COW |
| [Skill Filesystem](runtime/skillfs.md) | skillfs | FUSE virtual views with progressive disclosure |

Expand Down
215 changes: 215 additions & 0 deletions docs/user-guide/en/runtime/blaze/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Blaze Runtime Slots

[中文版](../../../zh/runtime/blaze/QUICKSTART.md)

Blaze can prepare independent runtime slots in the background so a compatible
sandbox create can reuse prepared storage and, optionally, an already started
backend. The feature is bounded, disabled by default, and continues through
the existing create flow whenever no compatible slot is ready.

## Requirements

- Linux with root privileges for the selected sandbox backend
- Rust 1.88 or newer for source builds
- a Blaze policy whose `[pool]` section sets `enabled = true`
- stable daemon state, storage-instance, and runtime directories across restart

## Installation

### ANOLISA CLI

Blaze is a Labs component. The source tree contains an ANOLISA component
manifest, but a configured component repository may not publish a `blaze`
candidate. Preview resolution before applying the system installation:

```bash
sudo anolisa --install-mode system --dry-run install blaze
sudo anolisa --install-mode system install blaze
```

### RPM

On an RPM repository that publishes Blaze:

```bash
sudo yum install blaze
```

### Source build

```bash
cd src/blaze
cargo build --release --locked
```

## Enable Background Capacity

Set a non-zero target in the daemon configuration:

```toml
[storage]
provider = "file"
images_dir = "/var/lib/blaze/images"
instances_dir = "/var/lib/blaze/instances"
pool_size = 2
prefork = false

[pool]
default_warm_ttl = "30m"
gc_interval = "5m"
```

Enable eligibility in each policy that may use a prepared slot:

```toml
[pool]
enabled = true
# Optional. When omitted, pool.default_warm_ttl from config.toml applies.
warm_ttl = "15m"
```

`storage.pool_size` is the target for background runtime slots. Policy `min`,
`target`, `max`, and `reset_mode` are reserved policy schema metadata. The
runtime-slot worker does not consume them, and `/v1/pools` does not apply them
from policy. None of them resizes background runtime capacity. The public reset
operation currently returns `501`, so a complete lifecycle return-to-pool
workflow is not connected.

`pool_size = 0` disables construction. Duration values must include a positive
unit: `s`, `m`, `h`, or `d`.

## Start Blaze

Use the packaged service:

```bash
sudo systemctl enable --now blazed
```

For a source checkout, run the built daemon with a configuration whose
`policy.dir` points to readable policies:

```bash
sudo ./target/release/blazed daemon start --config examples/config.toml
```

The example configuration points `policy.dir` to
`/etc/anolisa/blaze/policies`. A package installs policies there; for a source
checkout, copy the example policies to that directory or edit the configuration
to use the checkout path.

## Create and Claim a Slot

The first eligible create fixes one build shape for this daemon run and wakes
the background worker. It does not wait for the worker to fill the target, so
that request normally continues through the existing create flow. Later
compatible requests claim a ready slot when one is available:

```bash
curl -X POST --unix-socket /run/blaze/api.sock \
http://localhost/v1/sandboxes \
-H 'Content-Type: application/json' \
-d '{"workload_class":"agent-tool","image_digest":"sha256:..."}'
```

The existing `start_path` field is a generic warm-start classification. A
background runtime-slot claim reports this shape:

```json
{
"start_path": "warm",
"instance": {
"start_path": "warm",
"runtime_location": "warm-pool"
}
}
```

A `"cold"` result is not an error: this request did not use an applicable warm
source.

```mermaid
flowchart LR
A["POST /v1/sandboxes"] --> B{"Policy eligible?"}
B -- "No" --> C["Existing create flow"]
B -- "Yes" --> D["Configure or match build shape"]
D --> K{"Prototype accepted?"}
K -- "No" --> C
K -- "Yes" --> E{"Compatible slot ready?"}
E -- "No" --> C
E -- "Yes" --> F["Record ownership handoff"]
F --> G["Publish lifecycle owner"]
G --> H["Return Running sandbox"]
K -- "Yes" --> I["Wake background worker"]
I --> J["Build toward pool_size"]
```

## Prefork Modes

| `storage.prefork` | Prepared slot | Work performed after claim |
| --- | --- | --- |
| `false` | Independent storage | Start the backend and wait for guest readiness when the backend exposes a guest endpoint |
| `true` | Independent storage plus a running backend | Check backend liveness at claim; when a guest endpoint exists, readiness was already checked before the slot became ready |

Every slot owns its own storage snapshot. A slot is never made ready by sharing
another sandbox's mutable storage.

## Capacity and Expiry

The target counts ready slots, active builds, leases being handed off, and
pool-owned slots awaiting cleanup. An ambiguous handoff has no selected
cleanup owner, but remains accounted for until reconciliation. A sandbox stops
consuming this target after lifecycle ownership is durably established.

The worker removes ready slots after their effective `warm_ttl`. Claim checks
expiry for every slot and backend liveness when the slot holds a prefork
backend. Pool cleanup failures remain owned and are retried; they continue to
consume target capacity until cleanup succeeds.

## Restart and Shutdown

Before opening its API listeners, Blaze reconciles every runtime-slot ownership
record with durable sandbox lifecycle state. It cleans unclaimed slots instead
of rebuilding the old ready queue. Any ambiguous or inconsistent record, or
runtime reconciliation step that cannot complete, stops startup. After runtime
reconciliation succeeds, ordinary sandbox lifecycle reconciliation runs; one
sandbox cleanup failure is retained and reported but does not prevent listener
startup.

Keep `daemon.state_dir`, `storage.instances_dir`, the selected storage provider,
and backend availability consistent across restart. Changing those values can
prevent the daemon from identifying and cleaning resources created by the
previous run.

During graceful shutdown, Blaze stops new slot construction, joins the worker,
and attempts bounded cleanup for every pool-owned slot. Lifecycle-owned
sandboxes follow the normal sandbox cleanup path.

## Current Boundaries

- One compatible build shape is accepted per daemon run. Requests with another
image, backend, policy shape, or runtime configuration continue through the
existing create flow.
- Capacity starts on the first eligible create; daemon startup does not prefill
slots.
- Restart cleans unclaimed slots and does not restore them as ready.
- There is no public status, drain, or refill endpoint for background runtime
slots. `/v1/pools` and the health response's `storage_pool` object refer to
other pool contracts.
- A configured target improves the chance of a warm claim but does not
guarantee one for every request.
- A claimed background slot is single-use: destroy releases its resources and
the worker builds replacement capacity instead of returning that sandbox to
the ready queue.

## Troubleshooting

| Symptom | Check |
| --- | --- |
| Every response has `start_path: "cold"` | Confirm `pool_size > 0`, policy `enabled = true`, and identical request/build inputs; then allow time for background construction |
| Slot construction keeps retrying | Inspect daemon logs for storage, backend start, or guest-readiness errors |
| Capacity appears below target | Cleanup or an unresolved handoff may still count toward the target; inspect daemon logs |
| Daemon stops during startup reconciliation | Restore the provider and directory configuration used by the previous run, then inspect the reported ownership record |

For the ownership and recovery rationale, see
[Runtime Slot Ownership](../../../../../src/blaze/docs/design/runtime-slot-ownership.md).
3 changes: 2 additions & 1 deletion docs/user-guide/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ANOLISA 为 AI Agent 提供完整的服务端运行时能力。通过 `anolisa`
│ anolisa-cli · cosh · os-skills │
├──────────────────────────────────┬─────────────────────────────────┤
│ Token 节省 │ 运行时 │
│ tokenless · agent-memory │ skillfs · ws-ckpt
│ tokenless · agent-memory │ blaze · skillfs · ws-ckpt │
├──────────────────────────────────┼─────────────────────────────────┤
│ Agent 可观测 │ Agent 安全 │
│ agentsight │ agent-sec-core │
Expand Down Expand Up @@ -68,6 +68,7 @@ ANOLISA 为 AI Agent 提供完整的服务端运行时能力。通过 `anolisa`

| 文档 | 组件 | 说明 |
|------|------|------|
| [Blaze Runtime 槽位](runtime/blaze/QUICKSTART.md) | blaze | 有界后台存储槽位,可选后端 prefork |
| [工作区快照](runtime/ws-ckpt.md) | ws-ckpt | 秒级快照创建/回滚,基于 btrfs COW |
| [技能文件系统](runtime/skillfs.md) | skillfs | FUSE 虚拟视图、渐进披露 |

Expand Down
Loading
Loading