Crate spt_proto

Crate spt_proto 

Source
Expand description

spt-proto — the wire-protocol commodity layer for spt-core.

Per ADR-0001, the stable wire formats are copied verbatim from the sister project (claude_skill_owl); only architecture/lifecycle is clean-room. This crate owns the envelope grammar and is part of the public, semver-committed SDK (R-ARCH-2), carrying its own wire-protocol version independent of crate semver (R-ARCH-3).

Modules§

addr
Qualified-address grammar [subnet:]id[@node] (D3c, ADR-0006 §2 / REQ-INST-10).
chunk
EVENT-PART chunking and reassembly.
endpoint
Endpoint types — the day-one taxonomy of what shape of entity lives at a perch, plus the two structural seams that let the model grow without a rewrite (CONTEXT.md “Endpoint types” / “Agent endpoints vs Shells”).
envelope
Envelope grammar: the HTML-entity transport codec and the two-slice Psyche-context parser. Copied verbatim from claude_skill_owl (src/owl/poll.rs codec + src/common/envelope.rs parser) per ADR-0001 — this is the stable, public wire contract; do not clean-room it.
event
EVENT envelope grammar: compose and parse the <EVENT attrs>body</EVENT> wire line. The format is copied verbatim from claude_skill_owl (src/owl/poll.rs compose sites — assemble_event_line, body_is_typed_event_envelope) per ADR-0001; this is the stable, public wire contract. The general parser is the receiver-side inverse of those compose sites (the sister parses receiver-side in the harness/agent layer, per the runtime reorientation contract — we make it a first-class function here).
id
Endpoint-id charset contract — the addressable-name validator.
identity
Ed25519 identity primitive — keypair generation, detached signing/verify, and stable public-key ↔ string (hex) conversion.
payload
Payload model — the messaging substrate carries typed operation commands and arbitrary file blobs, not just text (CONTEXT.md “Agent endpoints vs Shells” seam #2). This is what lets a Shell type be driven later: an agent sends Commands and Blobs (text/audio/image/video) over the same EVENT envelope that carries plain text today.
version
Wire-protocol version — orthogonal to crate semver (CONTEXT.md “wire-protocol version vs crate semver”). Two nodes, or a node and a crate-linking consumer, interoperate iff their proto versions are compatible, governed by a documented N-1 compat window (REQ-ARCH-3).