Host: - test first: a new version is tested where it lies; only an installed version goes to versions/, and instances run from there - data/ and public/ are shared by all versions; no snapshots; rollback restores code only - no re-delivery, status.json, list, remove/archive, smoke test, data/ hiding, or stdin timeout; rollback needs a version - supervisor.rs split out; one place for installing a version - init only writes the agent folder; run installs it like any actor - console: @actor, text to the agent, /help, /quit Agent: - every text goes out as a broadcast; 5-line prompt; 5 tools that describe themselves; turn.json only marks an active turn Docs: PROTOCOL.md, README.md, DECISIONS.md, AGENTS.md rewritten. Examples: only notes and notes-v2.
1.9 KiB
1.9 KiB
Working on Sausage
Sausage is meant to be read and changed by agents, including its own agent. Keep it that way.
Priorities
- Correct. Every behavior in
PROTOCOL.mdhas a test incli/tests/. - Simple and short. Prefer the obvious code. No abstraction for one caller. No configuration that nobody asked for.
- Readable. A new reader must understand a file without the others. Each module starts with a doc comment that says what it owns.
- Efficient on the paths that run per message.
- 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.
Layout
cli/: the host (sausagebinary 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.fs.rs: commit on close.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: thecargoactor pointssausage-actor = "0.1"at its local copy.agent/: the agent actor.sausage initembeds and builds it.examples/: small actors. They are not workspace members.PROTOCOL.md: the contract between the host and the actors. Change it in the same commit as the behavior.DECISIONS.mdsays why; when the two disagree,PROTOCOL.mdand the code win.
Checks
nix develop -c cargo test -p sausage -p sausage-actor -p agent
nix develop -c cargo build --release -p agent --target wasm32-wasip2
nix develop -c cargo clippy --workspace
nix run -- init and nix run -- run must keep working without other
setup.