oficina / equipo Public

Housekeeping view browser test, page checks, budgets

TestBrowserHousekeeping at 1280 and 390: the view with evidence, Undo
in reach and quiet meters, the header link and the digest line, Undo
and Pause from the view. The contract tests read the scriptless pages
too. Budget records for the chat store, the instance and thintest; the
two new GET API routes are bearer-only JSON (perf skip).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 977915bc47e1c47080131d6d07072d4ee56fdf25 parent 820fa45
4 files changed, +126 −4
  • .rastrillo/budgets.txt +5 −3
  • internal/equipo/render.go +1 −1
  • internal/thintest/housekeeping_browser_test.go +106 −0
  • internal/thintest/housekeeping_contract_test.go +14 −0
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 96f747fe..c8c59530 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 14400 - The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here.
+size internal/equipo 14700 - Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here.
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); 60s gives 34 percent headroom. Shared baseline capture reduces repeated Go runs; retain the CI allowance for sandbox sentinels, timeout and child cleanup. 2026-11-07: loaded CI (host load about 24) measured 66.5s with the package unchanged by thin v1 slice 4 beyond optional check mounts; 90s keeps 35 percent headroom.
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). Parallel plan graphs and removal of repeated progress floods reduced their local targeted run from 146.920s to 30.784s; the original bug graph retains volume coverage. Keep 330s for journal, proxy, recovery and namespace integration, with 13 percent headroom.
@@ -36,7 +36,7 @@ perf GET /releases/* skip Verified runner release file downloads, not browser GE
time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; niced serial reruns measured 5.773s and 5.750s. The added coordinator mount check has no repeated launches to remove; 15s leaves 38 percent headroom for namespace, process-exit and recovery assertions.
time internal/tryequipo 30s Release starter-set controller K3 records CI runs of 10.8s and 13.1s; 30s retains the guide integration checks with headroom on the shared runner.
size internal/runner/thin 11500 - Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path.
-time internal/thintest 60s Thin v1 slice 4c adds the merge, adoption, cancel and retention contract tests (CI measured 35.7s). Thin v1 contract tests: a real instance and a scripted runner per test, fixtures replayed against every request, frame and event. Slice 3 adds the task, step-sync and grant contracts; CI measured 14.805s. 30s keeps room for the slice 4 review contracts. UX1 adds step activity, task source and duplicates, coordinator merging and project facts (four contracts, about 6s); the package measured 34s locally under load, so 40s. UX1's inner screens gallery (two owners, seven tasks, every page) adds about 3s; measured 40.9s locally under load, so 60s.
+time internal/thintest 75s Housekeeping slice 1 adds six contract tests (combine, Undo round trips and the race, Pause, auto-disable, quiet hours, restart while claimed; about 6s); the package measured 67.7s beside other packages locally, so 75s. Thin v1 slice 4c adds the merge, adoption, cancel and retention contract tests (CI measured 35.7s). Thin v1 contract tests: a real instance and a scripted runner per test, fixtures replayed against every request, frame and event. Slice 3 adds the task, step-sync and grant contracts; CI measured 14.805s. 30s keeps room for the slice 4 review contracts. UX1 adds step activity, task source and duplicates, coordinator merging and project facts (four contracts, about 6s); the package measured 34s locally under load, so 40s. UX1's inner screens gallery (two owners, seven tasks, every page) adds about 3s; measured 40.9s locally under load, so 60s.
time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). Measured 17.8s locally under load. Slice 4b review adds a 16 MiB git output bound, an injected index-pack failure and stall (3s deadline) and held-answer tests; measured 30.3s locally under load. 45s keeps 33 percent headroom.
time internal/headless 480s Connections slice 1 after Astra round 1 adds attempts that wait for a connection, Review on a refused credential, Codex Engineering and Review and the preference (about 90s more; loaded CI measured 6m42s). It first adds TestHeadlessConnections (usage rows, failover, Codex coordinator, device code, Claude sign-in, failure kinds, cancel and sign-out, writes replayed, Engineering and Review moving connection, the waiting turn): eleven scenarios, about 55 to 100s locally. Thin v1 headless suite: real instance, runner and bubblewrap per scenario (spec 7, under two minutes). Slice 4 adds the review and checks scenarios (4_review with its fix rounds, branch move and merge; 4_checks_honest); loaded CI measured 170s on 2026-11-07. Slice 4b adds 4b_ask (about 12s); loaded CI measured 182.9s. 240s keeps 30 percent headroom.
perf GET /api/v1/turns/{id} skip Thin v1 person API: bearer-only JSON for devices, not a browser screen.
@@ -48,7 +48,9 @@ perf GET /api/v1/projects skip Thin v1 person API: bearer-only JSON for devices;
perf GET /api/v1/notebook skip Thin v1 person API: bearer-only JSON for devices; the browser reads the notebook through /conversation/notebook.
perf GET /api/v1/tasks skip Thin v1 person API: bearer-only JSON for devices; the browser reads tasks through /tasks.
perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads a task through /tasks/{id}.
-size internal/equipo/chat 8200 - Thin v1 UX1 round 3 adds Equipo combining duplicate tasks reversibly (duplicates.go: detection, the in-transaction fold checks, fold, Undo, about 400 lines) and headlines on findings and steps (headline.go); measured 7898. Connections slice 1 adds connection records from hello and attempts, the connect mailbox, the API, usage rows and the turn's mutation ledger (connections.go and tools.go, about 600 lines); measured 7400 after merging UX1. Thin v1 UX1 adds step activity lines, duplicates and their fold, the coordinator at work on a task, project facts from the runner catalog and open merge cards for the pages (inner.go, about 330 lines); measured 6610 with slice 4c's review fixes. Thin v1 slice 4c adds the merge policy, the merge card, the rebase round and duplicate reports (merge.go, about 380 lines). Thin v1 instance core: conversation, projects, tasks, review and, from slice 4b, questions to the specialists (questions.go, about 470 lines) share one store, transaction and event log; splitting would export the transaction internals. Measured 5514 source lines; revisit at the slice 7 sweep.
+size internal/equipo/chat 9800 - Housekeeping slice 1 adds the loop's ledger and state machine, the housekeeping principal's checks inside the shared store functions, reservations, Pause, quiet hours, the digest, claim recovery and the API (housekeeping.go, housekeeping_control.go, housekeeping_http.go, about 1,350 lines); the checks must run inside the store's transactions, so they live beside them; the detectors themselves are pure, in internal/equipo/housekeeping. Measured 9637. Thin v1 UX1 round 3 adds Equipo combining duplicate tasks reversibly (duplicates.go: detection, the in-transaction fold checks, fold, Undo, about 400 lines) and headlines on findings and steps (headline.go); measured 7898. Connections slice 1 adds connection records from hello and attempts, the connect mailbox, the API, usage rows and the turn's mutation ledger (connections.go and tools.go, about 600 lines); measured 7400 after merging UX1. Thin v1 UX1 adds step activity lines, duplicates and their fold, the coordinator at work on a task, project facts from the runner catalog and open merge cards for the pages (inner.go, about 330 lines); measured 6610 with slice 4c's review fixes. Thin v1 slice 4c adds the merge policy, the merge card, the rebase round and duplicate reports (merge.go, about 380 lines). Thin v1 instance core: conversation, projects, tasks, review and, from slice 4b, questions to the specialists (questions.go, about 470 lines) share one store, transaction and event log; splitting would export the transaction internals. Measured 5514 source lines; revisit at the slice 7 sweep.
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.
+perf GET /api/v1/housekeeping skip Housekeeping slice 1 person API: bearer-only JSON for devices; the browser reads it through /housekeeping.
+perf GET /api/v1/housekeeping/actions skip Housekeeping slice 1 person API: bearer-only JSON for devices; the browser reads actions on /housekeeping.
diff --git a/internal/equipo/render.go b/internal/equipo/render.go
index 9b98ead4..8cd40a5f 100644
--- a/internal/equipo/render.go
+++ b/internal/equipo/render.go
@@ -33,7 +33,7 @@ var assets = rastrillo.NewAssets(appFS)
var pages = map[string]*template.Template{}
func init() {
- for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "work_tasks", "work_task", "work_projects", "work_project", "models", "work_needs"} {
+ for _, name := range []string{"person_devices", "person_device", "teams", "onboarding", "invite", "playbooks", "playbook_form", "playbook_diff", "specialist_form", "template_library", "template_diff", "conversation", "chat", "thread", "plan", "coordinator", "preferences", "index", "empty", "projects", "project", "project_form", "people", "settings", "specialist", "errors", "signin_page", "form_error", "runners", "tasks", "task", "task_form", "question", "merge", "connections", "recovery", "recovery_form", "rendered_approval", "notebook", "housekeeping", "work_tasks", "work_task", "work_projects", "work_project", "models", "work_needs"} {
page := template.Must(template.New("layout").
Funcs(ui.Funcs(ui.WithIcons(icons.Icon, icons.Assets))).
Funcs(template.FuncMap{"chatMarkdown": chatmarkdown.Render, "loadingLine": loadingLine, "split": strings.Split, "since": sinceMillis, "elapsed": elapsedText, "short": short, "agoData": agoData, "agoFormats": agoFormats, "projectAllows": library.ProjectAllowed, "asset": assets.Path, "copy": copyText, "taskGroups": func() []string { return []string{"needs-person", "running", "queued", "finished"} },
diff --git a/internal/thintest/housekeeping_browser_test.go b/internal/thintest/housekeeping_browser_test.go
new file mode 100644
index 00000000..26d2d833
--- /dev/null
+++ b/internal/thintest/housekeeping_browser_test.go
@@ -0,0 +1,106 @@
+//go:build browser
+
+package thintest
+
+import (
+ "fmt"
+ "testing"
+ "time"
+
+ "github.com/chromedp/chromedp"
+)
+
+// click activates the element selector finds, as a tap or a click does.
+func (p *innerPage) click(selector string) {
+ p.t.Helper()
+ p.check(`(()=>{const e=document.querySelector(`+jsString(selector)+`);if(!e)return false;e.click();return true})()`, "click "+selector)
+ p.do(chromedp.Sleep(50 * time.Millisecond))
+}
+
+// TestBrowserHousekeeping: the Housekeeping view and the digest line at
+// 1280 with a mouse and at 390 with touch. The view lists what Equipo
+// combined with its evidence and Undo in reach; today's three budgets are
+// quiet meters; the conversation's header leads to the view and the
+// digest line links there; Undo from the view restores the task; nothing
+// scrolls sideways. Screens are saved when EQUIPO_BROWSER_ARTIFACTS names
+// a directory (hk-<screen>-<width>.png).
+func TestBrowserHousekeeping(t *testing.T) {
+ r := newToolRig(t)
+ for i, title := range []string{"Swipe back from the edge doesn't work", "Timeline jumps when images load"} {
+ r.pair(fmt.Sprintf("b%d", i), title)
+ }
+ // The second pair's record_task combines the first; the sweep the
+ // second.
+ r.tidy()
+ if n := len(r.housekeeping().Actions); n != 2 {
+ t.Fatalf("combined %d", n)
+ }
+ // Tomorrow at 08:30 the digest line is written.
+ r.clock(time.Now().UTC().Add(24 * time.Hour).Truncate(24 * time.Hour).Add(8*time.Hour + 30*time.Minute))
+ r.tick()
+ r.inst.Store.Chat().SetHousekeepingClock(nil)
+
+ for _, size := range []struct {
+ w, h int64
+ touch bool
+ }{{1280, 900, false}, {390, 844, true}} {
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), size.w, size.h, size.touch, "light", "no-preference")
+
+ // The conversation: the header's way to the view, the digest line.
+ p.open("/conversation")
+ 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")
+ 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.wait(`document.querySelector('[data-housekeeping]')`, "the view")
+ // Settled, as opened directly (the phone slides the page in).
+ p.open("/housekeeping")
+ p.check(`document.querySelectorAll('[data-hk-meter]').length===3`, "three meters")
+ p.check(`document.querySelectorAll('[equipo-hk-action]').length===2`, "two actions")
+ p.check(`[...document.querySelectorAll('[equipo-hk-action] [equipo-hk-line]')].every(e=>e.textContent.includes('Combined'))`, "action lines")
+ p.check(`[...document.querySelectorAll('[equipo-hk-action] [equipo-hk-meta]')].every(e=>/\d+% alike, \d+ words in common/.test(e.textContent))`, "evidence")
+ p.check(`document.querySelectorAll('[data-detector]').length===2 && !document.querySelector('[data-detector][data-off]')`, "detectors on")
+ p.check(`!!document.querySelector('[data-hk-pause]')`, "Pause")
+ if size.touch {
+ p.check(`[...document.querySelectorAll('[data-hk-undo]')].every(b=>{const r=b.getBoundingClientRect();return r.height>=44&&r.width>0})`, "Undo within reach on touch")
+ } else {
+ p.check(`[...document.querySelectorAll('[data-hk-undo]')].every(b=>b.getBoundingClientRect().width>0)`, "Undo visible")
+ }
+ p.fits("housekeeping")
+ p.shot(fmt.Sprintf("hk-view-%d", size.w))
+ p.stop()
+ }
+
+ // Undo from the view: the action reads Undone and the task is back.
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), 1280, 900, false, "light", "no-preference")
+ defer p.stop()
+ p.open("/housekeeping")
+ id := eval[string](p, `document.querySelector('[equipo-hk-action]').dataset.action`)
+ p.click(`[data-action="` + id + `"] [data-hk-undo]`)
+ p.wait(`document.querySelector('[data-action="`+id+`"][data-undone]')`, "the action undone")
+ p.check(`!document.querySelector('[data-action="`+id+`"] [data-hk-undo]')`, "no Undo after Undo")
+ p.check(`document.querySelector('[data-action="`+id+`"] [data-hk-state]').textContent==='Undone'`, "state words")
+ a := r.housekeeping()
+ for _, x := range a.Actions {
+ if x.ID == id {
+ if k, _ := r.client.Task(r.ctx, x.Subject.ID); k.Folded != nil {
+ t.Fatal("Undo from the view did not restore the task")
+ }
+ }
+ }
+ p.shot("hk-view-undone-1280")
+
+ // Pause from the view.
+ p.click(`[data-hk-pause]`)
+ p.wait(`document.querySelector('[data-housekeeping][data-paused] [data-hk-resume]')`, "paused")
+ if h := r.housekeeping(); !h.Paused {
+ t.Fatal("Pause from the view did not take")
+ }
+ p.shot("hk-view-paused-1280")
+}
diff --git a/internal/thintest/housekeeping_contract_test.go b/internal/thintest/housekeeping_contract_test.go
index 72752bc4..27755a52 100644
--- a/internal/thintest/housekeeping_contract_test.go
+++ b/internal/thintest/housekeeping_contract_test.go
@@ -123,6 +123,17 @@ func TestContractHousekeepingCombine(t *testing.T) {
if err != nil || snap.HousekeepingSummary.Paused || len(snap.HousekeepingSummary.Disabled) != 0 {
t.Fatalf("summary: %+v %v", snap.HousekeepingSummary, err)
}
+ // The view beside the Notebook, scriptless: the action, its evidence
+ // and Undo; the conversation's header leads there.
+ view := r.inst.Get(t, "/housekeeping")
+ for _, want := range []string{`data-action="` + a.ID + `"`, "data-hk-undo", "Combined “Swipe back from the edge", "words in common", "data-hk-pause", `data-detector="duplicate_same_creator"`} {
+ if !strings.Contains(view, want) {
+ t.Fatalf("view lacks %q", want)
+ }
+ }
+ if !strings.Contains(r.inst.Get(t, "/conversation"), "data-housekeeping-link") {
+ t.Fatal("no way from the conversation to the view")
+ }
// A teammate sees none of it, and cannot undo it.
member := personToolRig(t, r, "member@example.com", equipo.RoleMember)
if mh, err := member.client.Housekeeping(r.ctx); err != nil || len(mh.Actions) != 0 {
@@ -341,6 +352,9 @@ func TestContractHousekeepingAutoDisable(t *testing.T) {
t.Fatalf("digest: %+v", digests)
}
shape(t, "api/card-digest.json", digests[0])
+ if !strings.Contains(r.inst.Get(t, "/conversation"), `data-digest-link`) {
+ t.Fatal("the digest line is not on the conversation page")
+ }
r.clock(next.Add(24 * time.Hour))
r.tick()
n := 0