Skip to content

docs: onboarding a ClankMail peer (docs/clankmail.md) - #414

Merged
ZacxDev merged 6 commits into
mainfrom
docs/clankmail-onboarding
Nov 3, 2026
Merged

ZacxDev merged 6 commits into
mainfrom
docs/clankmail-onboarding

Conversation

@ZacxDev

@ZacxDev ZacxDev commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Adds docs/clankmail.md, a step-by-step guide for an operator who runs their own muster and wants their chief to exchange signed agent-to-agent messages with another operator's chief over ClankMail through muster-clankmail (#410) and a ClankMail hub. The examples use the placeholder hub hub.example; the doc says the real hub's name and URL come from whoever invites you, and both chiefs must use the same hub.

Sections, in order: the trust model, setup (plugin image/binary, keygen, identity claim/grant, the clankmail plugin token, env, a generic container plus compose and Kubernetes notes), pairing, day to day, and troubleshooting (the plugin's own error strings).

Linked from docs/plugins.md (intro) and the docs/README.md index.

Limitations the doc states plainly

  • No outbound-first path: the plugin only sends approved replies, and compose drafts are not shipped. Until they are, the side that starts the conversation sends the first message with ClankMail's tested send-first example (examples: send-first, sign and submit a thread's first message clankmail#15), and the other side replies through its plugin. The doc links to it and gives its go run command, with --max-body 16384 for muster's 16 KiB chief-body limit. The muster plugin itself stays reply-only.
  • No release carries the plugin or plugins: thread routing and the unrouted ask also cover clankmail #409's server-side thread routing yet (latest tag v0.135.0 predates both). The doc says to build both the muster server and the plugin from main until one does, and names what breaks on an older server (clankmail threads do not route). Compose instructions set MUSTER_IMAGE/MUSTER_VERSION for the locally built image and give the plugin service in full, with its image: and healthcheck override. The release archives do not ship the binary.
  • Changing CLANKMAIL_PEERS needs the container re-created (rm + re-run, docker compose up -d, or the Deployment env); the doc says a plain docker restart keeps the old env.
  • Kubernetes: a namespace of its own does not keep the chief key from muster in either provisioner layout. Default: muster's service account holds secrets get/list/create/update/delete and pods/exec in every namespace. Least-privilege: the standing access is gone, but it keeps cluster-wide rolebindings get/create, bind on muster-agent-namespace and namespaces delete, so it can bind itself in the plugin's namespace and read the Secret. A compromised muster-server can therefore sign as @<owner>/chief. What isolates the key: another cluster, or docs/provisioner.md's ValidatingAdmissionPolicy with the plugin's namespace outside the agent prefix and outside muster's own namespace. docs/configuration.md's admin-socket note carried the same wrong implication and is corrected too. (RBAC checked against docs/provisioner.md; the repo ships no RBAC manifests, so that doc is the only source.)
  • Compose: admin commands use docker compose exec muster-clankmail … (compose names the container <project>-muster-clankmail-1), and the compose service publishes 127.0.0.1:8080 for /health. MUSTER_VERSION=local also retags the stt-cohere image, which the doc now says.
  • A turn marks only an UNVERIFIED sender; sender_verified is a field on the stored message and the tools' JSON, and the doc now says so instead of implying a positive mark.
  • The image's built-in HEALTHCHECK probes /muster-server. A plugin container needs --no-healthcheck, or the exec-form /muster-clankmail show under compose.
  • The CLI cannot revoke a grant or re-enroll under an existing one, so moving @owner/chief to a new key, or recovering a half-finished identity grant, needs the library.

Correction to docs/plugins.md: it said a ClankMail thread is bound by muster-clankmail send --bind <session>. That command does not exist. The text now says the plugin has no send command and that the first sender binds the thread by hand.

🔴 Merge order: ZacxDev/clankmail#15 first. The send-first link is deliberately still on the PR branch and is retargeted after #15 merges. Until it merges, the doc's link points at that PR's branch (tree/feat/example-send-first-message/go/examples/send-first) and its go run …/send-first@main command fails, because clankmail main does not have the example yet. After #15 merges, change the link to tree/main/go/examples/send-first, then merge this PR. (A branch name with a slash is not a valid Go version query, so the command uses @main and will be correct after the merge.)

Gates (on 40d2557)

  • go test ./internal/modulegate/ passes (includes the doc-link checker).
  • Leak scan, with the denied-identifier check ON. The round-1 body said "make leakscan is clean", which was false: it was run without MUSTER_LEAKSCAN_KEY, so the denied-identifier check was skipped, and CI's leak gate refused the doc's 9 mentions of the private hub domain. Now run with the key: positive control at b0f5e3b reproduces exactly those 9 findings (rc 1); at 40d2557 leakscan_test.py (19 tests), --self-test and the scan all pass, 0 findings across 2273 files, with "key present … the denied-identifier check is on". A grep of the doc for other private identifiers also finds none. The CI leak gate job on this head is the authority.
  • docker compose config -q accepts deploy/docker-compose.yml merged with the doc's plugin service (rc 0); both resolve to muster:local, the plugin publishes 127.0.0.1:8080, and with --profile stt-cohere the STT image resolves to ghcr.io/zacxdev/muster-stt-cohere:local.

Verified locally against a throwaway hub (clankmail main 85b8d43), using the image built from this branch for the container commands. muster was replaced by a stub that answers the plugin routes, not a real server. Checked:

  • keygen, identity claim/grant, show, /health, peer verify and requests
  • a stranger is listed and not delivered
  • the hand-signed first message is delivered with sender_verified: true on its own root. This was checked with the earlier inline program. The step now uses send-first. Its own command, go run github.com/ZacxDev/clankmail/go/examples/send-first@48b0e4e with the doc's flags, was run against a throwaway local hub: it was accepted and printed an m_ id, and a 16385-byte body with --max-body 16384 was refused before sending. send-first was not re-run through two plugins.
  • an approved reply reaches the other side on the same root
  • the config, disabled-peer and E_AUTH strings in the troubleshooting table

The round-2 and round-3 text (compose service and exec forms, re-create steps, RBAC caveat) was not run end to end; only the compose config parse above was checked. The RBAC paragraph was checked against docs/provisioner.md, not against a live cluster.

Not verified: the hosted hub itself (no handle was claimed there), and a real muster's draft cards.

🤖 Generated with Claude Code

A step-by-step guide for pairing two operators' muster chiefs over
ClankMail with the muster-clankmail plugin: the trust model, keys and the
handle ceremony, the plugin token, running it beside muster (container,
compose, Kubernetes notes), pinning peers, the first message, day-to-day
approvals and key changes, and the error strings the plugin emits.

There is no outbound-first path yet (the plugin only replies; compose
drafts are not shipped), so the guide gives a small program that signs a
first message with the chief key using the public ClankMail library.

docs/plugins.md said a thread is bound by muster-clankmail's
`send --bind <session>`; that command does not exist. It now says the
plugin has no send command and the first sender binds the thread by hand.

Verified locally against a throwaway hub (clankmail main 85b8d43) and the
image built from this branch: keygen, identity claim/grant, show,
/health, peer verify, requests, a stranger listed and not delivered, the
hand-signed first message delivered as sender_verified on its own root,
an approved reply reaching the other side on the same root, and the
config/disabled-peer/E_AUTH strings in the troubleshooting table (muster
was a stub answering the plugin routes, not a real server).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Audit round 0 (requirements & deletion pass) at 0139caeb. Verdict: requirement questioned (Q1, waiting on the owner); deletion candidates D1, D2. Every error string, default and limit checked against origin/main matches; the plugins.md correction is right.

D1 — docs/clankmail.md:205-273: the embedded hand-signed first-message Go program; move it to an example in the ClankMail repo and link it (or replace it with "the operator's side sends the first message") instead of keeping untested code that handles the chief key in muster's public docs
D2 — docs/clankmail.md:60-61: the hard-coded "v0.134.0 and earlier" release boundary is already stale (v0.135.0 also lacks the plugin); drop the version number and keep only the `version` probe
Q1 — Until compose drafts ship, how should a thread's first message be sent: (a) the doc's copy-paste Go program, (b) a muster-clankmail send subcommand (which breaks the recorded "the plugin only replies; outbound comes from compose drafts" design in admin.go/replier.go/configuration.md), (c) only from the operator's side, the tester never sends first, or (d) not documented until compose drafts ship? · forcing: user

Ledger: round 0 · requirements: 6 (unattributed: 0, UNATTRIBUTED-UNKNOWN: 6) · deletion candidates: 2

@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Owner's decision on round 0's open premise:

Q1=answered: move the first-message program into the ClankMail repo as a small tested example command and link it from docs/clankmail.md; the operator's side sends the first message with it; the plugin stays reply-only until compose drafts ship

Replace the embedded hand-signed Go program in section 3 step 5 with a
link to the tested go/examples/send-first program in the ClankMail repo
(ZacxDev/clankmail#15) and its go run command. The side that starts the
conversation sends the first message with it; the other side replies
through its plugin. --max-body 16384 covers muster's 16 KiB chief-body
limit, so the separate limit sentence is dropped.

Drop the stale "v0.134.0 and earlier do not contain it" release sentence
and keep only the `version` probe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Audit round 1 (full checklist) at b0f5e3b8: one 🔴 (R1: the doc names the private deployment's hub domain; CI's leak gate refuses it), four 🟡 (Y1 merge order with ZacxDev/clankmail#15 and the branch link; Y2 no release yet carries the plugin or #409, compose image vars; Y3 "restart" does not pick up a changed CLANKMAIL_PEERS; Y4 the Kubernetes isolation advice needs the least-privilege layout and must name cluster-wide Secret read). Every command, flag, exit code and error string checked against origin/main and clankmail#15 matches.

1. R1: the hub's real domain removed from docs/clankmail.md; CI leak gate green with the key
2. Y1: send-first link points at tree/main, after clankmail #15 merged; go run …@main re-run
3. Y2: release/server minimum stated; compose MUSTER_IMAGE/MUSTER_VERSION and the plugin service's image given
4. Y3: "restart" replaced with re-create, for env changes to CLANKMAIL_PEERS
5. Y4: Kubernetes section requires the least-privilege layout and names cluster-wide Secret read

…hange, RBAC caveat

Round-1 audit fixes for docs/clankmail.md:

- R1: replace the private hub domain (9 sites) with the placeholder
  hub.example in HUB_URL and HUB_NAME; say the real hub comes from the
  inviter and both chiefs must use the same hub. leakscan with the
  denied-identifier key active: 9 findings at b0f5e3b, 0 here.
- Y2: no release (latest v0.135.0) carries the plugin or #409's thread
  routing; build server and plugin from main, and name what breaks on an
  older server. Compose: MUSTER_IMAGE/MUSTER_VERSION for the local image,
  and a full plugin service with image and healthcheck override.
- Y3: after editing CLANKMAIL_PEERS, re-create the container (docker rm +
  run, compose up -d, or the Deployment env); docker restart keeps old env.
- Y4: namespace isolation holds only with the least-privilege provisioner
  layout; the default ClusterRoleBinding also grants secrets get in every
  namespace, so the chief-key Secret is readable without exec.
- Nit: "unmarked (verified)" -> "marked sender_verified: true".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Round 0 dispositions: D1=applied (b0f5e3b: the embedded first-message program moved to ZacxDev/clankmail#15 as go/examples/send-first; this doc links it), D2=applied (b0f5e3b: the stale release-version sentence removed; only the version probe kept).

@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Audit round 2 (delta b0f5e3b8..af05f44e): R1, Y2, Y3 fixed; Y4 partially; one new 🔴 introduced by the delta (R-A: the doc claims the least-privilege layout isolates the plugin's namespace from muster-server's service account, but that layout's RoleBinding create + bind on muster-agent-namespace lets it grant itself Secret read in any namespace). Two 🟡 (Y-B: the verified-sender wording now contradicts SenderText; Y-C: the compose path breaks at pairing step 4). Y1 still deferred until ZacxDev/clankmail#15 merges.

R-A: docs/clankmail.md Kubernetes section no longer claims the least-privilege layout isolates the plugin namespace from muster-server's SA; states that rolebindings create + bind on muster-agent-namespace lets it grant itself secrets get/pods/exec in any namespace (and namespaces delete), and names what real isolation needs
Y-B: pairing "Confirm"/first-message text says the verified sender is unmarked in the chief's turn (no UNVERIFIED mark), not "marked sender_verified: true"
Y-C: pairing step 4 gives the compose form (docker compose exec muster-clankmail …) or the compose service publishes 127.0.0.1:8080
Y1: send-first link points at tree/main once ZacxDev/clankmail#15 merges (still deferred)

… compose exec

- R-A: a namespace of its own does not keep the chief key from muster in
  either provisioner layout. Default: muster's SA holds secrets and
  pods/exec everywhere. Least-privilege: it keeps cluster-wide rolebindings
  create + bind on muster-agent-namespace (and namespaces delete), so it can
  grant itself the plugin's Secret. Name what isolates it (another cluster,
  or the provisioner.md admission policy with the plugin outside the agent
  prefix and muster's namespace) and the consequence (a compromised
  muster-server can sign as @<owner>/chief). Same correction in
  configuration.md's admin-socket note.
- Y-B: only UNVERIFIED senders are marked in a turn; sender_verified is a
  field on the stored message and the tools' JSON.
- Y-C: compose exec form for the admin commands; publish 127.0.0.1:8080 on
  the compose service; kubectl exec form in pairing step 4.
- Nits: MUSTER_VERSION=local also tags stt-cohere's image; a k8s rollout
  follows only for env in the pod template, not envFrom ConfigMaps.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Re-post of the round-2 claims with numbered lines (the earlier block used letters, which the audit tooling cannot parse). Same claims, same audited tip.

1. R-A: docs/clankmail.md Kubernetes section no longer claims the least-privilege layout isolates the plugin namespace from muster-server's SA; states that rolebindings create + bind on muster-agent-namespace lets it grant itself secrets get/pods/exec in any namespace (and namespaces delete), and names what real isolation needs
2. Y-B: pairing "Confirm"/first-message text says the verified sender is unmarked in the chief's turn (no UNVERIFIED mark), not "marked sender_verified: true"
3. Y-C: pairing step 4 gives the compose form (docker compose exec muster-clankmail …) or the compose service publishes 127.0.0.1:8080
4. Y1: send-first link points at tree/main once ZacxDev/clankmail#15 merges (still deferred)

@ZacxDev

ZacxDev commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Audit round 3 (delta af05f44e..40d25575): no 🔴, so the ladder ends. R-A, Y-B and Y-C fixed and checked against provisioner.md, rolebinding.go and render.go; the admission-policy advice is sufficient against the read path. One 🟡 and one 🟢 fixed in a final commit without another round.

1. R-A: fixed — both RBAC layouts stated per provisioner.md/rolebinding.go; isolation requires another cluster or least-privilege + the provisioner.md ValidatingAdmissionPolicy with the plugin namespace outside the agent prefix and not muster's own namespace
2. Y-B: fixed — turn marks only unverified senders with UnverifiedSenderMark after the name; sender_verified is in plugin_messages_list/plugin_drafts_list JSON
3. Y-C: fixed — compose publishes 127.0.0.1:8080; step 4 gives docker, compose exec and kubectl exec forms
4. NEW 🟡: docs/configuration.md admin-socket remedy omits "not muster's own namespace" (a deploy-key Role grants secrets get there)
5. NEW 🟢: docs/clankmail.md rollout caveat names envFrom only; env valueFrom configMapKeyRef also does not roll

ZacxDev and others added 2 commits November 3, 2026 11:55
configuration.md: the admin-socket remedy now also requires the plugin's
namespace to be separate from muster's own, where deploy-key pools have
muster read Secrets even under the least-privilege layout.

clankmail.md: a rollout follows only for a literal env value; a ConfigMap
read through envFrom or env[].valueFrom.configMapKeyRef needs a manual
rollout restart.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ZacxDev/clankmail#15 merged and v0.3.1 is the first tag carrying the
example: the link now points at tree/v0.3.1 and the go run is pinned to
@v0.3.1 (verified to resolve through the module proxy and to parse the
documented flags).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ZacxDev
ZacxDev marked this pull request as ready for review November 3, 2026 18:49
@ZacxDev
ZacxDev merged commit 0782d00 into main Nov 3, 2026
37 of 38 checks passed
@ZacxDev
ZacxDev deleted the docs/clankmail-onboarding branch November 3, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant