fix(identity): use System as the one root identity and record who created every task (#1851)
deploy / plan (push) Successful in 25s
deploy / gate (push) Successful in 7m57s
deploy / agent-image (push) Successful in 21s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 2m12s

Drop the bot_user-derived root identity and the empty-identity sentinel. System
polls forge connections and owns instance-level work; a polled task stores the
polling identity, task_queued and work_request_submitted carry task id, actor
and principal, and an empty task identity is refused. Migration 0072 moves
empty tasks.identity, the identity-grants root key and the old root's
connection permits to System so a re-poll dedups.
This commit is contained in:
sam committed 2026-11-10 20:01:16 +11:00
1 parent 04798b990a
commit e3ffefdc7d
36 files changed
+283 -189

No files matched your search

+4 -1
View File
@@ -150,7 +150,10 @@ func (a *workflowsAPI) handleWorkRequest(w http.ResponseWriter, r *http.Request)
http.Error(w, "work request rejected", http.StatusBadRequest)
return
}
a.emit(r.Context(), events.Event{Kind: events.KindWorkRequestSubmitted, TaskID: created.ID, Repo: request.Repository, Workflow: request.Workflow, Detail: request.Title})
a.emit(r.Context(), events.Event{
Kind: events.KindWorkRequestSubmitted, TaskID: created.ID, Repo: request.Repository, Workflow: request.Workflow, Detail: request.Title,
ActorID: string(principal.IdentityID), ActorKind: string(principal.Kind), PrincipalID: string(principal.IdentityID),
})
w.WriteHeader(http.StatusCreated)
writeJSON(w, map[string]any{"ok": true, "task_id": created.ID})
}