Repository navigation
Conversation
…rs dictionary
Per the real-time conversation with Codex + Joel: body_hint was the
right idea but the wrong shape. The clean primitive is a string-keyed
headers map on the envelope (HTTP analogy), not a single typed field.
Changes:
- Envelope.body_hint (single optional field) → Envelope.headers
(`BTreeMap<String, String>`)
- Subscription.body_hint → Subscription.headers (header-keyed
match patterns with Exact/Prefix variants)
- Storage `messages.body_hint` column → `messages.headers` JSONB
- Storage `subscriptions.body_hint_or_null` → `subscriptions.header_filters`
Namespace convention (no schema coordination needed):
- airc.* — substrate-owned: trace_id, priority, reply_to,
content_encoding, deadline, lease, auth_scope, pii
- forge.* — alloy/contract: body_hint (e.g. "forge.work.offer"),
requires_capability (e.g. "render.gpu"), persona.tier
- continuum.* — continuum-specific: persona_id, activity
- openclaw.*, hermes.*, etc. — other consumer ecosystems
- x-* — experimental / private headers
BTreeMap chosen over HashMap for:
- deterministic ordering (signatures + replay + diff-tests stable)
- simple serialization (sorted keys, predictable JSON)
- unknown-header pass-through (transports just copy the map)
- no schema churn when middleware adds new headers
Rules added:
- "Authority rule": routing/admission decisions trust the headers.
Body MAY contain its own kind field as local ergonomics for
consumers that already parse the body — substrate never consults
body fields. Headers are canonical.
- "Extensibility rule": consumers add new headers without
coordinating with airc-rust. Other consumers ignore unknown
headers.
- "Encryption note": when body is encrypted under recipient key
(double-ratchet), routers can't read body. Headers stay
accessible (only authenticated via signature, not encrypted).
That's how routing remains efficient under E2E encryption.
- "Ergonomic helpers, plain strings underneath": Rust API exposes
typed accessors (e.g. `envelope.body_hint() -> Option<&str>`
reads `forge.body_hint`) without changing the wire format.
Storage/transport see plain BTreeMap.
Sweep: all body_hint references through the doc (Subscription
examples, security PII tagging, presence announce, WebRTC signaling,
appendix C automation engine) now use the headers map shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 18, 2026
joelteply
added a commit
that referenced
this pull request
May 19, 2026
… (reopen of #658) (#662) docs(airc-rust): replace single body_hint field with HTTP-style Headers dictionary Per the real-time conversation with Codex + Joel: body_hint was the right idea but the wrong shape. The clean primitive is a string-keyed headers map on the envelope (HTTP analogy), not a single typed field. Changes: - Envelope.body_hint (single optional field) → Envelope.headers (`BTreeMap<String, String>`) - Subscription.body_hint → Subscription.headers (header-keyed match patterns with Exact/Prefix variants) - Storage `messages.body_hint` column → `messages.headers` JSONB - Storage `subscriptions.body_hint_or_null` → `subscriptions.header_filters` Namespace convention (no schema coordination needed): - airc.* — substrate-owned: trace_id, priority, reply_to, content_encoding, deadline, lease, auth_scope, pii - forge.* — alloy/contract: body_hint (e.g. "forge.work.offer"), requires_capability (e.g. "render.gpu"), persona.tier - continuum.* — continuum-specific: persona_id, activity - openclaw.*, hermes.*, etc. — other consumer ecosystems - x-* — experimental / private headers BTreeMap chosen over HashMap for: - deterministic ordering (signatures + replay + diff-tests stable) - simple serialization (sorted keys, predictable JSON) - unknown-header pass-through (transports just copy the map) - no schema churn when middleware adds new headers Rules added: - "Authority rule": routing/admission decisions trust the headers. Body MAY contain its own kind field as local ergonomics for consumers that already parse the body — substrate never consults body fields. Headers are canonical. - "Extensibility rule": consumers add new headers without coordinating with airc-rust. Other consumers ignore unknown headers. - "Encryption note": when body is encrypted under recipient key (double-ratchet), routers can't read body. Headers stay accessible (only authenticated via signature, not encrypted). That's how routing remains efficient under E2E encryption. - "Ergonomic helpers, plain strings underneath": Rust API exposes typed accessors (e.g. `envelope.body_hint() -> Option<&str>` reads `forge.body_hint`) without changing the wire format. Storage/transport see plain BTreeMap. Sweep: all body_hint references through the doc (Subscription examples, security PII tagging, presence announce, WebRTC signaling, appendix C automation engine) now use the headers map shape. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
joelteply
added a commit
that referenced
this pull request
May 19, 2026
…odel (reopen of #659) (#663) * docs(airc-rust): UUIDv4 for every internal identifier — mesh-native discipline Per Joel's directive: "use the hell out of uuidv4 — uuid is so much cleaner for the global nature of this system, literally p2p mesh based." Adds an "Identifiers — UUIDv4 everywhere" section documenting the identifier policy: - Every internal id (EventId, IdentityId, ClientId, ChannelId, RoomId, FileId, LeaseId, SubscriptionId) is UUIDv4 - Non-negotiable for P2P mesh: peers generate locally without a coordinator, 122 bits of entropy makes collision negligible, privacy-friendly (no timestamp/MAC leakage) - Wire: serde encodes Uuid as the canonical hyphenated string for JSON envelopes + cross-language interop - Rust API: `uuid` crate, `Uuid::new_v4()` at generation, newtype wrappers (e.g. `EventId(pub Uuid)`) for compile-time type safety - What changes from existing airc-core: tighter typing (currently `EventId(pub String)`), parse-on-ingest (malformed id fails at envelope deserialization, not later in routing), clear policy - No alternative id schemes: no timestamp-prefixed ids, no human-hash-derived runtime ids (those stay for display nicks only), no content-addressed runtime ids (those are blobs only via ContentHash) Inserted before "Names + identity" section since IDs underlie the identity model. Lands on canary independently — no dependency on the headers PR (#658). Implementation work (changing the existing `EventId(String)` newtypes to `EventId(Uuid)` and adding the uuid crate dep to airc-core) follows as its own PR after this doc lands. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(airc-rust): names as mutable handles, UUIDs as identity Per Codex's framing: human-readable names (#general, helper, foundry-mac, forge.work.offer) remain throughout the system, but they are mutable handles on top of immutable UUIDv4 identity. A channel #general is displayed by name but referenced internally by its ChannelId(Uuid). A peer "helper" is the same identity even after a NICK rename. Renaming a forge contract from work.offer to work.bid is a name-layer concern; the internal UUIDs that referenced it stay valid. Plus the full UUIDv4 application list (identities, channels/rooms, envelopes/events, blob manifests, sessions/calls, commands/tasks, replay fixtures, work leases) for clarity. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(airc-rust): three-field identity model (id + nick + role) Per Codex's framing: an airc Identity carries three load-bearing fields plus the existing display metadata. identity_id : 9d8c4f7e-... — UUIDv4, mesh-stable, immutable nick : helper-ai — mutable display, room-scoped, can collide role : persona — kind classifier (human|persona|agent|...) The three are intentionally orthogonal: - identity_id is the cross-machine pointer (leases, permissions, audit, replay all cite this — never changes for life of identity) - nick is the human-readable handle (mutable, renames normal, collisions tolerable — substrate disambiguates via identity_id) - role is the kind classifier (consumer UI renders appropriately; substrate doesn't interpret beyond pass-through) Folded as a subsection of "Names vs identity" within the UUIDv4 section since it's the concrete model the names-vs-identity rule manifests as. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 28, 2026
Closed
Merged
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reshapes the envelope-metadata model per the iterative refinement with Joel and Codex on AIRC:
Why the dictionary won over a typed struct
Joel's framing made this concrete: this is the same pattern web HTTP has used for decades. X-headers, Content-Type, middleware that reads only what it understands and passes the rest through unchanged. Typed top-level fields hard-code every concern into the substrate schema; a string-keyed dictionary stays extensible.
Routing/middleware never parses the body — it inspects headers. Even with E2E encryption (body encrypted under recipient key) the headers stay accessible because they're authenticated by signature, not encrypted. That's how routing efficiency survives under double-ratchet.
Rules locked
What changed in the doc
Test plan
🤖 Generated with Claude Code