PROTOCOL.md, DECISIONS.md, README.md, AGENTS.md for plugins, processes, and JSON-RPC
This commit is contained in:
@@ -10,25 +10,25 @@ Keep it that way.
|
||||
caller. No configuration that nobody asked for.
|
||||
3. **Readable.** A new reader must understand a file without the others.
|
||||
Each module starts with a doc comment that says what it owns.
|
||||
4. **Efficient** on the paths that run per message.
|
||||
4. **Efficient** on the paths that run per call.
|
||||
5. **Raw and minimal.** Sausage has no permissions, sandboxing beyond WASI,
|
||||
limits, or authentication. Do not add them to the core. Add nothing to
|
||||
the host that an actor (or the agent, by changing itself) could do.
|
||||
the host that a plugin (or the agent, by changing itself) could do.
|
||||
|
||||
## Layout
|
||||
|
||||
- `cli/`: the host (`sausage` binary and library).
|
||||
- `lib.rs`: `Host`, which starts and stops a world.
|
||||
- `broker.rs`: routing, mailboxes, the version store, broker requests.
|
||||
- `supervisor.rs`: runs one WASM actor (restarts, swaps, rollbacks).
|
||||
- `runtime.rs`: Wasmtime instances and what they get (mounts, network).
|
||||
- `candidate.rs`: tests a new version. `cargo_actor.rs`: builds Rust.
|
||||
- `world.rs`: the on-disk layout. `console.rs`: the terminal.
|
||||
- `sdk/`: `sausage-actor`, the SDK for Rust actors. Never published: the
|
||||
`cargo` actor points `sausage-actor = "0.1"` at its local copy.
|
||||
- `agent/`: the agent actor. `sausage init` embeds and builds it.
|
||||
- `examples/`: small actors. They are not workspace members.
|
||||
- `PROTOCOL.md`: the contract between the host and the actors. Change it in
|
||||
- `cli/`: the host (`sausage` binary and library): the core, the native
|
||||
`cargo` plugin, the WASI test runner, and the console.
|
||||
- `vfs/`: `sausage-vfs`, the virtual filesystem for WASI guests. It knows
|
||||
nothing about Sausage.
|
||||
- `interface/`: `sausage-interface`: OpenRPC documents, the compatibility
|
||||
check, and the generator of client code.
|
||||
- `sdk/`: `sausage-plugin`, the SDK for Rust plugins, and `sdk/macros/`, its
|
||||
macros. Never published: `cargo` points `sausage-plugin = "0.1"` at its
|
||||
local copy.
|
||||
- `agent/`: the agent plugin. `sausage init` embeds and builds it.
|
||||
- `examples/`: small plugins. They are not workspace members.
|
||||
- `PROTOCOL.md`: the contract between the core and the plugins. Change it in
|
||||
the same commit as the behavior. `DECISIONS.md` says why; when the two
|
||||
disagree, `PROTOCOL.md` and the code win.
|
||||
|
||||
@@ -36,7 +36,7 @@ Keep it that way.
|
||||
|
||||
```sh
|
||||
nix flake check -L # all tests below; CI runs this on every push
|
||||
nix develop -c cargo test -p sausage -p sausage-actor -p agent
|
||||
nix develop -c cargo test --workspace
|
||||
nix develop -c cargo build --release -p agent --target wasm32-wasip2
|
||||
nix develop -c cargo clippy --workspace
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user