@pwngh/economy-lab
    Preparing search index...

    Type Alias Principal

    Principal:
        | { kind: "user"; userId: string }
        | { kind: "system"; service: string }
        | { kind: "operator"; operatorId: string }

    Who is making a request, and what they are allowed to do. Three kinds: a user may act only on their own accounts; a system service is a trusted internal caller acting on the platform's behalf (its writes keep working through a maintenance pause); an operator is a human running a manual, fully-audited action — the only kind allowed to run adjust and reverse. Build one with userActor, systemActor, or operatorActor rather than hand-writing the tagged union.