import { type ActorContext, type Capability } from '../db/actor.js'
import { Seam } from '../seam.js'

/**
 * Request -> actor context. The other half of #11 decision 4.
 *
 * Capability is a ROUTING concern, not a component concern (#23 decision 1):
 * every route carries it, so a deep link cannot land in the wrong context.
 * The UI boundary and the authorization boundary are drawn in the same place.
 */
export interface Resolved extends ActorContext {
  tier: 'base' | 'pro' | 'enterprise'
  lapsed: boolean
}

/**
 * Entitlement is resolved HERE, once, into the same context object — and then
 * asserted per feature. It is never expressed as row visibility (#20).
 */
export function resolve(_req: Request, _capability: Capability): Resolved {
  throw new Seam('#35', 'session resolution and entitlement lookup')
}
