A resolved plan plus its provenance. The plan here is only ever used for
display and for gating hosted surfaces — it never gates a local
capability (Local-Free Invariant; the local engine has no entitlement checks).
Result of a successful Wrapped publish (POST /api/wrapped). The edit_token is returned
(and must be stored to delete/claim later) only on a fresh insert; on a signed re-publish
the server updates the existing card in place and omits it (the client keeps the stored one).
Days a cached plan keeps granting its hosted entitlements while the billing
backend is unreachable. Generous on purpose: a network blip or a weekend
offline must never silently demote a paying user to Free.
The cached plan, if any. Prefers the structured plan.json; falls back to a
legacy plan.txt (no timestamp → verified_at = 0, i.e. immediately past
grace until the next successful refresh re-stamps it).
Publish a whitelisted Wrapped payload. Accepts either a bare payload (legacy anonymous) or a
signed envelope {payload_json, public_key, signature} (login-less identity → server upsert).
No account auth; the server rate-limits per IP. Contract: docs/contracts/wrapped-permalink-v1.md.
Push gotchas as a zero-knowledge vault (GL #467 follow-up): sealed
client-side under the gotcha-vault-v1 HKDF domain — the backend stores
ciphertext only and purges the account’s legacy plaintext rows on the
first vault push.
Push the knowledge store as a zero-knowledge vault (GL #467): entries are
sealed client-side (XChaCha20-Poly1305, domain-separated HKDF key) — the
backend stores ciphertext and can never read them. The first vault push
also purges the account’s legacy plaintext rows server-side.
Best-effort live resolve: try the backend (refreshing the cache on success),
otherwise fall back to the cached-with-grace plan. Suitable for explicit
commands like lean-ctx billing status where a network round-trip is fine.
Resolve the effective plan from the local cache only (no network),
applying the offline-grace policy. Use this on hot paths (dashboard
requests); use refresh_effective_plan when a live confirmation is
acceptable.
Start a Stripe Checkout session for the logged-in account and return the
hosted URL to open. plan is e.g. "pro" or "team"; interval is
"monthly" or "yearly". The open backend proxies this to the private
billing plane (which returns 503 when billing is not configured).