oficina / equipo Public

Combine duplicates, timeline headlines, calmer Stardust

Equipo combines a person's look-alike tasks on its own (furthest along
keeps the work; the other is folded reversibly, with a receipt and
Undo); other pairs are only named. Test people (EQUIPO_TEST_PEOPLE,
staging .invalid) see only their own tasks; staging backs up before a
deploy. Timeline entries lead with one plain sentence; the rest, paths
and commits sit behind Details. The sparkle turns slowly and breathes;
motes drift out of step; no spins or pops. Fixtures follow the merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev e28b8b8ac4a8665cb205f321ce5df33ea4a460ce parent d7c99e3
35 files changed, +1,108 −120
  • docs/mockups/tasks.html +27 −0
  • docs/mockups/thinking.html +28 −0
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +22 −2
  • docs/superpowers/plans/UX1-PROGRESS.md +61 −0
  • internal/equipo/app.go +8 −1
  • internal/equipo/chat/duplicates.go +337 −0
  • internal/equipo/chat/http.go +11 −0
  • internal/equipo/chat/inner.go +5 −2
  • internal/equipo/chat/merge.go +6 −1
  • internal/equipo/chat/models.go +1 −1
  • internal/equipo/chat/projects.go +5 −0
  • internal/equipo/chat/store.go +3 −0
  • internal/equipo/chat/tasks.go +29 −3
  • internal/equipo/chat_page.go +7 −1
  • internal/equipo/chat_wiring.go +9 −0
  • internal/equipo/config.go +9 −0
  • internal/equipo/copy.go +22 −2
  • internal/equipo/migrations/0051_thin_duplicates.sql +5 −0
  • internal/equipo/migrations/schema.sql +3 −2
  • internal/equipo/static/chat-stream.js +14 −6
  • internal/equipo/static/equipo.css +43 −30
  • internal/equipo/static/nav-stream.js +0 −10
  • internal/equipo/store.go +2 −0
  • internal/equipo/templates/chat.html +1 −1
  • internal/equipo/templates/work_parts.html +1 −1
  • internal/equipo/templates/work_task.html +10 −6
  • internal/equipo/work_pages.go +14 −0
  • internal/equipo/work_views.go +169 −41
  • internal/equipo/work_views_test.go +23 −0
  • internal/thintest/duplicates_contract_test.go +185 −0
  • internal/thintest/gallery_test.go +14 −6
  • internal/thintest/inner_browser_test.go +12 −1
  • internal/thintest/instance.go +1 −1
  • internal/thintest/pages_test.go +1 −1
  • scripts/staging-thin.py +20 −1
diff --git a/docs/mockups/tasks.html b/docs/mockups/tasks.html
index 6b2d233c..2e72cae1 100644
--- a/docs/mockups/tasks.html
+++ b/docs/mockups/tasks.html
@@ -477,6 +477,33 @@ a { color: var(--rst-accent); }
:root:not([data-motion="full"]) .mark [data-sat="1"], :root:not([data-motion="full"]) .mark [data-sat="2"] { opacity: .7; transform: scale(.8) rotate(45deg); }
:root:not([data-motion="full"]) .mark [data-mote] { display: none; }
}
+
+/* Calm Stardust (Paul, 2026-11-08: "more gentle and calming rather than
+ jittery"): a slow continuous turn, a soft sine breath, a slow glow,
+ satellites that fade, motes drifting out of step; the flourish is only
+ a soft brightening; marks in the rail and rows only breathe. */
+.mark svg { animation: m-calm-turn 16s linear infinite; }
+.mark path { animation: m-calm-breathe 3.6s cubic-bezier(.37, 0, .63, 1) infinite; }
+.mark circle { animation: m-calm-glow 4.8s cubic-bezier(.37, 0, .63, 1) infinite; }
+.mark [data-sat] { transform: scale(.85) rotate(45deg); animation: m-calm-sat 6.5s cubic-bezier(.37, 0, .63, 1) .4s infinite; }
+.mark [data-sat="2"] { animation-duration: 7.7s; animation-delay: 2.3s; }
+.mark [data-sat="3"] { animation-duration: 8.9s; animation-delay: 4.1s; }
+.mark[data-flourish] svg { animation: m-calm-turn 16s linear infinite; }
+.mark[data-flourish] path { animation: m-calm-breathe 3.6s cubic-bezier(.37, 0, .63, 1) infinite, m-calm-bright 1.6s cubic-bezier(.37, 0, .63, 1); }
+.mark [data-mote], .mark[data-flourish] [data-mote] { animation: m-calm-mote 5s cubic-bezier(.37, 0, .63, 1) var(--d, 0s) infinite both; }
+.mark [data-mote]:nth-of-type(5) { animation-duration: 5.7s; animation-delay: 1.9s; }
+.mark [data-mote]:nth-of-type(6) { animation-duration: 4.4s; animation-delay: 3.6s; }
+.mark [data-mote]:nth-of-type(n+7) { display: none; }
+.mark[data-size="s"] svg { animation: none; }
+.mark[data-size="s"] [data-sat] { animation: none; opacity: .55; }
+@keyframes m-calm-turn { to { transform: rotate(360deg); } }
+@keyframes m-calm-breathe { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
+@keyframes m-calm-glow { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
+@keyframes m-calm-sat { 0%, 100% { opacity: 0; } 45%, 60% { opacity: .75; } }
+@keyframes m-calm-bright { 50% { filter: brightness(1.3); } }
+@keyframes m-calm-mote { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 35% { opacity: .65; } 70% { opacity: .5; } 100% { opacity: 0; transform: translate(calc(var(--dx) * .5), calc(var(--dy) * .5)) scale(.45); } }
+:root[data-motion="reduced"] .mark svg, :root[data-motion="reduced"] .mark path, :root[data-motion="reduced"] .mark circle, :root[data-motion="reduced"] .mark i { animation: none !important; }
+@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) .mark svg, :root:not([data-motion="full"]) .mark path, :root:not([data-motion="full"]) .mark circle, :root:not([data-motion="full"]) .mark i { animation: none !important; } }
</style>
</head>
<body>
diff --git a/docs/mockups/thinking.html b/docs/mockups/thinking.html
index f3e26945..a5cd9133 100644
--- a/docs/mockups/thinking.html
+++ b/docs/mockups/thinking.html
@@ -322,6 +322,34 @@ body { margin: 0; background: var(--rst-bg); color: var(--rst-text); font: var(-
.page { padding-block: var(--rst-sp-5); }
.variant > p { min-block-size: 0; }
}
+
+/* Calm Stardust (Paul, 2026-11-08: "more gentle and calming rather than
+ jittery"), over every take above: a slow continuous turn, a soft sine
+ breath, a slow glow at the heart, satellites that fade rather than pop,
+ two or three motes drifting out of step, and a flourish that is only a
+ soft brightening. The handoff fades over about 600 ms. */
+[data-v] .spk > svg { animation: k-calm-turn 16s linear infinite; }
+[data-v] .spk .st { animation: k-calm-breathe 3.6s cubic-bezier(.37, 0, .63, 1) infinite; }
+[data-v] .spk .core { animation: k-calm-glow 4.8s cubic-bezier(.37, 0, .63, 1) infinite; }
+[data-v] .spk .sat { transform: scale(.85) rotate(45deg); animation: k-calm-sat 6.5s cubic-bezier(.37, 0, .63, 1) .4s infinite; }
+[data-v] .spk .sat:nth-of-type(2) { animation-duration: 7.7s; animation-delay: 2.3s; }
+[data-v] .spk .sat:nth-of-type(3) { animation-duration: 8.9s; animation-delay: 4.1s; }
+[data-v] .spk.fl > svg { animation: k-calm-turn 16s linear infinite; }
+[data-v] .spk.fl .st { animation: k-calm-breathe 3.6s cubic-bezier(.37, 0, .63, 1) infinite, k-calm-bright 1.6s cubic-bezier(.37, 0, .63, 1); }
+[data-v] .spk.fl .gl, [data-v] .spk.fl .arc { animation: none; }
+[data-v] .spk .du, [data-v] .spk.fl .du { animation: k-calm-mote 5s cubic-bezier(.37, 0, .63, 1) var(--d, 0s) infinite both; }
+[data-v] .spk .du:nth-of-type(2) { animation-duration: 5.7s; animation-delay: 1.9s; }
+[data-v] .spk .du:nth-of-type(3) { animation-duration: 4.4s; animation-delay: 3.6s; }
+[data-v] .spk .du:nth-of-type(n+4) { display: none; }
+[data-v] .tl.leaving .du:nth-of-type(n) { animation: none; opacity: 0; transition: opacity .6s ease; }
+:is([data-v^="s"], [data-v^="d"]) .tl.leaving .ph .ch { animation: t-out .6s ease both; }
+@keyframes k-calm-turn { to { transform: rotate(360deg); } }
+@keyframes k-calm-breathe { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
+@keyframes k-calm-glow { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
+@keyframes k-calm-sat { 0%, 100% { opacity: 0; } 45%, 60% { opacity: .75; } }
+@keyframes k-calm-bright { 50% { filter: brightness(1.3); } }
+@keyframes k-calm-mote { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 35% { opacity: .65; } 70% { opacity: .5; } 100% { opacity: 0; transform: translate(calc(var(--dx, 1em) * .5), calc(var(--dy, 0em) * .5)) scale(.45); } }
+@media (prefers-reduced-motion: reduce) { [data-v] .spk > svg, [data-v] .spk .st, [data-v] .spk .core, [data-v] .spk .sat, [data-v] .spk .du { animation: none !important; } }
</style>
</head>
<body>
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index 416e2b27..f5301d51 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -4937,7 +4937,7 @@ records remain unchanged.
| `work.menu.fold_note` | Keeps that task; this one closes as a duplicate | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.needs.one` | One decision, in one tap. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.needs.many` | %d decisions, each in one tap. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
-| `work.decide.unchecked_why` | Review approved the change at %s. Checks could not run here: %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.decide.unchecked_why` | Review approved the change. Checks could not run here: %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.no_gate` | no checks were found | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.reason.needs_macos` | they need macOS | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.reason.needs_network` | they need the network | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
@@ -4947,7 +4947,7 @@ records remain unchanged.
| `work.project.tasks` | %d tasks | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.unchecked_ask` | Merge without checks? | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.unchecked_hint` | Waiting leaves it ready until checks can run. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
-| `work.decide.adopt_why` | Checks passed and Review approved the change at %s before Equipo started merging on its own. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.decide.adopt_why` | Checks passed and Review approved the change before Equipo started merging on its own. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.adopt_ask` | Merge it now? | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.stopped_why` | %s stopped: %s, on attempt %d. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.decide.retry_ask` | Try again? | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
@@ -4991,6 +4991,18 @@ records remain unchanged.
| `work.tl.ready_waits_you` | Waiting for your decision. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.tl.ready_waits` | Waiting for %s's decision. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.tl.merged` | Merged into %s | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.checks_passed` | Checks passed. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.checks_failed` | Checks failed. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.checks_none` | No checks found, so Review judged it alone. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.checks_needs_macos` | Checks need macOS, so Review judged it alone. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.checks_needs_network` | Checks need the network, so Review judged it alone. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.checks_cannot` | Checks couldn't run here, so Review judged it alone. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.approved` | Approved. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.approved_notes` | Approved, with %d notes. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.headline.changes` | Asked for changes. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.tl.on_sha` | On commit %s. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.tl.merged_told` | The coordinator told %s in the conversation. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.tl.merged_as` | Merged as commit %s. | Thin v1 UX1 timeline headlines (task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.tl.merged_detail` | %s. The coordinator told %s in the conversation. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.tl.folded` | Folded into %s. | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.details` | Details | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
@@ -5032,6 +5044,14 @@ records remain unchanged.
| `work.note.repo` | From %s, %s | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `work.note.own` | Noted %s | Thin v1 UX1 inner screens (Tasks, task, Projects, project, Needs you, sidebar) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.card.merge_adopt` | Merge %s? | Thin v1 slice 4c review (merge card) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `chat.card.combined` | Combined “%s” into “%s”. | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `chat.card.combined_undone` | Undone: both tasks are back as they were. | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.combined_into` | Combined into %s | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.combined_line` | Equipo combined this task into | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.combined_open` | Open it | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `work.combined_here` | Combined “%s” into this task. | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `copyTidyFailed` | Tidy duplicate tasks. | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `copyTidied` | Combined duplicate tasks. | Thin v1 UX1 duplicates (combined receipt, task page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.card.not_now` | Not now | Thin v1 slice 4c review (merge card) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.card.merge_chose_not_now` | Not now. | Thin v1 slice 4c review (merge card) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.connections.title` | Connections | Connections slice 1 (Connections page) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
diff --git a/docs/superpowers/plans/UX1-PROGRESS.md b/docs/superpowers/plans/UX1-PROGRESS.md
index 77da0f53..163d8962 100644
--- a/docs/superpowers/plans/UX1-PROGRESS.md
+++ b/docs/superpowers/plans/UX1-PROGRESS.md
@@ -181,6 +181,67 @@ pass". Conventions as in `SLICE1-PROGRESS.md` to `SLICE4C-PROGRESS.md`.
`TestTeamsHierarchyBrowser` (plan3test, browser tag) fail on f2eac36
too.
+9. Merged `thin-v1-conn1` at 7946111 (a fast-forward: it held 96bce97).
+
+10. Duplicates (Paul: "A bit weird that we ended up with the same task
+ three times"; then "Can Equipo itself tidy up the duplicates?"):
+ - Equipo combines on its own when one person filed both tasks, in one
+ project, reading very much alike (title overlap 0.75 with three
+ shared words, or title and brief 0.7 with five), neither merging,
+ and the weaker one has no open card and no step at work. The one
+ furthest along keeps the work (stage, then not stopped, then the
+ older); the other's report, findings and thread are copied onto it
+ (`chat_task_entries.folded_from`) and it is cancelled without
+ merging (`folded_into`, `folded_stage`, `folded_at`; a direct
+ update, not an ending, so the runner keeps its sessions and nothing
+ is withdrawn). Rows are never deleted.
+ - The person gets a quiet receipt in the conversation ("Combined
+ “…” into “…”.", Undo) and on both task pages. Undo (the receipt, the
+ task pages, `POST /api/v1/tasks/{id}/uncombine`; the creator only)
+ restores the task exactly (stage, findings, thread), deletes the
+ copies and records the pair in `chat_task_distinct`, so it is never
+ combined again. A pair the coordinator recorded with `separate:
+ true` is recorded there too: Equipo trusts its judgement.
+ - Any other pair is only named: the weaker task's `duplicate_of`
+ ("Possible duplicate of …"). No Needs you card for duplicates.
+ - When: at every start (`TidyDuplicates` in `RouterWithStore`, after
+ migration 0051) and after every recorded task. Staging's two
+ Woodstar tasks of Paul's (filed before de-duplication) combine on
+ the next deploy: "Swipe from the edge to go back" (stopped) into
+ "Swipe back from the edge" (Ready to merge, its merge card stays).
+ - Wire: `TaskRef.creator`, `Task.folded`, `Task.combined`, card
+ `combined`. Test: `TestContractCombineDuplicates` (the round trip
+ through Undo, the coordinator's separate pairs, a task at work, a
+ teammate's look-alike, a test person). Mutations killed: the
+ at-work guard (after making the busy task the weaker one; it
+ survived first because the busy task was the stronger), Undo's
+ deletion of the copies.
+
+11. The suite person on staging. Decision: hidden, not moved. The thin
+ core has no teams within an instance (every task is the instance's,
+ every active member sees it), so "its own team" would mean its own
+ staging instance. `EQUIPO_TEST_PEOPLE` (address suffixes; staging sets
+ `.invalid`) lists a test person's tasks only to itself (API v1 and the
+ pages) and never pairs them with anyone else's, at record time or when
+ tidying. `scripts/staging-thin.py deploy` sets it and takes a database
+ backup (`carlos db pull`, 0600, newest five under the staging root)
+ before every deploy. A test person's task pages still open by URL.
+
+12. Timeline headlines (Paul: "The wordy descriptions need to have
+ one-line summaries and the wordy stuff should be hidden"): every
+ entry is a short label (who, badge, duration, time), one plain
+ sentence, and a quiet Details disclosure (closed; markdown, findings
+ with file and line, commits). The sentence is the agent's own
+ headline (`headline` on findings, Engineering and Review steps,
+ written by the agents: see the headline merge below) or the first
+ sentence of the text that names no file, skipping headings and code,
+ cut at a word; checks and verdicts have fixed plain lines ("Checks
+ need macOS, so Review judged it alone.", "Approved."). Paths and
+ commits appear only inside Details (asserted on the page), and the
+ merge decision no longer names the commit. `TestTimelineHeadlines`;
+ browser: closed by default, Details by keyboard and by click, shots
+ `ux1-task-details-open-{1280,390}`.
+
## Staging
Release c14b833 (built by `scripts/staging-thin.py build`, deployed with
diff --git a/internal/equipo/app.go b/internal/equipo/app.go
index 93fdc879..e0e99262 100644
--- a/internal/equipo/app.go
+++ b/internal/equipo/app.go
@@ -138,10 +138,16 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg
logger.Info(copyMigrate, "applied", migrated.Applied,
"skipped", migrated.Skipped, "adopted", migrated.Adopted)
- store.chatExecution = cfg.ExecutionEnabled
+ store.chatExecution, store.chatTestPeople = cfg.ExecutionEnabled, cfg.TestPeople
if err := store.Bootstrap(context.Background(), cfg.Owners); err != nil {
return nil, err
}
+ // Duplicates filed before Equipo tidied them, on every start.
+ if folded, err := store.Chat().TidyDuplicates(context.Background()); err != nil {
+ logger.Warn(copyTidyFailed, "err", err)
+ } else if folded > 0 {
+ logger.Info(copyTidied, "combined", folded)
+ }
authentication, err := NewAuth(d, cfg, mailer, store, logger)
if err != nil {
return nil, err
@@ -191,6 +197,7 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg
r.Post("/conversation/tasks/{id}/retry", a.workTaskAction(true))
r.Post("/conversation/tasks/{id}/cancel", a.workTaskAction(false))
r.Post("/tasks/{id}/duplicate", a.workDuplicate)
+ r.Post("/tasks/{id}/uncombine", a.workUncombine)
r.Post("/conversation/tasks/{id}/merge", a.workTaskMerge)
r.Get("/tasks/new", a.taskForm)
r.Get("/tasks/{id}", a.taskDetail)
diff --git a/internal/equipo/chat/duplicates.go b/internal/equipo/chat/duplicates.go
new file mode 100644
index 00000000..f1c10f33
--- /dev/null
+++ b/internal/equipo/chat/duplicates.go
@@ -0,0 +1,337 @@
+package chat
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "slices"
+ "time"
+
+ "gorm.io/gorm"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// Equipo tidies duplicate tasks on its own (Paul, 2026-11-08: "Can Equipo
+// itself tidy up the duplicates?"). Within a project, two open tasks that
+// read alike are a pair. When one person filed both, they read very much
+// alike, neither is merging and the weaker one has no open card and no
+// step at work, the weaker is combined into the one that is furthest
+// along: its report, findings and thread are copied onto the survivor
+// (marked as folded from it) and it is cancelled without merging. Nothing
+// is deleted, so Undo restores it exactly. Any other pair is only named:
+// the weaker task's DuplicateOf is the stronger one. A pair someone undid,
+// or the coordinator recorded as separate, is never touched again.
+
+// distinctRecord is a pair of tasks that are not the same work, a < b.
+type distinctRecord struct {
+ A string `gorm:"primaryKey"`
+ B string `gorm:"primaryKey"`
+ CreatedAt time.Time
+}
+
+func (distinctRecord) TableName() string { return "chat_task_distinct" }
+
+func (t *txn) markDistinct(a, b string) error {
+ if a > b {
+ a, b = b, a
+ }
+ return t.db.Exec("INSERT INTO chat_task_distinct(a, b, created_at) VALUES (?,?,?) ON CONFLICT DO NOTHING", a, b, t.now()).Error
+}
+
+// pairMatch says whether two tasks read like the same work, and whether
+// they read so much alike that Equipo combines them on its own.
+func pairMatch(a, b taskRecord) (match, high bool) {
+ ta, tb := significant(a.Title), significant(b.Title)
+ ts, tn := overlap(ta, tb)
+ bs, bn := overlap(significant(a.Title+" "+a.Brief), significant(b.Title+" "+b.Brief))
+ match = ts >= 0.6 && tn >= 2 || bs >= 0.5 && bn >= 3
+ high = ts >= 0.75 && tn >= 3 || bs >= 0.7 && bn >= 5
+ return match, match && high
+}
+
+// stageRank orders how far along a task is.
+var stageRank = map[string]int{wire.StageNoted: 0, wire.StageInvestigated: 1, wire.StageInProgress: 2, wire.StageInReview: 3, wire.StageReadyToMerge: 4, wire.StageMerging: 5}
+
+// stronger reports whether a is further along than b: a later stage, then
+// not stopped, then the older one.
+func stronger(a, b taskRecord, stopped map[string]bool) bool {
+ if ra, rb := stageRank[a.Stage], stageRank[b.Stage]; ra != rb {
+ return ra > rb
+ }
+ if stopped[a.ID] != stopped[b.ID] {
+ return !stopped[a.ID]
+ }
+ return a.CreatedAt.Before(b.CreatedAt)
+}
+
+// TidyDuplicates looks over every project's open tasks, at start.
+func (s *Store) TidyDuplicates(ctx context.Context) (folded int, err error) {
+ var projects []string
+ if err := s.read(ctx, func(tx *gorm.DB) error {
+ return tx.Model(&taskRecord{}).Where("stage NOT IN ?", []string{wire.StageDone, wire.StageCancelled}).Distinct().Pluck("project_id", &projects).Error
+ }); err != nil {
+ return 0, err
+ }
+ for _, p := range projects {
+ err := s.tx(ctx, func(t *txn) error {
+ n, err := t.tidyDuplicates(p)
+ folded += n
+ return err
+ })
+ if err != nil {
+ return folded, err
+ }
+ }
+ return folded, nil
+}
+
+// tidyDuplicates combines or names the project's duplicate pairs.
+func (t *txn) tidyDuplicates(projectID string) (int, error) {
+ folded := 0
+ for range 20 {
+ var open []taskRecord
+ if err := t.db.Where("project_id = ? AND stage NOT IN ? AND cancel_requested = ? AND (folded_into IS NULL OR folded_into = '')", projectID, []string{wire.StageDone, wire.StageCancelled}, false).Order("created_at, id").Find(&open).Error; err != nil {
+ return folded, err
+ }
+ if len(open) < 2 {
+ return folded, nil
+ }
+ ids := make([]string, len(open))
+ for i, k := range open {
+ ids[i] = k.ID
+ }
+ var distinct []distinctRecord
+ if err := t.db.Where("a IN ? AND b IN ?", ids, ids).Find(&distinct).Error; err != nil {
+ return folded, err
+ }
+ apart := map[[2]string]bool{}
+ for _, d := range distinct {
+ apart[[2]string{d.A, d.B}] = true
+ }
+ var steps []stepRecord
+ if err := t.db.Where("task_id IN ?", ids).Order("task_id, idx").Find(&steps).Error; err != nil {
+ return folded, err
+ }
+ last := map[string]stepRecord{}
+ for _, s := range steps {
+ last[s.TaskID] = s
+ }
+ stopped, busy := map[string]bool{}, map[string]bool{}
+ for id, s := range last {
+ stopped[id] = s.State == wire.StepFailed
+ busy[id] = s.State == wire.StepRunning || s.State == wire.StepQueued
+ }
+ var carded []string
+ if err := t.db.Model(&cardRecord{}).Where("task_id IN ? AND state = ? AND kind <> ?", ids, wire.CardOpen, wire.CardTask).Pluck("task_id", &carded).Error; err != nil {
+ return folded, err
+ }
+ hidden := t.s.authority.TestPerson
+ acted := false
+ for i := 0; i < len(open) && !acted; i++ {
+ for j := i + 1; j < len(open) && !acted; j++ {
+ a, b := open[i], open[j]
+ key := [2]string{min(a.ID, b.ID), max(a.ID, b.ID)}
+ if apart[key] {
+ continue
+ }
+ // A test person's work never meets anyone else's.
+ if a.Creator != b.Creator && hidden != nil && (hidden(a.Creator) || hidden(b.Creator)) {
+ continue
+ }
+ match, high := pairMatch(a, b)
+ if !match {
+ continue
+ }
+ keep, fold := a, b
+ if stronger(b, a, stopped) {
+ keep, fold = b, a
+ }
+ if high && keep.Creator == fold.Creator && keep.Stage != wire.StageMerging && fold.Stage != wire.StageMerging && !busy[fold.ID] && !slices.Contains(carded, fold.ID) {
+ if err := t.fold(fold, keep); err != nil {
+ return folded, err
+ }
+ folded++
+ acted = true
+ continue
+ }
+ if fold.DuplicateOf == "" {
+ fold.DuplicateOf = keep.ID
+ if err := t.db.Model(&taskRecord{}).Where("id = ?", fold.ID).Update("duplicate_of", keep.ID).Error; err != nil {
+ return folded, err
+ }
+ if err := t.saveTask(&fold); err != nil {
+ return folded, err
+ }
+ acted = true
+ }
+ }
+ }
+ if !acted {
+ return folded, nil
+ }
+ }
+ return folded, nil
+}
+
+// fold combines k into into: k's report, findings and thread are copied
+// onto into, marked as folded from k; k is cancelled without merging,
+// keeping the stage it had for Undo; the creator gets a quiet receipt.
+func (t *txn) fold(k, into taskRecord) error {
+ now := t.now()
+ var entries []entryRecord
+ if err := t.db.Where("task_id = ? AND (folded_from IS NULL OR folded_from = '')", k.ID).Order("created_at, id").Find(&entries).Error; err != nil {
+ return err
+ }
+ report := k.Title
+ if k.Brief != "" {
+ report += "\n\n" + k.Brief
+ }
+ copies := []entryRecord{{ID: newID("e_"), TaskID: into.ID, IdempotencyKey: "fold:" + k.ID, Kind: entryReport, Author: k.Creator, Text: clip(report, wire.MaxThreadText), CreatedAt: k.CreatedAt, FoldedFrom: k.ID}}
+ for _, e := range entries {
+ c := e
+ c.ID, c.TaskID, c.IdempotencyKey, c.FoldedFrom = newID("e_"), into.ID, "fold:"+k.ID+":"+e.ID, k.ID
+ copies = append(copies, c)
+ }
+ if err := t.db.Create(&copies).Error; err != nil {
+ return err
+ }
+ k.FoldedInto, k.FoldedStage, k.FoldedAt, k.DuplicateOf = into.ID, k.Stage, &now, into.ID
+ k.Stage = wire.StageCancelled
+ k.Revision++
+ k.UpdatedAt = now
+ // Not saveTask: a fold is no ending. The runner keeps the task's
+ // sessions and nothing is withdrawn, so Undo finds it as it was.
+ if err := t.db.Model(&taskRecord{}).Where("id = ?", k.ID).Select("stage", "folded_into", "folded_stage", "folded_at", "duplicate_of", "revision", "updated_at").Updates(&k).Error; err != nil {
+ return err
+ }
+ if err := t.taskEvent(k); err != nil {
+ return err
+ }
+ if err := t.saveTask(&into); err != nil {
+ return err
+ }
+ opts, _ := json.Marshal([]string{wire.ChoiceUndo})
+ c := cardRecord{ID: newID("c_"), Person: k.Creator, Kind: wire.CardCombined, State: wire.CardOpen, ProjectID: k.ProjectID, TaskID: k.ID, Name: k.Title, Question: t.words("chat.card.combined", k.Title, into.Title), Options: string(opts), Revision: 1, CreatedAt: now, UpdatedAt: now}
+ if err := t.db.Create(&c).Error; err != nil {
+ return err
+ }
+ return t.cardEvent(c)
+}
+
+// unfold restores a combined task exactly as it was and keeps the pair
+// apart from then on.
+func (t *txn) unfold(person string, k taskRecord) (taskRecord, error) {
+ if k.FoldedInto == "" {
+ return k, ErrConflict
+ }
+ if k.Creator != person {
+ return k, ErrForbidden
+ }
+ into, err := t.loadTask(k.FoldedInto)
+ survivor := err == nil
+ if err != nil && !errors.Is(err, ErrNotFound) {
+ return k, err
+ }
+ if err := t.db.Where("task_id = ? AND folded_from = ?", k.FoldedInto, k.ID).Delete(&entryRecord{}).Error; err != nil {
+ return k, err
+ }
+ if err := t.markDistinct(k.ID, k.FoldedInto); err != nil {
+ return k, err
+ }
+ k.Stage, k.FoldedInto, k.FoldedStage, k.FoldedAt, k.DuplicateOf = k.FoldedStage, "", "", nil, ""
+ k.Revision++
+ k.UpdatedAt = t.now()
+ if err := t.db.Model(&taskRecord{}).Where("id = ?", k.ID).Select("stage", "folded_into", "folded_stage", "folded_at", "duplicate_of", "revision", "updated_at").Updates(&k).Error; err != nil {
+ return k, err
+ }
+ if err := t.taskEvent(k); err != nil {
+ return k, err
+ }
+ if survivor {
+ if err := t.saveTask(&into); err != nil {
+ return k, err
+ }
+ }
+ var cards []cardRecord
+ if err := t.db.Where("task_id = ? AND kind = ? AND state = ?", k.ID, wire.CardCombined, wire.CardOpen).Find(&cards).Error; err != nil {
+ return k, err
+ }
+ for i := range cards {
+ cards[i].State, cards[i].Choice = wire.CardAnswered, wire.ChoiceUndo
+ if err := t.saveCard(&cards[i]); err != nil {
+ return k, err
+ }
+ }
+ return k, nil
+}
+
+// Uncombine is Undo on a combined task: its creator only.
+func (s *Store) Uncombine(ctx context.Context, person, id string) (out wire.Task, err error) {
+ err = s.tx(ctx, func(t *txn) error {
+ if err := s.authority.CurrentPerson(ctx, t.db); err != nil {
+ return err
+ }
+ k, err := t.loadTask(id)
+ if err != nil {
+ return err
+ }
+ if k, err = t.unfold(person, k); err != nil {
+ return err
+ }
+ out, err = t.taskView(k)
+ return err
+ })
+ return out, err
+}
+
+// answerCombined is Undo on the combined receipt card.
+func (t *txn) answerCombined(person string, c cardRecord, in wire.AnswerCard) (wire.Card, wire.Card, error) {
+ v, err := t.cardView(c)
+ if err != nil {
+ return wire.Card{}, wire.Card{}, err
+ }
+ if in.Choice != wire.ChoiceUndo {
+ return wire.Card{}, wire.Card{}, ErrInvalid
+ }
+ if c.State != wire.CardOpen || c.Revision != in.Revision {
+ return wire.Card{}, v, ErrCardConflict
+ }
+ if c.Person != person {
+ return wire.Card{}, wire.Card{}, ErrForbidden
+ }
+ k, err := t.loadTask(c.TaskID)
+ if err != nil {
+ return wire.Card{}, wire.Card{}, err
+ }
+ if _, err := t.unfold(person, k); err != nil {
+ return wire.Card{}, wire.Card{}, err
+ }
+ if err := t.db.Where("id = ?", c.ID).First(&c).Error; err != nil {
+ return wire.Card{}, wire.Card{}, err
+ }
+ out, err := t.cardView(c)
+ return out, out, err
+}
+
+// foldViews fills the task's fold: where it went, and what came into it.
+func (t *txn) foldViews(v *wire.Task, k taskRecord) error {
+ if k.FoldedInto != "" && k.FoldedAt != nil {
+ var into taskRecord
+ err := t.db.Select("id", "title", "stage", "creator").Where("id = ?", k.FoldedInto).First(&into).Error
+ if err == nil {
+ v.Folded = &wire.TaskFold{Into: wire.TaskRef{ID: into.ID, Title: into.Title, Stage: into.Stage, Creator: into.Creator}, At: *k.FoldedAt}
+ } else if !errors.Is(err, gorm.ErrRecordNotFound) {
+ return err
+ }
+ }
+ var in []taskRecord
+ if err := t.db.Select("id", "title", "stage", "creator").Where("folded_into = ?", k.ID).Order("folded_at DESC, id").Find(&in).Error; err != nil {
+ return err
+ }
+ v.Combined = []wire.TaskRef{}
+ for _, f := range in {
+ v.Combined = append(v.Combined, wire.TaskRef{ID: f.ID, Title: f.Title, Stage: f.Stage, Creator: f.Creator})
+ }
+ return nil
+}
diff --git a/internal/equipo/chat/http.go b/internal/equipo/chat/http.go
index bf68c532..2a682e4f 100644
--- a/internal/equipo/chat/http.go
+++ b/internal/equipo/chat/http.go
@@ -77,6 +77,7 @@ func (h *HTTP) Mount(r chi.Router) {
r.Post("/tasks/{id}/retry", h.bearer(h.retryTask))
r.Post("/tasks/{id}/duplicate", h.bearer(h.markDuplicate))
r.Post("/tasks/{id}/merge", h.bearer(h.mergeTask))
+ r.Post("/tasks/{id}/uncombine", h.bearer(h.uncombineTask))
r.Post("/tasks/{id}/thread", h.bearer(h.postThread))
r.Get("/steps/{id}/log", h.bearer(h.stepLog))
r.Post("/tasks/{id}/questions", h.bearer(h.ask))
@@ -532,6 +533,16 @@ func (h *HTTP) markDuplicate(w http.ResponseWriter, r *http.Request, p personapi
writeJSON(w, 200, out)
}
+// uncombineTask is Undo on a task Equipo combined into another.
+func (h *HTTP) uncombineTask(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) {
+ out, err := h.Store.Uncombine(r.Context(), p.Address, chi.URLParam(r, "id"))
+ if err != nil {
+ h.fail(w, r, err)
+ return
+ }
+ writeJSON(w, 200, out)
+}
+
// mergeTask is the creator's Merge on a task left at Ready to merge.
func (h *HTTP) mergeTask(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) {
attempt, err := h.Store.MergeTask(r.Context(), p.Address, chi.URLParam(r, "id"))
diff --git a/internal/equipo/chat/inner.go b/internal/equipo/chat/inner.go
index 068eee79..4ab501a9 100644
--- a/internal/equipo/chat/inner.go
+++ b/internal/equipo/chat/inner.go
@@ -123,6 +123,9 @@ func (t *txn) stepActivity(l Lease, v *wire.StepActivityReport) error {
// coordinator at work on it.
func (t *txn) taskExtras(v *wire.Task, k taskRecord, steps []stepRecord) error {
v.CreatorName, _ = DisplayName(k.Creator)
+ if err := t.foldViews(v, k); err != nil {
+ return err
+ }
if k.TurnID != "" {
var m messageRecord
err := t.db.Where("turn_id = ? AND person = ? AND role = ?", k.TurnID, k.Creator, wire.RolePerson).Order("seq").First(&m).Error
@@ -135,9 +138,9 @@ func (t *txn) taskExtras(v *wire.Task, k taskRecord, steps []stepRecord) error {
}
if k.DuplicateOf != "" {
var d taskRecord
- err := t.db.Select("id", "title", "stage").Where("id = ?", k.DuplicateOf).First(&d).Error
+ err := t.db.Select("id", "title", "stage", "creator").Where("id = ?", k.DuplicateOf).First(&d).Error
if err == nil {
- v.DuplicateOf = &wire.TaskRef{ID: d.ID, Title: d.Title, Stage: d.Stage}
+ v.DuplicateOf = &wire.TaskRef{ID: d.ID, Title: d.Title, Stage: d.Stage, Creator: d.Creator}
} else if !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}
diff --git a/internal/equipo/chat/merge.go b/internal/equipo/chat/merge.go
index 92cec67f..22d2d1d8 100644
--- a/internal/equipo/chat/merge.go
+++ b/internal/equipo/chat/merge.go
@@ -303,7 +303,7 @@ func overlap(a, b map[string]bool) (float64, int) {
// similarTasks are the open tasks of project that read like title and
// brief, best first.
-func (t *txn) similarTasks(projectID, title, brief string) ([]taskRecord, error) {
+func (t *txn) similarTasks(person, projectID, title, brief string) ([]taskRecord, error) {
var open []taskRecord
if err := t.db.Where("project_id = ? AND stage NOT IN ? AND cancel_requested = ?", projectID, []string{wire.StageDone, wire.StageCancelled}, false).Order("created_at DESC").Limit(200).Find(&open).Error; err != nil {
return nil, err
@@ -314,7 +314,12 @@ func (t *txn) similarTasks(projectID, title, brief string) ([]taskRecord, error)
score float64
}
var hits []scored
+ hidden := t.s.authority.TestPerson
for _, k := range open {
+ // A test person's work never meets anyone else's.
+ if k.Creator != person && hidden != nil && (hidden(k.Creator) || hidden(person)) {
+ continue
+ }
ts, tn := overlap(nt, significant(k.Title))
bs, bn := overlap(nb, significant(k.Title+" "+k.Brief))
score := max(ts, bs*0.9)
diff --git a/internal/equipo/chat/models.go b/internal/equipo/chat/models.go
index 3439f205..bd9d7db9 100644
--- a/internal/equipo/chat/models.go
+++ b/internal/equipo/chat/models.go
@@ -7,7 +7,7 @@ package chat
import "time"
// Models are the tables this package owns, for the migration check.
-var Models = []any{&turnRecord{}, &messageRecord{}, &eventRecord{}, &commandRecord{}, &inboxRecord{}, &runnerSessionRecord{}, &projectRecord{}, &cardRecord{}, &toolCallRecord{}, &settingRecord{}, &coordinatorRecord{}, &notebookRecord{}, &taskRecord{}, &stepRecord{}, &entryRecord{}, &attachmentRecord{}, &questionRecord{}, &connectionRecord{}, &usageRecord{}}
+var Models = []any{&turnRecord{}, &messageRecord{}, &eventRecord{}, &commandRecord{}, &inboxRecord{}, &runnerSessionRecord{}, &projectRecord{}, &cardRecord{}, &toolCallRecord{}, &settingRecord{}, &coordinatorRecord{}, &notebookRecord{}, &taskRecord{}, &stepRecord{}, &entryRecord{}, &attachmentRecord{}, &questionRecord{}, &connectionRecord{}, &usageRecord{}, &distinctRecord{}}
type turnRecord struct {
ID string `gorm:"primaryKey"`
diff --git a/internal/equipo/chat/projects.go b/internal/equipo/chat/projects.go
index 1c357dc8..9540cae1 100644
--- a/internal/equipo/chat/projects.go
+++ b/internal/equipo/chat/projects.go
@@ -514,6 +514,11 @@ func (s *Store) Answer(ctx context.Context, person, id string, in wire.AnswerCar
out.Card, current = card, cur
return e
}
+ if c.Kind == wire.CardCombined {
+ card, cur, e := t.answerCombined(person, c, in)
+ out.Card, current = card, cur
+ return e
+ }
if c.Kind == wire.CardMerge {
card, cur, e := t.answerMerge(person, c, in)
out.Card, current = card, cur
diff --git a/internal/equipo/chat/store.go b/internal/equipo/chat/store.go
index 381fc614..398a222e 100644
--- a/internal/equipo/chat/store.go
+++ b/internal/equipo/chat/store.go
@@ -53,6 +53,9 @@ type Authority struct {
// instance itself writes into a conversation (the merge card, the
// merged line). "" for an unknown key.
Copy func(key string) string
+ // TestPerson reports a test identity (staging's suite person): its
+ // tasks are listed only to itself and never paired with anyone else's.
+ TestPerson func(address string) bool
}
// Store owns the chat tables.
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go
index 65efe3da..0de1ed58 100644
--- a/internal/equipo/chat/tasks.go
+++ b/internal/equipo/chat/tasks.go
@@ -1,6 +1,7 @@
package chat
import (
+ "slices"
"context"
"crypto/rand"
"encoding/json"
@@ -71,6 +72,11 @@ type taskRecord struct {
// DuplicateOf is an open task that read like this one when it was
// recorded anyway, or the task it was folded into.
DuplicateOf string
+ // FoldedInto is the task Equipo combined this one into, FoldedStage the
+ // stage it had then (Undo restores it) and FoldedAt when.
+ FoldedInto string
+ FoldedStage string
+ FoldedAt *time.Time
}
func (taskRecord) TableName() string { return "chat_tasks" }
@@ -147,6 +153,9 @@ type entryRecord struct {
Path string
Line int
CreatedAt time.Time
+ // FoldedFrom is the task this entry was copied from when Equipo
+ // combined that task into this one; Undo deletes exactly these.
+ FoldedFrom string
}
func (entryRecord) TableName() string { return "chat_task_entries" }
@@ -447,7 +456,7 @@ func (t *txn) recordTask(r turnRecord, repo, title, brief string, separate bool)
return wire.ToolResult{}, err
}
if err == nil {
- similar, err := t.similarTasks(existing.ID, title, brief)
+ similar, err := t.similarTasks(r.Person, existing.ID, title, brief)
if err != nil {
return wire.ToolResult{}, err
}
@@ -476,13 +485,20 @@ func (t *txn) recordTask(r turnRecord, repo, title, brief string, separate bool)
if separate {
// Recorded anyway: the most similar open task is named as a
// possible duplicate, for the person to fold it if it is one.
- similar, err := t.similarTasks(p.ID, title, brief)
+ similar, err := t.similarTasks(r.Person, p.ID, title, brief)
if err != nil {
return wire.ToolResult{}, err
}
if len(similar) > 0 {
k.DuplicateOf = similar[0].ID
}
+ // The coordinator saw them and judged this one different: Equipo
+ // never combines these pairs on its own.
+ for _, o := range similar {
+ if err := t.markDistinct(k.ID, o.ID); err != nil {
+ return wire.ToolResult{}, err
+ }
+ }
}
if err := t.db.Create(&k).Error; err != nil {
return wire.ToolResult{}, err
@@ -490,6 +506,9 @@ func (t *txn) recordTask(r turnRecord, repo, title, brief string, separate bool)
if err := t.taskEvent(k); err != nil {
return wire.ToolResult{}, err
}
+ if _, err := t.tidyDuplicates(p.ID); err != nil {
+ return wire.ToolResult{}, err
+ }
c := cardRecord{ID: newID("c_"), Person: r.Person, Kind: wire.CardTask, State: wire.StageNoted, TurnID: r.ID, ProjectID: p.ID, TaskID: k.ID, Options: "[]", Revision: 1, CreatedAt: now, UpdatedAt: now}
if err := t.db.Create(&c).Error; err != nil {
return wire.ToolResult{}, err
@@ -986,7 +1005,14 @@ func (s *Store) Tasks(ctx context.Context, person string) (out wire.TaskList, er
return err
}
out.Items, err = (&txn{s: s, db: tx}).recentTasks(wire.MaxTaskList)
- return err
+ if err != nil {
+ return err
+ }
+ // A test person's tasks are listed to itself only.
+ if hide := s.authority.TestPerson; hide != nil {
+ out.Items = slices.DeleteFunc(out.Items, func(k wire.Task) bool { return k.Creator != person && hide(k.Creator) })
+ }
+ return nil
})
return out, err
}
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go
index 30a78937..7b3d3e3b 100644
--- a/internal/equipo/chat_page.go
+++ b/internal/equipo/chat_page.go
@@ -115,6 +115,12 @@ func cardView(c wire.Card, choices []string, tasks map[string]wire.Task) chatCar
case c.State == wire.CardResolved:
v.Note = copyText("chat.card.merge_resolved")
}
+ case wire.CardCombined:
+ // Equipo combined two of the person's tasks: a quiet line, Undo.
+ v.Line, v.Open = c.Question, c.State == wire.CardOpen
+ if c.State == wire.CardAnswered {
+ v.Line = copyText("chat.card.combined_undone")
+ }
case wire.CardTask:
if t, ok := tasks[c.TaskID]; ok {
// A task card sits in its creator's own conversation.
@@ -189,7 +195,7 @@ func (a *application) chatPage(w http.ResponseWriter, r *http.Request) {
if c.Kind == wire.CardTask && v.Task == nil {
continue
}
- v.Receipt = c.Kind == wire.CardProject || c.Kind == wire.CardTask || c.Kind == wire.CardHome && c.State != wire.CardHomeAsk
+ v.Receipt = c.Kind == wire.CardProject || c.Kind == wire.CardTask || c.Kind == wire.CardCombined || c.Kind == wire.CardHome && c.State != wire.CardHomeAsk
if i, ok := reply[c.TurnID]; ok && v.Receipt && c.TurnID != "" {
view.Messages[i].Receipts = append(view.Messages[i].Receipts, v)
} else if i, ok := last[c.TurnID]; ok && c.TurnID != "" {
diff --git a/internal/equipo/chat_wiring.go b/internal/equipo/chat_wiring.go
index 90184a9b..faebf761 100644
--- a/internal/equipo/chat_wiring.go
+++ b/internal/equipo/chat_wiring.go
@@ -38,6 +38,15 @@ func (s *Store) Chat() *chat.Store {
},
ActivityLabel: activityLabel,
Copy: copyText,
+ TestPerson: func(address string) bool {
+ address = strings.ToLower(address)
+ for _, suffix := range s.chatTestPeople {
+ if strings.HasSuffix(address, suffix) {
+ return true
+ }
+ }
+ return false
+ },
}, nil)
})
return s.chat.store
diff --git a/internal/equipo/config.go b/internal/equipo/config.go
index 0b7c6cf7..d0a2359b 100644
--- a/internal/equipo/config.go
+++ b/internal/equipo/config.go
@@ -19,6 +19,10 @@ type Config struct {
AllowLoggedMail bool
// DatabaseName: a new name is a fresh database (scripts/cutover-thin.sh).
DatabaseName string
+ // TestPeople are address suffixes of test identities
+ // (EQUIPO_TEST_PEOPLE, comma-separated; staging's ".invalid"): their
+ // tasks are listed only to themselves.
+ TestPeople []string
}
func LoadConfig(getenv func(string) string) (Config, error) {
@@ -33,6 +37,11 @@ func LoadConfig(getenv func(string) string) (Config, error) {
if cfg.DatabaseName == "" {
cfg.DatabaseName = "equipo.db"
}
+ for _, suffix := range strings.Split(getenv("EQUIPO_TEST_PEOPLE"), ",") {
+ if suffix = strings.ToLower(strings.TrimSpace(suffix)); suffix != "" {
+ cfg.TestPeople = append(cfg.TestPeople, suffix)
+ }
+ }
if !databaseName.MatchString(cfg.DatabaseName) {
//lint:ignore ST1005 User-facing errors preserve the reviewed sentences in copy.go.
return Config{}, errors.New(copyInvalidDatabase)
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index 19b785ad..1a6aabe0 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -41,6 +41,8 @@ const (
copyInvalidDatabase = "EQUIPO_DATABASE must be a file name like equipo-v1.db." // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
copyChatSweep = "Could not clear old conversation events." // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
copyMigrate = "Apply migrations."
+ copyTidyFailed = "Tidy duplicate tasks."
+ copyTidied = "Combined duplicate tasks."
)
// BootLog is the shared diagnostic used by the command entry point.
@@ -587,6 +589,12 @@ var pageCopy = map[string]string{
"chat.card.merge_chose_wait": "Waiting for checks.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.merge_resolved": "Nothing to decide any more.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.merge_adopt": "Merge %s?", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "chat.card.combined": "Combined “%s” into “%s”.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "chat.card.combined_undone": "Undone: both tasks are back as they were.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.combined_into": "Combined into %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.combined_line": "Equipo combined this task into", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.combined_open": "Open it", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.combined_here": "Combined “%s” into this task.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.not_now": "Not now", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.merge_chose_not_now": "Not now.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.connections.title": "Connections", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
@@ -693,7 +701,7 @@ var pageCopy = map[string]string{
"work.menu.fold_note": "Keeps that task; this one closes as a duplicate", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.needs.one": "One decision, in one tap.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.needs.many": "%d decisions, each in one tap.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
- "work.decide.unchecked_why": "Review approved the change at %s. Checks could not run here: %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.decide.unchecked_why": "Review approved the change. Checks could not run here: %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.no_gate": "no checks were found", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.reason.needs_macos": "they need macOS", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.reason.needs_network": "they need the network", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
@@ -703,7 +711,7 @@ var pageCopy = map[string]string{
"work.project.tasks": "%d tasks", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.unchecked_ask": "Merge without checks?", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.unchecked_hint": "Waiting leaves it ready until checks can run.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
- "work.decide.adopt_why": "Checks passed and Review approved the change at %s before Equipo started merging on its own.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.decide.adopt_why": "Checks passed and Review approved the change before Equipo started merging on its own.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.adopt_ask": "Merge it now?", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.stopped_why": "%s stopped: %s, on attempt %d.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.decide.retry_ask": "Try again?", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
@@ -747,6 +755,18 @@ var pageCopy = map[string]string{
"work.tl.ready_waits_you": "Waiting for your decision.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.tl.ready_waits": "Waiting for %s's decision.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.tl.merged": "Merged into %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.checks_passed": "Checks passed.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.checks_failed": "Checks failed.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.checks_none": "No checks found, so Review judged it alone.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.checks_needs_macos": "Checks need macOS, so Review judged it alone.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.checks_needs_network": "Checks need the network, so Review judged it alone.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.checks_cannot": "Checks couldn't run here, so Review judged it alone.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.approved": "Approved.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.approved_notes": "Approved, with %d notes.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.headline.changes": "Asked for changes.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.tl.on_sha": "On commit %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.tl.merged_told": "The coordinator told %s in the conversation.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "work.tl.merged_as": "Merged as commit %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.tl.merged_detail": "%s. The coordinator told %s in the conversation.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.tl.folded": "Folded into %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.details": "Details", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
diff --git a/internal/equipo/migrations/0051_thin_duplicates.sql b/internal/equipo/migrations/0051_thin_duplicates.sql
new file mode 100644
index 00000000..230aaf0c
--- /dev/null
+++ b/internal/equipo/migrations/0051_thin_duplicates.sql
@@ -0,0 +1,5 @@
+ALTER TABLE chat_tasks ADD COLUMN folded_into text;
+ALTER TABLE chat_tasks ADD COLUMN folded_stage text;
+ALTER TABLE chat_tasks ADD COLUMN folded_at datetime;
+ALTER TABLE chat_task_entries ADD COLUMN folded_from text;
+CREATE TABLE chat_task_distinct (a text, b text, created_at datetime, PRIMARY KEY (a, b));
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql
index 58729a56..da7f8a35 100644
--- a/internal/equipo/migrations/schema.sql
+++ b/internal/equipo/migrations/schema.sql
@@ -592,13 +592,14 @@ CREATE TABLE chat_coordinators (person text PRIMARY KEY, state text, turn_id tex
CREATE TABLE chat_notebooks (person text PRIMARY KEY, entries text, revision integer, updated_at datetime);
CREATE INDEX chat_card_task ON chat_cards(task_id);
CREATE TABLE chat_project_attachments (project_id text, kind text, ref text, name text, created_at datetime, PRIMARY KEY (project_id, kind, ref));
-CREATE TABLE chat_tasks (id text PRIMARY KEY, project_id text, title text, brief text, stage text, branch text, base_sha text, creator text, turn_id text, cancel_requested numeric, revision integer, created_at datetime, updated_at datetime, watching text, moved_from text, branch_head text, merge_asked text, merged_sha text, merged_into text, merge_strategy text, merged_without_checks numeric, merged_at datetime, ready_sha text, merge_eligible text, done_at datetime, duplicate_of text);
+CREATE TABLE chat_tasks (id text PRIMARY KEY, project_id text, title text, brief text, stage text, branch text, base_sha text, creator text, turn_id text, cancel_requested numeric, revision integer, created_at datetime, updated_at datetime, watching text, moved_from text, branch_head text, merge_asked text, merged_sha text, merged_into text, merge_strategy text, merged_without_checks numeric, merged_at datetime, ready_sha text, merge_eligible text, done_at datetime, duplicate_of text, folded_into text, folded_stage text, folded_at datetime);
CREATE INDEX chat_task_project ON chat_tasks(project_id);
CREATE TABLE chat_steps (id text PRIMARY KEY, task_id text, idx integer, specialist text, person text, state text, reason text, attempt integer, base_sha text, candidate_sha text, pushed numeric, terminated numeric, summary text, log_tail text, started_at datetime, finished_at datetime, revision integer, created_at datetime, updated_at datetime, round integer, family text, account text, verdict text, review_label text, findings text, checks text, gate text, exit_code integer, output text, republish numeric, from_attempt integer, askable numeric, rebase numeric, from_base text, from_candidate text, merge_sha text, merge_into text, merge_strategy text, without_checks numeric, activity text, switched text);
CREATE INDEX chat_step_task ON chat_steps(task_id);
-CREATE TABLE chat_task_entries (id text PRIMARY KEY, task_id text, idempotency_key text, kind text, author text, text text, repo text, path text, line integer, created_at datetime);
+CREATE TABLE chat_task_entries (id text PRIMARY KEY, task_id text, idempotency_key text, kind text, author text, text text, repo text, path text, line integer, created_at datetime, folded_from text);
CREATE INDEX chat_entry_task ON chat_task_entries(task_id);
CREATE UNIQUE INDEX chat_entry_key ON chat_task_entries(task_id, idempotency_key);
+CREATE TABLE chat_task_distinct (a text, b text, created_at datetime, PRIMARY KEY (a, b));
CREATE TABLE chat_questions (id text PRIMARY KEY, task_id text, asker text, idempotency_key text, step_id text, specialist text, chosen text, text text, state text, reason text, attempt integer, dispatched numeric, answer text, timing text, revision integer, created_at datetime, updated_at datetime);
CREATE INDEX chat_question_task ON chat_questions(task_id);
CREATE UNIQUE INDEX chat_question_key ON chat_questions(task_id, asker, idempotency_key);
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js
index fd7b5075..eb500e09 100644
--- a/internal/equipo/static/chat-stream.js
+++ b/internal/equipo/static/chat-stream.js
@@ -48,9 +48,14 @@
// stagger: ms between letters (or words) as a phrase comes in; step:
// "letter" or "word"; dust: motes per flourish; warm: how many are
// warm gold; drift: "along" the words, "rise" or "settle"; every: ms
- // between flourishes (a new phrase brings one too); spin: the star's
- // flourish ("nudge", "half", "flip" or "whirl").
+ // between flourishes (a new phrase brings one too; 0: only a new
+ // phrase); spin: the star's flourish ("nudge", "half", "flip" or
+ // "whirl"; "glow" is a soft brightening). Paul, 2026-11-08: "more gentle
+ // and calming rather than jittery": calm turns slowly, breathes, lets
+ // two or three motes drift out of step and only brightens on a new
+ // phrase.
var STARDUST = {
+ calm: { stagger: 18, step: "letter", dust: 3, warm: 0, drift: "along", every: 0, spin: "glow" },
whisper: { stagger: 6, step: "letter", dust: 3, warm: 0, drift: "along", every: 5200, spin: "nudge" },
drift: { stagger: 14, step: "letter", dust: 5, warm: 0, drift: "along", every: 3600, spin: "half" },
embers: { stagger: 70, step: "word", dust: 6, warm: 2, drift: "rise", every: 4000, spin: "flip" },
@@ -59,7 +64,7 @@
// handoff: "gone" (the line fades where it sits as the reply's first
// words arrive), "caret" or "dot" (the same, then a thin caret or a
// soft dot ends the streaming text).
- var LOOK = { star: STARDUST.drift, handoff: "gone" };
+ var LOOK = { star: STARDUST.calm, handoff: "gone" };
var still = window.matchMedia ? matchMedia("(prefers-reduced-motion: reduce)") : null;
function moving() { return !(still && still.matches); }
var STAR = '<svg viewBox="0 0 16 16" focusable="false"><path d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle cx="8" cy="8" r="1.7"/></svg><i data-sat="1"></i><i data-sat="2"></i><i data-sat="3"></i>';
@@ -70,9 +75,11 @@
var dx, dy;
if (look.drift === "rise") { dx = -0.3 + (i * 0.37) % 1.7; dy = -1.2 - (i * 0.41) % 1.2; }
else if (look.drift === "settle") { dx = -0.8 + i * 0.6; dy = 0.6 + (i * 0.13) % 0.5; }
- else { dx = 1.7 + (i * 1.37) % 3; dy = (i * 0.53) % 1.4 - 0.7; }
+ else { dx = 0.9 + (i * 0.7) % 1.6; dy = (i * 0.53) % 1.2 - 0.6; }
var warm = look.warm && i % Math.ceil(n / look.warm) === 1;
- out.push({ dx: dx, dy: dy, delay: Math.round(i * 420 / n), kind: warm ? "warm" : i % 2 ? "light" : "" });
+ // Out of step: each its own slow pace and a staggered, slightly
+ // random start, so they never pulse together.
+ out.push({ dx: dx, dy: dy, delay: Math.round(i * 1700 + Math.random() * 700), dur: 4 + Math.random() * 2, kind: warm ? "warm" : i % 2 ? "light" : "" });
}
return out;
}
@@ -116,6 +123,7 @@
mote.style.setProperty("--dx", m.dx.toFixed(2) + "em");
mote.style.setProperty("--dy", m.dy.toFixed(2) + "em");
mote.style.setProperty("--d", m.delay + "ms");
+ mote.style.setProperty("--dur", m.dur.toFixed(2) + "s");
spark.append(mote);
});
var label = line.querySelector("[equipo-activity]");
@@ -289,7 +297,7 @@
var out = el.querySelector("[equipo-elapsed]");
var started = Number(el.dataset.started) || Date.now();
if (out) out.textContent = format.replace("{n}", String(Math.max(0, Math.floor((Date.now() - started) / 1000))));
- if (!el.hasAttribute("data-streaming") && Date.now() - (el.flourished || 0) > LOOK.star.every) flourish(el);
+ if (LOOK.star.every && !el.hasAttribute("data-streaming") && Date.now() - (el.flourished || 0) > LOOK.star.every) flourish(el);
});
}
setInterval(tick, 1000);
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index 42c7583c..5d0b2bc6 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -196,39 +196,32 @@ html:has([equipo-conversation]) { overflow: hidden; scrollbar-gutter: auto; }
[equipo-activity] { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; color: var(--rst-text); font-weight: 500; }
[equipo-activity-sep] { flex: none; padding-inline: .3em; color: var(--rst-text-faint); }
[equipo-elapsed] { flex: none; color: var(--rst-text-muted); font-variant-numeric: tabular-nums; }
-[equipo-activity-sep], [equipo-elapsed] { transition: opacity .25s ease-in; }
+[equipo-activity-sep], [equipo-elapsed] { transition: opacity .6s ease; }
/* The sparkle: a cobalt star that turns and pulses around a white
glint, three satellites that pop in and out, and motes of dust for
its flourishes. */
[equipo-sparkle] { --equipo-warm: color-mix(in srgb, var(--rst-tone-warning-fg) 85%, var(--rst-tone-warning-bg)); position: relative; flex: none; inline-size: 1.15em; block-size: 1.15em; margin-inline-end: .6em; }
-[equipo-sparkle] svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; filter: drop-shadow(0 0 .22em color-mix(in srgb, var(--rst-accent) 55%, transparent)); transition: opacity .25s ease-in, transform .25s ease-in; }
-[equipo-sparkle] path { fill: var(--rst-accent); transform-box: fill-box; transform-origin: center; animation: equipo-star 4.2s ease-in-out infinite; }
-[equipo-sparkle] circle { fill: var(--rst-on-accent-fill); transform-box: fill-box; transform-origin: center; animation: equipo-glint 2.1s ease-in-out infinite; }
-@keyframes equipo-star { 0% { transform: rotate(0) scale(.8); } 50% { transform: rotate(45deg) scale(1.05); } 100% { transform: rotate(90deg) scale(.8); } }
-@keyframes equipo-glint { 0%, 100% { transform: scale(.75); opacity: .65; } 50% { transform: scale(1.1); opacity: 1; } }
+[equipo-sparkle] svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; filter: drop-shadow(0 0 .22em color-mix(in srgb, var(--rst-accent) 55%, transparent)); transition: opacity .6s ease, transform .6s ease; animation: equipo-turn 16s linear infinite; }
+[equipo-sparkle] path { fill: var(--rst-accent); transform-box: fill-box; transform-origin: center; animation: equipo-breathe-star 3.6s cubic-bezier(.37, 0, .63, 1) infinite; }
+[equipo-sparkle] circle { fill: var(--rst-on-accent-fill); transform-box: fill-box; transform-origin: center; animation: equipo-glow 4.8s cubic-bezier(.37, 0, .63, 1) infinite; }
+@keyframes equipo-turn { to { transform: rotate(360deg); } }
+@keyframes equipo-breathe-star { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
+@keyframes equipo-glow { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
[equipo-sparkle] i { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; opacity: 0; }
-[equipo-sparkle] [data-sat] { inset-block-start: auto; inset-inline-start: auto; inline-size: .44em; block-size: .44em; background: var(--rst-accent); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); transform: scale(0); animation: equipo-sat 2.7s ease-in-out .4s infinite; }
+[equipo-sparkle] [data-sat] { inset-block-start: auto; inset-inline-start: auto; inline-size: .44em; block-size: .44em; background: var(--rst-accent); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); transform: scale(.85) rotate(45deg); animation: equipo-sat 6.5s cubic-bezier(.37, 0, .63, 1) .4s infinite; }
[equipo-sparkle] [data-sat="1"] { inset-block-start: -.32em; inset-inline-end: -.38em; }
-[equipo-sparkle] [data-sat="2"] { inset-block-end: -.22em; inset-inline-start: -.36em; inline-size: .34em; block-size: .34em; background: color-mix(in srgb, var(--rst-accent) 45%, var(--rst-on-accent-fill)); animation-duration: 3.7s; animation-delay: 1.5s; }
-[equipo-sparkle] [data-sat="3"] { inset-block-start: -.45em; inset-inline-start: -.05em; inline-size: .3em; block-size: .3em; animation-duration: 4.3s; animation-delay: 2.6s; }
+[equipo-sparkle] [data-sat="2"] { inset-block-end: -.22em; inset-inline-start: -.36em; inline-size: .34em; block-size: .34em; background: color-mix(in srgb, var(--rst-accent) 45%, var(--rst-on-accent-fill)); animation-duration: 7.7s; animation-delay: 2.3s; }
+[equipo-sparkle] [data-sat="3"] { inset-block-start: -.45em; inset-inline-start: -.05em; inline-size: .3em; block-size: .3em; animation-duration: 8.9s; animation-delay: 4.1s; }
[equipo-sparkle][data-warm] [data-sat="2"] { background: var(--equipo-warm); }
-@keyframes equipo-sat { 0%, 24%, 100% { opacity: 0; transform: scale(0) rotate(0); } 10% { opacity: 1; transform: scale(1) rotate(45deg); } }
+@keyframes equipo-sat { 0%, 100% { opacity: 0; } 45%, 60% { opacity: .75; } }
[equipo-sparkle] [data-mote] { inline-size: .26em; block-size: .26em; margin: -.13em; border-radius: 50%; background: var(--rst-accent); box-shadow: 0 0 .25em color-mix(in srgb, var(--rst-accent) 70%, transparent); }
[equipo-sparkle] [data-mote="light"] { background: color-mix(in srgb, var(--rst-accent) 40%, var(--rst-on-accent-fill)); }
[equipo-sparkle] [data-mote="warm"] { background: var(--equipo-warm); box-shadow: 0 0 .3em color-mix(in srgb, var(--equipo-warm) 70%, transparent); }
-[equipo-sparkle][data-flourish] [data-mote] { animation: equipo-dust 1.3s ease-out var(--d) both; }
-[equipo-sparkle][data-drift="settle"][data-flourish] [data-mote] { animation: equipo-settle 1.6s cubic-bezier(.2, .6, .4, 1) var(--d) both; }
-@keyframes equipo-dust { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .12)) scale(1.2); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
-@keyframes equipo-settle { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 12% { opacity: 1; } 35% { transform: translate(calc(var(--dx) * .45), -.8em) scale(1.1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.5); } }
+[equipo-sparkle] [data-mote] { animation: equipo-mote var(--dur, 5s) cubic-bezier(.37, 0, .63, 1) var(--d, 0s) infinite both; }
+@keyframes equipo-mote { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 35% { opacity: .65; } 70% { opacity: .5; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.45); } }
/* The star's flourish, one per look. */
-[equipo-sparkle][data-flourish][data-spin="nudge"] svg { animation: equipo-nudge .7s var(--equipo-ease); }
-[equipo-sparkle][data-flourish][data-spin="half"] svg { animation: equipo-half .7s var(--equipo-ease); }
-[equipo-sparkle][data-flourish][data-spin="flip"] svg { animation: equipo-flip .8s var(--equipo-ease); }
-[equipo-sparkle][data-flourish][data-spin="whirl"] svg { animation: equipo-whirl .85s cubic-bezier(.3, 1.5, .5, 1); }
-@keyframes equipo-nudge { 40% { transform: scale(1.12) rotate(12deg); } }
-@keyframes equipo-half { 50% { transform: rotate(90deg) scale(1.28); } 100% { transform: rotate(180deg); } }
-@keyframes equipo-flip { 50% { transform: rotateY(180deg) scale(1.2); } 100% { transform: rotateY(360deg); } }
-@keyframes equipo-whirl { 45% { transform: rotate(240deg) scale(1.38); } 100% { transform: rotate(360deg); } }
+[equipo-sparkle][data-flourish] path { animation: equipo-breathe-star 3.6s cubic-bezier(.37, 0, .63, 1) infinite, equipo-brighten 1.6s cubic-bezier(.37, 0, .63, 1); }
+@keyframes equipo-brighten { 50% { filter: brightness(1.3); } }
/* The words: the visible phrase is drawn letter by letter beside the
real label, which stays for screen readers. Letters the new phrase
shares with the old stay still; the rest fade in. */
@@ -239,18 +232,16 @@ html:has([equipo-conversation]) { overflow: hidden; scrollbar-gutter: auto; }
[equipo-phrase] > span > span { display: inline-block; white-space: pre; }
[equipo-phrase] > [data-in] > span { animation: equipo-letter-in .32s ease-out calc(.2s + var(--n) * var(--stagger, 14ms)) both, equipo-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; }
[equipo-phrase] > [data-in] > [data-keep] { animation: equipo-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; }
-[equipo-phrase] > [data-out] > span, [equipo-activity-line][data-leaving] [equipo-phrase] > span > span { animation: equipo-letter-out .2s ease-in both; }
+[equipo-phrase] > [data-out] > span, [equipo-activity-line][data-leaving] [equipo-phrase] > span > span { animation: equipo-letter-out .6s ease both; }
@keyframes equipo-letter-in { from { opacity: 0; transform: translateY(.18em); } }
@keyframes equipo-letter-out { to { opacity: 0; transform: translateY(-.15em); } }
@keyframes equipo-wave { 0%, 22%, 100% { color: var(--rst-text); } 8% { color: var(--rst-accent); } }
/* Handing over: as the reply's first words arrive the line fades where
it sits, star and timer together, with a last wisp of two motes. */
-[equipo-activity-line][data-leaving] { position: absolute; inset-block-start: 0; inset-inline-start: 0; visibility: hidden; pointer-events: none; transition: visibility 0s .9s; }
-[equipo-activity-line][data-leaving] [equipo-sparkle] svg { opacity: 0; transform: scale(.5); animation: none; }
-[equipo-activity-line][data-leaving] [data-sat] { animation: none; opacity: 0; }
+[equipo-activity-line][data-leaving] { position: absolute; inset-block-start: 0; inset-inline-start: 0; visibility: hidden; pointer-events: none; transition: visibility 0s .6s; }
+[equipo-activity-line][data-leaving] [equipo-sparkle] svg { opacity: 0; transform: scale(.85); animation: none; }
+[equipo-activity-line][data-leaving] [data-sat], [equipo-activity-line][data-leaving] [data-mote] { animation: none; opacity: 0; transition: opacity .6s ease; }
[equipo-activity-line][data-leaving] [equipo-activity-sep], [equipo-activity-line][data-leaving] [equipo-elapsed] { opacity: 0; }
-[equipo-activity-line][data-leaving] [data-wisp] { animation: equipo-wisp .9s ease-out both; }
-@keyframes equipo-wisp { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: .5; } 100% { opacity: 0; transform: translate(.5em, -1.1em) scale(.5); } }
/* The reply's words fade in as they stream. The caret and dot handoffs
end the streaming text with a thin caret or a soft dot. */
[data-stream-text] [data-new] { animation: equipo-fade .32s ease-out both; }
@@ -364,8 +355,8 @@ html:has([equipo-conversation]) { overflow: hidden; scrollbar-gutter: auto; }
[equipo-mark] { display: inline-block; inline-size: 1em; block-size: 1em; margin: 0; vertical-align: -.12em; }
[equipo-mark][data-size="s"] { font-size: .85em; }
[equipo-mark][data-size="s"] [data-mote] { display: none; }
-[equipo-mark][data-flourish] svg { animation: equipo-half .7s var(--equipo-ease); }
-[equipo-mark][data-flourish] [data-mote] { animation: equipo-dust 1.3s ease-out var(--d) both; }
+[equipo-mark][data-size="s"] svg { animation: none; }
+[equipo-mark][data-size="s"] [data-sat] { animation: none; opacity: .55; }
[equipo-clock] { font-variant-numeric: tabular-nums; color: var(--rst-text-muted); }
/* People and projects. */
[equipo-av] { display: inline-grid; place-items: center; flex: none; inline-size: 1.25rem; block-size: 1.25rem; border-radius: 50%; font-size: .6rem; font-weight: 600; color: light-dark(oklch(0.35 0.08 var(--h)), oklch(0.9 0.06 var(--h))); background: light-dark(oklch(0.92 0.045 var(--h)), oklch(0.32 0.06 var(--h))); box-shadow: inset 0 0 0 1px light-dark(oklch(0.85 0.06 var(--h)), oklch(0.4 0.07 var(--h))); }
@@ -709,3 +700,25 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex
[equipo-chat-header] { block-size: auto; min-block-size: calc(3.5rem + env(safe-area-inset-top, 0px)); padding-block: env(safe-area-inset-top, 0px) 0; }
[equipo-chat-header] h1 { line-height: 1.25; }
}
+/* A combined duplicate: a quiet line with Undo on hover, focus or touch. */
+[equipo-combined] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-1) var(--rst-sp-2); margin: var(--rst-sp-2) 0 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
+[equipo-combined] .icon { inline-size: 1em; block-size: 1em; margin: 0; color: var(--rst-tone-positive-fg); }
+[equipo-combined] a { color: inherit; }
+[equipo-combined] form { margin: 0; }
+[equipo-combined] [equipo-link] { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--rst-text-muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; opacity: 0; transition: opacity .15s; }
+[equipo-combined]:hover [equipo-link], [equipo-combined]:focus-within [equipo-link] { opacity: 1; }
+@media (hover: none) { [equipo-combined] [equipo-link] { opacity: 1; } }
+/* Timeline entries lead with one plain sentence; the wordy rest, paths
+ and commits are behind a quiet Details, closed until asked for. */
+[equipo-headline] { margin: .15rem 0 0; color: var(--rst-text); font-size: var(--rst-fs-sm); max-inline-size: 64ch; }
+[equipo-tl-more] { margin-block-start: .2rem; font-size: var(--rst-fs-sm); }
+[equipo-tl-more] > summary { list-style: none; display: inline-flex; align-items: center; gap: .3em; padding: .1rem .3rem; margin-inline-start: -.3rem; border-radius: var(--rst-radius-sm); color: var(--rst-text-muted); font-size: var(--rst-fs-xs); cursor: pointer; }
+[equipo-tl-more] > summary::-webkit-details-marker { display: none; }
+[equipo-tl-more] > summary:hover, [equipo-tl-more] > summary:focus-visible { color: var(--rst-text); background: var(--rst-tint-hover); }
+[equipo-tl-more] > summary .icon { inline-size: 1em; block-size: 1em; margin: 0; transform: rotate(-90deg); transition: transform .2s var(--equipo-ease, ease); }
+[equipo-tl-more][open] > summary .icon { transform: none; }
+[equipo-tl-body] { display: grid; gap: var(--rst-sp-2); margin: var(--rst-sp-2) 0 var(--rst-sp-1); padding: var(--rst-sp-2) var(--rst-sp-3); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: var(--rst-surface); color: var(--rst-text-muted); max-inline-size: 64ch; }
+[equipo-tl-body] [equipo-findings] { margin: 0; }
+[equipo-tl-body] pre { max-block-size: 14rem; overflow: auto; font-size: var(--rst-fs-xs); }
+[equipo-tl-note] { margin: 0; font-size: var(--rst-fs-xs); color: var(--rst-text-faint); }
+@media (prefers-reduced-motion: reduce) { [equipo-tl-more] > summary .icon { transition: none; } }
diff --git a/internal/equipo/static/nav-stream.js b/internal/equipo/static/nav-stream.js
index e7fe6729..91a4601f 100644
--- a/internal/equipo/static/nav-stream.js
+++ b/internal/equipo/static/nav-stream.js
@@ -61,16 +61,6 @@
}
window.equipoAges = ages;
setInterval(ages, 60000);
- // Now and then the larger marks flourish, never under reduced motion.
- var still = window.matchMedia && matchMedia("(prefers-reduced-motion: reduce)");
- setInterval(function () {
- if (still && still.matches) return;
- document.querySelectorAll("[equipo-mark]:not([data-size='s'])").forEach(function (m) {
- m.removeAttribute("data-flourish");
- void m.offsetWidth;
- m.setAttribute("data-flourish", "");
- });
- }, 3600);
function work(type) {
document.dispatchEvent(new CustomEvent("equipo:work", { detail: { type: type } }));
}
diff --git a/internal/equipo/store.go b/internal/equipo/store.go
index dbd768ea..a0389cd7 100644
--- a/internal/equipo/store.go
+++ b/internal/equipo/store.go
@@ -73,6 +73,8 @@ type Store struct {
// chatExecution is EQUIPO_EXECUTION_ENABLED: without it no runner
// receives coordinator turns.
chatExecution bool
+ // chatTestPeople are EQUIPO_TEST_PEOPLE's address suffixes.
+ chatTestPeople []string
}
type StoreOption func(*Store)
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html
index b224bcd0..4fda85d0 100644
--- a/internal/equipo/templates/chat.html
+++ b/internal/equipo/templates/chat.html
@@ -2,7 +2,7 @@
{{define "title"}}{{copy "conversation.title"}}{{end}}
{{define "chat-card"}}<li equipo-card="{{.Kind}}"{{if .Receipt}} equipo-receipt{{end}} data-card="{{.ID}}" data-state="{{.State}}" data-turn-id="{{.TurnID}}">
{{if and .Receipt (eq .Kind "task")}}{{template "work-task-receipt" .}}
-{{else if .Receipt}}<p equipo-card-line>{{icon "folder"}}<span>{{.Line}}</span></p>{{if .Open}}<button type="button" equipo-receipt-more aria-expanded="false" aria-controls="acts-{{.ID}}" aria-label="{{copy "chat.card.more"}}">⋯</button><span equipo-receipt-actions id="acts-{{.ID}}">{{if eq .Kind "home"}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><button equipo-link name="choice" value="undo" type="submit">{{copy "chat.card.undo"}}</button></form>{{else}}<details equipo-change><summary equipo-link>{{.Change}}</summary><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><select rst-input name="choice" aria-label="{{.Change}}">{{range .Choices}}<option>{{.}}</option>{{end}}</select><button rst-btn="primary" type="submit">{{copy "chat.card.use"}}</button></form></details>{{if .Remove}}<form method="post" action="/conversation/projects/{{.ProjectID}}/remove" data-card-form><button equipo-link type="submit">{{copy "chat.card.remove"}}</button></form>{{end}}{{end}}</span>{{end}}
+{{else if .Receipt}}<p equipo-card-line>{{icon "folder"}}<span>{{.Line}}</span></p>{{if .Open}}<button type="button" equipo-receipt-more aria-expanded="false" aria-controls="acts-{{.ID}}" aria-label="{{copy "chat.card.more"}}">⋯</button><span equipo-receipt-actions id="acts-{{.ID}}">{{if or (eq .Kind "home") (eq .Kind "combined")}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><button equipo-link name="choice" value="undo" type="submit" data-card-undo>{{copy "chat.card.undo"}}</button></form>{{else}}<details equipo-change><summary equipo-link>{{.Change}}</summary><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><select rst-input name="choice" aria-label="{{.Change}}">{{range .Choices}}<option>{{.}}</option>{{end}}</select><button rst-btn="primary" type="submit">{{copy "chat.card.use"}}</button></form></details>{{if .Remove}}<form method="post" action="/conversation/projects/{{.ProjectID}}/remove" data-card-form><button equipo-link type="submit">{{copy "chat.card.remove"}}</button></form>{{end}}{{end}}</span>{{end}}
{{else if eq .Kind "question"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{range .Options}}<button rst-btn name="choice" value="{{.}}" type="submit">{{.}}</button>{{else}}<input rst-input name="choice" required maxlength="2000" aria-label="{{copy "chat.card.answer"}}"><button rst-btn="primary" type="submit">{{copy "chat.card.answer"}}</button>{{end}}</form>{{else}}<p equipo-card-note>{{printf (copy "chat.card.answered") .Choice}}</p>{{end}}
{{else if eq .Kind "home"}}<p equipo-card-line>{{icon "folder"}}<span>{{.Line}}</span></p><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}"><button rst-btn="primary" name="choice" value="confirm" type="submit">{{copy "chat.card.confirm"}}</button></form>
{{else if eq .Kind "merge"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{range .Options}}<button rst-btn="{{if eq . "merge"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-merge-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
diff --git a/internal/equipo/templates/work_parts.html b/internal/equipo/templates/work_parts.html
index e736c651..f8df4baa 100644
--- a/internal/equipo/templates/work_parts.html
+++ b/internal/equipo/templates/work_parts.html
@@ -2,7 +2,7 @@
the stage track, badges, the row and the decision card. Every row is
clickable as a whole through its title link's ::after; the few
controls inside a row sit above it. */}}
-{{define "mark"}}<span equipo-sparkle equipo-mark{{if eq . "s"}} data-size="s"{{end}} aria-hidden="true"><svg viewBox="0 0 16 16" focusable="false"><path d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle cx="8" cy="8" r="1.7"/></svg><i data-sat="1"></i><i data-sat="2"></i><i data-sat="3"></i>{{if ne . "s"}}<i data-mote style="--dx:1.70em;--dy:-0.70em;--d:0ms"></i><i data-mote="light" style="--dx:3.07em;--dy:-0.17em;--d:84ms"></i><i data-mote style="--dx:1.74em;--dy:0.36em;--d:168ms"></i><i data-mote="light" style="--dx:3.11em;--dy:-0.11em;--d:252ms"></i><i data-mote style="--dx:2.48em;--dy:0.42em;--d:336ms"></i>{{end}}</span>{{end}}
+{{define "mark"}}<span equipo-sparkle equipo-mark{{if eq . "s"}} data-size="s"{{end}} aria-hidden="true"><svg viewBox="0 0 16 16" focusable="false"><path d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle cx="8" cy="8" r="1.7"/></svg><i data-sat="1"></i><i data-sat="2"></i><i data-sat="3"></i>{{if ne . "s"}}<i data-mote style="--dx:.9em;--dy:-.6em;--d:.3s;--dur:4.6s"></i><i data-mote="light" style="--dx:1.5em;--dy:-.1em;--d:2.1s;--dur:5.7s"></i><i data-mote style="--dx:1.1em;--dy:.5em;--d:3.8s;--dur:5.1s"></i>{{end}}</span>{{end}}
{{define "elapsed"}}<span equipo-clock data-since="{{since .}}">{{elapsed .}}</span>{{end}}
{{define "av"}}<span equipo-av style="--h:{{.Hue}}" title="{{.Address}}" aria-hidden="true">{{.Initials}}</span>{{end}}
{{define "av-l"}}<span equipo-av data-size="l" style="--h:{{.Hue}}" title="{{.Address}}" aria-hidden="true">{{.Initials}}</span>{{end}}
diff --git a/internal/equipo/templates/work_task.html b/internal/equipo/templates/work_task.html
index ca06a682..b0e8c3ad 100644
--- a/internal/equipo/templates/work_task.html
+++ b/internal/equipo/templates/work_task.html
@@ -11,17 +11,21 @@
{{template "track-full" .}}
<p equipo-t-summary data-summary>{{if .Live}}{{template "mark" ""}}{{end}}<span data-stage-line>{{.Summary}}</span></p>
{{with .Dup}}{{if not $.Thin.Task.Decision}}<p equipo-dup>{{icon "alert-triangle"}}<span>{{copy "work.dup"}} <a href="/tasks/{{.ID}}">{{.Title}}</a>{{if not $.Thin.Task.Mine}} {{printf (copy "work.dup_decides") $.Thin.Task.Creator.Name}}{{end}}</span></p>{{end}}{{end}}
+{{with .Folded}}<div equipo-combined data-folded>{{icon "check-circle"}}<span>{{copy "work.combined_line"}} <a href="/tasks/{{.Into.ID}}">{{.Into.Title}}</a>.</span>{{if $.Thin.Task.Mine}}<form method="post" action="/tasks/{{$.Thin.Task.ID}}/uncombine"><input type="hidden" name="from" value="task"><button equipo-link type="submit" data-uncombine>{{copy "chat.card.undo"}}</button></form>{{end}}</div>{{end}}
+{{range .Combined}}<div equipo-combined data-combined="{{.ID}}">{{icon "check-circle"}}<span>{{printf (copy "work.combined_here") .Title}} <a href="/tasks/{{.ID}}">{{copy "work.combined_open"}}</a></span>{{if $.Thin.Task.Mine}}<form method="post" action="/tasks/{{.ID}}/uncombine"><input type="hidden" name="from" value="task"><input type="hidden" name="task" value="{{$.Thin.Task.ID}}"><button equipo-link type="submit" data-uncombine>{{copy "chat.card.undo"}}</button></form>{{end}}</div>{{end}}
{{if and .Decision (not .Card)}}{{template "decision" (dict "Task" . "Head" false "From" "task")}}{{end}}
</header>
<div equipo-t-cols>
<section equipo-t-main data-work-region id="task-main"><h2>{{copy "work.tl.heading"}}</h2>
-<ol equipo-tl>{{range .Timeline}}<li data-kind="{{.Kind}}"{{if .Live}} data-live{{end}}><span equipo-tl-dot>{{if .Live}}{{template "mark" ""}}{{end}}</span><div>
-<p equipo-what>{{if .Live}}<span equipo-live-line>{{.What}}{{with .Since}} {{template "elapsed" .}}{{end}}</span>{{else}}<b>{{.What}}</b>{{end}}{{with .Badge}} {{template "badge" .}}{{end}}{{with .Took}} <span equipo-took>{{.}}</span>{{end}}{{with .At}}{{if not $.Thin.Task.Live}}{{end}} <time datetime="{{.Format "2006-01-02T15:04:05Z07:00"}}">{{.Format "15:04"}}</time>{{end}}</p>
-{{with .Detail}}<p equipo-tl-detail{{if $.Thin.Task.Live}} data-activity{{end}}>{{.}}</p>{{end}}
+<ol equipo-tl>{{range $i, $it := .Timeline}}<li data-kind="{{.Kind}}"{{if .Live}} data-live{{end}}><span equipo-tl-dot>{{if .Live}}{{template "mark" ""}}{{end}}</span><div>
+<p equipo-what>{{if .Live}}<span equipo-live-line>{{.What}}{{with .Since}} {{template "elapsed" .}}{{end}}</span>{{else}}<b>{{.What}}</b>{{end}}{{with .Badge}} {{template "badge" .}}{{end}}{{with .Took}} <span equipo-took>{{.}}</span>{{end}}{{with .At}} <time datetime="{{.Format "2006-01-02T15:04:05Z07:00"}}">{{.Format "15:04"}}</time>{{end}}</p>
+{{with .Headline}}<p equipo-headline>{{.}}</p>{{end}}
{{if .Lines}}<ol equipo-tl-lines data-step-lines>{{range .Lines}}<li>{{.}}</li>{{end}}</ol>{{end}}
-{{with .Markdown}}<div equipo-tl-detail equipo-markdown>{{chatMarkdown .}}</div>{{end}}
-{{with .Findings}}<ul equipo-findings>{{range .}}<li>{{.Text}}{{if .Path}}<small><code>{{.Path}}{{if .Line}}:{{.Line}}{{end}}</code></small>{{end}}</li>{{end}}</ul>{{end}}
-{{with .Receipt}}<p equipo-receipt-line>{{.}}</p>{{end}}
+{{if .HasDetails}}<details equipo-tl-more id="tl-more-{{$i}}"><summary>{{icon "chevron-down"}}<span>{{copy "work.details"}}</span></summary><div equipo-tl-body>
+{{with .Markdown}}<div equipo-markdown equipo-md>{{chatMarkdown .}}</div>{{end}}
+{{with .Findings}}<ul equipo-findings>{{range .}}<li>{{with .Headline}}<b>{{.}}</b> {{end}}{{.Text}}{{if .Path}}<small><code>{{.Path}}{{if .Line}}:{{.Line}}{{end}}</code></small>{{end}}</li>{{end}}</ul>{{end}}
+{{range .Text}}<p equipo-tl-note>{{.}}</p>{{end}}
+</div></details>{{end}}
{{if .Decision}}{{template "decision" (dict "Task" $.Thin.Task "Head" false "From" "task")}}{{end}}
</div></li>{{end}}</ol>
<details equipo-details id="task-details"><summary>{{icon "chevron-down"}}{{copy "work.details"}}</summary>
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go
index 5770562d..e0833d91 100644
--- a/internal/equipo/work_pages.go
+++ b/internal/equipo/work_pages.go
@@ -623,6 +623,20 @@ func (a *application) withMessage(ctx context.Context, address string, msgs []wi
return msgs
}
+// workUncombine is Undo on a task Equipo combined into another; it
+// returns to the task page it came from (the folded or the surviving one).
+func (a *application) workUncombine(w http.ResponseWriter, r *http.Request) {
+ id := chi.URLParam(r, "id")
+ back := r.PostFormValue("task")
+ if back == "" {
+ back = id
+ }
+ a.chatActionTo(w, r, workBack(r, back), func(ctx context.Context, address string) error {
+ _, err := a.store.Chat().Uncombine(ctx, address, id)
+ return err
+ })
+}
+
// workDuplicate folds the task into the open task it duplicates: the
// creator's one tap, the same MarkDuplicate a device makes.
func (a *application) workDuplicate(w http.ResponseWriter, r *http.Request) {
diff --git a/internal/equipo/work_views.go b/internal/equipo/work_views.go
index fa5c3062..71c56210 100644
--- a/internal/equipo/work_views.go
+++ b/internal/equipo/work_views.go
@@ -4,6 +4,7 @@ import (
"fmt"
"hash/fnv"
"net/url"
+ "regexp"
"slices"
"strings"
"time"
@@ -417,6 +418,14 @@ func (v *taskLine) richOf(t wire.Task, viewer string, card *wire.Card, now time.
if t.DuplicateOf != nil && !wire.FinalStage(t.Stage) {
v.Dup = t.DuplicateOf
}
+ if t.Folded != nil {
+ v.StageLine = fmt.Sprintf(copyText("work.combined_into"), t.Folded.Into.Title)
+ for i := range v.Track {
+ if v.Track[i].State == "current" {
+ v.Track[i].Label = copyText("work.stage.cancelled")
+ }
+ }
+ }
if v.Mine && !wire.FinalStage(t.Stage) && t.Stage != wire.StageMerging {
if v.Dup != nil && !wire.FinalStage(v.Dup.Stage) {
v.Menu = append(v.Menu, menuItem{Action: "duplicate", Value: v.Dup.ID, Label: fmt.Sprintf(copyText("work.menu.fold"), v.Dup.Title), Note: copyText("work.menu.fold_note")})
@@ -450,7 +459,7 @@ func decisionOf(t wire.Task, v taskLine) *decisionView {
c := v.Card
d.Card = c
if slices.Contains(c.Options, wire.ChoiceNotNow) {
- d.Why = fmt.Sprintf(copyText("work.decide.adopt_why"), short(t.CandidateSHA))
+ d.Why = copyText("work.decide.adopt_why")
d.Ask = copyText("work.decide.adopt_ask")
} else {
reason := copyText("work.decide.reason." + t.ChecksReason)
@@ -460,7 +469,7 @@ func decisionOf(t wire.Task, v taskLine) *decisionView {
case reason == "":
reason = copyText("work.decide.reason.checks_unavailable")
}
- d.Why = fmt.Sprintf(copyText("work.decide.unchecked_why"), short(t.CandidateSHA), reason)
+ d.Why = fmt.Sprintf(copyText("work.decide.unchecked_why"), reason)
d.Ask = copyText("work.decide.unchecked_ask")
d.Hint = copyText("work.decide.unchecked_hint")
}
@@ -479,10 +488,6 @@ func decisionOf(t wire.Task, v taskLine) *decisionView {
d.Why = fmt.Sprintf(copyText("work.decide.stopped_why"), who(v.Stopped), reason, attempt)
d.Retry, d.Cancel = v.Retry, v.Cancel
d.Ask = copyText("work.decide.retry_ask")
- if v.Dup != nil && !wire.FinalStage(v.Dup.Stage) {
- d.Fold = true
- d.Ask = copyText("work.decide.fold_ask")
- }
case wire.NeedsFixRounds:
d.Tone, d.Why, d.Ask, d.Talk, d.Cancel = "attention", copyText("work.decide.fix_rounds_why"), copyText("work.decide.talk_ask"), true, v.Cancel
case wire.NeedsBranchMoved:
@@ -506,6 +511,8 @@ func summaryOf(t wire.Task, v taskLine) string {
return fmt.Sprintf(copyText("work.summary.merged"), t.Merged.Into)
case t.Stage == wire.StageDone:
return copyText("work.summary.done")
+ case t.Folded != nil:
+ return fmt.Sprintf(copyText("work.combined_into"), t.Folded.Into.Title) + "."
case t.Stage == wire.StageCancelled && t.DuplicateOf != nil:
return fmt.Sprintf(copyText("work.summary.folded"), t.DuplicateOf.Title)
case t.Stage == wire.StageCancelled:
@@ -540,20 +547,121 @@ func summaryOf(t wire.Task, v taskLine) string {
return v.StageLine + "."
}
-// timelineItem is one event on the task page's timeline.
+// timelineItem is one event on the task page's timeline: who or what (a
+// short label with its badge, duration and time), one plain headline,
+// and the rest folded behind Details (markdown, findings with their file
+// and line, commits).
type timelineItem struct {
- Kind, What, Detail, Markdown, Receipt string
- Live bool
- At, Since *time.Time
- Took string
- Badge *badgeLine
- Findings []wire.Finding
- Lines []string
- Decision bool
+ Kind, What, Headline string
+ Live bool
+ At, Since *time.Time
+ Took string
+ Badge *badgeLine
+ Lines []string
+ Decision bool
+ // Details: Markdown, Text lines, Findings, SHA notes; Open when there
+ // is anything to show.
+ Markdown string
+ Text []string
+ Findings []wire.Finding
+}
+
+// HasDetails reports whether the entry has anything behind Details.
+func (it timelineItem) HasDetails() bool {
+ return it.Markdown != "" || len(it.Text) > 0 || len(it.Findings) > 0
}
func at(t time.Time) *time.Time { return &t }
+var (
+ pathToken = regexp.MustCompile("`[^`]*`|\\S*/\\S*|\\b[\\w.-]+\\.[A-Za-z]{1,6}(?::\\d+)?\\b|:\\d+\\b")
+ mdNoise = regexp.MustCompile(`^[#>*\-\s]+|\*\*|__`)
+ sentenceAt = regexp.MustCompile(`[.!?](?:\s|$)`)
+)
+
+// headline is the one plain sentence an entry leads with: the
+// specialist's own when it wrote one (and it names no path), else the
+// first sentence of text that names no file, cut at a word boundary.
+func headline(explicit, text string) string {
+ if h := strings.TrimSpace(explicit); h != "" && !pathToken.MatchString(h) {
+ return clipWords(h, 110)
+ }
+ for _, line := range strings.Split(text, "\n") {
+ if strings.HasPrefix(strings.TrimSpace(line), "#") || strings.HasPrefix(strings.TrimSpace(line), "```") {
+ // A heading or code is never the headline.
+ continue
+ }
+ line = strings.TrimSpace(mdNoise.ReplaceAllString(strings.TrimSpace(line), ""))
+ if line == "" {
+ continue
+ }
+ for _, s := range sentences(line) {
+ if s = strings.TrimSpace(s); s != "" && !pathToken.MatchString(s) && !strings.HasSuffix(s, ":") {
+ return clipWords(s, 110)
+ }
+ }
+ }
+ return ""
+}
+
+func sentences(line string) []string {
+ var out []string
+ for line != "" {
+ loc := sentenceAt.FindStringIndex(line)
+ if loc == nil {
+ return append(out, line)
+ }
+ out = append(out, line[:loc[0]+1])
+ line = strings.TrimSpace(line[loc[1]:])
+ }
+ return out
+}
+
+// clipWords cuts s to at most n bytes at a word boundary.
+func clipWords(s string, n int) string {
+ if len(s) <= n {
+ return s
+ }
+ cut := s[:n]
+ if i := strings.LastIndexByte(cut, ' '); i > n/2 {
+ cut = cut[:i]
+ }
+ return strings.TrimRight(cut, " ,;:") + "…"
+}
+
+// checksHeadline is a checks result as a person reads it.
+func checksHeadline(outcome, reason string) string {
+ switch outcome {
+ case wire.ChecksPassed:
+ return copyText("work.headline.checks_passed")
+ case wire.ChecksFailed:
+ return copyText("work.headline.checks_failed")
+ case wire.ChecksNone:
+ return copyText("work.headline.checks_none")
+ }
+ if s := copyText("work.headline.checks_" + reason); s != "" {
+ return s
+ }
+ return copyText("work.headline.checks_cannot")
+}
+
+// reviewHeadline is Review's verdict as a person reads it.
+func reviewHeadline(s wire.Step) string {
+ if h := headline(s.Headline, ""); h != "" {
+ return h
+ }
+ switch {
+ case s.Verdict == wire.VerdictApprove && len(s.Findings) == 0:
+ return copyText("work.headline.approved")
+ case s.Verdict == wire.VerdictApprove:
+ return fmt.Sprintf(copyText("work.headline.approved_notes"), len(s.Findings))
+ }
+ if h := headline("", s.Summary); h != "" {
+ return h
+ }
+ return copyText("work.headline.changes")
+}
+
// timelineOf is what happened, oldest first.
func timelineOf(t wire.Task, v taskLine) []timelineItem {
var out []timelineItem
@@ -561,23 +669,31 @@ func timelineOf(t wire.Task, v taskLine) []timelineItem {
if !v.Mine {
noted = fmt.Sprintf(copyText("work.tl.noted_by"), v.Creator.Name)
}
- out = append(out, timelineItem{Kind: "noted", What: noted, Detail: v.Source, At: at(t.CreatedAt)})
+ out = append(out, timelineItem{Kind: "noted", What: noted, Headline: v.Source, At: at(t.CreatedAt)})
if len(t.Findings) > 0 {
- out = append(out, timelineItem{Kind: "finding", What: copyText("work.tl.looked"), Findings: t.Findings, At: at(t.Findings[0].At)})
+ h := ""
+ for _, f := range t.Findings {
+ if h = headline(f.Headline, f.Text); h != "" {
+ break
+ }
+ }
+ out = append(out, timelineItem{Kind: "finding", What: copyText("work.tl.looked"), Headline: h, Findings: t.Findings, At: at(t.Findings[0].At)})
}
if t.Coordinator != nil && t.Coordinator.Kind == wire.CoordinatorLooking {
out = append(out, timelineItem{Kind: "live", Live: true, What: copyText("work.chip.coordinator_looking"), Since: at(t.Coordinator.Since)})
}
+ on := func(sha string) string { return fmt.Sprintf(copyText("work.tl.on_sha"), short(sha)) }
for _, s := range t.Steps {
name := specialistName(s.Specialist)
- title := name
+ title := fmt.Sprintf(copyText("work.tl.attempt"), name, s.Attempt)
if s.Specialist == wire.SpecialistEngineering {
- title = fmt.Sprintf(copyText("work.tl.attempt"), name, s.Attempt)
if s.Rebase {
title += " (" + copyText("work.rebase") + ")"
} else if s.Round > 0 {
title += " (" + fmt.Sprintf(copyText("work.round"), s.Round) + ")"
}
+ } else if s.Attempt <= 1 {
+ title = name
}
if s.Specialist == wire.SpecialistMerge && (s.State == wire.StepQueued || s.State == wire.StepRunning || s.State == wire.StepDone) {
// The merging and merged lines say it.
@@ -602,10 +718,11 @@ func timelineOf(t wire.Task, v taskLine) []timelineItem {
if reason == "" {
reason = copyText("work.reason.other")
}
- if s.Specialist != wire.SpecialistEngineering {
- title = fmt.Sprintf(copyText("work.tl.attempt"), name, s.Attempt)
+ it := timelineItem{Kind: "stopped", What: fmt.Sprintf(copyText("work.tl.stopped"), title), Headline: sentenceCase(reason) + ".", At: s.FinishedAt}
+ if s.LogTail != "" {
+ it.Markdown = "```\n" + s.LogTail + "\n```"
}
- out = append(out, timelineItem{Kind: "stopped", What: fmt.Sprintf(copyText("work.tl.stopped"), title), Detail: reason, At: s.FinishedAt})
+ out = append(out, it)
continue
case wire.StepCancelled:
out = append(out, timelineItem{Kind: "stopped", What: fmt.Sprintf(copyText("work.tl.cancelled"), title), At: s.FinishedAt})
@@ -613,30 +730,30 @@ func timelineOf(t wire.Task, v taskLine) []timelineItem {
}
switch s.Specialist {
case wire.SpecialistEngineering:
- it := timelineItem{Kind: "step", What: title, Took: took(s), Markdown: s.Summary, At: s.FinishedAt}
+ it := timelineItem{Kind: "step", What: title, Took: took(s), Headline: headline(s.Headline, s.Summary), Markdown: s.Summary, At: s.FinishedAt}
if s.Pushed {
- it.Receipt = fmt.Sprintf(copyText("work.tl.pushed"), short(s.CandidateSHA))
+ it.Text = append(it.Text, fmt.Sprintf(copyText("work.tl.pushed"), short(s.CandidateSHA)))
}
out = append(out, it)
case wire.SpecialistChecks:
one := t
one.Checks, one.ChecksReason, one.CandidateSHA = s.Checks, s.Reason, s.CandidateSHA
- it := timelineItem{Kind: "step", What: fmt.Sprintf(copyText("work.tl.on"), name, short(s.CandidateSHA)), Badge: checksBadge(one, nil), At: s.FinishedAt}
- switch s.Checks {
- case wire.ChecksPassed:
- it.Detail = fmt.Sprintf(copyText("work.tl.checks_passed"), s.Gate, took(s))
- case wire.ChecksFailed:
- it.Detail = checksLine(s.Checks, s.Reason, s.Gate, s.ExitCode)
- case wire.ChecksCannotRun:
- it.Detail = copyText("work.tl.checks_cannot")
+ it := timelineItem{Kind: "step", What: title, Badge: checksBadge(one, nil), Took: took(s), Headline: checksHeadline(s.Checks, s.Reason), At: s.FinishedAt}
+ it.Text = append(it.Text, on(s.CandidateSHA))
+ if line := checksLine(s.Checks, s.Reason, s.Gate, s.ExitCode); line != "" {
+ it.Text = append(it.Text, line+".")
+ }
+ if s.Checks == wire.ChecksFailed && s.LogTail != "" {
+ it.Markdown = "```\n" + s.LogTail + "\n```"
}
out = append(out, it)
case wire.SpecialistReview:
one := t
one.Verdict, one.ReviewLabel = s.Verdict, s.ReviewLabel
- it := timelineItem{Kind: "step", What: fmt.Sprintf(copyText("work.tl.on"), name, short(s.CandidateSHA)), Badge: reviewBadge(one, nil), Took: took(s), Findings: s.Findings, At: s.FinishedAt}
- if len(s.Findings) == 0 && s.Verdict == wire.VerdictApprove {
- it.Detail = copyText("work.tl.no_findings")
+ it := timelineItem{Kind: "step", What: title, Badge: reviewBadge(one, nil), Took: took(s), Headline: reviewHeadline(s), Findings: s.Findings, Markdown: s.Summary, At: s.FinishedAt}
+ it.Text = append(it.Text, on(s.CandidateSHA))
+ if by := copyText("work.badge.by." + s.ReviewLabel); by != "" {
+ it.Text = append(it.Text, by+".")
}
out = append(out, it)
}
@@ -654,12 +771,12 @@ func timelineOf(t wire.Task, v taskLine) []timelineItem {
case v.Decision != nil && v.Decision.Card != nil:
it.Decision = true
case v.Card != nil || t.Checks == wire.ChecksCannotRun || t.Checks == wire.ChecksNone:
- it.Detail = fmt.Sprintf(copyText("work.tl.ready_waits"), v.Creator.Name)
+ it.Headline = fmt.Sprintf(copyText("work.tl.ready_waits"), v.Creator.Name)
if v.Mine {
- it.Detail = copyText("work.tl.ready_waits_you")
+ it.Headline = copyText("work.tl.ready_waits_you")
}
default:
- it.Detail = copyText("work.tl.ready_next")
+ it.Headline = copyText("work.tl.ready_next")
}
out = append(out, it)
}
@@ -675,20 +792,31 @@ func timelineOf(t wire.Task, v taskLine) []timelineItem {
if !v.Mine {
told = v.Creator.Name
}
- out = append(out, timelineItem{Kind: "merged", What: fmt.Sprintf(copyText("work.tl.merged"), t.Merged.Into), Detail: fmt.Sprintf(copyText("work.tl.merged_detail"), short(t.Merged.SHA), told), At: at(t.Merged.At)})
+ out = append(out, timelineItem{Kind: "merged", What: fmt.Sprintf(copyText("work.tl.merged"), t.Merged.Into), Headline: fmt.Sprintf(copyText("work.tl.merged_told"), told), Text: []string{fmt.Sprintf(copyText("work.tl.merged_as"), short(t.Merged.SHA))}, At: at(t.Merged.At)})
} else if t.Stage == wire.StageDone {
out = append(out, timelineItem{Kind: "merged", What: copyText("work.stage.done"), At: at(t.UpdatedAt)})
}
- if t.Stage == wire.StageCancelled {
+ if t.Folded != nil {
+ out = append(out, timelineItem{Kind: "stopped", What: fmt.Sprintf(copyText("work.combined_into"), t.Folded.Into.Title), At: at(t.Folded.At)})
+ } else if t.Stage == wire.StageCancelled {
it := timelineItem{Kind: "stopped", What: copyText("work.stage.cancelled"), At: at(t.UpdatedAt)}
if t.DuplicateOf != nil {
- it.Detail = fmt.Sprintf(copyText("work.tl.folded"), t.DuplicateOf.Title)
+ it.Headline = fmt.Sprintf(copyText("work.tl.folded"), t.DuplicateOf.Title)
}
out = append(out, it)
}
return out
}
+// sentenceCase capitalises a reason fragment for a line of its own.
+func sentenceCase(s string) string {
+ if s == "" {
+ return s
+ }
+ r, n := utf8.DecodeRuneInString(s)
+ return string(unicode.ToUpper(r)) + s[n:]
+}
+
// sortGroup orders a group's tasks by their last change, newest first.
func sortGroup(ts []taskLine) {
slices.SortStableFunc(ts, func(a, b taskLine) int { return b.Changed.Compare(a.Changed) })
diff --git a/internal/equipo/work_views_test.go b/internal/equipo/work_views_test.go
index eb63f048..4bd38e21 100644
--- a/internal/equipo/work_views_test.go
+++ b/internal/equipo/work_views_test.go
@@ -30,3 +30,26 @@ func TestTaskSummaryWords(t *testing.T) {
t.Fatalf("merged: %q", got)
}
}
+
+// A timeline entry leads with one plain sentence: the specialist's own
+// headline when it wrote one, else the first sentence that names no file;
+// never a path, cut at a word.
+func TestTimelineHeadlines(t *testing.T) {
+ for _, tc := range []struct{ explicit, text, want string }{
+ {"Fixed swipe-back. Couldn't test on iOS here.", "Long summary.", "Fixed swipe-back. Couldn't test on iOS here."},
+ {"Edited ios/Woodstar/Host.swift", "The fix lets the stack's pop gesture run.\n\nMore.", "The fix lets the stack's pop gesture run."},
+ {"", "The fix:\n\n- `AccountNavigationHost.swift:15` now allows both gestures.\n\nSwipe-back works on every pane now. Tested nothing.", "Swipe-back works on every pane now."},
+ {"", "**Found it:** hiding the navigation bar turned off swipe-back in panes/swipe.go. It is set in the host.", "It is set in the host."},
+ {"", "## Summary\nHiding the navigation bar turned off swipe-back. See the host.", "Hiding the navigation bar turned off swipe-back."},
+ {"", strings.Repeat("word ", 40), strings.TrimSpace(strings.Repeat("word ", 22)) + "…"},
+ {"", "internal/equipo/static/live.js:88", ""},
+ } {
+ got := headline(tc.explicit, tc.text)
+ if got != tc.want {
+ t.Fatalf("headline(%q, %q) = %q, want %q", tc.explicit, tc.text, got, tc.want)
+ }
+ if pathToken.MatchString(strings.TrimSuffix(got, "…")) {
+ t.Fatalf("a path in %q", got)
+ }
+ }
+}
diff --git a/internal/thintest/duplicates_contract_test.go b/internal/thintest/duplicates_contract_test.go
new file mode 100644
index 00000000..a1edbf56
--- /dev/null
+++ b/internal/thintest/duplicates_contract_test.go
@@ -0,0 +1,185 @@
+package thintest
+
+import (
+ "context"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/equipo"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// Uncombine is Undo on a task Equipo combined into another.
+func (c *Client) Uncombine(ctx context.Context, id string) (out wire.Task, err error) {
+ return out, c.do(ctx, "POST", "/api/v1/tasks/"+id+"/uncombine", nil, &out)
+}
+
+// forgetJudgements drops the "recorded as separate" pairs, as for tasks
+// filed before Equipo looked for duplicates (staging's swipe-back pair).
+func (r *toolRig) forgetJudgements() {
+ r.t.Helper()
+ if _, err := r.inst.DB.Writer().Exec("DELETE FROM chat_task_distinct"); err != nil {
+ r.t.Fatal(err)
+ }
+}
+
+// forgetPair drops one "recorded as separate" pair.
+func (r *toolRig) forgetPair(a, b string) {
+ r.t.Helper()
+ if _, err := r.inst.DB.Writer().Exec("DELETE FROM chat_task_distinct WHERE (a = ? AND b = ?) OR (a = ? AND b = ?)", a, b, b, a); err != nil {
+ r.t.Fatal(err)
+ }
+}
+
+func (r *toolRig) tidy() int {
+ r.t.Helper()
+ n, err := r.inst.Store.Chat().TidyDuplicates(r.ctx)
+ if err != nil {
+ r.t.Fatal(err)
+ }
+ return n
+}
+
+// TestContractCombineDuplicates: Paul, staging ("Can Equipo itself tidy
+// up the duplicates?"). Two tasks one person filed that read very much
+// alike are combined by Equipo: the one furthest along keeps the work and
+// gains the other's report, findings and thread; the other is cancelled
+// without merging, and the person gets a quiet receipt with Undo. Undo
+// restores it exactly (stage, findings, thread) and the pair is never
+// combined again. A teammate's look-alike is only named, a task at work
+// is left alone, and a test person's tasks are listed to itself only.
+func TestContractCombineDuplicates(t *testing.T) {
+ r := newToolRig(t)
+ ctx := r.ctx
+ keep := taskID(t, r.call("d1", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": "Swipe back from the edge doesn't work", "brief": "On the Account pane."}))
+ r.call("d2", wire.ToolAddFinding, map[string]any{"task": keep, "text": "The pane takes the edge swipe.", "repo": "oficina/sample", "path": "panes/swipe.go", "line": 4})
+ fold := taskID(t, r.call("d3", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": "Swipe from the edge to go back doesn't work", "brief": "Nothing happens on a swipe.", "separate": true}))
+ r.call("d4", wire.ToolAddFinding, map[string]any{"task": fold, "text": "Same pane host.", "repo": "oficina/sample", "path": "panes/host.go", "line": 9})
+ if _, err := r.client.PostThread(ctx, fold, "Only on the phone.", "n1"); err != nil {
+ t.Fatal(err)
+ }
+ // Recorded as separate by the coordinator: never combined on its own.
+ if n := r.tidy(); n != 0 {
+ t.Fatalf("combined a pair the coordinator kept apart: %d", n)
+ }
+ before, _ := r.client.Task(ctx, fold)
+ keptBefore, _ := r.client.Task(ctx, keep)
+ if before.Stage != wire.StageInvestigated || before.DuplicateOf == nil || before.DuplicateOf.ID != keep || before.DuplicateOf.Creator != Owner {
+ t.Fatalf("separate record: %+v", before.DuplicateOf)
+ }
+
+ // Filed before Equipo looked: combined on the next look.
+ r.forgetJudgements()
+ if n := r.tidy(); n != 1 {
+ t.Fatalf("combined %d", n)
+ }
+ folded, _ := r.client.Task(ctx, fold)
+ kept, _ := r.client.Task(ctx, keep)
+ if folded.Stage != wire.StageCancelled || folded.Folded == nil || folded.Folded.Into.ID != keep || folded.Merged != nil {
+ t.Fatalf("folded task: %+v", folded)
+ }
+ if len(kept.Combined) != 1 || kept.Combined[0].ID != fold || kept.Stage != keptBefore.Stage {
+ t.Fatalf("kept task: combined %+v stage %s", kept.Combined, kept.Stage)
+ }
+ text := func(k wire.Task) string {
+ var b strings.Builder
+ for _, f := range k.Findings {
+ b.WriteString(f.Text + "|")
+ }
+ for _, e := range k.Thread {
+ b.WriteString(e.Text + "|")
+ }
+ return b.String()
+ }
+ for _, want := range []string{"Same pane host.", "Only on the phone.", "Swipe from the edge to go back doesn't work", "The pane takes the edge swipe."} {
+ if !strings.Contains(text(kept), want) {
+ t.Fatalf("kept task lacks %q: %s", want, text(kept))
+ }
+ }
+ var card wire.Card
+ r.wait("combined receipt", func(c *Conversation) bool {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardCombined && k.TaskID == fold && k.State == wire.CardOpen {
+ card = k
+ return true
+ }
+ }
+ return false
+ })
+ if !strings.Contains(card.Question, "Combined “Swipe from the edge to go back doesn't work” into “Swipe back from the edge doesn't work”") {
+ t.Fatalf("receipt: %q", card.Question)
+ }
+ // Only its creator undoes it.
+ member := personToolRig(t, r, "member@example.com", equipo.RoleMember)
+ if _, err := member.client.Uncombine(ctx, fold); Status(err) != 403 {
+ t.Fatalf("member undo: %v", err)
+ }
+
+ // Undo restores it exactly, from the receipt.
+ if _, err := r.client.Answer(ctx, card.ID, wire.ChoiceUndo, card.Revision); err != nil {
+ t.Fatal(err)
+ }
+ after, _ := r.client.Task(ctx, fold)
+ keptAfter, _ := r.client.Task(ctx, keep)
+ if after.Stage != before.Stage || after.Folded != nil || text(after) != text(before) || len(after.Findings) != len(before.Findings) {
+ t.Fatalf("undo: stage %s (was %s), %q (was %q)", after.Stage, before.Stage, text(after), text(before))
+ }
+ if text(keptAfter) != text(keptBefore) || len(keptAfter.Combined) != 0 {
+ t.Fatalf("kept task after undo: %q (was %q)", text(keptAfter), text(keptBefore))
+ }
+ if n := r.tidy(); n != 0 {
+ t.Fatal("combined again after Undo")
+ }
+
+ // A task at work is not combined, even into one further along: keep
+ // moves on to In review; busy has Engineering at work.
+ r.call("d5s", wire.ToolStartTask, map[string]string{"task": keep, "brief": "go"})
+ _, body := r.expect(wire.FrameDispatch)
+ kd := body.(*wire.DispatchCommand)
+ base, cand := strings.Repeat("1", 40), strings.Repeat("2", 40)
+ r.step("d5-run", wire.StepReport{TaskID: keep, StepID: kd.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: base})
+ r.step("d5-done", wire.StepReport{TaskID: keep, StepID: kd.StepID, Attempt: 1, State: wire.StepDone, BaseSHA: base, CandidateSHA: cand, Pushed: true, Termination: true})
+ r.dispatched(wire.SpecialistChecks, base, cand, 0)
+ busy := taskID(t, r.call("d5", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": "Edge swipe back doesn't work on the pane", "brief": "Swipe back.", "separate": true}))
+ r.call("d6", wire.ToolStartTask, map[string]string{"task": busy, "brief": "go"})
+ _, body = r.expect(wire.FrameDispatch)
+ d := body.(*wire.DispatchCommand)
+ r.step("d6-run", wire.StepReport{TaskID: busy, StepID: d.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: base})
+ r.forgetPair(busy, keep)
+ r.tidy()
+ if k, _ := r.client.Task(ctx, busy); k.Folded != nil || k.Stage == wire.StageCancelled {
+ t.Fatalf("a task at work was combined: %+v", k.Folded)
+ }
+ // A teammate's look-alike is only named.
+ b := personToolRig(t, r, "second@example.com", equipo.RoleOwner)
+ theirs := taskID(t, b.call("d7", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": "Swipe back from the pane edge doesn't work", "brief": "Mine too.", "separate": true}))
+ r.forgetPair(theirs, keep)
+ r.tidy()
+ if k, _ := r.client.Task(ctx, theirs); k.Folded != nil || k.DuplicateOf == nil {
+ t.Fatalf("a teammate's look-alike: folded %+v, named %+v", k.Folded, k.DuplicateOf)
+ }
+
+ // A test person's tasks are its own: listed to itself only, and never
+ // paired with anyone else's.
+ tester := personToolRig(t, r, "suite@staging.invalid", equipo.RoleOwner)
+ own := taskID(t, tester.call("d8", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": "Swipe back from the edge doesn't work", "brief": "Witness.", "separate": true}))
+ r.forgetPair(own, keep)
+ r.tidy()
+ if k, _ := tester.client.Task(ctx, own); k.DuplicateOf != nil || k.Folded != nil {
+ t.Fatalf("test person's task paired: %+v", k.DuplicateOf)
+ }
+ list, _ := r.client.Tasks(ctx)
+ for _, k := range list.Items {
+ if k.ID == own {
+ t.Fatal("a test person's task is listed to the owner")
+ }
+ }
+ mine, _ := tester.client.Tasks(ctx)
+ found := false
+ for _, k := range mine.Items {
+ found = found || k.ID == own
+ }
+ if !found {
+ t.Fatal("a test person does not see its own task")
+ }
+}
diff --git a/internal/thintest/gallery_test.go b/internal/thintest/gallery_test.go
index f1f7dfc8..444932b3 100644
--- a/internal/thintest/gallery_test.go
+++ b/internal/thintest/gallery_test.go
@@ -1,6 +1,7 @@
package thintest
import (
+ "regexp"
"strings"
"testing"
"time"
@@ -192,18 +193,25 @@ func TestPagesInnerScreens(t *testing.T) {
needs := a.get(owner, "/tasks?needs=you", 200)
has(needs, "Needs you", "2 decisions, each in one tap.", `data-decision="`+g.unchecked+`"`, "Merge without checks?",
- `data-merge-choice="merge"`, `data-merge-choice="wait"`, `name="from" value="needs"`, `data-decision="`+g.stopped+`"`, "Fold it into the other task?",
- `action="/tasks/`+g.stopped+`/duplicate"`, `data-group="others"`, `data-task="`+g.noras+`"`)
- not(needs, "Needs you", `data-decision="`+g.noras+`"`)
+ `data-merge-choice="merge"`, `data-merge-choice="wait"`, `name="from" value="needs"`, `data-decision="`+g.stopped+`"`, "Try again?", `data-group="others"`, `data-task="`+g.noras+`"`)
+ // No card for duplicates: Equipo tidies them, or names them quietly.
+ not(needs, "Needs you", `data-decision="`+g.noras+`"`, "Fold it into the other task?", `action="/tasks/`+g.stopped+`/duplicate"`)
detail := a.get(owner, "/tasks/"+g.running, 200)
has(detail, "running task", `<ol equipo-track-full data-track`, "Engineering is on it now: editing internal/equipo/static/live.js.",
`<li data-kind="step" data-live>`, "Reading internal/equipo/static/nav-stream.js", "Coordinator looked into it", "internal/equipo/static/live.js:88",
`<details equipo-details id="task-details">`, "What happened", "Questions and notes")
ready := a.get(owner, "/tasks/"+g.unchecked, 200)
- has(ready, "unchecked task", "Approved, but checks could not run here, so it waits on you.", "<b>Checks on bc025ca</b>", "Checks: needs macOS",
- "<b>Review on bc025ca</b>", "No findings.", `<li data-kind="ready">`, "Merge without checks?", `name="from" value="task"`,
+ has(ready, "unchecked task", "Approved, but checks could not run here, so it waits on you.", "<b>Checks</b>", "Checks: needs macOS", "Checks need macOS, so Review judged it alone.", "On commit bc025ca.",
+ "<b>Review</b>", "<p equipo-headline>Approved.</p>", `<details equipo-tl-more id="tl-more-`, `<li data-kind="ready">`, "Merge without checks?", `name="from" value="task"`,
"<code>AccountNavigationHost</code>", "Pushed bc025ca", "The brief", "Where it lives", `data-open-amadan>Open on Amadan</a>`)
+ // Paths and commits live behind Details only.
+ outside := regexp.MustCompile(`(?s)<details.*?</details>`).ReplaceAllString(ready, "")
+ for _, hidden := range []string{"ios/Woodstar/AccountNavigationHost.swift", "bc025ca", "AccountNavigationHost.swift:15"} {
+ if strings.Contains(outside, hidden) {
+ t.Fatalf("%q outside Details", hidden)
+ }
+ }
// Open on Amadan is a quiet link in Details only.
if strings.Count(ready, "data-open-amadan") != 1 || strings.Index(ready, "data-open-amadan") < strings.Index(ready, "equipo-details") {
t.Fatal("Open on Amadan outside Details")
@@ -221,7 +229,7 @@ func TestPagesInnerScreens(t *testing.T) {
has(a.get(owner, "/conversation?message="+src, 200), "conversation", `data-message="`+src+`"`)
has(tasks, "Tasks", `data-ago-formats="{&#34;days&#34;:&#34;{n} days ago&#34;`)
done := a.get(owner, "/tasks/"+g.nora, 200)
- has(done, "merged task", "Merged into main. Checks and review passed before it went in.", `<li data-kind="merged">`, "<b>Merged into main</b>", "c7d0a52. The coordinator told Nora in the conversation.")
+ has(done, "merged task", "Merged into main. Checks and review passed before it went in.", `<li data-kind="merged">`, "<b>Merged into main</b>", "The coordinator told Nora in the conversation.", "Merged as commit c7d0a52.")
not(done, "merged task", "data-task-cancel", "data-task-retry")
projects := a.get(owner, "/projects", 200)
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go
index 8a62dc7e..a58d5ca9 100644
--- a/internal/thintest/inner_browser_test.go
+++ b/internal/thintest/inner_browser_test.go
@@ -265,8 +265,19 @@ func TestBrowserInnerScreens(t *testing.T) {
}
}
+ // Timeline entries: one plain line each, the rest behind Details,
+ // closed by default; Details opens by keyboard and by click.
+ p.open("/tasks/" + g.unchecked)
+ more := `[...document.querySelectorAll('[equipo-tl-more]')]`
+ p.check(more+`.length>=3 && `+more+`.every(d=>!d.open) && document.querySelectorAll('[equipo-headline]').length>=4`, "timeline entries not collapsed with headlines")
+ p.check(`(()=>{const s=document.querySelector('[equipo-tl] > li[data-kind="step"] [equipo-tl-more] > summary');s.focus();return document.activeElement===s})()`, "Details not focusable")
+ p.do(chromedp.KeyEvent("\r"))
+ p.wait(`document.querySelector('[equipo-tl] > li[data-kind="step"] [equipo-tl-more]').open && document.querySelector('[equipo-tl] > li[data-kind="step"] [equipo-tl-body]').getBoundingClientRect().height>0`, "Details opened by keyboard")
+ p.check(`(()=>{const s=document.querySelector('[equipo-tl] > li[data-kind="finding"] [equipo-tl-more] > summary');s.click();return s.parentElement.open && s.parentElement.textContent.includes('AccountNavigationHost.swift')})()`, "Details opened by click with the path")
+ p.shot(fmt.Sprintf("ux1-task-details-open-%d", size.w))
+
// Relative times keep current on their own (the minute tick).
- p.check(`(()=>{const e=document.querySelector('[equipo-ago][data-at]');e.dataset.at=String(Date.now()-5*60000-1000);window.equipoAges();return e.textContent==='5 min ago'})()`, "relative time did not tick")
+ p.check(`(()=>{const e=document.querySelector('[equipo-ago][data-at]');e.dataset.at=String(Date.now()-5*60000-1000);window.equipoAges();return e.textContent.endsWith('5 min ago')})()`, "relative time did not tick")
// "From your conversation" opens the conversation at that message,
// in view and highlighted.
diff --git a/internal/thintest/instance.go b/internal/thintest/instance.go
index dbdbae35..c1cae9c0 100644
--- a/internal/thintest/instance.go
+++ b/internal/thintest/instance.go
@@ -87,7 +87,7 @@ func (i *Instance) serve(t testing.TB, l net.Listener) {
t.Fatal(err)
}
s := equipo.NewStore(d)
- router, err := equipo.RouterWithStore(d, equipo.Config{Origin: i.URL, InstanceKey: "thin-v1-test", AllowLoggedMail: true, ExecutionEnabled: !i.NoExecution, Owners: []string{Owner}}, mail.Logged(i.logger), i.logger, s)
+ router, err := equipo.RouterWithStore(d, equipo.Config{Origin: i.URL, InstanceKey: "thin-v1-test", AllowLoggedMail: true, ExecutionEnabled: !i.NoExecution, Owners: []string{Owner}, TestPeople: []string{".invalid"}}, mail.Logged(i.logger), i.logger, s)
if err != nil {
t.Fatal(err)
}
diff --git a/internal/thintest/pages_test.go b/internal/thintest/pages_test.go
index c0b8cdc9..a4ccf85b 100644
--- a/internal/thintest/pages_test.go
+++ b/internal/thintest/pages_test.go
@@ -116,7 +116,7 @@ func TestPagesTasksAndProjects(t *testing.T) {
}
// The task page's timeline: each judgement on its SHA, then Equipo
// merging it, live.
- if detail := r.get(owner, "/tasks/"+id, 200); !strings.Contains(detail, "<b>Checks on abcdef0</b>") || !strings.Contains(detail, "<b>Review on abcdef0</b>") || !strings.Contains(detail, `<li data-kind="merging" data-live>`) || !strings.Contains(detail, "Merging into the default branch") {
+ if detail := r.get(owner, "/tasks/"+id, 200); !strings.Contains(detail, "<b>Checks</b>") || !strings.Contains(detail, "On commit abcdef0.") || !strings.Contains(detail, "<b>Review</b>") || !strings.Contains(detail, `<li data-kind="merging" data-live>`) || !strings.Contains(detail, "Merging into the default branch") {
t.Fatalf("task page timeline: %s", detail)
}
r.step("r-pm-run", wire.StepReport{TaskID: id, StepID: m.StepID, Attempt: 1, State: wire.StepRunning, BaseSHA: base, CandidateSHA: cand})
diff --git a/scripts/staging-thin.py b/scripts/staging-thin.py
index dafa0070..5f8babd1 100755
--- a/scripts/staging-thin.py
+++ b/scripts/staging-thin.py
@@ -165,9 +165,14 @@ def deploy():
if 'EQUIPO_INSTANCE_KEY' not in carlos('secrets list', quiet=True):
carlos('secrets set', 'EQUIPO_INSTANCE_KEY=' + secrets.token_urlsafe(48), quiet=True) # gitleaks:allow (generated, never stored in source)
owner = claude_a()['person_id']
+ backup()
+ # The suite person (SUITE, *.invalid) is a test identity: its tasks
+ # are listed only to itself and never paired with anyone's as a
+ # duplicate. The thin core has no teams within an instance to move it
+ # into, so it is hidden instead (UX1-PROGRESS.md).
carlos('env set', '--no-prompt', 'EQUIPO_ORIGIN=' + ORIGIN, 'EQUIPO_OWNERS=' + owner,
'EQUIPO_EXECUTION_ENABLED=1', 'EQUIPO_EXECUTION_MARKER_PATH=/data/instances/' + HOST + '/execution/witness',
- 'EQUIPO_ALLOW_LOGGED_MAIL=1')
+ 'EQUIPO_ALLOW_LOGGED_MAIL=1', 'EQUIPO_TEST_PEOPLE=.invalid')
carlos('deploy', '--target', 'linux-arm64', '--swap', 'hold', '--version', sha, '--timeout', '5m', '--no-prompt', str(binary))
deadline = time.monotonic() + 120
while True:
@@ -184,6 +189,20 @@ def deploy():
time.sleep(2)
+def backup():
+ """A copy of staging's database before every deploy (a release may
+ change data on start: it combines duplicate tasks), kept 0600 under
+ the staging root; the newest five are kept."""
+ folder = ROOT / 'backups'
+ folder.mkdir(parents=True, exist_ok=True, mode=0o700)
+ out = folder / ('equipo-' + time.strftime('%Y%m%dT%H%M%SZ', time.gmtime()) + '.db')
+ carlos('db pull', '--out', str(out), quiet=True)
+ os.chmod(out, 0o600)
+ for old in sorted(folder.glob('equipo-*.db'))[:-5]:
+ old.unlink()
+ print('backed up', out)
+
+
class FormParser:
"""Reads the inputs of the first form posting to action."""
def __init__(self, page, action):