Files
saltbo__agent-kanban/server/domain/tasks/taskReviewDecisionAuthority.ts
jarvis a2fa54a729 feat!: rebuild Agent Kanban for Realmroot Toolbox
Replace the v1 Agent/Machine runtime and CLI architecture with the v2 Resource Server, AMA-backed projections, task lifecycle, session observation, BDD specifications, and a single-package layered codebase.

BREAKING CHANGE: remove the v1 CLI, internal Agent/Machine runtime entities, workspace layout, and legacy runtime coordination APIs.
2026-09-02 00:17:52 -04:00

14 lines
607 B
TypeScript

export type TaskReviewDecisionActor = { type: "agent"; id: string } | { type: "human"; id: string } | { type: "system"; id: string };
export type TaskReviewDecisionAuthority = "allowed" | "unsupported-assignee" | "self-review";
export function taskReviewDecisionAuthority(
assigneeIdentityType: string | null,
assignedTo: string | null,
actor: TaskReviewDecisionActor,
): TaskReviewDecisionAuthority {
if (assigneeIdentityType !== "realmroot_actor" || !assignedTo) return "unsupported-assignee";
if (actor.type === "agent" && actor.id === assignedTo) return "self-review";
return "allowed";
}