Skip to content

docs(swarm): SWARM_SPEC.md v1 — wire-format contract (closes #74)#78

Merged
Dewinator merged 1 commit into
mainfrom
agent/issue-74-2026-04-27T18-31-33-183Z
Apr 27, 2026
Merged

docs(swarm): SWARM_SPEC.md v1 — wire-format contract (closes #74)#78
Dewinator merged 1 commit into
mainfrom
agent/issue-74-2026-04-27T18-31-33-183Z

Conversation

@Dewinator
Copy link
Copy Markdown
Owner

Summary

  • Adds docs/SWARM_SPEC.md v1.0 — the wire-format contract for the decentralized mycelium swarm.
  • Spec-only (no code, no migrations). Future swarm phases (1–9) implement against this single contract.
  • Restates the three unverletzlichen Designprinzipien (Souveränität, Generalisierung-vor-Sharing, Diversität) at the top so every later phase can be checked against them.

Research summary

  • Existing docs/ style mirrors affect-observables.md and middleware.md — design-doc voice, mermaid where it earns its keep, explicit rejection rules.
  • No prior SWARM* material in the repo; closest precedent is the older engram-mcp Stand 2026-04-23 commit 925b6f9 docs swarm roadmap referenced in vector-memory.
  • Recall surfaced the Schwarm-These (3acb8bb1-…): "Diversität ist nicht reproduzierbar — kein GPU-Count schlägt sie." Encoded directly into Designprinzip 3 and the rejection-rule design (no convergence pressure).
  • RFC 8785 (JCS) is the only widely-implemented JSON canonicalization with reference libraries in JS, Rust, Go, Elixir — picked for v1. Implementer-warning subsection added because ECMAScript number serialization on float[768] embeddings is the obvious footgun.
  • Ed25519 chosen as the only signature algorithm in v1; key rotation explicitly deferred to v2 to keep node_id = multihash(pubkey) self-certifying.

What this does NOT do

  • No implementation of any wire type — that is the next 9 swarm phases.
  • No DB migrations, no schema changes, no MCP tool changes.
  • No transport beyond HTTPS — no libp2p, no DHT, no WebSocket push, no NAT traversal, no key rotation, no encrypted-record envelope, no differential privacy. All explicitly listed in §6 as out-of-scope-for-v1.
  • No README.md cross-link or other repo-wide doc reshuffle. Easy follow-up if desired.
  • No change to CONSTITUTION.md.

Constitution affirmation

This spec touches:

  • Pillar 1 — Decentralized, networked AI → reinforced. Discovery via .well-known + gossip; no central registry; every endpoint optional; offline is the default-correct state.
  • Pillar 3 — Swarm intelligence → reinforced. Lesson and HubAnchor are the units that let many specialized nodes pool knowledge without flattening difference; the Generalization rule (§3.1) keeps episodic diversity local.
  • Pillar 6 — Cyber security → reinforced. Every wire record is signed (Ed25519 over JCS), node_id is self-certifying via multihash, transport is TLS-only, rejection rules are uniform across implementations.

No pillar is weakened. Pillars 2, 4, 5 are not touched and continue to be governed by their respective subsystems.

Test plan

  • Read docs/SWARM_SPEC.md end-to-end.
  • Verify the three Designprinzipien in §0 match the recalled Schwarm-These memory and the Constitution.
  • Pick one wire type (e.g. Lesson) and try to derive a Postgres column list from §3.1 alone — should be unambiguous (uuid, text, vector(768), int, text, timestamptz, bytea, timestamptz, text[], text). If two reviewers get different types, the spec failed acceptance criterion N2: Middleware-Skelett (Reverse-Proxy vor dem Gateway) #2.
  • Confirm mermaid block in §7 renders on GitHub.
  • Confirm §6 lists every deferred concern from the issue body (NAT, libp2p/DHT, WebSocket, key rotation, encrypted transport beyond HTTPS, differential privacy).

Spec-only first phase of the Mycelium Swarm Foundation Plan v1. Defines
spec versioning, JCS (RFC 8785) over Ed25519 for signatures, the four
wire types (Lesson, HubAnchor, NodeAdvertisement, TrustEdge), four
HTTP/JSON endpoints, and uniform rejection rules. No code, no migrations.

Restates the three unverletzlichen Designprinzipien (Souveränität,
Generalisierung-vor-Sharing, Diversität) at the top so all later phases
implement against the same contract and the same constraints.

Closes the Phase-0 deliverable of issue #74.
@Dewinator
Copy link
Copy Markdown
Owner Author

The conductor auto-merger will not merge this PR for the following reason(s):

  • mergeStateStatus=UNKNOWN

Resolve the blockers (or remove the agent-opened label for human review) to proceed.

1 similar comment
@Dewinator
Copy link
Copy Markdown
Owner Author

The conductor auto-merger will not merge this PR for the following reason(s):

  • mergeStateStatus=UNKNOWN

Resolve the blockers (or remove the agent-opened label for human review) to proceed.

@Dewinator Dewinator merged commit 2fef277 into main Apr 27, 2026
@Dewinator Dewinator deleted the agent/issue-74-2026-04-27T18-31-33-183Z branch April 27, 2026 21:49
Dewinator added a commit that referenced this pull request Apr 29, 2026
The cryptographic foundation of the swarm (SWARM_SPEC v1, Ed25519
signing, JCS canonicalization, wire-validator, .well-known discovery,
peer/signed-record storage — PRs #78,#79,#81,#82,#85,#89,#91,#92) was
landing on main while the README/MANIFESTO still claimed
"pairing/swarm/federation deferred". This commit fixes that mismatch.

README (EN+DE):
- new "Swarm — federation in flight" section with merged-PR table
  and a "what is next" subsection pointing to the swarm label
- Roadmap rewritten: phase 4-5 from "deferred" to "Phase 1 shipped"
- existing /.well-known/mycelium-node block folded into the new section
- promo video as a clickable poster near the top, served from a
  v0.4-swarm-phase-1 GitHub release asset (14 MB H.264 1080p)

MANIFESTO (EN+DE):
- "What is built today" split into brain core + Swarm Phase 1
- aspirational Tailscale+mTLS / mutual-pairing claims removed; those
  pieces remain on archive/swarm-deferred as historical reference
- "What is not built yet" sharpened to the social layer (verification,
  reputation, banishment-by-consensus, Sybil resistance) plus
  micro-transactions

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-opened Opened by the autonomy loop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant