mit einem Klick
peat-node
// Per-repo skill for the Peat sidecar node — Rust binary that exposes peat-protocol over Connect/gRPC/gRPC-Web for co-located applications, plus Helm/Zarf packaging.
// Per-repo skill for the Peat sidecar node — Rust binary that exposes peat-protocol over Connect/gRPC/gRPC-Web for co-located applications, plus Helm/Zarf packaging.
| name | peat-node |
| description | Per-repo skill for the Peat sidecar node — Rust binary that exposes peat-protocol over Connect/gRPC/gRPC-Web for co-located applications, plus Helm/Zarf packaging. |
| when_to_use | Editing files under peat-node/, reviewing peat-node PRs, debugging the sidecar API or DDIL fleet sync, editing proto/sidecar.proto, or working on the Helm chart / Zarf packaging. |
| verifies_with | cargo fmt --check, cargo clippy -- -D warnings, cargo test, the cross-cluster-sync.sh functional test for sync-path changes, and helm template for chart changes. |
peat-node SKILLpeat-node is the sidecar node for the Peat ecosystem. It runs alongside a co-located application and exposes peat-protocol as a gRPC API (Connect + gRPC + gRPC-Web on a single port via ConnectRPC) so applications can read/write Peat documents and consume change events without embedding the mesh stack themselves. The repo ships:
src/main.rs) implementing the sidecar.proto/sidecar.proto, compiled via connectrpc_build (build.rs) for the in-tree server.chart/peat-node/ and a Zarf manifest for Kubernetes deployment.test/cross-cluster-sync.sh) plus in-tree Rust integration tests under tests/. The canonical test files map to RPC surfaces:
tests/grpc_test.rs — generic Connect HTTP+JSON coverage for the document / peer / sync / typed-collection RPCstests/attachments_*_test.rs — PRD-006 attachment surface (smoke, acceptance, subscribe, multi-peer, deferred)tests/subscribe_test.rs, tests/subscribe_query_test.rs — document Subscribe streaming RPCtests/sync_test.rs, tests/cross_peer_encryption_test.rs, tests/formation_isolation_test.rs, tests/partition_test.rs — multi-node CRDT scenariostests/node_test.rs, tests/uds_test.rs, tests/typed_collections_test.rs, tests/sync_control_test.rs — in-process unit-ish integration tests against SidecarNodeConsumers in other languages talk to the sidecar directly over the Connect-RPC wire — no in-repo SDK. The examples/compose/ quickstart shows the bash+curl+jq path. For typed clients, generate from proto/sidecar.proto in the consumer's own repo (or front it with peat-gateway per ADR-043).
src/ (sidecar implementation, agent watcher, encryption-at-rest)proto/sidecar.proto — the wire contract; changes ripple to the Rust server code and any external consumer that generates from itchart/peat-node/ (Helm chart) or zarf.yaml (Zarf packaging)test/cross-cluster-sync.sh or the in-tree Rust integration testspeat-mesh version (currently =0.9.0-rc.7)In scope:
aes-gcm)Out of scope (route elsewhere):
peat-mesh/SKILL.mdpeat-btle/SKILL.mdpeat-registry/SKILL.mdpeat-gateway for protocol-bridge adapters (ADR-043)peat/peat-protocol or peat/peat-schema. Dependency direction: peat-node depends on peat-mesh (always) and peat-protocol (for the attachment substrate — FileDistribution, IrohFileDistribution, DistributionHandle, TransferPriority). peat-protocol is the layer beneath peat-mesh in the workspace, not a sibling; the two-dep arrangement is intentional. Sibling repos (peat-btle, peat-registry, peat-gateway) remain out-of-bounds — those still route through their own skills.peat/SKILL.md (ecosystem) if accessible. Read this file. Read docs/DESIGN.md if you're touching architectural surfaces. git status, git log -10.proto/sidecar.proto, plan how the Rust server and any external consumer will pick up the change.main per the trunk-based convention. Vertical slices, one concern per commit.main referencing the issue. Single concern per PR — squash-merge applies.A session in this repo is not done until each of these produces evidence:
cargo fmt --check exits 0cargo clippy -- -D warnings exits 0cargo test exits 0 (this includes tests/sync_test.rs, the two-node in-process CRDT-sync test)proto/sidecar.proto was touched: cargo build (re-runs proto compile via build.rs and confirms server code matches the new contract); external consumers regenerate from the new proto on their side./test/cross-cluster-sync.shchart/ or zarf.yaml was touched: helm template chart/peat-node renders cleanlypeat-mesh: full integration suite, not just unit tests"Seems right" or "the diff looks correct" is never sufficient.
| Excuse | Rebuttal |
|---|---|
| "This change is too small to need a test." | If it's worth changing, it's worth one assertion. Add the test. |
| "I'll fix the clippy warning later." | The CI gate is -D warnings. There is no later. |
| "I'll add this new endpoint as a Rust-only handler — easier than touching proto." | Proto-first. New endpoints go in sidecar.proto first; the Rust server follows. Consumers can't talk to a Rust-only endpoint. |
"I'll skip the cross-cluster sync test — cargo test passes." | DDIL fleet sync is the product. Cross-cluster test catches network-partition / re-convergence bugs unit tests don't. |
"I'll bump peat-mesh to the latest RC." | The pin (=0.9.0-rc.7) is intentional. Bumps need full integration validation and possibly chart/Zarf updates. |
| "I'll inline the encryption-at-rest call without zeroization — it's only briefly in memory." | aes-gcm material lives in security-sensitive paths. Use the established zeroization patterns; don't introduce un-zeroized handling. |
| "I'll add a Go/TS/Python SDK directly to this repo for a quick consumer integration." | No SDKs live in this repo. Typed clients generate from proto/sidecar.proto in the consumer's own repo, or front the sidecar with peat-gateway per ADR-043. |
chart/, zarf.yaml, or test fixtures.--no-verify to skip pre-commit hooks.Add an entry each time a session produces output that needed correction. One line per gotcha plus a Why: line.
IROH_DISTRIBUTION_COLLECTION docs only via peat_protocol::storage::{read_distribution_document, scan_distribution_documents, write_receiver_node_status} — never collection.get/scan + serde_json.
Why: as of peat-protocol 0.9.0-rc.9 the on-wire shape is structured Automerge (ROOT.metadata byte-scalar + typed ROOT.node_statuses Map), not a single JSON ROOT.data scalar; the old access pattern returns None/garbage against rc.9 docs and the inline wholesale RMW was the substrate root of peat#864.end_to_end_attachment_delivery_two_nodes, node_list_scope_only_delivers_to_listed_nodes, receiver_writes_node_status_into_distribution_doc, subscribe_emits_progress_then_terminal) must carry #[serial_test::serial(iroh_two_node)].
Why: cargo test runs tests within a binary in parallel; each of these spins up a #[tokio::test(flavor = "multi_thread")] runtime + two real iroh endpoints, and the CPU contention deterministically stalls PRD-006 test 23's 60s budget on CI runners (cost: a closed PR #77 and three CI-fail rounds before the cause was nailed).protoc must support proto3 optional; the distro protobuf-compiler (3.12.x) does not. Install a prebuilt protoc ≥25 to ~/.local/bin and pass PROTOC=$HOME/.local/bin/protoc to cargo.
Why: build.rs runs connectrpc_build over proto/sidecar.proto which uses proto3 optional; an old protoc fails the build with --experimental_allow_proto3_optional was not set. CI installs a current protoc; local dev usually doesn't.subscribe_progress stream.
Why: receiver_writes_node_status_into_distribution_doc reads the receiver's own doc via read_distribution_document, isolating peat-node's write contract from upstream sender-observation races; this is what made the peat#864 bisect tractable.peat/SKILL.md (sibling repo)docs/DESIGN.mddocs/CONFIGURATION.mdproto/sidecar.protochart/peat-node/zarf.yamltest/cross-cluster-sync.shtests/examples/compose/Last updated: 2026-05-11 Maintained by: Kit Plummer, VP Data and Autonomy, Defense Unicorns