project: name: Heimdall status: active phase: first_provider_persistence premise: > Build Heimdall as one reusable GameCult auth authority service for OAuth, linked identities, local sessions, grants, and capability claims without mixing in app-domain audience or product data. objective: primary: > Create a shared auth authority service that Repixelizer, StreamPixels, and future GameCult-hosted experiments can consume. current: > Use the new stateful provider slice to land the first consumer verifier seam and harden key/token custody before app integrations start breeding fresh sludge. constraints: - Heimdall owns auth/control-plane authority; app-domain data stays app-owned by default. - Prefer a same-host Heimdall service on Yggdrasil over duplicated per-app provider stacks. - Host apps verify signed claims locally for routine guarded routes. - App profiles stay thin; the shared architecture note owns the main model. - StreamPixels audience and creator data must not be absorbed into a shared auth store. invariants: - The map is canonical and slow-changing. - Scratch is temporary and disposable. - Evidence is durable and distilled; routine activity logs belong in git history and commit messages. - Heimdall owns OAuth, local sessions, grants, entitlement refresh, capability evaluation, and audit surfaces. - App-domain data stays with the host app unless there is a deliberate, source-grounded reason to share it. - Host apps verify signed claims locally and keep resource ownership checks local. - StreamPixels can reuse shared auth authority without centralizing streamer-audience data. - Persistent state cruft is the same failure class as architecture cruft. data_flow: observe: - task request - shared architecture note - app profile bindings - current app/runtime seams in Repixelizer and StreamPixels - Yggdrasil host topology and nginx/service shape process: - rehydrate from canonical state - choose one bounded architecture or implementation slice - keep auth authority and app-domain data boundaries explicit - keep routine route auth local after claim verification - record only belief-changing evidence - commit or backtrack cut: - reject shared-data creep - reject duplicated auth blobs per app - reject per-request auth round-trip chatter active_subgoals: - Keep the shared architecture explicit and separate from app profiles. - Preserve the default boundary that app-domain data remains app-owned. - Align the plan to Heimdall as a Yggdrasil-hosted authority service. - Define the claim-verification contract that Repixelizer and StreamPixels will consume locally. accepted_design: - `docs/architecture.md` is the canonical shared architecture note. - `docs/service-contract.md` records the concrete HTTP/JWKS contract of the landed service slice. - `docs/app-profiles/*.md` are thin app bindings, not duplicate brains. - Heimdall owns provider OAuth, identity linking, signed local sessions, grants, entitlement refresh, capability evaluation, and audit events. - Host apps own their domain data, runtime state, and product-specific resources. - Host apps verify signed claims locally for routine route authorization. - A shared Heimdall store, if it exists, should hold auth/control-plane truth only. - Repixelizer is the first auth-blank hosted-app binding. - StreamPixels is the migration case that proves shared authority must not imply audience-data centralization. - The first service skeleton is a standalone TypeScript/Fastify app with Ed25519 JWT signing, JWKS discovery, signed OAuth `state`, and app-profile-driven shared capability evaluation. - The first stateful slice adds durable auth/control-plane storage plus a real Discord callback path for Repixelizer. landed_baseline: - Shared architecture extracted into its own repo and renamed to Heimdall. - Repixelizer and StreamPixels app-profile notes created. - Repo-local state, handoff, and compaction scaffolding created. - Initial Heimdall service skeleton landed with discovery, JWKS, OAuth start/callback contract surfaces, and claim issuance scaffolding. - Durable auth persistence landed for accounts, linked identities, sessions, grants, entitlement snapshots, and audit events. - The first real provider slice landed for Discord callback exchange, identity resolution, entitlement evaluation, and session/claim issuance for Repixelizer. - Signing-key persistence/bootstrap, managed token encryption at rest, and a local verifier seam landed for the first real consumer integration pass. - Direct backend callback handoff landed as the preferred same-host app-consumer path, with browser completion-code exchange retained as fallback. rejected_paths: - name: per_app_auth_copy_paste reason: duplicates the same provider/session sludge across every experiment - name: per_request_auth_round_trip reason: turns shared auth into a noisy bottleneck instead of local claim verification - name: shared_user_data_swamp reason: reusing auth mechanics does not justify centralizing app-domain audience or product data current_status: summary: Heimdall now has a hardened first provider slice plus a direct app-backend handoff path: TypeScript/Fastify runtime, Ed25519 JWT signing with file-backed key support, JWKS/discovery exposure, signed OAuth start-state handling, durable auth/control-plane persistence, a real Discord callback path, AES-256-GCM token sealing for managed provider credentials at rest, a local JWT verifier seam for app backends, direct backend callback delivery for same-host consumers, and the older one-time completion-code exchange retained as fallback. The key boundary still holds: Heimdall owns auth/control-plane authority and credential custody; app-domain bindings and runtime behavior remain app-owned. next_action: Consume the hardened slice in the first real Repixelizer integration: open auth in a new browser context, let Heimdall deliver the result directly to a Repixelizer backend callback endpoint keyed by a local auth attempt, trust Heimdall claims locally through the verifier seam, and add any tiny app-local session bridge or attempt-status surface needed without dragging app-domain data into Heimdall.