wire: headlines on findings and steps; combined duplicates
Finding.headline, Step.headline and StepReport.headline: one plain sentence for the task page's timeline. TaskRef.creator, Task.folded and Task.combined, the combined receipt card, for Equipo combining a person's duplicate tasks reversibly. Fixtures follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+55
−25
internal/wire/tasks.go+55 −25
Intent
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go| index 5cf4ae45..4943535d 100644 |
| --- a/internal/wire/tasks.go |
| +++ b/internal/wire/tasks.go |
| @@ -184,12 +184,15 @@ const AttachmentRepo = "repo" |
| // Finding is what the coordinator found while investigating, attached to |
| // the task: a diagnosis with the file and line it points at, if any. |
| type Finding struct { |
| - ID string `json:"id"` |
| - Text string `json:"text"` |
| - Repo string `json:"repo"` |
| - Path string `json:"path"` |
| - Line int `json:"line"` |
| - At time.Time `json:"at"` |
| + ID string `json:"id"` |
| + // Headline is one plain sentence a person reads first (no paths, at |
| + // most MaxHeadline bytes); Text is the full diagnosis. |
| + Headline string `json:"headline"` |
| + Text string `json:"text"` |
| + Repo string `json:"repo"` |
| + Path string `json:"path"` |
| + Line int `json:"line"` |
| + At time.Time `json:"at"` |
| } |
| // ThreadEntry is one line of a task's own thread: a person's note or an |
| @@ -206,22 +209,26 @@ type ThreadEntry struct { |
| // forge confirmed the branch points at it. Terminated is the runner's |
| // proof that the attempt's namespace has exited. |
| type Step struct { |
| - ID string `json:"id"` |
| - Revision int64 `json:"revision"` |
| - TaskID string `json:"task_id"` |
| - Index int `json:"index"` |
| - Specialist string `json:"specialist"` |
| - State string `json:"state"` |
| - Reason string `json:"reason"` |
| - Attempt int64 `json:"attempt"` |
| - BaseSHA string `json:"base_sha"` |
| - CandidateSHA string `json:"candidate_sha"` |
| - Pushed bool `json:"pushed"` |
| - Terminated bool `json:"terminated"` |
| - Summary string `json:"summary"` |
| - LogTail string `json:"log_tail"` |
| - StartedAt *time.Time `json:"started_at"` |
| - FinishedAt *time.Time `json:"finished_at"` |
| + ID string `json:"id"` |
| + Revision int64 `json:"revision"` |
| + TaskID string `json:"task_id"` |
| + Index int `json:"index"` |
| + Specialist string `json:"specialist"` |
| + State string `json:"state"` |
| + Reason string `json:"reason"` |
| + Attempt int64 `json:"attempt"` |
| + BaseSHA string `json:"base_sha"` |
| + CandidateSHA string `json:"candidate_sha"` |
| + Pushed bool `json:"pushed"` |
| + Terminated bool `json:"terminated"` |
| + Summary string `json:"summary"` |
| + // Headline is the step's outcome in one plain sentence (Engineering's |
| + // change, Review's verdict), written by the specialist; Summary has the |
| + // rest. Empty when the specialist gave none. |
| + Headline string `json:"headline"` |
| + LogTail string `json:"log_tail"` |
| + StartedAt *time.Time `json:"started_at"` |
| + FinishedAt *time.Time `json:"finished_at"` |
| // Round is the fix round the step belongs to: 0 for the first |
| // Engineering step, then 1 and 2 for the automatic fix rounds. |
| Round int `json:"round"` |
| @@ -331,15 +338,34 @@ type Task struct { |
| // Coordinator is what the coordinator is doing on the task right now |
| // (looking into it, merging it); null when nothing. |
| Coordinator *TaskActivity `json:"coordinator"` |
| + // Folded is set while Equipo has combined this task into another one |
| + // (its stage is then cancelled); Combined are the tasks folded into |
| + // this one, newest first. |
| + Folded *TaskFold `json:"folded"` |
| + Combined []TaskRef `json:"combined"` |
| } |
| // TaskRef names another task. |
| type TaskRef struct { |
| - ID string `json:"id"` |
| - Title string `json:"title"` |
| - Stage string `json:"stage"` |
| + ID string `json:"id"` |
| + Title string `json:"title"` |
| + Stage string `json:"stage"` |
| + Creator string `json:"creator"` |
| } |
| +// TaskFold is how Equipo combined a duplicate into another task: Into |
| +// keeps the work; this task is cancelled until someone undoes it |
| +// (POST /api/v1/tasks/{id}/uncombine restores it exactly as it was). |
| +type TaskFold struct { |
| + Into TaskRef `json:"into"` |
| + At time.Time `json:"at"` |
| +} |
| + |
| +// CardCombined is the quiet receipt in the creator's conversation when |
| +// Equipo combined two of their tasks (TaskID the folded task, Name the |
| +// line); ChoiceUndo restores the folded task. |
| +const CardCombined = "combined" |
| + |
| // TaskActivity is the coordinator at work on a task: Kind is |
| // CoordinatorLooking (its turn that noted the task is still running) or |
| // CoordinatorMerging (the merge step), since Since. |
| @@ -372,6 +398,9 @@ const ( |
| ActivityOther = "other" |
| ) |
| +// MaxHeadline bounds a headline: one sentence, about 80 characters. |
| +const MaxHeadline = 120 |
| + |
| // MaxStepActivity is how many activity lines a step keeps; |
| // MaxActivitySubject bounds a line's subject. |
| const ( |
| @@ -607,6 +636,7 @@ type StepReport struct { |
| Pushed bool `json:"pushed"` |
| Termination bool `json:"termination"` |
| Summary string `json:"summary"` |
| + Headline string `json:"headline"` |
| LogTail string `json:"log_tail"` |
| // What ran (family, account binding) and, for checks and review, |
| // their result on CandidateSHA. Output is the checks' last 200 lines. |