A subscription signs itself in again.

Skarbiec keeps each subscription's grant, knows when it needs a sign-in, and asks Weles through Stado to sign the account in, so a refused or missing grant is replaced without a person pasting a token.

What a subscription is here#

A subscription is a live item tagged brama:subscription. Its brama:provider: tag names the provider and its brama:id: tag the subscription id; a brama:login: tag names the login item the account signs in with, and a subscription that names none is signed in with the login of the account Weles resolves it to (weles accounts list names it). The grant the provider issued when the account signed in is the item's value field, a JSON document. Skarbiec judges a grant on being present, a JSON document with credential material in it, and on when its access token ends, read where its provider keeps it: Claude Code's claudeAiOauth.expiresAt in milliseconds, Kimi's expires_at in seconds, Codex's access token's own exp claim. skarbiec subscription list shows that moment as access_ends_at.

When a grant is due#

A grant is due a sign-in when the item holds none, when a consumer that presented the grant recorded that the provider refused it (skarbiec subscription refuse, or POST /v1/subscriptions/refused with report:subscriptions), or when its access token ends before another pass could sign it in: before the next firing of the Stado schedule running the pass (STADO_SCHEDULE_NEXT_DUE_AT), or, for a command a person runs, before now. Brama renews the grants it uses while the provider still renews them and writes each renewed grant back to the item, so a grant still ending by then is one nothing renewed. A refusal applies to the grant the item holds when it is recorded: a later sign-in writes a new revision, and the refusal no longer applies.

A consumer holds one capability for this, report:subscriptions: it covers every live subscription item, including one donated or bought after the grant was issued, so no list of items has to follow the vault, and it reads no grant. Brama's launcher issues it to brama-subscription-reporter at each start, with the bearer kept in that user's Stado home.

Who signs it in#

skarbiec subscription run, and every skarbiec maintain pass on the vault owner, ask Stado's browser-automation family for its subscription-sign-in operation. Skarbiec names no Weles address and starts no Weles program it found; Stado runs the alternative that answers the family, today Weles's weles accounts refresh, which first redeems the refresh token the grant holds at the provider, with no browser, and signs the account in on its own browser host only when the provider no longer renews it; either way the new grant is stored on the same item. The sign-in counts only once the vault holds a newer revision of the item with another grant than the one it held before, read after Weles answered.

Before Stado is asked, the login is judged as skarbiec login factor list judges it: a login whose sign-in asks for an authenticator code the vault keeps no seed for, or a seed that computes none, is refused naming that (unsignable), so no browser starts for a code nobody can compute; skarbiec totp set adds the seed, which releases it.

A sign-in Weles ran and the provider or the account refused is held: it is not asked for again until the refusal, the item, its login item, its tags or what blocks it change, or an operator asks for it with --now. A failure asking again can change (Weles or its host unreachable, no Stado here) leaves the grant due, and the next pass asks again. A replica signs nothing in; its source does.

Every sign-in that fails is recorded as a defect of Skarbiec in the register Stado's work-registers family names for it (stado capabilities resolve work-registers --consumer skarbiec, Oko today), once per footing it failed on: the same failure met again on every pass while Weles is unreachable is recorded once. The subscription's last_report says what the register answered, or why nothing was recorded (register-unresolved: no alternative answers the family here; register-refused: the register did not take it), and the next attempt offers it again.

What tells you why#

skarbiec subscription list shows each grant, when its access token ends (access_ends_at), whether it is due and why, whether it is held and on what refusal, what blocks a sign-in (no single provider or id tag, more than one login tag, a login item that is gone, a second factor the vault keeps no seed for), the last attempt with its status and error, and what the defect register answered for its last failure (last_report). A consumer with report:subscriptions reads the same row for one subscription with POST /v1/subscriptions/standing; Brama quotes it when it refuses a request because every credential was rejected. A run that fails exits 1 naming each subscription and its cause; skarbiec maintain fails with the same reasons and posts them where alert set points.