Skip to content
20 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts1import type { Comment } from "@g1t/contracts";
2
3/**
4 * Whether the viewer may edit or delete a comment: its author may, and so
5 * may someone with the Maintain role or higher (`canModerate`). Notes of
6 * what happened are nobody's to change, and a review's verdict stays, so a
7 * review can be edited but not deleted. The work service decides; this
8 * only says which buttons to show.
9 */
10export function mayChangeComment(
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar11 comment: Pick<Comment, "kind" | "verdict"> &
12 Partial<Pick<Comment, "advisory">> & { author: { id: string }; actingFor?: { id: string } | null },
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts13 viewerId: string | null | undefined,
14 canModerate: boolean,
15): { edit: boolean; delete: boolean } {
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar16 // What an agent wrote as itself is answered for by whoever it acted for.
17 const answerable = comment.actingFor?.id ?? comment.author.id;
18 const allowed = comment.kind === "comment" && viewerId != null && (answerable === viewerId || canModerate);
19 return { edit: allowed, delete: allowed && comment.verdict == null && !comment.advisory };
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts20}

This file's history is long; its oldest lines are credited to the oldest commit read.