halkyon/apps/todo/halkyon_todo_server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tizian 「ティツィアーン」 dbae802915
feat(base,learn,todo): the operator's assistants, and the instance's privacy page (ADR 0021, step 2)
The server half of the assistants (points 4 to 8, D27 to D46): the
operator sets language models in deploy/assistants.env, grants them to
people with limits, and the module forwards their questions with the
operator's key, counting what each used, never what was asked.

- assistantsFrom: ASSISTANTS, ASSISTANT_ID_KEY, ASSISTANT_<ID>_NAME,
  _PROTOCOL (anthropic, openai, openai-responses), _BASE_URL, _MODEL,
  _KEY, _IMAGES, _PRICE_INPUT and _PRICE_OUTPUT (per million tokens),
  ASSISTANT_CURRENCY, ASSISTANT_OWN_KEYS; anything unusable stops the
  server as it starts, naming the variable.
- The assistant endpoint (identified): offered, agree (D40), ask as a
  Serverpod stream (D35): the text as the model writes it, then the
  whole turn, sent once the request is counted; figures, the caller's
  own. Checked in order: at most 2 questions on their way per person
  (tooManyAtOnce), the grant, the agreement, limits in the pricing's
  unit now (limitOutdated), the month's and the day's limits (with when
  they reset, UTC), the question (malformed, imagesNotRead, tooLarge
  past 400,000 characters, an image over 3,932,160 bytes or more than
  20 images); output capped at 16,384 tokens. Each request carries the
  person's opaque ID (HMAC-SHA256 under ASSISTANT_ID_KEY, D30). Once
  sent, the provider's reply is read to its end even if the app
  cancels, and counted on a session of its own; a provider's failure is
  logged by kind and status, told as providerKey, providerBusy (with
  its wait), providerRefused or providerFailed.
- The assistantOperator endpoint (identified and operator, on the
  register): setUp, grants, grant (assistantNotSet, invalidLimit,
  notFound), revoke, figures of a UTC month.
- Tables assistant_grant and assistant_figures (per person, assistant
  and UTC day), in the module's, Learn's and Todo's migrations. The
  daily pruning keeps this month and the two before
  (forgetOldAssistantFigures, D41); deletePerson deletes both.
  A member offers no assistant (D43).
- instance.basics() gains assistantOwnKeys.
- /privacy (D39, addPrivacyPageRoute, on the register's web server,
  before the profile pages' route): made from the instance's settings,
  English or German, no JavaScript: who may sign up, where the data and
  backups are, what the module keeps (the account, sessions, IP
  addresses, the server's log), the host's privacyPagePoints (Learn's:
  studysets synced, private ones encrypted on the devices with what
  stays readable, what is published, dictionary lookups, the learner
  count), each assistant with its model and host, what goes and what is
  counted, and whether personal keys are allowed. Never a key.

Tests: 70 on the assistants (grants, limits, refusals in order,
streaming, cancelling, counting, concurrency, the operator's denials,
deletion, pruning), 19 on the settings, 8 on the privacy page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-26 07:17:06 +01:00
..
bin feat(todo): the server on halkyon_base 2026-10-22 18:11:06 +02:00
config feat(todo): the server on halkyon_base 2026-10-22 18:11:06 +02:00
lib feat(base,learn,todo): the operator's assistants, and the instance's privacy page (ADR 0021, step 2) 2026-10-26 07:17:06 +01:00
migrations feat(base,learn,todo): the operator's assistants, and the instance's privacy page (ADR 0021, step 2) 2026-10-26 07:17:06 +01:00
test/integration feat(base)!: no anonymous accounts on the server (ADR 0020, D25) 2026-10-24 16:14:42 +02:00
.gitignore chore: Halkyon Todo's scaffold joins the repository in apps/todo 2026-10-22 18:11:03 +02:00
analysis_options.yaml feat(todo): the server on halkyon_base 2026-10-22 18:11:06 +02:00
CHANGELOG.md chore: Halkyon Todo's scaffold joins the repository in apps/todo 2026-10-22 18:11:03 +02:00
dart_test.yaml chore: Halkyon Todo's scaffold joins the repository in apps/todo 2026-10-22 18:11:03 +02:00
LICENSE docs(todo): what Todo is now, and its licences 2026-10-22 18:11:06 +02:00
pubspec.yaml feat(todo): the server on halkyon_base 2026-10-22 18:11:06 +02:00
README.md docs(todo): what Todo is now, and its licences 2026-10-22 18:11:06 +02:00

halkyon_todo_server

Halkyon Todo's server: Serverpod with the halkyon_base module. See Todo's README.