oficina / equipo Public

Complete Roster phone layout, live states and isolated card replies

Paul Campbell pushed by paul@keymail.dev 6af83fad8af8b94e387a0b7bb7eb0bb1b1515ead parent f5dd824
35 files changed, +605 −98
  • .rastrillo/budgets.txt +4 −4
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +3 −0
  • internal/equipo/app.go +1 −0
  • internal/equipo/chat/roster.go +89 −14
  • internal/equipo/chat/roster_copy.go +2 −0
  • internal/equipo/chat/roster_test.go +12 −1
  • internal/equipo/chat/store.go +2 −1
  • internal/equipo/chat_days.go +8 −0
  • internal/equipo/chat_page.go +31 −4
  • internal/equipo/chat_roster.go +89 −2
  • internal/equipo/copy.go +3 −0
  • internal/equipo/migrations/0086_conversation_roster.sql +1 −1
  • internal/equipo/migrations/schema.sql +6 −0
  • internal/equipo/research_views.go +9 −0
  • internal/equipo/static/chat-compose.js +9 −1
  • internal/equipo/static/chat-stream.js +29 −4
  • internal/equipo/static/equipo.css +44 −4
  • internal/equipo/templates/chat.html +29 −29
  • internal/equipo/templates/work_needs.html +2 −2
  • internal/equipo/templates/work_parts.html +1 −1
  • internal/equipo/templates/work_task.html +1 −1
  • internal/equipo/work_pages.go +5 −1
  • internal/equipo/work_views.go +15 −0
  • internal/headless/browser_cards_test.go +1 −1
  • internal/headless/browser_notebook_test.go +21 −14
  • internal/plan3test/plan3_release_test.go +2 −1
  • internal/thintest/housekeeping_browser_test.go +4 −2
  • internal/thintest/inner_browser_test.go +2 −2
  • internal/thintest/merge_contract_test.go +1 −1
  • internal/thintest/publish_contract_test.go +1 −1
  • internal/thintest/research_pages_test.go +1 −1
  • internal/thintest/roster_browser_test.go +72 −5
  • internal/thintest/roster_contract_test.go +42 −0
  • internal/thintest/roster_reports_browser_test.go +56 −0
  • scripts/runner-reference-allowlist.json +7 −0

CI failed — run details

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 3bf127f5..c1c50c10 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,7 +14,7 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr
time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI.
time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage.
-size internal/equipo 19893 - Web pages, handlers, templates and runtime copy stay together: Oficina ID route wiring, the Copy setting and the job thread pages. Measured 19893 source lines.
+size internal/equipo 20238 - The web view models and templates share rendering; Roster adds bylines, reports, private sub-chat views and the Stop route. Measured 20238 source lines.
size internal/wire 6197 - Runner and person API types share Encode. Protocol 21 adds Copy fields, 22 adds job lanes and job cards. Measured 6197 source lines.
size internal/equipotest - 13400 Task 21 repairs historical migration and conversation fixtures after Plan 3. Measured 13024 test lines; the 300s time ceiling is unchanged.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
@@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device
perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen.
-size internal/equipo/chat 28039 - The instance store shares transaction and authority helpers: Copy reviews and ledger, job threads, titles, cards and nudges. Measured 28039 source lines.
+size internal/equipo/chat 28393 - The transactional conversation store shares authority and dispatch helpers; Roster adds independent personal visibility and links card replies to existing turns. Measured 28393 source lines.
perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}.
perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}.
perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections.
@@ -70,8 +70,8 @@ perf GET /api/v1/tasks/{id}/files/{file} skip Research kept images: bearer-only
perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one image, shown on the task page; a file, not a screen.
perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section.
time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally).
-size internal/headless - 10732 End-to-end scenarios through a real runner and instance: the Copy setting, wording flag and the Assistant's job threads. Measured 10732 test lines.
-size internal/thintest - 27960 Contract and browser tests share one instance harness: the Assistant's hand-off, outcome and job contracts and the models'. Measured 27960 test lines.
+size internal/headless - 10739 End-to-end scenarios through a real runner and instance: the Copy setting, wording flag and the Assistant's job threads. Measured 10739 test lines.
+size internal/thintest - 28256 The contract and browser tests share the instance harness; Roster adds real action states and desktop/phone captures in both themes. Measured 28256 test lines.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
perf GET /api/v1/advice skip Thin v1 person API: bearer-only JSON for devices; the browser reads advice through /usage and /conversation.
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index 2afcf4c7..683cdb37 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6613,6 +6613,9 @@ records remain unchanged.
| `roster.finished` | Done | C · Roster conversation | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14) |
| `roster.copy_waiting` | Copy review is waiting | C · Roster conversation | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14) |
+| `roster.copy_done` | Continuing without Copy. | C · Roster conversation | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14) |
+| `roster.stopping` | Stopping… | C · Roster conversation | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14) |
+
## Task 21
Status: DONE_WITH_CONCERNS. Offline 3b acceptance, the complete person API contract
diff --git a/internal/equipo/app.go b/internal/equipo/app.go
index 66e7f549..9aa8d3d3 100644
--- a/internal/equipo/app.go
+++ b/internal/equipo/app.go
@@ -303,6 +303,7 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg
r.Post("/conversation/cards/{id}/answer", a.chatCardAnswer)
r.Post("/conversation/cards/{id}/visibility", a.chatCardVisibility)
r.Post("/conversation/cards/{id}/reply", a.chatCardReply)
+ r.Post("/conversation/turns/{id}/stop", a.chatTurnStop)
r.Get("/jobs", a.jobsPage)
r.Get("/jobs/{id}", a.jobPage)
r.Post("/jobs/{id}/messages", a.jobSend)
diff --git a/internal/equipo/chat/roster.go b/internal/equipo/chat/roster.go
index 2c6ea1c1..e7e4eb6a 100644
--- a/internal/equipo/chat/roster.go
+++ b/internal/equipo/chat/roster.go
@@ -20,6 +20,7 @@ type cardVisibility struct {
func (cardVisibility) TableName() string { return "chat_card_visibility" }
type cardThreadRecord struct {
+ MessageID string
ID string `gorm:"primaryKey"`
CardID string `gorm:"index:chat_card_thread_card"`
Person string
@@ -34,12 +35,16 @@ func (cardThreadRecord) TableName() string { return "chat_card_threads" }
// CardPresentation is browser presentation only. Visibility is separate
// from the decision and never changes a card's revision or authority.
type CardPresentation struct {
- Coverage CardCopyCoverage
- Turns []string
- Aside bool
- Thread []CardThreadTurn
- Waiting bool
- TurnID string
+ OwnMessages []string
+ Activity []wire.ActivityLine
+ ThreadState string
+ StepID string
+ Coverage CardCopyCoverage
+ Turns []string
+ Aside bool
+ Thread []CardThreadTurn
+ Waiting bool
+ TurnID string
}
type CardThreadTurn struct {
Own bool
@@ -121,12 +126,12 @@ func (s *Store) CardPresentations(ctx context.Context, person string, ids []stri
if err := tx.Where("person = ? AND card_id = ?", person, c.ID).Order("created_at, id").Find(&links).Error; err != nil {
return err
}
- if c.AnswerMessage != "" {
+ if c.AnswerMessage != "" && c.Kind == wire.CardQuestion {
var m messageRecord
if err := tx.Where("person = ? AND id = ?", person, c.AnswerMessage).First(&m).Error; err != nil {
return err
}
- links = append([]cardThreadRecord{{TurnID: m.TurnID}}, links...)
+ links = append([]cardThreadRecord{{TurnID: m.TurnID, MessageID: m.ID}}, links...)
}
for _, link := range links {
if link.TurnID != "" {
@@ -136,6 +141,12 @@ func (s *Store) CardPresentations(ctx context.Context, person string, ids []stri
return err
}
for _, m := range ms {
+ if m.Role == wire.RolePerson && m.ID != link.MessageID {
+ continue
+ }
+ if m.Role == wire.RolePerson {
+ p.OwnMessages = append(p.OwnMessages, m.ID)
+ }
p.Thread = append(p.Thread, CardThreadTurn{Own: m.Role == wire.RolePerson, Text: m.Text, At: m.CreatedAt})
}
var turn turnRecord
@@ -144,13 +155,16 @@ func (s *Store) CardPresentations(ctx context.Context, person string, ids []stri
}
p.Waiting = turn.State == wire.TurnQueued || turn.State == wire.TurnRunning || turn.State == wire.TurnWaiting
p.TurnID = turn.ID
+ p.ThreadState = turn.State
} else {
p.Thread = append(p.Thread, CardThreadTurn{Own: true, Text: link.Text, At: link.CreatedAt})
+ p.StepID = link.StepID
var step stepRecord
if err := tx.First(&step, "id = ?", link.StepID).Error; err != nil {
return err
}
p.Waiting = step.State == wire.StepQueued || step.State == wire.StepRunning
+ p.Activity = decodeActivity(step.Activity)
if step.Summary != "" {
p.Thread = append(p.Thread, CardThreadTurn{Text: step.Summary, At: step.UpdatedAt})
}
@@ -164,7 +178,12 @@ func (s *Store) CardPresentations(ctx context.Context, person string, ids []stri
}
// OpenStandaloneCards keeps questions without a task reachable in Needs you.
-func (s *Store) OpenStandaloneCards(ctx context.Context, person string) (out []wire.Card, err error) {
+type StandaloneCard struct {
+ wire.Card
+ Job string
+}
+
+func (s *Store) OpenStandaloneCards(ctx context.Context, person string) (out []StandaloneCard, err error) {
err = s.read(ctx, func(tx *gorm.DB) error {
if err := s.authority.CurrentPerson(ctx, tx); err != nil {
return err
@@ -179,7 +198,8 @@ func (s *Store) OpenStandaloneCards(ctx context.Context, person string) (out []w
if err != nil {
return err
}
- out = append(out, v)
+ job, _ := wire.JobOf(c.Lane)
+ out = append(out, StandaloneCard{Card: v, Job: job})
}
return nil
})
@@ -190,7 +210,7 @@ func (s *Store) OpenStandaloneCards(ctx context.Context, person string) (out []w
// The original decision remains answered; the new message owns its turn.
func (s *Store) ReplyCard(ctx context.Context, person, id, key, text string) error {
text, ok := cleanText(text, 2000)
- if !ok || key == "" || len(key) > 128 {
+ if !ok || !validKey(key) {
return ErrInvalid
}
return s.tx(ctx, func(t *txn) error {
@@ -206,12 +226,67 @@ func (s *Store) ReplyCard(ctx context.Context, person, id, key, text string) err
if c.Kind != wire.CardQuestion || c.State != wire.CardAnswered {
return ErrCardConflict
}
- _, _, err := t.send(c.Lane, person, "thread:"+c.ID+":"+key, text, nil, func(m messageRecord) error {
- if err := t.db.Create(&cardThreadRecord{ID: newID("ct_"), CardID: c.ID, Person: person, TurnID: m.TurnID, CreatedAt: t.now()}).Error; err != nil {
+ if _, job := wire.JobOf(c.Lane); job {
+ if err := t.jobRunner(person); err != nil {
+ return err
+ }
+ }
+ _, _, err := t.send(c.Lane, person, "card:reply:"+c.ID+":"+key, text, nil, func(m messageRecord) error {
+ if err := t.db.Create(&cardThreadRecord{ID: newID("ct_"), CardID: c.ID, Person: person, TurnID: m.TurnID, MessageID: m.ID, CreatedAt: t.now()}).Error; err != nil {
return err
}
- return s.authority.Audit(t.db, person, "card.reply", c.ID)
+ if err := s.authority.Audit(t.db, person, "card.reply", c.ID); err != nil {
+ return err
+ }
+ return t.followAnswer(c, m)
})
return err
})
}
+
+// StopConversationTurn stops a verified person's own or job Coordinator,
+// with its audit and cancellation command in the same transaction.
+func (s *Store) StopConversationTurn(ctx context.Context, person, id string) error {
+ return s.tx(ctx, func(t *txn) error {
+ if err := s.authority.CurrentPerson(ctx, t.db); err != nil {
+ return err
+ }
+ var turn turnRecord
+ if err := t.db.Where("id = ? AND person = ? AND "+coordinatorRole, id, person).First(&turn).Error; errors.Is(err, gorm.ErrRecordNotFound) {
+ return ErrNotFound
+ } else if err != nil {
+ return err
+ }
+ if wire.Terminal(turn.State) {
+ return ErrTerminal
+ }
+ if err := s.authority.Audit(t.db, person, "turn.cancel", id); err != nil {
+ return err
+ }
+ return t.cancelTurn(turn)
+ })
+}
+
+// ResolvedAsideCards keeps today's resolution of an older stub in place
+// even when the original question belongs to a collapsed earlier day.
+func (s *Store) ResolvedAsideCards(ctx context.Context, person, lane string, since time.Time) (out []wire.Card, err error) {
+ err = s.read(ctx, func(tx *gorm.DB) error {
+ if err := s.authority.CurrentPerson(ctx, tx); err != nil {
+ return err
+ }
+ var cs []cardRecord
+ if err := tx.Where("person = ? AND coalesce(lane, '') = ? AND updated_at >= ? AND state IN ? AND EXISTS (SELECT 1 FROM chat_card_visibility v WHERE v.card_id = chat_cards.id AND v.person = chat_cards.person AND v.aside = ?)", person, lane, since, []string{wire.CardAnswered, wire.CardResolved}, true).Order("created_at, id").Find(&cs).Error; err != nil {
+ return err
+ }
+ t := &txn{s: s, db: tx, ctx: ctx}
+ for _, c := range cs {
+ v, err := t.cardView(c)
+ if err != nil {
+ return err
+ }
+ out = append(out, v)
+ }
+ return nil
+ })
+ return
+}
diff --git a/internal/equipo/chat/roster_copy.go b/internal/equipo/chat/roster_copy.go
index 82bc8805..e9e18afa 100644
--- a/internal/equipo/chat/roster_copy.go
+++ b/internal/equipo/chat/roster_copy.go
@@ -8,6 +8,7 @@ import (
)
type CardCopyCoverage struct {
+ Skipped bool
Known bool
Total, Reviewed int
Since *time.Time
@@ -20,6 +21,7 @@ func cardCopyCoverage(tx *gorm.DB, task string) (v CardCopyCoverage, err error)
if err = tx.Where("task_id = ? AND specialist = ?", task, wire.SpecialistCopy).Order("idx DESC").Find(&steps).Error; err != nil || len(steps) == 0 {
return
}
+ v.Skipped = steps[0].Note == "copy-skip" && steps[0].State == wire.StepDone
v.Since = steps[0].HeldAt
if v.Since == nil && steps[0].Reason != "" {
v.Since = &steps[0].UpdatedAt
diff --git a/internal/equipo/chat/roster_test.go b/internal/equipo/chat/roster_test.go
index 9024015a..b2b872e9 100644
--- a/internal/equipo/chat/roster_test.go
+++ b/internal/equipo/chat/roster_test.go
@@ -13,7 +13,11 @@ func TestRosterSetAsideNeverAnswersOrCancels(t *testing.T) {
r := newMeteredRig(t)
ctx := context.Background()
now := r.s.now()
- c := cardRecord{ID: "c_roster", Person: hkOwner, Kind: wire.CardQuestion, State: wire.CardOpen, Question: "Which page?", Options: "[]", Revision: 1, CreatedAt: now, UpdatedAt: now}
+ task := taskRecord{ID: "tk_roster", Creator: hkOwner, Stage: wire.StageInProgress, Revision: 1, CreatedAt: now, UpdatedAt: now}
+ if err := r.s.db.G.Create(&task).Error; err != nil {
+ t.Fatal(err)
+ }
+ c := cardRecord{TaskID: task.ID, ID: "c_roster", Person: hkOwner, Kind: wire.CardQuestion, State: wire.CardOpen, Question: "Which page?", Options: "[]", Revision: 1, CreatedAt: now, UpdatedAt: now}
if err := r.s.db.G.Create(&c).Error; err != nil {
t.Fatal(err)
}
@@ -39,6 +43,13 @@ func TestRosterSetAsideNeverAnswersOrCancels(t *testing.T) {
if !reflect.DeepEqual(after, c) {
t.Fatalf("set aside answered or changed card: %+v", after)
}
+ var afterTask taskRecord
+ if err := r.s.db.G.First(&afterTask, "id = ?", task.ID).Error; err != nil {
+ t.Fatal(err)
+ }
+ if !reflect.DeepEqual(afterTask, task) {
+ t.Fatalf("set aside changed or cancelled task: %+v", afterTask)
+ }
for _, table := range []string{"runner_commands", "chat_messages", "chat_steps"} {
var n int64
if err := r.s.db.G.Table(table).Count(&n).Error; err != nil {
diff --git a/internal/equipo/chat/store.go b/internal/equipo/chat/store.go
index 5cdff7d2..9991b1d0 100644
--- a/internal/equipo/chat/store.go
+++ b/internal/equipo/chat/store.go
@@ -546,10 +546,11 @@ func (t *txn) send(lane, person, key, text string, files []string, before func(m
// card raised in a hand-off's turn, start a turn of their own, which
// nothing joins: its work is the hand-off's alone.
alone, err := t.handoffMessage(key)
+ alone = alone || strings.HasPrefix(key, "card:")
if err != nil {
return out, false, err
}
- err = t.db.Where("person = ? AND coalesce(lane, '') = ? AND dispatched = ? AND state = ? AND coalesce(kind, '') = '' AND NOT EXISTS (SELECT 1 FROM chat_handoff_turns WHERE turn_id = chat_turns.id)", person, lane, false, wire.TurnQueued).Order("created_at DESC, id DESC").First(&turn).Error
+ err = t.db.Where("person = ? AND coalesce(lane, '') = ? AND dispatched = ? AND state = ? AND coalesce(kind, '') = '' AND NOT EXISTS (SELECT 1 FROM chat_handoff_turns WHERE turn_id = chat_turns.id) AND NOT EXISTS (SELECT 1 FROM chat_messages WHERE turn_id = chat_turns.id AND idempotency_key LIKE 'card:%')", person, lane, false, wire.TurnQueued).Order("created_at DESC, id DESC").First(&turn).Error
fresh := errors.Is(err, gorm.ErrRecordNotFound) || err == nil && alone
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
return out, false, err
diff --git a/internal/equipo/chat_days.go b/internal/equipo/chat_days.go
index c9757270..348ec2ac 100644
--- a/internal/equipo/chat_days.go
+++ b/internal/equipo/chat_days.go
@@ -70,6 +70,7 @@ func (v chatView) Earlier(address string) chatFeed { return chatFeed{v.Open, add
// there are. A stacked row (decisions, what is still open) puts each
// item on its own line.
type dayRow struct {
+ Width int
Count int
Key, Label string
Items []dayItem
@@ -319,6 +320,13 @@ func (a *application) earlierDays(ctx context.Context, address string, loc *time
d.Rows = append(d.Rows, *r)
}
}
+ total := 0
+ for _, r := range d.Rows {
+ total += r.Count
+ }
+ for j := range d.Rows {
+ d.Rows[j].Width = max(1, (d.Rows[j].Count*100+total/2)/total)
+ }
d.Quiet = len(d.Rows) == 0
if !d.Expanded {
continue
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go
index 48d33d63..bd69fd4e 100644
--- a/internal/equipo/chat_page.go
+++ b/internal/equipo/chat_page.go
@@ -81,8 +81,14 @@ type chatLine struct {
// chatCard is one card under the message that ends its turn. Line is the
// card's sentence; the forms post to the page routes below.
type chatCard struct {
- ResearchReports []*researchView
- ReplyKey string
+ ThreadActivity string
+ ThreadError string
+ ResearchReports []*researchView
+ HoldReason string
+ BylineAt time.Time
+ SlimReport bool
+ ExplorationSummary string
+ ReplyKey string
wire.Card
Line, Change, Agent, Namespace, Note string
Presentation chat.CardPresentation
@@ -109,7 +115,7 @@ type notebookLine struct {
}
func cardView(c wire.Card, choices []string, tasks map[string]wire.Task) chatCard {
- v := chatCard{Card: c, Choices: choices}
+ v := chatCard{Card: c, Choices: choices, BylineAt: c.CreatedAt}
switch c.Kind {
case wire.CardProject:
v.Line = fmt.Sprintf(copyText("chat.card."+c.State), c.Name)
@@ -238,10 +244,31 @@ func cardView(c wire.Card, choices []string, tasks map[string]wire.Task) chatCar
line.MergeDropped = dropped
line.richOf(pt, t.Creator, nil, t.UpdatedAt)
line.Track = rosterTrack(pt)
+ v.BylineAt = t.UpdatedAt
+ v.SlimReport = t.NeedsYou == "" && (t.Stage == wire.StageReadyToMerge || t.Stage == wire.StageDone)
+ if t.Kind == wire.KindExplore {
+ for i := len(t.Steps) - 1; i >= 0; i-- {
+ if t.Steps[i].Specialist == wire.SpecialistEngineering {
+ v.ExplorationSummary = headline(t.Steps[i].Headline, t.Steps[i].Summary)
+ break
+ }
+ }
+ }
+ if t.CopyHold {
+ v.HoldReason = copyText("copy.round_budget")
+ }
+ if t.CopyCanSkip {
+ if s := lastStep(t); s != nil {
+ v.HoldReason = reasonLine(s.Reason, "work.reason.other")
+ }
+ }
v.Task, v.Line, v.Open = &line, t.Title, line.Retry || line.Cancel || line.Merge || line.Recover || t.CopyCanSkip || t.CopyHold
for _, step := range t.Steps {
if step.Specialist == wire.SpecialistResearch && step.Research != nil {
- v.ResearchReports = append(v.ResearchReports, researchOf(t.ID, *step.Research))
+ report := researchOf(t.ID, *step.Research)
+ report.StepID = step.ID
+ report.At = step.FinishedAt
+ v.ResearchReports = append(v.ResearchReports, report)
}
}
}
diff --git a/internal/equipo/chat_roster.go b/internal/equipo/chat_roster.go
index 58d3086a..0cf776c1 100644
--- a/internal/equipo/chat_roster.go
+++ b/internal/equipo/chat_roster.go
@@ -18,7 +18,7 @@ func (v *chatCard) rosterAuthor(tasks map[string]wire.Task) {
}
if t, ok := tasks[v.TaskID]; ok {
who := wire.SpecialistEngineering
- if v.Kind == wire.CardResearchSources {
+ if v.Kind == wire.CardResearchSources || v.Kind == wire.CardResearchInventory {
who = wire.SpecialistResearch
}
if t.CopyHold || t.CopyCanSkip {
@@ -35,6 +35,40 @@ func (v chatCard) Interactive() bool {
func (v chatCard) SetAside() bool { return v.Interactive() && v.Presentation.Aside }
func (a *application) presentRoster(ctx context.Context, address string, view *chatView) error {
+ lane := wire.LaneCoordinator
+ if view.Job != nil {
+ lane = wire.JobLane(view.Job.ID)
+ }
+ closed, err := a.store.Chat().ResolvedAsideCards(ctx, address, lane, chat.DayStart(a.store.Chat().Now(), a.store.Chat().Zone(address)))
+ if err != nil {
+ return err
+ }
+ shown := map[string]bool{}
+ noteShown := func(lines []chatLine) {
+ for _, line := range lines {
+ for _, cs := range [][]chatCard{line.Cards, line.Receipts} {
+ for _, c := range cs {
+ shown[c.ID] = true
+ }
+ }
+ }
+ }
+ noteShown(view.Messages)
+ noteShown(view.Open)
+ for _, day := range view.Days {
+ noteShown(day.Feed.Lines)
+ }
+ for _, c := range closed {
+ if !shown[c.ID] {
+ v := cardView(c, nil, nil)
+ v.Job, _ = wire.JobOf(lane)
+ if v.Note == "" && c.Kind != wire.CardQuestion {
+ v.Note = copyText("roster.finished")
+ }
+ view.Open = append(view.Open, chatLine{ID: c.ID, CardOnly: true, Cards: []chatCard{v}, CreatedAt: c.CreatedAt})
+ }
+ }
+ slices.SortStableFunc(view.Open, func(a, b chatLine) int { return a.CreatedAt.Compare(b.CreatedAt) })
var cards []*chatCard
collect := func(lines []chatLine) {
for i := range lines {
@@ -61,14 +95,32 @@ func (a *application) presentRoster(ctx context.Context, address string, view *c
for _, c := range cards {
c.Presentation = ps[c.ID]
c.ReplyKey = rand.Text()
+ if n := len(c.Presentation.Activity); n > 0 {
+ c.ThreadActivity = activityText(c.Presentation.Activity[n-1])
+ }
+ if c.Presentation.ThreadState == wire.TurnFailed {
+ c.ThreadError = copyText("chat.failed")
+ }
+ if c.Presentation.ThreadState == wire.TurnCancelled {
+ c.ThreadError = copyText("chat.cancelled")
+ }
}
turns := map[string]bool{}
+ own := map[string]bool{}
for _, p := range ps {
+ for _, id := range p.OwnMessages {
+ own[id] = true
+ }
for _, id := range p.Turns {
turns[id] = true
}
}
- view.Messages = slices.DeleteFunc(view.Messages, func(m chatLine) bool { return turns[m.TurnID] && len(m.Cards) == 0 && len(m.Receipts) == 0 })
+ view.Messages = slices.DeleteFunc(view.Messages, func(m chatLine) bool {
+ return (own[m.ID] || !m.Own && turns[m.TurnID]) && len(m.Cards) == 0 && len(m.Receipts) == 0
+ })
+ if view.Ended != nil && turns[view.Ended.ID] {
+ view.Ended = nil
+ }
view.Waiting = slices.DeleteFunc(view.Waiting, func(t wire.Turn) bool { return turns[t.ID] })
return nil
}
@@ -93,6 +145,22 @@ func (a *application) chatCardReply(w http.ResponseWriter, r *http.Request) {
}
func rosterTrack(t wire.Task) []trackStop {
+ if t.Kind == wire.KindExplore {
+ v := taskLine{}
+ v.trackOf(t)
+ out := slices.DeleteFunc(v.Track, func(s trackStop) bool { return s.Stage == wire.StageInvestigated })
+ for i := range out {
+ out[i].Live = false
+ out[i].At = nil
+ if out[i].State == "current" {
+ out[i].Tone = "positive"
+ if t.NeedsYou != "" {
+ out[i].Tone = "negative"
+ }
+ }
+ }
+ return out
+ }
stages := []string{wire.StageNoted, wire.StageInProgress, wire.StageInReview, wire.StageReadyToMerge, wire.StageDone}
current := slices.Index(stages, t.Stage)
if t.Stage == wire.StageMerging {
@@ -114,3 +182,22 @@ func rosterTrack(t wire.Task) []trackStop {
}
return out
}
+
+func (a *application) chatTurnStop(w http.ResponseWriter, r *http.Request) {
+ a.chatActionTo(w, r, workBack(r, ""), func(ctx context.Context, address string) error {
+ return a.store.Chat().StopConversationTurn(ctx, address, chi.URLParam(r, "id"))
+ })
+}
+
+func (v chatView) HasOpen() bool {
+ for _, line := range v.Open {
+ for _, cards := range [][]chatCard{line.Cards, line.Receipts} {
+ for _, c := range cards {
+ if c.Open {
+ return true
+ }
+ }
+ }
+ }
+ return false
+}
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index feccd23c..2389bcac 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -59,6 +59,9 @@ const BootLog = "Equipo could not start."
// COPY APPROVED BY DELEGATION (Luna pass, 2026-11-01, house rules).
var pageCopy = map[string]string{
+ "roster.copy_done": "Continuing without Copy.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)
+ "roster.stopping": "Stopping…", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)
+
"roster.copy_count": "%d of %d strings reviewed", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)
"roster.stop": "Stop", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)
"roster.finished": "Done", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)
diff --git a/internal/equipo/migrations/0086_conversation_roster.sql b/internal/equipo/migrations/0086_conversation_roster.sql
index fdf55845..ec250669 100644
--- a/internal/equipo/migrations/0086_conversation_roster.sql
+++ b/internal/equipo/migrations/0086_conversation_roster.sql
@@ -1,4 +1,4 @@
-- A person's stream visibility is independent of the decision.
CREATE TABLE chat_card_visibility (person text, card_id text, aside numeric, updated_at datetime, PRIMARY KEY (person, card_id));
-CREATE TABLE chat_card_threads (id text PRIMARY KEY, card_id text, person text, turn_id text, step_id text, text text, created_at datetime);
+CREATE TABLE chat_card_threads (id text PRIMARY KEY, card_id text, person text, message_id text, turn_id text, step_id text, text text, created_at datetime);
CREATE INDEX chat_card_thread_card ON chat_card_threads(card_id);
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql
index b79021f5..4fba469a 100644
--- a/internal/equipo/migrations/schema.sql
+++ b/internal/equipo/migrations/schema.sql
@@ -691,3 +691,9 @@ CREATE TRIGGER equipo_member_identity AFTER INSERT ON members WHEN NEW.identity_
END;
CREATE TABLE equipo_id_accounts (id INTEGER PRIMARY KEY AUTOINCREMENT, binding TEXT NOT NULL UNIQUE, member_key TEXT NOT NULL UNIQUE, linked_at INTEGER NOT NULL DEFAULT 0);
CREATE TABLE equipo_id_reauth (id_hash TEXT PRIMARY KEY, account_id INTEGER NOT NULL, session_hash TEXT NOT NULL, started INTEGER NOT NULL, expires INTEGER NOT NULL, purpose TEXT NOT NULL, ready INTEGER NOT NULL DEFAULT 0);
+
+CREATE TABLE chat_card_threads (id text PRIMARY KEY, card_id text, person text, message_id text, turn_id text, step_id text, text text, created_at datetime);
+
+CREATE TABLE chat_card_visibility (person text, card_id text, aside numeric, updated_at datetime, PRIMARY KEY (person, card_id));
+
+CREATE INDEX chat_card_thread_card ON chat_card_threads(card_id);
diff --git a/internal/equipo/research_views.go b/internal/equipo/research_views.go
index d5831d3b..f8dabb96 100644
--- a/internal/equipo/research_views.go
+++ b/internal/equipo/research_views.go
@@ -2,6 +2,7 @@ package equipo
import (
"fmt"
+ "time"
"amadan.net/oficina/equipo/internal/wire"
)
@@ -15,6 +16,8 @@ import (
// them: the summary, each fact with the pages it came from, what it could
// not find, the images it kept and its fetch log.
type researchView struct {
+ At *time.Time
+ StepID string
Summary string
Facts []researchFact
Gaps []string
@@ -62,6 +65,8 @@ func researchItem(t wire.Task, s wire.Step, v taskLine, title string) timelineIt
if s.Research != nil {
// What it fetched before it stopped: the fetch log alone.
it.Research = researchOf(t.ID, *s.Research)
+ it.Research.StepID = s.ID
+ it.Research.At = s.FinishedAt
}
case wire.StepCancelled:
// Cancelled with a reason of its own (Research left the team, the
@@ -72,6 +77,8 @@ func researchItem(t wire.Task, s wire.Step, v taskLine, title string) timelineIt
}
if s.Research != nil {
it.Research = researchOf(t.ID, *s.Research)
+ it.Research.StepID = s.ID
+ it.Research.At = s.FinishedAt
}
default:
it.Kind, it.What, it.Took, it.At = "step", title, took(s), s.FinishedAt
@@ -83,6 +90,8 @@ func researchItem(t wire.Task, s wire.Step, v taskLine, title string) timelineIt
break
}
it.Research = researchOf(t.ID, *s.Research)
+ it.Research.StepID = s.ID
+ it.Research.At = s.FinishedAt
}
return it
}
diff --git a/internal/equipo/static/chat-compose.js b/internal/equipo/static/chat-compose.js
index 97ff436a..35d73b06 100644
--- a/internal/equipo/static/chat-compose.js
+++ b/internal/equipo/static/chat-compose.js
@@ -48,6 +48,14 @@
form.toggleAttribute("data-has-content", /\S/.test(event.target.value));
});
document.addEventListener("toggle", function (event) {
- if(event.target.matches("[data-direction-thread]") && event.target.open) event.target.querySelector("textarea").focus({preventScroll:true});
+ if(event.target.matches("[data-direction-thread]") && event.target.open) {if(event.target.hasAttribute("data-restored")){delete event.target.dataset.restored;return;}event.target.querySelector("textarea").focus({preventScroll:true});}
},true);
})();
+(function () {
+ "use strict";
+ document.addEventListener("keydown", function(e) {
+ var form=e.target.closest("[equipo-mini-composer]");
+ if(!form || e.target.tagName!=="TEXTAREA" || e.key!=="Enter" || e.shiftKey || e.isComposing || e.keyCode===229)return;
+ e.preventDefault();var send=form.querySelector("[data-thread-send]");if(send && !send.disabled)form.requestSubmit(send);
+ });
+})();
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js
index d2bde991..1555232d 100644
--- a/internal/equipo/static/chat-stream.js
+++ b/internal/equipo/static/chat-stream.js
@@ -21,7 +21,9 @@
var id = el.dataset.turn || el.dataset.turnId;
if (thread && id) asked[id] = asked[id] || "";
});
+ root.setAttribute("data-roster-enhanced", "");
var feed = root.querySelector("[equipo-feed]");
+ root.querySelectorAll("[data-card-form]").forEach(function(f){f.dataset.busy="false";});
var offline = root.querySelector("[equipo-offline]");
var form = document.getElementById("composer");
var cursor = Number(root.dataset.cursor) || 0;
@@ -226,6 +228,11 @@
var cs = getComputedStyle(li).maxInlineSize;
var max = /%$/.test(cs) ? parseFloat(cs) / 100 * li.parentElement.clientWidth : parseFloat(cs) || li.parentElement.clientWidth;
var room = Math.floor(max - (line.offsetWidth - phrase.offsetWidth) - 8);
+ if (!thread) {
+ var elapsed=line.querySelector("[equipo-elapsed]"), sep=line.querySelector("[equipo-activity-sep]");
+ var gap=parseFloat(getComputedStyle(line).columnGap)||0;
+ room=Math.floor(line.clientWidth-(elapsed?elapsed.offsetWidth:0)-(sep?sep.offsetWidth:0)-gap*3-8);
+ }
phrase.querySelectorAll("[data-in]").forEach(function (old) {
old.removeAttribute("data-in");
old.setAttribute("data-out", "");
@@ -443,6 +450,7 @@
// now with the server's attributes, time and markdown. No reflow.
function settle(live, server) {
clearTimeout(live.holding);
+ var stop=live.querySelector("[equipo-turn-stop]");if(stop)stop.remove();
var line = live.querySelector("[equipo-activity-line]");
Array.from(live.attributes).forEach(function (a) { live.removeAttribute(a.name); });
Array.from(server.attributes).forEach(function (a) { live.setAttribute(a.name, a.value); });
@@ -611,6 +619,8 @@
var format = root.dataset.elapsed || "{n}s";
feed.querySelectorAll("[equipo-thinking]").forEach(function (el) {
enliven(el);
+ var stop = el.querySelector("[equipo-turn-stop]");
+ if (stop && el.dataset.turn && !el.hasAttribute("data-optimistic")) { stop.action="/conversation/turns/"+encodeURIComponent(el.dataset.turn)+"/stop"; stop.hidden=false; }
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))));
@@ -778,8 +788,11 @@
.then(function (body) {
var doc = new DOMParser().parseFromString(body, "text/html");
var next = doc.querySelector("[equipo-feed]");
+ if (next) next.querySelectorAll("[data-card-form]").forEach(function(f){f.dataset.busy="false";});
var page = doc.querySelector("[data-chat-stream]");
if (!next || !page) return;
+ var pill=root.querySelector("[equipo-needs-pill]"), nextPill=doc.querySelector("[equipo-needs-pill]");
+ if(pill && nextPill) pill.replaceWith(nextPill);
var build = newer(doc);
if (build) reloadWhenQuiet(build);
var at = Number(page.dataset.cursor) || 0;
@@ -790,6 +803,8 @@
// Keep live timers and activity lines across the re-render.
// A newly committed reply settles into its draft's element; a turn
// may already have earlier messages on the page.
+ var focused=document.activeElement, focusedCard=focused && focused.closest("[data-card]");
+ var cardFocus=focusedCard && /^(TEXTAREA|INPUT)$/.test(focused.tagName) ? {id:focusedCard.dataset.card,name:focused.name,start:focused.selectionStart,end:focused.selectionEnd} : null;
var keep = {}, shown = {}, opened = {};
feed.querySelectorAll("[equipo-thinking]:not([data-optimistic])").forEach(function (el) { keep[el.dataset.turn] = el; });
// A receipt the person opened with ⋯ stays open.
@@ -808,7 +823,7 @@
});
next.querySelectorAll("[data-card]").forEach(function (card) {
var old = cardBusy.get(card.dataset.card); if (old) { card.replaceWith(old); return; }
- var drawer=card.querySelector("[data-direction-thread]"); if(drawer && cardOpen.has(card.dataset.card)) drawer.open=true;
+ var drawer=card.querySelector("[data-direction-thread]"); if(drawer && cardOpen.has(card.dataset.card)) {drawer.dataset.restored="";drawer.open=true;}
var values = cardDrafts.get(card.dataset.card); if (!values) return;
card.querySelectorAll("textarea, input:not([type=hidden])").forEach(function (el) { if (values[el.name]) { el.value = values[el.name]; el.closest("form").setAttribute("data-has-content", ""); } });
});
@@ -847,12 +862,16 @@
}
return settle(old, el);
}).filter(Boolean));
+ if(cardFocus) {
+ var target=feed.querySelector('[data-card="'+CSS.escape(cardFocus.id)+'"] [name="'+CSS.escape(cardFocus.name)+'"]');
+ if(target) {target.focus({preventScroll:true});if(target.setSelectionRange)target.setSelectionRange(cardFocus.start,cardFocus.end);}
+ }
// A stale page lacks lines for turns that started since: they stay.
if (stale) Object.keys(keep).forEach(function (turn) { if (!ended[turn] && !queued[turn]) feed.append(keep[turn]); });
local.forEach(function (el) { place(el); });
pending.forEach(function (el) { feed.append(el); });
Object.keys(drafts).forEach(function (turn) {
- if (feed.querySelector('[equipo-thinking][data-turn="' + CSS.escape(turn) + '"]')) showDraft(turn);
+ if (feed.querySelector('[equipo-thinking][data-turn="' + CSS.escape(turn) + '"], [data-roster-turn="' + CSS.escape(turn) + '"] [equipo-thread-draft]')) showDraft(turn);
});
notes();
tick();
@@ -870,6 +889,7 @@
return;
}
var question = e.resource === "question";
+ if(type==="activity" && e.resource==="step" && v.step_id && feed.querySelector('[data-roster-step="'+CSS.escape(v.step_id)+'"]')) { refreshSoon(); return; }
if (thread) {
// The thread: its own questions' streams; everything else about
// the task is rendered by the server, like a committed reply.
@@ -1068,6 +1088,7 @@
fetch(f.action, { method: "POST", credentials: "same-origin", headers: { "Accept": "application/json" }, body: body })
.then(function (r) { if (!r.ok) throw new Error(r.status === 409 ? "stale" : "card");
if (id) { cardBusy.delete(id); if (body.get("aside") === null) { cardDrafts.delete(id); f.querySelectorAll("textarea").forEach(function (el) { el.value=""; }); } }
+ if (f.matches("[equipo-turn-stop]")) return;
return refreshed();
}).then(function () {
if (body.get("aside") === "true") {
@@ -1095,13 +1116,17 @@
retry.addEventListener("click", function () { if (e.message === "stale") refreshed(); else cardSubmit(f, button); }); error.append(retry);
});
}
+ root.addEventListener("click", function(event) {
+ var open=event.target.closest("[data-thread-open]"); if(!open || open.disabled)return;
+ var drawer=open.closest("[data-card]").querySelector("[data-direction-thread]"); drawer.open=true; drawer.querySelector("textarea").focus();
+ });
root.addEventListener("submit", function (event) {
var f = event.target.closest("[data-card-form]"); if (!f) return;
event.preventDefault();
// A toast uses the live stub's form, so it has the card's revision.
if (f.closest("[equipo-roster-toast]")) {
- var match = feed.querySelector('form[action="' + CSS.escape(f.getAttribute("action")) + '"]');
- if (match) cardSubmit(match, match.querySelector("button"));
+ var match = feed.querySelector('[equipo-aside-stub] form[action="' + CSS.escape(f.getAttribute("action")) + '"]');
+ if (match) cardSubmit(match, match.querySelector("button")); else f.closest("[equipo-roster-toast]").hidden=true;
} else cardSubmit(f, event.submitter);
});
// Sending stays on this page: no navigation, so no page transition. The
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index d5ada21b..893fde60 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -1786,8 +1786,9 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-roster-stage] { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); font-weight: 650; }
[equipo-roster-stage]:not([data-needs=""]) { color: var(--rst-tone-negative-fg); }
[equipo-roster-facts] { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; border-block-start: 1px solid var(--rst-line); padding-block-start: .625rem; }
-[equipo-roster-facts] > div { min-inline-size: 0; padding-inline: .875rem; border-inline-start: 1px solid var(--rst-line); }
-[equipo-roster-facts] > div:first-child { padding-inline-start: 0; border: 0; }
+[equipo-roster-facts] > div { min-inline-size: 0; padding-inline: .875rem; border-inline-end: 1px solid var(--rst-line); }
+[equipo-roster-facts] > div:first-child { padding-inline-start: 0; }
+[equipo-roster-facts] > div:last-child { border: 0; }
[equipo-roster-facts] dt { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); }
[equipo-roster-facts] dd { margin: 0; font-weight: 600; font-size: var(--rst-fs-sm); overflow-wrap: anywhere; }
[equipo-roster-facts] small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rst-text-muted); }
@@ -1850,7 +1851,7 @@ label[equipo-sp-label] { cursor: pointer; }
[data-question-thread] [data-first] [equipo-thread-bubble] { padding: 0; border: 0; background: transparent; font-size: 1.125rem; font-weight: 650; line-height: 1.3; max-inline-size: 100%; }
[equipo-card] [equipo-mini-composer] { display: block; inline-size: 100%; }
[equipo-mini-pill] { display: flex; gap: .5rem; align-items: end; border: 1px solid var(--rst-control-border); border-radius: calc(4 * var(--rst-radius)); padding: .375rem .5rem .375rem .875rem; background: var(--rst-surface); }
-[equipo-mini-pill]:focus-within { border-color: var(--rst-accent); box-shadow: var(--rst-focus-halo); }
+[equipo-mini-pill]:focus-within { border-color: var(--rst-accent); box-shadow: 0 0 0 3px var(--rst-focus-halo); }
[equipo-mini-pill] textarea { flex: 1; min-inline-size: 0; inline-size: 100%; min-block-size: 1.5rem; max-block-size: 8rem; field-sizing: content; border: 0; background: transparent; padding: .375rem 0; outline: none; box-shadow: none; resize: none; font: inherit; font-size: 1rem; color: var(--rst-text); caret-color: var(--rst-accent); }
[equipo-mini-pill] textarea::placeholder { color: var(--rst-text-muted); }
[equipo-mini-pill] button { display: grid; place-items: center; flex: none; inline-size: 2.25rem; block-size: 2.25rem; padding: .375rem; border: 0; border-radius: 50%; color: var(--rst-text-faint); background: var(--rst-surface-2); cursor: pointer; }
@@ -1897,5 +1898,44 @@ label[equipo-sp-label] { cursor: pointer; }
[equipo-roster-report] [equipo-track-full] li[data-tone="negative"] > span { color: var(--rst-tone-negative-fg); }
[equipo-roster-report] [equipo-track-full] li[data-tone="positive"] > span { color: var(--rst-tone-positive-fg); }
[equipo-roster-card] [rst-btn="primary"]:hover { background: var(--rst-accent-fill-hover); }
-[equipo-roster-card] [rst-btn="primary"]:active { background: var(--rst-accent-fill-press); transform: translateY(1px); }
+[equipo-roster-card] [rst-btn="primary"]:active { background: var(--rst-accent-fill-edge); transform: translateY(1px); }
[equipo-roster-card] button:active { transform: translateY(1px); }
+/* One quiet live line; the roster byline already carries the mark. */
+[equipo-conversation]:not([data-task]) [equipo-thinking] [equipo-sparkle] { display: none; }
+[equipo-conversation]:not([data-task]) [equipo-thinking] [equipo-bubble] { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .5rem; }
+[equipo-conversation]:not([data-task]) [equipo-thinking] [data-stream-text] { grid-column: 1 / -1; }
+[equipo-conversation]:not([data-task]) [equipo-thinking] [equipo-activity-line] { grid-column: 1; margin: 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
+[equipo-turn-stop] { grid-column: 2; margin: 0; }
+[equipo-turn-stop][hidden] { display: none; }
+[equipo-turn-stop] button { min-block-size: 2.75rem; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); }
+[equipo-conversation] [equipo-thinking] [equipo-coordinator-mark] { animation: roster-think 2.6s ease-in-out infinite; }
+@keyframes roster-think { 50% { transform: rotate(45deg) scale(.85); opacity: .5; } }
+@media (prefers-reduced-motion: reduce) { [equipo-conversation] [equipo-thinking] [equipo-coordinator-mark] { animation: none; } }
+[equipo-mini-pill] button[aria-busy="true"] { inline-size: auto; border-radius: calc(4 * var(--rst-radius)); font-size: var(--rst-fs-xs); padding-inline: .75rem; }
+[equipo-set-aside] button[aria-busy="true"] { inline-size: auto; padding-inline: .5rem; background: var(--rst-surface); font-size: var(--rst-fs-xs); }
+[equipo-roster-card] { color: var(--rst-text); }
+[equipo-copy-hold] > p, [data-research-report] > p { color: var(--rst-text-muted); }
+[equipo-copy-hold] > [equipo-roster-stage] { color: var(--rst-tone-warning-fg); }
+[equipo-roster-byline] { position: relative; }
+[equipo-roster-avatar] { inset-inline-start: -3rem; }
+[equipo-roster-card] + [equipo-roster-byline] { margin-block-start: 1.25rem; }
+@media (max-width:500px) {
+ [equipo-roster-avatar] { inset-inline-start: 0; }
+ [equipo-roster-card] [equipo-actions] > form:has([rst-btn="primary"]) { grid-column: 1 / -1; }
+ [equipo-roster-card] [equipo-actions] > form { display: contents; }
+ [equipo-roster-card] [equipo-actions] [rst-btn] { min-block-size: 2.75rem; min-inline-size: 0; white-space: normal; text-align: center; justify-content: center; padding-inline: .5rem; }
+}
+[equipo-roster-card][data-done] > :not([equipo-card-done]) { display: none; }
+[data-thread-open] { display: none; }
+[data-roster-enhanced] [data-thread-open] { display: inline-flex; }
+[data-roster-enhanced] [data-direction-thread] > summary { display: none; }
+[equipo-roster-report][data-slim] [equipo-roster-report-head] h3 { font-size: .9375rem; }
+[equipo-roster-report][data-slim] [equipo-roster-facts] { display: flex; flex-wrap: wrap; gap: .5rem 1rem; border: 0; padding: 0; }
+[equipo-roster-report][data-slim] [equipo-roster-facts] > div { padding: 0; border: 0; }
+[equipo-roster-report][data-slim] [equipo-roster-facts] dt { display: none; }
+[equipo-exploration-summary] { margin: 0; color: var(--rst-text-muted); }
+[equipo-roster-card] + [equipo-roster-card] { margin-block-start: .75rem; }
+[equipo-conversation]:not([data-task]) [equipo-thinking] [equipo-activity-line] { inline-size: 100%; min-inline-size: 0; }
+[equipo-roster-report] [equipo-roster-stage][equipo-stage] { margin: 0; padding: 0; border: 0; background: transparent; font-size: var(--rst-fs-xs); }
+[equipo-thread-error] { color: var(--rst-tone-negative-fg); font-size: var(--rst-fs-sm); }
+@media (max-width:500px) { [equipo-roster-card] [equipo-actions] [rst-btn]:not([rst-btn="primary"]) { font-size: var(--rst-fs-sm); } }
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html
index ee6aeed5..93ce8443 100644
--- a/internal/equipo/templates/chat.html
+++ b/internal/equipo/templates/chat.html
@@ -2,36 +2,36 @@
{{define "title"}}{{if .Chat.Job}}{{copy "jobs.title"}}{{else}}{{copy "conversation.title"}}{{end}}{{end}}
{{define "card-job"}}{{with .Job}}<input type="hidden" name="from" value="job"><input type="hidden" name="job" value="{{.}}">{{end}}{{end}}
{{define "chat-card"}}<li equipo-card="{{.Kind}}"{{if .Receipt}} equipo-receipt{{end}} id="card-{{.ID}}" data-card="{{.ID}}" data-state="{{.State}}" data-turn-id="{{.TurnID}}">
-{{template "roster-byline" .}}{{if .SetAside}}<section equipo-aside-stub><span>{{.Line}} <small>{{copy "roster.aside"}}</small></span>{{template "roster-undo" .}}</section>{{else}}<section equipo-roster-card{{if .Interactive}} data-ask{{end}}{{if .Receipt}} data-flat{{end}}{{if and (not .Open) .Note (not .Presentation.Thread)}} data-done{{end}}>
-{{if .Interactive}}<form method="post" action="/conversation/cards/{{.ID}}/visibility" data-card-form data-busy="false" equipo-set-aside><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="aside" value="true">{{template "card-job" .}}<button type="submit" data-set-aside aria-label="{{copy "roster.set_aside"}}" title="{{copy "roster.set_aside"}}" data-busy-label="{{copy "roster.setting_aside"}}">{{icon "x"}}</button></form>{{end}}
-{{if and (not .Open) .Note (ne .Kind "direction")}}<p equipo-card-done>{{icon "check"}}{{.Note}}</p>{{else if and .Task (or .Task.CopyHold .Task.CopyCanSkip)}}{{template "roster-copy-hold" .}}{{else if and .Receipt (eq .Kind "task")}}{{template "work-task-receipt" .}}
-{{else if eq .Kind "advice"}}{{if ne .State "resolved"}}<p equipo-card-line data-advice-card>{{icon "lightbulb"}}<span>{{.Line}}</span></p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="act" type="submit" data-advice-choice="act">{{.ActLabel}}</button><button rst-btn name="choice" value="dismiss" type="submit" data-advice-choice="dismiss">{{.DismissLabel}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}{{end}}
+{{template "roster-byline" .}}{{if .SetAside}}<section equipo-aside-stub><span>{{.Line}} <small>{{copy "roster.aside"}}</small></span>{{template "roster-undo" .}}</section>{{else}}<section equipo-roster-card{{if .Interactive}} data-ask{{end}}{{if .Receipt}} data-flat{{end}}{{if or (and (not .Open) .Note (not .Presentation.Thread)) .Presentation.Coverage.Skipped}} data-done{{end}}>
+{{if .Interactive}}<form method="post" action="/conversation/cards/{{.ID}}/visibility" data-card-form equipo-set-aside><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="aside" value="true">{{template "card-job" .}}<button type="submit" data-set-aside aria-label="{{copy "roster.set_aside"}}" title="{{copy "roster.set_aside"}}" data-busy-label="{{copy "roster.setting_aside"}}">{{icon "x"}}</button></form>{{end}}
+{{if .Presentation.Coverage.Skipped}}<p equipo-card-done role="status">{{icon "check"}}{{copy "roster.copy_done"}}</p>{{else if and (not .Open) .Note (ne .Kind "direction")}}<p equipo-card-done role="status">{{icon "check"}}{{.Note}}</p>{{else if and .Task (or .Task.CopyHold .Task.CopyCanSkip)}}{{template "roster-copy-hold" .}}{{else if and .Receipt (eq .Kind "task")}}{{template "work-task-receipt" .}}
+{{else if eq .Kind "advice"}}{{if ne .State "resolved"}}<p equipo-card-line data-advice-card>{{icon "lightbulb"}}<span>{{.Line}}</span></p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="act" type="submit" data-advice-choice="act">{{.ActLabel}}</button><button rst-btn name="choice" value="dismiss" type="submit" data-advice-choice="dismiss">{{.DismissLabel}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}{{end}}
{{else if eq .Kind "housekeeping"}}<p equipo-card-line data-digest>{{icon "list-checks"}}<span>{{.Line}} <a href="/housekeeping" data-digest-link>{{copy "chat.housekeeping.link"}}</a></span></p>
-{{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 data-busy="false"><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<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 data-busy="false"><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<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 data-busy="false"><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}}">{{template "card-job" .}}<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}}">{{template "card-job" .}}<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"}}<div equipo-subchat data-question-thread data-roster-turn="{{.Presentation.TurnID}}">
-<div equipo-thread-list><div equipo-thread-turn data-first><span equipo-thread-avatar>{{if eq .AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon .AuthorIcon}}{{end}}</span><div equipo-thread-bubble><div equipo-thread-who>{{.Author}}</div><div equipo-thread-text>{{.Line}}</div></div></div>{{template "roster-thread-turns" .}}</div>
-{{if .Open}}{{if .Options}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn name="choice" value="{{.}}" type="submit">{{.}}</button>{{end}}</form>{{else}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<div equipo-mini-pill><textarea name="choice" required maxlength="2000" rows="1" aria-label="{{copy "chat.card.answer"}}" placeholder="{{copy "chat.card.answer"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}{{else if not .Presentation.Waiting}}<form method="post" action="/conversation/cards/{{.ID}}/reply" data-card-form data-busy="false" equipo-mini-composer><input type="hidden" name="request_id" value="{{.ReplyKey}}">{{template "card-job" .}}<div equipo-mini-pill><textarea name="body" required maxlength="2000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}</div>
-{{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 data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="confirm" type="submit">{{copy "chat.card.confirm"}}</button></form>
-{{else if eq .Kind "direction"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}{{if ne . "again"}}<button rst-btn="{{if eq . "build"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-direction-choice="{{.}}"{{if eq . "build"}} data-busy-label="{{copy "roster.building"}}"{{end}}>{{copy (printf "chat.card.%s" .)}}</button>{{end}}{{end}}</form><details equipo-subchat data-direction-thread><summary equipo-thread-open>{{copy "chat.card.again"}}</summary><div equipo-thread-list><div equipo-thread-turn><span equipo-thread-avatar>{{icon .AuthorIcon}}</span><div equipo-thread-bubble><div equipo-thread-who>{{.Author}}</div><div equipo-thread-text>{{copy "roster.change"}}</div></div></div></div><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="again">{{template "card-job" .}}<div equipo-mini-pill><textarea name="note" required maxlength="1000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send data-direction-choice="again" aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form></details>{{else}}{{with .Note}}<p equipo-card-done>{{.}}</p>{{end}}{{if .Presentation.Thread}}<div equipo-subchat><div equipo-thread-list>{{template "roster-thread-turns" .}}</div></div>{{end}}{{end}}
-{{else if eq .Kind "specialist"}}<p equipo-card-line>{{.Line}}</p>{{with .Specialist}}{{range .Capabilities}}<p equipo-card-note data-capability="{{.ID}}">{{.Words}}</p>{{end}}<p equipo-card-note data-specialist-brief>{{printf (copy "chat.card.specialist_brief") .Brief}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if eq . "add"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-specialist-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
-{{else if eq .Kind "research_sources"}}<p equipo-card-line>{{.Line}}</p>{{with .Name}}<p equipo-card-note data-research-task>{{printf (copy "chat.card.research_for") .}}</p>{{end}}{{with .Research}}<p equipo-card-note data-research-question>{{printf (copy "chat.card.research_looks_for") .Question}}</p><ul equipo-card-list data-research-urls>{{range .URLs}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if eq . "allow"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-research-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
-{{else if eq .Kind "research_inventory"}}<p equipo-card-line>{{.Line}}</p>{{with .Inventory}}<ul equipo-card-list data-research-addresses>{{range .Addresses}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="confirm" type="submit" data-inventory-confirm>{{copy "chat.card.inventory_confirm"}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
-{{else if eq .Kind "publish"}}<p equipo-card-line>{{.Line}}</p>{{with .Site}}{{if .URL}}<p equipo-card-note><a href="{{.URL}}" rel="noopener" target="_blank" data-site-link>{{copy "chat.card.site_link"}}</a></p>{{end}}{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if eq . "publish"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-publish-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
-{{else if eq .Kind "merge"}}<p equipo-card-line>{{.Line}}</p>{{with .PreviewURL}}<p equipo-card-note><a href="{{.}}" rel="noopener" target="_blank" data-preview-link>{{copy "chat.card.preview_link"}}</a></p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{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}}
-{{else if or (eq .Kind "merge_ships") (eq .Kind "merge_policy") (eq .Kind "merge_receipt")}}{{if eq .Kind "merge_receipt"}}<div equipo-card-line equipo-markdown data-merge-receipt>{{chatMarkdown .Line}}</div>{{else}}<p equipo-card-line>{{.Line}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false" equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if or (eq . "save") (eq . "not_ships")}}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}}
-{{else if eq .Kind "access"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<details equipo-grant><summary rst-btn>{{copy "chat.card.grant"}}</summary><p>{{.GrantHow}}</p><code>amadan agent grant {{.Agent}} {{.Namespace}}</code><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form data-busy="false"><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn name="choice" value="check" type="submit" data-grant-check>{{copy "chat.card.grant_check"}}</button></form></details>{{end}}
-{{end}}<p equipo-card-error role="alert" hidden></p></section>{{end}}{{if not .SetAside}}{{range .ResearchReports}}<div equipo-roster-byline><b>{{copy "work.specialist.research"}}</b><span>{{copy "roster.reports"}}</span></div><section equipo-roster-card data-research-report><h3>{{copy "roster.research"}}</h3><p>{{.Summary}}</p><ol equipo-roster-findings>{{range .Facts}}<li><div><strong>{{.Label}}</strong> {{.Value}}</div>{{range .Sources}}{{if .URL}}<a href="{{.URL}}" target="_blank" rel="noopener">{{.URL}}</a>{{else}}<span>{{.ID}}</span>{{end}}{{end}}</li>{{end}}{{range .Gaps}}<li data-gap>{{.}}</li>{{end}}</ol><a href="/tasks/{{$.TaskID}}#research">{{copy "roster.research_log"}} ({{len .Fetches}})</a></section>{{end}}{{end}}
+<div equipo-thread-list role="log" aria-live="polite"><div equipo-thread-turn data-first><span equipo-thread-avatar>{{if eq .AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon .AuthorIcon}}{{end}}</span><div equipo-thread-bubble><div equipo-thread-who>{{.Author}}</div><div equipo-thread-text>{{.Line}}</div></div></div>{{template "roster-thread-turns" .}}</div>
+{{if .Open}}{{if .Options}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn name="choice" value="{{.}}" type="submit">{{.}}</button>{{end}}</form>{{else}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<div equipo-mini-pill><textarea name="choice" required maxlength="2000" rows="1" aria-label="{{copy "chat.card.answer"}}" placeholder="{{copy "chat.card.answer"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}{{else if not .Presentation.Waiting}}<form method="post" action="/conversation/cards/{{.ID}}/reply" data-card-form equipo-mini-composer><input type="hidden" name="request_id" value="{{.ReplyKey}}">{{template "card-job" .}}<div equipo-mini-pill><textarea name="body" required maxlength="2000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}</div>
+{{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}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="confirm" type="submit">{{copy "chat.card.confirm"}}</button></form>
+{{else if eq .Kind "direction"}}<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}}">{{template "card-job" .}}{{range .Options}}{{if eq . "again"}}<button type="button" rst-btn data-thread-open>{{copy "chat.card.again"}}</button>{{else}}<button rst-btn="{{if eq . "build"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-direction-choice="{{.}}"{{if eq . "build"}} data-busy-label="{{copy "roster.building"}}"{{end}}>{{copy (printf "chat.card.%s" .)}}</button>{{end}}{{end}}</form><details equipo-subchat data-direction-thread><summary equipo-thread-open>{{copy "chat.card.again"}}</summary><div equipo-thread-list role="log" aria-live="polite"><div equipo-thread-turn><span equipo-thread-avatar>{{icon .AuthorIcon}}</span><div equipo-thread-bubble><div equipo-thread-who>{{.Author}}</div><div equipo-thread-text>{{copy "roster.change"}}</div></div></div></div><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="again">{{template "card-job" .}}<div equipo-mini-pill><textarea name="note" required maxlength="1000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send data-direction-choice="again" aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form></details>{{else}}{{with .Note}}<p equipo-card-done role="status">{{.}}</p>{{end}}{{if .Presentation.Thread}}<div equipo-subchat data-roster-step="{{.Presentation.StepID}}"><div equipo-thread-list role="log" aria-live="polite">{{template "roster-thread-turns" .}}</div></div>{{end}}{{end}}
+{{else if eq .Kind "specialist"}}<p equipo-card-line>{{.Line}}</p>{{with .Specialist}}{{range .Capabilities}}<p equipo-card-note data-capability="{{.ID}}">{{.Words}}</p>{{end}}<p equipo-card-note data-specialist-brief>{{printf (copy "chat.card.specialist_brief") .Brief}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if eq . "add"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-specialist-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
+{{else if eq .Kind "research_sources"}}<p equipo-card-line>{{.Line}}</p>{{with .Name}}<p equipo-card-note data-research-task>{{printf (copy "chat.card.research_for") .}}</p>{{end}}{{with .Research}}<p equipo-card-note data-research-question>{{printf (copy "chat.card.research_looks_for") .Question}}</p><ul equipo-card-list data-research-urls>{{range .URLs}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if eq . "allow"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-research-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
+{{else if eq .Kind "research_inventory"}}<p equipo-card-line>{{.Line}}</p>{{with .Inventory}}<ul equipo-card-list data-research-addresses>{{range .Addresses}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="confirm" type="submit" data-inventory-confirm>{{copy "chat.card.inventory_confirm"}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
+{{else if eq .Kind "publish"}}<p equipo-card-line>{{.Line}}</p>{{with .Site}}{{if .URL}}<p equipo-card-note><a href="{{.URL}}" rel="noopener" target="_blank" data-site-link>{{copy "chat.card.site_link"}}</a></p>{{end}}{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if eq . "publish"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-publish-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
+{{else if eq .Kind "merge"}}<p equipo-card-line>{{.Line}}</p>{{with .PreviewURL}}<p equipo-card-note><a href="{{.}}" rel="noopener" target="_blank" data-preview-link>{{copy "chat.card.preview_link"}}</a></p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{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}}
+{{else if or (eq .Kind "merge_ships") (eq .Kind "merge_policy") (eq .Kind "merge_receipt")}}{{if eq .Kind "merge_receipt"}}<div equipo-card-line equipo-markdown data-merge-receipt>{{chatMarkdown .Line}}</div>{{else}}<p equipo-card-line>{{.Line}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="{{if or (eq . "save") (eq . "not_ships")}}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}}
+{{else if eq .Kind "access"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<details equipo-grant><summary rst-btn>{{copy "chat.card.grant"}}</summary><p>{{.GrantHow}}</p><code>amadan agent grant {{.Agent}} {{.Namespace}}</code><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn name="choice" value="check" type="submit" data-grant-check>{{copy "chat.card.grant_check"}}</button></form></details>{{end}}
+{{end}}<p equipo-card-error role="alert" hidden></p></section>{{end}}{{if .Presentation.Coverage.Skipped}}<section equipo-roster-card data-flat>{{template "work-task-receipt" .}}</section>{{end}}{{if not .SetAside}}{{range .ResearchReports}}<div equipo-roster-byline><span equipo-roster-avatar>{{icon "search"}}</span><b>{{copy "work.specialist.research"}}</b><span>{{copy "roster.reports"}}</span>{{with .At}}<time datetime="{{.Format "2006-01-02T15:04:05Z07:00"}}">{{.Format "15:04"}}</time>{{end}}</div><section equipo-roster-card data-research-report><h3>{{copy "roster.research"}}</h3><p>{{.Summary}}</p><ol equipo-roster-findings>{{range .Facts}}<li><div><strong>{{.Label}}</strong> {{.Value}}</div>{{range .Sources}}{{if .URL}}<a href="{{.URL}}" target="_blank" rel="noopener">{{.URL}}</a>{{else}}<span>{{.ID}}</span>{{end}}{{end}}</li>{{end}}{{range .Gaps}}<li data-gap>{{.}}</li>{{end}}</ol><a href="/tasks/{{$.TaskID}}#research-{{.StepID}}">{{copy "roster.research_log"}} ({{len .Fetches}})</a></section>{{end}}{{end}}
</li>{{end}}
-{{define "roster-copy-hold"}}<div equipo-copy-hold><span equipo-roster-stage>{{copy "roster.copy_waiting"}}</span><h3>{{.Line}}</h3><p>{{.Task.StageLine}}</p>{{with .Presentation.Coverage}}<div equipo-copy-meter>{{if .Known}}{{if .Total}}<meter min="0" max="{{.Total}}" value="{{.Reviewed}}" aria-label="{{printf (copy "roster.copy_count") .Reviewed .Total}}"></meter>{{end}}<span>{{printf (copy "roster.copy_count") .Reviewed .Total}}</span>{{else}}<span>{{copy "roster.copy_coverage"}}</span>{{end}}{{with .Since}}<small>{{printf (copy "roster.copy_since") (.Format "15:04")}}</small>{{end}}</div>{{end}}<div equipo-actions>{{if .Task.CopyCanSkip}}<form method="post" action="/conversation/tasks/{{.TaskID}}/continue-without-copy" data-card-form data-busy="false"><button rst-btn="primary" type="submit" data-copy-continue>{{copy "copy.continue"}}</button></form>{{end}}<a rst-btn href="/conversation?about={{.TaskID}}">{{copy "work.decide.ask_coordinator"}}</a><a equipo-link href="/tasks/{{.TaskID}}">{{copy "roster.open_task"}}</a></div></div>{{end}}
-{{define "roster-thread-turns"}}{{range .Presentation.Thread}}<div equipo-thread-turn{{if .Own}} data-own{{end}}>{{if not .Own}}<span equipo-thread-avatar{{if eq $.AuthorIcon "sparkles"}} equipo-coordinator-mark{{end}}>{{if eq $.AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon $.AuthorIcon}}{{end}}</span>{{end}}<div equipo-thread-bubble><div equipo-thread-who>{{if .Own}}{{copy "work.summary.you"}}{{else}}{{$.Author}}{{end}} <time datetime="{{.At.Format "2006-01-02T15:04:05Z07:00"}}">{{.At.Format "15:04"}}</time></div><div equipo-thread-text equipo-markdown>{{chatMarkdown .Text}}</div></div>{{if .Own}}<small equipo-thread-sent>{{copy "roster.sent"}}</small>{{end}}</div>{{end}}{{if .Presentation.Waiting}}<div equipo-thread-wait role="status"><span equipo-reading-dots aria-hidden="true"><i></i><i></i><i></i></span><span>{{printf (copy "roster.waiting") .Author}}</span><div equipo-thread-draft></div></div>{{end}}{{end}}
-{{define "roster-undo"}}<form method="post" action="/conversation/cards/{{.ID}}/visibility" data-card-form data-busy="false"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="aside" value="false">{{template "card-job" .}}<button equipo-link type="submit" data-aside-undo data-busy-label="{{copy "roster.restoring"}}">{{copy "roster.undo"}}</button></form>{{end}}
-{{define "roster-byline"}}<div equipo-roster-byline><span equipo-roster-avatar{{if eq .AuthorIcon "sparkles"}} equipo-coordinator-mark{{end}}>{{if eq .AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon .AuthorIcon}}{{end}}</span><b>{{.Author}}</b><span>{{.Verb}}</span><time datetime="{{.CreatedAt.Format "2006-01-02T15:04:05Z07:00"}}">{{.CreatedAt.Format "15:04"}}</time></div>{{end}}
+{{define "roster-copy-hold"}}<div equipo-copy-hold><span equipo-roster-stage>{{copy "roster.copy_waiting"}}</span><h3>{{.Line}}</h3><p>{{.HoldReason}}</p>{{with .Presentation.Coverage}}<div equipo-copy-meter>{{if .Known}}{{if .Total}}<meter min="0" max="{{.Total}}" value="{{.Reviewed}}" aria-label="{{printf (copy "roster.copy_count") .Reviewed .Total}}"></meter>{{end}}<span>{{printf (copy "roster.copy_count") .Reviewed .Total}}</span>{{else}}<span>{{copy "roster.copy_coverage"}}</span>{{end}}{{with .Since}}<small>{{printf (copy "roster.copy_since") (.Format "15:04")}}</small>{{end}}</div>{{end}}<div equipo-actions>{{if .Task.CopyCanSkip}}<form method="post" action="/conversation/tasks/{{.TaskID}}/continue-without-copy" data-card-form><button rst-btn="primary" type="submit" data-copy-continue>{{copy "copy.continue"}}</button></form>{{end}}<a rst-btn href="/conversation?about={{.TaskID}}">{{copy "work.decide.ask_coordinator"}}</a><a equipo-link href="/tasks/{{.TaskID}}">{{copy "roster.open_task"}}</a></div></div>{{end}}
+{{define "roster-thread-turns"}}{{range .Presentation.Thread}}<div equipo-thread-turn{{if .Own}} data-own{{end}}>{{if not .Own}}<span equipo-thread-avatar{{if eq $.AuthorIcon "sparkles"}} equipo-coordinator-mark{{end}}>{{if eq $.AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon $.AuthorIcon}}{{end}}</span>{{end}}<div equipo-thread-bubble><div equipo-thread-who>{{if .Own}}{{copy "work.summary.you"}}{{else}}{{$.Author}}{{end}} <time datetime="{{.At.Format "2006-01-02T15:04:05Z07:00"}}">{{.At.Format "15:04"}}</time></div><div equipo-thread-text equipo-markdown>{{chatMarkdown .Text}}</div></div>{{if .Own}}<small equipo-thread-sent>{{copy "roster.sent"}}</small>{{end}}</div>{{end}}{{with .ThreadError}}<p equipo-thread-error role="alert">{{.}}</p>{{end}}{{if .Presentation.Waiting}}<div equipo-thread-wait role="status"><span equipo-reading-dots aria-hidden="true"><i></i><i></i><i></i></span><span>{{if .ThreadActivity}}{{.ThreadActivity}}{{else}}{{printf (copy "roster.waiting") .Author}}{{end}}</span><div equipo-thread-draft></div></div>{{end}}{{end}}
+{{define "roster-undo"}}<form method="post" action="/conversation/cards/{{.ID}}/visibility" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="aside" value="false">{{template "card-job" .}}<button equipo-link type="submit" data-aside-undo data-busy-label="{{copy "roster.restoring"}}">{{copy "roster.undo"}}</button></form>{{end}}
+{{define "roster-byline"}}<div equipo-roster-byline><span equipo-roster-avatar{{if eq .AuthorIcon "sparkles"}} equipo-coordinator-mark{{end}}>{{if eq .AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon .AuthorIcon}}{{end}}</span><b>{{.Author}}</b><span>{{.Verb}}</span><time datetime="{{.BylineAt.Format "2006-01-02T15:04:05Z07:00"}}">{{.BylineAt.Format "15:04"}}</time></div>{{end}}
{{define "roster-mark"}}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3c1.1 5.8 3.2 7.9 9 9-5.8 1.1-7.9 3.2-9 9-1.1-5.8-3.2-7.9-9-9 5.8-1.1 7.9-3.2 9-9Z"/></svg>{{end}}
-{{define "work-task-receipt"}}{{with .Task}}<div equipo-roster-report>
-<div equipo-roster-report-head><div><span equipo-roster-stage data-needs="{{.NeedsYou}}">{{.StageLine}}</span><h3><a href="/tasks/{{.ID}}">{{.Title}}</a></h3></div>{{if .NeedsYou}}<span rst-badge="warning">{{copy "nav.needs-you"}}</span>{{end}}</div>
-{{if ne .Stage "cancelled"}}{{template "track-full" .}}{{end}}
+{{define "work-task-receipt"}}{{$card := .}}{{with .Task}}<div equipo-roster-report{{if $card.SlimReport}} data-slim{{end}}>
+<div equipo-roster-report-head><div><span equipo-roster-stage equipo-stage data-stage="{{.Stage}}" data-needs="{{.NeedsYou}}">{{.StageLine}}</span><h3 equipo-card-line><a href="/tasks/{{.ID}}">{{.Title}}</a></h3></div>{{if .NeedsYou}}<span rst-badge="warning">{{copy "nav.needs-you"}}</span>{{end}}</div>
+{{if and (ne .Stage "cancelled") (not $card.SlimReport)}}{{template "track-full" .}}{{end}}{{with $card.ExplorationSummary}}<p equipo-exploration-summary>{{.}}</p>{{end}}
<dl equipo-roster-facts>{{if .ChecksLine}}<div><dt>{{copy "roster.checks"}}</dt><dd data-checks>{{.ChecksLine}}</dd></div>{{end}}{{if .ReviewLine}}<div><dt>{{copy "roster.review"}}</dt><dd data-verdict>{{.ReviewLine}}</dd></div>{{end}}{{if .Branch}}<div><dt>{{copy "roster.branch"}}</dt><dd><code>{{.Branch}}</code></dd><small>{{.CandidateSHA}}</small></div>{{end}}</dl>
-<div equipo-roster-links><a href="/tasks/{{.ID}}">{{copy "roster.open_task"}}</a>{{if and .Pushed (not .MergedLine)}}<span data-pushed>{{.Pushed}}</span><a href="{{.URL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{if .MergedLine}}<span data-merged>{{.MergedLine}}</span><a href="{{.RepoURL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{if .PreviewURL}}<a href="{{.PreviewURL}}" rel="noopener" target="_blank" data-preview>{{copy "chat.card.preview_link"}}</a>{{end}}</div>
+{{if .MergeDropped}}<p equipo-card-note>{{copy "work.tl.merge_dropped"}}</p>{{end}}<div equipo-roster-links><a href="/tasks/{{.ID}}">{{copy "roster.open_task"}}</a>{{if and .Pushed (not .MergedLine)}}<span data-pushed><span>{{.Pushed}}</span></span><a href="{{.URL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{if .MergedLine}}<span data-merged><span>{{.MergedLine}}</span> <a href="{{.RepoURL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a></span>{{end}}{{if .PreviewURL}}<a href="{{.PreviewURL}}" rel="noopener" target="_blank" data-preview>{{copy "chat.card.preview_link"}}</a>{{end}}</div>
</div>{{end}}{{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}}">{{template "work-task-actions" .Task}}</span>{{end}}{{end}}
{{define "message-files"}}{{with .}}<div equipo-message-files>{{range .}}{{if eq .Kind "image"}}<a equipo-file-thumb href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}"><img src="/conversation/attachments/{{.ID}}/preview" alt="{{.Name}}"{{if .Width}} width="{{.Width}}" height="{{.Height}}"{{end}} loading="lazy" decoding="async"></a>{{else}}<a equipo-file-chip href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}">{{icon "file-text"}}<span equipo-file-name>{{.Name}}</span><span equipo-file-size>{{fileSize .Size}}</span></a>{{end}}{{end}}</div>{{end}}{{end}}
{{define "chat-lines"}}{{$address := .Address}}{{range .Lines}}
@@ -48,7 +48,7 @@
{{define "chat-day"}}<li equipo-rollup id="day-{{.Key}}" data-day="{{.Key}}"{{if .Expanded}} data-expanded{{end}}>
<section equipo-day-box aria-labelledby="day-title-{{.Key}}">
<header equipo-day-head><h2 id="day-title-{{.Key}}"><time datetime="{{.Key}}">{{.Label}}</time></h2><span equipo-day-count>{{.Messages}}</span></header>
-{{if not .Quiet}}<div equipo-daybar aria-hidden="true">{{range .Rows}}<i data-kind="{{.Key}}" style="flex-grow:{{.Count}}"></i>{{end}}</div><div equipo-day-legend>{{range .Rows}}<span data-kind="{{.Key}}"><b>{{.Count}}</b> {{.Label}}</span>{{end}}</div>{{end}}
+{{if not .Quiet}}<div equipo-daybar aria-hidden="true">{{range .Rows}}<i data-kind="{{.Key}}" data-w="{{.Width}}"></i>{{end}}</div><div equipo-day-legend>{{range .Rows}}<span data-kind="{{.Key}}"><b>{{.Count}}</b> {{.Label}}</span>{{end}}</div>{{end}}
{{if .Quiet}}<p equipo-day-quiet>{{copy "chat.day.quiet"}}</p>{{else}}<dl equipo-day-rows>{{range .Rows}}{{template "day-row" .}}{{end}}</dl>{{end}}
<a equipo-day-toggle href="{{.Toggle}}" data-day-toggle="{{.Key}}" aria-expanded="{{if .Expanded}}true{{else}}false{{end}}" aria-controls="day-feed-{{.Key}}"><span>{{if .Expanded}}{{copy "chat.day.hide"}}{{else}}{{copy "chat.day.show"}}{{end}}</span>{{icon "chevron-down"}}</a>
</section>
@@ -65,16 +65,16 @@
<template equipo-own-template><li equipo-message="own" data-message=""><div equipo-message-meta><strong equipo-visually-hidden>{{.Address}}</strong><time></time></div><div equipo-message-files hidden></div><div equipo-bubble><p equipo-message-body></p></div></li></template>
<template equipo-file-template><a equipo-file-chip href="" target="_blank" rel="noopener" data-attachment="">{{icon "file-text"}}<span equipo-file-name></span><span equipo-file-size></span></a></template>
<template equipo-chip-template><li equipo-chip data-state="uploading"><span equipo-chip-thumb>{{icon "file-text"}}</span><span equipo-chip-text><span equipo-chip-name></span><span equipo-chip-note></span></span><span equipo-chip-progress role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i></i></span><button type="button" equipo-chip-remove>{{icon "x"}}</button></li></template>
-<template equipo-thinking-template><li equipo-message="incoming" equipo-thinking data-turn="" data-started="" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span>{{copy "conversation.coordinator"}}</strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{copy "chat.activity.thinking"}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p></div></li></template>
+<template equipo-thinking-template><li equipo-message="incoming" equipo-thinking data-turn="" data-started="" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span>{{copy "conversation.coordinator"}}</strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{copy "chat.activity.thinking"}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p><form method="post" data-card-form equipo-turn-stop hidden><button equipo-link type="submit" data-turn-stop data-busy-label="{{copy "roster.stopping"}}">{{copy "roster.stop"}}</button></form></div></li></template>
<template equipo-ended-template><li equipo-system-note data-ended=""><p></p></li></template>
<ol equipo-feed>
{{range .Chat.Days}}{{template "chat-day" .}}{{end}}
{{if .Chat.Days}}<li equipo-day-divider data-today><span>{{copy "chat.day.today"}}</span></li>{{end}}
-{{with .Chat.Open}}<li equipo-day-note data-still-open>{{copy "chat.day.still_open"}}</li>{{end}}
+{{if .Chat.HasOpen}}<li equipo-day-note data-still-open>{{copy "chat.day.still_open"}}</li>{{end}}
{{template "chat-lines" (.Chat.Earlier .Address)}}
{{template "chat-lines" (.Chat.Today .Address)}}
{{if not (or .Chat.Days .Chat.Open .Chat.Messages)}}<li data-empty-state="conversation.empty">{{copy "conversation.empty"}}</li>{{end}}
-{{range .Chat.Waiting}}<li equipo-message="incoming" equipo-thinking data-turn="{{.ID}}"{{with .Kind}} data-kind="{{.}}"{{end}} data-started="{{.CreatedAt.UnixMilli}}" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span>{{copy "conversation.coordinator"}}</strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{if eq .Kind "move_in"}}{{copy "chat.moving_in"}}{{else if eq .Kind "explore"}}{{copy "chat.exploring"}}{{else}}{{copy "chat.activity.thinking"}}{{end}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p></div></li>{{end}}
+{{range .Chat.Waiting}}<li equipo-message="incoming" equipo-thinking data-turn="{{.ID}}"{{with .Kind}} data-kind="{{.}}"{{end}} data-started="{{.CreatedAt.UnixMilli}}" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span>{{copy "conversation.coordinator"}}</strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{if eq .Kind "move_in"}}{{copy "chat.moving_in"}}{{else if eq .Kind "explore"}}{{copy "chat.exploring"}}{{else}}{{copy "chat.activity.thinking"}}{{end}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p><form method="post" action="/conversation/turns/{{.ID}}/stop" data-card-form equipo-turn-stop>{{with $.Chat.Job}}<input type="hidden" name="from" value="job"><input type="hidden" name="job" value="{{.ID}}">{{end}}<button equipo-link type="submit" data-turn-stop data-busy-label="{{copy "roster.stopping"}}">{{copy "roster.stop"}}</button></form></div></li>{{end}}
{{with .Chat.NoConnection}}<li equipo-card="no_connection" data-no-connection="{{.TurnID}}"><p equipo-card-line>{{.Line}}</p><p equipo-actions><a rst-btn="primary" href="/conversation/settings/connections/add" data-add-connection>{{copy "chat.no_connection.add"}}</a></p></li>{{end}}
{{with .Chat.Ended}}<li equipo-system-note data-ended="{{.ID}}"><p>{{copy .Key}}</p></li>{{end}}
</ol>
diff --git a/internal/equipo/templates/work_needs.html b/internal/equipo/templates/work_needs.html
index b115a6c2..968ec0ed 100644
--- a/internal/equipo/templates/work_needs.html
+++ b/internal/equipo/templates/work_needs.html
@@ -1,8 +1,8 @@
{{define "title"}}{{copy "nav.needs-you"}}{{end}}
{{define "content"}}
<section equipo-work equipo-inner data-work-live data-work-region id="work-needs">
-{{with .Thin}}<div equipo-page-head><h1>{{copy "nav.needs-you"}}</h1><p>{{if eq (len .Decisions) 0}}{{copy "work.needs_empty"}}{{else if eq (len .Decisions) 1}}{{copy "work.needs.one"}}{{else}}{{printf (copy "work.needs.many") (len .Decisions)}}{{end}}</p></div>
-{{range .Questions}}<article equipo-decision><h2>{{.Line}}</h2><a equipo-btn href="/conversation?card={{.ID}}#card-{{.ID}}">{{copy "conversation.title"}}</a></article>{{end}}
+{{with .Thin}}<div equipo-page-head><h1>{{copy "nav.needs-you"}}</h1><p>{{if eq .DecisionCount 0}}{{copy "work.needs_empty"}}{{else if eq .DecisionCount 1}}{{copy "work.needs.one"}}{{else}}{{printf (copy "work.needs.many") .DecisionCount}}{{end}}</p></div>
+{{range .Questions}}<article equipo-decision><h2>{{.Line}}</h2><a equipo-btn href="{{if .Job}}/jobs/{{.Job}}{{else}}/conversation{{end}}?card={{.ID}}#card-{{.ID}}">{{copy "conversation.title"}}</a></article>{{end}}
{{range .Decisions}}{{template "decision" (dict "Task" . "Head" true "From" "needs")}}{{end}}
{{with .Groups}}{{template "work-groups" (dict "Groups" . "From" "needs")}}{{end}}{{end}}
</section>
diff --git a/internal/equipo/templates/work_parts.html b/internal/equipo/templates/work_parts.html
index f949f4fc..f9111329 100644
--- a/internal/equipo/templates/work_parts.html
+++ b/internal/equipo/templates/work_parts.html
@@ -37,7 +37,7 @@
{{if $.Head}}{{template "mono" $t.Mono}}<div equipo-d-title><a href="/tasks/{{$t.ID}}">{{$t.Title}}</a><span equipo-quiet>{{$t.Project}} · {{template "source" $t}}</span></div>{{end}}
<p equipo-d-why>{{.Why}}</p>
<p equipo-d-ask>{{.Ask}}</p>{{if .Link}}<p equipo-quiet data-direction-line>{{with .LinkText}}{{.}} {{end}}<a equipo-link href="{{.Link}}" rel="noopener noreferrer" target="_blank" data-direction-link>{{.LinkLabel}}</a>{{with .AltLink}} <a equipo-link href="{{.}}" rel="noopener noreferrer" target="_blank" data-direction-branch>{{$t.Decision.AltLabel}}</a>{{end}}</p>{{end}}{{with .Said}}<p equipo-quiet data-triage-said>{{.}}</p>{{end}}{{with .Failed}}<p equipo-quiet data-triage-failed>{{.}}</p>{{end}}{{with .Recommend}}<p equipo-quiet data-triage-recommend>{{.}}</p>{{end}}
-<div equipo-d-actions>{{with .Card}}<form method="post" action="/conversation/cards/{{.ID}}/answer"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="task" value="{{$t.ID}}">{{if $.Task.Decision.Note}}<textarea rst-input name="note" maxlength="1000" rows="2" aria-label="{{copy "chat.card.direction_note"}}" placeholder="{{copy "chat.card.direction_note"}}" data-direction-note></textarea>{{end}}{{range $.Task.Decision.Choices}}<button equipo-btn{{if .Primary}} data-primary{{end}} type="submit" name="choice" value="{{.Value}}" data-merge-choice="{{.Value}}">{{.Label}}</button>{{end}}</form>{{end}}{{if .Fold}}<form method="post" action="/tasks/{{$t.ID}}/duplicate"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="of" value="{{$t.Dup.ID}}"><button equipo-btn data-primary type="submit" data-task-duplicate>{{copy "work.decide.fold"}}</button></form>{{end}}{{if .Recover}}<form method="post" action="/conversation/tasks/{{$t.ID}}/recover"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-recover>{{copy "work.recover"}}</button></form>{{end}}{{with .Unsandboxed}}<details equipo-mach-confirm data-unsandboxed><summary equipo-btn>{{copy "work.decide.unsandboxed"}}</summary><div><p>{{.Warning}}</p><form method="post" action="/conversation/tasks/{{$t.ID}}/unsandboxed"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="step" value="{{.Step}}"><input type="hidden" name="attempt" value="{{.Attempt}}"><button equipo-btn data-danger type="submit" data-task-unsandboxed>{{copy "work.decide.unsandboxed_confirm"}}</button></form></div></details>{{end}}{{if .Retry}}<form method="post" action="/conversation/tasks/{{$t.ID}}/retry"><input type="hidden" name="from" value="{{$.From}}"><button {{if .Fold}}equipo-link{{else}}equipo-btn data-primary{{end}} type="submit" data-task-retry>{{copy "work.retry"}}</button></form>{{end}}{{if .Round}}<form method="post" action="/conversation/tasks/{{$t.ID}}/round"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-round>{{copy "work.decide.round"}}</button></form>{{end}}{{if .Talk}}<a equipo-btn href="/conversation?about={{$t.ID}}" data-ask-coordinator>{{copy "work.decide.ask_coordinator"}}</a>{{end}}{{if .Cancel}}<form method="post" action="/conversation/tasks/{{$t.ID}}/cancel"><input type="hidden" name="from" value="{{$.From}}"><button equipo-link type="submit" data-task-cancel>{{copy "work.decide.cancel"}}</button></form>{{end}}{{with .Hint}}<span equipo-quiet>{{.}}</span>{{end}}<span equipo-d-quiet>{{if .Mac}}<a equipo-link href="/conversation/settings/machines/add" data-set-up-mac>{{copy "work.decide.mac_set_up"}}</a>{{end}}<a equipo-link href="/conversation?about={{$t.ID}}" data-ask-about>{{copy "work.ask_about"}}</a></span></div>
+<div equipo-d-actions>{{if .CopyContinue}}<form method="post" action="/conversation/tasks/{{$t.ID}}/continue-without-copy"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-copy-continue>{{copy "copy.continue"}}</button></form>{{end}}{{with .Card}}<form method="post" action="/conversation/cards/{{.ID}}/answer"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="task" value="{{$t.ID}}">{{if $.Task.Decision.Note}}<textarea rst-input name="note" maxlength="1000" rows="2" aria-label="{{copy "chat.card.direction_note"}}" placeholder="{{copy "chat.card.direction_note"}}" data-direction-note></textarea>{{end}}{{range $.Task.Decision.Choices}}<button equipo-btn{{if .Primary}} data-primary{{end}} type="submit" name="choice" value="{{.Value}}" data-merge-choice="{{.Value}}">{{.Label}}</button>{{end}}</form>{{end}}{{if .Fold}}<form method="post" action="/tasks/{{$t.ID}}/duplicate"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="of" value="{{$t.Dup.ID}}"><button equipo-btn data-primary type="submit" data-task-duplicate>{{copy "work.decide.fold"}}</button></form>{{end}}{{if .Recover}}<form method="post" action="/conversation/tasks/{{$t.ID}}/recover"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-recover>{{copy "work.recover"}}</button></form>{{end}}{{with .Unsandboxed}}<details equipo-mach-confirm data-unsandboxed><summary equipo-btn>{{copy "work.decide.unsandboxed"}}</summary><div><p>{{.Warning}}</p><form method="post" action="/conversation/tasks/{{$t.ID}}/unsandboxed"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="step" value="{{.Step}}"><input type="hidden" name="attempt" value="{{.Attempt}}"><button equipo-btn data-danger type="submit" data-task-unsandboxed>{{copy "work.decide.unsandboxed_confirm"}}</button></form></div></details>{{end}}{{if .Retry}}<form method="post" action="/conversation/tasks/{{$t.ID}}/retry"><input type="hidden" name="from" value="{{$.From}}"><button {{if .Fold}}equipo-link{{else}}equipo-btn data-primary{{end}} type="submit" data-task-retry>{{copy "work.retry"}}</button></form>{{end}}{{if .Round}}<form method="post" action="/conversation/tasks/{{$t.ID}}/round"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-round>{{copy "work.decide.round"}}</button></form>{{end}}{{if .Talk}}<a equipo-btn href="/conversation?about={{$t.ID}}" data-ask-coordinator>{{copy "work.decide.ask_coordinator"}}</a>{{end}}{{if .Cancel}}<form method="post" action="/conversation/tasks/{{$t.ID}}/cancel"><input type="hidden" name="from" value="{{$.From}}"><button equipo-link type="submit" data-task-cancel>{{copy "work.decide.cancel"}}</button></form>{{end}}{{with .Hint}}<span equipo-quiet>{{.}}</span>{{end}}<span equipo-d-quiet>{{if .Mac}}<a equipo-link href="/conversation/settings/machines/add" data-set-up-mac>{{copy "work.decide.mac_set_up"}}</a>{{end}}<a equipo-link href="/conversation?about={{$t.ID}}" data-ask-about>{{copy "work.ask_about"}}</a></span></div>
</div>{{end}}{{end}}
{{define "star-toggle"}}{{$p := .P}}<form method="post" action="/projects/{{$p.ID}}/star" equipo-star-form><input type="hidden" name="starred" value="{{if $p.Star.On}}0{{else}}1{{end}}"><input type="hidden" name="from" value="{{.From}}"><button type="submit" equipo-star{{if $p.Star.On}} aria-pressed="true"{{if $p.Star.Auto}} data-auto{{end}}{{else}} aria-pressed="false"{{end}} aria-label="{{$p.Star.Label}}" title="{{$p.Star.Who}}" data-star-toggle>{{icon "star"}}</button></form>{{end}}
{{define "project-facts"}}{{with .StackLine}}<span>{{if $.PhoneStack}}{{icon "phone"}}{{else}}{{icon "code"}}{{end}}{{.}}</span>{{end}}{{with .Repos}}<span data-repos>{{icon "git"}}{{if eq (len .) 1}}{{copy "work.project.one_repo"}}{{else}}{{printf (copy "work.project.repos") (len .)}}{{end}}</span>{{end}}{{with .ChecksLine}}<span data-tone="{{if $.Checks.Here}}positive{{else}}warning{{end}}" data-checks-fact>{{if $.Checks.Here}}{{icon "check-circle"}}{{else}}{{icon "help-circle"}}{{end}}{{.}}</span>{{end}}{{end}}
diff --git a/internal/equipo/templates/work_task.html b/internal/equipo/templates/work_task.html
index 0b8e4a56..fb793eb2 100644
--- a/internal/equipo/templates/work_task.html
+++ b/internal/equipo/templates/work_task.html
@@ -87,5 +87,5 @@
{{if .Facts}}<dl equipo-facts>{{range .Facts}}<dt>{{.Label}}</dt><dd><span>{{.Value}}</span>{{range .Sources}}{{if .URL}}<a equipo-source href="{{.URL}}" target="_blank" rel="noopener noreferrer" data-source="{{.ID}}">{{.URL}}</a>{{else}}<small equipo-source data-source="{{.ID}}">{{.ID}}</small>{{end}}{{end}}</dd>{{end}}</dl>{{end}}
{{if .Gaps}}<div equipo-gaps><h3>{{copy "work.research.gaps"}}</h3><ul>{{range .Gaps}}<li>{{.}}</li>{{end}}</ul></div>{{end}}
{{if .Images}}<ul equipo-kept>{{range .Images}}<li><figure><img src="{{.Src}}" alt="{{.Description}}" width="{{.Width}}" height="{{.Height}}" loading="lazy" decoding="async"><figcaption><b>{{.RoleWord}}</b> {{.Description}}</figcaption></figure></li>{{end}}</ul>{{end}}
-{{if .Fetches}}<details equipo-tl-more data-fetch-log><summary>{{icon "chevron-down"}}<span>{{printf (copy "work.research.log") (len .Fetches)}}</span></summary><ol equipo-fetch-log>{{range .Fetches}}<li><code>{{.URL}}</code>{{range .Hops}} <span aria-hidden="true">→</span> <code>{{.URL}}</code>{{with .Status}} <span>{{.}}</span>{{end}}{{end}}{{with .Status}} <span>{{.}}</span>{{end}}{{with .Type}} <span>{{.}}</span>{{end}}{{with .Bytes}} <span>{{fileSize .}}</span>{{end}}{{with .Reason}} <span data-reason>{{.}}</span>{{end}}</li>{{end}}</ol></details>{{end}}
+{{if .Fetches}}<details equipo-tl-more data-fetch-log id="research-{{.StepID}}"><summary>{{icon "chevron-down"}}<span>{{printf (copy "work.research.log") (len .Fetches)}}</span></summary><ol equipo-fetch-log>{{range .Fetches}}<li><code>{{.URL}}</code>{{range .Hops}} <span aria-hidden="true">→</span> <code>{{.URL}}</code>{{with .Status}} <span>{{.}}</span>{{end}}{{end}}{{with .Status}} <span>{{.}}</span>{{end}}{{with .Type}} <span>{{.}}</span>{{end}}{{with .Bytes}} <span>{{fileSize .}}</span>{{end}}{{with .Reason}} <span data-reason>{{.}}</span>{{end}}</li>{{end}}</ol></details>{{end}}
</div>{{end}}
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go
index 0c3a4f12..51645321 100644
--- a/internal/equipo/work_pages.go
+++ b/internal/equipo/work_pages.go
@@ -637,7 +637,9 @@ func (a *application) workTasks(w http.ResponseWriter, r *http.Request) {
return
}
for _, c := range questions {
- data.Thin.Questions = append(data.Thin.Questions, cardView(c, nil, nil))
+ v := cardView(c.Card, nil, nil)
+ v.Job = c.Job
+ data.Thin.Questions = append(data.Thin.Questions, v)
}
for _, t := range all {
switch {
@@ -1078,3 +1080,5 @@ func (a *application) workTaskContinueCopy(w http.ResponseWriter, r *http.Reques
return a.store.Chat().ContinueWithoutCopy(ctx, address, id)
})
}
+
+func (v workView) DecisionCount() int { return len(v.Decisions) + len(v.Questions) }
diff --git a/internal/equipo/work_views.go b/internal/equipo/work_views.go
index 7b330df6..2eb2ea2d 100644
--- a/internal/equipo/work_views.go
+++ b/internal/equipo/work_views.go
@@ -129,6 +129,7 @@ type menuItem struct {
// decisionView is a decision card: why, the question, and the one-tap
// answers. Card is the merge card it answers, if any.
type decisionView struct {
+ CopyContinue bool
Need, Tone, Why, Ask, Hint string
Card *wire.Card
Choices []decisionChoice
@@ -214,6 +215,9 @@ func needsViewer(t wire.Task, viewer string, card *wire.Card) bool {
if t.Creator != viewer || wire.FinalStage(t.Stage) {
return false
}
+ if t.CopyHold || t.CopyCanSkip {
+ return true
+ }
switch t.NeedsYou {
case wire.NeedsRetry, wire.NeedsReviewBlocked, wire.NeedsFixRounds, wire.NeedsBranchMoved, wire.NeedsMergeConflict, wire.NeedsMachineRemoved, wire.NeedsMacSandbox, wire.NeedsDirection:
return true
@@ -225,6 +229,9 @@ func needsViewer(t wire.Task, viewer string, card *wire.Card) bool {
// needsSomeone is the same for any creator, for "Waiting for Nora".
func needsSomeone(t wire.Task) bool {
+ if t.CopyHold || t.CopyCanSkip {
+ return !wire.FinalStage(t.Stage)
+ }
switch t.NeedsYou {
case wire.NeedsRetry, wire.NeedsReviewBlocked, wire.NeedsFixRounds, wire.NeedsBranchMoved, wire.NeedsMergeConflict, wire.NeedsMachineRemoved, wire.NeedsMacSandbox, wire.NeedsDirection:
return !wire.FinalStage(t.Stage)
@@ -620,6 +627,14 @@ func actionOf(id string, d *decisionView, stopped *wire.Step) *rowAction {
// decisionOf is the one card for what the creator must decide.
func decisionOf(t wire.Task, v taskLine) *decisionView {
d := &decisionView{Need: t.NeedsYou}
+ if t.CopyHold || t.CopyCanSkip {
+ d.Need, d.Tone, d.Ask, d.Talk, d.CopyContinue = "copy", "attention", copyText("roster.copy_waiting"), true, t.CopyCanSkip
+ d.Why = copyText("copy.round_budget")
+ if s := lastStep(t); s != nil && s.Reason != "" {
+ d.Why = reasonLine(s.Reason, "work.reason.other")
+ }
+ return d
+ }
who := func(s *wire.Step) string {
if s == nil {
return specialistName(wire.SpecialistEngineering)
diff --git a/internal/headless/browser_cards_test.go b/internal/headless/browser_cards_test.go
index 5e94e05b..58243ddd 100644
--- a/internal/headless/browser_cards_test.go
+++ b/internal/headless/browser_cards_test.go
@@ -90,7 +90,7 @@ func TestBrowserThinkingAndCards(t *testing.T) {
send("tool:ask_person:Should the panes slide on iPad too?|Yes|No")
run(browsertest.Wait(`!!document.querySelector('[equipo-card="question"][data-state="open"] button[value="Yes"]')`))
check(`(()=>{document.querySelector('[equipo-card="question"][data-state="open"] button[value="Yes"]').click();return true})()`, "answer")
- run(browsertest.Wait(`[...document.querySelectorAll('[equipo-card="question"][data-state="answered"]')].some(e=>e.textContent.includes('You answered: Yes')) && [...document.querySelectorAll('[equipo-message="own"] [equipo-message-body]')].some(e=>e.textContent==='Yes')`))
+ run(browsertest.Wait(`[...document.querySelectorAll('[equipo-card="question"][data-state="answered"] [equipo-thread-turn][data-own] [equipo-thread-text]')].some(e=>e.textContent.trim()==='Yes')`))
run(browsertest.Wait(`!document.querySelector('[equipo-thinking]')`))
// A keyboard shrinks the visual viewport: after a send the newest
diff --git a/internal/headless/browser_notebook_test.go b/internal/headless/browser_notebook_test.go
index e6e98bff..3ba182b2 100644
--- a/internal/headless/browser_notebook_test.go
+++ b/internal/headless/browser_notebook_test.go
@@ -93,22 +93,29 @@ func TestBrowserNotebookLook(t *testing.T) {
for _, theme := range []string{"light", "dark"} {
p.run(chromedp.Navigate(inst.URL+"/conversation"), browsertest.Wait(`!!document.querySelector('[data-chat-stream]')`))
p.theme(theme)
- p.check(`(()=>{const b=document.querySelector('[equipo-chat-header] a[equipo-header-button][href="/conversation/settings/notebook"]');if(!b)return false;const r=b.getBoundingClientRect();return b.getAttribute('aria-label')==='Notebook' && b.title==='Notebook' && !!b.querySelector('svg') && b.textContent.trim()==='' && getComputedStyle(b).cursor==='pointer' && (`+strconv.FormatBool(width < 600)+` ? r.width>=44 && r.height>=44 : r.width>=24)})()`, "header button")
- // Keyboard: Tab reaches the button, and its focus shows.
- for i := 0; i < 30; i++ {
- var on bool
- p.run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error {
- var err error
- on, err = chromedp.Evaluate[bool](`document.activeElement && document.activeElement.hasAttribute('equipo-header-button')`)(ctx, target)
- return err
- }))
- if on {
- break
+ if width < 600 {
+ p.check(`getComputedStyle(document.querySelector('[equipo-chat-header] [equipo-header-button]')).display==='none' && !!document.querySelector('[equipo-needs-pill]')`, "phone header keeps the Needs you control")
+ p.run(chromedp.Navigate(inst.URL+"/conversation/settings"), browsertest.Wait(`!!document.querySelector('a[href="/conversation/settings/notebook"]')`))
+ p.check(`(()=>{document.querySelector('a[href="/conversation/settings/notebook"]').click();return true})()`, "Notebook reachable through settings")
+ p.run(browsertest.Wait(`location.pathname==='/conversation/settings/notebook'`))
+ } else {
+ p.check(`(()=>{const b=document.querySelector('[equipo-chat-header] a[equipo-header-button][href="/conversation/settings/notebook"]');if(!b)return false;const r=b.getBoundingClientRect();return b.getAttribute('aria-label')==='Notebook' && b.title==='Notebook' && !!b.querySelector('svg') && b.textContent.trim()==='' && getComputedStyle(b).cursor==='pointer' && (`+strconv.FormatBool(width < 600)+` ? r.width>=44 && r.height>=44 : r.width>=24)})()`, "header button")
+ // Keyboard: Tab reaches the button, and its focus shows.
+ for i := 0; i < 30; i++ {
+ var on bool
+ p.run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error {
+ var err error
+ on, err = chromedp.Evaluate[bool](`document.activeElement && document.activeElement.hasAttribute('equipo-header-button')`)(ctx, target)
+ return err
+ }))
+ if on {
+ break
+ }
+ p.run(chromedp.KeyEvent("\t"))
}
- p.run(chromedp.KeyEvent("\t"))
+ p.check(`document.activeElement.hasAttribute('equipo-header-button') && getComputedStyle(document.activeElement).outlineStyle!=='none'`, "keyboard focus on the Notebook button")
+ p.run(chromedp.KeyEvent("\r"), browsertest.Wait(`location.pathname==='/conversation/settings/notebook'`))
}
- p.check(`document.activeElement.hasAttribute('equipo-header-button') && getComputedStyle(document.activeElement).outlineStyle!=='none'`, "keyboard focus on the Notebook button")
- p.run(chromedp.KeyEvent("\r"), browsertest.Wait(`location.pathname==='/conversation/settings/notebook'`))
p.theme(theme)
p.check(`(()=>{const ns=[...document.querySelectorAll('[equipo-notes] > [equipo-note]')];if(ns.length!==5)return false;const page=getComputedStyle(document.body).backgroundColor;return ns.every(n=>{const s=getComputedStyle(n);return s.borderTopWidth==='1px'&&s.borderLeftWidth==='1px'&&s.borderLeftColor===s.borderTopColor&&s.boxShadow!=='none'&&s.backgroundColor!==page&&n.querySelector('[equipo-note-caption] time')})})()`, "notes are not paper cards")
p.check(`(()=>{const q=document.querySelector('[equipo-note][data-said] blockquote p');return !!q && q.textContent.startsWith('I like short replies') && getComputedStyle(q,'::before').content==='"“"' && q.closest('[equipo-note]').querySelector('[equipo-note-caption]').textContent.includes('You said')})()`, "the person's words are not a quote")
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go
index c2ee995b..4589e5af 100644
--- a/internal/plan3test/plan3_release_test.go
+++ b/internal/plan3test/plan3_release_test.go
@@ -177,8 +177,9 @@ func plan3CopyInventory(t *testing.T) {
approvedAssistant := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-13, copy-review jbltdd2mvwblrz4en6xfhv6d2y, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-13, copy-review 64nswfjbrpsw2pezhyi7y3nenq, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-13, copy-review c3ipwcupsvwv7rpbj2kdbgrsyy, unchanged)")
// Paul's own review of the jobs strings and the API section's job prose.
approvedJobs := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq)")
+ acceptedRoster := strings.HasPrefix(key, "roster.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)")
acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key])
- if !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs {
+ if !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs {
t.Fatal("entry has no copy review status or applicable acceptance", key)
}
}
diff --git a/internal/thintest/housekeeping_browser_test.go b/internal/thintest/housekeeping_browser_test.go
index 85449e4f..1e344f39 100644
--- a/internal/thintest/housekeeping_browser_test.go
+++ b/internal/thintest/housekeeping_browser_test.go
@@ -53,13 +53,15 @@ func TestBrowserHousekeeping(t *testing.T) {
p.wait(`document.querySelector('[data-digest]')`, "digest line")
p.check(`document.querySelector('[data-digest]').textContent.includes('Tidied 2 things.')`, "digest words")
p.check(`document.querySelector('[data-digest-link]').getAttribute('href')==='/housekeeping'`, "digest link")
- p.check(`(()=>{const a=document.querySelector('[data-housekeeping-link]');const b=a.getBoundingClientRect();return b.width>0&&b.height>0&&b.top>=0})()`, "header link visible")
+ if !size.touch {
+ p.check(`(()=>{const a=document.querySelector('[data-housekeeping-link]');const b=a.getBoundingClientRect();return b.width>0&&b.height>0&&b.top>=0})()`, "header link visible")
+ }
p.check(`document.querySelectorAll('[equipo-card="combined"]').length===2`, "two quiet receipts")
p.fits("conversation")
p.shot(fmt.Sprintf("hk-conversation-%d", size.w))
// The view.
- p.click(`[data-housekeeping-link]`)
+ p.click(`[data-digest-link]`)
p.wait(`document.querySelector('[data-housekeeping]')`, "the view")
// Settled, as opened directly (the phone slides the page in).
p.open("/housekeeping")
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go
index 85f63f66..0c83d0c6 100644
--- a/internal/thintest/inner_browser_test.go
+++ b/internal/thintest/inner_browser_test.go
@@ -285,7 +285,7 @@ func TestBrowserInnerScreens(t *testing.T) {
// Needs you: one card per decision, the prominent answer in reach.
p.open("/tasks?needs=you")
- p.check(`document.querySelectorAll('[equipo-decision]').length===2`, "two decisions")
+ p.check(`document.querySelectorAll('[equipo-decision][data-decision]').length===2`, "two decisions")
p.check(`(()=>{const b=document.querySelector('[data-decision="`+g.unchecked+`"] [data-merge-choice="merge"]').getBoundingClientRect();return b.width>0 && b.height>=`+map[bool]string{true: "44", false: "30"}[size.touch]+`})()`, "Merge out of reach")
p.fits("needs")
@@ -296,7 +296,7 @@ func TestBrowserInnerScreens(t *testing.T) {
// centre.
mid := `(e=>{const r=e.getBoundingClientRect();return (r.top+r.bottom)/2})`
p.open("/conversation")
- p.check(`(()=>{const m=`+mid+`;const a=m(document.querySelector('[rst-shell-back] > a')),h=m(document.querySelector('[equipo-chat-header] h1')),b=m(document.querySelector('[equipo-chat-header] [equipo-header-button]'));return Math.abs(a-h)<=1 && Math.abs(h-b)<=1})()`, "conversation bar not on one centre line")
+ p.check(`(()=>{const m=`+mid+`;const a=m(document.querySelector('[rst-shell-back] > a')),h=m(document.querySelector('[equipo-chat-header] h1')),b=m(document.querySelector('[equipo-chat-header] [equipo-needs-pill]'));return Math.abs(a-h)<=1 && Math.abs(h-b)<=1})()`, "conversation bar not on one centre line")
for _, path := range []string{"/tasks/" + g.unchecked, "/projects/" + a.conv.Tasks[g.unchecked].ProjectID} {
p.open(path)
p.check(`(()=>{const m=`+mid+`;const bar=document.querySelector('[rst-shell-back]'),l=bar.querySelector('a');const pad=parseFloat(getComputedStyle(bar).paddingTop);const r=bar.getBoundingClientRect();return Math.abs(m(l)-(r.top+pad+r.bottom)/2)<=1})()`, path+" back link off its bar's centre")
diff --git a/internal/thintest/merge_contract_test.go b/internal/thintest/merge_contract_test.go
index e3653b42..370f2fde 100644
--- a/internal/thintest/merge_contract_test.go
+++ b/internal/thintest/merge_contract_test.go
@@ -203,7 +203,7 @@ func TestContractMergeWithoutChecks(t *testing.T) {
if err != nil || out.Card.State != wire.CardAnswered || out.Card.Choice != wire.ChoiceWaitMac {
t.Fatalf("wait %+v %v", out, err)
}
- if page := r.get(r.inst.Cookie(), "/conversation", 200); !strings.Contains(page, "Merge Swipe back on iOS? I&#39;d wait") || !strings.Contains(page, "Waiting for a Mac.") || strings.Contains(page, `data-merge-choice="merge"`) {
+ if page := r.get(r.inst.Cookie(), "/conversation", 200); !strings.Contains(page, `data-card="`+card.ID+`"`) || !strings.Contains(page, "Waiting for a Mac.") || strings.Contains(page, `data-merge-choice="merge"`) {
t.Fatalf("answered card: %s", page)
}
if k, _ := r.client.Task(ctx, id); k.Stage != wire.StageReadyToMerge || k.NeedsYou != wire.NeedsMerge || r.heldKinds(wire.FrameDispatch) != 0 {
diff --git a/internal/thintest/publish_contract_test.go b/internal/thintest/publish_contract_test.go
index 13484d68..ec7feb37 100644
--- a/internal/thintest/publish_contract_test.go
+++ b/internal/thintest/publish_contract_test.go
@@ -235,7 +235,7 @@ func TestContractPublishSite(t *testing.T) {
if r.audits("publish.authorize") != 4 {
t.Fatalf("authorize audited %d times", r.audits("publish.authorize"))
}
- if page := r.get(r.inst.Cookie(), "/conversation", 200); !strings.Contains(page, "Publish Quick website on the web as "+app+"?") || !strings.Contains(page, "Publishing.") {
+ if page := r.get(r.inst.Cookie(), "/conversation", 200); !strings.Contains(page, `equipo-card="publish"`) || !strings.Contains(page, "Publishing.") {
t.Fatalf("conversation page lacks the publish card")
}
}
diff --git a/internal/thintest/research_pages_test.go b/internal/thintest/research_pages_test.go
index b629a980..b88d6cbe 100644
--- a/internal/thintest/research_pages_test.go
+++ b/internal/thintest/research_pages_test.go
@@ -140,7 +140,7 @@ func TestResearchInventoryCardPage(t *testing.T) {
r.inventoryCard(wire.CardAnswered)
r.backdate(-48 * time.Hour)
after := cardOf(t, r.get(owner, "/conversation", 200), card.ID)
- if strings.Contains(after, "<form") || !strings.Contains(after, "<p equipo-card-note>Confirmed. Research will block pages served from these addresses.</p>") {
+ if strings.Contains(after, "<form") || !strings.Contains(after, "Confirmed. Research will block pages served from these addresses.</p>") {
t.Fatalf("confirmed card:\n%s", after)
}
}
diff --git a/internal/thintest/roster_browser_test.go b/internal/thintest/roster_browser_test.go
index 5e1604b7..1c1c23c2 100644
--- a/internal/thintest/roster_browser_test.go
+++ b/internal/thintest/roster_browser_test.go
@@ -5,6 +5,8 @@ package thintest
import (
"amadan.net/oficina/equipo/internal/wire"
"fmt"
+ "github.com/chromedp/cdproto/input"
+ "github.com/chromedp/chromedp"
"testing"
)
@@ -18,11 +20,12 @@ func TestBrowserRosterVisual(t *testing.T) {
p.open("/conversation")
p.wait(`document.querySelector('[equipo-offline]').hidden`, "connected")
p.check(`!!document.querySelector('[equipo-roster-byline]')`, "roster bylines missing")
- p.check(`!!document.querySelector('[equipo-roster-report] [data-track]')`, "report stage track missing")
+ p.check(`[...document.querySelectorAll("[equipo-daybar] i")].every(i=>i.getBoundingClientRect().width>0) && !document.querySelector("[equipo-daybar] [style]")`, "roll-up bar violates the style policy")
+ p.check(`document.querySelector('[equipo-roster-report] [data-track]').children.length===5`, "report needs five stages")
p.check(`!!document.querySelector('[equipo-roster-facts]')`, "report facts missing")
p.check(`(()=>{const s=getComputedStyle(document.querySelector('[equipo-coordinator-mark]'));return s.backgroundColor==='rgba(0, 0, 0, 0)' && s.boxShadow==='none'})()`, "coordinator has a tile")
p.fits("Roster")
- p.check(`(()=>{document.querySelector('[equipo-scroll]').scrollTop=0;return true})()`, "top")
+ p.check(`(()=>{const s=document.querySelector('[equipo-scroll]');s.scrollTop=0;s.dispatchEvent(new Event('scroll'));return true})()`, "top")
p.shot(fmt.Sprintf("roster-%d-%s", width, scheme))
})
}
@@ -30,18 +33,20 @@ func TestBrowserRosterVisual(t *testing.T) {
}
func TestBrowserRosterSetAside(t *testing.T) {
- r := newRollupRig(t)
for _, width := range []int64{1280, 390} {
for _, scheme := range []string{"light", "dark"} {
t.Run(fmt.Sprintf("%d-%s", width, scheme), func(t *testing.T) {
+ r := newRollupRig(t)
p := openInner(t, r.inst.URL, r.inst.Cookie(), width, 844, width == 390, scheme, "reduce")
defer p.stop()
p.open("/conversation")
card := `[data-card="` + r.askCard.ID + `"]`
p.wait(`document.querySelector('`+card+` [data-set-aside]')`, "Set aside")
+ before := eval[string](p, `document.querySelector("[equipo-needs-pill]").textContent`)
p.click(card + ` [data-set-aside]`)
p.wait(`document.querySelector('`+card+` [equipo-aside-stub]')`, "persisted stub")
- p.check(`!!document.querySelector('[equipo-roster-toast] [data-aside-undo]')`, "toast undo missing")
+ p.check(`document.querySelector("[equipo-needs-pill]").textContent===`+jsString(before), "set aside changed Needs you count")
+ p.wait(`document.querySelector('[equipo-roster-toast] [data-aside-undo]')`, "toast undo")
p.shot(fmt.Sprintf("roster-aside-%d-%s", width, scheme))
p.open("/conversation")
p.wait(`document.querySelector('`+card+` [equipo-aside-stub]')`, "stub after reload")
@@ -53,6 +58,12 @@ func TestBrowserRosterSetAside(t *testing.T) {
p.open("/conversation")
p.check(`!document.querySelector('`+card+` [equipo-aside-stub]')`, "undo did not persist")
p.fits("set aside and undo")
+ p.click(card + ` [data-set-aside]`)
+ p.wait(`document.querySelector('`+card+` [equipo-aside-stub]')`, "set aside again")
+ if _, err := r.client.Answer(r.ctx, r.askCard.ID, wire.ChoiceWaitMac, r.askCard.Revision); err != nil {
+ t.Fatal(err)
+ }
+ p.wait(`!document.querySelector('`+card+` [equipo-aside-stub]') && document.querySelector('`+card+` [equipo-card-done]')`, "answer from elsewhere resolves the stub")
})
}
}
@@ -77,18 +88,32 @@ func TestBrowserRosterSubchat(t *testing.T) {
p.check(`document.querySelector('[equipo-subchat] [equipo-thread-turn]').textContent.includes('Which page should change?')`, "first word is not a turn")
p.check(`(()=>{const i=document.querySelector('[equipo-mini-composer] textarea');i.value='The sign-in page.';i.dispatchEvent(new Event('input',{bubbles:true}));i.focus();return true})()`, "type")
p.shot(fmt.Sprintf("roster-thread-typing-%d-%s", width, scheme))
+ p.click(`[data-set-aside]`)
+ p.wait(`document.querySelector('[equipo-aside-stub]')`, "question set aside")
+ p.wait(`document.querySelector('[equipo-roster-toast] [data-aside-undo]')`, "question toast")
+ p.click(`[equipo-roster-toast] [data-aside-undo]`)
+ p.wait(`document.querySelector('[equipo-mini-composer] textarea')?.value==='The sign-in page.'`, "undo retains the draft")
p.click(`[equipo-mini-composer] [data-thread-send]`)
f, body := r.expect(wire.FrameMessage)
m := body.(*wire.MessageCommand)
r.runner.Send(r.ctx, "roster-a", wire.FrameAck, wire.Ack{ID: f.ID})
p.wait(`document.querySelector('[equipo-subchat] [data-own]') && document.querySelector('[equipo-thread-wait]')`, "sent and waiting")
p.shot(fmt.Sprintf("roster-thread-waiting-%d-%s", width, scheme))
+ r.runner.Send(r.ctx, "roster-delta", wire.FrameDelta, wire.DeltaReport{TurnID: m.TurnID, Attempt: 1, Offset: 0, Text: "I’ll start"})
+ p.wait(`document.querySelector('[equipo-thread-draft]')?.textContent==='I’ll start'`, "streamed reply in the drawer")
r.runner.Send(r.ctx, "roster-answer", wire.FrameReply, wire.Reply{TurnID: m.TurnID, Attempt: 1, Text: "I’ll start with the sign-in page."})
p.wait(`document.querySelector('[equipo-subchat]').textContent.includes('I’ll start with the sign-in page.')`, "reply inside the sub-chat")
p.open("/conversation")
p.wait(`document.querySelector('[equipo-subchat]').textContent.includes('I’ll start with the sign-in page.')`, "thread after reload")
p.fits("sub-chat")
p.shot(fmt.Sprintf("roster-thread-answered-%d-%s", width, scheme))
+ p.check(`(()=>{const i=document.querySelector('[equipo-mini-composer] textarea');i.value='Keep the email link.';i.dispatchEvent(new Event('input',{bubbles:true}));return true})()`, "follow-up")
+ p.click(`[equipo-mini-composer] [data-thread-send]`)
+ f2, b2 := r.expect(wire.FrameMessage)
+ m2 := b2.(*wire.MessageCommand)
+ r.runner.Send(r.ctx, "roster-a2", wire.FrameAck, wire.Ack{ID: f2.ID})
+ r.runner.Send(r.ctx, "roster-answer2", wire.FrameReply, wire.Reply{TurnID: m2.TurnID, Attempt: 1, Text: "The email link will stay."})
+ p.wait(`document.querySelector('[equipo-subchat]').textContent.includes('The email link will stay.') && document.querySelectorAll('[equipo-subchat] [data-own]').length===2`, "second round stays in the thread")
})
}
}
@@ -100,11 +125,31 @@ func TestBrowserRosterDecisionStates(t *testing.T) {
t.Run(fmt.Sprintf("%d-%s", width, scheme), func(t *testing.T) {
r := newToolRigAt(t, wire.ProtocolCurrent)
id, c := r.toDirection("roster", "Explore a shorter setup")
+ _, built := r.toDirection("roster-build", "Explore compact navigation")
p := openInner(t, r.inst.URL, r.inst.Cookie(), width, 844, width == 390, scheme, "reduce")
defer p.stop()
p.open("/conversation")
card := `[data-card="` + c.ID + `"]`
p.wait(`document.querySelector('`+card+` [data-direction-choice="build"]')`, "direction")
+ p.check(`(()=>{document.querySelector('`+card+` [equipo-actions] [name=revision]').value='0';return true})()`, "make stale")
+ p.click(card + ` [data-direction-choice="build"]`)
+ p.wait(`document.querySelector('`+card+` [equipo-card-error]').textContent.includes('This item has changed')`, "stale revision error")
+ if k := r.task(id); k.Stage != wire.StageInReview {
+ t.Fatalf("stale choice changed task: %s", k.Stage)
+ }
+ p.shot(fmt.Sprintf("roster-decision-stale-%d-%s", width, scheme))
+ p.click(card + ` [equipo-card-error] button`)
+ p.wait(`document.querySelector('`+card+` [equipo-actions] [name=revision]').value==='1'`, "refresh stale decision")
+ p.check(`(()=>{const b=document.querySelector('`+card+` [data-direction-choice="build"]');b.scrollIntoView({block:'center'});b.addEventListener('click',e=>e.preventDefault(),{once:true});return true})()`, "inspect pointer states")
+ xy := eval[[]float64](p, `(()=>{const r=document.querySelector('`+card+` [data-direction-choice="build"]').getBoundingClientRect();return [r.x+r.width/2,r.y+r.height/2]})()`)
+ p.do(chromedp.MouseEvent(input.DispatchMouseEventTypeMouseMoved, xy[0], xy[1]))
+ p.check(`document.querySelector('`+card+` [data-direction-choice="build"]').matches(':hover')`, "hover state")
+ p.shot(fmt.Sprintf("roster-decision-hover-%d-%s", width, scheme))
+ p.do(chromedp.MouseEvent(input.DispatchMouseEventTypeMousePressed, xy[0], xy[1], chromedp.ButtonLeft, chromedp.ClickCount(1)))
+ p.check(`getComputedStyle(document.querySelector('`+card+` [data-direction-choice="build"]')).transform!=='none'`, "pressed state")
+ p.shot(fmt.Sprintf("roster-decision-pressed-%d-%s", width, scheme))
+ p.do(chromedp.MouseEvent(input.DispatchMouseEventTypeMouseReleased, xy[0], xy[1], chromedp.ButtonLeft, chromedp.ClickCount(1)))
+
p.check(`(()=>{window.__fetch=window.fetch;window.fetch=function(url,opts){if(opts&&opts.method==='POST')return new Promise(resolve=>{window.__release=()=>resolve(new Response('{}',{status:503}));});return window.__fetch(url,opts)};return true})()`, "hold request")
p.click(card + ` [data-direction-choice="build"]`)
p.check(`(()=>{const c=document.querySelector('`+card+`');return c.getAttribute('aria-busy')==='true' && c.querySelector('[aria-busy="true"]').textContent.includes('Building') && [...c.querySelectorAll('button')].every(b=>b.disabled)})()`, "busy and sibling disabled")
@@ -113,7 +158,7 @@ func TestBrowserRosterDecisionStates(t *testing.T) {
p.wait(`!document.querySelector('`+card+` [equipo-card-error]').hidden`, "in-place error")
p.shot(fmt.Sprintf("roster-decision-error-%d-%s", width, scheme))
p.check(`(()=>{window.fetch=window.__fetch;return true})()`, "restore request")
- p.click(card + ` [data-direction-thread] summary`)
+ p.click(card + ` [data-thread-open]`)
p.check(`document.activeElement===document.querySelector('`+card+` textarea')`, "Try again focuses sub-chat")
p.check(`(()=>{const i=document.querySelector('`+card+` textarea');i.value='Keep the runner step, drop the tour.';i.dispatchEvent(new Event('input',{bubbles:true}));return true})()`, "note")
p.click(card + ` [data-thread-send]`)
@@ -123,7 +168,29 @@ func TestBrowserRosterDecisionStates(t *testing.T) {
}
p.fits("direction states")
p.shot(fmt.Sprintf("roster-decision-sent-%d-%s", width, scheme))
+ build := `[data-card="` + built.ID + `"]`
+ p.click(build + ` [data-direction-choice="build"]`)
+ p.wait(`document.querySelector('`+build+` [data-done]')`, "Build collapses to success")
+ p.check(`getComputedStyle(document.querySelector('`+build+` [equipo-card-line]')).display==='none'`, "success retained the open card title")
+ p.shot(fmt.Sprintf("roster-decision-success-%d-%s", width, scheme))
})
}
}
}
+
+func TestBrowserRosterThinking(t *testing.T) {
+ r := newToolRig(t)
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), 390, 844, true, "dark", "reduce")
+ defer p.stop()
+ p.open("/conversation")
+ p.wait(`document.querySelector('[equipo-thinking] [data-turn-stop]')`, "Stop on thinking line")
+ p.check(`(()=>{const s=getComputedStyle(document.querySelector('[equipo-thinking] [equipo-sparkle]'));return s.display==='none'})()`, "filled thinking mark remains")
+ p.fits("thinking line")
+ p.shot("roster-thinking-390-dark")
+ p.click(`[equipo-thinking] [data-turn-stop]`)
+ cf, _ := r.expect(wire.FrameCancel)
+ r.runner.Send(r.ctx, "roster-stop-ack", wire.FrameAck, wire.Ack{ID: cf.ID})
+ r.runner.Send(r.ctx, "roster-stop-report", wire.FrameTurn, wire.TurnReport{TurnID: r.turn, Attempt: 1, State: wire.TurnCancelled, Reason: "cancelled"})
+ r.wait("stopped", func(c *Conversation) bool { return c.Turns[r.turn].State == wire.TurnCancelled })
+ p.wait(`!document.querySelector('[equipo-thinking]')`, "stopped line removed")
+}
diff --git a/internal/thintest/roster_contract_test.go b/internal/thintest/roster_contract_test.go
new file mode 100644
index 00000000..c238af54
--- /dev/null
+++ b/internal/thintest/roster_contract_test.go
@@ -0,0 +1,42 @@
+package thintest
+
+import (
+ "amadan.net/oficina/equipo/internal/wire"
+ "testing"
+)
+
+// While one turn is running, answers to different cards and the main
+// composer must queue independently. Otherwise their replies mix threads.
+func TestRosterRepliesDoNotBatch(t *testing.T) {
+ r := newToolRig(t)
+ for _, id := range []string{"one"} {
+ if res := r.call(id, wire.ToolAskPerson, map[string]any{"question": id + "?", "options": []string{}}); res.Code != "asked" {
+ t.Fatal(res)
+ }
+ }
+ snap, err := r.client.Snapshot(r.ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ before, err := r.client.Send(r.ctx, "An earlier main message", "before")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var turns []string
+ for _, c := range snap.Cards {
+ if c.Kind == wire.CardQuestion {
+ answer, err := r.client.Answer(r.ctx, c.ID, "My answer", c.Revision)
+ if err != nil {
+ t.Fatal(err)
+ }
+ turns = append(turns, answer.Turn.ID)
+ }
+ }
+ main, err := r.client.Send(r.ctx, "An unrelated request", "unrelated")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(turns) != 1 || turns[0] == main.Turn.ID || turns[0] == before.Turn.ID {
+ t.Fatalf("card replies share a turn: %v, main %s", turns, main.Turn.ID)
+ }
+}
diff --git a/internal/thintest/roster_reports_browser_test.go b/internal/thintest/roster_reports_browser_test.go
new file mode 100644
index 00000000..67288050
--- /dev/null
+++ b/internal/thintest/roster_reports_browser_test.go
@@ -0,0 +1,56 @@
+//go:build browser
+
+package thintest
+
+import (
+ "amadan.net/oficina/equipo/internal/wire"
+ "fmt"
+ "testing"
+)
+
+func TestBrowserRosterReports(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, personWords)
+ r.researchOn()
+ r.inventoryOn()
+ d := r.runningResearch("roster-research")
+ r.step("roster-findings", wire.StepReport{TaskID: d.TaskID, StepID: d.StepID, Attempt: d.Attempt, State: wire.StepDone, Termination: true, Summary: "Read four pages.", Research: &wire.ResearchResult{Findings: findingsJSON(t, goodFindings()), Fetches: fetchLog()}})
+ r.nextDispatch()
+ // A paused Copy attempt, with the runner's stored extraction and review.
+ held := r.shopTask("roster-copy")
+ now := r.inst.Store.Chat().Now()
+ raw := `{"extraction":{"version":1,"strings":[{"key":"a","text":"One"},{"key":"b","text":"Two"}]},"review":{"version":1,"strings":[{"key":"a","text":"One"}]}}`
+ if _, err := r.inst.DB.Writer().Exec("INSERT INTO chat_steps(id,task_id,idx,specialist,person,state,reason,attempt,candidate_sha,copy_result,held_at,revision,created_at,updated_at) VALUES('roster-copy-step',?,1,'copy',?,'queued','copy_budget',1,?,?,?,1,?,?)", held, Owner, candX, raw, now, now, now); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := r.inst.DB.Writer().Exec("UPDATE chat_tasks SET copy_hold=1,stage='in_review' WHERE id=?", held); err != nil {
+ t.Fatal(err)
+ }
+ for _, width := range []int64{1280, 390} {
+ for _, scheme := range []string{"light", "dark"} {
+ t.Run(fmt.Sprintf("%d-%s", width, scheme), func(t *testing.T) {
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), width, 844, width == 390, scheme, "reduce")
+ defer p.stop()
+ p.open("/conversation")
+ p.wait(`document.querySelector('[data-research-report]')`, "research findings")
+ p.check(`document.querySelectorAll('[data-research-report] [equipo-roster-findings] a').length===3 && !!document.querySelector('[data-research-report] [data-gap]')`, "findings lost sources or gaps")
+ p.check(`(()=>{document.querySelector('[data-research-report]').scrollIntoView({block:'center'});return true})()`, "show Research")
+ p.fits("Research")
+ p.shot(fmt.Sprintf("roster-research-%d-%s", width, scheme))
+ p.check(`document.querySelector('[equipo-copy-meter]').textContent.includes('1 of 2 strings reviewed') && document.querySelector('[equipo-copy-meter] meter').value===1`, "Copy coverage")
+ p.check(`(()=>{document.querySelector('[equipo-copy-hold]').scrollIntoView({block:'center'});return true})()`, "show Copy")
+ p.fits("Copy hold")
+ p.check(`[...document.querySelectorAll("[equipo-roster-card]")].every(c=>c.scrollWidth<=c.clientWidth+1)`, "content overflows a card")
+ p.shot(fmt.Sprintf("roster-copy-%d-%s", width, scheme))
+ p.check(`(()=>{document.querySelector('[equipo-copy-hold]').closest('[data-card]').querySelector('[data-set-aside]').click();return true})()`, "set Copy aside")
+ p.wait(`document.querySelector('[equipo-aside-stub]')`, "Copy stub")
+ p.open("/tasks?needs=you")
+ p.check(`!!document.querySelector('a[href="/tasks/`+held+`"]')`, "Copy hold missing from Needs you")
+ p.open("/tasks/" + held)
+ p.check(`!!document.querySelector('[data-copy-continue]')`, "Copy hold unreachable from task")
+ p.open("/conversation")
+ p.click(`[equipo-aside-stub] [data-aside-undo]`)
+ p.wait(`document.querySelector('[equipo-copy-meter]')`, "Copy restored")
+ })
+ }
+ }
+}
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json
index 30f38453..b54c086b 100644
--- a/scripts/runner-reference-allowlist.json
+++ b/scripts/runner-reference-allowlist.json
@@ -15748,5 +15748,12 @@
"match": "equipo-runner",
"count": 4,
"reason": "Redacted real hosted CI fixture; retained diagnostic text exercises complete failed-unit classification and recovery."
+ },
+ {
+ "path": "internal/equipo/static/chat-stream.js",
+ "line_sha256": "15b2ed7466c12578d071dd4bfa90f24684c0ab96198f1dae2f69ac06bd6db7cd",
+ "match": "Node",
+ "count": 2,
+ "reason": "Browser DOM text and clone methods for the set-aside undo toast, not a runtime dependency."
}
]