oficina / equipo Public

wire: fields the inner screens need (activity, source, people, facts)

Step.activity lines and the step_activity frame; Task creator_name,
source_message_id/source_at, duplicate_of, coordinator activity;
Project description, stack, checks, people; Attachment head; RepoInfo
head, gate and checks reason; MarkDuplicate. Fixtures follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev f993f821b0f1c258ef52e6870ccf6d4a14d59dd3 parent 5833f06
3 files changed, +143 −0
  • internal/wire/api.go +9 −0
  • internal/wire/frames.go +11 −0
  • internal/wire/tasks.go +123 −0
diff --git a/internal/wire/api.go b/internal/wire/api.go
index ba4504a0..6271c861 100644
--- a/internal/wire/api.go
+++ b/internal/wire/api.go
@@ -235,6 +235,15 @@ type Project struct {
AddedBy string `json:"added_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
+ // Description is one line about the product (its README's first
+ // paragraph until the coordinator writes one); Stack the languages
+ // and platforms found in its repositories (go, swift, swiftui...);
+ // Checks whether its checks run on the team's runner. People are the
+ // person who added it and everyone who filed a task in it.
+ Description string `json:"description"`
+ Stack []string `json:"stack"`
+ Checks *ProjectChecks `json:"checks"`
+ People []PersonRef `json:"people"`
}
// ProjectList is GET /api/v1/projects. Allowed is the person's
diff --git a/internal/wire/frames.go b/internal/wire/frames.go
index f489d824..4c151955 100644
--- a/internal/wire/frames.go
+++ b/internal/wire/frames.go
@@ -134,6 +134,8 @@ func (f Frame) Decode() (any, error) {
v = &ForgetTaskCommand{}
case FrameBranch:
v = &BranchReport{}
+ case FrameStepActivity:
+ v = &StepActivityReport{}
default:
return nil, fmt.Errorf("%w: frame type %q", ErrStrict, f.Type)
}
@@ -248,6 +250,15 @@ type RepoInfo struct {
Names []string `json:"names"`
Hints []string `json:"hints"`
UpdatedAt time.Time `json:"updated_at"`
+ // HeadSHA and HeadSubject are the default branch's newest commit
+ // (UpdatedAt is its time). Gate is the checks gate found at that
+ // commit (".amadan/ci.d", ".amadan/ci", "make ci" or ""); ChecksReason
+ // is why this runner cannot run the project's checks (needs_macos), or
+ // empty when it can.
+ HeadSHA string `json:"head_sha"`
+ HeadSubject string `json:"head_subject"`
+ Gate string `json:"gate"`
+ ChecksReason string `json:"checks_reason"`
}
// SessionState is the runner's durable coordinator session for a person.
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go
index b790d6ce..20a32c0e 100644
--- a/internal/wire/tasks.go
+++ b/internal/wire/tasks.go
@@ -166,6 +166,13 @@ type Attachment struct {
Kind string `json:"kind"`
Ref string `json:"ref"`
Name string `json:"name"`
+ // For a repository, from the runner's index: its default branch and
+ // that branch's newest commit (SHA, subject, time); empty until the
+ // index has read it.
+ DefaultBranch string `json:"default_branch"`
+ HeadSHA string `json:"head_sha"`
+ HeadSubject string `json:"head_subject"`
+ HeadAt *time.Time `json:"head_at"`
}
// AttachmentRepo is a repository attachment.
@@ -243,6 +250,10 @@ type Step struct {
Into string `json:"into"`
Strategy string `json:"strategy"`
WithoutChecks bool `json:"without_checks"`
+ // Activity is what the specialist did most recently in this attempt,
+ // oldest first, at most MaxStepActivity lines; empty until the runner
+ // reports any. It stays after the step ends (its last lines).
+ Activity []ActivityLine `json:"activity"`
}
// Task is one piece of work under a project. Branch is the task's own
@@ -290,6 +301,118 @@ type Task struct {
// Reports counts the person's reports attached to this task after it
// was recorded (the same problem reported again).
Reports int `json:"reports"`
+ // CreatorName is the creator's display name (from the address until
+ // people have profiles).
+ CreatorName string `json:"creator_name"`
+ // SourceMessageID is the person's message the task was noted from
+ // (in the creator's conversation) and SourceAt its time; empty and
+ // null when no message is known.
+ SourceMessageID string `json:"source_message_id"`
+ SourceAt *time.Time `json:"source_at"`
+ // DuplicateOf is an open task in the same project that reads like this
+ // one, when the coordinator recorded it anyway; null otherwise. A task
+ // folded into another (POST /tasks/{id}/duplicate) is cancelled with
+ // DuplicateOf naming where it went.
+ DuplicateOf *TaskRef `json:"duplicate_of"`
+ // Coordinator is what the coordinator is doing on the task right now
+ // (looking into it, merging it); null when nothing.
+ Coordinator *TaskActivity `json:"coordinator"`
+}
+
+// TaskRef names another task.
+type TaskRef struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+ Stage string `json:"stage"`
+}
+
+// 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.
+type TaskActivity struct {
+ Kind string `json:"kind"`
+ Since time.Time `json:"since"`
+}
+
+// Coordinator activities on a task.
+const (
+ CoordinatorLooking = "looking"
+ CoordinatorMerging = "merging"
+)
+
+// ActivityLine is one thing a specialist started during a step: Kind is
+// an Activity* constant and Subject the file (repository-relative) or the
+// command's first line, clipped; At is when the runner saw it.
+type ActivityLine struct {
+ Kind string `json:"kind"`
+ Subject string `json:"subject"`
+ At time.Time `json:"at"`
+}
+
+// Step activity kinds.
+const (
+ ActivityRead = "read"
+ ActivitySearch = "search"
+ ActivityEdit = "edit"
+ ActivityRun = "run"
+ ActivityOther = "other"
+)
+
+// MaxStepActivity is how many activity lines a step keeps;
+// MaxActivitySubject bounds a line's subject.
+const (
+ MaxStepActivity = 5
+ MaxActivitySubject = 160
+)
+
+// FrameStepActivity reports what a running step's specialist started
+// (runner to instance, not durable: a lost line is only a lost line).
+const FrameStepActivity = "step_activity"
+
+// StepActivityReport is one activity line of a running step attempt.
+type StepActivityReport struct {
+ TaskID string `json:"task_id"`
+ StepID string `json:"step_id"`
+ Attempt int64 `json:"attempt"`
+ Kind string `json:"kind"`
+ Subject string `json:"subject"`
+}
+
+// StepActivity is the activity event's data for resource "step": the
+// step's newest lines, oldest first.
+type StepActivity struct {
+ TaskID string `json:"task_id"`
+ StepID string `json:"step_id"`
+ Attempt int64 `json:"attempt"`
+ Activity []ActivityLine `json:"activity"`
+}
+
+// ResourceStep is the activity event's resource for a step.
+const ResourceStep = "step"
+
+// MarkDuplicate is the body of POST /api/v1/tasks/{id}/duplicate: the
+// task's creator folds it into Of, an open task in the same project. The
+// task is cancelled (its running step stopped first) and its brief goes
+// on Of's thread as a report.
+type MarkDuplicate struct {
+ Of string `json:"of"`
+}
+
+// PersonRef is a team member as screens show them: the address, a
+// display name and initials for an avatar.
+type PersonRef struct {
+ Address string `json:"address"`
+ Name string `json:"name"`
+ Initials string `json:"initials"`
+}
+
+// ProjectChecks says whether the project's checks can run on the team's
+// runner: Here with the Gate that runs, or not with Reason (a checks
+// reason such as needs_macos, or none when no gate was found).
+type ProjectChecks struct {
+ Here bool `json:"here"`
+ Gate string `json:"gate"`
+ Reason string `json:"reason"`
}
// Merged is how Equipo merged a task: SHA on Into, with Strategy;