Files
orangecat/docs
CatoandClaude Fable 5.1 30ed087aef feat(bots): a bot writes first on the person's own key, and can ask Loki as them (#1503)
* feat(bots): a bot writes first, on the person's own key

A person can tell one of their bots to write first, every day at a time
they pick, with a prompt they wrote. The run happens on the person's own
OpenRouter key only; without a key the routine is kept, shown as waiting,
and skipped with the reason, so no platform key is ever spent by a timer
(fleet standing rule 2026-09-25).

- companion_routines table (one per person per bot, owner-only RLS),
  routines-store (time validation, next run in the person's zone) and the
  runner behind a cron route + 15-minute systemd timer, registered as a
  person-asked timer in the no-background-ai gate with a marker check.
- GET/PUT/DELETE /api/ai-assistants/[id]/routine for the owner.
- RoutineRow in a bot's own chat: "Writes first, every day", time and
  prompt inline, a line to Settings when a key is missing.
- Hands: the proposal line names what will be set up, never only "Sure";
  a created event's outcome carries its link.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(bots): a bot can ask Loki, as the person — the first connector

ask_loki: a Cat action (communication, low risk, confirmed) in the hands
launch set. The bot relays a question over the signed OrangeCat → Loki rail
to Loki's POST /api/orangecat/ask, which runs a read-only turn as the Loki
user linked to the actor; Loki's own sentence is the outcome the person
reads, and a refusal (no linked account, a spent budget) is relayed as
written. A relayed question can never dispatch, approve or spend: that stays
with send_task_to_loki, and the two verbs name each other so a question is
never dispatched as a task.

ADR-0013: D6 first connector and D7 recorded as shipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(bots): the routine's day-in-zone comes from the timezone helper

check:app-locale (new on main) refuses a literal locale handed to Intl; the
routine's next-run computation now takes the day in the person's zone from
instantToWallTime, the one rendering the app already trusts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(bots): the chip knows the verb of ask_loki

The tool-label table of leading verbs gains ask → Asking / Asked, so the
chip for a bot's question to Loki never falls back to the generic label.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 07:40:33 +01:00
..

OrangeCat Documentation

Documentation for the OrangeCat platform. Start with the area you need.

Area What's inside
getting-started/ First-time setup and orientation
architecture/ System design, entity model, the Cat, ADRs (adr/), DB schema (SUPABASE_SCHEMA_GUIDE.md)
development/ Day-to-day dev: standards, contributing, guides, examples, templates, components
operations/ Running prod: deployment, devops/runbooks, self-hosted Supabase
design-system/ Design tokens, UI/UX, navigation, branding
features/ Feature-level docs (posting, messaging, etc.)
security/ Security model and practices
testing/ Test strategy and coverage
business/ Executive, legal, marketing
reference/ API, changelog, content, misc reference material
forward-looking/ Plans, proposals, in-flight ideas
non-public/ Internal-only material
archive/ Frozen historical docs (incl. the retired managed-cloud era)

Ground truth (checked 2026-10)

  • Database — self-hosted Supabase at supabase.orangecat.ch on the Hetzner box (bitbaum). The managed Supabase Cloud was retired 2026-06. Schema = SQL files in ../supabase/migrations/, applied automatically on every deploy by scripts/apply-migrations.sh — never by hand. See operations/supabase/.
  • Deployment — self-hosted on Hetzner behind Caddy. A green PR is merged by .github/workflows/auto-merge.yml; CI on main then hands off to .github/workflows/cd.yml, which deploys. See operations/deployment/ and "Deploy path" in ../AGENTS.md.
  • Bitcoin — BTC is the canonical stored unit (NUMERIC(18,8)) and the only Bitcoin unit; SATS is not a currency code.

Conventions

  • Point-in-time reports, audits, and completed runbooks live in archive/ — keep active docs current, not historical.
  • Engineering rules the AI agent follows live in ../.claude/, not here.