| 1 | # Tasks, task, projects, project, needs you: notes for the build |
| 2 | |
| 3 | The mockup is `tasks.html`, one self-contained file. `?screen=tasks|task|projects|project|needs&theme=light|dark&motion=reduced&live=on&task=<id>` opens straight into a state. Copy is placeholder and goes through copy review when built. |
| 4 | |
| 5 | ## What each piece needs from API v1 |
| 6 | |
| 7 | Shapes are `internal/wire` (`Task`, `Step`, `Finding`, `Project`, `Attachment`, `Question`, `ThreadEntry`). "Missing" means nothing stores or serves it today. |
| 8 | |
| 9 | ### Sidebar specialist rows |
| 10 | |
| 11 | | Piece | Source | Status | |
| 12 | | --- | --- | --- | |
| 13 | | Working or idle | last `Step` of each task: `state` running or queued, by `specialist` (checks folded under Review today in `rail.go`; the mockup gives Checks its own row) | have | |
| 14 | | Elapsed timer | `Step.started_at` | have | |
| 15 | | Task link, stage, attempt | `Task.id`, `Task.stage`, `Step.attempt` | have | |
| 16 | | Live activity lines ("Reading live.js", "Running checks", "Committing") | per-step activity events, the same kind the coordinator's thinking line already streams (`chat.activity.*`) | missing: the runner reports nothing between start and finish; needs a step activity stream (last N lines, with a time each) | |
| 17 | | Queue ("1 waiting: …") | tasks whose next step is queued, or tasks investigated but not started | partly: `StepQueued` exists; "looked into, waiting for Engineering" has no step yet, so it needs a flag or the coordinator's own queue | |
| 18 | | Coordinator working (looking into, merging) | no step today | missing: a coordinator activity for a task (looking into it, merging) | |
| 19 | |
| 20 | ### Task rows and groups |
| 21 | |
| 22 | | Piece | Source | Status | |
| 23 | | --- | --- | --- | |
| 24 | | Group: Needs you | `Task.needs_you` (`fix_rounds`, `branch_moved`, `review_blocked`) | partly: also needs `merge_without_checks`, `stopped` (last step failed, creator can retry), `question` (a question to the person), and the creator address so only the creator sees the group | |
| 25 | | Group: In progress, Ready to merge, Done | `Task.stage` | have; `merging` is a new stage (see Merging) | |
| 26 | | Project monogram | `Project.title` | have; a project icon is missing (letter monogram with a stable hue until then) | |
| 27 | | Stage track | `Task.stage`, and `Step` timestamps for the small times under the full track | have | |
| 28 | | Live mark on the track | a running step, or a coordinator activity | partly (coordinator activity missing) | |
| 29 | | Who filed it (avatar and name) | `Task.creator` (an address) | partly: no display name or avatar; Keymail profile or a people lookup needed | |
| 30 | | "From your conversation, 18:39" linked to the message | `Task.turn_id` | partly: the turn is known but the message id and its time in the conversation are not served with the task; needs `source_message_id` and `source_at` | |
| 31 | | Time since the last change | `Task.updated_at` | have, as long as every step, verdict and merge bumps it | |
| 32 | | Checks badge with reason | `Task.checks`, `Task.checks_reason`, the step's `gate` and `exit_code` | have | |
| 33 | | Review badge with family in the tooltip | `Task.verdict`, `Task.review_label`, `Step.family` | have | |
| 34 | | Who is working now | running step's `specialist`; "Waiting for Nora" from `creator` and `needs_you` | have / partly (names) | |
| 35 | | Branch and SHA in detail or on hover | `Task.branch`, `candidate_sha`, `url` | have | |
| 36 | | Possible duplicate | similarity between open tasks in the same project | missing: `Task.duplicate_of` set by the coordinator when it records a task (title and brief similarity, same project, open); plus a "merge into" mutation that closes one task as a duplicate of another | |
| 37 | | Quiet ⋯ for the creator only | `Task.creator` vs the signed-in address | have | |
| 38 | | Filters by project and person | `project_id`, `creator` | have (client-side is enough) | |
| 39 | | Whole row clickable | none | have | |
| 40 | |
| 41 | ### Task page |
| 42 | |
| 43 | | Piece | Source | Status | |
| 44 | | --- | --- | --- | |
| 45 | | Header, full stage track with times | `Task`, `Step.started_at/finished_at`, findings' `at` | have | |
| 46 | | One-line human summary | derived from stage, last step, checks and review | derivable; the coordinator could also write it (`Task.summary`, missing) | |
| 47 | | Timeline: noted, findings, attempt N with summary, pushed, checks, review findings, fix rounds, ready, merging, merged | `Findings`, `Steps` (summary, candidate_sha, pushed, round, verdict, findings), `Task.stage` | have, except merging and merged (see below) | |
| 48 | | Step summaries as markdown | `Step.summary` | have; render with the same `chatMarkdown` as the conversation | |
| 49 | | Details folded: brief, findings, summaries, branch, SHA, Open on Amadan | `Task.brief`, `findings`, `steps`, `branch`, `candidate_sha`, `url` | have | |
| 50 | | Live step with the current activity line | step activity stream | missing (as above) | |
| 51 | | Questions and notes beside the timeline | `Task.questions`, `Task.thread`, ask and notes endpoints | have | |
| 52 | | Decision card: Merge without checks? | `checks == cannot_run` and `verdict == approve` on `candidate_sha`; a merge mutation | missing (see Merging) | |
| 53 | |
| 54 | ### Merging (binding ruling, 2026-11-07) |
| 55 | |
| 56 | "Open on Amadan to merge" goes. After Ready to merge the coordinator merges (or tasks a specialist to). This needs a backend merge capability that another agent builds: |
| 57 | |
| 58 | - a `merging` stage between `ready_to_merge` and `done`, with `merging_since`; |
| 59 | - a merge action the coordinator can take: fast-forward or merge the task branch into the repo's default branch on Amadan, record `merged_sha` and `merged_at`, move to `done`, delete the branch; |
| 60 | - an outcome-level line in the conversation ("Merged Replace em dash in README into main"); |
| 61 | - the one exception as a question to the creator when checks could not run: `needs_you = merge_without_checks`, answered by `merge` or `wait`; `wait` keeps the task ready and retries checks when a capable runner joins; |
| 62 | - "Open on Amadan" stays as a quiet link in Details only. |
| 63 | |
| 64 | ### Projects |
| 65 | |
| 66 | | Piece | Source | Status | |
| 67 | | --- | --- | --- | |
| 68 | | Title and attachments (repos) | `Project.title`, `attachments` | have | |
| 69 | | One-line description | coordinator's notebook and the README | missing: `Project.description` written by the coordinator when it moves in | |
| 70 | | Repo default branch, last commit, when | forge | missing: `Attachment.default_branch`, `head_sha`, `head_subject`, `head_at` (cheap to refresh on the task-list poll) | |
| 71 | | Stack or platforms (iOS, Swift; Go) | detect from the repo (Package.swift, go.mod, project files) when moving in | missing: `Project.stack []string`, `platform` | |
| 72 | | Checks can run here, and where | the runner's capabilities against the project's needs | missing: `Project.checks {here bool, reason, gate}`; today only a step's `checks_reason` says so after the fact | |
| 73 | | Task counts by stage | tasks by `project_id` | have (count client-side or add `Project.task_counts`) | |
| 74 | | Recent activity | task and step timestamps | derivable from tasks; a per-project event list would be cheaper | |
| 75 | | Who is involved | creators of the project's tasks, plus `Project.added_by` | derivable; names and avatars missing as above | |
| 76 | | Coordinator's notes about the project | notebook entries tagged with the project | partly: notebook exists; entries need a `project_id` | |
| 77 | | Later: CARLOS apps and links as attachments | `Attachment.kind` | have the shape | |
| 78 | |
| 79 | ### Needs you |
| 80 | |
| 81 | | Piece | Source | Status | |
| 82 | | --- | --- | --- | |
| 83 | | One card per decision with context | `needs_you` plus the task's last step, checks and review | partly: needs the new `needs_you` values above | |
| 84 | | One-tap answers | mutations: merge, wait, retry, cancel, merge-into, answer a question | partly: retry and cancel exist; merge, wait, merge-into and the one-tap question answer are missing | |
| 85 | | Waiting on others | tasks with `needs_you` whose creator is someone else | have | |
| 86 | |
| 87 | ### Nav |
| 88 | |
| 89 | Projects moves above Tasks: Conversation, Projects, Tasks, Needs you. `rail.go`'s `nav` order changes; no data change. |
| 90 | |
| 91 | ## Behaviour notes |
| 92 | |
| 93 | - The coordinator should check open tasks in the same project before recording a new one, and ask "Is this the same as …?" instead of filing a third copy. The swipe-back bug was filed three times in one evening. When it does file, it sets `duplicate_of` so the list can show it and the creator can fold it. |
| 94 | - Only the creator acts on a task. Everyone on the team reads it. Rows and cards show "Waiting for Nora" rather than hiding her tasks. |
| 95 | - The live mark is the Stardust sparkle from the thinking line, at `font-size` 0.85em in the rail and on a track, without motes there so it sheds no dust over text. Reduced motion keeps the star and two satellites still; the timers keep counting, since they are content. |
| 96 | - Elapsed timers tick client-side from `started_at`; nothing polls for them. |
| 97 | |