halkyon/apps/learn/halkyon_learn_server/migrations/migration_registry.txt
Tizian 「ティツィアーン」 7aee78bd87
feat(base,app,learn,todo,train,meditate): agent accounts with tokens
ADR 0044's step 6a (D42, D43, D45): accounts for programs, such as AI
assistants, that an identified person makes from the Profile.

halkyon_base keeps them on the instance's register, which its members
ask: an agent is an account (agent_account: its owner, its name, its
public keys, set by itself once) with one token (agent_token: 32
random bytes, kept as their SHA-256 alone, shown once). agents.create,
mine, newToken, revoke, delete and setKeys serve its owner;
agentSignIn.signIn exchanges the token for an ordinary server-side
session of a day, with the scopes identified and agent, at most 60
sign-ins an hour from a network. Revoking a token or making a new one
ends the agent's sessions; a token unused for 90 days lapses in every
service's pruning. Up to 5 agents a person, where the operator didn't
switch them off (AGENTS=off; said on the privacy page and in
instance.basics). An agent makes no agents, creates or owns no shared
space, is invited and raised as a Viewer alone, is never handed a
space on, is named no operator and granted no assistants; each refusal
has its test. Deleting a person deletes their agents first; an agent's
public profile names whose agent it is.

In the apps, every Profile has an Agents card (halkyon_app's
AgentsSection): made with a name and a handle, its token shown once to
copy, a new token, the token taken back, deleted. Learn's Share sheet
marks an agent among the members and offers it no role above Viewer.

The migrations, the module's and each host's (Learn, Meditate, Todo,
Train), are additive alone: CREATE TABLE "agent_account" with a unique
index on "agentId" (one row an agent account) and one on "ownerId" (a
person's agents, and deleting them with the person), and CREATE TABLE
"agent_token" with unique indexes on "agentId" (one token an agent)
and "tokenHash" (the sign-in finds the token by its hash). No existing
table is touched, so the server before the deploy keeps working on the
migrated database.

Whats-New: Make agents in your Profile: accounts for programs such as AI assistants, which sign in with a token and see only what you share with them.
Whats-New-De: Leg in deinem Profil Agenten an: Konten für Programme wie KI-Assistenten, die sich mit einem Token anmelden und nur sehen, was du mit ihnen teilst.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-11 19:56:13 +01:00

61 lines
2 KiB
Text

### AUTOMATICALLY GENERATED DO NOT MODIFY
###
### This file is generated by Serverpod when creating a migration, do not modify it
### manually. If a collision is detected in this file when doing a code merge, resolve
### the conflict by removing and recreating the conflicting migration.
20260916165410927
20260930094729362-studysets
20260930122235111-cards
20260930145136285-reviews
20261001064926911-tree-tags-assets
20261002035419149-file-allowance
20261002191122122-notes
20261002211346701-learning-paths
20261003110855698-pdf-sources
20261007205440868-card-buried-at
20261008165051407-pdf-position
20261008223835206-dictionaries
20261009123850448-dictionary-kind
20261009145434785-dictionary-entry-version
20261009184924904-public-profiles
20261009195137836-published-studysets
20261009202105673-explore
20261009215552429-learner-count
20261009220324372-based-on
20261009224606274-feedback
20261010095547719-assistant-connector
20261012162411835-studyset-deleted-at
20261013035552510-dictionary-keys
20261014153932647-release-colour
20261015171326465-email-sign-in
20261015220121195-verified-links
20261015220626303-discussions
20261017110130653
20261019121406578-halkyon-base
20261019201023295-profiles-in-halkyon-base
20261019204112282-deletion-notices
20261020111943300-passwords
20261020125117584-sessions-ended
20261020185750538-recovery-proof-key
20261020194228286-second-factor-waits
20261020204619104-session-code-tries
20261020211224692-email-code-purpose
20261021100422048-session-ended-warning
20261021110159867-second-factor-paths
20261021134803749-reset-hold-outs
20261021184601197-private-studysets
20261023131636437
20261023181810112-oidc-module
20261023192913178-simplelogin-keys
20261025135744595-waiting-accounts
20261025165102861-assistants
20261025184004860-assistant-conversations
20261026140329810-assistant-budgets
20261110225358224-file-store-in-halkyon-base
20261111091720823-shared-spaces
20261111100124819-shared-space-keys
20261111110923694-own-rows-by-id
20261111145608988-shared-space-key-roll
20261111170119332-shared-space-invitations
20261111182838916-agents