[RFC] Owner / identity seam and server-only persistence (tracking)
Author: wyucCreated Sep 23, 2026Updated Sep 29, 2026
Labelstype:rfcarea:storage
Tracking issue for the RFC in Discussion #1657. Design discussion happens there; this issue tracks the phased work.
Scope
- One pluggable
OwnerAuthenticatorseam for routes, Server Actions and background runners. Built-ins:anonymousCookie(default),sharedTeam,trustedProxyHeader(real accounts through an identity gateway). No built-in accounts, no native OIDC client, no teacher/student roles in core. - Server persistence as the only durable store, with an embedded PGlite fallback when
DATABASE_URLis unset. Browser IndexedDB keeps only device preferences and caches.
Phases
- 1. Seam + built-ins reproducing today's behavior; fold the three owner resolvers; replace
anon:prefix checks withkind/ roles - 2. Runtime learner key from the principal (drop
x-learner-key/ dev token on the server path); per-owner asset principal;trustedProxyHeader; runtime tombstone guard - 3. Host hooks:
onCreate/authorizeCreate,LibraryProvider,beforeAssetAllocate,configureAssetByteStore - 4. PGlite default +
OPENMAIC_REQUIRE_DATABASE_URL; removeNEXT_PUBLIC_PERSISTENCE; library without the agent runtime; browser → server import (courses, media, folders) - 5. Tenancy in
stage_metaonly - 6. Claim registry,
owner_merges, identity lock - 7. Versioned SQL migrations per store
- 8. Remove the Dexie persistence path after the import window
Related: #23, #237, #582, #585, #596, #1129, #1413, #1550
Source: THU-MAIC/OpenMAIC