Skip to content

docs(airc-rust): UUIDv4 for every internal identifier — mesh-native discipline - #659

Closed
joelteply wants to merge 2 commits into
canaryfrom
docs/airc-rust-uuidv4-identifiers
Closed

joelteply wants to merge 2 commits into
canaryfrom
docs/airc-rust-uuidv4-identifiers

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Per Joel: "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 to the design doc, before "Names + identity."

Policy

  • Every internal id (EventId, IdentityId, ClientId, ChannelId, RoomId, FileId, LeaseId, SubscriptionId) = UUIDv4
  • Generated locally with `Uuid::new_v4()` — no central authority, no coordinator
  • 122 bits of entropy → collision-free across unbounded peers
  • Privacy-friendly: random, leaks nothing about generator
  • Cross-language: 32-char hex / 16 bytes, every parser available
  • Wire shape: canonical hyphenated string in JSON, raw bytes in binary
  • Rust API: `uuid` crate, newtype wrappers (`EventId(pub Uuid)`)
  • No alternative id schemes: no timestamp-prefixed, no human-hash runtime ids (display nicks only), no content-addressed runtime ids (blobs only via ContentHash)

Why this matters for the mesh

P2P substrate requires globally-unique IDs that no central node assigns. UUIDv4 fits perfectly — peers generate locally, ids stay stable across replay/audit/cross-transport routing, no re-keying when envelopes hop between transports.

What's NOT in this PR

  • No code changes. Existing airc-core uses `EventId(pub String)`; the typed-Uuid conversion lands as a follow-up implementation PR after this doc anchors the policy.
  • No `uuid` crate dependency change yet.

🤖 Generated with Claude Code

joelteply and others added 2 commits May 18, 2026 16:33
…iscipline

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]>
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]>
@joelteply joelteply closed this May 18, 2026
@joelteply
joelteply deleted the docs/airc-rust-uuidv4-identifiers branch May 18, 2026 21:39
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
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