Align end-to-end checks with named activity events
5 files changed,
+9
−12
.rastrillo/budgets.txt+2 −2internal/equipo/chat/activity.go+5 −7internal/headless/browser_cards_test.go+1 −1internal/headless/projects_test.go+1 −1internal/thintest/activity_subjects_contract_test.go+0 −1
CI passed — run details
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 2bf39702..6a2ef244 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -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 25319 - The instance store shares transaction and authority helpers. Adds activity subject resolution beside task and catalog access. Measured 25319 source lines. |
| +size internal/equipo/chat 25317 - The instance store shares transaction and authority helpers. Adds activity subject resolution beside task and catalog access. Measured 25317 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. |
| @@ -71,7 +71,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im |
| 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 - 10352 End-to-end scenarios through a real runner and instance, browser drives and the Assistant's included. Measured 10352 test lines. |
| -size internal/thintest - 24566 Contract and browser tests share one instance harness. Adds activity subject privacy, plain tool labels, long titles and accessible text checks. Measured 24566 test lines. |
| +size internal/thintest - 24565 Contract and browser tests share one instance harness. Adds activity subject privacy, plain tool labels, long titles and accessible text checks. Measured 24565 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/internal/equipo/chat/activity.go b/internal/equipo/chat/activity.go| index e5acaa9c..ff52c5be 100644 |
| --- a/internal/equipo/chat/activity.go |
| +++ b/internal/equipo/chat/activity.go |
| @@ -2,7 +2,6 @@ package chat |
| import ( |
| "encoding/json" |
| - "slices" |
| "strings" |
| "amadan.net/oficina/equipo/internal/wire" |
| @@ -12,12 +11,11 @@ import ( |
| // the arguments. Arguments select records; only those records supply text. |
| func (t *txn) toolActivity(r turnRecord, call *wire.ToolCall) error { |
| tool := call.Name |
| - names := wire.ConverseTools |
| - if r.Lane != wire.LaneCoordinator { |
| - names = wire.AssistTools |
| - } |
| - if !slices.Contains(names, tool) { |
| - tool = "other" |
| + switch tool { |
| + case wire.ToolReadTask, wire.ToolCancelTask, wire.ToolAddReport, wire.ToolHoldMerge, wire.ToolStartTask, |
| + wire.ToolReadFile, wire.ToolSearchCode, wire.ToolAddProject, wire.ToolCreateProject, wire.ToolStarProject: |
| + default: |
| + return nil |
| } |
| a := wire.Activity{TurnID: r.ID, Attempt: r.Attempt, Kind: wire.ActivityTool, Tool: tool} |
| var in struct { |
diff --git a/internal/headless/browser_cards_test.go b/internal/headless/browser_cards_test.go| index 717baab0..5e94e05b 100644 |
| --- a/internal/headless/browser_cards_test.go |
| +++ b/internal/headless/browser_cards_test.go |
| @@ -63,7 +63,7 @@ func TestBrowserThinkingAndCards(t *testing.T) { |
| // The timer counts in seconds from the send; the line shows the |
| // latest activity, then gives way to the streamed reply. |
| send("think pause:2600 sleep:1500 tool:status\ntool:add_project:oficina/sample") |
| - run(browsertest.Wait(`(()=>{const l=document.querySelector('[equipo-thinking] [equipo-activity]');return !!l && l.textContent==='Adding a project…'})()`)) |
| + run(browsertest.Wait(`(()=>{const l=document.querySelector('[equipo-thinking] [equipo-activity]');return !!l && l.textContent==='Adding oficina/sample…'})()`)) |
| run(browsertest.Wait(`(()=>{const e=document.querySelector('[equipo-thinking] [equipo-elapsed]');return !!e && /^[1-9][0-9]*s$/.test(e.textContent)})()`)) |
| check(`!!document.querySelector('[equipo-thinking] [equipo-sparkle] svg') && [...document.querySelectorAll('[equipo-thinking] [equipo-phrase] [data-in] > span')].some(s=>getComputedStyle(s).animationName.includes('equipo-wave'))`, "no sparkle or wave") |
| check(`!document.querySelector('[equipo-thinking-dots]')`, "dots still shown") |
diff --git a/internal/headless/projects_test.go b/internal/headless/projects_test.go| index 7ff0762a..7e9a3d1f 100644 |
| --- a/internal/headless/projects_test.go |
| +++ b/internal/headless/projects_test.go |
| @@ -327,7 +327,7 @@ func scenarioProject(t *testing.T, env *Env) { |
| for _, a := range acts { |
| kinds = append(kinds, a.Kind+":"+a.Tool+":"+a.Label) |
| } |
| - want := []string{"thinking::Thinking", "tool:status:Checking your projects…", "tool:add_project:Adding a project…"} |
| + want := []string{"thinking::Thinking", "tool:status:Checking your projects…", "tool:add_project:Adding a project…", "tool:add_project:Adding oficina/sample…"} |
| if !slices.Equal(kinds, want) { |
| t.Fatalf("activity %q, want %q", kinds, want) |
| } |
diff --git a/internal/thintest/activity_subjects_contract_test.go b/internal/thintest/activity_subjects_contract_test.go| index 207a1246..725d1cba 100644 |
| --- a/internal/thintest/activity_subjects_contract_test.go |
| +++ b/internal/thintest/activity_subjects_contract_test.go |
| @@ -50,7 +50,6 @@ func TestContractActivitySubjects(t *testing.T) { |
| {"star", wire.ToolStarProject, map[string]any{"project": "oficina/sample", "starred": true}, "Starring oficina/sample…"}, |
| {"create-known", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/sample"}, "Creating oficina/sample…"}, |
| {"create-new", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/raw-input"}, "Creating a repository…"}, |
| - {"find", wire.ToolFind, map[string]string{"query": "/private/raw-input"}, "Looking for it…"}, |
| {"start", wire.ToolStartTask, map[string]string{"task": own}, "Handing ‘Project threads’ to Engineering…"}, |
| {"cancel", wire.ToolCancelTask, map[string]string{"task": own}, "Cancelling ‘Project threads’…"}, |
| } |