Skip to content

docs(airc-rust): UUIDv4 for every identifier + three-field identity model (reopen of #659) - #663

Merged
joelteply merged 3 commits into
canaryfrom
feat/uuidv4-identifiers
May 19, 2026
Merged

joelteply merged 3 commits into
canaryfrom
feat/uuidv4-identifiers

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Reopen of closed #659 — same as #658, auto-closed by my branch-rename API call.

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."

  • Every internal id = UUIDv4 (EventId, IdentityId, ClientId, ChannelId, RoomId, FileId, LeaseId, SubscriptionId)
  • Generated locally with `Uuid::new_v4()` — no central authority
  • 122 bits entropy → collision-free across unbounded peers
  • Wire shape: canonical hyphenated string in JSON, raw bytes in binary
  • Rust API: `uuid` crate, newtype wrappers (`EventId(pub Uuid)`)
  • Names as mutable handles, UUIDs as identity — channels/peers/contracts can be renamed; the internal UUIDs that reference them stay valid
  • Three-field identity model: `identity_id` (UUIDv4, immutable) + `nick` (mutable display) + `role` (kind classifier: human/persona/agent/device/grid_node/bot)

No code change yet — typed-Uuid conversion follows as its own implementation PR once policy anchors.

🤖 Generated with Claude Code

joelteply and others added 3 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]>
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]>
@joelteply
joelteply merged commit c78486c into canary May 19, 2026
6 checks passed
@joelteply
joelteply deleted the feat/uuidv4-identifiers branch May 19, 2026 03:23
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