Merge main into runner-startup-logs
Brings in browser-timing and turn-batching (b6c6268) before hosted CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 files changed,
+2,769
−800
.amadan/ci.d/05-copy+5 −0.amadan/ci.d/{20-check@23 => 20-check@28}+5 −3.rastrillo/budgets.txt+3 −3Makefile+4 −2docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+1 −0docs/superpowers/plans/HOSTED-CI-PROGRESS.md+21 −3docs/superpowers/plans/TURNBATCH-PROGRESS.md+98 −0docs/superpowers/specs/2026-11-06-equipo-thin-v1.md+23 −0docs/superpowers/specs/2026-11-11-equipo-turn-batching.md+133 −0internal/equipo/chat/attachments.go+9 −6internal/equipo/chat/runner.go+5 −1internal/equipo/chat/store.go+107 −7internal/equipo/chat/stream.go+8 −1internal/equipo/chat_page.go+5 −1internal/equipo/copy.go+1 −0internal/equipo/static/chat-stream.js+2 −1internal/equipo/templates/chat.html+1 −1internal/equipotest/browser_test.go+0 −190internal/equipotest/chat_browser_test.go+0 −142internal/equipotest/chat_style_browser_test.go+0 −40internal/equipotest/foundation_test.go+1 −1internal/equipotest/optimistic_browser_test.go+0 −82internal/equipotest/task_browser_test.go+0 −92internal/fakeclaude/fake.go+34 −1internal/headless/batching_test.go+188 −0internal/headless/browser_review_test.go+10 −7internal/headless/browser_thread_test.go+3 −1internal/plan3test/conversation_layout_browser_test.go+0 −118internal/plan3test/conversation_layout_test.go+0 −17internal/plan3test/teams_navigation_browser_test.go+6 −2internal/testci/box_test.go+36 −0internal/thintest/batching_contract_test.go+429 −0internal/thintest/instance_contract_test.go+2 −2internal/thintest/instant_browser_test.go+5 −0internal/thintest/settings_browser_test.go+5 −4internal/thintest/thinking_browser_test.go+75 −28scripts/ci-box.py+154 −2scripts/ci-chromium-pin.py+146 −0scripts/ci-chromium.json+1,090 −0scripts/ci-test.py+154 −14scripts/runner-reference-allowlist.json+0 −28
CI passed — run details
diff --git a/.amadan/ci.d/05-copy b/.amadan/ci.d/05-copy| new file mode 100755 |
| index 00000000..4176a80c |
| --- /dev/null |
| +++ b/.amadan/ci.d/05-copy |
| @@ -0,0 +1,5 @@ |
| +#!/bin/sh |
| +# Copy that is still marked COPY REVIEW REQUIRED in internal/equipo/copy.go |
| +# fails here, in seconds, and not at the staging build: make release runs |
| +# the same check (copy-release-check) before it builds anything. |
| +exec "$(dirname "$0")/../../scripts/ci-box.py" run make copy-release-check |
diff --git a/.amadan/ci.d/20-check@23 b/.amadan/ci.d/20-check@28| similarity index 65% |
| rename from .amadan/ci.d/20-check@23 |
| rename to .amadan/ci.d/20-check@28 |
| index d74e82b6..8bd34ec1 100755 |
| --- a/.amadan/ci.d/20-check@23 |
| +++ b/.amadan/ci.d/20-check@28 |
| @@ -1,7 +1,9 @@ |
| #!/bin/sh |
| -# Everything but perf, as 23 shards side by side; AMADAN_SHARD picks one |
| -# (scripts/ci-test.py: LANES, then EXTRA_SHARDS). Seventeen test lanes of |
| -# about a minute each. Then the quarantine: known flaky tests |
| +# Everything but perf, as 28 shards side by side; AMADAN_SHARD picks one |
| +# (scripts/ci-test.py: LANES, BROWSER_LANES, then EXTRA_SHARDS). Seventeen |
| +# test lanes of about a minute each. Then five browser lanes: the |
| +# -tags browser tests, each driving the pinned headless Chromium |
| +# (scripts/ci-chromium.json). Then the quarantine: known flaky tests |
| # (scripts/ci-quarantine.txt), kept out of the lanes. Then runner-host: the exact bubblewrap build, |
| # the pinned programs, real namespaces and the cgroup move, uncached. Then |
| # the static checks: build, vet, format, budgets, references and the |
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 34eb197f..760bc054 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -49,7 +49,7 @@ perf GET /api/v1/notebook skip Thin v1 person API: bearer-only JSON for devices; |
| perf GET /api/v1/thinking skip Thin v1 person API: bearer-only JSON for devices; the browser reads thinking words on /settings/thinking. |
| 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 14050 - The re-run ruling (recheckMayMerge, refreshAfterRecheck, about 70 lines); measured 13981. Merge authority thin v1 adds the gate's store side (mergeauth.go: authorizeMerge before dispatch and at each hub request, the fence for runners below the merge-facts protocol, the ask card in Equipo's words, the ships question, receipts with Undo, the policy tool and API, about 1000 lines); the gate is pure, in internal/equipo/mergegate, but its inputs and audit must be read and written inside the store's transactions. Measured 13204. Mac recheck runs a waiting task's needs_macos checks again when a Mac that fits arrives (macrecheck.go, about 90 lines); measured 12485. Spend 1 merged onto Projects UX: measured 12376 with both. Spend 1 adds a task's spend from its usage rows (TaskSpend, about 60 lines) and the usage rows' round; measured 12047. Projects UX adds per-person project stars with the auto-star reconciliation, the person's and the coordinator's star_project (stars.go, about 210 lines) and the project's own repository in its view; measured 12206. Claude's sign-in by a link adds the code route beside the token's in SendSecret, the sign-in prompt and the kind it becomes (about 40 lines); measured 11933. Mac runners slices A and B add per-runner mailboxes, placement, withdrawal, the offline rule, the runners view, transfers and publication (runners.go, transfers.go, about 1100 lines). Composer attachments add uploads, the message link, the mailbox relay with chunk frames hydrated from the stored file, and serving (attachments.go, attachments_http.go, about 330 lines); the link and relay run inside the send and dispatch transactions, so they live beside them; sniffing and stripping are pure, in internal/attach. Measured 10292. Merged with UX1 thinking words (f2602d3), measured 9801. 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 thinking words adds the per-person set and its API (thinking.go, about 100 lines); measured 8305. Connections slice 1 review round 2: the mutation ledger matches record_task by subject only and refuses an ambiguous call with the earlier operations, the preference and forget (about 120 lines); measured 8236. 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 14100 - Turn batching adds turnText, the frame fit (fitTail, batchFull) and the stranded-turn recovery in sync (about 115 lines); measured 14095. The re-run ruling (recheckMayMerge, refreshAfterRecheck, about 70 lines); measured 13981. Merge authority thin v1 adds the gate's store side (mergeauth.go: authorizeMerge before dispatch and at each hub request, the fence for runners below the merge-facts protocol, the ask card in Equipo's words, the ships question, receipts with Undo, the policy tool and API, about 1000 lines); the gate is pure, in internal/equipo/mergegate, but its inputs and audit must be read and written inside the store's transactions. Measured 13204. Mac recheck runs a waiting task's needs_macos checks again when a Mac that fits arrives (macrecheck.go, about 90 lines); measured 12485. Spend 1 merged onto Projects UX: measured 12376 with both. Spend 1 adds a task's spend from its usage rows (TaskSpend, about 60 lines) and the usage rows' round; measured 12047. Projects UX adds per-person project stars with the auto-star reconciliation, the person's and the coordinator's star_project (stars.go, about 210 lines) and the project's own repository in its view; measured 12206. Claude's sign-in by a link adds the code route beside the token's in SendSecret, the sign-in prompt and the kind it becomes (about 40 lines); measured 11933. Mac runners slices A and B add per-runner mailboxes, placement, withdrawal, the offline rule, the runners view, transfers and publication (runners.go, transfers.go, about 1100 lines). Composer attachments add uploads, the message link, the mailbox relay with chunk frames hydrated from the stored file, and serving (attachments.go, attachments_http.go, about 330 lines); the link and relay run inside the send and dispatch transactions, so they live beside them; sniffing and stripping are pure, in internal/attach. Measured 10292. Merged with UX1 thinking words (f2602d3), measured 9801. 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 thinking words adds the per-person set and its API (thinking.go, about 100 lines); measured 8305. Connections slice 1 review round 2: the mutation ledger matches record_task by subject only and refuses an ambiguous call with the earlier operations, the preference and forget (about 120 lines); measured 8236. 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. |
| @@ -61,6 +61,6 @@ perf GET /conversation/attachments/{id} skip Composer attachments: the bytes of |
| perf GET /conversation/attachments/{id}/preview skip Composer attachments: an image thumbnail inside the conversation; 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 Mac runners slice B: TestReleaseRunnerHasNoFakeWorker builds the release runner exactly as make release-runner does and the thin package under the testbuild tag (measured 11.9s locally with a warm cache). |
| -size internal/headless - 8400 Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. |
| -size internal/thintest - 13196 The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. |
| +size internal/headless - 8523 Turn batching merged onto the browser lane: measured 8523. Turn batching adds TestHeadlessTurnBatching (three messages behind a slow turn through the real runner and fake CLI: the one next turn, its input, the bubbles and note, the usage rows and the spend lines) and TestHeadlessBatchAfterRefusedReply (the real runner reconnects after a refused reply), about 190 lines; measured 8518. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. |
| +size internal/thintest - 13678 Turn batching merged onto the ThinkingCycles clock fix (the drive takes a still clock and the page's record of each phrase, about 50 lines): measured 13678. Turn batching merged onto the browser lane: measured 13631. Turn batching adds its contracts (the crash between turns, the stranded recovery, failed, cancelled, interrupted and retried turns, the cancelled batch, the note clearing, batches split to fit one frame and the failed batch's note; about 430 lines); measured 13630 with the ship buttons merged. The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. |
| 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}. |
diff --git a/Makefile b/Makefile| index 43617000..f12af546 100644 |
| --- a/Makefile |
| +++ b/Makefile |
| @@ -94,7 +94,9 @@ budget: |
| # LANE=headless-work runs one; scripts/ci-test.py lanes lists them), with |
| # test-quarantine, runner-host and the static checks as further shards. |
| # Known flaky tests are quarantined (scripts/ci-quarantine.txt): skipped |
| -# here and run by test-quarantine. |
| +# here and run by test-quarantine. The browser tests (-tags browser) run |
| +# after the rest, as their own lanes on CI; they need a Chromium |
| +# (RASTRILLO_CHROME, or one on PATH). |
| # |
| # A failed test is retried once, in the lane where it failed. A pass on |
| # the retry keeps the lane green and prints a FLAKE line (the test, the |
| @@ -233,7 +235,7 @@ runner-host: runner-adapter-test runner-namespace-test |
| # fails the build the moment models.go and migrations/ disagree, |
| # instead of at boot on whatever machine notices next. If the app |
| # declares manifest resources, also add: rastrillo generate --check |
| -ci: runner-dead-references build vet fmt-check staticcheck govulncheck gitleaks budget test test-quarantine runner-host migration-check perf |
| +ci: copy-release-check runner-dead-references build vet fmt-check staticcheck govulncheck gitleaks budget test test-quarantine runner-host migration-check perf |
| .PHONY: copy-release-check direct-release-check release-runner runner-prerequisites |
| copy-release-check: |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 2c7fd9e6..3338f454 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -5995,6 +5995,7 @@ records remain unchanged. |
| | `teams.undo` | Undo | Settings UX pass (Paul, 2026-11-11): Teams, after Forget | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `chat.activity.star_project` | Starring a project… | Coordinator activity (projects-ux) | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `chat.queued` | Waiting its turn | Conversation: the note under a message sent while a turn runs (thinking-stale hot fix) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| +| `chat.failed_many` | The coordinator could not answer these messages. | Conversation: the note when a turn that covered several messages fails (turn batching) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `work.reason.provider_failed` | the model connection failed | Tasks: why a step stopped (projects-ux) | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `work.reason.provider_rejected` | the model service declined the request | Tasks: why a step stopped (projects-ux) | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
| | `work.reason.policy_rejected` | Equipo's rules blocked it | Tasks: why a step stopped (projects-ux) | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) | |
diff --git a/docs/superpowers/plans/HOSTED-CI-PROGRESS.md b/docs/superpowers/plans/HOSTED-CI-PROGRESS.md| index b2638013..27f19a2c 100644 |
| --- a/docs/superpowers/plans/HOSTED-CI-PROGRESS.md |
| +++ b/docs/superpowers/plans/HOSTED-CI-PROGRESS.md |
| @@ -57,6 +57,23 @@ between two delegated cgroups. So: |
| check that they are the right sources. |
| - **A missing pinned program fails on CI** instead of skipping |
| (`testci.Absent`, `EQUIPO_TEST_TOOLS_REQUIRED=1` set by the box). |
| +- **Chromium for the browser tests.** The `//go:build browser` tests |
| + run on CI in their own lanes (`BROWSER_LANES` in `scripts/ci-test.py`, |
| + `-tags browser,testbuild`, only the tests that tag adds, found with go |
| + list so a new one always runs; `scripts/ci-test.py lanes` prints them). |
| + The browser is Debian 13's `chromium-headless-shell`, pinned with |
| + every library it needs that a Debian image lacks: about 75 packages, |
| + 155 MB, in `scripts/ci-chromium.json`, each by snapshot.debian.org URL |
| + and SHA-256. Chrome for Testing has no Linux arm64 build; Debian builds |
| + both. `ci-box.py prepare` unpacks them into one tree, mounted at |
| + `/opt/chromium-<version>`, and the box sets `RASTRILLO_CHROME` to its |
| + launcher, which `harness.ChromePath` reads first. Raise it with |
| + `scripts/ci-chromium-pin.py VERSION SNAPSHOT SECURITY_SNAPSHOT`. The |
| + quarantine runs a quarantined browser test with the browser tag. |
| + Five browser drives of pre-thin pages (four in equipotest, |
| + TestConversationLayout in plan3test) failed every time once they ran; |
| + they were deleted, and their pages are on the slice 7 sweep list |
| + (thin v1 spec §8). |
| ## Caches across fresh machines |
| @@ -81,9 +98,10 @@ between two delegated cgroups. So: |
| | step | what | |
| |---|---| |
| -| `00-prepare` | fetch and verify the pinned programs, pull the image, deepen the clone, set file times | |
| -| `10-compile` | compile every package and its tests once, link no test; build rastrillo and the static check tools | |
| -| `20-check@23` | 17 test lanes, the quarantine, `runner-host` (bubblewrap build, pinned codex, namespaces, cgroup move, uncached), and the static checks in four groups; a failed test is retried once | |
| +| `00-prepare` | fetch and verify the pinned programs and Chromium, pull the image, deepen the clone, set file times | |
| +| `05-copy` | `make copy-release-check`: copy still marked COPY REVIEW REQUIRED fails here, not at the staging build | |
| +| `10-compile` | compile every package and its tests once (the browser packages with `-tags browser` too), link no test; build rastrillo and the static check tools | |
| +| `20-check@28` | 17 test lanes, 5 browser lanes, the quarantine, `runner-host` (bubblewrap build, pinned codex, namespaces, cgroup move, uncached), and the static checks in four groups; a failed test is retried once | |
| | `50-perf` | alone, it measures time | |
| | `90-cache` | report and trim the caches | |
diff --git a/docs/superpowers/plans/TURNBATCH-PROGRESS.md b/docs/superpowers/plans/TURNBATCH-PROGRESS.md| new file mode 100644 |
| index 00000000..b5e2a8f1 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/TURNBATCH-PROGRESS.md |
| @@ -0,0 +1,98 @@ |
| +# Turn batching: progress |
| + |
| +Branch `turn-batching` from main 03f8a91. Design note: |
| +`docs/superpowers/specs/2026-11-11-equipo-turn-batching.md`. |
| + |
| +## Done |
| + |
| +1. **Finding.** The instance already batched messages sent during a turn |
| + into one next turn (64cd2ce). The gap was that the messages were not |
| + distinct: `Text` was the words joined by blank lines, and the files |
| + were one list for the whole turn. |
| +2. **Change** (instance only, no wire, fixture or migration change): |
| + `turnText` sets each message of a batch apart, with its files. `sync` |
| + starts a stranded queued turn. |
| +3. **Failing first.** `TestHeadlessTurnBatching` (real runner, fake CLI, |
| + thintest instance) failed on main for the input check. The output is |
| + in commit fd22d42. |
| +4. **Contracts** (`internal/thintest/batching_contract_test.go`, protocol |
| + 1 runner): `TestBatchCrashBetweenTurns`, `TestBatchStrandedRecovers`, |
| + `TestBatchAfterTurnEnds` (failed, cancelled, interrupted), |
| + `TestBatchWaitsForRetriedTurn`, `TestBatchCancelledWhileWaiting`, |
| + `TestBatchMarkerClearsTogether`, `TestBatchSplitsToFitTheFrame`, and |
| + headless `TestHeadlessBatchAfterRefusedReply` (real runner). |
| +5. **Astra round 1** (gpt-6-astra, high): REQUEST CHANGES, three |
| + Important findings. |
| + - Oversized batches could exceed the 256 KiB frame, and the runner |
| + would refuse them on every resend. Fixed: batches split to fit, the |
| + tail is trimmed to fit, and a waiting batch is kept out of an |
| + earlier batch's tail. |
| + - A store error on a runner frame closed with `CloseRevoked`, which |
| + stops a real runner. Fixed: the close is now 1011 (retryable); |
| + `ErrForbidden` still closes `CloseRevoked`. |
| + - Queued marker on each bubble: this is a product question, left for |
| + the controller. The branch keeps the single note from the |
| + thinking-stale fix. |
| +6. **Rulings.** No hold between turns, and the single note stays. |
| + `chat.failed_many` ("The coordinator could not answer these |
| + messages.") is added for a failed batch, on the page and from the |
| + event stream. Delegated Astra copy pass: KEEP, marked COPY ACCEPTED BY |
| + DELEGATION (Astra, 2026-11-11) in copy.go and the Plan 3 inventory. |
| + Mutations: drop the page's batch case and `TestBatchFailedSaysThemAll` |
| + dies ("a failed batch lacks the note for its messages"); drop the |
| + script's and `TestBrowserInstantThinkingQueued` dies ("waiting for the |
| + failed batch's note"). |
| +7. **Merged origin/main** 42a31cb (ship buttons). The budgets conflict |
| + was resolved by keeping both reasons (internal/thintest at 13600, then 13630 with the plural note). |
| + |
| +## Mutations |
| + |
| +Each guard was broken once, with the targeted runs below, then restored. |
| +Command: `CGO_ENABLED=0 nice -n 10 go test ./internal/thintest -run |
| +'^(TestBatch|TestQueuedMessagesJoinOneTurn$)'` and, where shown, `go test |
| +./internal/headless -run '^TestHeadlessTurnBatching$'`. |
| + |
| +| Guard | Mutation | Died | |
| +|---|---|---| |
| +| Ordering | dispatch reads the batch `seq DESC` | thintest: CrashBetweenTurns "batch lacks alpha in place", StrandedRecovers and others; headless: "turn input lacks Message 1 of 3" | |
| +| Distinct messages | `turnText` joins the words as before | the same tests in both packages | |
| +| One next turn | every message opens a turn of its own (`fresh := true`) | thintest: "message 2: ... MessageIDs:[one id]" in every TestBatch | |
| +| One at a time (send) | a message dispatches beside the running turn | thintest: "message 2" in every TestBatch | |
| +| One at a time (end and recovery) | `dispatchNext` ignores a turn in flight | thintest: CrashBetweenTurns, the batch frame arrived during the held turn | |
| +| Atomic end and next | `reply` commits when the next dispatch fails | thintest: CrashBetweenTurns "the reply was acked with the next turn refused" | |
| +| Recovery | `sync` no longer calls `dispatchNext` | thintest: StrandedRecovers "no next turn" | |
| +| Marker clearing | the line's holder may be a turn that ended | thintest: MarkerClearsTogether "the note stayed after the turn picked the messages up" (headless survives: its runner acks at once) | |
| +| One note | every waiting bubble gets the note | thintest: MarkerClearsTogether; headless: "queued note not once under the latest message" | |
| +| Frame fit (split) | a batch never fills up | thintest: SplitsToFitTheFrame "12 large messages made batches of [one]" | |
| +| Frame fit (tail) | the tail is never trimmed | thintest: SplitsToFitTheFrame "message too big: read limited at 262145 bytes" | |
| +| Tail excludes waiting batches | the tail takes every other turn's messages | thintest: SplitsToFitTheFrame "batch 1's tail holds a message still waiting" | |
| +| Retryable close | a failed frame closes `CloseRevoked` again | headless: BatchAfterRefusedReply "runner stopped: runner credential refused" | |
| + |
| +## Spend (fake CLI, input tokens are prompt length / 4) |
| + |
| +| Case | Turns after the slow one | Input tokens | |
| +|---|---|---| |
| +| main, three messages during a slow turn | 1 | 102 | |
| +| this branch, the same | 1 | 154 (+52 for the batch line and headers) | |
| +| the same three words, each after the last reply | 3 | 2, 3, 3 | |
| + |
| +The fake does not model the fixed context every real turn pays (about |
| +17k input tokens on staging, 77% cached), so the third row understates |
| +real spend: three turns pay that context three times, and a batch pays |
| +it once. Usage stays per turn: one row for the batch turn and none for |
| +any single message (`TestHeadlessTurnBatching`). |
| + |
| +## Verification |
| + |
| +- Targeted: the contracts above, `TestQueuedMessagesJoinOneTurn`, |
| + `TestCancel`, `TestMailboxResendAndGenerations`, `TestDrainAndRestart`, |
| + `TestSecondaryRunnerSyncIgnored`, `TestContractAttachments`, |
| + `TestContractStorageFullInWords`, the move-in contracts, |
| + `TestContractConversation`, `TestSendIdempotency`, `TestChatPage`, |
| + `TestReplacedConnectionFenced`, headless `6_quick_messages`. |
| +- Browser, one at a time: `TestBrowserInstantThinking*`, |
| + `TestBrowserThinkingLinesClear`, `TestBrowserDraftStreamsFormatted`. |
| + All pass. |
| +- `make budget`, vet, staticcheck on the changed packages, and |
| + `TestReleaseCopyReviewed` with `EQUIPO_RELEASE_COPY_CHECK=1` (no UI |
| + strings changed). |
diff --git a/docs/superpowers/specs/2026-11-06-equipo-thin-v1.md b/docs/superpowers/specs/2026-11-06-equipo-thin-v1.md| index 25e103f4..e6f2d8c1 100644 |
| --- a/docs/superpowers/specs/2026-11-06-equipo-thin-v1.md |
| +++ b/docs/superpowers/specs/2026-11-06-equipo-thin-v1.md |
| @@ -339,6 +339,29 @@ journal, `runner/journal*.go`, `supervisor.go`, `witness.go`, `planflow`, |
| about 35,000 lines. Security regression tests are ported first (§5) and old |
| suites deleted last. |
| +Their browser drives went first (ci-browser-lane, 2026-11-11): once CI |
| +ran them they failed every time against the thin pages, so they were |
| +deleted, and the pre-thin pages they covered go in this sweep with them: |
| + |
| +- `TestFoundationBrowserWalk` (equipotest): the old rail destinations |
| + (`railPaths` in equipotest: `/journey`, `/needs-you`, `/specialists/*`, |
| + `/playbooks`, `/templates`, `/preferences`, `/settings/coordinator`, |
| + `/connections`, `/settings`), `/work`, `/projects/accounts` and its |
| + `/accounts` form, the old project form (`/projects/new`, |
| + `/projects/{id}/edit`) and the empty pre-thin `/conversation`. |
| +- `TestChatBrowser` (equipotest): the pre-thin conversation page |
| + (coordinator and specialist messages, `#conversation-feed`) and |
| + `/tasks/{id}/thread`. |
| +- `TestOptimisticChat` (equipotest): the pre-thin chat's optimistic send |
| + into `#conversation-feed`. |
| +- `TestRunnerTaskBrowserWalk` (equipotest): the pre-thin task page |
| + (`taskDetail`, page key `journey`), `/tasks/new` and its scriptless form, |
| + `/settings/recovery` and `/settings/recovery/release`, the specialist |
| + instruction pages. |
| +- `TestConversationLayout` (plan3test, and its `!browser` stub): plan 3's |
| + conversation layout, messages through the pre-thin conversation store, |
| + and the plan proposal page `/tasks/{id}/plan`. |
| + |
| Each slice lands headless first (contracts, runner, fake scenario green in CI |
| and on staging with real CLIs), then UI, then deploy; Paul says hello. |
diff --git a/docs/superpowers/specs/2026-11-11-equipo-turn-batching.md b/docs/superpowers/specs/2026-11-11-equipo-turn-batching.md| new file mode 100644 |
| index 00000000..3781e591 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-11-11-equipo-turn-batching.md |
| @@ -0,0 +1,133 @@ |
| +# Equipo turn batching |
| + |
| +2026-11-11, branch `turn-batching` from main 03f8a91. |
| + |
| +## What happens today |
| + |
| +The instance already batches. This has been the case since the first thin |
| +v1 commit (64cd2ce, the thin v1 spec's §2 "Second message rule", tested by |
| +`TestQueuedMessagesJoinOneTurn` and headless scenario 6). |
| + |
| +1. `chatSend` (the page) and `POST /api/v1/messages` (devices) both call |
| + `Store.Send`, then `txn.send` in one write transaction. |
| +2. `send` looks for the person's queued, undispatched person turn. If it |
| + finds one, the message joins it. If not, it creates a new turn |
| + (`chat_turns`, state `queued`). The message row (`chat_messages`) points |
| + at that turn. |
| +3. If no dispatched turn is in flight (`queued`, `running` or `waiting`), |
| + `dispatch` runs in the same transaction. It writes one `message` command |
| + to the person's primary runner's mailbox (`runner_commands`): the |
| + attachment frames first, then `wire.MessageCommand` with `Text`, |
| + `PersonText` (one entry per message), the tail and the attachment refs. |
| + The turn becomes `dispatched`. If a turn is already in flight, the |
| + message waits in the queued turn. |
| +4. The runner's ack moves the turn to `running`. `reply`, `report` |
| + (failed or cancelled), `sync` (a turn the runner no longer holds) and |
| + `Cancel` of an undispatched turn each end the turn and call |
| + `dispatchNext` in the same transaction. `dispatchNext` dispatches the |
| + oldest queued turn (the person's own first) once nothing is in flight. |
| +5. The runner (`thin.coordBase.prompt`) puts `Text` under "Newest message" |
| + in a fresh session, or sends it alone in a warm one. Claude and Codex |
| + read the same text. |
| + |
| +So three messages sent during a slow turn already become one next turn and |
| +one reply. A message sent while nothing runs starts its own turn at once. |
| +The 13 staging turns fit messages that mostly arrived between turns. I |
| +could not check this, because I did not read staging. |
| + |
| +## What was missing |
| + |
| +- **Distinct messages.** `Text` was the messages joined with a blank line. |
| + "two\n\nthree" reads the same as one message with two paragraphs. The |
| + fake coordinator, which splits on blank lines, counted the attachment |
| + note as a fourth message. |
| +- **Attachments per message.** The runner lists every file of the turn as |
| + "the person attached these files", with nothing tying a file to the |
| + message that carried it. |
| +- **Recovery of a stranded queued turn.** Each end path dispatches the next |
| + turn in the same transaction, so the current code cannot strand one. A |
| + queued turn left behind with nothing in flight (an older build, a manual |
| + repair) waited until the person sent another message. |
| + |
| +## The change |
| + |
| +All of it is on the instance, mostly in its turn building. There is no |
| +wire, protocol, fixture or migration change. |
| + |
| +- `dispatch` builds `Text` with `turnText`. One message is sent exactly as |
| + before. Several messages are sent as: |
| + |
| + ``` |
| + [Equipo: the person sent 3 messages while you were busy, oldest first. Each is a separate message; answer them together in one reply.] |
| + |
| + Message 1 of 3: |
| + alpha first |
| + |
| + Message 2 of 3 (attached: notes.md): |
| + bravo second |
| + |
| + Message 3 of 3: |
| + charlie third |
| + ``` |
| + |
| + `relayFiles` also returns each message's file names. `PersonText` and |
| + `Attachments` keep their meaning. Every protocol reads `Text` as the |
| + person's words, so old and new runners get the same frame shape. |
| +- `sync`, after it reconciles, calls `dispatchNext` for the person. |
| + `dispatchNext` does nothing while a turn is in flight. A stranded queued |
| + turn therefore starts on the runner's next connection, exactly once. |
| +- **One frame each** (Astra round 1). A runner reads at most |
| + `wire.MaxFrameBytes` (256 KiB) and refuses a larger frame every time it |
| + is resent. Each message is up to 16 KiB and goes in twice (`Text` and |
| + `PersonText`), JSON-escaped. A message joins the newest waiting batch |
| + only while the batch's own part fits `batchRoom` (the frame less 64 |
| + KiB). Otherwise it starts the next batch, which goes after the first, |
| + one turn at a time and in order. `dispatch` drops the oldest tail |
| + messages until the command fits (`fitTail`). The tail never holds the |
| + messages of a batch still waiting behind the one being sent. |
| +- **A failed runner frame is retryable** (Astra round 1). A store error |
| + while applying a runner frame used to close the socket with |
| + `CloseRevoked`, so a real runner stopped as if its credential had been |
| + revoked. Now it closes with 1011 (internal error): the runner |
| + reconnects with backoff and resends the unacked frame. `ErrForbidden` |
| + keeps `CloseRevoked`. A credential revoked meanwhile is refused at the |
| + handshake (403), and every runner version maps that to revoked. Old |
| + runners treat any other close code as a reason to reconnect. |
| + |
| +## Crash, retry and end cases |
| + |
| +| Case | What happens | Contract | |
| +|---|---|---| |
| +| Crash between "turn ended" and "next turn created" | The end and the next dispatch are one transaction. Neither commits. The runner's reply is not acked, so it comes again after the restart. The inbox row rolled back with the transaction, so the reply applies once and starts one next turn. | `TestBatchCrashBetweenTurns` | |
| +| Same reply again, runner reconnects | The inbox drops the duplicate reply. The reconnect resends the same unacked command (same frame id), not a new turn. | `TestBatchCrashBetweenTurns` | |
| +| End committed without its successor | The next `sync` dispatches it once. A second sync does nothing. | `TestBatchStrandedRecovers` | |
| +| Running turn fails, is cancelled, or is lost across a runner reconnect | The batch goes next, once. The ended turn keeps only its own message. | `TestBatchAfterTurnEnds` | |
| +| Running turn retried (attempt 2) | The batch keeps waiting. A message sent during the retry joins it. A late attempt-1 reply is ignored. The batch goes once, after attempt 2 replies. | `TestBatchWaitsForRetriedTurn` | |
| +| The instance refuses the next turn (a store error) with a real runner | The reply rolls back and the socket closes 1011. The runner reconnects and resends the reply, and the batch goes once. | `TestHeadlessBatchAfterRefusedReply` | |
| +| Batch too big for one frame | It is split into several batches, sent one after another, in order. Each frame fits. | `TestBatchSplitsToFitTheFrame` | |
| +| Batch cancelled while it waits | All of its messages end `cancelled` together, unsent. The next message gets a turn of its own. | `TestBatchCancelledWhileWaiting` | |
| +| Bubbles and the queued note | Each message keeps its own bubble in the queued turn. One note sits under the latest one, as the thinking-stale fix did. The note clears for all of them when the batch's frame goes out, before the ack. | `TestBatchMarkerClearsTogether`, `TestHeadlessTurnBatching` | |
| + |
| +## Usage attribution |
| + |
| +Usage is recorded per turn (`chat_usage.turn_id`). A batch is one |
| +coordinator turn, so it is one user message to the CLI and one result. |
| +Claude's rows come from that result's `model_usage_since_last_result`. |
| +Codex's `CodexTally` counts one provider turn per attempt. Both attribute |
| +the whole batch to the batch turn. Nothing reads usage per message. |
| +`TestHeadlessTurnBatching` checks for one row for the batch turn and none |
| +for any single message. |
| + |
| +## Rulings (controller, 2026-11-11) |
| + |
| +1. **No hold.** A message sent while nothing runs starts its turn at |
| + once. A fast first reply beats batching messages that arrive between |
| + turns. |
| +2. **One note.** The single "Waiting its turn" note under the latest |
| + waiting message stays, as the thinking-stale fix built it. |
| +3. **Plural failure.** A failed turn that covered more than one message |
| + says `chat.failed_many`, "The coordinator could not answer these |
| + messages." (Astra copy pass: KEEP). The page and the event stream |
| + (`chat-stream.js`, from the turn's `message_ids`) both choose it. |
| + `TestBatchFailedSaysThemAll` and `TestBrowserInstantThinkingQueued` |
| + cover it. |
diff --git a/internal/equipo/chat/attachments.go b/internal/equipo/chat/attachments.go| index c5f85b06..9560bf95 100644 |
| --- a/internal/equipo/chat/attachments.go |
| +++ b/internal/equipo/chat/attachments.go |
| @@ -239,14 +239,15 @@ func (s *Store) AttachmentData(ctx context.Context, person, id string, preview b |
| // relayFiles writes the attachment frames for the files of a turn's |
| // messages, before its message frame. The command rows hold no bytes: |
| -// Pending reads each chunk from chat_attachment_data as it sends. |
| -func (t *txn) relayFiles(person string, messages []string) ([]wire.AttachmentRef, error) { |
| +// Pending reads each chunk from chat_attachment_data as it sends. names |
| +// are each message's file names, in order. |
| +func (t *txn) relayFiles(person string, messages []string) ([]wire.AttachmentRef, map[string][]string, error) { |
| if len(messages) == 0 { |
| - return nil, nil |
| + return nil, nil, nil |
| } |
| var rows []fileRecord |
| if err := t.db.Where("message_id IN ? AND person = ?", messages, person).Find(&rows).Error; err != nil { |
| - return nil, err |
| + return nil, nil, err |
| } |
| order := map[string]int{} |
| for i, id := range messages { |
| @@ -259,17 +260,19 @@ func (t *txn) relayFiles(person string, messages []string) ([]wire.AttachmentRef |
| return a.Position - b.Position |
| }) |
| refs := make([]wire.AttachmentRef, 0, len(rows)) |
| + names := map[string][]string{} |
| for _, r := range rows { |
| ref := wire.AttachmentRef{ID: r.ID, Kind: r.Kind, Name: r.Name, MediaType: r.MediaType, Size: r.Size, SHA256: r.SHA256} |
| count := attach.Chunks(r.Size) |
| for i := 0; i < count; i++ { |
| if err := t.command(person, wire.FrameAttachment, wire.AttachmentChunk{Person: person, AttachmentRef: ref, Index: i, Count: count}); err != nil { |
| - return nil, err |
| + return nil, nil, err |
| } |
| } |
| refs = append(refs, ref) |
| + names[r.MessageID] = append(names[r.MessageID], r.Name) |
| } |
| - return refs, nil |
| + return refs, names, nil |
| } |
| // hydrate fills an attachment frame's bytes from the stored file. |
diff --git a/internal/equipo/chat/runner.go b/internal/equipo/chat/runner.go| index af66e6a6..6f886197 100644 |
| --- a/internal/equipo/chat/runner.go |
| +++ b/internal/equipo/chat/runner.go |
| @@ -537,7 +537,11 @@ func (t *txn) sync(l Lease, v *wire.Sync) error { |
| return err |
| } |
| } |
| - return nil |
| + // Every path that ends a turn starts the next in the same |
| + // transaction. A queued turn left behind with nothing in flight (an |
| + // older instance's crash) starts here, once: dispatchNext does nothing |
| + // while a turn is in flight. |
| + return t.dispatchNext(l.Runner.Person) |
| } |
| // markTainted records, for good, that a check ran outside the sandbox on |
diff --git a/internal/equipo/chat/store.go b/internal/equipo/chat/store.go| index b249c051..15ff0ba4 100644 |
| --- a/internal/equipo/chat/store.go |
| +++ b/internal/equipo/chat/store.go |
| @@ -7,6 +7,7 @@ import ( |
| "encoding/hex" |
| "encoding/json" |
| "errors" |
| + "strconv" |
| "strings" |
| "sync" |
| "sync/atomic" |
| @@ -246,7 +247,7 @@ func (t *txn) commandTo(runner, person, kind string, body any) error { |
| } |
| // dispatch sends a queued turn to the runner with the person's messages |
| -// joined into one frame and the conversation tail before them. A move-in |
| +// in one frame (turnText) and the conversation tail before them. A move-in |
| // or explore turn carries no text: the runner writes its prompt. |
| func (t *txn) dispatch(r *turnRecord) error { |
| if err := t.hkSpend(r.Person); err != nil { |
| @@ -259,8 +260,11 @@ func (t *txn) dispatch(r *turnRecord) error { |
| if len(mine) == 0 && r.Kind == wire.TurnPerson { |
| return ErrInvalid |
| } |
| + // The tail is what went before: never this turn's messages, nor those |
| + // of a batch still waiting behind it (a batch too big for one frame |
| + // goes as several turns, one after another). |
| var prior []messageRecord |
| - if err := t.db.Where("person = ? AND turn_id <> ?", r.Person, r.ID).Order("seq DESC").Limit(wire.MaxTailMessages).Find(&prior).Error; err != nil { |
| + if err := t.db.Where("person = ? AND turn_id <> ? AND turn_id NOT IN (SELECT id FROM chat_turns WHERE person = ? AND dispatched = ? AND state = ?)", r.Person, r.ID, r.Person, false, wire.TurnQueued).Order("seq DESC").Limit(wire.MaxTailMessages).Find(&prior).Error; err != nil { |
| return err |
| } |
| tail := make([]wire.TailMessage, 0, len(prior)) |
| @@ -274,10 +278,11 @@ func (t *txn) dispatch(r *turnRecord) error { |
| ids = append(ids, m.ID) |
| } |
| // Attachment bytes go first, as their own frames. |
| - files, err := t.relayFiles(r.Person, ids) |
| + files, names, err := t.relayFiles(r.Person, ids) |
| if err != nil { |
| return err |
| } |
| + attached := make([][]string, 0, len(mine)) |
| for _, m := range mine { |
| own = append(own, m.Text) |
| text, err := t.answerPrefix(m) |
| @@ -285,13 +290,100 @@ func (t *txn) dispatch(r *turnRecord) error { |
| return err |
| } |
| texts = append(texts, text) |
| + attached = append(attached, names[m.ID]) |
| } |
| now := t.now() |
| r.Dispatched, r.DispatchedAt = true, &now |
| - if err := t.command(r.Person, wire.FrameMessage, wire.MessageCommand{Person: r.Person, TurnID: r.ID, Attempt: r.Attempt, Kind: r.Kind, Text: strings.Join(texts, "\n\n"), PersonText: own, Tail: tail, Attachments: files}); err != nil { |
| + cmd := wire.MessageCommand{Person: r.Person, TurnID: r.ID, Attempt: r.Attempt, Kind: r.Kind, Text: turnText(texts, attached), PersonText: own, Tail: tail, Attachments: files} |
| + if cmd.Tail, err = fitTail(cmd); err != nil { |
| return err |
| } |
| - return nil |
| + return t.command(r.Person, wire.FrameMessage, cmd) |
| +} |
| + |
| +// frameRoom is what a message command's body may take: the frame limit |
| +// less its envelope (id and type). |
| +const frameRoom = wire.MaxFrameBytes - 1<<10 |
| + |
| +// fitTail drops the oldest tail messages until the command fits one |
| +// frame: a runner refuses a larger frame, every time it is resent. |
| +func fitTail(cmd wire.MessageCommand) ([]wire.TailMessage, error) { |
| + raw, err := json.Marshal(cmd) |
| + if err != nil { |
| + return nil, err |
| + } |
| + size, tail := len(raw), cmd.Tail |
| + for len(tail) > 0 && size > frameRoom { |
| + one, err := json.Marshal(tail[0]) |
| + if err != nil { |
| + return nil, err |
| + } |
| + size, tail = size-len(one)-1, tail[1:] |
| + } |
| + return tail, nil |
| +} |
| + |
| +// batchRoom bounds the person's own part of a batch (its words twice, as |
| +// Text and PersonText, and its files), leaving room for answer prefixes |
| +// and some tail. |
| +const batchRoom = wire.MaxFrameBytes - 64<<10 |
| + |
| +// batchFull reports whether a queued turn has no room left for one more |
| +// message: its text and its number of files. A full batch stays as it is; |
| +// the message starts the next batch, which goes after it. |
| +func (t *txn) batchFull(turn, text string, files int) (bool, error) { |
| + var rows []messageRecord |
| + if err := t.db.Select("id", "text").Where("turn_id = ? AND role = ?", turn, wire.RolePerson).Find(&rows).Error; err != nil { |
| + return false, err |
| + } |
| + ids := make([]string, 0, len(rows)) |
| + texts := []string{text} |
| + for _, m := range rows { |
| + ids, texts = append(ids, m.ID), append(texts, m.Text) |
| + } |
| + var held int64 |
| + if len(ids) > 0 { |
| + if err := t.db.Model(&fileRecord{}).Where("message_id IN ?", ids).Count(&held).Error; err != nil { |
| + return false, err |
| + } |
| + } |
| + size := 256 + 512*(int(held)+files) |
| + for _, text := range texts { |
| + raw, err := json.Marshal(text) |
| + if err != nil { |
| + return false, err |
| + } |
| + size += 2*len(raw) + 64 |
| + } |
| + return size > batchRoom, nil |
| +} |
| + |
| +// turnText is what the coordinator reads for a turn's messages. One |
| +// message is its words alone (none, for a move-in or explore turn). |
| +// Several (sent while another turn ran) are each set apart, oldest |
| +// first, with the names of the files each one carried, so the |
| +// coordinator can tell them apart and answer them together. Every runner |
| +// reads Text as the person's words, so the frame is the same at every |
| +// protocol. |
| +func turnText(texts []string, files [][]string) string { |
| + if len(texts) < 2 { |
| + return strings.Join(texts, "") |
| + } |
| + var b strings.Builder |
| + n := strconv.Itoa(len(texts)) |
| + b.WriteString("[Equipo: the person sent " + n + " messages while you were busy, oldest first. Each is a separate message; answer them together in one reply.]") |
| + for i, text := range texts { |
| + b.WriteString("\n\nMessage " + strconv.Itoa(i+1) + " of " + n) |
| + if len(files[i]) > 0 { |
| + b.WriteString(" (attached: " + strings.Join(files[i], ", ") + ")") |
| + } |
| + b.WriteString(":\n") |
| + if text == "" { |
| + text = "(files only, no words)" |
| + } |
| + b.WriteString(text) |
| + } |
| + return b.String() |
| } |
| // personFirst orders queued turns: the person's own before any move-in or |
| @@ -328,7 +420,8 @@ func bodyHash(text string) string { |
| } |
| // Send records a person message. While a turn is in flight, new messages |
| -// join one queued turn, which goes to the coordinator as a single frame. |
| +// join one queued turn, which goes to the coordinator as a single frame |
| +// (several, one turn after another, when they would not fit one). |
| func (s *Store) Send(ctx context.Context, person string, in wire.SendMessage) (out wire.Sent, created bool, err error) { |
| // A message is words, attachments or both. |
| if in.Text = strings.TrimSpace(in.Text); in.Text == "" && len(in.Attachments) == 0 || len(in.Text) > wire.MaxMessageBytes || !utf8.ValidString(in.Text) || strings.ContainsRune(in.Text, 0) { |
| @@ -378,11 +471,18 @@ func (t *txn) send(person, key, text string, files []string, before func(message |
| } |
| now := t.now() |
| var turn turnRecord |
| - err = t.db.Where("person = ? AND dispatched = ? AND state = ? AND coalesce(kind, '') = ''", person, false, wire.TurnQueued).Order("created_at, id").First(&turn).Error |
| + // The message joins the newest waiting batch, unless that batch would |
| + // no longer fit one frame. |
| + err = t.db.Where("person = ? AND dispatched = ? AND state = ? AND coalesce(kind, '') = ''", person, false, wire.TurnQueued).Order("created_at DESC, id DESC").First(&turn).Error |
| fresh := errors.Is(err, gorm.ErrRecordNotFound) |
| if err != nil && !fresh { |
| return out, false, err |
| } |
| + if !fresh { |
| + if fresh, err = t.batchFull(turn.ID, text, len(files)); err != nil { |
| + return out, false, err |
| + } |
| + } |
| if fresh { |
| turn = turnRecord{ID: newID("t_"), Person: person, State: wire.TurnQueued, Attempt: 1, CreatedAt: now, UpdatedAt: now} |
| if err = t.db.Create(&turn).Error; err != nil { |
diff --git a/internal/equipo/chat/stream.go b/internal/equipo/chat/stream.go| index 821ef57a..691b253a 100644 |
| --- a/internal/equipo/chat/stream.go |
| +++ b/internal/equipo/chat/stream.go |
| @@ -208,9 +208,16 @@ func (rc *runnerConn) read(ctx context.Context) websocket.StatusCode { |
| return wire.CloseSuperseded |
| case errors.Is(err, ErrInvalid): |
| return websocket.StatusPolicyViolation |
| - case err != nil && !errors.Is(err, ErrNotFound): |
| + case errors.Is(err, ErrForbidden): |
| rc.log("runner frame", err) |
| return wire.CloseRevoked |
| + case err != nil && !errors.Is(err, ErrNotFound): |
| + // The frame's transaction rolled back and it stays unacked. The |
| + // runner reconnects and sends it again; a credential revoked |
| + // meanwhile is refused at the handshake (403), which is how |
| + // every runner learns it is revoked. |
| + rc.log("runner frame", err) |
| + return websocket.StatusInternalError |
| } |
| if f.Durable() { |
| ack, _ := wire.NewFrame("a"+f.ID, wire.FrameAck, wire.Ack{ID: f.ID}) |
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go| index f01b82fd..e7a28367 100644 |
| --- a/internal/equipo/chat_page.go |
| +++ b/internal/equipo/chat_page.go |
| @@ -306,9 +306,13 @@ func (a *application) chatPage(w http.ResponseWriter, r *http.Request) { |
| } |
| if latest != nil && (latest.State == wire.TurnFailed || latest.State == wire.TurnCancelled) { |
| key := "chat." + latest.State |
| - if latest.Reason == wire.ReasonStorageFull { |
| + switch { |
| + case latest.Reason == wire.ReasonStorageFull: |
| // The runner had no room for an attachment: said in words. |
| key = "chat.failed_storage" |
| + case latest.State == wire.TurnFailed && len(latest.MessageIDs) > 1: |
| + // The turn carried a batch: messages sent while another ran. |
| + key = "chat.failed_many" |
| } |
| view.Ended = &chatEnded{ID: latest.ID, Key: key} |
| } |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index a883ea55..1dfac536 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -566,6 +566,7 @@ var pageCopy = map[string]string{ |
| "conversation.thinking": "Thinking", |
| "chat.offline": "Your runner is offline. Messages wait here until it is back.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.failed": "The coordinator could not answer this message.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "chat.failed_many": "The coordinator could not answer these messages.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| "chat.cancelled": "Stopped.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.activity.thinking": "Thinking", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "chat.activity.status": "Checking your projects…", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js| index 25886291..7ce58740 100644 |
| --- a/internal/equipo/static/chat-stream.js |
| +++ b/internal/equipo/static/chat-stream.js |
| @@ -892,7 +892,8 @@ |
| if (v.kind) return; |
| var note = template("equipo-ended-template"); |
| note.dataset.ended = v.id; |
| - note.querySelector("p").textContent = v.state !== "failed" ? form.dataset.cancelled : v.reason === "runner_storage_full" && form.dataset.failedStorage ? form.dataset.failedStorage : form.dataset.failed; |
| + // A batch (messages sent while another turn ran) says them all. |
| + note.querySelector("p").textContent = v.state !== "failed" ? form.dataset.cancelled : v.reason === "runner_storage_full" && form.dataset.failedStorage ? form.dataset.failedStorage : (v.message_ids || []).length > 1 && form.dataset.failedMany ? form.dataset.failedMany : form.dataset.failed; |
| feed.append(note); |
| scroll(); |
| } |
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html| index f1919dda..9b8d8a4c 100644 |
| --- a/internal/equipo/templates/chat.html |
| +++ b/internal/equipo/templates/chat.html |
| @@ -45,7 +45,7 @@ |
| </div> |
| <div equipo-announcements role="status" aria-live="polite" aria-atomic="false"></div> |
| <div id="chat-composer"> |
| -<form id="composer" equipo-form equipo-composer method="post" action="/conversation" data-failed="{{copy "chat.failed"}}" data-failed-storage="{{copy "chat.failed_storage"}}" data-retry="{{copy "conversation.retry"}}" data-cancelled="{{copy "chat.cancelled"}}" data-upload="/conversation/attachments" data-max-files="5" data-max-bytes="10485760" data-too-large="{{copy "api.attachment_too_large"}}" data-heic="{{copy "api.attachment_heic"}}" data-too-many="{{copy "chat.attach.too_many"}}" data-upload-failed="{{copy "chat.attach.failed"}}" data-uploading="{{copy "chat.attach.uploading"}}" data-remove="{{copy "chat.attach.remove"}}"> |
| +<form id="composer" equipo-form equipo-composer method="post" action="/conversation" data-failed="{{copy "chat.failed"}}" data-failed-many="{{copy "chat.failed_many"}}" data-failed-storage="{{copy "chat.failed_storage"}}" data-retry="{{copy "conversation.retry"}}" data-cancelled="{{copy "chat.cancelled"}}" data-upload="/conversation/attachments" data-max-files="5" data-max-bytes="10485760" data-too-large="{{copy "api.attachment_too_large"}}" data-heic="{{copy "api.attachment_heic"}}" data-too-many="{{copy "chat.attach.too_many"}}" data-upload-failed="{{copy "chat.attach.failed"}}" data-uploading="{{copy "chat.attach.uploading"}}" data-remove="{{copy "chat.attach.remove"}}"> |
| <input type="hidden" name="request_id" value="{{.RequestID}}"> |
| <div equipo-adder hidden><button type="button" equipo-plus aria-label="{{copy "chat.attach.add"}}" title="{{copy "chat.attach.add"}}" aria-haspopup="menu" aria-expanded="false" aria-controls="attach-menu">{{icon "plus"}}</button><div equipo-add-menu id="attach-menu" role="menu" aria-label="{{copy "chat.attach.add"}}" hidden><button type="button" role="menuitem" data-pick="image">{{icon "image"}}<span>{{copy "chat.attach.image"}}</span></button><button type="button" role="menuitem" data-pick="file">{{icon "file-text"}}<span>{{copy "chat.attach.file"}}</span></button></div><input type="file" data-picker="image" accept="image/*" multiple tabindex="-1" aria-hidden="true" equipo-visually-hidden><input type="file" data-picker="file" accept=".txt,.md,.markdown,.csv,.json,.log,.pdf,text/plain,text/markdown,text/csv,application/json,application/pdf" multiple tabindex="-1" aria-hidden="true" equipo-visually-hidden></div> |
| <div equipo-pill> |
diff --git a/internal/equipotest/browser_test.go b/internal/equipotest/browser_test.go| deleted file mode 100644 |
| index f70879c5..00000000 |
| --- a/internal/equipotest/browser_test.go |
| +++ /dev/null |
| @@ -1,190 +0,0 @@ |
| -//go:build browser |
| - |
| -package equipotest |
| - |
| -import ( |
| - "amadan.net/oficina/equipo/internal/browsertest" |
| - "context" |
| - "fmt" |
| - "io" |
| - "log/slog" |
| - "net/http" |
| - "os" |
| - "path/filepath" |
| - "strings" |
| - "testing" |
| - |
| - "amadan.net/oficina/equipo/internal/equipo" |
| - "amadan.net/rastrillo/rastrillo/db" |
| - "amadan.net/rastrillo/rastrillo/harness" |
| - "github.com/chromedp/cdproto/cdp" |
| - "github.com/chromedp/cdproto/emulation" |
| - "github.com/chromedp/cdproto/network" |
| - "github.com/chromedp/chromedp" |
| - "github.com/chromedp/chromedp/kb" |
| -) |
| - |
| -func TestFoundationBrowserWalk(t *testing.T) { |
| - mailer := &capturingMailer{} |
| - rig := harness.New(t, func(origin string) http.Handler { |
| - logger := slog.New(slog.NewTextHandler(io.Discard, nil)) |
| - d, err := db.Open(filepath.Join(t.TempDir(), "app.db"), logger) |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - t.Cleanup(func() { d.Close() }) |
| - mux, err := equipo.App(d, testConfig(origin), mailer, logger) |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - return mux |
| - }, harness.WithScrollbars()) |
| - noJS := os.Getenv("EQUIPO_BROWSER_NO_JS") == "1" |
| - // The pinned harness treats Chromium's native cancelled-transition |
| - // promise as an app exception, even with scripts disabled. Reduced motion |
| - // keeps this walk about navigation and forms; shell focus scripts still run. |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, emulation.SetScriptExecutionDisabled, emulation.SetScriptExecutionDisabledParams{Value: noJS}) |
| - if err != nil { |
| - return err |
| - } |
| - motion := "reduce" |
| - if os.Getenv("EQUIPO_BROWSER_NORMAL_MOTION") == "1" { |
| - motion = "no-preference" |
| - } |
| - _, err = cdp.Call(ctx, target, emulation.SetEmulatedMedia, emulation.SetEmulatedMediaParams{Features: []*emulation.MediaFeature{{Name: "prefers-reduced-motion", Value: motion}}}) |
| - return err |
| - })) |
| - t.Logf("scripts disabled: %t", noJS) |
| - browserSignin(t, rig, mailer) |
| - |
| - check := func(expression, reason string) { |
| - t.Helper() |
| - ok := harness.Evaluate[bool](rig, expression) |
| - if !ok { |
| - t.Fatal(reason) |
| - } |
| - } |
| - screen := func(note string) { |
| - t.Helper() |
| - t.Log(note) |
| - rig.Screen("body", note) |
| - rig.Run(browsertest.Wait(`!document.documentElement.matches(":active-view-transition") && document.getAnimations().every(a => a.playState !== "running")`)) |
| - check(`document.documentElement.scrollWidth <= document.documentElement.clientWidth && document.body.scrollWidth <= document.documentElement.clientWidth`, "horizontal overflow: "+note) |
| - } |
| - goTo := func(path string) { |
| - t.Helper() |
| - rig.Run(chromedp.Navigate(rig.Origin + path)) |
| - screen(path) |
| - } |
| - clickTo := func(selector, path string) { |
| - t.Helper() |
| - rig.Run(browsertest.Click(selector), browsertest.Wait(fmt.Sprintf(`location.pathname + location.hash === %q`, path))) |
| - screen(path) |
| - } |
| - shot := func(name string) { browsertest.Screenshot(t, rig, name) } |
| - for _, width := range []int64{1280, 390} { |
| - rig.Run(chromedp.EmulateViewport(width, 900)) |
| - goTo("/conversation") |
| - check(`!!document.querySelector('[data-empty-state]')`, "missing conversation empty state") |
| - shot(fmt.Sprintf("empty-%d", width)) |
| - for _, path := range railPaths { |
| - if width == 390 { |
| - goTo("/work") |
| - } |
| - selector := fmt.Sprintf(`[rst-shell-nav] a[href=%q]`, path) |
| - clickTo(selector, path) |
| - check(fmt.Sprintf(`document.querySelector('[aria-current="page"]').getAttribute('href') === %q`, path), "wrong active destination") |
| - if strings.HasPrefix(path, "/specialists/") && width == 390 { |
| - key := strings.TrimPrefix(path, "/specialists/") |
| - rig.Run(chromedp.Click(chromedp.CSS(`[rel="up"]`)), browsertest.Wait(`location.pathname === '/work'`)) |
| - selected := "document.activeElement" |
| - if noJS { |
| - selected = "document.querySelector(':target')" |
| - } |
| - rig.Run(browsertest.Wait(fmt.Sprintf(`%s?.id === %q`, selected, "nav-"+key))) |
| - check(fmt.Sprintf(`%s?.id === %q && %s.getBoundingClientRect().bottom <= innerHeight && %s.getBoundingClientRect().top >= 0`, selected, "nav-"+key, selected, selected), "back link missed visible index row") |
| - rig.Run(browsertest.Wait(`!document.documentElement.matches(":active-view-transition") && document.getAnimations().every(a => a.playState !== "running")`)) |
| - check(`document.documentElement.scrollWidth <= innerWidth`, "parent index overflow") |
| - shot("parent-" + key) |
| - // The pinned chromedp can retain stale DOM node IDs after a |
| - // back/forward-cache restoration. Assert the restored page |
| - // above, then reload before Screen uses its node queries. |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := chromedp.RunResponse(ctx, chromedp.Reload()) |
| - return err |
| - })) |
| - screen("specialist parent reloaded") |
| - } |
| - if path == "/conversation" { |
| - check(`!!document.querySelector('[data-empty-state]')`, "empty destination missing") |
| - } |
| - } |
| - goTo("/work") |
| - shot(fmt.Sprintf("index-%d", width)) |
| - // Content pages start keyboard traversal at the skip link. |
| - goTo("/conversation") |
| - rig.Run(chromedp.KeyEvent(kb.Tab)) |
| - check(`document.activeElement.matches('[rst-skip]')`, "skip link not first in keyboard order") |
| - shot(fmt.Sprintf("focus-%d", width)) |
| - rig.Run(chromedp.KeyEvent(kb.Enter)) |
| - check(`location.hash === '#main'`, "skip link did not reach main") |
| - |
| - goTo("/settings") |
| - label := fmt.Sprintf("Browser account %d", width) |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`form[action="/accounts"]:has(input[name="id"][value="0"]) input[name="label"]`), label), browsertest.Click(`form[action="/accounts"]:has(input[name="id"][value="0"]) button`), browsertest.Wait(fmt.Sprintf(`Array.from(document.querySelectorAll('h2')).some(e => e.textContent === %q)`, label))) |
| - screen("account saved") |
| - for _, kind := range []string{"app", "website", "repository"} { |
| - goTo("/projects/new") |
| - name := fmt.Sprintf("%s %d %s", kind, width, strings.Repeat("LongProjectName", 12)) |
| - rig.Run( |
| - chromedp.SetValue(chromedp.CSS(`[name="account_id"]`), fmt.Sprint(map[int64]int{1280: 1, 390: 2}[width])), |
| - chromedp.SendKeys(chromedp.CSS(`[name="name"]`), name), |
| - chromedp.SetValue(chromedp.CSS(`[name="kind"]`), kind), |
| - chromedp.SendKeys(chromedp.CSS(`[name="repository"]`), fmt.Sprintf("amadan.net/browser/%s-%d", kind, width)), |
| - chromedp.SendKeys(chromedp.CSS(`[name="default_branch"]`), "main"), |
| - chromedp.SetValue(chromedp.CSS(`[name="owner_work"]`), ownerAddress), |
| - chromedp.SetValue(chromedp.CSS(`[name="owner_merge"]`), ownerAddress), |
| - ) |
| - if kind != "repository" { |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`[name="app_name"]`), fmt.Sprintf("%s-%d", kind, width))) |
| - } |
| - rig.Run(browsertest.Click(`[equipo-form] button[type="submit"]`), browsertest.Wait(` /^\/projects\/\d+$/.test(location.pathname)`)) |
| - screen("created " + kind) |
| - check(fmt.Sprintf(`document.querySelector('main h1').textContent === %q && !!document.querySelector('[data-project-kind="%s"]')`, name, kind), "project metadata missing") |
| - path := harness.Read(rig, chromedp.Location()) |
| - path = strings.TrimPrefix(path, rig.Origin) |
| - goTo("/projects/accounts") |
| - check(fmt.Sprintf(`document.querySelector('h3 a[href=%q]').getClientRects().length > 1`, path), "long project name does not wrap") |
| - clickTo(fmt.Sprintf(`h3 a[href=%q]`, path), path) |
| - clickTo(fmt.Sprintf(`a[href=%q]`, path+"/edit"), path+"/edit") |
| - rig.Run(chromedp.SetValue(chromedp.CSS(`[name="name"]`), name+" edited"), chromedp.SetValue(chromedp.CSS(`[name="default_branch"]`), "release/browser"), browsertest.Click(`[equipo-form] button[type="submit"]`), browsertest.Wait(fmt.Sprintf(`location.pathname === %q`, path))) |
| - screen("edited " + kind) |
| - goTo(path) |
| - check(fmt.Sprintf(`document.querySelector('main h1').textContent === %q && document.querySelector('[equipo-metadata]').textContent.includes('release/browser')`, name+" edited"), "edit did not persist") |
| - } |
| - goTo("/projects/accounts") |
| - check(fmt.Sprintf(`document.querySelectorAll('[data-project-kind]').length === %d`, map[int64]int{1280: 3, 390: 6}[width]), "project count mismatch") |
| - shot(fmt.Sprintf("projects-%d", width)) |
| - goTo("/specialists/engineering") |
| - check(`document.querySelectorAll('#activity > section').length === 4 && document.querySelectorAll('#activity [data-empty-state]').length === 1 && document.querySelectorAll('#activity [data-task]').length === 0`, "specialist work is not empty") |
| - shot(fmt.Sprintf("specialist-%d", width)) |
| - } |
| - goTo("/work") |
| - rig.Run(chromedp.Click(chromedp.CSS(`[rst-shell-profile] summary`))) |
| - clickTo(`form[action="/signout"] button`, "/signin") |
| - goTo("/projects") |
| - check(`location.pathname === '/signin' && !document.querySelector('[data-project-count]')`, "signout retained project access") |
| -} |
| - |
| -func browserSignin(t *testing.T, rig *harness.Rig, mailer *capturingMailer) { |
| - t.Helper() |
| - c := signinClient(t, rig.Origin) |
| - signinEmail(t, c, rig.Origin, rig.Origin, mailer, ownerAddress) |
| - for _, cookie := range c.Jar.Cookies(mustURL(t, rig.Origin)) { |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, network.SetCookie, network.SetCookieParams{Name: cookie.Name, Value: cookie.Value, URL: rig.Origin, Path: "/"}) |
| - return err |
| - })) |
| - } |
| -} |
diff --git a/internal/equipotest/chat_browser_test.go b/internal/equipotest/chat_browser_test.go| deleted file mode 100644 |
| index 30f30f26..00000000 |
| --- a/internal/equipotest/chat_browser_test.go |
| +++ /dev/null |
| @@ -1,142 +0,0 @@ |
| -//go:build browser |
| - |
| -package equipotest |
| - |
| -import ( |
| - "amadan.net/oficina/equipo/internal/browsertest" |
| - "amadan.net/oficina/equipo/internal/equipo" |
| - "amadan.net/rastrillo/rastrillo/harness" |
| - "context" |
| - "fmt" |
| - "github.com/chromedp/cdproto/cdp" |
| - "github.com/chromedp/cdproto/emulation" |
| - "github.com/chromedp/chromedp" |
| - "github.com/chromedp/chromedp/kb" |
| - "net/http" |
| - "os" |
| - "testing" |
| -) |
| - |
| -func TestChatBrowser(t *testing.T) { |
| - f, _ := questionFixture(t) |
| - task := f.a.TaskID |
| - mustSQL(t, f.d, "UPDATE questions SET raw_request=?", `{"provider":"claude","name":"AskUserQuestion","input":{"questions":[{"question":"Which invoice total should appear?","options":[{"label":"Net"},{"label":"Subtotal"}]}]}}`) |
| - mustSQL(t, f.d, "UPDATE tasks SET description=? WHERE id=?", "Fix the invoice total", task) |
| - mustSQL(t, f.d, "UPDATE projects SET name=?", "Comercio") |
| - for _, thread := range []string{"", task} { |
| - for i, body := range []string{"The invoice total changes after adding delivery.", "I’ll trace the calculation and ask Engineering to reproduce it.", "Please keep the existing tax rules.", "The reproduction is ready. Delivery is being counted twice.", "Include a check for invoices without delivery too.", "Engineering is adding that check before the independent review."} { |
| - m, err := f.s.SendMessage(connectionContext, ownerActor, thread, body, equipo.Mutation{RequestID: fmt.Sprintf("seed-%s-%d", thread, i)}) |
| - executionMust(t, err) |
| - if i%2 == 1 { |
| - kind, author := "coordinator", "coordinator" |
| - if thread != "" { |
| - kind, author = "specialist", "engineering" |
| - } |
| - mustSQL(t, f.d, "UPDATE conversation_messages SET author_kind=?,author_id=? WHERE id=?", kind, author, m.ID) |
| - } |
| - mustSQL(t, f.d, "UPDATE conversation_messages SET created_at=? WHERE id=?", fmt.Sprintf("2026-11-05 10:%02d:00", i), m.ID) |
| - } |
| - } |
| - mustSQL(t, f.d, "INSERT INTO conversation_cards(id,stream_id,kind,resource_id,sequence,revision) SELECT 'chat-task',id,'task',?,2,1 FROM conversations WHERE person=?", task, ownerAddress) |
| - mailer := &capturingMailer{} |
| - var router http.Handler |
| - rig := harness.New(t, func(origin string) http.Handler { |
| - cfg := testConfig(origin) |
| - var err error |
| - router, err = equipo.RouterWithStore(f.d, cfg, mailer, nil, f.s) |
| - executionMust(t, err) |
| - mux := http.NewServeMux() |
| - mux.Handle("/mockups/", http.StripPrefix("/mockups/", http.FileServer(http.Dir("../../docs/mockups")))) |
| - mux.Handle("/", equipo.Mux(router)) |
| - return mux |
| - }, harness.WithScrollbars()) |
| - t.Cleanup(func() { equipo.CloseLive(router) }) |
| - noJS := os.Getenv("EQUIPO_BROWSER_NO_JS") == "1" |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, emulation.SetScriptExecutionDisabled, emulation.SetScriptExecutionDisabledParams{Value: noJS}) |
| - if err != nil { |
| - return err |
| - } |
| - _, err = cdp.Call(ctx, target, emulation.SetEmulatedMedia, emulation.SetEmulatedMediaParams{Features: []*emulation.MediaFeature{{Name: "prefers-reduced-motion", Value: "reduce"}}}) |
| - return err |
| - })) |
| - browserSignin(t, rig, mailer) |
| - check := func(expression, reason string) { |
| - t.Helper() |
| - if !harness.Evaluate[bool](rig, expression) { |
| - t.Fatal(reason) |
| - } |
| - } |
| - shot := func(name string) { browsertest.Screenshot(t, rig, name) } |
| - baseline := os.Getenv("EQUIPO_CHAT_BASELINE") == "1" |
| - for _, width := range []int64{1280, 390} { |
| - rig.Run(chromedp.EmulateViewport(width, 900)) |
| - for _, screen := range []struct{ name, path string }{{"conversation", "/conversation"}, {"thread", "/tasks/" + task + "/thread"}, {"nav", "/work"}} { |
| - rig.Run(chromedp.Navigate(rig.Origin+screen.path), browsertest.Wait(`!document.documentElement.matches(":active-view-transition")`)) |
| - shot(fmt.Sprintf("%s-%d", screen.name, width)) |
| - if baseline { |
| - continue |
| - } |
| - check(`document.documentElement.scrollWidth<=innerWidth`, "horizontal overflow") |
| - checkChatStyle(t, rig, screen.name == "nav") |
| - if screen.name == "nav" { |
| - continue |
| - } |
| - if screen.name == "conversation" { |
| - check(`document.querySelector("[data-card=chat-task]").parentElement.previousElementSibling.dataset.sequence === "2"`, "task card detached from its message") |
| - } |
| - rig.Screen("body", fmt.Sprintf("chat %s %d", screen.name, width)) |
| - check(`!!document.querySelector('ol[equipo-feed]') && !!document.querySelector('[aria-live="polite"]')`, "missing accessible chat feed") |
| - check(`document.querySelectorAll('[equipo-message] time[datetime]').length>=6`, "missing message times") |
| - check(`document.querySelector('#composer').getBoundingClientRect().bottom<=innerHeight && document.querySelector('#composer textarea').getBoundingClientRect().top>0`, "composer outside viewport") |
| - if noJS { |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`#composer textarea`), "Scriptless reply"), browsertest.Click(`#composer button`)) |
| - check(`document.querySelector('#conversation-feed').textContent.includes('Scriptless reply')`, "scriptless reply missing") |
| - continue |
| - } |
| - check(`document.querySelectorAll('[equipo-message="incoming"] .icon').length>=3`, "missing sender icons") |
| - harness.Evaluate[bool](rig, `(window.chatDocument=true)`) |
| - thread := "" |
| - if screen.name == "thread" { |
| - thread = task |
| - } |
| - liveText := fmt.Sprintf("Live reply %s %d", screen.name, width) |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`#composer textarea`), "Keep this draft")) |
| - _, err := f.s.SendMessage(connectionContext, ownerActor, thread, liveText, equipo.Mutation{RequestID: liveText}) |
| - executionMust(t, err) |
| - rig.Run(browsertest.Wait(fmt.Sprintf(`document.querySelector('#conversation-feed').textContent.includes(%q)`, liveText))) |
| - check(`window.chatDocument && document.querySelector('#chat-body').value==='Keep this draft' && document.activeElement.id==='chat-body'`, "live update lost document, draft or focus") |
| - check(`(()=>{const s=document.querySelector('[equipo-scroll]');return s.scrollHeight-s.clientHeight-s.scrollTop<3})()`, "live update did not follow bottom") |
| - harness.Evaluate[bool](rig, `(()=>{const s=document.querySelector('[equipo-scroll]');s.scrollTop=0;return true})()`) |
| - rig.Run(browsertest.Wait(`document.querySelector('[equipo-scroll]').scrollTop===0`)) |
| - _, err = f.s.SendMessage(connectionContext, ownerActor, thread, liveText+" while reading", equipo.Mutation{RequestID: liveText + "-reading"}) |
| - executionMust(t, err) |
| - rig.Run(browsertest.Wait(fmt.Sprintf(`document.querySelector('#conversation-feed').textContent.includes(%q)`, liveText+" while reading"))) |
| - check(`document.querySelector('[equipo-scroll]').scrollTop<3`, "live update pulled reader to bottom") |
| - check(`document.querySelector('[equipo-announcements]').textContent.includes('while reading')`, "new message not announced") |
| - harness.Evaluate[bool](rig, `(()=>{const t=document.querySelector("#chat-body");t.value="Browser reply";t.focus();return true})()`) |
| - rig.Run(chromedp.KeyEvent(kb.Enter, chromedp.KeyModifiers(chromedp.ModifierShift))) |
| - check(`document.querySelector('#composer textarea').value.endsWith('\n')`, "Shift+Enter did not add a newline") |
| - rig.Run(chromedp.KeyEvent(kb.Enter), browsertest.Wait(`document.querySelector('#composer button').disabled && document.querySelector('#chat-body').readOnly`)) |
| - rig.Run(browsertest.Wait(`document.querySelector('#composer textarea').value==='' && document.querySelector('#conversation-feed').textContent.includes('Browser reply')`)) |
| - check(`document.activeElement.id==='chat-body' && window.chatDocument`, "composer lost focus or reloaded") |
| - check(`(()=>{const s=document.querySelector('[equipo-scroll]');return s.scrollHeight-s.clientHeight-s.scrollTop<3})()`, "send did not reach bottom") |
| - } |
| - if baseline { |
| - for _, name := range []string{"conversation", "nav", "journey", "native"} { |
| - rig.Run(chromedp.Navigate(rig.Origin + "/mockups/" + name + ".html")) |
| - shot(fmt.Sprintf("mockup-%s-%d", name, width)) |
| - } |
| - } |
| - } |
| - if !baseline && !noJS { |
| - rig.Run(chromedp.Navigate(rig.Origin+"/tasks/"+task+"/thread"), browsertest.Click(`[equipo-choice] button[value="Net"]`)) |
| - if scalar(t, f.d, "SELECT count(*) FROM questions WHERE state='answered' AND answer LIKE '%Net%'") != 1 { |
| - t.Fatal("one-tap answer was not saved") |
| - } |
| - rig.Run(chromedp.Navigate(rig.Origin + "/tasks/" + task + "/thread")) |
| - _, err := f.s.CancelTask(connectionContext, ownerActor, task) |
| - executionMust(t, err) |
| - rig.Run(browsertest.Wait(`document.querySelector('[equipo-chat-task]').textContent.includes('Cancelled')`)) |
| - } |
| -} |
diff --git a/internal/equipotest/chat_style_browser_test.go b/internal/equipotest/chat_style_browser_test.go| deleted file mode 100644 |
| index 2dc2fa96..00000000 |
| --- a/internal/equipotest/chat_style_browser_test.go |
| +++ /dev/null |
| @@ -1,40 +0,0 @@ |
| -//go:build browser |
| - |
| -package equipotest |
| - |
| -import ( |
| - "amadan.net/rastrillo/rastrillo/harness" |
| - "testing" |
| -) |
| - |
| -func checkChatStyle(t *testing.T, rig *harness.Rig, nav bool) { |
| - t.Helper() |
| - checks := map[string]string{ |
| - "one team header with switch": `!!document.querySelector('[equipo-team-heading] #nav-teams') && document.querySelectorAll('[rst-shell-rail] > [rst-shell-brand]').length===0`, |
| - "one specialists heading": `Array.from(document.querySelectorAll('[equipo-nav-group]')).filter(e=>e.textContent==='Specialists').length===1`, |
| - "compact sidebar counts": `Array.from(document.querySelectorAll('[equipo-count]')).every(e=>e.parentElement.matches('a') && getComputedStyle(e).whiteSpace==='nowrap' && e.scrollWidth<=e.clientWidth)`, |
| - "project and attention counts": `!!document.querySelector('#nav-projects [equipo-count]') && !!document.querySelector('#nav-needs-you [equipo-count]')`, |
| - } |
| - if !nav { |
| - for name, expression := range map[string]string{ |
| - "no page scrolling": `document.documentElement.scrollHeight<=innerHeight && document.body.scrollHeight<=innerHeight`, |
| - "plain incoming text": `Array.from(document.querySelectorAll('[equipo-message="incoming"] [equipo-bubble]')).every(e=>getComputedStyle(e).borderTopWidth==='0px' && getComputedStyle(e).paddingTop==='0px')`, |
| - "own name hidden": `Array.from(document.querySelectorAll('[equipo-message="own"] [equipo-message-meta] strong')).every(e=>getComputedStyle(e).clipPath==='inset(50%)')`, |
| - "compact message menu": `location.pathname!=="/conversation" || !!document.querySelector('[equipo-message-actions] summary[aria-label]')`, |
| - "date separator": `!!document.querySelector('[equipo-day] time[datetime]')`, |
| - "slim header": `!document.querySelector('[equipo-chat-header] > p')`, |
| - "compact question": `!!document.querySelector('[equipo-question] textarea[rows="1"]') && !document.querySelector('[equipo-question] [equipo-badge]')`, |
| - "question options": `document.querySelectorAll('[equipo-question] [equipo-choice] button').length>=2`, |
| - "task age": `!!document.querySelector('[equipo-chat-task] time[datetime]')`, |
| - "task plan actions": `!!document.querySelector('[equipo-models]') && !!document.querySelector('[equipo-task-link]')`, |
| - "composer placeholder and project": `!!document.querySelector('#chat-body[placeholder][aria-label]') && (location.pathname!=='/conversation' || !!document.querySelector('#composer select[name="project_id"]')) && !document.querySelector('#composer label')`, |
| - } { |
| - checks[name] = expression |
| - } |
| - } |
| - for name, expression := range checks { |
| - if !harness.Evaluate[bool](rig, expression) { |
| - t.Fatal(name) |
| - } |
| - } |
| -} |
diff --git a/internal/equipotest/foundation_test.go b/internal/equipotest/foundation_test.go| index 04975a1b..4b09c5fd 100644 |
| --- a/internal/equipotest/foundation_test.go |
| +++ b/internal/equipotest/foundation_test.go |
| @@ -175,7 +175,7 @@ func TestFoundationMigratesTwice(t *testing.T) { |
| // on a runner host, so the fake make sees what each step asks for. |
| func TestCIGateSteps(t *testing.T) { |
| root := filepath.Join("..", "..") |
| - want := []string{"build", "vet", "fmt-check", "staticcheck", "govulncheck", "gitleaks", "budget", "test", "test-quarantine", "runner-host", "runner-dead-references", "migration-check", "perf"} |
| + want := []string{"copy-release-check", "build", "vet", "fmt-check", "staticcheck", "govulncheck", "gitleaks", "budget", "test", "test-quarantine", "runner-host", "runner-dead-references", "migration-check", "perf"} |
| sort.Strings(want) |
| // The step scripts run outside this process; their bytes are inputs. |
| testci.Files(t, filepath.Join(root, ".amadan"), filepath.Join(root, "scripts", "ci-test.py"), filepath.Join(root, "scripts", "ci-box.py")) |
diff --git a/internal/equipotest/optimistic_browser_test.go b/internal/equipotest/optimistic_browser_test.go| deleted file mode 100644 |
| index 83038478..00000000 |
| --- a/internal/equipotest/optimistic_browser_test.go |
| +++ /dev/null |
| @@ -1,82 +0,0 @@ |
| -//go:build browser |
| - |
| -package equipotest |
| - |
| -import ( |
| - "net/http" |
| - "testing" |
| - |
| - "amadan.net/oficina/equipo/internal/browsertest" |
| - "amadan.net/oficina/equipo/internal/equipo" |
| - "amadan.net/rastrillo/rastrillo/harness" |
| - "github.com/chromedp/chromedp" |
| - "github.com/chromedp/chromedp/kb" |
| -) |
| - |
| -func TestOptimisticChat(t *testing.T) { |
| - d, _ := foundationDB(t) |
| - mailer := &capturingMailer{} |
| - var router http.Handler |
| - rig := harness.New(t, func(origin string) http.Handler { |
| - cfg := testConfig(origin) |
| - var err error |
| - router, err = equipo.Router(d, cfg, mailer, nil) |
| - executionMust(t, err) |
| - return equipo.Mux(router) |
| - }) |
| - t.Cleanup(func() { equipo.CloseLive(router) }) |
| - browserSignin(t, rig, mailer) |
| - rig.Run(chromedp.Navigate(rig.Origin + "/conversation")) |
| - // Hold only the POST. Live refreshes still race with the optimistic bubble. |
| - harness.Evaluate[bool](rig, `(()=>{window.beforeSend=document.getElementById('conversation-feed').cloneNode(true);const real=window.realFetch=window.fetch;window.posts=0;window.fetch=(u,o)=>{if(o&&o.method==='POST'){window.posts++;window.postedAt=performance.now();return new Promise((resolve,reject)=>{window.deliver=()=>real(u,o).then(resolve,reject);window.fail=()=>reject(new TypeError('offline'))})}return real(u,o)};return true})()`) |
| - check := func(expression, why string) { |
| - t.Helper() |
| - if !harness.Evaluate[bool](rig, expression) { |
| - t.Fatal(why) |
| - } |
| - } |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`#chat-body`), "Immediate <safe> message"), chromedp.KeyEvent(kb.Enter)) |
| - check(`document.querySelector('[data-pending]').textContent.includes('Immediate <safe> message')`, "sent message missing before HTTP completes") |
| - check(`document.querySelector('[data-pending] [equipo-send-status]').textContent===''`, "sending state appeared before 500 ms") |
| - rig.Run(browsertest.Wait(`performance.now()-window.postedAt>=250`)) |
| - check(`document.querySelector('[data-pending] [equipo-send-status]').textContent===''`, "sending state appeared within 250 ms") |
| - rig.Run(browsertest.Wait(`document.querySelector('[data-pending] [equipo-send-status]').textContent.length>0`)) |
| - harness.Evaluate[bool](rig, `(()=>{const feed=document.getElementById('conversation-feed');const copy=feed.cloneNode(true);copy.querySelectorAll('[data-pending]').forEach(n=>n.remove());feed.replaceWith(copy);return true})()`) |
| - rig.Run(browsertest.Wait(`document.querySelectorAll('[data-pending]').length===1`)) |
| - harness.Evaluate[bool](rig, `(window.fail(),true)`) |
| - rig.Run(browsertest.Wait(`!!document.querySelector('[data-pending] button')`)) |
| - rig.Run(chromedp.Click(chromedp.CSS(`[data-pending] button`))) |
| - check(`window.posts===2`, "retry did not post") |
| - harness.Evaluate[bool](rig, `(window.deliver(),true)`) |
| - rig.Run(browsertest.Wait(`!document.querySelector('[data-pending]') && document.querySelector('[data-message] [equipo-message-body]').textContent==='Immediate <safe> message'`)) |
| - check(`document.querySelectorAll('[data-message]').length>=1 && !document.querySelector('safe')`, "message HTML was interpreted") |
| - if scalar(t, d, "SELECT count(*) FROM conversation_messages WHERE body='Immediate <safe> message'") != 1 { |
| - t.Fatal("retry duplicated message") |
| - } |
| - // A live GET started before the send can arrive after its POST response. |
| - harness.Evaluate[bool](rig, `(document.getElementById('conversation-feed').replaceWith(window.beforeSend),true)`) |
| - rig.Run(browsertest.Wait(`Array.from(document.querySelectorAll('[data-message] [equipo-message-body]')).filter(n=>n.textContent==='Immediate <safe> message').length===1`)) |
| - // Identical text in separate sends must keep separate identities. |
| - harness.Evaluate[bool](rig, `(()=>{const real=window.fetch;window.fetch=(u,o)=>real(u,o);return true})()`) |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`#chat-body`), "Same body"), chromedp.KeyEvent(kb.Enter)) |
| - harness.Evaluate[bool](rig, `(window.deliver(),true)`) |
| - rig.Run(browsertest.Wait(`!document.querySelector('[data-pending]')`)) |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`#chat-body`), "Same body"), chromedp.KeyEvent(kb.Enter)) |
| - harness.Evaluate[bool](rig, `(window.deliver(),true)`) |
| - rig.Run(browsertest.Wait(`!document.querySelector('[data-pending]')`)) |
| - if scalar(t, d, "SELECT count(*) FROM conversation_messages WHERE body='Same body'") != 2 { |
| - t.Fatal("identical messages were conflated") |
| - } |
| - // A committed write with a lost response retries the original request ID. |
| - harness.Evaluate[bool](rig, `(()=>{let drop=true;window.fetch=(u,o)=>{if(o&&o.method==='POST')return window.realFetch(u,o).then(r=>{if(drop){drop=false;throw new TypeError('lost response')}return r});if(o&&o.headers&&new Headers(o.headers).has('Rastrillo-Fragment'))return new Promise(()=>{});return window.realFetch(u,o)};return true})()`) |
| - rig.Run(chromedp.SendKeys(chromedp.CSS("#chat-body"), "Committed once"), chromedp.KeyEvent(kb.Enter)) |
| - rig.Run(browsertest.Wait(`!!document.querySelector('[data-pending] button')`)) |
| - if scalar(t, d, "SELECT count(*) FROM conversation_messages WHERE body='Committed once'") != 1 { |
| - t.Fatal("lost-response control did not commit") |
| - } |
| - rig.Run(chromedp.Click(chromedp.CSS(`[data-pending] button`)), browsertest.Wait(`!document.querySelector('[data-pending]')`)) |
| - if scalar(t, d, "SELECT count(*) FROM conversation_messages WHERE body='Committed once'") != 1 { |
| - t.Fatal("lost-response retry duplicated message") |
| - } |
| - |
| -} |
diff --git a/internal/equipotest/task_browser_test.go b/internal/equipotest/task_browser_test.go| deleted file mode 100644 |
| index 1df9319a..00000000 |
| --- a/internal/equipotest/task_browser_test.go |
| +++ /dev/null |
| @@ -1,92 +0,0 @@ |
| -//go:build browser |
| - |
| -package equipotest |
| - |
| -import ( |
| - "amadan.net/oficina/equipo/internal/browsertest" |
| - "context" |
| - "fmt" |
| - "net/http" |
| - "os" |
| - "strings" |
| - "testing" |
| - |
| - "amadan.net/oficina/equipo/internal/equipo" |
| - "amadan.net/rastrillo/rastrillo/harness" |
| - "github.com/chromedp/cdproto/cdp" |
| - "github.com/chromedp/cdproto/emulation" |
| - "github.com/chromedp/chromedp" |
| - "github.com/chromedp/chromedp/kb" |
| -) |
| - |
| -func TestRunnerTaskBrowserWalk(t *testing.T) { |
| - f := bugFixture(t) |
| - task := bugTask(t, f) |
| - long := strings.Repeat("Long bug description ", 30) |
| - mustSQL(t, f.d, "UPDATE tasks SET description=? WHERE id=?", long, task.ID) |
| - mailer := &capturingMailer{} |
| - var router http.Handler |
| - rig := harness.New(t, func(origin string) http.Handler { |
| - cfg := testConfig(origin) |
| - r, err := equipo.RouterWithStore(f.d, cfg, mailer, nil, f.s) |
| - executionMust(t, err) |
| - router = r |
| - return equipo.Mux(r) |
| - }, harness.WithScrollbars()) |
| - t.Cleanup(func() { equipo.CloseLive(router) }) |
| - noJS := os.Getenv("EQUIPO_BROWSER_NO_JS") == "1" |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, emulation.SetScriptExecutionDisabled, emulation.SetScriptExecutionDisabledParams{Value: noJS}) |
| - return err |
| - })) |
| - // Normal motion is retained: shell transitions run in this walk. |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, emulation.SetEmulatedMedia, emulation.SetEmulatedMediaParams{Features: []*emulation.MediaFeature{{Name: "prefers-reduced-motion", Value: "no-preference"}}}) |
| - return err |
| - })) |
| - browserSignin(t, rig, mailer) |
| - |
| - check := func(expression, reason string) { |
| - t.Helper() |
| - if !harness.Evaluate[bool](rig, expression) { |
| - t.Fatal(reason) |
| - } |
| - } |
| - for _, width := range []int64{1280, 390} { |
| - rig.Run(chromedp.EmulateViewport(width, 900)) |
| - for _, path := range []string{"/work", "/journey", "/needs-you", "/tasks/" + task.ID, "/connections", "/settings/recovery", "/settings/recovery/release", "/specialists/product", "/specialists/design", "/specialists/copy", "/specialists/engineering", "/specialists/review", "/tasks/new"} { |
| - rig.Run(chromedp.Navigate(rig.Origin+path), browsertest.Wait(`!document.documentElement.matches(":active-view-transition") && document.getAnimations().every(a=>a.playState!=="running")`)) |
| - check(`document.documentElement.scrollWidth<=innerWidth && document.body.scrollWidth<=innerWidth`, fmt.Sprintf("overflow %s at %d", path, width)) |
| - if path != "/work" { |
| - check(`document.querySelectorAll('[aria-current="page"]').length===1`, "one active destination") |
| - } |
| - rig.Screen("body", fmt.Sprintf("task16 %s %d", path, width)) |
| - if path == "/journey" { |
| - browsertest.Screenshot(t, rig, fmt.Sprintf("task16-%d", width)) |
| - } |
| - } |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`[name="description"]`), "Keep my draft")) |
| - _, err := f.s.CreateBug(connectionContext, ownerActor, f.project.ID, "another task", fmt.Sprintf("browser-%d", width)) |
| - executionMust(t, err) |
| - check(`document.querySelector('[name="description"]').value==='Keep my draft' && document.activeElement.name==='description'`, "draft or focus lost") |
| - rig.Run(browsertest.Click(`form[action="/tasks"] button`), browsertest.Wait(`location.pathname.startsWith('/tasks/') && location.pathname!=='/tasks/new'`)) |
| - check(`document.querySelector('#activity').textContent.includes('Keep my draft')`, "scriptless form did not reach task detail") |
| - rig.Run(chromedp.Navigate(rig.Origin+"/specialists/engineering"), browsertest.Wait(`!document.documentElement.matches(":active-view-transition")`)) |
| - rig.Run(chromedp.SendKeys(chromedp.CSS(`[name="standing_instructions"]`), "Keep specialist edit")) |
| - _, err = f.s.CreateBug(connectionContext, ownerActor, f.project.ID, fmt.Sprintf("live visible %d", width), fmt.Sprintf("live-%d", width)) |
| - executionMust(t, err) |
| - if !noJS { |
| - rig.Run(browsertest.Wait(fmt.Sprintf(`document.querySelector('#activity').textContent.includes(%q)`, fmt.Sprintf("live visible %d", width)))) |
| - } |
| - check(`document.querySelector('[name="standing_instructions"]').value.includes('Keep specialist edit') && document.activeElement.name==='standing_instructions'`, "live region replaced form focus or edits") |
| - rig.Run(chromedp.Navigate(rig.Origin+"/journey"), browsertest.Wait(`!document.documentElement.matches(":active-view-transition")`), chromedp.KeyEvent(kb.Tab)) |
| - check(`document.activeElement.matches('[rst-skip]')`, "keyboard skip order") |
| - if width == 390 { |
| - rig.Run(chromedp.KeyEvent(kb.Tab)) |
| - check(`document.activeElement.rel==='up'`, "phone back keyboard order") |
| - rig.Run(chromedp.KeyEvent(kb.Enter), browsertest.Wait(`location.pathname==='/work'`)) |
| - check(`location.hash==='#nav-journey'`, "phone back target") |
| - } |
| - } |
| - t.Logf("normal motion, 1280 and 390, scripts disabled: %t", noJS) |
| -} |
diff --git a/internal/fakeclaude/fake.go b/internal/fakeclaude/fake.go| index b06c72cd..51edb54c 100644 |
| --- a/internal/fakeclaude/fake.go |
| +++ b/internal/fakeclaude/fake.go |
| @@ -69,6 +69,11 @@ |
| // "asksleep:<ms>" pauses before the reply. |
| // Native tools in system/init are those of --tools. |
| // |
| +// Several messages in one turn: when the newest part of the prompt holds |
| +// "Message <i> of <n>:" headers (the instance's batch), the reply ends |
| +// "You sent <n> messages: <i>/<n> <first line> [<files>]; ...", in the |
| +// order the prompt gives them, so a test sees each one arrived apart. |
| +// |
| // Setup tokens: with CLAUDE_CODE_OAUTH_TOKEN in its environment the fake |
| // is signed in by that token, as the pinned CLI is: `auth status` says |
| // logged in for any token at all, never asking the server (with the |
| @@ -719,7 +724,9 @@ func (f *fake) serve(stdin io.Reader, stdout, stderr io.Writer) int { |
| if strings.Contains(prompt, "Conversation so far") { |
| reply += " I see the earlier conversation." |
| } |
| - if strings.Contains(prompt, "\n\n") && !strings.Contains(prompt, "Newest message") { |
| + if seen := batchMessages(newest); len(seen) > 0 { |
| + reply += fmt.Sprintf(" You sent %d messages: %s.", len(seen), strings.Join(seen, "; ")) |
| + } else if strings.Contains(prompt, "\n\n") && !strings.Contains(prompt, "Newest message") { |
| reply += fmt.Sprintf(" You sent %d messages.", strings.Count(prompt, "\n\n")+1) |
| } |
| if strings.Contains(prompt, "=== Your notebook") { |
| @@ -921,6 +928,32 @@ func (f *fake) serve(stdin io.Reader, stdout, stderr io.Writer) int { |
| var moveInPause = regexp.MustCompile(`movein-pause:([0-9]+)`) |
| +// batchHeader opens each message of a turn that carries several, as the |
| +// instance writes them: "Message 2 of 3" and, when it has files, |
| +// " (attached: a.png, b.md)", then a colon and the message. |
| +var batchHeader = regexp.MustCompile(`(?m)^Message ([0-9]+) of ([0-9]+)(?: \(attached: ([^)\n]*)\))?:$`) |
| + |
| +// batchMessages reads the separate messages of a turn that carries |
| +// several, in the order the prompt gives them: each message's first line, |
| +// with its files in brackets. Nothing when the turn has one message. |
| +func batchMessages(newest string) []string { |
| + heads := batchHeader.FindAllStringSubmatchIndex(newest, -1) |
| + out := make([]string, 0, len(heads)) |
| + for i, h := range heads { |
| + end := len(newest) |
| + if i+1 < len(heads) { |
| + end = heads[i+1][0] |
| + } |
| + body := strings.TrimSpace(newest[h[1]:end]) |
| + first, _, _ := strings.Cut(body, "\n") |
| + if h[6] >= 0 { |
| + first += " [" + newest[h[6]:h[7]] + "]" |
| + } |
| + out = append(out, newest[h[2]:h[3]]+"/"+newest[h[4]:h[5]]+" "+first) |
| + } |
| + return out |
| +} |
| + |
| // attachmentPath is an attached file's path in the namespace. |
| var attachmentPath = regexp.MustCompile(`/workspace/attachments/at_[a-z0-9]+/[^\s:]+`) |
diff --git a/internal/headless/batching_test.go b/internal/headless/batching_test.go| new file mode 100644 |
| index 00000000..20e24470 |
| --- /dev/null |
| +++ b/internal/headless/batching_test.go |
| @@ -0,0 +1,188 @@ |
| +package headless |
| + |
| +import ( |
| + "encoding/json" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/thintest" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// TestHeadlessTurnBatching: three messages sent while a slow turn runs |
| +// wait together, each in its own bubble. When the slow turn ends, one |
| +// turn picks all three up; the coordinator gets them in order, as |
| +// separate messages with their files, and answers once. The spend lines |
| +// it logs are the turns and input tokens of the batch beside the same |
| +// three messages sent one at a time. |
| +func TestHeadlessTurnBatching(t *testing.T) { |
| + env, inst, r := localEnv(t) |
| + r.start(t) |
| + s := open(t, env) |
| + busy := s.send(t, "Take your time with this one. sleep:4000") |
| + s.waitTurn(t, busy.Turn.ID, wire.TurnRunning) |
| + notes := upload(t, s, "notes.md", "text/markdown", []byte("# Notes\n\nStep three fails.\n")) |
| + sent := []wire.Sent{s.send(t, "alpha first"), sendWith(t, s, "bravo second", notes), s.send(t, "charlie third")} |
| + batch := sent[0].Turn.ID |
| + for i, m := range sent { |
| + if m.Turn.ID != batch || m.Turn.ID == busy.Turn.ID || m.Turn.State != wire.TurnQueued { |
| + t.Fatalf("message %d went to turn %s (%s), not the queued turn %s", i+1, m.Turn.ID, m.Turn.State, batch) |
| + } |
| + } |
| + if ids := sent[2].Turn.MessageIDs; len(ids) != 3 || ids[0] != sent[0].Message.ID || ids[1] != sent[1].Message.ID || ids[2] != sent[2].Message.ID { |
| + t.Fatalf("queued turn holds %v", ids) |
| + } |
| + // Each message keeps its own bubble, in order, in the queued turn; the |
| + // quiet note waits under the latest. |
| + page := inst.Get(t, "/conversation") |
| + at := -1 |
| + for i, m := range sent { |
| + bubble := `data-message="` + m.Message.ID + `" data-turn-id="` + batch + `"` |
| + n := strings.Index(page, bubble) |
| + if n < 0 || n < at || strings.Count(page, `data-message="`+m.Message.ID+`"`) != 1 { |
| + t.Fatalf("bubble %d missing, repeated or out of order", i+1) |
| + } |
| + at = n |
| + } |
| + const note = "<p equipo-card-note data-queued>" |
| + if strings.Count(page, note) != 1 || strings.Index(page, note) < at { |
| + t.Fatalf("queued note not once under the latest message") |
| + } |
| + s.waitTurn(t, busy.Turn.ID, wire.TurnReplied) |
| + reply := replyOf(t, s, batch) |
| + // Exactly one next turn: the batch, and no turn for any one message. |
| + var turns int |
| + if err := inst.DB.Writer().QueryRow("SELECT count(*) FROM chat_turns").Scan(&turns); err != nil { |
| + t.Fatal(err) |
| + } |
| + if turns != 2 { |
| + t.Fatalf("%d turns for one slow message and three queued ones", turns) |
| + } |
| + s.conv.Locked(func(c *thintest.Conversation) { |
| + if got := c.Turns[batch].MessageIDs; len(got) != 3 || len(c.Replies()) != 2 { |
| + t.Fatalf("batch picked up %v; %d replies", got, len(c.Replies())) |
| + } |
| + }) |
| + if page = inst.Get(t, "/conversation"); strings.Contains(page, note) { |
| + t.Fatal("queued note still shows after the turn picked the messages up") |
| + } |
| + // Spend goes to the turn: one usage row for the batch beside the slow |
| + // turn's own, none for any one message. |
| + if rows := logSpend(t, inst, "batched", batch); rows != 1 || logSpend(t, inst, "slow", busy.Turn.ID) != 1 { |
| + t.Fatalf("batch has %d usage rows", rows) |
| + } |
| + var usage int |
| + if err := inst.DB.Writer().QueryRow("SELECT count(*) FROM chat_usage WHERE role = 'coordinator'").Scan(&usage); err != nil || usage != 2 { |
| + t.Fatalf("%d coordinator usage rows for two turns: %v", usage, err) |
| + } |
| + // The coordinator's input: one frame naming each message apart, in |
| + // order, with its file. |
| + cmds := messageCommands(t, inst, batch) |
| + if len(cmds) != 1 { |
| + t.Fatalf("%d message commands for the batch", len(cmds)) |
| + } |
| + text, last := cmds[0].Text, -1 |
| + for _, want := range []string{"Message 1 of 3:\nalpha first", "Message 2 of 3 (attached: notes.md):\nbravo second", "Message 3 of 3:\ncharlie third"} { |
| + n := strings.Index(text, want) |
| + if n <= last { |
| + t.Fatalf("turn input lacks %q in order:\n%s", want, text) |
| + } |
| + last = n |
| + } |
| + if p := cmds[0].PersonText; len(p) != 3 || p[0] != "alpha first" || p[1] != "bravo second" || p[2] != "charlie third" { |
| + t.Fatalf("person text %q", p) |
| + } |
| + if len(cmds[0].Attachments) != 1 || cmds[0].Attachments[0].ID != notes.ID { |
| + t.Fatalf("attachments %+v", cmds[0].Attachments) |
| + } |
| + if want := "You sent 3 messages: 1/3 alpha first; 2/3 bravo second [notes.md]; 3/3 charlie third."; !strings.Contains(reply.Text, want) { |
| + t.Fatalf("coordinator did not see three messages apart: %q", reply.Text) |
| + } |
| + // The same three words one at a time, each after the last reply: what |
| + // the person pays when nothing is running to batch behind. |
| + for i, text := range []string{"alpha first", "bravo second", "charlie third"} { |
| + one := s.send(t, text) |
| + replyOf(t, s, one.Turn.ID) |
| + logSpend(t, inst, "alone "+string(rune('1'+i)), one.Turn.ID) |
| + } |
| +} |
| + |
| +// messageCommands are the message frames the instance wrote for a turn. |
| +func messageCommands(t *testing.T, inst *thintest.Instance, turn string) []wire.MessageCommand { |
| + t.Helper() |
| + rows, err := inst.DB.Writer().Query("SELECT body FROM runner_commands WHERE kind = ? ORDER BY seq", wire.FrameMessage) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer rows.Close() |
| + var out []wire.MessageCommand |
| + for rows.Next() { |
| + var body string |
| + var m wire.MessageCommand |
| + if err := rows.Scan(&body); err != nil || json.Unmarshal([]byte(body), &m) != nil { |
| + t.Fatalf("command %v", err) |
| + } |
| + if m.TurnID == turn { |
| + out = append(out, m) |
| + } |
| + } |
| + return out |
| +} |
| + |
| +// logSpend logs a coordinator turn's recorded usage (rows, input and |
| +// cached input tokens) and returns its row count. |
| +func logSpend(t *testing.T, inst *thintest.Instance, label, turn string) int64 { |
| + t.Helper() |
| + var rows, input, cached int64 |
| + if err := inst.DB.Writer().QueryRow("SELECT count(*), coalesce(sum(input_tokens), 0), coalesce(sum(cached_input_tokens), 0) FROM chat_usage WHERE turn_id = ? AND role = 'coordinator'", turn).Scan(&rows, &input, &cached); err != nil { |
| + t.Fatal(err) |
| + } |
| + if rows == 0 { |
| + t.Fatalf("no usage recorded for turn %s", turn) |
| + } |
| + t.Logf("spend %s: turn %s, %d usage rows, %d input tokens, %d cached", label, turn, rows, input, cached) |
| + return rows |
| +} |
| + |
| +// TestHeadlessBatchAfterRefusedReply: when the instance cannot start the |
| +// next turn, the reply that ended the slow one rolls back with it. The |
| +// real runner is not told it was revoked: it reconnects, sends the reply |
| +// again once the instance can take it, and the batch goes once. |
| +func TestHeadlessBatchAfterRefusedReply(t *testing.T) { |
| + env, inst, r := localEnv(t) |
| + r.start(t) |
| + s := open(t, env) |
| + s.keep() |
| + busy := s.send(t, "Take your time with this one. sleep:3000") |
| + s.waitTurn(t, busy.Turn.ID, wire.TurnRunning) |
| + a, b := s.send(t, "alpha first"), s.send(t, "bravo second") |
| + db := inst.DB.Writer() |
| + if _, err := db.Exec(`CREATE TRIGGER refuse_next BEFORE INSERT ON runner_commands WHEN NEW.kind = 'message' BEGIN SELECT RAISE(ABORT, 'refused'); END`); err != nil { |
| + t.Fatal(err) |
| + } |
| + for deadline := time.Now().Add(time.Minute); strings.Count(inst.Logs(), "refused") < 2; time.Sleep(100 * time.Millisecond) { |
| + if time.Now().After(deadline) { |
| + t.Fatal("the reply was never refused twice") |
| + } |
| + } |
| + select { |
| + case err := <-r.done: |
| + t.Fatalf("the runner stopped: %v", err) |
| + default: |
| + } |
| + if st, err := env.Client.Turn(s.ctx, busy.Turn.ID); err != nil || st.State != wire.TurnRunning { |
| + t.Fatalf("slow turn %+v %v while its successor is refused", st, err) |
| + } |
| + if _, err := db.Exec(`DROP TRIGGER refuse_next`); err != nil { |
| + t.Fatal(err) |
| + } |
| + replyOf(t, s, busy.Turn.ID) |
| + reply := replyOf(t, s, a.Turn.ID) |
| + if b.Turn.ID != a.Turn.ID || !strings.Contains(reply.Text, "You sent 2 messages: 1/2 alpha first; 2/2 bravo second.") { |
| + t.Fatalf("batch %s/%s answered %q", a.Turn.ID, b.Turn.ID, reply.Text) |
| + } |
| + if cmds := messageCommands(t, inst, a.Turn.ID); len(cmds) != 1 { |
| + t.Fatalf("%d frames for the batch", len(cmds)) |
| + } |
| +} |
diff --git a/internal/headless/browser_review_test.go b/internal/headless/browser_review_test.go| index fd874c57..ab8b7941 100644 |
| --- a/internal/headless/browser_review_test.go |
| +++ b/internal/headless/browser_review_test.go |
| @@ -11,8 +11,10 @@ import ( |
| // Paul, staging 71ce51b: the task receipt follows the task live, with no |
| // reload: In progress, then the pushed branch and its short SHA, In |
| -// review while checks and review run, then Ready to merge with what they |
| -// found and the one prominent decision, Open on Amadan to merge. |
| +// review while checks and review run, then what they found. Since slice |
| +// 4c Equipo merges a task whose checks passed and whose review approved, |
| +// so the receipt ends at Done, merged into main, with the link to the |
| +// repository; there is no merge for the person to make. |
| func TestBrowserReceiptFollowsReview(t *testing.T) { |
| _, inst, r := localEnv(t) |
| r.start(t) |
| @@ -24,12 +26,13 @@ func TestBrowserReceiptFollowsReview(t *testing.T) { |
| card := taskCard("Fix the README typo") |
| stage := card + `?.querySelector('[equipo-stage]')?.textContent` |
| p.run(browsertest.Wait(stage + `==='In progress'`)) |
| - p.run(browsertest.Wait(`(()=>{const c=` + card + `;return !!c && c.querySelector('[equipo-stage]').textContent==='In review' && /^Pushed equipo\/tk[a-z0-9]+-fix-the-readme-typo at [0-9a-f]{7}$/.test(c.querySelector('[data-pushed] span').textContent)})()`)) |
| - p.run(browsertest.Wait(`(()=>{const c=` + card + `;return c.querySelector('[data-verdict]')?.textContent==='Reviewing…' && c.querySelector('[data-checks]')?.textContent==='Checks passed (make ci)'})()`)) |
| - p.run(browsertest.Wait(`(()=>{const c=` + card + `;const b=c.querySelector('[data-merge]');return c.querySelector('[equipo-stage]').textContent==='Ready to merge' && c.querySelector('[data-verdict]').textContent==='Approved (same family, same account)' && !!b && b.textContent==='Open on Amadan to merge' && b.target==='_blank' && b.href.startsWith('https://amadan.net/oficina/sample?branch=equipo/')})()`)) |
| + // The step and the review each sleep 2.5 s on purpose: these waits are |
| + // on that work, so they get the window the rail drive gives it. |
| + p.run(browsertest.WaitWithin(`(()=>{const c=`+card+`;return !!c && c.querySelector('[equipo-stage]').textContent==='In review' && /^Pushed equipo\/tk[a-z0-9]+-fix-the-readme-typo at [0-9a-f]{7}$/.test(c.querySelector('[data-pushed] span').textContent)})()`, 20*time.Second)) |
| + p.run(browsertest.WaitWithin(`(()=>{const c=`+card+`;return c.querySelector('[data-verdict]')?.textContent==='Reviewing…' && c.querySelector('[data-checks]')?.textContent==='Checks passed (make ci)'})()`, 20*time.Second)) |
| + p.run(browsertest.WaitWithin(`(()=>{const c=`+card+`;const m=c.querySelector('[data-merged]');const a=m?.querySelector('[data-open-amadan]');return c.querySelector('[equipo-stage]').textContent==='Done' && c.querySelector('[data-verdict]').textContent==='Approved (same family, same account)' && !!m && /^Merged into main at [0-9a-f]{7}$/.test(m.querySelector('span').textContent) && !c.querySelector('[data-pushed]') && !!a && a.textContent==='Open on Amadan' && a.target==='_blank' && a.href.startsWith('https://amadan.net/oficina/sample')})()`, 20*time.Second)) |
| p.check(`performance.getEntriesByType('navigation').length===window.__nav`, "the page reloaded") |
| - // The decision is the one prominent control: visible and in reach on a phone. |
| - p.check(`(()=>{const b=`+card+`.querySelector('[data-merge]').getBoundingClientRect();return b.width>0 && b.height>=36})()`, "merge button hidden") |
| + p.check(`(()=>{const b=`+card+`.querySelector('[data-merged] [data-open-amadan]').getBoundingClientRect();return b.width>0 && b.height>0})()`, "the link to the merge is hidden") |
| } |
| // Paul, staging: the sidebar reads the thin core and follows the stream. |
diff --git a/internal/headless/browser_thread_test.go b/internal/headless/browser_thread_test.go| index 99bdef14..b1fd3c7f 100644 |
| --- a/internal/headless/browser_thread_test.go |
| +++ b/internal/headless/browser_thread_test.go |
| @@ -70,10 +70,12 @@ func TestBrowserTaskThread(t *testing.T) { |
| p.check(`(`+effectiveBackground+`)(document.querySelector('#chat-composer'))===(`+effectiveBackground+`)(document.querySelector('[equipo-thread]'))`, "the dock is not the page's colour") |
| p.check(`getComputedStyle(document.querySelector('#chat-composer')).position==='sticky'`, "the composer is not docked") |
| // Ask: the question at once, then the answer streams and settles. |
| + // The session's own last reply leads it: Engineering's headline, |
| + // then its summary (as the API answer in ask_test.go). |
| p.check(`(()=>{document.querySelector('#chat-body').value='What did you change and why? ask:git';document.querySelector('#composer').requestSubmit();return true})()`, "ask") |
| p.check(`[...document.querySelectorAll('[equipo-thread] [equipo-message="own"] [equipo-message-body]')].some(e=>e.textContent.startsWith('What did you change'))`, "the question did not show at once") |
| p.run(browsertest.Wait(`(()=>{const e=document.querySelector('[equipo-thread] [equipo-thinking]');if(!e)return false;e.__live=true;return e.querySelector('[data-who]').textContent==='Engineering'})()`)) |
| - p.run(browsertest.Wait(`(()=>{const a=document.querySelector('[equipo-thread] [equipo-message="incoming"][data-turn-id]');return !!a && a.__live===true && !a.hasAttribute('equipo-thinking') && a.textContent.includes('From my session: Replaced') && a.textContent.includes('The change: +')})()`)) |
| + p.run(browsertest.Wait(`(()=>{const a=document.querySelector('[equipo-thread] [equipo-message="incoming"][data-turn-id]');return !!a && a.__live===true && !a.hasAttribute('equipo-thinking') && a.textContent.includes('From my session: Headline: Made the change the task asks for.') && a.textContent.includes('Replaced "teh panes" with "the panes" in README.md.') && a.textContent.includes('The change: +')})()`)) |
| p.check(`performance.getEntriesByType('navigation').length===window.__nav`, "the page reloaded") |
| p.check(`document.querySelector('[data-ask-specialist]').value===''`, "the next question keeps the last choice") |
| p.stop() |
diff --git a/internal/plan3test/conversation_layout_browser_test.go b/internal/plan3test/conversation_layout_browser_test.go| deleted file mode 100644 |
| index b99d2600..00000000 |
| --- a/internal/plan3test/conversation_layout_browser_test.go |
| +++ /dev/null |
| @@ -1,118 +0,0 @@ |
| -//go:build browser |
| - |
| -package plan3test |
| - |
| -import ( |
| - "amadan.net/oficina/equipo/internal/equipo" |
| - "amadan.net/rastrillo/rastrillo/harness" |
| - "context" |
| - "fmt" |
| - "github.com/chromedp/cdproto/cdp" |
| - "github.com/chromedp/cdproto/network" |
| - "github.com/chromedp/chromedp" |
| - "github.com/chromedp/chromedp/kb" |
| - "net/http" |
| - "os/exec" |
| - "strings" |
| - "testing" |
| - "time" |
| -) |
| - |
| -func TestConversationLayout(t *testing.T) { |
| - found := false |
| - for _, name := range []string{"chromium", "chromium-browser", "google-chrome", "google-chrome-stable"} { |
| - if _, err := exec.LookPath(name); err == nil { |
| - found = true |
| - break |
| - } |
| - } |
| - if !found { |
| - t.Skip("Chrome/Chromium is unavailable locally; conversation layout requires the existing chromedp browser fixture") |
| - } |
| - f := newFixture(t) |
| - p := proposed(t, f) |
| - p.Steps[1].SelectionReason = strings.Repeat("A long reason for this selection ", 30) |
| - var err error |
| - p, err = f.Store.EditPlan(ctx, owner, p, equipo.Mutation{RequestID: "browser-reason", Revision: p.Revision}) |
| - must(t, err) |
| - liveFixture(t, f) |
| - rig := harness.New(t, func(string) http.Handler { return f.Handler }, harness.WithScrollbars()) |
| - cookie := f.Cookies[owner.Address] |
| - rig.Run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, network.SetCookie, network.SetCookieParams{Name: cookie.Name, Value: cookie.Value, URL: rig.Origin, Path: "/"}) |
| - return err |
| - })) |
| - for _, width := range []int64{390, 1280} { |
| - for _, scale := range []int{100, 200} { |
| - rig.Run(chromedp.EmulateViewport(width, 900), chromedp.Navigate(rig.Origin+"/conversation")) |
| - harness.Evaluate[bool](rig, fmt.Sprintf(`(document.documentElement.style.fontSize='%d%%',true)`, scale)) |
| - if !harness.Evaluate[bool](rig, `document.documentElement.scrollWidth<=innerWidth && getComputedStyle(document.querySelector('[equipo-conversation]')).flexDirection==='column'`) { |
| - t.Fatal("conversation overflow or split screen") |
| - } |
| - if !harness.Evaluate[bool](rig, `Array.from(document.querySelectorAll('[equipo-value],[equipo-badge]')).every(e=>getComputedStyle(e).whiteSpace==='nowrap')`) { |
| - t.Fatal("wrapping values or badges") |
| - } |
| - if !harness.Evaluate[bool](rig, `Array.from(document.querySelectorAll('[equipo-card],[equipo-note]')).every(e=>{let s=getComputedStyle(e);return s.borderLeftColor===s.borderRightColor && s.borderLeftWidth===s.borderRightWidth})`) { |
| - t.Fatal("coloured left accent") |
| - } |
| - rig.Run(chromedp.KeyEvent(kb.Tab)) |
| - if !harness.Evaluate[bool](rig, `document.activeElement.matches('[rst-skip]')`) { |
| - t.Fatal("lost keyboard focus") |
| - } |
| - if !harness.Evaluate[bool](rig, `Array.from(document.querySelectorAll('[equipo-secondary]')).every(e=>getComputedStyle(e).textOverflow==='ellipsis' && getComputedStyle(e).whiteSpace==='nowrap') && Array.from(document.querySelectorAll('[rst-person-av]')).every(e=>e.textContent.trim()==='')`) { |
| - t.Fatal("secondary text wraps or initials shown") |
| - } |
| - rig.Run(chromedp.Focus(chromedp.CSS(`#composer textarea`)), chromedp.SendKeys(chromedp.CSS(`#composer textarea`), "Keep this draft")) |
| - msg, err := f.Store.SendMessage(ctx, owner, "", "live arrival", equipo.Mutation{RequestID: fmt.Sprintf("arrival-%d-%d", width, scale)}) |
| - must(t, err) |
| - rig.Run(conversationBrowserWait(fmt.Sprintf(`!!document.querySelector('[data-message="%s"]')`, msg.ID))) |
| - if !harness.Evaluate[bool](rig, `document.activeElement.matches('#composer textarea') && document.activeElement.value==='Keep this draft'`) { |
| - t.Fatal("live invalidation lost composer draft or focus") |
| - } |
| - |
| - if width == 390 && scale == 100 { |
| - for i := 0; i < 8; i++ { |
| - _, err = f.Store.SendMessage(ctx, owner, "", fmt.Sprintf("Warm history %d", i), equipo.Mutation{RequestID: fmt.Sprintf("warm-%d", i)}) |
| - must(t, err) |
| - } |
| - rig.Run(conversationBrowserWait(`document.querySelector('#conversation-feed').textContent.includes('Warm history 7') && document.querySelector('[equipo-scroll]').scrollHeight>document.querySelector('[equipo-scroll]').clientHeight`)) |
| - |
| - harness.Evaluate[bool](rig, `(()=>{const s=document.querySelector('[equipo-scroll]');s.scrollTop=0;s.dispatchEvent(new Event('scroll'));return true})()`) |
| - harness.Evaluate[bool](rig, fmt.Sprintf(`(window.readOffset=document.querySelector('[data-message="%s"]').getBoundingClientRect().top,true)`, msg.ID)) |
| - for i := 0; i < 55; i++ { |
| - _, err = f.Store.SendMessage(ctx, owner, "", fmt.Sprintf("History arrival %d", i), equipo.Mutation{RequestID: fmt.Sprintf("history-%d", i)}) |
| - must(t, err) |
| - } |
| - rig.Run(conversationBrowserWait(`document.querySelector('#conversation-feed').textContent.includes('History arrival 54')`)) |
| - if !harness.Evaluate[bool](rig, fmt.Sprintf(`!!document.querySelector('[data-message="%s"]') && Math.abs(document.querySelector('[data-message="%s"]').getBoundingClientRect().top-window.readOffset)<3`, msg.ID, msg.ID)) { |
| - t.Fatalf("live window discarded the message being read: %s", harness.Evaluate[string](rig, fmt.Sprintf(`JSON.stringify({present:!!document.querySelector('[data-message="%s"]'),before:window.readOffset,after:document.querySelector('[data-message="%s"]')?.getBoundingClientRect().top,top:document.querySelector('[equipo-scroll]').scrollTop,items:Array.from(document.querySelector('[equipo-feed]').children).slice(0,5).map(e=>[e.dataset.sequence,e.dataset.message,e.dataset.entry,e.getBoundingClientRect().top])})`, msg.ID, msg.ID))) |
| - } |
| - } |
| - rig.Run(chromedp.Navigate(rig.Origin + "/tasks/" + p.TaskID + "/plan")) |
| - harness.Evaluate[bool](rig, fmt.Sprintf(`(document.documentElement.style.fontSize='%d%%',true)`, scale)) |
| - if !harness.Evaluate[bool](rig, `document.documentElement.scrollWidth<=innerWidth`) { |
| - t.Fatal("plan overflow") |
| - } |
| - } |
| - } |
| -} |
| - |
| -func conversationBrowserWait(expression string) chromedp.Action[chromedp.Void] { |
| - return chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) |
| - defer cancel() |
| - tick := time.NewTicker(20 * time.Millisecond) |
| - defer tick.Stop() |
| - for { |
| - ok, err := chromedp.Evaluate[bool](expression)(ctx, target) |
| - if err == nil && ok { |
| - return nil |
| - } |
| - select { |
| - case <-ctx.Done(): |
| - return fmt.Errorf("waiting for %s: %w", expression, ctx.Err()) |
| - case <-tick.C: |
| - } |
| - } |
| - }) |
| -} |
diff --git a/internal/plan3test/conversation_layout_test.go b/internal/plan3test/conversation_layout_test.go| deleted file mode 100644 |
| index 94d8bb76..00000000 |
| --- a/internal/plan3test/conversation_layout_test.go |
| +++ /dev/null |
| @@ -1,17 +0,0 @@ |
| -//go:build !browser |
| - |
| -package plan3test |
| - |
| -import ( |
| - "os/exec" |
| - "testing" |
| -) |
| - |
| -func TestConversationLayout(t *testing.T) { |
| - for _, name := range []string{"chromium", "chromium-browser", "google-chrome", "google-chrome-stable"} { |
| - if _, err := exec.LookPath(name); err == nil { |
| - t.Skip("Run with -tags browser to enable the existing chromedp fixtures") |
| - } |
| - } |
| - t.Skip("Chrome/Chromium is unavailable locally; conversation layout requires the existing chromedp browser fixture") |
| -} |
diff --git a/internal/plan3test/teams_navigation_browser_test.go b/internal/plan3test/teams_navigation_browser_test.go| index fdcf750a..565da55e 100644 |
| --- a/internal/plan3test/teams_navigation_browser_test.go |
| +++ b/internal/plan3test/teams_navigation_browser_test.go |
| @@ -3,6 +3,7 @@ |
| package plan3test |
| import ( |
| + "amadan.net/oficina/equipo/internal/testci" |
| "amadan.net/rastrillo/rastrillo/harness" |
| "context" |
| "github.com/chromedp/cdproto/cdp" |
| @@ -10,6 +11,7 @@ import ( |
| "github.com/chromedp/cdproto/network" |
| "github.com/chromedp/chromedp" |
| "net/http" |
| + "os" |
| "os/exec" |
| "strings" |
| "testing" |
| @@ -17,7 +19,9 @@ import ( |
| ) |
| func TestTeamsHierarchyBrowser(t *testing.T) { |
| - found := false |
| + // The browser harness.ChromePath finds: RASTRILLO_CHROME (the CI box |
| + // sets it to its pinned Chromium), or one on PATH. |
| + found := os.Getenv("RASTRILLO_CHROME") != "" |
| for _, name := range []string{"chromium", "chromium-browser", "google-chrome", "google-chrome-stable"} { |
| if _, err := exec.LookPath(name); err == nil { |
| found = true |
| @@ -25,7 +29,7 @@ func TestTeamsHierarchyBrowser(t *testing.T) { |
| } |
| } |
| if !found { |
| - t.Skip("Chrome/Chromium binary unavailable; scriptless Teams hierarchy needs the chromedp fixture") |
| + testci.Absent(t, "Chrome/Chromium binary unavailable; scriptless Teams hierarchy needs the chromedp fixture") |
| } |
| f := newFixture(t) |
| task := f.createTask(t) |
diff --git a/internal/testci/box_test.go b/internal/testci/box_test.go| index fd8de184..0aa7958e 100644 |
| --- a/internal/testci/box_test.go |
| +++ b/internal/testci/box_test.go |
| @@ -61,3 +61,39 @@ func TestBoxPinsMatchTheCode(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// The box's Chromium is a tree of Debian packages (scripts/ci-chromium.json, |
| +// written by scripts/ci-chromium-pin.py): every one fetched by an https URL |
| +// and checked by SHA-256, on both architectures, and the headless shell |
| +// among them at the pinned version. |
| +func TestBoxChromiumPinned(t *testing.T) { |
| + raw, err := os.ReadFile("../../scripts/ci-chromium.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var pinned map[string]json.RawMessage |
| + if err = json.Unmarshal(raw, &pinned); err != nil { |
| + t.Fatal(err) |
| + } |
| + var version string |
| + if err = json.Unmarshal(pinned["version"], &version); err != nil || version == "" { |
| + t.Fatalf("no version: %v", err) |
| + } |
| + digest := regexp.MustCompile(`^[a-f0-9]{64}$`) |
| + for _, arch := range []string{"amd64", "arm64"} { |
| + var packages []struct{ Package, Version, URL, SHA256 string } |
| + if err = json.Unmarshal(pinned[arch], &packages); err != nil || len(packages) == 0 { |
| + t.Fatalf("%s: no packages (%v)", arch, err) |
| + } |
| + shell := false |
| + for _, p := range packages { |
| + if !strings.HasPrefix(p.URL, "https://") || !digest.MatchString(p.SHA256) { |
| + t.Errorf("%s %s: want an https URL and a SHA-256, got %q %q", arch, p.Package, p.URL, p.SHA256) |
| + } |
| + shell = shell || (p.Package == "chromium-headless-shell" && p.Version == version) |
| + } |
| + if !shell { |
| + t.Errorf("%s: no chromium-headless-shell %s among the pinned packages", arch, version) |
| + } |
| + } |
| +} |
diff --git a/internal/thintest/batching_contract_test.go b/internal/thintest/batching_contract_test.go| new file mode 100644 |
| index 00000000..ef5e7a36 |
| --- /dev/null |
| +++ b/internal/thintest/batching_contract_test.go |
| @@ -0,0 +1,429 @@ |
| +package thintest |
| + |
| +import ( |
| + "context" |
| + "fmt" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// Turn batching: messages sent while a turn runs wait in one queued turn |
| +// and go to the coordinator together when it ends, exactly once, however |
| +// it ends and whatever crashes between. The runner here speaks protocol |
| +// 1, the oldest the instance serves. |
| + |
| +// busyWithThree starts a turn, has the runner take it, and queues three |
| +// messages behind it. |
| +func (r *rig) busyWithThree(runner *FakeRunner) (wire.Sent, []wire.Sent) { |
| + r.t.Helper() |
| + busy, err := r.client.Send(r.ctx, "one", "k0") |
| + if err != nil { |
| + r.t.Fatal(err) |
| + } |
| + f, _, err := runner.Expect(r.ctx, wire.FrameMessage) |
| + if err != nil { |
| + r.t.Fatal(err) |
| + } |
| + runner.Send(r.ctx, "a0", wire.FrameAck, wire.Ack{ID: f.ID}) |
| + r.turnIs(busy.Turn.ID, wire.TurnRunning) |
| + var queued []wire.Sent |
| + for i, text := range []string{"alpha", "bravo", "charlie"} { |
| + s, err := r.client.Send(r.ctx, text, "kq"+string(rune('1'+i))) |
| + if err != nil || s.Turn.ID == busy.Turn.ID || s.Turn.State != wire.TurnQueued || len(queued) > 0 && s.Turn.ID != queued[0].Turn.ID { |
| + r.t.Fatalf("message %d: %+v %v", i+1, s.Turn, err) |
| + } |
| + queued = append(queued, s) |
| + } |
| + return busy, queued |
| +} |
| + |
| +// acked waits for the instance's ack of one of the runner's frames. |
| +func (r *rig) acked(runner *FakeRunner, id string) { |
| + r.t.Helper() |
| + for { |
| + _, body, err := runner.Expect(r.ctx, wire.FrameAck) |
| + if err != nil { |
| + r.t.Fatalf("no ack for %s: %v", id, err) |
| + } |
| + if body.(*wire.Ack).ID == id { |
| + return |
| + } |
| + } |
| +} |
| + |
| +// turnIs waits until the API reads a turn in state. |
| +func (r *rig) turnIs(id, state string) wire.Turn { |
| + r.t.Helper() |
| + var got wire.Turn |
| + for deadline := time.Now().Add(10 * time.Second); time.Now().Before(deadline); time.Sleep(20 * time.Millisecond) { |
| + var err error |
| + if got, err = r.client.Turn(r.ctx, id); err == nil && got.State == state { |
| + return got |
| + } |
| + } |
| + r.t.Fatalf("turn %s is %s (%s), not %s", id, got.State, got.Reason, state) |
| + return got |
| +} |
| + |
| +// batchFrame expects the next message frame to be the batch: the three |
| +// messages apart and in order, and nothing else. |
| +func (r *rig) batchFrame(runner *FakeRunner, batch string, texts ...string) wire.Frame { |
| + r.t.Helper() |
| + ctx, cancel := context.WithTimeout(r.ctx, 10*time.Second) |
| + defer cancel() |
| + f, body, err := runner.Expect(ctx, wire.FrameMessage) |
| + if err != nil { |
| + r.t.Fatalf("no next turn: %v", err) |
| + } |
| + cmd := body.(*wire.MessageCommand) |
| + if cmd.TurnID != batch || len(cmd.PersonText) != len(texts) { |
| + r.t.Fatalf("next turn %s carries %q, not the batch %s", cmd.TurnID, cmd.PersonText, batch) |
| + } |
| + at := -1 |
| + for i, text := range texts { |
| + n := strings.Index(cmd.Text, "Message "+string(rune('1'+i))+" of "+string(rune('0'+len(texts)))+":\n"+text) |
| + if n <= at || cmd.PersonText[i] != text { |
| + r.t.Fatalf("batch lacks %q in place:\n%s", text, cmd.Text) |
| + } |
| + at = n |
| + } |
| + shape(r.t, "frames/message.json", runner.Received[len(runner.Received)-1]) |
| + return f |
| +} |
| + |
| +// exactlyOnce checks a batch went to the runner in one message frame, |
| +// that the conversation has turns turns, and that no turn has two replies. |
| +func (r *rig) exactlyOnce(batch string, turns int) { |
| + r.t.Helper() |
| + var frames, all, replies int |
| + db := r.inst.DB.Writer() |
| + if err := db.QueryRow("SELECT count(*) FROM runner_commands WHERE kind = ? AND body LIKE ?", wire.FrameMessage, `%"turn_id":"`+batch+`"%`).Scan(&frames); err != nil { |
| + r.t.Fatal(err) |
| + } |
| + if err := db.QueryRow("SELECT count(*) FROM chat_turns").Scan(&all); err != nil { |
| + r.t.Fatal(err) |
| + } |
| + if err := db.QueryRow("SELECT coalesce(max(n), 0) FROM (SELECT count(*) AS n FROM chat_messages WHERE role = ? GROUP BY turn_id)", wire.RoleCoordinator).Scan(&replies); err != nil { |
| + r.t.Fatal(err) |
| + } |
| + if frames != 1 || all != turns { |
| + r.t.Fatalf("batch %s went out %d times; %d turns, want %d", batch, frames, all, turns) |
| + } |
| + if replies > 1 { |
| + r.t.Fatalf("a turn has %d replies", replies) |
| + } |
| +} |
| + |
| +// A crash between the end of a turn and the start of the next leaves |
| +// neither: the instance commits both in one transaction, so the runner's |
| +// reply comes again after the restart and starts exactly one next turn. |
| +func TestBatchCrashBetweenTurns(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + db := r.inst.DB.Writer() |
| + if _, err := db.Exec(`CREATE TRIGGER batch_crash BEFORE INSERT ON runner_commands WHEN NEW.kind = 'message' BEGIN SELECT RAISE(ABORT, 'crash'); END`); err != nil { |
| + t.Fatal(err) |
| + } |
| + reply := wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "first"} |
| + runner.Send(r.ctx, "rep1", wire.FrameReply, reply) |
| + for { |
| + _, body, err := runner.Next(r.ctx) |
| + if err != nil { |
| + break |
| + } |
| + if a, ok := body.(*wire.Ack); ok && a.ID == "rep1" { |
| + t.Fatal("the reply was acked with the next turn refused") |
| + } |
| + } |
| + if st, _ := r.client.Turn(r.ctx, busy.Turn.ID); st.State != wire.TurnRunning { |
| + t.Fatalf("turn ended without its successor: %s", st.State) |
| + } |
| + if st, _ := r.client.Turn(r.ctx, batch); st.State != wire.TurnQueued || len(st.MessageIDs) != 3 { |
| + t.Fatalf("batch %+v", st) |
| + } |
| + if _, err := db.Exec(`DROP TRIGGER batch_crash`); err != nil { |
| + t.Fatal(err) |
| + } |
| + r.inst.Restart(t) |
| + again := r.dial(runner.Welcome.Generation) |
| + again.Send(r.ctx, "s1", wire.FrameSync, wire.Sync{Sessions: []wire.SessionState{}, Runs: []wire.Run{{TurnID: busy.Turn.ID, Attempt: 1, State: wire.TurnRunning}}}) |
| + // Frames apply in order: once a no-op report is acked, the sync is in. |
| + again.Send(r.ctx, "s1b", wire.FrameTurn, wire.TurnReport{TurnID: busy.Turn.ID, Attempt: 1, State: wire.TurnRunning}) |
| + r.acked(again, "s1b") |
| + // The runner still holds the turn: the batch waits for it. |
| + var early int |
| + if err := r.inst.DB.Writer().QueryRow("SELECT count(*) FROM runner_commands WHERE kind = ? AND body LIKE ?", wire.FrameMessage, `%"turn_id":"`+batch+`"%`).Scan(&early); err != nil || early != 0 { |
| + t.Fatalf("batch went out beside the running turn: %d %v", early, err) |
| + } |
| + again.Send(r.ctx, "rep1", wire.FrameReply, reply) |
| + f := r.batchFrame(again, batch, "alpha", "bravo", "charlie") |
| + // The same reply once more, and a reconnect that resends the unacked |
| + // frame: still the one batch. |
| + again.Send(r.ctx, "rep1", wire.FrameReply, reply) |
| + again.Close() |
| + back := r.dial(runner.Welcome.Generation) |
| + if f2 := r.batchFrame(back, batch, "alpha", "bravo", "charlie"); f2.ID != f.ID { |
| + t.Fatalf("reconnect wrote a new frame %s, not %s", f2.ID, f.ID) |
| + } |
| + back.Send(r.ctx, "ab", wire.FrameAck, wire.Ack{ID: f.ID}) |
| + r.turnIs(batch, wire.TurnRunning) |
| + back.Send(r.ctx, "rep2", wire.FrameReply, wire.Reply{TurnID: batch, Attempt: 1, Text: "all three"}) |
| + r.turnIs(batch, wire.TurnReplied) |
| + r.exactlyOnce(batch, 2) |
| +} |
| + |
| +// A turn whose end committed without its successor (an older instance, or |
| +// a failure this one does not have) recovers on the runner's next sync: |
| +// exactly one next turn, the waiting messages in it. |
| +func TestBatchStrandedRecovers(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + if _, err := r.inst.DB.Writer().Exec("UPDATE chat_turns SET state = ? WHERE id = ?", wire.TurnFailed, busy.Turn.ID); err != nil { |
| + t.Fatal(err) |
| + } |
| + runner.Close() |
| + r.inst.Restart(t) |
| + again := r.dial(runner.Welcome.Generation) |
| + again.Send(r.ctx, "s1", wire.FrameSync, wire.Sync{Sessions: []wire.SessionState{}, Runs: []wire.Run{}}) |
| + f := r.batchFrame(again, batch, "alpha", "bravo", "charlie") |
| + again.Send(r.ctx, "s2", wire.FrameSync, wire.Sync{Sessions: []wire.SessionState{}, Runs: []wire.Run{}}) |
| + again.Send(r.ctx, "ab", wire.FrameAck, wire.Ack{ID: f.ID}) |
| + r.turnIs(batch, wire.TurnRunning) |
| + r.exactlyOnce(batch, 2) |
| +} |
| + |
| +// However the running turn ends (failed, cancelled, or lost across a |
| +// runner reconnect), the batch goes next, once, and the failed turn's own |
| +// message is not answered again inside it. |
| +func TestBatchAfterTurnEnds(t *testing.T) { |
| + for _, end := range []string{"failed", "cancelled", "interrupted"} { |
| + t.Run(end, func(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + switch end { |
| + case "failed": |
| + runner.Send(r.ctx, "e1", wire.FrameTurn, wire.TurnReport{TurnID: busy.Turn.ID, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"}) |
| + case "cancelled": |
| + if _, err := r.client.Cancel(r.ctx, busy.Turn.ID); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, _, err := runner.Expect(r.ctx, wire.FrameCancel); err != nil { |
| + t.Fatal(err) |
| + } |
| + runner.Send(r.ctx, "e1", wire.FrameTurn, wire.TurnReport{TurnID: busy.Turn.ID, Attempt: 1, State: wire.TurnCancelled, Reason: "cancelled"}) |
| + case "interrupted": |
| + // A new runner process no longer holds the turn. |
| + runner.Close() |
| + runner = r.dial(0) |
| + runner.Send(r.ctx, "e1", wire.FrameSync, wire.Sync{Sessions: []wire.SessionState{}, Runs: []wire.Run{}}) |
| + } |
| + r.batchFrame(runner, batch, "alpha", "bravo", "charlie") |
| + if st, _ := r.client.Turn(r.ctx, busy.Turn.ID); !wire.Terminal(st.State) || len(st.MessageIDs) != 1 { |
| + t.Fatalf("ended turn %+v", st) |
| + } |
| + r.exactlyOnce(batch, 2) |
| + }) |
| + } |
| +} |
| + |
| +// A turn the runner retries (a new attempt on another connection) keeps |
| +// the batch waiting: a message sent meanwhile joins it, and the batch |
| +// goes once, after the retried attempt's reply. A late reply from the |
| +// abandoned attempt changes nothing. |
| +func TestBatchWaitsForRetriedTurn(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + runner.Send(r.ctx, "r2", wire.FrameTurn, wire.TurnReport{TurnID: busy.Turn.ID, Attempt: 2, State: wire.TurnRunning}) |
| + for got := r.turnIs(busy.Turn.ID, wire.TurnRunning); got.Attempt != 2; got = r.turnIs(busy.Turn.ID, wire.TurnRunning) { |
| + time.Sleep(20 * time.Millisecond) |
| + } |
| + fourth, err := r.client.Send(r.ctx, "delta", "kq4") |
| + if err != nil || fourth.Turn.ID != batch || len(fourth.Turn.MessageIDs) != 4 { |
| + t.Fatalf("message during the retry: %+v %v", fourth.Turn, err) |
| + } |
| + runner.Send(r.ctx, "late", wire.FrameReply, wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "stale"}) |
| + runner.Send(r.ctx, "rep", wire.FrameReply, wire.Reply{TurnID: busy.Turn.ID, Attempt: 2, Text: "first"}) |
| + r.batchFrame(runner, batch, "alpha", "bravo", "charlie", "delta") |
| + if got := r.turnIs(busy.Turn.ID, wire.TurnReplied); got.Attempt != 2 { |
| + t.Fatalf("replied on attempt %d", got.Attempt) |
| + } |
| + r.exactlyOnce(batch, 2) |
| +} |
| + |
| +// Cancelling the waiting batch ends all its messages together, unsent; |
| +// the next message starts a turn of its own without them. |
| +func TestBatchCancelledWhileWaiting(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + if _, err := r.client.Cancel(r.ctx, batch); err != nil { |
| + t.Fatal(err) |
| + } |
| + if got := r.turnIs(batch, wire.TurnCancelled); len(got.MessageIDs) != 3 { |
| + t.Fatalf("cancelled batch %+v", got) |
| + } |
| + later, err := r.client.Send(r.ctx, "echo", "kq5") |
| + if err != nil || later.Turn.ID == batch || len(later.Turn.MessageIDs) != 1 { |
| + t.Fatalf("later message %+v %v", later.Turn, err) |
| + } |
| + runner.Send(r.ctx, "rep", wire.FrameReply, wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "first"}) |
| + _, body, err := runner.Expect(r.ctx, wire.FrameMessage) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if cmd := body.(*wire.MessageCommand); cmd.TurnID != later.Turn.ID || cmd.Text != "echo" { |
| + t.Fatalf("after a cancelled batch the runner got %s %q", cmd.TurnID, cmd.Text) |
| + } |
| +} |
| + |
| +// Each waiting message keeps its own bubble in the queued turn, with the |
| +// one quiet note under the latest. The note goes for all of them together |
| +// the moment the turn picks them up (its frame is out), before the runner |
| +// acks it, and the bubbles stay. |
| +func TestBatchMarkerClearsTogether(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + const note = "<p equipo-card-note data-queued>" |
| + bubbles := func(page string) int { |
| + at := -1 |
| + for i, m := range queued { |
| + n := strings.Index(page, `data-message="`+m.Message.ID+`" data-turn-id="`+batch+`"`) |
| + if n <= at { |
| + t.Fatalf("bubble %d missing or out of order", i+1) |
| + } |
| + at = n |
| + } |
| + return at |
| + } |
| + page := r.inst.Get(t, "/conversation") |
| + if last := bubbles(page); strings.Count(page, note) != 1 || strings.Index(page, note) < last { |
| + t.Fatal("waiting messages lack the one note under the latest") |
| + } |
| + runner.Send(r.ctx, "rep", wire.FrameReply, wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "first"}) |
| + f := r.batchFrame(runner, batch, "alpha", "bravo", "charlie") |
| + if page = r.inst.Get(t, "/conversation"); strings.Contains(page, note) { |
| + t.Fatal("the note stayed after the turn picked the messages up") |
| + } |
| + bubbles(page) |
| + runner.Send(r.ctx, "ab", wire.FrameAck, wire.Ack{ID: f.ID}) |
| + r.turnIs(batch, wire.TurnRunning) |
| + if page = r.inst.Get(t, "/conversation"); strings.Contains(page, note) { |
| + t.Fatal("the note came back while the turn runs") |
| + } |
| + bubbles(page) |
| +} |
| + |
| +// Messages that would not fit one frame together go as several batches, |
| +// one turn after another, in order. Each frame fits (the runner reads at |
| +// most wire.MaxFrameBytes): the oldest tail goes first, and a later |
| +// batch's messages are never in an earlier one's tail. |
| +func TestBatchSplitsToFitTheFrame(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, err := r.client.Send(r.ctx, "one", "k0") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + f, _, _ := runner.Expect(r.ctx, wire.FrameMessage) |
| + runner.Send(r.ctx, "a0", wire.FrameAck, wire.Ack{ID: f.ID}) |
| + r.turnIs(busy.Turn.ID, wire.TurnRunning) |
| + var texts []string |
| + turns := map[string][]string{} |
| + var order []string |
| + for i := range 12 { |
| + // Near the largest message, with characters JSON escapes (the |
| + // person API reads at most twice the limit). |
| + text := fmt.Sprintf("m%02d %s%s", i+1, strings.Repeat("x", wire.MaxMessageBytes-2008), strings.Repeat("<", 2000)) |
| + s, err := r.client.Send(r.ctx, text, fmt.Sprintf("kb%d", i)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, ok := turns[s.Turn.ID]; !ok { |
| + order = append(order, s.Turn.ID) |
| + } |
| + turns[s.Turn.ID] = append(turns[s.Turn.ID], text) |
| + texts = append(texts, text) |
| + } |
| + if len(order) < 2 || len(turns[order[0]]) < 2 { |
| + t.Fatalf("12 large messages made batches of %v", order) |
| + } |
| + end := wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "first"} |
| + var got []string |
| + for i, batch := range order { |
| + runner.Send(r.ctx, fmt.Sprintf("rep%d", i), wire.FrameReply, end) |
| + mf, body, err := runner.Expect(r.ctx, wire.FrameMessage) |
| + if err != nil { |
| + t.Fatalf("batch %d: %v", i+1, err) |
| + } |
| + cmd := body.(*wire.MessageCommand) |
| + if cmd.TurnID != batch || len(cmd.PersonText) != len(turns[batch]) { |
| + t.Fatalf("batch %d is %s with %d messages", i+1, cmd.TurnID, len(cmd.PersonText)) |
| + } |
| + for _, m := range cmd.Tail { |
| + for _, later := range order[i+1:] { |
| + for _, text := range turns[later] { |
| + if m.Text == text { |
| + t.Fatalf("batch %d's tail holds a message still waiting", i+1) |
| + } |
| + } |
| + } |
| + } |
| + if len(cmd.Tail) == 0 || cmd.Tail[len(cmd.Tail)-1].Text != end.Text { |
| + t.Fatalf("batch %d's tail lost the newest reply", i+1) |
| + } |
| + got = append(got, cmd.PersonText...) |
| + runner.Send(r.ctx, fmt.Sprintf("ab%d", i), wire.FrameAck, wire.Ack{ID: mf.ID}) |
| + r.turnIs(batch, wire.TurnRunning) |
| + end = wire.Reply{TurnID: batch, Attempt: 1, Text: fmt.Sprintf("reply %d", i+1)} |
| + } |
| + if len(got) != len(texts) { |
| + t.Fatalf("%d of %d messages reached the coordinator", len(got), len(texts)) |
| + } |
| + for i := range texts { |
| + if got[i] != texts[i] { |
| + t.Fatalf("message %d out of place", i+1) |
| + } |
| + } |
| +} |
| + |
| +// A failed batch says the coordinator could not answer these messages; a |
| +// failed turn of one message still says this message. |
| +func TestBatchFailedSaysThemAll(t *testing.T) { |
| + r := newRig(t) |
| + runner := r.dial(0) |
| + busy, queued := r.busyWithThree(runner) |
| + batch := queued[0].Turn.ID |
| + runner.Send(r.ctx, "rep", wire.FrameReply, wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "first"}) |
| + f := r.batchFrame(runner, batch, "alpha", "bravo", "charlie") |
| + runner.Send(r.ctx, "ab", wire.FrameAck, wire.Ack{ID: f.ID}) |
| + runner.Send(r.ctx, "fb", wire.FrameTurn, wire.TurnReport{TurnID: batch, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"}) |
| + r.turnIs(batch, wire.TurnFailed) |
| + if page := r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+batch+`"><p>The coordinator could not answer these messages.</p>`) { |
| + t.Fatal("a failed batch lacks the note for its messages") |
| + } |
| + one, err := r.client.Send(r.ctx, "delta", "kq6") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + of, _, _ := runner.Expect(r.ctx, wire.FrameMessage) |
| + runner.Send(r.ctx, "a1", wire.FrameAck, wire.Ack{ID: of.ID}) |
| + runner.Send(r.ctx, "f1", wire.FrameTurn, wire.TurnReport{TurnID: one.Turn.ID, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"}) |
| + r.turnIs(one.Turn.ID, wire.TurnFailed) |
| + if page := r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+one.Turn.ID+`"><p>The coordinator could not answer this message.</p>`) { |
| + t.Fatal("a failed single message lacks its note") |
| + } |
| +} |
diff --git a/internal/thintest/instance_contract_test.go b/internal/thintest/instance_contract_test.go| index e8c2c16c..de46a1b6 100644 |
| --- a/internal/thintest/instance_contract_test.go |
| +++ b/internal/thintest/instance_contract_test.go |
| @@ -219,7 +219,7 @@ func TestSendIdempotency(t *testing.T) { |
| } |
| // Messages sent while a turn runs join one queued turn and reach the |
| -// coordinator as one frame. |
| +// coordinator as one frame, each set apart. |
| func TestQueuedMessagesJoinOneTurn(t *testing.T) { |
| r := newRig(t) |
| runner := r.dial(0) |
| @@ -240,7 +240,7 @@ func TestQueuedMessagesJoinOneTurn(t *testing.T) { |
| t.Fatal(err) |
| } |
| cmd := body.(*wire.MessageCommand) |
| - if cmd.TurnID != second.Turn.ID || cmd.Text != "two\n\nthree" || len(cmd.Tail) != 2 || cmd.Tail[0].Text != "one" || cmd.Tail[1].Role != wire.RoleCoordinator { |
| + if cmd.TurnID != second.Turn.ID || cmd.Text != "[Equipo: the person sent 2 messages while you were busy, oldest first. Each is a separate message; answer them together in one reply.]\n\nMessage 1 of 2:\ntwo\n\nMessage 2 of 2:\nthree" || len(cmd.PersonText) != 2 || len(cmd.Tail) != 2 || cmd.Tail[0].Text != "one" || cmd.Tail[1].Role != wire.RoleCoordinator { |
| t.Fatalf("joined command %+v", cmd) |
| } |
| } |
diff --git a/internal/thintest/instant_browser_test.go b/internal/thintest/instant_browser_test.go| index 05cbf4c2..88ad81f8 100644 |
| --- a/internal/thintest/instant_browser_test.go |
| +++ b/internal/thintest/instant_browser_test.go |
| @@ -241,5 +241,10 @@ func TestBrowserInstantThinkingQueued(t *testing.T) { |
| // The first replies: the queued turn's line comes, the note goes. |
| runner.Send(r.ctx, "r-q1", wire.FrameReply, wire.Reply{TurnID: first, Attempt: 1, Text: "First done."}) |
| p.wait(`document.querySelectorAll('[equipo-thinking]').length===1 && document.querySelector('[equipo-thinking]').dataset.turn===`+jsString(second)+` && !document.querySelector('[data-queued]')`, "the second turn's line, no note") |
| + // The batch of two fails: its note says these messages, from the event. |
| + bf := messageFrame(t, r, runner) |
| + runner.Send(r.ctx, "a-q2", wire.FrameAck, wire.Ack{ID: bf.ID}) |
| + runner.Send(r.ctx, "f-q2", wire.FrameTurn, wire.TurnReport{TurnID: second, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"}) |
| + p.wait(`(document.querySelector('[data-ended=`+jsString(second)+`] p')||{}).textContent===`+jsString("The coordinator could not answer these messages."), "the failed batch's note") |
| p.stayed("queued sends") |
| } |
diff --git a/internal/thintest/settings_browser_test.go b/internal/thintest/settings_browser_test.go| index b60b3eff..085d4c2d 100644 |
| --- a/internal/thintest/settings_browser_test.go |
| +++ b/internal/thintest/settings_browser_test.go |
| @@ -92,7 +92,7 @@ func (p *innerPage) waitFor(cond func() bool, what string) { |
| // Settings menu is a second sidebar beside the section, the current one |
| // marked, the app's rail still there, and a section is a link away; at |
| // 390 /conversation/settings is the menu as full-row drill-ins with |
| -// chevrons, and a section is its own page with Settings in its bar and no |
| +// chevrons (six since Machines moved under Settings), and a section is its own page with Settings in its bar and no |
| // menu. Light and dark; EQUIPO_BROWSER_ARTIFACTS keeps the shots. |
| func TestBrowserSettingsMenu(t *testing.T) { |
| r := newToolRig(t) |
| @@ -117,7 +117,7 @@ func TestBrowserSettingsMenu(t *testing.T) { |
| // Phone. |
| q := openInner(t, r.inst.URL, r.inst.Cookie(), 390, 844, true, scheme, "no-preference") |
| q.open("/conversation/settings") |
| - q.check(`(()=>{const ls=[...document.querySelectorAll('[equipo-settings-link]')];const body=document.querySelector('[equipo-settings-body]');return ls.length===5&&ls.every(a=>{const r=a.getBoundingClientRect();return r.height>=44&&r.width>=340&&getComputedStyle(a.querySelector('.icon:last-child')).display!=='none'})&&getComputedStyle(body).display==='none'&&document.documentElement.scrollWidth<=390})()`, scheme+" 390: the menu is not full-row drill-ins") |
| + q.check(`(()=>{const ls=[...document.querySelectorAll('[equipo-settings-link]')];const body=document.querySelector('[equipo-settings-body]');return ls.length===6&&ls.every(a=>{const r=a.getBoundingClientRect();return r.height>=44&&r.width>=340&&getComputedStyle(a.querySelector('.icon:last-child')).display!=='none'})&&getComputedStyle(body).display==='none'&&document.documentElement.scrollWidth<=390})()`, scheme+" 390: the menu is not full-row drill-ins") |
| q.wait(`document.getAnimations().every(a=>a.playState!=='running'||a.effect&&a.effect.getTiming().iterations===Infinity)`, "the slide settled") |
| q.shot("settings-list-390-" + scheme) |
| q.click(`[data-settings-link="thinking"]`) |
| @@ -137,7 +137,8 @@ func TestBrowserSettingsMenu(t *testing.T) { |
| // TestBrowserSettingsRail: Paul, 2026-11-10: "The settings nav should |
| // probably replace the main nav on this view, right?" At 1280 Settings |
| // is two columns: the rail itself turns into the Settings nav ("‹ |
| -// Equipo", the sections, Add a connection under Connections) with a |
| +// Equipo", the sections, Add a connection under Connections and Add a |
| +// machine under Machines) with a |
| // short slide as the person crosses in, and none between sections; "‹ |
| // Equipo" goes back to where they were, the main nav sliding back. The |
| // rail does not move or resize. Under reduced motion nothing slides. At |
| @@ -152,7 +153,7 @@ func TestBrowserSettingsRail(t *testing.T) { |
| p.check(`(()=>{sessionStorage.setItem('rail',JSON.stringify(document.querySelector('[rst-shell-rail]').getBoundingClientRect()));return document.querySelector('#rail').checkVisibility() && !document.querySelector('[equipo-settings-rail]')})()`, "1280: the main nav is not the rail outside Settings") |
| p.click(`#rail a[href="/conversation/settings"]`) |
| p.wait(`location.pathname==='/conversation/settings' && `+sliding+`(document.querySelector('[equipo-settings-rail]'))`, "the Settings nav slides in") |
| - p.check(`(()=>{const was=JSON.parse(sessionStorage.getItem('rail')),now=document.querySelector('[rst-shell-rail]').getBoundingClientRect();const n=document.querySelector('[equipo-settings-rail]');const links=[...n.querySelectorAll('a')].map(a=>a.dataset.railSettings||'leave');return Math.abs(was.left-now.left)<1&&Math.abs(was.width-now.width)<1&&!document.querySelector('#rail').checkVisibility()&&links.join()==='leave,thinking,connections,connections-add,housekeeping,notebook,teams'&&n.querySelector('[data-settings-leave]').textContent.trim()==='Equipo'&&n.querySelector('[data-settings-leave]').getAttribute('href')==='/tasks'})()`, "1280: the rail moved, or is not ‹ Equipo and the sections, or ‹ Equipo does not lead back to Tasks") |
| + p.check(`(()=>{const was=JSON.parse(sessionStorage.getItem('rail')),now=document.querySelector('[rst-shell-rail]').getBoundingClientRect();const n=document.querySelector('[equipo-settings-rail]');const links=[...n.querySelectorAll('a')].map(a=>a.dataset.railSettings||'leave');return Math.abs(was.left-now.left)<1&&Math.abs(was.width-now.width)<1&&!document.querySelector('#rail').checkVisibility()&&links.join()==='leave,thinking,connections,connections-add,machines,machines-add,housekeeping,notebook,teams'&&n.querySelector('[data-settings-leave]').textContent.trim()==='Equipo'&&n.querySelector('[data-settings-leave]').getAttribute('href')==='/tasks'})()`, "1280: the rail moved, or is not ‹ Equipo and the sections, or ‹ Equipo does not lead back to Tasks") |
| p.check(`(()=>{const n=document.querySelector('[equipo-settings-rail]').getBoundingClientRect(),b=document.querySelector('[equipo-settings-body]').getBoundingClientRect();return n.right<=b.left&&b.left-n.right<120&&!document.querySelector('[equipo-settings-nav]').checkVisibility()})()`, "1280: Settings is not two columns") |
| p.wait(settled, "the slide settled") |
| p.shot("settings-rail-1280") |
diff --git a/internal/thintest/thinking_browser_test.go b/internal/thintest/thinking_browser_test.go| index 800935b3..10b389b5 100644 |
| --- a/internal/thintest/thinking_browser_test.go |
| +++ b/internal/thintest/thinking_browser_test.go |
| @@ -7,7 +7,6 @@ import ( |
| "encoding/json" |
| "fmt" |
| "testing" |
| - "time" |
| "amadan.net/oficina/equipo/internal/wire" |
| "github.com/chromedp/cdproto/cdp" |
| @@ -100,13 +99,18 @@ func TestBrowserThinkingWords(t *testing.T) { |
| // TestBrowserThinkingCycles: Paul, 2026-11-09: "They could swap a touch |
| // less frequently, they're a bit frantic. There needs to be many more per |
| -// category so it takes a while before I see the same ones again." With a |
| -// fake clock: a situation's first phrase holds about 5 s, then a new one |
| -// every 6 to 8 s; the phrases come from a shuffled deck, none again until |
| -// all have shown, across two turns (a reload keeps only localStorage); |
| -// after the deck runs out the next is none of the last three; a new |
| -// activity switches to its own phrases at once; under reduced motion the |
| -// words still change. |
| +// category so it takes a while before I see the same ones again." A |
| +// situation's first phrase holds 5 s, then a new one every 6 to 8 s; the |
| +// phrases come from a shuffled deck, none again until all have shown, |
| +// across two turns (a reload keeps only localStorage); after the deck runs |
| +// out the next is none of the last three; a new activity switches to its |
| +// own phrases at once; under reduced motion the words still change. |
| +// |
| +// The page's clock stands still but for the test (clock below): each |
| +// phrase is held to just under its minimum while the phrase timer looks, |
| +// then to its maximum. The page records each phrase it draws with its |
| +// clock, and the dwell rule is judged from that record, never from how |
| +// long the test waited, so a slow machine cannot make a phrase go early. |
| func TestBrowserThinkingCycles(t *testing.T) { |
| r := newToolRig(t) |
| words, _ := r.client.Thinking(r.ctx) |
| @@ -117,50 +121,92 @@ func TestBrowserThinkingCycles(t *testing.T) { |
| } |
| } |
| js := func(v any) string { raw, _ := json.Marshal(v); return string(raw) } |
| + // The runner keeps reading, so it answers the instance's pings (a |
| + // websocket answers only while it reads) and its stream outlives the |
| + // ping deadline however slow the machine is; nothing it is sent |
| + // matters here. |
| + go func() { |
| + for { |
| + if _, _, err := r.runner.Conn.Read(r.ctx); err != nil { |
| + return |
| + } |
| + } |
| + }() |
| + // clock: Date.now is base + skew, both kept in sessionStorage so a |
| + // reload goes on from the same time; it moves only when the test |
| + // moves it. The phrase timer (chat-stream.js turns phrases from a |
| + // 250 ms interval) looks every 50 ms here, which changes no dwell (the |
| + // dwell is read from the clock), and __ticks counts its runs, so the |
| + // test knows the timer has looked at the clock it set. __drawn is each |
| + // phrase drawn: its turn, its text and the clock when it came in. |
| + const clock = `(()=>{const real=Date.now.bind(Date);window.__base=Number(sessionStorage.getItem('base'))||real();sessionStorage.setItem('base',window.__base);window.__skew=Number(sessionStorage.getItem('skew')||0);Date.now=()=>window.__base+window.__skew;` + |
| + `window.__ticks=0;const every=window.setInterval;window.setInterval=function(fn,ms,...rest){if(ms===250&&typeof fn==='function'){const f=fn;fn=function(){try{return f.apply(this,arguments)}finally{window.__ticks++}};ms=50}return every.call(window,fn,ms,...rest)};` + |
| + `window.__drawn=[];const once=new WeakSet();new MutationObserver(ms=>{for(const m of ms)for(const e of m.target.querySelectorAll('[equipo-phrase] > [data-in]'))if(!once.has(e)&&once.add(e))window.__drawn.push({turn:e.closest('[equipo-thinking]')?.dataset.turn,text:e.textContent,at:Date.now()})}).observe(document,{childList:true,subtree:true});})()` |
| for _, motion := range []string{"no-preference", "reduce"} { |
| p := openInner(t, r.inst.URL, r.inst.Cookie(), 390, 844, true, "dark", motion) |
| p.do(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error { |
| - _, err := cdp.Call(ctx, target, page.AddScriptToEvaluateOnNewDocument, page.AddScriptToEvaluateOnNewDocumentParams{Source: `(()=>{const real=Date.now.bind(Date);window.__skew=Number(sessionStorage.getItem('skew')||0);Date.now=()=>real()+window.__skew;})()`}) |
| + _, err := cdp.Call(ctx, target, page.AddScriptToEvaluateOnNewDocument, page.AddScriptToEvaluateOnNewDocumentParams{Source: clock}) |
| return err |
| })) |
| p.open("/conversation") |
| line := `document.querySelector('[equipo-thinking][data-turn="` + r.turn + `"]')` |
| phrase := line + `?.querySelector('[equipo-phrase] [data-in]')?.textContent` |
| - advance := func(ms int) { |
| + drawn := `window.__drawn.filter(d=>d.turn===` + js(r.turn) + `)` |
| + // age: the page's clock to ms after the shown phrase came in, by |
| + // the page's record. |
| + age := func(ms int) { |
| t.Helper() |
| - p.check(fmt.Sprintf(`(()=>{window.__skew+=%d;sessionStorage.setItem('skew',window.__skew);return true})()`, ms), "advance the clock") |
| + p.check(fmt.Sprintf(`(()=>{const d=%s;window.__skew=d[d.length-1].at-window.__base+%d;sessionStorage.setItem('skew',window.__skew);window.__looked=window.__ticks;return true})()`, drawn, ms), "set the clock") |
| + } |
| + var seen []string |
| + first := func(what string) { |
| + t.Helper() |
| + p.wait(js(think)+`.includes(`+phrase+`) && `+drawn+`.length>0`, what) |
| + seen = append(seen, eval[string](p, phrase)) |
| } |
| - p.wait(js(think)+`.includes(`+phrase+`)`, "the first thinking phrase") |
| - seen := []string{eval[string](p, phrase)} |
| - // The pace: the first holds past 4.5 s and goes by 5.5 s; then each |
| - // holds past 5.8 s and goes by 8.2 s. |
| + // holds: at ms, once the phrase timer has looked, the same phrase. |
| holds := func(ms int, what string) { |
| t.Helper() |
| - advance(ms) |
| - time.Sleep(600 * time.Millisecond) |
| + age(ms) |
| + p.wait(`window.__ticks>window.__looked`, "the phrase timer looked") |
| p.check(phrase+`===`+js(seen[len(seen)-1]), what) |
| } |
| next := func(ms int) { |
| t.Helper() |
| - advance(ms) |
| + age(ms) |
| p.wait(phrase+`!==`+js(seen[len(seen)-1])+` && `+js(think)+`.includes(`+phrase+`)`, fmt.Sprintf("phrase %d", len(seen)+1)) |
| seen = append(seen, eval[string](p, phrase)) |
| } |
| - holds(4500, motion+": the first phrase went before 5 s") |
| - next(1000) |
| - for i := 0; i < 3; i++ { |
| - holds(5800, motion+": a phrase went before 6 s") |
| - next(2400) |
| + // cycle: the next phrase, held past just under 6 s, gone by 8 s. |
| + cycle := func() { |
| + t.Helper() |
| + holds(5999, motion+": a phrase went before 6 s") |
| + next(8000) |
| + } |
| + // dwelt: the page's record of this page's phrases is seen[from:], |
| + // in order; the first came in 5 s after the one before it, each |
| + // later one 6 to 8 s after. |
| + dwelt := func(from int) { |
| + t.Helper() |
| + if bad := eval[string](p, `(()=>{const d=`+drawn+`,want=`+js(seen[from:])+`;if(JSON.stringify(d.map(x=>x.text))!==JSON.stringify(want))return 'drawn '+JSON.stringify(d.map(x=>x.text));for(let i=1;i<d.length;i++){const g=d[i].at-d[i-1].at,min=i===1?5000:6000,max=i===1?5000:8000;if(g<min||g>max)return 'phrase '+(i+1)+' came '+g+' ms after the one before'}return ''})()`); bad != "" { |
| + t.Fatalf("%s: %s", motion, bad) |
| + } |
| } |
| + first("the first thinking phrase") |
| + holds(4999, motion+": the first phrase went before 5 s") |
| + next(5000) |
| for len(seen) < 20 { |
| - next(8100) |
| + cycle() |
| } |
| + dwelt(0) |
| // A new turn: the page again, nothing kept but localStorage. |
| p.do(chromedp.Reload()) |
| - p.wait(js(think)+`.includes(`+phrase+`)`, "the thinking phrase after the reload") |
| - seen = append(seen, eval[string](p, phrase)) |
| + from := len(seen) |
| + first("the thinking phrase after the reload") |
| + holds(4999, motion+": the first phrase after the reload went before 5 s") |
| + next(5000) |
| for len(seen) < len(think) { |
| - next(8100) |
| + cycle() |
| } |
| distinct := map[string]bool{} |
| for _, s := range seen { |
| @@ -171,12 +217,13 @@ func TestBrowserThinkingCycles(t *testing.T) { |
| } |
| // The deck ran out: the next is none of the last three. |
| last := seen[len(seen)-3:] |
| - next(8100) |
| + cycle() |
| for _, l := range last { |
| if seen[len(seen)-1] == l { |
| t.Fatalf("%s: %q again straight after the deck ran out", motion, l) |
| } |
| } |
| + dwelt(from) |
| // A new activity: its own phrases at once. |
| if err := r.runner.Send(r.ctx, "cyc-read-"+motion, wire.FrameActivity, wire.ActivityReport{TurnID: r.turn, Attempt: 1, Kind: wire.ActivityTool, Tool: wire.ToolReadFile}); err != nil { |
| t.Fatal(err) |
diff --git a/scripts/ci-box.py b/scripts/ci-box.py| index c17e2ac4..0fe488a8 100755 |
| --- a/scripts/ci-box.py |
| +++ b/scripts/ci-box.py |
| @@ -18,9 +18,14 @@ pinned programs mounted where a runner host has them: |
| /usr/local/bin/codex codex 0.165.0 |
| ~/.local/share/equipo/try/bin codex, its code mode host, claude |
| /usr/bin/socat Claude's own sandbox needs it |
| + /opt/chromium-<version>/chrome the browser tests' Chromium |
| Every pinned program is fetched by URL and checked against the SHA-256 in |
| -scripts/ci-box.json, for this machine's architecture. The job's checkout |
| +scripts/ci-box.json, for this machine's architecture. Chromium is Debian's |
| +headless shell and the libraries it needs, some seventy packages pinned in |
| +scripts/ci-chromium.json (scripts/ci-chromium-pin.py writes it), unpacked |
| +into one tree; RASTRILLO_CHROME names its launcher, which is where the |
| +browser tests (harness.ChromePath) look first. The job's checkout |
| and Go caches are mounted at fixed paths, so Go's build and test caches |
| hold from one fresh machine to the next. Inside, the command runs as an |
| ordinary user (scripts/ci-box-enter.sh), never as root. |
| @@ -34,6 +39,7 @@ import json |
| import lzma |
| import os |
| import platform |
| +import re |
| import shutil |
| import subprocess |
| import sys |
| @@ -45,6 +51,7 @@ from concurrent.futures import ThreadPoolExecutor |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| PINS = os.path.join(ROOT, "scripts", "ci-box.json") |
| +CHROMIUM_PINS = os.path.join(ROOT, "scripts", "ci-chromium.json") |
| COLD = os.path.join(ROOT, ".amadan", "cold") |
| # Where things sit inside the box. Fixed, whatever the job's own paths |
| @@ -226,6 +233,145 @@ def fetch_tools(): |
| return tools_dir() |
| +# Chromium: a tree of Debian packages, not one program. |
| + |
| +def chromium_pins(): |
| + with open(CHROMIUM_PINS) as f: |
| + return json.load(f) |
| + |
| + |
| +def chromium_name(): |
| + """The tree's directory name, here and in the box: it carries the |
| + version, so RASTRILLO_CHROME, which go test keys cached results on, |
| + changes when the pin does.""" |
| + return "chromium-" + re.sub(r"[^A-Za-z0-9.+-]", "_", chromium_pins()["version"]) |
| + |
| + |
| +def chromium_dir(): |
| + return os.path.join(tools_dir(), chromium_name()) |
| + |
| + |
| +def chromium_box(): |
| + return "/opt/" + chromium_name() |
| + |
| + |
| +def unpack_deb(path, root): |
| + """Unpack a .deb's files under root. Nothing may land outside it: an |
| + absolute link is made relative to root, and a name that climbs out |
| + is refused.""" |
| + def inside(name): |
| + name = os.path.normpath(name[2:] if name.startswith("./") else name) |
| + if name == ".." or name.startswith("../") or os.path.isabs(name): |
| + raise RuntimeError("%s: %s is outside the package" % (path, name)) |
| + return name |
| + |
| + with tarfile.open(fileobj=io.BytesIO(deb_data(path))) as tar: |
| + for member in tar: |
| + name = inside(member.name) |
| + if name == ".": |
| + continue |
| + dest = os.path.join(root, name) |
| + if member.isdir(): |
| + os.makedirs(dest, exist_ok=True) |
| + continue |
| + os.makedirs(os.path.dirname(dest), exist_ok=True) |
| + if os.path.lexists(dest): |
| + os.unlink(dest) |
| + if member.issym(): |
| + target = member.linkname |
| + if os.path.isabs(target): |
| + target = os.path.relpath(os.path.join(root, target.lstrip("/")), os.path.dirname(dest)) |
| + os.symlink(target, dest) |
| + elif member.islnk(): |
| + shutil.copy2(os.path.join(root, inside(member.linkname)), dest) |
| + elif member.isfile(): |
| + with tar.extractfile(member) as source, open(dest, "wb") as out: |
| + shutil.copyfileobj(source, out) |
| + os.chmod(dest, member.mode & 0o755) |
| + |
| + |
| +def library_dirs(root): |
| + """Every directory of the tree that holds a shared library, the |
| + browser's own aside: the launcher's LD_LIBRARY_PATH.""" |
| + found = [] |
| + for directory, _, names in os.walk(root): |
| + if directory.startswith(os.path.join(root, "usr", "lib", "chromium")): |
| + continue |
| + if any(".so" in n for n in names): |
| + found.append(os.path.relpath(directory, root)) |
| + return sorted(found) |
| + |
| + |
| +FONTS_CONF = """<?xml version="1.0"?> |
| +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
| +<fontconfig> |
| + <dir prefix="relative">root/usr/share/fonts</dir> |
| + <cachedir prefix="xdg">fontconfig</cachedir> |
| +</fontconfig> |
| +""" |
| + |
| +LAUNCHER = """#!/bin/sh |
| +# Chromium %(version)s, Debian's headless shell, from scripts/ci-chromium.json |
| +# (scripts/ci-box.py unpacked it). Its libraries are in this tree, not on |
| +# the system, and so is its font configuration. |
| +here=$(dirname "$(readlink -f "$0")") |
| +LD_LIBRARY_PATH=%(libs)s${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} |
| +FONTCONFIG_FILE=$here/fonts.conf |
| +export LD_LIBRARY_PATH FONTCONFIG_FILE |
| +exec "$here/root/%(program)s" "$@" |
| +""" |
| + |
| + |
| +def fetch_chromium(): |
| + pinned = chromium_pins() |
| + machine = arch() |
| + if machine not in pinned: |
| + sys.exit("ci-box: scripts/ci-chromium.json has no pin for " + machine) |
| + packages = pinned[machine] |
| + stamp = json.dumps(packages, sort_keys=True) |
| + final = chromium_dir() |
| + marker = os.path.join(final, "pinned.json") |
| + if os.path.isfile(marker): |
| + with open(marker) as f: |
| + if f.read() == stamp: |
| + return "chromium %s: present" % pinned["version"] |
| + started = time.time() |
| + os.makedirs(tools_dir(), exist_ok=True) |
| + with tempfile.TemporaryDirectory(dir=tools_dir()) as scratch: |
| + def get(index_package): |
| + index, package = index_package |
| + path = os.path.join(scratch, "%03d.deb" % index) |
| + got = download(package["url"], path) |
| + if got != package["sha256"]: |
| + raise RuntimeError("chromium: %s has SHA-256 %s, pinned %s" % (package["url"], got, package["sha256"])) |
| + return path |
| + with ThreadPoolExecutor(max_workers=8) as pool: |
| + debs = list(pool.map(get, enumerate(packages))) |
| + tree = os.path.join(scratch, "tree") |
| + root = os.path.join(tree, "root") |
| + os.makedirs(root) |
| + for deb in debs: |
| + unpack_deb(deb, root) |
| + os.unlink(deb) |
| + program = os.path.join(root, pinned["program"]) |
| + if not os.path.isfile(program): |
| + raise RuntimeError("chromium: the packages hold no " + pinned["program"]) |
| + libs = ":".join('"$here/root/%s"' % d for d in library_dirs(root)) |
| + with open(os.path.join(tree, "fonts.conf"), "w") as f: |
| + f.write(FONTS_CONF) |
| + launcher = os.path.join(tree, "chrome") |
| + with open(launcher, "w") as f: |
| + f.write(LAUNCHER % {"version": pinned["version"], "libs": libs, "program": pinned["program"]}) |
| + os.chmod(launcher, 0o755) |
| + with open(os.path.join(tree, "pinned.json"), "w") as f: |
| + f.write(stamp) |
| + if os.path.isdir(final): |
| + shutil.rmtree(final) |
| + os.replace(tree, final) |
| + return "chromium %s: %d packages fetched, verified and unpacked in %.1fs" % ( |
| + pinned["version"], len(packages), time.time() - started) |
| + |
| + |
| # The container engine and the image. |
| def engine(): |
| @@ -328,6 +474,8 @@ def run(command): |
| machine = arch() |
| tools = pins()["tools"] |
| missing = [name for name, tool in tools.items() if not os.path.isfile(tool_path(name, tool))] |
| + if not os.path.isfile(os.path.join(chromium_dir(), "chrome")): |
| + missing.append("chromium") |
| if missing: |
| sys.exit("ci-box: %s not fetched; run scripts/ci-box.py prepare first" % ", ".join(sorted(missing))) |
| gocache, gomodcache = go_env("GOCACHE"), go_env("GOMODCACHE") |
| @@ -345,6 +493,7 @@ def run(command): |
| inside = entry[machine].get("box") or entry.get("box") |
| if inside: |
| args += ["-v", tool_path(name, entry) + ":" + inside + ":ro"] |
| + args += ["-v", chromium_dir() + ":" + chromium_box() + ":ro"] |
| if tool == "docker": |
| args.append("--init") # reaps the orphans the containment tests leave on purpose |
| # A CI runner checks a branch out as a git worktree: .git is a file |
| @@ -359,6 +508,7 @@ def run(command): |
| env = { |
| "GOCACHE": GOCACHE, "GOMODCACHE": GOMODCACHE, |
| "EQUIPO_TEST_TOOLS_REQUIRED": "1", |
| + "RASTRILLO_CHROME": chromium_box() + "/chrome", |
| "EQUIPO_BOX_UID": str(os.getuid()), "EQUIPO_BOX_GID": str(os.getgid()), |
| } |
| if tool == "podman" and os.getuid() != 0: |
| @@ -466,9 +616,11 @@ def prepare(): |
| return # a runner host: nothing to fetch |
| started = time.time() |
| facts() |
| - with ThreadPoolExecutor(max_workers=2) as pool: |
| + with ThreadPoolExecutor(max_workers=3) as pool: |
| image = pool.submit(pull_image) |
| + chromium = pool.submit(fetch_chromium) |
| fetch_tools() |
| + say(chromium.result()) |
| image.result() |
| if os.environ.get("AMADAN_CI") == "1": |
| deepen() |
diff --git a/scripts/ci-chromium-pin.py b/scripts/ci-chromium-pin.py| new file mode 100755 |
| index 00000000..a00510ba |
| --- /dev/null |
| +++ b/scripts/ci-chromium-pin.py |
| @@ -0,0 +1,146 @@ |
| +#!/usr/bin/env python3 |
| +"""Pin the Chromium the CI box runs browser tests with: write |
| +scripts/ci-chromium.json. |
| + |
| + scripts/ci-chromium-pin.py VERSION DEBIAN_SNAPSHOT SECURITY_SNAPSHOT |
| + |
| +for example |
| + |
| + scripts/ci-chromium-pin.py 156.0.8078.79-1~deb13u1 20261107T024144Z 20261103T013555Z |
| + |
| +The browser is Debian 13's chromium-headless-shell, the system the box |
| +image runs, because Debian builds it for arm64 (hosted CI) and amd64 |
| +alike; Chrome for Testing has no Linux arm64 build. It is a program and |
| +some sixty libraries, not one file, so this reads the Packages indexes of |
| +trixie and trixie-security at two snapshot.debian.org timestamps and |
| +pins every package the headless shell needs that a Debian image does not |
| +already have: what Priority: required pulls in is in every Debian image, |
| +the box's too, and is left out. Each package is pinned by the SHA-256 the |
| +signed index gives it, at a snapshot URL that never changes; |
| +scripts/ci-box.py fetches and checks them and unpacks them into one tree. |
| + |
| +Raise the pin with each Chromium security release: the newest version is |
| +at https://snapshot.debian.org/mr/binary/chromium-headless-shell/, and |
| +its first_seen there (binfiles?fileinfo=1) is the security timestamp. |
| +""" |
| +import json |
| +import lzma |
| +import os |
| +import re |
| +import sys |
| +import urllib.request |
| + |
| +ARCHES = ("amd64", "arm64") |
| +TOP = ("chromium-headless-shell", "chromium-common") |
| +# chromium-common's own dependencies are the full browser's (x11-utils for |
| +# xmessage, xdg-utils for opening links); the headless shell runs neither. |
| +SKIP = {"x11-utils", "xdg-utils"} |
| +OUT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ci-chromium.json") |
| +SNAPSHOT = "https://snapshot.debian.org/archive/%s/%s/" |
| + |
| + |
| +def fetch(url): |
| + request = urllib.request.Request(url, headers={"User-Agent": "equipo-ci-chromium-pin"}) |
| + with urllib.request.urlopen(request, timeout=300) as response: |
| + return response.read() |
| + |
| + |
| +def stanzas(text): |
| + for block in text.split("\n\n"): |
| + fields, last = {}, None |
| + for line in block.splitlines(): |
| + if line[:1] in (" ", "\t") and last: |
| + fields[last] += "\n" + line |
| + elif ":" in line: |
| + last, value = line.split(":", 1) |
| + fields[last] = value.strip() |
| + if "Package" in fields: |
| + yield fields |
| + |
| + |
| +def index(archive, stamp, suite, arch): |
| + url = SNAPSHOT % (archive, stamp) + "dists/%s/main/binary-%s/Packages.xz" % (suite, arch) |
| + packages = {} |
| + for p in stanzas(lzma.decompress(fetch(url)).decode()): |
| + p["_base"] = SNAPSHOT % (archive, stamp) |
| + packages[p["Package"]] = p |
| + return packages |
| + |
| + |
| +def relations(p): |
| + """The alternatives of each Depends and Pre-Depends group, names only.""" |
| + groups = [] |
| + for field in ("Pre-Depends", "Depends"): |
| + for group in filter(None, (g.strip() for g in p.get(field, "").split(","))): |
| + groups.append([re.split(r"[\s(\[:]", alt.strip(), maxsplit=1)[0] for alt in group.split("|")]) |
| + return groups |
| + |
| + |
| +def resolver(packages): |
| + provides = {} |
| + for name, p in packages.items(): |
| + for virtual in filter(None, (v.strip() for v in p.get("Provides", "").split(","))): |
| + provides.setdefault(re.split(r"[\s(]", virtual, maxsplit=1)[0], name) |
| + |
| + def pick(alternatives): |
| + for alt in alternatives: |
| + if alt in packages: |
| + return alt |
| + for alt in alternatives: |
| + if alt in provides: |
| + return provides[alt] |
| + raise SystemExit("no package for any of %s" % " | ".join(alternatives)) |
| + |
| + def closure(start, skip=frozenset(), prune=frozenset()): |
| + seen, todo = set(), list(start) |
| + while todo: |
| + name = todo.pop() |
| + if name in seen or name in prune: |
| + continue |
| + seen.add(name) |
| + if name in skip: |
| + continue |
| + for group in relations(packages[name]): |
| + todo.append(pick(group)) |
| + return seen |
| + return closure |
| + |
| + |
| +def pins(version, debian, security, arch): |
| + packages = index("debian", debian, "trixie", arch) |
| + for name, p in index("debian-security", security, "trixie-security", arch).items(): |
| + packages[name] = p # a security update supersedes the release's build |
| + for name in TOP: |
| + if packages[name]["Version"] != version: |
| + sys.exit("%s %s: the snapshots have %s, not %s" % (name, arch, packages[name]["Version"], version)) |
| + closure = resolver(packages) |
| + required = [n for n, p in packages.items() if p.get("Priority") == "required" or p.get("Essential") == "yes"] |
| + base = closure(required) |
| + wanted = sorted(closure(TOP, skip=SKIP, prune=base) - SKIP) |
| + return [{"package": n, "version": packages[n]["Version"], |
| + "url": packages[n]["_base"] + packages[n]["Filename"], |
| + "sha256": packages[n]["SHA256"], "size": int(packages[n]["Size"])} for n in wanted] |
| + |
| + |
| +def main(argv): |
| + if len(argv) != 3: |
| + print(__doc__, file=sys.stderr) |
| + return 2 |
| + version, debian, security = argv |
| + pinned = { |
| + "version": version, |
| + "snapshots": {"debian": debian, "debian-security": security}, |
| + "program": "usr/lib/chromium/chromium-headless-shell", |
| + } |
| + for arch in ARCHES: |
| + pinned[arch] = pins(version, debian, security, arch) |
| + print("%s: %d packages, %.0f MB" % (arch, len(pinned[arch]), sum(p["size"] for p in pinned[arch]) / 1e6)) |
| + with open(OUT, "w") as f: |
| + json.dump(pinned, f, indent=2) |
| + f.write("\n") |
| + print("wrote " + OUT) |
| + return 0 |
| + |
| + |
| +if __name__ == "__main__": |
| + sys.exit(main(sys.argv[1:])) |
diff --git a/scripts/ci-chromium.json b/scripts/ci-chromium.json| new file mode 100644 |
| index 00000000..3a9267a8 |
| --- /dev/null |
| +++ b/scripts/ci-chromium.json |
| @@ -0,0 +1,1090 @@ |
| +{ |
| + "version": "156.0.8078.79-1~deb13u1", |
| + "snapshots": { |
| + "debian": "20261107T024144Z", |
| + "debian-security": "20261103T013555Z" |
| + }, |
| + "program": "usr/lib/chromium/chromium-headless-shell", |
| + "amd64": [ |
| + { |
| + "package": "at-spi2-common", |
| + "version": "2.56.2-1+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/at-spi2-core/at-spi2-common_2.56.2-1+deb13u2_all.deb", |
| + "sha256": "a2a7b53c9925ec33a471d56dd60f5effe35cece109ec4296cc8d98a1250213b4", |
| + "size": 170748 |
| + }, |
| + { |
| + "package": "chromium-common", |
| + "version": "156.0.8078.79-1~deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/c/chromium/chromium-common_156.0.8078.79-1~deb13u1_amd64.deb", |
| + "sha256": "29d9a33123bcc5aba47746eb89a72d973bf7a737e3820425c7496904f7235fbd", |
| + "size": 31731400 |
| + }, |
| + { |
| + "package": "chromium-headless-shell", |
| + "version": "156.0.8078.79-1~deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/c/chromium/chromium-headless-shell_156.0.8078.79-1~deb13u1_amd64.deb", |
| + "sha256": "3effad373d85df1bb998bb88a5768aa3b8cf715a2e0e7a4723d384240169aa80", |
| + "size": 69320980 |
| + }, |
| + { |
| + "package": "fontconfig-config", |
| + "version": "2.15.0-2.3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fontconfig/fontconfig-config_2.15.0-2.3_amd64.deb", |
| + "sha256": "0475c00d02660c07a15085051818625331bb502e053242106aaaa1f2ddb41225", |
| + "size": 318308 |
| + }, |
| + { |
| + "package": "fonts-dejavu-core", |
| + "version": "2.37-8", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fonts-dejavu/fonts-dejavu-core_2.37-8_all.deb", |
| + "sha256": "86635b3d25b3655fc11cb3ecc3af59f0bf19643b02b94f2de48bd10253cdba12", |
| + "size": 840460 |
| + }, |
| + { |
| + "package": "fonts-dejavu-mono", |
| + "version": "2.37-8", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fonts-dejavu/fonts-dejavu-mono_2.37-8_all.deb", |
| + "sha256": "3003e98a5debfdeadc7040a7f715fe9fe6fb67f68deacf6049b54e30f07fc014", |
| + "size": 488808 |
| + }, |
| + { |
| + "package": "libasound2-data", |
| + "version": "1.2.14-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/alsa-lib/libasound2-data_1.2.14-1+deb13u1_all.deb", |
| + "sha256": "04688afdff3769c0f685541daed7b2f6f0cb946799ddf1d5847ddf11fe245559", |
| + "size": 21188 |
| + }, |
| + { |
| + "package": "libasound2t64", |
| + "version": "1.2.14-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/alsa-lib/libasound2t64_1.2.14-1+deb13u1_amd64.deb", |
| + "sha256": "5495496142d57e5ad6d581ac5456ec3c87f872c109a2bfb815d154b673eebc67", |
| + "size": 380896 |
| + }, |
| + { |
| + "package": "libasyncns0", |
| + "version": "0.8-6+b5", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/liba/libasyncns/libasyncns0_0.8-6+b5_amd64.deb", |
| + "sha256": "e7958777b0e3586349c57ac759a95b68f80d28e5bd1c4225705198b39b436115", |
| + "size": 12028 |
| + }, |
| + { |
| + "package": "libatk1.0-0t64", |
| + "version": "2.56.2-1+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/at-spi2-core/libatk1.0-0t64_2.56.2-1+deb13u2_amd64.deb", |
| + "sha256": "24786bc90e3ff80c4d1d8bdb5ec18bb5f06df9081a5233eb080f3202fcf6a1c3", |
| + "size": 51996 |
| + }, |
| + { |
| + "package": "libatomic1", |
| + "version": "14.2.0-19", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/g/gcc-14/libatomic1_14.2.0-19_amd64.deb", |
| + "sha256": "212b399aae2f7299203d261a57e49372e09565a9a5ea971905f94a3960366c05", |
| + "size": 9308 |
| + }, |
| + { |
| + "package": "libatspi2.0-0t64", |
| + "version": "2.56.2-1+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/at-spi2-core/libatspi2.0-0t64_2.56.2-1+deb13u2_amd64.deb", |
| + "sha256": "65e9c9ecbd820fba2d04104cddd0bad33d256cbdfe0d1cb5365f10e363df2315", |
| + "size": 81056 |
| + }, |
| + { |
| + "package": "libbrotli1", |
| + "version": "1.1.0-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/b/brotli/libbrotli1_1.1.0-2+deb13u1_amd64.deb", |
| + "sha256": "db46824c60fee46aff3cc0be3e5f736bc606cae669b1fb17516a41e8073251a9", |
| + "size": 303640 |
| + }, |
| + { |
| + "package": "libdav1d7", |
| + "version": "1.5.1-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/d/dav1d/libdav1d7_1.5.1-1_amd64.deb", |
| + "sha256": "8c64de4465a8ae1ca23e1dada1dfc73d7b431540fd5ae18f21430928576d5b05", |
| + "size": 558612 |
| + }, |
| + { |
| + "package": "libdbus-1-3", |
| + "version": "1.16.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/d/dbus/libdbus-1-3_1.16.2-2_amd64.deb", |
| + "sha256": "bbcb711daff7e104b5f80f9b05475b6142674bfe65518a36a56e96a91068a3f5", |
| + "size": 177904 |
| + }, |
| + { |
| + "package": "libdouble-conversion3", |
| + "version": "3.3.1-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/d/double-conversion/libdouble-conversion3_3.3.1-1_amd64.deb", |
| + "sha256": "bd43b8c185a78d108548b30da6a695aabb6644ce0dd266892da2d10cfe471067", |
| + "size": 41816 |
| + }, |
| + { |
| + "package": "libdrm-amdgpu1", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.124-2_amd64.deb", |
| + "sha256": "c1d97a5e32e2bc68e833b8abeae026b6306198e87ee4396a7ffecd4779caefbf", |
| + "size": 22632 |
| + }, |
| + { |
| + "package": "libdrm-common", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm-common_2.4.124-2_all.deb", |
| + "sha256": "9a8a6c65c165e9964f106fb4ac710959b5d33e0790227e3ab6b27c4742d1254a", |
| + "size": 8288 |
| + }, |
| + { |
| + "package": "libdrm-intel1", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm-intel1_2.4.124-2_amd64.deb", |
| + "sha256": "188ab1fd74c838b3c8055d62107351e16a4bb7a25d39c30bbb9aac30ddd37238", |
| + "size": 64104 |
| + }, |
| + { |
| + "package": "libdrm2", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm2_2.4.124-2_amd64.deb", |
| + "sha256": "fe2276901c7cd7b8079de63072d37fe1cbeb4eb001a3bc1f1d662ad89aa0890e", |
| + "size": 39032 |
| + }, |
| + { |
| + "package": "libedit2", |
| + "version": "3.1-20250104-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libe/libedit/libedit2_3.1-20250104-1_amd64.deb", |
| + "sha256": "b002ea172b9c1e34a67bc497c523c67bb74c3f0a4e98113cb083990a1f1d3bfe", |
| + "size": 93832 |
| + }, |
| + { |
| + "package": "libelf1t64", |
| + "version": "0.192-4", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/e/elfutils/libelf1t64_0.192-4_amd64.deb", |
| + "sha256": "94497b7e17b6f574a0605b380d454e20d3f01a9c63b70c2a2263f679d30053e1", |
| + "size": 189408 |
| + }, |
| + { |
| + "package": "libexpat1", |
| + "version": "2.9.0-1~deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/e/expat/libexpat1_2.9.0-1~deb13u1_amd64.deb", |
| + "sha256": "feff874772cae904ae4d24e917b35664952bec4b4ae9100a4edda5a7fa746832", |
| + "size": 125744 |
| + }, |
| + { |
| + "package": "libffi8", |
| + "version": "3.4.8-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libf/libffi/libffi8_3.4.8-2_amd64.deb", |
| + "sha256": "0ebdc340de33333639c3c63874cd4b15ac2e83dfa1ef3053b7eefaf4919f4f68", |
| + "size": 24144 |
| + }, |
| + { |
| + "package": "libflac14", |
| + "version": "1.5.0+ds-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/flac/libflac14_1.5.0+ds-2_amd64.deb", |
| + "sha256": "658b9f77d35638caf75dfaea4f6d5cde196104d5662f0776e23d7cc450bd4cb5", |
| + "size": 209588 |
| + }, |
| + { |
| + "package": "libfontconfig1", |
| + "version": "2.15.0-2.3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fontconfig/libfontconfig1_2.15.0-2.3_amd64.deb", |
| + "sha256": "7ae91ec59857cc8e375eb2bdd371a4a69daea38f7787d06d474a847867d852b1", |
| + "size": 391576 |
| + }, |
| + { |
| + "package": "libfreetype6", |
| + "version": "2.13.3+dfsg-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/f/freetype/libfreetype6_2.13.3+dfsg-1+deb13u1_amd64.deb", |
| + "sha256": "e4947f3291528f03d574f2b01d5c5fc45c58c47480f32888a5cdf0f231ab584e", |
| + "size": 452308 |
| + }, |
| + { |
| + "package": "libgbm1", |
| + "version": "25.0.7-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/m/mesa/libgbm1_25.0.7-2+deb13u1_amd64.deb", |
| + "sha256": "31fb6d76b9ceaf13848fa617df53f85f62626b4fe7464a93811c720af6d5f2dd", |
| + "size": 44592 |
| + }, |
| + { |
| + "package": "libglib2.0-0t64", |
| + "version": "2.84.4-3~deb13u5", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/g/glib2.0/libglib2.0-0t64_2.84.4-3~deb13u5_amd64.deb", |
| + "sha256": "e2baf92c57d1db1753e5781a61450d9a01e7833c7bd2dfe87776a6811c11ecc2", |
| + "size": 1521120 |
| + }, |
| + { |
| + "package": "libgraphite2-3", |
| + "version": "1.3.14-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/g/graphite2/libgraphite2-3_1.3.14-2+deb13u1_amd64.deb", |
| + "sha256": "1769ba3ed3c1fc75b7fbe02678e32aa24391205813eceef4e1e3500015d12ee3", |
| + "size": 75172 |
| + }, |
| + { |
| + "package": "libharfbuzz-subset0", |
| + "version": "10.2.0-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/h/harfbuzz/libharfbuzz-subset0_10.2.0-1+deb13u1_amd64.deb", |
| + "sha256": "2d0de8588408af221927b372c3c8d439d638a0a8abb549660ed5813ab529e6bc", |
| + "size": 559548 |
| + }, |
| + { |
| + "package": "libharfbuzz0b", |
| + "version": "10.2.0-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/h/harfbuzz/libharfbuzz0b_10.2.0-1+deb13u1_amd64.deb", |
| + "sha256": "932165b933e5eb633293afe984a983ebe89cb27c923ce7208626f1da6c0c7941", |
| + "size": 478952 |
| + }, |
| + { |
| + "package": "libjpeg62-turbo", |
| + "version": "1:2.1.5-4", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_2.1.5-4_amd64.deb", |
| + "sha256": "5504299ad0e3c0a9ca9f962a68a650a040db52f9f416a109e74df48d55601d3f", |
| + "size": 168152 |
| + }, |
| + { |
| + "package": "liblcms2-2", |
| + "version": "2.16-2+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/l/lcms2/liblcms2-2_2.16-2+deb13u2_amd64.deb", |
| + "sha256": "32e53c2002ccea8c60c02779bea0ba49ac132fef702988a30d64af79b6617806", |
| + "size": 160264 |
| + }, |
| + { |
| + "package": "libllvm19", |
| + "version": "1:19.1.7-3+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/llvm-toolchain-19/libllvm19_19.1.7-3+b1_amd64.deb", |
| + "sha256": "db0d614d61345ca710fb73e75105f1ec6e38898fa7b3aa99fa7eb7d8b0a11d57", |
| + "size": 25978316 |
| + }, |
| + { |
| + "package": "libminizip1t64", |
| + "version": "1:1.3.dfsg+really1.3.1-1+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/z/zlib/libminizip1t64_1.3.dfsg+really1.3.1-1+b1_amd64.deb", |
| + "sha256": "9682faa260b02c865790f02089a755cb19b4b9100d91d3adb11da090709ad5d2", |
| + "size": 53324 |
| + }, |
| + { |
| + "package": "libmp3lame0", |
| + "version": "3.100-6+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/lame/libmp3lame0_3.100-6+b3_amd64.deb", |
| + "sha256": "3867319c9fbbc8cc25f2d1dc1d75d13548c84c37fa709c1ac9ca02ac051b63ab", |
| + "size": 362660 |
| + }, |
| + { |
| + "package": "libmpg123-0t64", |
| + "version": "1.32.10-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/m/mpg123/libmpg123-0t64_1.32.10-1+deb13u1_amd64.deb", |
| + "sha256": "31fa6ef638f1fdbe198faee0b6fe50d9dd468077f8247cc3dbf6b2250abb6101", |
| + "size": 149184 |
| + }, |
| + { |
| + "package": "libnspr4", |
| + "version": "2:4.36-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/n/nspr/libnspr4_4.36-1_amd64.deb", |
| + "sha256": "87fc2039ee89cff2b8010fa9535706b1def40031acfc52bf12197dcb3cb7b064", |
| + "size": 109800 |
| + }, |
| + { |
| + "package": "libnss3", |
| + "version": "2:3.110-1+deb13u5", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/n/nss/libnss3_3.110-1+deb13u5_amd64.deb", |
| + "sha256": "7059839165c39e734ff59c712fde83ef5ea01328872819dfbabd1c08e75f3116", |
| + "size": 1392784 |
| + }, |
| + { |
| + "package": "libogg0", |
| + "version": "1.3.5-3+b2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libo/libogg/libogg0_1.3.5-3+b2_amd64.deb", |
| + "sha256": "911aec914f5bda0788164ff8068b682537378bf8d407b1d6c1b377522f96b83b", |
| + "size": 23812 |
| + }, |
| + { |
| + "package": "libopenh264-8", |
| + "version": "2.6.0+dfsg-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/o/openh264/libopenh264-8_2.6.0+dfsg-2_amd64.deb", |
| + "sha256": "d1ced361cc6053f8b1eaf1cb3095085a1645491819131919d900ad1e1922643b", |
| + "size": 395464 |
| + }, |
| + { |
| + "package": "libopenjp2-7", |
| + "version": "2.5.3-2.1~deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/o/openjpeg2/libopenjp2-7_2.5.3-2.1~deb13u2_amd64.deb", |
| + "sha256": "7ddf6360e8845853ba3c9cfaefc2ad6b92b2627eb8564a257f5f2a4c857f8748", |
| + "size": 204616 |
| + }, |
| + { |
| + "package": "libopus0", |
| + "version": "1.5.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/o/opus/libopus0_1.5.2-2_amd64.deb", |
| + "sha256": "794056db33d71b2ac4bd8b5a4eb23b627bcb8a49d123c33b6e841a996253a067", |
| + "size": 2851932 |
| + }, |
| + { |
| + "package": "libpciaccess0", |
| + "version": "0.17-3+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libp/libpciaccess/libpciaccess0_0.17-3+b3_amd64.deb", |
| + "sha256": "d9a0091071635a84e837051e4813005ac445071731becea28fba4d9806df5252", |
| + "size": 51920 |
| + }, |
| + { |
| + "package": "libpng16-16t64", |
| + "version": "1.6.48-1+deb13u6", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/libp/libpng1.6/libpng16-16t64_1.6.48-1+deb13u6_amd64.deb", |
| + "sha256": "0f8034d1c2547760430c81e8d87e5d6acd533a3493c80cf76dbecd0343b6773c", |
| + "size": 283368 |
| + }, |
| + { |
| + "package": "libpulse0", |
| + "version": "17.0+dfsg1-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/p/pulseaudio/libpulse0_17.0+dfsg1-2+b1_amd64.deb", |
| + "sha256": "786aca79119cb249562708fd24dcdf817604cfe75bbfcb8cda3464042e17f40e", |
| + "size": 275632 |
| + }, |
| + { |
| + "package": "libsensors-config", |
| + "version": "1:3.6.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/lm-sensors/libsensors-config_3.6.2-2_all.deb", |
| + "sha256": "3056da80c7d963af795dab480ab6f6f4b154ad4ac39f522dc52d17c834fea253", |
| + "size": 16236 |
| + }, |
| + { |
| + "package": "libsensors5", |
| + "version": "1:3.6.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/lm-sensors/libsensors5_3.6.2-2_amd64.deb", |
| + "sha256": "f0a994a6d7cfa695dea5343d0d1ba7eed796c0ad920c7282998b95f60049c4f6", |
| + "size": 37492 |
| + }, |
| + { |
| + "package": "libsndfile1", |
| + "version": "1.2.2-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libs/libsndfile/libsndfile1_1.2.2-2+deb13u1_amd64.deb", |
| + "sha256": "d92263a045554e6f39c6b1c2ee4cca44a3248d9b9339301ff195969bf84b75eb", |
| + "size": 199172 |
| + }, |
| + { |
| + "package": "libvorbis0a", |
| + "version": "1.3.7-3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libv/libvorbis/libvorbis0a_1.3.7-3_amd64.deb", |
| + "sha256": "0465f7f602f7b00965e58e7273b5876060ab7946f0452a9f95d979046932cc42", |
| + "size": 89960 |
| + }, |
| + { |
| + "package": "libvorbisenc2", |
| + "version": "1.3.7-3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libv/libvorbis/libvorbisenc2_1.3.7-3_amd64.deb", |
| + "sha256": "5fbbf06a5b196235aa2753cd12bbe7f843328571d368f15b1c337578e29f73a2", |
| + "size": 75432 |
| + }, |
| + { |
| + "package": "libwayland-server0", |
| + "version": "1.23.1-3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/w/wayland/libwayland-server0_1.23.1-3_amd64.deb", |
| + "sha256": "2967212bd582e0dffca443fdc44f4c660e7368d41f7ee3a7f6314e0c3abfe9ea", |
| + "size": 34432 |
| + }, |
| + { |
| + "package": "libx11-6", |
| + "version": "2:1.8.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libx11/libx11-6_1.8.12-1_amd64.deb", |
| + "sha256": "b5a3fd3bf8c8fd0364bfb9bea00dcba7fc301229bd02dded084632d31f5b0fb3", |
| + "size": 815292 |
| + }, |
| + { |
| + "package": "libx11-data", |
| + "version": "2:1.8.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libx11/libx11-data_1.8.12-1_all.deb", |
| + "sha256": "c54f87069888f80ba4da586da6147d74c7598ccdd8b90906dbc4271fa414c738", |
| + "size": 343072 |
| + }, |
| + { |
| + "package": "libx11-xcb1", |
| + "version": "2:1.8.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libx11/libx11-xcb1_1.8.12-1_amd64.deb", |
| + "sha256": "e05f94d21a932fba5b09b9b13d99df776b155d3bc792c0e294451df9ffe1ba25", |
| + "size": 247128 |
| + }, |
| + { |
| + "package": "libxau6", |
| + "version": "1:1.0.11-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxau/libxau6_1.0.11-1_amd64.deb", |
| + "sha256": "689a9f0e0ba3e2c65431f864871e303ee904de69dd28abfc462663fae030227f", |
| + "size": 20392 |
| + }, |
| + { |
| + "package": "libxcb-dri3-0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-dri3-0_1.17.0-2+b1_amd64.deb", |
| + "sha256": "f446d42fb5fcebbb3e347368ba83616769fdb271d85b2f49048e337f3163d267", |
| + "size": 106892 |
| + }, |
| + { |
| + "package": "libxcb-present0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-present0_1.17.0-2+b1_amd64.deb", |
| + "sha256": "db95ea4630c55bd7f3281cb60ccf75b1627ef2f4399e1939f8f6161e584a92fb", |
| + "size": 105612 |
| + }, |
| + { |
| + "package": "libxcb-randr0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-randr0_1.17.0-2+b1_amd64.deb", |
| + "sha256": "f5d9fe5fdf797918f81f0abf6cfd4270bd54659540cddb4da709ab7154523214", |
| + "size": 116736 |
| + }, |
| + { |
| + "package": "libxcb-sync1", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-sync1_1.17.0-2+b1_amd64.deb", |
| + "sha256": "0ce4770ed1505be9ddc6473045e4662d062aff2f3077ee684265f01cfb543559", |
| + "size": 108688 |
| + }, |
| + { |
| + "package": "libxcb-xfixes0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-xfixes0_1.17.0-2+b1_amd64.deb", |
| + "sha256": "f9c1aafc18bf9e4662e34bbaf3bb00f1f4e8c2fc1dd786fdfb6cb9cb6c64fae7", |
| + "size": 109288 |
| + }, |
| + { |
| + "package": "libxcb1", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb1_1.17.0-2+b1_amd64.deb", |
| + "sha256": "5c222a72d11b866447da31693254f738430726e3e065a384e82687b2fd2f978b", |
| + "size": 144340 |
| + }, |
| + { |
| + "package": "libxcomposite1", |
| + "version": "1:0.4.6-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcomposite/libxcomposite1_0.4.6-1_amd64.deb", |
| + "sha256": "20e3c1d9b2135f0c8c4246a9fd26a51a57d5850c3b36ecc173c45d6be7328af3", |
| + "size": 16348 |
| + }, |
| + { |
| + "package": "libxdamage1", |
| + "version": "1:1.1.6-1+b2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxdamage/libxdamage1_1.1.6-1+b2_amd64.deb", |
| + "sha256": "e51e43f23f3befbc1f9408271f4df6773d37caece9ce7e1f38abade382f7fbf7", |
| + "size": 15460 |
| + }, |
| + { |
| + "package": "libxdmcp6", |
| + "version": "1:1.1.5-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxdmcp/libxdmcp6_1.1.5-1_amd64.deb", |
| + "sha256": "0740dc760916b2008b45417a42a8fd7dd5de370fb57d31373f15034cda8acf0b", |
| + "size": 27756 |
| + }, |
| + { |
| + "package": "libxext6", |
| + "version": "2:1.3.4-1+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxext/libxext6_1.3.4-1+b3_amd64.deb", |
| + "sha256": "fc618ec40465e5ce48622606299cb47833efc3fb235ba15543b81f850722f443", |
| + "size": 50448 |
| + }, |
| + { |
| + "package": "libxfixes3", |
| + "version": "1:6.0.0-2+b4", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxfixes/libxfixes3_6.0.0-2+b4_amd64.deb", |
| + "sha256": "3fdd95d86d8e9d63e11f52070935c8f9f912c36aa3b17338d969f7685f3ed4fb", |
| + "size": 20228 |
| + }, |
| + { |
| + "package": "libxi6", |
| + "version": "2:1.8.2-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxi/libxi6_1.8.2-1_amd64.deb", |
| + "sha256": "093d0903f35bb7a9f6815180ee040e6951fecf9b66c128cd72f064710210606e", |
| + "size": 78896 |
| + }, |
| + { |
| + "package": "libxkbcommon0", |
| + "version": "1.7.0-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxkbcommon/libxkbcommon0_1.7.0-2_amd64.deb", |
| + "sha256": "f75ee544f55acc6a271debfab3ea4ae0458afc89d81cfe1a71137e07d4895b86", |
| + "size": 112700 |
| + }, |
| + { |
| + "package": "libxml2", |
| + "version": "2.12.7+dfsg+really2.9.14-2.1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/libx/libxml2/libxml2_2.12.7+dfsg+really2.9.14-2.1+deb13u1_amd64.deb", |
| + "sha256": "b4743a0fd8e86379ec2bdfb6b97b99fb1c92a925e538920052316814470e99f8", |
| + "size": 698060 |
| + }, |
| + { |
| + "package": "libxnvctrl0", |
| + "version": "535.171.04-1+b2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxnvctrl/libxnvctrl0_535.171.04-1+b2_amd64.deb", |
| + "sha256": "0f53cff5c3d0395635bcabd626ac85f6a74d2dac21963c4955396f24bfc73db8", |
| + "size": 14172 |
| + }, |
| + { |
| + "package": "libxrandr2", |
| + "version": "2:1.5.4-1+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxrandr/libxrandr2_1.5.4-1+b3_amd64.deb", |
| + "sha256": "11e3490de93a8bbee3daba719cb8e1325a26fb3c125525c34bdcb7deb05eb9b2", |
| + "size": 36312 |
| + }, |
| + { |
| + "package": "libxrender1", |
| + "version": "1:0.9.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxrender/libxrender1_0.9.12-1_amd64.deb", |
| + "sha256": "9d042dfd5e613be1e02e6ddd0c5c4adef19c5eb08f6db838c2eba672c496dca4", |
| + "size": 27896 |
| + }, |
| + { |
| + "package": "libxshmfence1", |
| + "version": "1.3.3-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxshmfence/libxshmfence1_1.3.3-1_amd64.deb", |
| + "sha256": "7b339e9e5b2349723d35af4df89bcc7aa456bbdf8ba1754358f9b44c3fe1f964", |
| + "size": 10884 |
| + }, |
| + { |
| + "package": "libz3-4", |
| + "version": "4.13.3-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/z/z3/libz3-4_4.13.3-1_amd64.deb", |
| + "sha256": "71383373523ef62d47eccf660cf6535c3febcbb3f88e54cb7a43124014b57359", |
| + "size": 8560036 |
| + }, |
| + { |
| + "package": "mesa-libgallium", |
| + "version": "25.0.7-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/m/mesa/mesa-libgallium_25.0.7-2+deb13u1_amd64.deb", |
| + "sha256": "3e610f29321cdcc61337c86e6b4031ff60f0c9915fe19e6a862ac06480620ff4", |
| + "size": 9630224 |
| + }, |
| + { |
| + "package": "xkb-data", |
| + "version": "2.42-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/x/xkeyboard-config/xkb-data_2.42-1_all.deb", |
| + "sha256": "196ff18533382f64e057ea49df2bb486bd4275a4cc0917361edb560b8756dada", |
| + "size": 789736 |
| + } |
| + ], |
| + "arm64": [ |
| + { |
| + "package": "at-spi2-common", |
| + "version": "2.56.2-1+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/at-spi2-core/at-spi2-common_2.56.2-1+deb13u2_all.deb", |
| + "sha256": "a2a7b53c9925ec33a471d56dd60f5effe35cece109ec4296cc8d98a1250213b4", |
| + "size": 170748 |
| + }, |
| + { |
| + "package": "chromium-common", |
| + "version": "156.0.8078.79-1~deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/c/chromium/chromium-common_156.0.8078.79-1~deb13u1_arm64.deb", |
| + "sha256": "80b0fe734394208d7a9d5daf160dfaea8bc8645214239e941f45bc2903d29f02", |
| + "size": 36694960 |
| + }, |
| + { |
| + "package": "chromium-headless-shell", |
| + "version": "156.0.8078.79-1~deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/c/chromium/chromium-headless-shell_156.0.8078.79-1~deb13u1_arm64.deb", |
| + "sha256": "ccecd0a51e2f5fdb32d5eef3a3af9cb85372e19671468ea9ee09ce0aea5bf76c", |
| + "size": 60758676 |
| + }, |
| + { |
| + "package": "fontconfig-config", |
| + "version": "2.15.0-2.3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fontconfig/fontconfig-config_2.15.0-2.3_arm64.deb", |
| + "sha256": "10f643f467b51cf25fc18d1945bc61246dd8d8d1fe6bc712a2b1712c74ebc4d6", |
| + "size": 318304 |
| + }, |
| + { |
| + "package": "fonts-dejavu-core", |
| + "version": "2.37-8", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fonts-dejavu/fonts-dejavu-core_2.37-8_all.deb", |
| + "sha256": "86635b3d25b3655fc11cb3ecc3af59f0bf19643b02b94f2de48bd10253cdba12", |
| + "size": 840460 |
| + }, |
| + { |
| + "package": "fonts-dejavu-mono", |
| + "version": "2.37-8", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fonts-dejavu/fonts-dejavu-mono_2.37-8_all.deb", |
| + "sha256": "3003e98a5debfdeadc7040a7f715fe9fe6fb67f68deacf6049b54e30f07fc014", |
| + "size": 488808 |
| + }, |
| + { |
| + "package": "libasound2-data", |
| + "version": "1.2.14-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/alsa-lib/libasound2-data_1.2.14-1+deb13u1_all.deb", |
| + "sha256": "04688afdff3769c0f685541daed7b2f6f0cb946799ddf1d5847ddf11fe245559", |
| + "size": 21188 |
| + }, |
| + { |
| + "package": "libasound2t64", |
| + "version": "1.2.14-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/alsa-lib/libasound2t64_1.2.14-1+deb13u1_arm64.deb", |
| + "sha256": "9c808d819ccddc37c793dd3186c2ecd858b2feb2474cebb883f70386e7890d39", |
| + "size": 341632 |
| + }, |
| + { |
| + "package": "libasyncns0", |
| + "version": "0.8-6+b5", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/liba/libasyncns/libasyncns0_0.8-6+b5_arm64.deb", |
| + "sha256": "818bbcaa7ada536a1bdd5b1c26b77608606403f5c15557691e83d0b4433b89ef", |
| + "size": 11672 |
| + }, |
| + { |
| + "package": "libatk1.0-0t64", |
| + "version": "2.56.2-1+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/at-spi2-core/libatk1.0-0t64_2.56.2-1+deb13u2_arm64.deb", |
| + "sha256": "c35cd1a2bd7f6750e56a0755571b091a13fdb606354312088626ba639719c953", |
| + "size": 50368 |
| + }, |
| + { |
| + "package": "libatomic1", |
| + "version": "14.2.0-19", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/g/gcc-14/libatomic1_14.2.0-19_arm64.deb", |
| + "sha256": "7ccff90234484bf21ae5ecb79d25b6a84b2f4038f65dd139085b2e3a937cd8dc", |
| + "size": 10128 |
| + }, |
| + { |
| + "package": "libatspi2.0-0t64", |
| + "version": "2.56.2-1+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/a/at-spi2-core/libatspi2.0-0t64_2.56.2-1+deb13u2_arm64.deb", |
| + "sha256": "0b5266747ef215e161152772081ce3b2990d72d02447185faa1af661e11e2d39", |
| + "size": 76680 |
| + }, |
| + { |
| + "package": "libbrotli1", |
| + "version": "1.1.0-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/b/brotli/libbrotli1_1.1.0-2+deb13u1_arm64.deb", |
| + "sha256": "a8caceeddd3a407888234ef488e0a773299e05fac703c8695166a0a9bc86587f", |
| + "size": 293896 |
| + }, |
| + { |
| + "package": "libdav1d7", |
| + "version": "1.5.1-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/d/dav1d/libdav1d7_1.5.1-1_arm64.deb", |
| + "sha256": "bcb430fa4c5f05bc3fa4dd9f18b7b0498ec9701c23e83bf57a29996216c3a245", |
| + "size": 252128 |
| + }, |
| + { |
| + "package": "libdbus-1-3", |
| + "version": "1.16.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/d/dbus/libdbus-1-3_1.16.2-2_arm64.deb", |
| + "sha256": "ca6bb5f2047ad58d274cb7d14216035a07d8e5aae6f6a0122c4f6293c9c39515", |
| + "size": 169068 |
| + }, |
| + { |
| + "package": "libdouble-conversion3", |
| + "version": "3.3.1-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/d/double-conversion/libdouble-conversion3_3.3.1-1_arm64.deb", |
| + "sha256": "ea827a47ddffeaa8e95dc8d0c3b8aa9c79b33b2be77109450c2b06a2b89644d8", |
| + "size": 37316 |
| + }, |
| + { |
| + "package": "libdrm-amdgpu1", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.124-2_arm64.deb", |
| + "sha256": "e36c72774cc215818b48ee2174c7ad1d9a2bf89a09cdee7a7a128d288d8eef43", |
| + "size": 21828 |
| + }, |
| + { |
| + "package": "libdrm-common", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm-common_2.4.124-2_all.deb", |
| + "sha256": "9a8a6c65c165e9964f106fb4ac710959b5d33e0790227e3ab6b27c4742d1254a", |
| + "size": 8288 |
| + }, |
| + { |
| + "package": "libdrm2", |
| + "version": "2.4.124-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libd/libdrm/libdrm2_2.4.124-2_arm64.deb", |
| + "sha256": "b535506630bb6a9a616bc07caf3b29915f980d8c3437852fb96ea64fb1a8a3f8", |
| + "size": 38304 |
| + }, |
| + { |
| + "package": "libedit2", |
| + "version": "3.1-20250104-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libe/libedit/libedit2_3.1-20250104-1_arm64.deb", |
| + "sha256": "496c31df89fac9cb7e98102fcc21daf887376dcd9914f6322c86dd5bd4360ff1", |
| + "size": 89296 |
| + }, |
| + { |
| + "package": "libelf1t64", |
| + "version": "0.192-4", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/e/elfutils/libelf1t64_0.192-4_arm64.deb", |
| + "sha256": "815b4265c7d6c89c5bbad456bdeed7af893da6912c9d16cf4c581001927c0e37", |
| + "size": 189080 |
| + }, |
| + { |
| + "package": "libexpat1", |
| + "version": "2.9.0-1~deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/e/expat/libexpat1_2.9.0-1~deb13u1_arm64.deb", |
| + "sha256": "d9e1c50fcdad079fe16d77f1578adcc763be1bf7f2da7fa8adca7010b0c84c83", |
| + "size": 113920 |
| + }, |
| + { |
| + "package": "libffi8", |
| + "version": "3.4.8-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libf/libffi/libffi8_3.4.8-2_arm64.deb", |
| + "sha256": "d84a783b818f2386627604e64b793eb4ac5bb9ea1ba321a194a1c9c82fe09a01", |
| + "size": 21260 |
| + }, |
| + { |
| + "package": "libflac14", |
| + "version": "1.5.0+ds-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/flac/libflac14_1.5.0+ds-2_arm64.deb", |
| + "sha256": "11800827306e56fcbd1a65ea67d9d13126fc02bf87fdfecd35e0f48a145b3c59", |
| + "size": 179768 |
| + }, |
| + { |
| + "package": "libfontconfig1", |
| + "version": "2.15.0-2.3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/f/fontconfig/libfontconfig1_2.15.0-2.3_arm64.deb", |
| + "sha256": "872781cf62926b68c34a4302a3caae334ff8d4d83a2b2477f8fb454460aadc99", |
| + "size": 387092 |
| + }, |
| + { |
| + "package": "libfreetype6", |
| + "version": "2.13.3+dfsg-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/f/freetype/libfreetype6_2.13.3+dfsg-1+deb13u1_arm64.deb", |
| + "sha256": "0c426e83f1af816b9a4df9056fd2238463d1cd07969ee640965da9fb6ecaf107", |
| + "size": 422284 |
| + }, |
| + { |
| + "package": "libgbm1", |
| + "version": "25.0.7-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/m/mesa/libgbm1_25.0.7-2+deb13u1_arm64.deb", |
| + "sha256": "2beb8d20ca715a01b7b2352c1167c0d7097c9d8a486704a9a966f95d4077cdfc", |
| + "size": 44144 |
| + }, |
| + { |
| + "package": "libglib2.0-0t64", |
| + "version": "2.84.4-3~deb13u5", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/g/glib2.0/libglib2.0-0t64_2.84.4-3~deb13u5_arm64.deb", |
| + "sha256": "d446f0ea85fb9dc411219ce861e59e5eabe1981c796918771a7d2aa97cc72481", |
| + "size": 1428508 |
| + }, |
| + { |
| + "package": "libgraphite2-3", |
| + "version": "1.3.14-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/g/graphite2/libgraphite2-3_1.3.14-2+deb13u1_arm64.deb", |
| + "sha256": "b0c3414b113de62be1dc28fa2c899ac0856256e2f094d92c36c3275a5053311a", |
| + "size": 70348 |
| + }, |
| + { |
| + "package": "libharfbuzz-subset0", |
| + "version": "10.2.0-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/h/harfbuzz/libharfbuzz-subset0_10.2.0-1+deb13u1_arm64.deb", |
| + "sha256": "94762ffe1961b0d3d042398fef3f56545f99c5e070b17a557782664056b05a00", |
| + "size": 508584 |
| + }, |
| + { |
| + "package": "libharfbuzz0b", |
| + "version": "10.2.0-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/h/harfbuzz/libharfbuzz0b_10.2.0-1+deb13u1_arm64.deb", |
| + "sha256": "3ff928f981b54b491ee12e4cf68558cc5d61c652bdab276cd4c4c3fbbcee16ca", |
| + "size": 441932 |
| + }, |
| + { |
| + "package": "libjpeg62-turbo", |
| + "version": "1:2.1.5-4", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_2.1.5-4_arm64.deb", |
| + "sha256": "e4989073bb0bac8a6ec043c7adb80e1dfe601d8552233da48bb24ab45d1a1d4a", |
| + "size": 172784 |
| + }, |
| + { |
| + "package": "liblcms2-2", |
| + "version": "2.16-2+deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/l/lcms2/liblcms2-2_2.16-2+deb13u2_arm64.deb", |
| + "sha256": "6636997fc488327a8d0951a038df6e5178a52b3f5e5cc2386d42655621f5672d", |
| + "size": 151540 |
| + }, |
| + { |
| + "package": "libllvm19", |
| + "version": "1:19.1.7-3+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/llvm-toolchain-19/libllvm19_19.1.7-3+b1_arm64.deb", |
| + "sha256": "8a48e1a49f7fcc3be74e697767d72902f4b03041401d1529bcfad1849df39148", |
| + "size": 23285344 |
| + }, |
| + { |
| + "package": "libminizip1t64", |
| + "version": "1:1.3.dfsg+really1.3.1-1+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/z/zlib/libminizip1t64_1.3.dfsg+really1.3.1-1+b1_arm64.deb", |
| + "sha256": "46f361d1deb90caa1760f230c9c119fa4ce255636b12e6d817a0f65d6de87aad", |
| + "size": 52592 |
| + }, |
| + { |
| + "package": "libmp3lame0", |
| + "version": "3.100-6+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/lame/libmp3lame0_3.100-6+b3_arm64.deb", |
| + "sha256": "ed3563722129ffa4def03b7af0b589fa20eef972bdcc4599202ddb1ac654c58e", |
| + "size": 354760 |
| + }, |
| + { |
| + "package": "libmpg123-0t64", |
| + "version": "1.32.10-1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/m/mpg123/libmpg123-0t64_1.32.10-1+deb13u1_arm64.deb", |
| + "sha256": "d284df39ff3b64f1cdf274352613c52534c55eed82c3a2ff0fc7ba154acd7bf0", |
| + "size": 143208 |
| + }, |
| + { |
| + "package": "libnspr4", |
| + "version": "2:4.36-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/n/nspr/libnspr4_4.36-1_arm64.deb", |
| + "sha256": "b8cd0221e4c35a77ec6e3b89959ca96deb75919a3c55b6735ca0288a1b61bdbb", |
| + "size": 102088 |
| + }, |
| + { |
| + "package": "libnss3", |
| + "version": "2:3.110-1+deb13u5", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/n/nss/libnss3_3.110-1+deb13u5_arm64.deb", |
| + "sha256": "71ec50f97b4e5df10609e521559cfccf96f29d73681284e9a48edd4400d5a0a5", |
| + "size": 1290684 |
| + }, |
| + { |
| + "package": "libogg0", |
| + "version": "1.3.5-3+b2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libo/libogg/libogg0_1.3.5-3+b2_arm64.deb", |
| + "sha256": "d59a83ab352bf0c16ce9513fdf264f87214813ca8c628c652801ef476ece8286", |
| + "size": 23580 |
| + }, |
| + { |
| + "package": "libopenh264-8", |
| + "version": "2.6.0+dfsg-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/o/openh264/libopenh264-8_2.6.0+dfsg-2_arm64.deb", |
| + "sha256": "dd40ffeeb006af3a610e015881340c704b8bb38627434a150b7d9e39e657dfbe", |
| + "size": 335852 |
| + }, |
| + { |
| + "package": "libopenjp2-7", |
| + "version": "2.5.3-2.1~deb13u2", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/o/openjpeg2/libopenjp2-7_2.5.3-2.1~deb13u2_arm64.deb", |
| + "sha256": "e27f4d03d4b5836473be3210b16567aa9435a337f8c4537868773a123f9c9e57", |
| + "size": 189464 |
| + }, |
| + { |
| + "package": "libopus0", |
| + "version": "1.5.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/o/opus/libopus0_1.5.2-2_arm64.deb", |
| + "sha256": "1d980e8a4717074805a98dbe07671cb3bee068c25709315f3de836980c629836", |
| + "size": 2812952 |
| + }, |
| + { |
| + "package": "libpng16-16t64", |
| + "version": "1.6.48-1+deb13u6", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/libp/libpng1.6/libpng16-16t64_1.6.48-1+deb13u6_arm64.deb", |
| + "sha256": "57177299a638e30032a7191cc32a1b25fe4de7565164d770685d6d7f56771317", |
| + "size": 275220 |
| + }, |
| + { |
| + "package": "libpulse0", |
| + "version": "17.0+dfsg1-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/p/pulseaudio/libpulse0_17.0+dfsg1-2+b1_arm64.deb", |
| + "sha256": "2de5610e3affe69cfb11110f890375261b47c9e0fc1a81eef7ecc4d6d2dc9a6d", |
| + "size": 236376 |
| + }, |
| + { |
| + "package": "libsensors-config", |
| + "version": "1:3.6.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/lm-sensors/libsensors-config_3.6.2-2_all.deb", |
| + "sha256": "3056da80c7d963af795dab480ab6f6f4b154ad4ac39f522dc52d17c834fea253", |
| + "size": 16236 |
| + }, |
| + { |
| + "package": "libsensors5", |
| + "version": "1:3.6.2-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/l/lm-sensors/libsensors5_3.6.2-2_arm64.deb", |
| + "sha256": "7469f1ccce8afdba33d3b11847d0ecdf2221805a0694dee21ee4d622e8f72145", |
| + "size": 36444 |
| + }, |
| + { |
| + "package": "libsndfile1", |
| + "version": "1.2.2-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libs/libsndfile/libsndfile1_1.2.2-2+deb13u1_arm64.deb", |
| + "sha256": "6c94f17e1f02778f98b96bb9ae19ff30085662e96685898a018c26bfd4bfc3f2", |
| + "size": 185528 |
| + }, |
| + { |
| + "package": "libvorbis0a", |
| + "version": "1.3.7-3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libv/libvorbis/libvorbis0a_1.3.7-3_arm64.deb", |
| + "sha256": "6e8e64ebe692dd2d019af7f914f2e3b81bf13d4b1ce2516fb4248a0310ef7cf6", |
| + "size": 83772 |
| + }, |
| + { |
| + "package": "libvorbisenc2", |
| + "version": "1.3.7-3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libv/libvorbis/libvorbisenc2_1.3.7-3_arm64.deb", |
| + "sha256": "4a477b3ae19ba50a288f036c8176d61cd9f3836ba65472f88b95e3f6b3bf2dd3", |
| + "size": 75532 |
| + }, |
| + { |
| + "package": "libwayland-server0", |
| + "version": "1.23.1-3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/w/wayland/libwayland-server0_1.23.1-3_arm64.deb", |
| + "sha256": "062702d57cf07b42ab7f0fa1aac8bc3f605eb47f2f0b9ecb1614674140d79f1b", |
| + "size": 33656 |
| + }, |
| + { |
| + "package": "libx11-6", |
| + "version": "2:1.8.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libx11/libx11-6_1.8.12-1_arm64.deb", |
| + "sha256": "646f2d3f2165c8eebceb7f4aaca31e97a818bb11a045964833a9f764b738bac2", |
| + "size": 794952 |
| + }, |
| + { |
| + "package": "libx11-data", |
| + "version": "2:1.8.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libx11/libx11-data_1.8.12-1_all.deb", |
| + "sha256": "c54f87069888f80ba4da586da6147d74c7598ccdd8b90906dbc4271fa414c738", |
| + "size": 343072 |
| + }, |
| + { |
| + "package": "libx11-xcb1", |
| + "version": "2:1.8.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libx11/libx11-xcb1_1.8.12-1_arm64.deb", |
| + "sha256": "1eafaa4295e129d6a81e742ab8da43194daa6b916199923c8cef8ad358985894", |
| + "size": 247336 |
| + }, |
| + { |
| + "package": "libxau6", |
| + "version": "1:1.0.11-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxau/libxau6_1.0.11-1_arm64.deb", |
| + "sha256": "ac1061728670f4626adaa1288953a0e6fb801c9cae72ee1c3231e63e2609d23a", |
| + "size": 20576 |
| + }, |
| + { |
| + "package": "libxcb-dri3-0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-dri3-0_1.17.0-2+b1_arm64.deb", |
| + "sha256": "247bf758dd78d6c285fdd47942ddacf4a3189fd50de4f0891c9bd9aea12da3a1", |
| + "size": 107068 |
| + }, |
| + { |
| + "package": "libxcb-present0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-present0_1.17.0-2+b1_arm64.deb", |
| + "sha256": "73521d715554a2230901d1d480465d6358b3083a5ce8801639595ffde6f31441", |
| + "size": 105784 |
| + }, |
| + { |
| + "package": "libxcb-randr0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-randr0_1.17.0-2+b1_arm64.deb", |
| + "sha256": "dbeb78d1d032959fe65548758ab12bfc6bb5919ec2984c3d871496b52aef929a", |
| + "size": 116736 |
| + }, |
| + { |
| + "package": "libxcb-sync1", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-sync1_1.17.0-2+b1_arm64.deb", |
| + "sha256": "eb428ac77daac9e5eea8a4e9ba48d1d78cc8ca400e415c8e4628cc729c6f4749", |
| + "size": 108792 |
| + }, |
| + { |
| + "package": "libxcb-xfixes0", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb-xfixes0_1.17.0-2+b1_arm64.deb", |
| + "sha256": "19cdb8502827bc010993e69eaba09c670024976f7edd35b2b504bd646b141b0a", |
| + "size": 109644 |
| + }, |
| + { |
| + "package": "libxcb1", |
| + "version": "1.17.0-2+b1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcb/libxcb1_1.17.0-2+b1_arm64.deb", |
| + "sha256": "d0178198e80ed4cacdececabe2c112ec88c7a9258cc11a55b8e267ab14a90d82", |
| + "size": 143168 |
| + }, |
| + { |
| + "package": "libxcomposite1", |
| + "version": "1:0.4.6-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxcomposite/libxcomposite1_0.4.6-1_arm64.deb", |
| + "sha256": "0fa60d7733d6354c94cea0b0b8e772a2e317db7040dee4ac84df5d844918a79c", |
| + "size": 16440 |
| + }, |
| + { |
| + "package": "libxdamage1", |
| + "version": "1:1.1.6-1+b2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxdamage/libxdamage1_1.1.6-1+b2_arm64.deb", |
| + "sha256": "7803f925e0940b720594f47bab4bc55bea1bdf6f2a3216442c78e53a77f4e19a", |
| + "size": 15640 |
| + }, |
| + { |
| + "package": "libxdmcp6", |
| + "version": "1:1.1.5-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxdmcp/libxdmcp6_1.1.5-1_arm64.deb", |
| + "sha256": "e10bbb0802181992ecf091e9425171850eee16068729c109214ba4924f81fb52", |
| + "size": 27752 |
| + }, |
| + { |
| + "package": "libxext6", |
| + "version": "2:1.3.4-1+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxext/libxext6_1.3.4-1+b3_arm64.deb", |
| + "sha256": "27cf208c6d2924b22ed3b9ceff304b992e1f07ef7b0ef00239585595581dac99", |
| + "size": 49244 |
| + }, |
| + { |
| + "package": "libxfixes3", |
| + "version": "1:6.0.0-2+b4", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxfixes/libxfixes3_6.0.0-2+b4_arm64.deb", |
| + "sha256": "d29134cbb9230a50ba1d097743d4d4fcf7826c6b48a2d8a303a0e3fc20b837e6", |
| + "size": 20456 |
| + }, |
| + { |
| + "package": "libxi6", |
| + "version": "2:1.8.2-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxi/libxi6_1.8.2-1_arm64.deb", |
| + "sha256": "b7148d371c908fa81bf45153fdcb3e7d178fe11e15f9907e29ce6e9ed9aaad24", |
| + "size": 77768 |
| + }, |
| + { |
| + "package": "libxkbcommon0", |
| + "version": "1.7.0-2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxkbcommon/libxkbcommon0_1.7.0-2_arm64.deb", |
| + "sha256": "866888d3cfeb32388dd88a2615c4f78ebf8dd7b272821a83494cba260d8fa7d1", |
| + "size": 106024 |
| + }, |
| + { |
| + "package": "libxml2", |
| + "version": "2.12.7+dfsg+really2.9.14-2.1+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian-security/20261103T013555Z/pool/updates/main/libx/libxml2/libxml2_2.12.7+dfsg+really2.9.14-2.1+deb13u1_arm64.deb", |
| + "sha256": "32baac0386190ff9d0a3994dcb6c18048dff90b69fb0c10861add5efc6c7c8f5", |
| + "size": 631164 |
| + }, |
| + { |
| + "package": "libxnvctrl0", |
| + "version": "535.171.04-1+b2", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxnvctrl/libxnvctrl0_535.171.04-1+b2_arm64.deb", |
| + "sha256": "87a7c8e67630667d4b6067f956ab62211f26dee2005560cb6090df22b15b25c7", |
| + "size": 14012 |
| + }, |
| + { |
| + "package": "libxrandr2", |
| + "version": "2:1.5.4-1+b3", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxrandr/libxrandr2_1.5.4-1+b3_arm64.deb", |
| + "sha256": "607a23d6d2cb920e000b24870531a86821cf4e141a4eb0bf38212b47b892d597", |
| + "size": 35932 |
| + }, |
| + { |
| + "package": "libxrender1", |
| + "version": "1:0.9.12-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxrender/libxrender1_0.9.12-1_arm64.deb", |
| + "sha256": "28396c96e460288d5851913121b053609f7ff34f996d78d7a38c1d2b6ab9f006", |
| + "size": 27024 |
| + }, |
| + { |
| + "package": "libxshmfence1", |
| + "version": "1.3.3-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/libx/libxshmfence/libxshmfence1_1.3.3-1_arm64.deb", |
| + "sha256": "34b494c83cebcf138d1f87c2cbdd5ee8efe9da2befbd69c2a025b0e214c64d2d", |
| + "size": 11104 |
| + }, |
| + { |
| + "package": "libz3-4", |
| + "version": "4.13.3-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/z/z3/libz3-4_4.13.3-1_arm64.deb", |
| + "sha256": "29a7b924a5a38c9ac4e2a64aa11586a9c54f26b579b18e4f75adf8f7c1106e45", |
| + "size": 7506868 |
| + }, |
| + { |
| + "package": "mesa-libgallium", |
| + "version": "25.0.7-2+deb13u1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/m/mesa/mesa-libgallium_25.0.7-2+deb13u1_arm64.deb", |
| + "sha256": "a27576030704ff305adaef8bd143954b281680861d5bfe21aabd7d376a939149", |
| + "size": 8032536 |
| + }, |
| + { |
| + "package": "xkb-data", |
| + "version": "2.42-1", |
| + "url": "https://snapshot.debian.org/archive/debian/20261107T024144Z/pool/main/x/xkeyboard-config/xkb-data_2.42-1_all.deb", |
| + "sha256": "196ff18533382f64e057ea49df2bb486bd4275a4cc0917361edb560b8756dada", |
| + "size": 789736 |
| + } |
| + ] |
| +} |
diff --git a/scripts/ci-test.py b/scripts/ci-test.py| index cc8ed033..1e3a2d48 100755 |
| --- a/scripts/ci-test.py |
| +++ b/scripts/ci-test.py |
| @@ -8,9 +8,13 @@ |
| scripts/ci-test.py compile compile every package once (make ci-compile) |
| scripts/ci-test.py retried LANE ARGS... go test ARGS, with the one retry |
| scripts/ci-test.py lanes print each lane and its packages |
| + scripts/ci-test.py browser print each package's browser tests |
| The slow packages each have a lane of their own and "rest" holds every |
| -other package. CI runs the lanes side by side as the shards of one step, |
| +other package. The browser tests (files built only with -tags browser) |
| +have lanes of their own, BROWSER_LANES, which build with BROWSER_TAGS |
| +and run only those tests; the browser is RASTRILLO_CHROME, the Chromium |
| +scripts/ci-box.py pins. CI runs the lanes side by side as the shards of one step, |
| .amadan/ci.d/20-check@N: amadan runs separate steps one after another, and |
| a step's @N shards are how it runs work in parallel. A lane's packages |
| pass or fail in that shard's own log. The quarantine, the runner host |
| @@ -48,6 +52,7 @@ from concurrent.futures import ThreadPoolExecutor |
| MODULE = "amadan.net/oficina/equipo" |
| TAGS = "testbuild" |
| +BROWSER_TAGS = "browser,testbuild" |
| TIMEOUT = "15m" |
| # Lane order is the shard index: shard 0 runs the first lane. After the |
| @@ -82,6 +87,24 @@ LANES = [ |
| ("rest", None, None), # every package no other lane names |
| ] |
| +# The browser tests: what -tags browser adds to a package's tests, found |
| +# by comparing go list with and without the tag, so a new browser test |
| +# always runs. Lanes as above, after them in shard order: a lane that |
| +# names tests runs those of its one package; one that names none runs |
| +# the package's other browser tests; packages None is every package with |
| +# browser tests that no other browser lane names. Each test drives one |
| +# headless Chromium against its own instance, one test at a time (none |
| +# calls t.Parallel), so a lane is one browser; the lanes run side by side. |
| +# The browser tests wait on the page with short deadlines, so none of |
| +# these is LATE. |
| +BROWSER_LANES = [ |
| + ("browser-headless-chat", [HEADLESS], ["TestBrowserChat", "TestBrowserChatSendStaysOnPage", "TestBrowserMoveIn", "TestBrowserComposer", "TestBrowserComposerReconcile", "TestBrowserComposerFocus", "TestBrowserComposerDock", "TestBrowserDraftStreamsFormatted", "TestBrowserDraftIsTheMessage", "TestBrowserRefreshRace"]), # 88 |
| + ("browser-headless-work", [HEADLESS], ["TestBrowserTaskCard", "TestBrowserReceiptFollowsReview", "TestBrowserRailFollowsWork", "TestBrowserTaskThread", "TestBrowserAskAfterMerge", "TestBrowserReceiptsDesktop", "TestBrowserReceiptsTouch", "TestBrowserNotebook", "TestBrowserEmptyExplore", "TestNotebookScreenshots", "TestBrowserNotebookLook"]), # 75 |
| + ("browser-headless-rest", [HEADLESS], None), # 74: the connections pages, thinking and cards, any new one |
| + ("browser-thintest", ["./internal/thintest"], None), # 80 |
| + ("browser-rest", None, None), # plan3test and any new package |
| +] |
| + |
| # Shards after the lanes: work that is not a lane of packages but runs |
| # beside them, each a list of make targets run in order. The static |
| # checks are here too: hosted CI runs steps one after another and only |
| @@ -109,6 +132,8 @@ TEST_TOOL_DIRS = {"try-bin": "~/.local/share/equipo/try/bin"} |
| QUARANTINE = "scripts/ci-quarantine.txt" |
| +TEST_FUNC = re.compile(r"^func (Test[A-Za-z0-9_]*)\(\w+ \*testing\.T\)", re.M) |
| + |
| # More failures than this in one lane is a broken change, not a flake: |
| # nothing is retried and the lane is red. |
| RETRY_LIMIT = 10 |
| @@ -191,6 +216,69 @@ def lane_flags(name): |
| return [] |
| +_browser = None |
| + |
| + |
| +def browser_tests(): |
| + """{package: [test, ...]}: the top-level tests that -tags browser adds, |
| + from the test files go list names only with BROWSER_TAGS.""" |
| + global _browser |
| + if _browser is not None: |
| + return _browser |
| + fmt = "{{.ImportPath}}|{{.Dir}}|{{join .TestGoFiles \" \"}} {{join .XTestGoFiles \" \"}}" |
| + |
| + def files(tags): |
| + out = subprocess.check_output(["go", "list", "-tags", tags, "-f", fmt, "./..."], text=True) |
| + found = {} |
| + for line in out.splitlines(): |
| + path, directory, names = line.split("|", 2) |
| + found["." + path[len(MODULE):]] = (directory, set(names.split())) |
| + return found |
| + plain, browser = files(TAGS), files(BROWSER_TAGS) |
| + _browser = {} |
| + for package, (directory, names) in sorted(browser.items()): |
| + tests = [] |
| + for name in sorted(names - plain.get(package, ("", set()))[1]): |
| + with open(os.path.join(directory, name)) as f: |
| + tests += TEST_FUNC.findall(f.read()) |
| + if tests: |
| + _browser[package] = sorted(set(tests)) |
| + return _browser |
| + |
| + |
| +def is_browser_lane(name): |
| + return any(lane == name for lane, _, _ in BROWSER_LANES) |
| + |
| + |
| +def browser_runs(name): |
| + """The (package, go test flags) a browser lane runs, one go test each.""" |
| + for lane, packages, tests in BROWSER_LANES: |
| + if lane != name: |
| + continue |
| + found = browser_tests() |
| + if packages is None: |
| + named = {p for _, ps, _ in BROWSER_LANES if ps for p in ps} |
| + packages = [p for p in found if p not in named] |
| + if tests: |
| + if len(packages) != 1: |
| + sys.exit(f"ci-test: browser lane {name} names tests, so it must name one package") |
| + return [(packages[0], ["-run", test_pattern(tests)])] |
| + runs = [] |
| + for package in packages: |
| + taken = [t for other, ps, ts in BROWSER_LANES if other != name and ts and ps and ps[0] == package for t in ts] |
| + flags = ["-run", test_pattern(["^(" + "|".join(found.get(package, [])) + ")$"])] |
| + if taken: |
| + flags += ["-skip", test_pattern(taken)] |
| + if found.get(package): |
| + runs.append((package, flags)) |
| + return runs |
| + sys.exit(f"ci-test: unknown browser lane {name!r}") |
| + |
| + |
| +def all_lanes(): |
| + return [lane for lane, _, _ in LANES + BROWSER_LANES] |
| + |
| + |
| def fingerprint(): |
| lines = [] |
| for tool in TEST_TOOLS: |
| @@ -248,7 +336,7 @@ def rastrillo(): |
| "RASTRILLO", "go run amadan.net/rastrillo/rastrillo/cmd/rastrillo")) |
| -def budget_test(packages, env, lane, flags=()): |
| +def budget_test(packages, env, lane, flags=(), tags=TAGS): |
| """One rastrillo budget test over packages, a failed test retried once; |
| returns its exit status.""" |
| status = 0 |
| @@ -259,7 +347,7 @@ def budget_test(packages, env, lane, flags=()): |
| continue |
| for p in group if extra else []: |
| print(f"uncached: {p}: {UNCACHED[p]}", flush=True) |
| - base = ["-tags", TAGS, "-timeout", TIMEOUT] + extra + list(flags) |
| + base = ["-tags", tags, "-timeout", TIMEOUT] + extra + list(flags) |
| status = run_retrying(rastrillo() + ["budget", "test"] + base + group, env, lane, base) or status |
| return status |
| @@ -308,18 +396,56 @@ def run_reporting_misses(cmd, env): |
| def run_lane(name): |
| + if is_browser_lane(name): |
| + return run_browser_lane(name) |
| packages = lane_packages(name) |
| print(f"test lane {name}: {' '.join(packages)}", flush=True) |
| return budget_test(packages, budget_env(environment(False)), name, lane_flags(name)) |
| +def browser_version(env): |
| + """Print which browser the tests will find; a launcher that does not |
| + start (a library missing from the pinned tree) fails here, by name, |
| + and not in every test. Returns whether it started.""" |
| + chrome = env.get("RASTRILLO_CHROME") |
| + if not chrome: |
| + print("browser: RASTRILLO_CHROME unset; harness.ChromePath looks for a chromium on PATH", flush=True) |
| + return True |
| + try: |
| + out = subprocess.run([chrome, "--version"], env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, |
| + text=True, timeout=60, errors="replace") |
| + except (OSError, subprocess.TimeoutExpired) as e: |
| + print(f"browser: {chrome} did not start: {e}", flush=True) |
| + return False |
| + print(f"browser: {chrome}: {out.stdout.strip()}", flush=True) |
| + return out.returncode == 0 |
| + |
| + |
| +def run_browser_lane(name, env=None): |
| + env = env or budget_env(environment(False)) |
| + if not browser_version(env): |
| + return 1 |
| + status = 0 |
| + runs = browser_runs(name) |
| + if not runs: |
| + print(f"browser lane {name}: no browser tests", flush=True) |
| + for package, flags in runs: |
| + print(f"browser lane {name}: {package}", flush=True) |
| + status = budget_test([package], env, name, flags, BROWSER_TAGS) or status |
| + return status |
| + |
| + |
| def run_all(): |
| env = budget_env(environment(False)) |
| if not UNCACHED: |
| # One go test over ./... lets rastrillo also flag a stale time record. |
| base = ["-tags", TAGS, "-timeout", TIMEOUT] |
| - return run_retrying(rastrillo() + ["budget", "test"] + base + ["./..."], env, "all", base) |
| - return budget_test(all_packages(), env, "all") |
| + status = run_retrying(rastrillo() + ["budget", "test"] + base + ["./..."], env, "all", base) |
| + else: |
| + status = budget_test(all_packages(), env, "all") |
| + for name, _, _ in BROWSER_LANES: |
| + status = run_browser_lane(name, env) or status |
| + return status |
| def run_retried(lane, args): |
| @@ -336,7 +462,9 @@ def run_compile(): |
| for cmd in (["go", "build", "-tags", TAGS, "./..."], |
| # -export compiles each package and, with -test, its tests: |
| # the lanes of one package would each compile them again. |
| - ["go", "list", "-export", "-test", "-tags", TAGS, "-f", "", "./..."]): |
| + ["go", "list", "-export", "-test", "-tags", TAGS, "-f", "", "./..."], |
| + # and the browser lanes' packages, with the browser tests in. |
| + ["go", "list", "-export", "-test", "-tags", BROWSER_TAGS, "-f", ""] + sorted(browser_tests())): |
| print("+ " + " ".join(cmd), flush=True) |
| started = time.time() |
| status = subprocess.call(cmd, stdout=subprocess.DEVNULL) |
| @@ -398,19 +526,20 @@ def machine_load(): |
| def run_shard(): |
| index = int(os.environ.get("AMADAN_SHARD", "-1")) |
| count = int(os.environ.get("AMADAN_SHARD_COUNT", "0")) |
| - shards = len(LANES) + len(EXTRA_SHARDS) |
| + lanes = all_lanes() |
| + shards = len(lanes) + len(EXTRA_SHARDS) |
| if count != shards or not 0 <= index < count: |
| - sys.exit(f"ci-test: shard {index} of {count}, but there are {len(LANES)} lanes and " |
| + sys.exit(f"ci-test: shard {index} of {count}, but there are {len(lanes)} lanes and " |
| f"{len(EXTRA_SHARDS)} extra shards; name the step 20-check@{shards}") |
| - name = LANES[index][0] if index < len(LANES) else EXTRA_SHARDS[index - len(LANES)][0] |
| + name = lanes[index] if index < len(lanes) else EXTRA_SHARDS[index - len(lanes)][0] |
| jobs = BUILD_JOBS_MANY if name == "rest" else BUILD_JOBS |
| os.environ["GOFLAGS"] = " ".join(filter(None, [os.environ.get("GOFLAGS", ""), f"-p={jobs}"])) |
| stagger(name) |
| - if index < len(LANES): |
| + if index < len(lanes): |
| status = run_lane(name) |
| machine_load() |
| return status |
| - targets = EXTRA_SHARDS[index - len(LANES)] |
| + targets = EXTRA_SHARDS[index - len(lanes)] |
| print(f"shard {index}: make {' '.join(targets)}", flush=True) |
| env = dict(os.environ) |
| if targets == ["runner-host"]: |
| @@ -562,10 +691,10 @@ def retry_failures(out, env, lane, base): |
| # The quarantine. |
| -def run_group(package, tests, env): |
| +def run_group(package, tests, env, tags=TAGS): |
| """Run one top-level test's quarantined entries; retry failures once.""" |
| report = [] |
| - base = ["-tags", TAGS, "-timeout", TIMEOUT] |
| + base = ["-tags", tags, "-timeout", TIMEOUT] |
| cmd, out, passed, failed, _ = go_test(package, tests, env, base, fresh=False) |
| report.append(f"+ {cmd}") |
| missing = set(tests) - passed - failed |
| @@ -602,8 +731,12 @@ def run_quarantine(): |
| sys.exit(f"{QUARANTINE}: list a test or some of its subtests, not both: {tests}") |
| print(f"quarantine: {sum(len(v) for v in groups.values())} tests from {QUARANTINE}; " |
| "a failure is retried once, and a pass on the retry is reported as a flake", flush=True) |
| + browser = browser_tests() |
| + |
| + def tags(package, top): |
| + return BROWSER_TAGS if top in browser.get(package, []) else TAGS |
| with ThreadPoolExecutor(max_workers=max(1, len(groups))) as pool: |
| - futures = [pool.submit(run_group, p, tests, env) for (p, _), tests in sorted(groups.items())] |
| + futures = [pool.submit(run_group, p, tests, env, tags(p, top)) for (p, top), tests in sorted(groups.items())] |
| results = [f.result() for f in futures] |
| flakes, broken = [], [] |
| for report, flaky, bad in results: |
| @@ -633,6 +766,13 @@ def main(argv): |
| if argv == ["lanes"]: |
| for name, _, _ in LANES: |
| print(name + ": " + " ".join(lane_packages(name) + lane_flags(name))) |
| + for name, _, _ in BROWSER_LANES: |
| + for package, flags in browser_runs(name): |
| + print(name + ": -tags " + BROWSER_TAGS + " " + " ".join([package] + [shlex.quote(f) for f in flags])) |
| + return 0 |
| + if argv == ["browser"]: |
| + for package, tests in browser_tests().items(): |
| + print(package + ": " + " ".join(tests)) |
| return 0 |
| print(__doc__, file=sys.stderr) |
| return 2 |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index c1c119b9..ed8eb16c 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -5270,20 +5270,6 @@ |
| "count": 1, |
| "reason": "Regression test fixture or assertion; no production legacy dependency." |
| }, |
| - { |
| - "path": "internal/equipotest/browser_test.go", |
| - "line_sha256": "5a02c7956bb347c04eca1966e5a4f09b4884631c8d720004879e519a74cb7d01", |
| - "match": "node", |
| - "count": 1, |
| - "reason": "DOM element identity in browser tests, not a runtime dependency." |
| - }, |
| - { |
| - "path": "internal/equipotest/browser_test.go", |
| - "line_sha256": "247069bc5249ee46df7d5c01ce83adbbe7908d51a07bde5c04abde841e0af816", |
| - "match": "node", |
| - "count": 1, |
| - "reason": "DOM element identity in browser tests, not a runtime dependency." |
| - }, |
| { |
| "path": "internal/equipotest/connections_test.go", |
| "line_sha256": "4ed9e39a71b23c27465ea46c7bfea527af953dfcc68b2dfad0f5ade31491c8fe", |
| @@ -7965,13 +7951,6 @@ |
| "count": 1, |
| "reason": "Opt-in local end-to-end harness builds and runs the retained production runner executable in scratch storage." |
| }, |
| - { |
| - "path": "internal/equipotest/optimistic_browser_test.go", |
| - "line_sha256": "f5292f806516e2cc91a49573249aa237210f4035e88b419c1bb2e579e706070e", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Browser DOM node operations in the optimistic chat implementation or its browser test; no external runtime." |
| - }, |
| { |
| "path": "docs/superpowers/plans/CONTROLLER-REPORT-e2e-coordinator.md", |
| "line_sha256": "012afb80e4abcdf1f01d242b8b6fae41764f17bbb27a861aab11138b8f733dba", |
| @@ -7979,13 +7958,6 @@ |
| "count": 1, |
| "reason": "Controller report references the retained runner service configuration; no execution authority." |
| }, |
| - { |
| - "path": "internal/equipotest/optimistic_browser_test.go", |
| - "line_sha256": "306c966eddd03b346567cda84dfc3c6de3c202b353dcec8c7fe78d5c9b9eff2c", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Browser DOM node operations in optimistic chat or its tests; no external runtime." |
| - }, |
| { |
| "path": "internal/equipo/connections.go", |
| "line_sha256": "0f7f2e64554e8eb66d4706757a1dce1c7504a85054a31e27d47ebba139857614", |