Public And Internal Identifier Strategy

Summary

Before v1 release, AgentInbox should stop using long prefix_uuid identifiers for durable records and move to one canonical short-ID scheme.

This is a pre-release cleanup, not a compatibility exercise.

The intended outcome is:

After this change, the repository should use only two identifier styles:

Numeric fields remain only where they are truly ordering or revision fields, such as sequence, revision, and event offsets.

Problem

Today the repository mixes several identifier schemes:

That has several costs:

Because v1 has not yet shipped, this is the right time to cleanly reset the identifier rules instead of preserving pre-release compatibility.

Goals

Non-Goals

Core Design

1. Fresh v1 Databases Use The New Scheme Only

#139/#140 already defined the storage reset boundary for pre-v1 data.

That means this RFC can be simpler:

This RFC therefore defines the canonical ID rules for the database shape that ships as v1.

2. Canonical Prefix Table

The repository should standardize on these canonical prefixes:

This is not just documentation. The code should be updated to use these prefixes consistently.

In particular, this RFC intentionally changes current implementation prefixes such as:

3. Agent IDs Use Readable Names

agentId is the one durable identifier that should default to a readable name instead of a random token.

Default generated shape:

Example:

Generation rules:

This preserves:

Explicit user-supplied agentId remains supported and is not rewritten.

4. All Other Durable IDs Use Short Random Tokens

All other durable identifiers should use one short-token family:

Recommended token properties:

Examples:

The exact token generator can be an implementation choice, but the product rule is:

5. Database Storage Matches Public Shape

Durable IDs should be stored in the database exactly as they are exposed through CLI and HTTP.

That means:

The repository should no longer maintain a special “integer in DB, prefixed ref at the boundary” path for durable IDs.

This simplifies:

6. Entry And Thread Keep Numeric Ordering Fields, Not Numeric IDs

InboxEntry and DigestThread no longer need special integer identity rules.

Instead:

If ordering is needed, keep it in dedicated numeric fields:

This preserves the useful part of the current design:

without preserving the confusing part:

7. Internal Durable IDs Follow The Same Short-ID Family

The following internal-but-durable IDs should also move off UUIDs and use the same canonical short-ID family:

They do not need readable names, but they should still follow the same prefix + short-token rule as other durable IDs.

This keeps the system from mixing:

for durable records.

Operational Consequences

Once implemented:

Open Coding Rule

After this RFC: