Phase 13, part 8: a team's data is theirs

The owner exports everything from Settings → Your data (the keys only with
their password), and can delete the team: it closes at once, everyone in it
is told, it can be undone for 30 days, and then its schema, files, agents
and memberships go for good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 12:40:28 -07:00
co-authored by Claude Opus 5.5
parent d35ed7cbb2
commit b8a64e258a
11 changed files with 501 additions and 4 deletions
+20
View File
@@ -434,3 +434,23 @@ func (s *Server) RunAccounts(ctx context.Context) {
}
}
}
// RunTeams removes, every hour, the teams whose 30 days after being
// deleted have passed (the multi-tenant platform's job).
func (s *Server) RunTeams(ctx context.Context) {
if !s.multi() {
return
}
tick := time.NewTicker(time.Hour)
defer tick.Stop()
for {
if _, err := s.jobs().Do(ctx, "platform:purge", func(ctx context.Context) { s.purgeTeams(ctx, time.Now()) }); err != nil {
s.Log.Warn("teams: taking the lock", "err", err)
}
select {
case <-ctx.Done():
return
case <-tick.C:
}
}
}