oficina / equipo Public

Organise conversation into collapsible project threads

The two receipt and task card browser tests broke because of the new grouping. When a request in the General conversation added a project, its confirmation card moved into that project's group, which put the card below the reply it belongs with. Now a card always stays with the request that produced it, and only a card with no such request is grouped by the project it links to. The size check failed because this feature pushed four parts of the code a few lines over their recorded limits, so I raised those limits to the measured sizes and noted why.

The shell refused every command again this round, so I couldn't run the browser tests or the size check, and these fixes are unverified until CI runs again. One trade-off: a card from an older General request that links a project now shows in General, next to its reply, not in that project's group.

Equipo task tkr23w5r4zb5, Engineering step attempt 1.
Equipo Engineering pushed by equipo-docs-t1 agent, operated by paul@keymail.dev 53aee010865518187746e73a167ceb978cded83e parent 9894dbc
3 files changed, +18 −12
  • .rastrillo/budgets.txt +4 −4
  • internal/equipo/static/project-threads.js +7 −4
  • release/project-threads/project-threads.js +7 −4

CI failed — run details

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index ede727ab..5df19b43 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,8 +14,8 @@ 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 19439 - The instance web layer: pages, handlers, templates and every screen's copy, the Assistant's and the models list included, and provider wiring. Measured 19439 source lines.
-size internal/wire 5966 - The runner and person API protocol: every frame, resource and downgrade up to protocol 19 (18 models, 19 the Assistant), one package so Encode sees every type. Measured 5966 source lines.
+size internal/equipo 19441 - The instance web layer: pages, handlers, templates and every screen's copy, the Assistant's and the models list included, and provider wiring. Project threads added 2. Measured 19441 source lines.
+size internal/wire 5969 - The runner and person API protocol: every frame, resource and downgrade up to protocol 19 (18 models, 19 the Assistant), one package so Encode sees every type. A message's project scope added 3. Measured 5969 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);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
@@ -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 25235 - The instance store: tasks, steps, cards, merges, housekeeping, metered connections and models, Research, scheduler, sites, and the Assistant's lane and hand-off. Measured 25235 source lines.
+size internal/equipo/chat 25263 - The instance store: tasks, steps, cards, merges, housekeeping, metered connections and models, Research, scheduler, sites, and the Assistant's lane and hand-off. Project-scoped messages added 28. Measured 25263 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,7 +70,7 @@ 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 - 10352 End-to-end scenarios through a real runner and instance, browser drives and the Assistant's included. Measured 10352 test lines.
+size internal/headless - 10406 End-to-end scenarios through a real runner and instance, browser drives and the Assistant's included. Project threads added 54. Measured 10406 test lines.
size internal/thintest - 24433 Thin v1 contract and page tests, the Assistant's (hand-off, outcome, ledger cases) and the models' included; one package keeps one instance harness. Measured 24433 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.
diff --git a/internal/equipo/static/project-threads.js b/internal/equipo/static/project-threads.js
index 99baf1fb..a1063412 100644
--- a/internal/equipo/static/project-threads.js
+++ b/internal/equipo/static/project-threads.js
@@ -78,18 +78,21 @@
observer.disconnect();
group('');
Object.keys(known).forEach(group);
- feed.querySelectorAll('[data-project-id][data-turn-id], [data-project-id][data-turn]').forEach(function (n) {
+ // A turn belongs where its messages are; an unscoped turn is General's.
+ feed.querySelectorAll('[data-turn-id], [data-turn]').forEach(function (n) {
var turn = n.dataset.turnId || n.dataset.turn;
- if (turn && n.dataset.projectId && !n.hasAttribute('data-card')) turns[turn] = n.dataset.projectId;
+ if (turn && !n.hasAttribute('data-card')) turns[turn] = n.dataset.projectId || turns[turn] || '';
});
// Keep General's day navigation and history in their original order.
Array.from(feed.children).forEach(function (n) {
if (!n.hasAttribute('data-project-thread')) groups[''].list.append(n);
});
// Snapshot the elements before moving them, preserving their order within
- // each project, including cards before/after the reply that produced them.
+ // each project. A card stays with the turn that produced it, so it never
+ // lands below that turn's reply; only a card without one uses its link.
Array.from(feed.querySelectorAll('[data-message], [data-card], [equipo-thinking], [data-ended]')).forEach(function (n) {
- var id = n.dataset.projectId || (!n.hasAttribute('data-card') && turns[n.dataset.turnId || n.dataset.turn]) || '';
+ var turn = n.dataset.turnId || n.dataset.turn;
+ var id = turn && turns.hasOwnProperty(turn) ? turns[turn] : n.dataset.projectId || '';
if (!known[id]) id = '';
var g = group(id);
if (id === '' && g.list.contains(n)) return;
diff --git a/release/project-threads/project-threads.js b/release/project-threads/project-threads.js
index 99baf1fb..a1063412 100644
--- a/release/project-threads/project-threads.js
+++ b/release/project-threads/project-threads.js
@@ -78,18 +78,21 @@
observer.disconnect();
group('');
Object.keys(known).forEach(group);
- feed.querySelectorAll('[data-project-id][data-turn-id], [data-project-id][data-turn]').forEach(function (n) {
+ // A turn belongs where its messages are; an unscoped turn is General's.
+ feed.querySelectorAll('[data-turn-id], [data-turn]').forEach(function (n) {
var turn = n.dataset.turnId || n.dataset.turn;
- if (turn && n.dataset.projectId && !n.hasAttribute('data-card')) turns[turn] = n.dataset.projectId;
+ if (turn && !n.hasAttribute('data-card')) turns[turn] = n.dataset.projectId || turns[turn] || '';
});
// Keep General's day navigation and history in their original order.
Array.from(feed.children).forEach(function (n) {
if (!n.hasAttribute('data-project-thread')) groups[''].list.append(n);
});
// Snapshot the elements before moving them, preserving their order within
- // each project, including cards before/after the reply that produced them.
+ // each project. A card stays with the turn that produced it, so it never
+ // lands below that turn's reply; only a card without one uses its link.
Array.from(feed.querySelectorAll('[data-message], [data-card], [equipo-thinking], [data-ended]')).forEach(function (n) {
- var id = n.dataset.projectId || (!n.hasAttribute('data-card') && turns[n.dataset.turnId || n.dataset.turn]) || '';
+ var turn = n.dataset.turnId || n.dataset.turn;
+ var id = turn && turns.hasOwnProperty(turn) ? turns[turn] : n.dataset.projectId || '';
if (!known[id]) id = '';
var g = group(id);
if (id === '' && g.list.contains(n)) return;