Files
loki/scripts
CatoandClaude Opus 5.5 95ec4a8375 feat(plans): CHF 15 / 40 / 90 with a monthly AI allowance, reservable until payments open (#1293)
* feat(plans): CHF 15 / 40 / 90 with a monthly AI allowance, reservable until payments open

The founder set the prices on 2026-10-17. Payments stay off until Loki's
company is registered, so everything up to the moment of paying works and
nothing is charged:

- config/plans.ts: Personal 15, Pro 40, Team 90 a month; each states its
  monthly allowance. The billing note says payments are not open and that a
  plan can be reserved with nothing charged.
- lib/plan.ts: PLAN_LIMITS.aiAnswersMonthly (1,000 / 3,000 / 8,000 at
  8,000 tokens an answer — about $0.002 each on a paid open model, a
  fraction of the price).
- lib/ai-budget/plan-allowance.ts + gate: past the daily free share, a paid
  plan's month still admits the turn. Read only after the share refused, so
  a free turn never pays for it; a failed read leaves the refusal standing;
  a lapsed or past-due plan has none.
- /pricing: four priced cards. A paid plan's button opens /pricing/<plan>,
  which reserves it (plan_reservations, one row per person, grants
  nothing) — and reads "Pay in Bitcoin" the day its OrangeCat pass exists.
- The out-of-answers refusal and the budget screen offer the plans beside
  the person's own key; Settings shows a plan's allowance left this month.
- Settings → Billing links each plan's reserve page; System → Revenue shows
  who is waiting on which plan, and counts only plans a settled pass pays
  for (a hand grant is "granted", not revenue).
- docs/architecture/models-and-money.md follows the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CG9dupSVqoXCCqKfBCfd9B

* test(ai-budget-gate): answer the plan read without a database

The gate now asks a paid plan's allowance after the share refuses. The
existing gate tests did not inject it, so where CI has a real Postgres the
default read opened a pool that kept the process alive and the runner
timed the file out. Every call now passes `planAllowance`, as the file
already does for the ledger and the capacity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CG9dupSVqoXCCqKfBCfd9B

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 01:08:13 +02:00
..
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00