Skip to content

RFC: users capsule (astrid:users@1.0.0)#28

Open
joshuajbouw wants to merge 3 commits into
mainfrom
feat/users-capsule-rfc
Open

RFC: users capsule (astrid:users@1.0.0)#28
joshuajbouw wants to merge 3 commits into
mainfrom
feat/users-capsule-rfc

Conversation

@joshuajbouw

Copy link
Copy Markdown
Contributor

Summary

Extracts the cross-platform user identity directory out of the kernel
into a first-party capsule (`astrid-capsule-users`) that publishes the
`astrid:users@1.0.0` IPC interface. The kernel keeps principal-level
tenancy; the capsule owns within-principal user attribution —
`AstridUserId`, `FrontendLink`, and the resolve / link / unlink /
create / list / get / delete surface.

The RFC defines:

  • The IPC topic schema (`users.v1..{request,response}`).
  • The `source` envelope (`channel`, `user-id?`, `correlation-id`)
    for multi-tenant uplink routing — local to this interface until
    feat(api): structured admin/client API — typed commands, multi-tenant correlation astrid#748 hoists it.
  • The KV storage layout (key scheme byte-compatible with the legacy
    `astrid-storage::identity` store; value shapes follow the WIT
    contract).
  • Validation invariants (`/` and `\0` forbidden in platform /
    platform-user-id key components).
  • The kernel-side cutover plan that strips
    `astrid-core::identity`, `astrid-storage::identity`, the host fn
    module, the manifest capability, and rewrites the SDK wrappers.

Tracks astrid-runtime/astrid#747.

Related branches:

  • `unicity-astrid/wit#feat/users-interface` — interface definition.
  • `unicity-astrid/capsule-users#feat/initial-scaffold` — implementation.
  • `unicity-astrid/sdk-rust#feat/users-interface` — Rust bindings.
  • `unicity-astrid/sdk-js#feat/users-interface` — JS bindings.

Test plan

  • RFC discussion in PR comments.
  • Reviewer signoff on naming (`astrid:users@1.0.0`, `users.v1.*`
    topic prefix, `source` envelope shape).
  • Reviewer signoff on cutover plan (delete order, SDK wrapper
    migration).
  • Open questions resolved: auto-create on first resolve, role
    markers, sync vs async SDK shape, #748 envelope hoisting.

Extracts the cross-platform user identity directory out of the kernel
into a first-party capsule that publishes the astrid:users@1.0.0 IPC
interface. Defines the topic surface (users.v1.<op>.{request,response}),
the source envelope (channel, user-id, correlation-id) for multi-tenant
uplink routing, the KV storage layout (compatible with the legacy
astrid-storage::identity store), and the kernel-side cutover plan.

Tracks astrid-runtime/astrid#747. WIT lives in
unicity-astrid/wit#feat/users-interface. Capsule scaffold lives in
unicity-astrid/capsule-users#feat/initial-scaffold. SDK bindings
shipped in unicity-astrid/sdk-rust#feat/users-interface and
unicity-astrid/sdk-js#feat/users-interface.
…e shapes follow WIT

The earlier 'identical to the legacy store' phrasing was overstated.
Three deliberate value-shape divergences (public_key list vs base64,
ms vs us timestamp precision, dropped principal field) come from
following the WIT contract instead of the kernel's chrono+serde
defaults. Pre-launch the divergence is academic; spell it out so the
cutover migration tool knows what to translate.
…ing, pagination

Rewrites the reference-level section against the shipped
astrid:users@1.0.0 surface (post astrid-runtime/wit#6):

  - source.uplink (was source.channel)
  - platform-instance scoping for Slack/IRC/XMPP (with per-platform
    table mapping audit findings to wire shapes)
  - frontend-link.display-name (platform-side global name)
  - set_display_name / set_public_key topics (UUID-preserving mutation)
  - paginated list_users, context.list_for_user, context.list_in_context
  - per-context display-name overlay (ContextIdentity record + 5
    context.* topics)
  - context-aware resolve with three-layer fallback chain
  - 15 topic pairs total; cascade semantics for unlink and delete_user

New sections: 'Identity model' visual, 'Platform-instance scoping'
audit table, 'Context-aware resolve' fallback documentation, 'Why a
two-layer identity model' rationale, 'Why platform-instance as a
dedicated field' rationale. Storage-layout section adds the
context/ key family + sentinel rule.

Open questions extended with resolve_or_create (filed as astrid#749),
merge-users, and the persisting role-markers / authz boundary.
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