oficina / equipo Public

Merge branch 'empty-repo-reads' into main

Merge empty-repo-reads: repositories with no commits yet

Protocol 6 with downgrade steps: a runner names empty repositories,
the first hello leaves empty entries out until the welcome, and reads
answer no commits yet instead of an access card. Headless witness.
Hosted CI passed on 5bb8c35.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 4e51bcd70c895c3979cbbcc28ff20419e31b4769 parent 412505aparent 5bb8c35
24 files changed, +679 −65
  • .rastrillo/budgets.txt +5 −5
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +14 −0
  • internal/equipo/chat/tools.go +76 −18
  • internal/equipo/chat_page.go +10 −5
  • internal/equipo/copy.go +1 −0
  • internal/equipo/templates/chat.html +1 −1
  • internal/headless/engineering_test.go +41 −0
  • internal/headless/env_test.go +34 −2
  • internal/headless/projects_test.go +13 −0
  • internal/headless/scenarios_test.go +1 −0
  • internal/runner/thin/bridge.go +9 −0
  • internal/runner/thin/contract_test.go +10 −0
  • internal/runner/thin/forge.go +31 −14
  • internal/runner/thin/index.go +23 −4
  • internal/runner/thin/index_empty_test.go +132 −0
  • internal/runner/thin/link.go +7 −0
  • internal/runner/thin/protocol_test.go +41 −0
  • internal/thintest/empty_repo_contract_test.go +98 −0
  • internal/thintest/pages_test.go +47 −2
  • internal/thintest/tasks_contract_test.go +0 −9
  • internal/thintest/tools_contract_test.go +5 −1
  • internal/wire/frames.go +5 −0
  • internal/wire/runners.go +27 −3
  • internal/wire/runners_test.go +48 −1

CI passed — run details

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 12a25ae9..6f3ff60b 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,7 +14,7 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr
time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI.
time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage.
-size internal/equipo 17031 - The paste box's look adds its three labels (Prompt, Text, Command) and pasteBox, which gives the renderer Copy's icons (about 13 lines); measured 17031. Token row facts merged onto main: measured 17018. Token row facts add the row's stated email and usage line (rowFacts), the email route and its field, connections.js keeping an open field across refreshes, their CSS and 8 strings (about 90 lines); measured 17009. Merge authority merged onto Machines in Settings and stale thinking lines: measured 16914. Stale thinking lines (the queued note in chat_page.go and chat.html, the refresh and turn ownership in chat-stream.js, about 60 lines) merged onto Machines in Settings: measured 16725. Machines in Settings adds the Machines list and Add a machine screens (machines_view.go, the runners.html rewrite, machines.js, their CSS, three icons and 35 strings, about 280 lines); measured 16664. Spend 1 (work_spend.go and the task page lines, about 90 lines) merged onto the four UI branches: measured 16381. The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. The Connections Add page and four display fixes add the Add page handler, account naming, stale meter filtering and the resting row's destination (connections_view.go, chat_connections.go, about 120 lines); measured 15467. Claude setup tokens add the token card, sealing route and Check again beside the composer and Mac lines; measured 15350. Settings in sections adds the section pages, the secondary menu and the old URLs' redirects (settings_hub.go, about 110 lines, less the removed Thinking words page); measured 14922. Mac runners (Darwin worker) add the one-tap enrolment link, the runners view's self-probes, /install.sh, the outside-the-sandbox label and their copy (about 90 lines); measured 15058. Mac runners add the runner role, the protocol route and the placement minute, then two-phase removal, Remove now and Recover (about 110 lines). Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. Thin v1 UX1 thinking words adds the settings page and the set registry wiring (thinking_words.go) and 55 strings of phrases; measured 14411. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here. Merge authority thin v1 adds the project page's "How Equipo merges" section and form (merge_policy_page.go, about 90 lines) and 86 strings; measured 16568 with main (spend-1, the four UI branches) merged. Spend 1 (work_spend.go and the task page lines, about 90 lines) merged onto the four UI branches: measured 16381. The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. Machines in Settings adds the Machines list and Add a machine screens (machines_view.go, the runners.html rewrite, machines.js, their CSS, three icons and 35 strings, about 280 lines); measured 16664. Spend 1 (work_spend.go and the task page lines, about 90 lines) merged onto the four UI branches: measured 16381. The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. The Connections Add page and four display fixes add the Add page handler, account naming, stale meter filtering and the resting row's destination (connections_view.go, chat_connections.go, about 120 lines); measured 15467. Claude setup tokens add the token card, sealing route and Check again beside the composer and Mac lines; measured 15350. Settings in sections adds the section pages, the secondary menu and the old URLs' redirects (settings_hub.go, about 110 lines, less the removed Thinking words page); measured 14922. Mac runners (Darwin worker) add the one-tap enrolment link, the runners view's self-probes, /install.sh, the outside-the-sandbox label and their copy (about 90 lines); measured 15058. Mac runners add the runner role, the protocol route and the placement minute, then two-phase removal, Remove now and Recover (about 110 lines). Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. Thin v1 UX1 thinking words adds the settings page and the set registry wiring (thinking_words.go) and 55 strings of phrases; measured 14411. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here.
+size internal/equipo 17037 - Empty repositories merged onto main: measured 17037. The access card picks its grant line and namespace from the card's name (GrantHow, about 6 lines). The paste box's look adds its three labels (Prompt, Text, Command) and pasteBox, which gives the renderer Copy's icons (about 13 lines); measured 17031. Token row facts merged onto main: measured 17018. Token row facts add the row's stated email and usage line (rowFacts), the email route and its field, connections.js keeping an open field across refreshes, their CSS and 8 strings (about 90 lines); measured 17009. Merge authority merged onto Machines in Settings and stale thinking lines: measured 16914. Stale thinking lines (the queued note in chat_page.go and chat.html, the refresh and turn ownership in chat-stream.js, about 60 lines) merged onto Machines in Settings: measured 16725. Machines in Settings adds the Machines list and Add a machine screens (machines_view.go, the runners.html rewrite, machines.js, their CSS, three icons and 35 strings, about 280 lines); measured 16664. Spend 1 (work_spend.go and the task page lines, about 90 lines) merged onto the four UI branches: measured 16381. The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. The Connections Add page and four display fixes add the Add page handler, account naming, stale meter filtering and the resting row's destination (connections_view.go, chat_connections.go, about 120 lines); measured 15467. Claude setup tokens add the token card, sealing route and Check again beside the composer and Mac lines; measured 15350. Settings in sections adds the section pages, the secondary menu and the old URLs' redirects (settings_hub.go, about 110 lines, less the removed Thinking words page); measured 14922. Mac runners (Darwin worker) add the one-tap enrolment link, the runners view's self-probes, /install.sh, the outside-the-sandbox label and their copy (about 90 lines); measured 15058. Mac runners add the runner role, the protocol route and the placement minute, then two-phase removal, Remove now and Recover (about 110 lines). Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. Thin v1 UX1 thinking words adds the settings page and the set registry wiring (thinking_words.go) and 55 strings of phrases; measured 14411. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here. Merge authority thin v1 adds the project page's "How Equipo merges" section and form (merge_policy_page.go, about 90 lines) and 86 strings; measured 16568 with main (spend-1, the four UI branches) merged. Spend 1 (work_spend.go and the task page lines, about 90 lines) merged onto the four UI branches: measured 16381. The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. Machines in Settings adds the Machines list and Add a machine screens (machines_view.go, the runners.html rewrite, machines.js, their CSS, three icons and 35 strings, about 280 lines); measured 16664. Spend 1 (work_spend.go and the task page lines, about 90 lines) merged onto the four UI branches: measured 16381. The team panel merged onto Projects UX, the Settings pattern and the Connections countdown: measured 16280 with all four. The team panel adds the compact specialist rows, the drawer page and its view (team_panel.go, team.html, team-panel.js, about 420 lines), the activity wording (team_activity.go) and their CSS and copy; the command reading went to its own package (internal/equipo/activity); measured 15788. Projects UX merged onto the Connections countdown and the Settings pattern: measured 15942 with all three. Projects UX adds the Projects page order (starred, active, quiet folded), the auto-star rules and their receipt, whole-word descriptions and the star action (project_order.go, about 200 lines), the Mac decision and Ask about this; measured 15815. Connection resets as a countdown (inText and its words, about 60 lines) and the Settings page pattern (settings_hub.go, team_links.go, about 30 lines) together; measured 15577 with both merged. The Connections Add page and four display fixes add the Add page handler, account naming, stale meter filtering and the resting row's destination (connections_view.go, chat_connections.go, about 120 lines); measured 15467. Claude setup tokens add the token card, sealing route and Check again beside the composer and Mac lines; measured 15350. Settings in sections adds the section pages, the secondary menu and the old URLs' redirects (settings_hub.go, about 110 lines, less the removed Thinking words page); measured 14922. Mac runners (Darwin worker) add the one-tap enrolment link, the runners view's self-probes, /install.sh, the outside-the-sandbox label and their copy (about 90 lines); measured 15058. Mac runners add the runner role, the protocol route and the placement minute, then two-phase removal, Remove now and Recover (about 110 lines). Housekeeping slice 1 adds the Housekeeping view beside the Notebook, the digest line and their copy (housekeeping_page.go, about 170 lines); measured 14513. Thin v1 UX1 thinking words adds the settings page and the set registry wiring (thinking_words.go) and 55 strings of phrases; measured 14411. The Connections page to Paul's approved mockup (connections_view.go: what is answering, the preference, rows with headroom, roles, usage and the recovery action, about 300 lines); measured 14268. Merged with UX1 round 3 (duplicate combining with Undo, timeline headlines) beside the Connections page; measured 13895. Connections slice 1 adds the Connections page, the switched line and the no_connection card and their copy (chat_connections.go, about 220 lines). Measured 12269. Thin v1 UX1 adds the inner screens' view model (work_views.go: stage track, badges, timeline, decisions, project facts, about 830 lines), the rich page handlers and their copy (about 170 lines); measured 13263. Thin v1 slice 4c adds the merged line, the merge card and its copy (about 60 lines). Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here.
size internal/equipotest - 13400 Task 21 repairs historical migration and conversation fixtures after Plan 3. Measured 13024 test lines; the 300s time ceiling is unchanged.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); 60s gives 34 percent headroom. Shared baseline capture reduces repeated Go runs; retain the CI allowance for sandbox sentinels, timeout and child cleanup. 2026-11-07: loaded CI (host load about 24) measured 66.5s with the package unchanged by thin v1 slice 4 beyond optional check mounts; 90s keeps 35 percent headroom.
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). Parallel plan graphs and removal of repeated progress floods reduced their local targeted run from 146.920s to 30.784s; the original bug graph retains volume coverage. Keep 330s for journal, proxy, recovery and namespace integration, with 13 percent headroom.
@@ -34,7 +34,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full
perf GET /releases/* skip Verified runner release file downloads, not browser GET screens.
perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen.
time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; niced serial reruns measured 5.773s and 5.750s. The added coordinator mount check has no repeated launches to remove; 15s leaves 38 percent headroom for namespace, process-exit and recovery assertions.
-size internal/runner/thin 16896 8411 Token row facts merged onto main: measured 16896/8411. Token row facts read the check's rate limit and record it as a turn's (TokenCheck, the Verify wiring, about 40 lines); measured 16614. The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path. Mac P2 diagnostics hand the probes' host runner.log's WARN (macHost.warn, 8 lines) and pin it with a test (12 lines): measured 16854/8411. Mac probe deadlines bound the booted simctl list, move the worker's wait for the probes out of its lock (hold) and warn when a probe run reaches its limit (about 24 lines); their tests (mac_stall_test.go: a fake xcrun that never answers, probes stalled while an update applies, about 270 lines) beside the Mac host they drive: measured 16846/8399. Release slice 1 merged onto main: measured 16822/8130. Release slice 1 (hosted checks) adds the hub's hosted CI verdict for checks: the deferred one-read poll with its persisted deadline, the one-snapshot verdict, the failing units and the restart case (judge_hosted.go, about 200 lines) and the forge's CI reads (forge.go, about 40); measured 16821. Its tests (judge_hosted_test.go, about 270 lines) take the package's tests to 8113, beside the step engine they drive. The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path. The paste box house rule merged onto the runner logs: measured 16573. The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path.
+size internal/runner/thin 16948 8594 Empty repositories merged onto main: measured 16948/8594. Empty repositories: the index lists a reachable repository with no commits as empty, DefaultBranch tells that from no access (lsRemote), reads of it say so, and the handshake hello keeps empty entries back until a protocol 6 welcome (about 52 lines); their tests (index_empty_test.go, the handshake hello at protocols 5 and 6, startLinkWith; about 183 lines). Token row facts merged onto main: measured 16896/8411. Token row facts read the check's rate limit and record it as a turn's (TokenCheck, the Verify wiring, about 40 lines); measured 16614. The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path. Mac P2 diagnostics hand the probes' host runner.log's WARN (macHost.warn, 8 lines) and pin it with a test (12 lines): measured 16854/8411. Mac probe deadlines bound the booted simctl list, move the worker's wait for the probes out of its lock (hold) and warn when a probe run reaches its limit (about 24 lines); their tests (mac_stall_test.go: a fake xcrun that never answers, probes stalled while an update applies, about 270 lines) beside the Mac host they drive: measured 16846/8399. Release slice 1 merged onto main: measured 16822/8130. Release slice 1 (hosted checks) adds the hub's hosted CI verdict for checks: the deferred one-read poll with its persisted deadline, the one-snapshot verdict, the failing units and the restart case (judge_hosted.go, about 200 lines) and the forge's CI reads (forge.go, about 40); measured 16821. Its tests (judge_hosted_test.go, about 270 lines) take the package's tests to 8113, beside the step engine they drive. The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path. The paste box house rule merged onto the runner logs: measured 16573. The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path.
time internal/thintest 180s Mac runners slices A and B add role, scoping, migration, placement, withdrawal, transfer and publication contracts, and Astra round 1 eight transition contracts (about 15s; the package measured 126s locally under load). Housekeeping slice 1 adds six contract tests (combine, Undo round trips and the race, Pause, auto-disable, quiet hours, restart while claimed; about 6s); the package measured 67.7s beside other packages locally, so 75s. Thin v1 slice 4c adds the merge, adoption, cancel and retention contract tests (CI measured 35.7s). Thin v1 contract tests: a real instance and a scripted runner per test, fixtures replayed against every request, frame and event. Slice 3 adds the task, step-sync and grant contracts; CI measured 14.805s. 30s keeps room for the slice 4 review contracts. UX1 adds step activity, task source and duplicates, coordinator merging and project facts (four contracts, about 6s); the package measured 34s locally under load, so 40s. UX1's inner screens gallery (two owners, seven tasks, every page) adds about 3s; measured 40.9s locally under load, so 60s.
time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing a waiting test two seconds after it starts. About 6s alone; loaded CI measured 12.5s.
time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). Measured 17.8s locally under load. Slice 4b review adds a 16 MiB git output bound, an injected index-pack failure and stall (3s deadline) and held-answer tests; measured 30.3s locally under load. 45s keeps 33 percent headroom.
@@ -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 14275 - Token row facts merged onto main: measured 14275. Token row facts add the stated email's store write with its shape check and the row facts read (StatedEmailShape, SetStatedEmail, ConnectionRowFacts, about 95 lines); measured 14195. 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. The duplicate keep rule merged onto main: measured 14175. The duplicate combine keeps the decided task: the housekeeping view reads each task's newest merge card and marks it Decided (about 12 lines); measured 14110. 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. Release slice 1 (hosted checks) adds the hosted CI offer, the binding's acceptance inside the step report's transaction, the hosted sandbox rule and the fix round's failing units (about 65 lines); measured 14160. 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.
+size internal/equipo/chat 14333 - Empty repositories merged onto main: measured 14333. Empty repositories: the read gate answers empty and not read yet, find covers repositories on the runner's list, and the access card names a namespace only from ns/repo (AccessName, GrantNamespace; about 58 lines). Token row facts merged onto main: measured 14275. Token row facts add the stated email's store write with its shape check and the row facts read (StatedEmailShape, SetStatedEmail, ConnectionRowFacts, about 95 lines); measured 14195. 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. The duplicate keep rule merged onto main: measured 14175. The duplicate combine keeps the decided task: the housekeeping view reads each task's newest merge card and marks it Decided (about 12 lines); measured 14110. 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. Release slice 1 (hosted checks) adds the hosted CI offer, the binding's acceptance inside the step report's transaction, the hosted sandbox rule and the fix round's failing units (about 65 lines); measured 14160. 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 - 9012 The paste box's look adds TestBrowserPasteBoxLook (one unit at 1280 and 390, light and dark: the bar inside the box, the labels, the prompt wrapped in the body font, the command scrolling, the tick and Copied without the bar moving; about 60 lines) and the streaming icon check; measured 9012. Copy's drive records what paste.js hands the clipboard API and the execCommand fallback on every run, and reads the real clipboard back only where the browser grants it (CI's Chromium refused it; about 34 lines); measured 8949. Copy's real clipboard drive and the stale page reload merged onto token row facts: measured 8915. They add browser_paste_copy_test.go (about 166 lines: both replies and the fallback through the real clipboard, the older page that reloads when quiet, the composer that holds it, the place kept and no loop); measured 8845. Token row facts merged onto main: measured 8749. Token row facts add TestHeadlessTokenCheckHeadroom (a check's windows and a quota-refused check through the real runner and fake CLI, about 70 lines); measured 8593. 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. The duplicate keep rule merged onto main: measured 8679. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. 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. 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. Release slice 1 merged onto main: measured 8679. 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. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. 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. 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 - 14109 Token row facts merged onto main: measured 14109. Token row facts add the token row's page and browser tests (token_row_pages_test.go, token_row_browser_test.go, about 225 lines); measured 13902. 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. The duplicate keep rule merged onto main: measured 13885. The duplicate combine keeps the decided task adds staging's Woodstar pair as a contract through the real store (TestContractCombineKeepsDecided, about 60 lines); measured 13747. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. 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. Release slice 1 merged onto main: measured 13823. Release slice 1 (hosted checks) adds its contracts (hosted_checks_contract_test.go: the pass that asks, the failure's fix round, every binding rule, the protocol 4 runner; about 140 lines); measured 13816. 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. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. 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.
+size internal/headless - 9099 Empty repositories merged onto main: measured 9099. Empty repositories add scenario 3_empty_repo through the real runner (grantEmpty, GrantEmpty and Indexed controls; about 87 lines). The paste box's look adds TestBrowserPasteBoxLook (one unit at 1280 and 390, light and dark: the bar inside the box, the labels, the prompt wrapped in the body font, the command scrolling, the tick and Copied without the bar moving; about 60 lines) and the streaming icon check; measured 9012. Copy's drive records what paste.js hands the clipboard API and the execCommand fallback on every run, and reads the real clipboard back only where the browser grants it (CI's Chromium refused it; about 34 lines); measured 8949. Copy's real clipboard drive and the stale page reload merged onto token row facts: measured 8915. They add browser_paste_copy_test.go (about 166 lines: both replies and the fallback through the real clipboard, the older page that reloads when quiet, the composer that holds it, the place kept and no loop); measured 8845. Token row facts merged onto main: measured 8749. Token row facts add TestHeadlessTokenCheckHeadroom (a check's windows and a quota-refused check through the real runner and fake CLI, about 70 lines); measured 8593. 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. The duplicate keep rule merged onto main: measured 8679. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. 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. 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. Release slice 1 merged onto main: measured 8679. 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. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. 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. 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 - 14247 Empty repositories merged onto main: measured 14247. Empty repositories add TestContractEmptyRepository and TestAccessName and extend the grant card page test to a named namespace (about 138 lines). Token row facts merged onto main: measured 14109. Token row facts add the token row's page and browser tests (token_row_pages_test.go, token_row_browser_test.go, about 225 lines); measured 13902. 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. The duplicate keep rule merged onto main: measured 13885. The duplicate combine keeps the decided task adds staging's Woodstar pair as a contract through the real store (TestContractCombineKeepsDecided, about 60 lines); measured 13747. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. 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. Release slice 1 merged onto main: measured 13823. Release slice 1 (hosted checks) adds its contracts (hosted_checks_contract_test.go: the pass that asks, the failure's fix round, every binding rule, the protocol 4 runner; about 140 lines); measured 13816. 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. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. 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/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index 18d3c55a..e2263ac7 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6130,6 +6130,7 @@ records remain unchanged.
| `chat.paste.prompt` | Prompt | Paste box: the bar's label for a block fenced as prompt | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| `chat.paste.text` | Text | Paste box: the bar's label for a block fenced as text | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
| `chat.paste.command` | Command | Paste box: the bar's label for a shell block (bash, sh, zsh, shell, console) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
+| `chat.card.grant_how_unknown` | The namespace owner runs this once. Replace &lt;namespace&gt; with the namespace that holds the repository. | Chat access card: under Grant access when the person named no namespace, so the command keeps its placeholder (empty-repo-reads, 2026-11-11) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11) |
## Task 21
@@ -7037,3 +7038,16 @@ Verification (targeted, niced):
- `go test ./internal/equipo -run 'TestTemplateCopyKeys|TestRunnerCopyInventory'`, `go test ./internal/plan3test -run 'TestConversationDraftRendersOnTheServer'`: ok.
- `go test -tags browser ./internal/headless -run '^TestBrowserPasteBox$'` (new; streams `replymd:paste` from fakeclaude): two local runs found test faults only (JS string quoting, then a batch that brought the trailing spaces and the closing fence together, which the test read as a move). The assertions are now precise. Hosted CI at 9b70f33 ran it in browser-headless-rest: ok. That run failed only on this report's own wording in the reference scan, fixed here.
- `python3 scripts/runner-dead-references.py`: 0 failures. `EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$'`: ok.
+
+## Delegated copy pass: empty repositories (Astra, 2026-11-11)
+
+Paul delegated copy review on 2026-10-25. One Astra pass (gpt-6-astra,
+effort high) reviewed the six strings branch empty-repo-reads adds. One is
+shown to people: `chat.card.grant_how_unknown`, which Astra revised (row
+above, COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11); copy.go matches).
+Five are tool results only the coordinator model reads, kept as drafted:
+the empty and not-yet-read answers of read_file and search_code, find's
+"(no commits yet)" and "(not read yet)" markers, and the runner's empty
+read. A first pass revised the "(not read yet)" marker because the brief
+misstated which strings must keep "no commits yet"; a second pass on the
+corrected brief accepted it as drafted.
diff --git a/internal/equipo/chat/tools.go b/internal/equipo/chat/tools.go
index 3fd62ffe..9b0be088 100644
--- a/internal/equipo/chat/tools.go
+++ b/internal/equipo/chat/tools.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ "path"
"regexp"
"slices"
"strconv"
@@ -26,6 +27,11 @@ const (
toolNoCreate = "You cannot create a repository in that namespace. Use the best-fitting existing repository with add_project and give one short reason."
toolExists = "That repository already exists. Use add_project with it instead."
toolUnreachable = "That repository is not one Equipo's agent can reach. Use find to see what it can reach."
+ // toolEmptyRepo and toolNotIndexed follow the repository's name.
+ toolEmptyRepo = " has no commits yet, so there is nothing to read. Equipo's agent can still work there."
+ toolNotIndexed = " is on the runner's list, but the runner has not read it yet. Try again in a few minutes."
+ toolFoundEmpty = " (no commits yet)"
+ toolFoundUnread = " (not read yet)"
toolMovingIn = "While moving in or exploring you only look around and take notes: status, find, search_code, read_file, read_notes and write_note."
toolAskedOwner = "Nothing changed yet: the person sees a card asking whether to make this change, and one tap applies it. Do not ask again in your reply."
toolNoHome = "New projects have no home now, so there is nothing to clear."
@@ -419,11 +425,20 @@ func (t *txn) runTool(l Lease, v *wire.ToolCall) (wire.ToolResult, error) {
if err != nil {
return wire.ToolResult{}, err
}
+ // The catalog says what the runner has read: a repository with no
+ // commits is empty, not out of reach, and one on the runner's list
+ // it has not read yet is said as such.
repo := NormalizeRepo(in.Repo)
- if !slices.ContainsFunc(h.Catalog, func(e wire.RepoInfo) bool { return e.Repo == repo }) {
- return refused("unreachable", toolUnreachable), nil
- }
- return wire.ToolResult{Code: "read", Repo: repo}, nil
+ i := slices.IndexFunc(h.Catalog, func(e wire.RepoInfo) bool { return e.Repo == repo })
+ switch {
+ case i >= 0 && h.Catalog[i].Empty:
+ return wire.ToolResult{Code: "empty", Repo: repo, Text: ProjectName(repo) + toolEmptyRepo}, nil
+ case i >= 0:
+ return wire.ToolResult{Code: "read", Repo: repo}, nil
+ case slices.Contains(h.Repos, repo):
+ return refused("not_indexed", ProjectName(repo)+toolNotIndexed), nil
+ }
+ return refused("unreachable", toolUnreachable), nil
case wire.ToolSetProjectHome:
var in struct {
Namespace string `json:"namespace"`
@@ -706,8 +721,23 @@ type hit struct {
reasons []string
}
-// catalogHits scores catalog entries against a query, best first.
-func catalogHits(h wire.Hello, query string) []hit {
+// reachable is every repository the agent reaches, for find: the catalog,
+// then each repository on the runner's list it has not read yet, by name
+// alone (unread).
+func reachable(h wire.Hello) (entries []wire.RepoInfo, unread map[string]bool) {
+ entries, unread = slices.Clone(h.Catalog), map[string]bool{}
+ for _, repo := range h.Repos {
+ if !strings.HasPrefix(repo, "amadan.net/") || slices.ContainsFunc(entries, func(e wire.RepoInfo) bool { return e.Repo == repo }) {
+ continue
+ }
+ entries = append(entries, wire.RepoInfo{Repo: repo, Names: []string{path.Base(repo)}, Hints: []string{}})
+ unread[repo] = true
+ }
+ return entries, unread
+}
+
+// catalogHits scores entries against a query, best first.
+func catalogHits(entries []wire.RepoInfo, query string) []hit {
words := []string{}
for _, w := range strings.FieldsFunc(strings.ToLower(query), func(c rune) bool { return !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '-' && c != '.' }) {
if len(w) > 1 && !slices.Contains(words, w) {
@@ -715,7 +745,7 @@ func catalogHits(h wire.Hello, query string) []hit {
}
}
var hits []hit
- for _, e := range h.Catalog {
+ for _, e := range entries {
x := hit{e: e}
name := strings.ToLower(ProjectName(e.Repo))
for _, w := range words {
@@ -759,14 +789,22 @@ func (t *txn) find(r turnRecord, query string) (wire.ToolResult, error) {
if err != nil {
return wire.ToolResult{}, err
}
- hits := catalogHits(h, query)
+ entries, unread := reachable(h)
+ hits := catalogHits(entries, query)
if len(hits) > 0 {
var b strings.Builder
for i, x := range hits {
if i == 5 {
break
}
- b.WriteString(ProjectName(x.e.Repo) + ": " + strings.Join(x.reasons, ", "))
+ b.WriteString(ProjectName(x.e.Repo))
+ switch {
+ case x.e.Empty:
+ b.WriteString(toolFoundEmpty)
+ case unread[x.e.Repo]:
+ b.WriteString(toolFoundUnread)
+ }
+ b.WriteString(": " + strings.Join(x.reasons, ", "))
if len(x.e.Hints) > 0 {
b.WriteString("; " + strings.Join(x.e.Hints, ", "))
}
@@ -778,7 +816,7 @@ func (t *txn) find(r turnRecord, query string) (wire.ToolResult, error) {
return wire.ToolResult{Code: "found", Text: b.String()}, nil
}
namespaces := []string{}
- for _, e := range h.Catalog {
+ for _, e := range entries {
if ns := strings.Split(ProjectName(e.Repo), "/")[0]; !slices.Contains(namespaces, ns) {
namespaces = append(namespaces, ns)
}
@@ -803,7 +841,7 @@ func (t *txn) accessCard(r turnRecord, query, agent string, namespaces []string)
}
raw, _ := json.Marshal(namespaces)
now := t.now()
- c := cardRecord{ID: newID("c_"), Person: r.Person, Kind: wire.CardAccess, State: wire.CardOpen, TurnID: r.ID, Question: clipText(query, wire.MaxQuestion), Options: string(raw), Choice: agent, Name: NamespaceGuess(query), Revision: 1, CreatedAt: now, UpdatedAt: now}
+ c := cardRecord{ID: newID("c_"), Person: r.Person, Kind: wire.CardAccess, State: wire.CardOpen, TurnID: r.ID, Question: clipText(query, wire.MaxQuestion), Options: string(raw), Choice: agent, Name: AccessName(query), Revision: 1, CreatedAt: now, UpdatedAt: now}
if err := t.db.Create(&c).Error; err != nil {
return err
}
@@ -862,15 +900,17 @@ var guessSkip = map[string]bool{"the": true, "a": true, "an": true, "my": true,
var guessName = regexp.MustCompile(`^[a-z0-9][a-z0-9-]{1,38}$`)
-// NamespaceGuess is the namespace a name looked for most likely lives in
-// (Woodstar is woodstar), for the grant command; empty when unclear.
-func NamespaceGuess(query string) string {
+// AccessName is what an access card is for, from what was looked for:
+// a repository with its namespace ("paulca/threatmin"), or else the one
+// name a person would type (Woodstar is woodstar); empty when unclear.
+// It is what resolves the card, never a namespace on its own.
+func AccessName(query string) string {
for _, w := range strings.Fields(strings.ToLower(query)) {
- w = strings.Trim(w, ".,;:!?'\"()")
+ w = strings.TrimPrefix(strings.Trim(w, ".,;:!?'\"()"), "amadan.net/")
if guessSkip[w] {
continue
}
- if guessName.MatchString(w) {
+ if repoRef.MatchString(w) || guessName.MatchString(w) {
return w
}
return ""
@@ -878,9 +918,27 @@ func NamespaceGuess(query string) string {
return ""
}
-// intended reports whether repo is what an access card asked for: a
-// repository in its namespace, or one named after it.
+// repoRef is a repository named with its namespace.
+var repoRef = regexp.MustCompile(`^[a-z0-9][a-z0-9_.-]{0,38}/[a-z0-9][a-z0-9._-]{0,99}$`)
+
+// GrantNamespace is the namespace an access card's grant command names:
+// only one the person gave with a repository. A bare name is as often a
+// repository or a product as a namespace ("threatmin" is a repository in
+// paulca), so the command keeps its placeholder rather than guess.
+func GrantNamespace(name string) string {
+ if ns, _, ok := strings.Cut(name, "/"); ok {
+ return ns
+ }
+ return ""
+}
+
+// intended reports whether repo is what an access card asked for: that
+// repository when the card names one with its namespace; otherwise a
+// repository in a namespace of that name, or one named after it.
func intended(repo, name string) bool {
+ if strings.Contains(name, "/") {
+ return strings.EqualFold(ProjectName(repo), name)
+ }
ns, base, _ := strings.Cut(ProjectName(repo), "/")
return ns == name || strings.EqualFold(base, name)
}
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go
index e7a28367..f3a45ae6 100644
--- a/internal/equipo/chat_page.go
+++ b/internal/equipo/chat_page.go
@@ -65,8 +65,10 @@ type chatLine struct {
type chatCard struct {
wire.Card
Line, Change, Agent, Namespace, Note string
- Open, Remove, Receipt bool
- Choices []string
+ // GrantHow introduces an access card's grant command.
+ GrantHow string
+ Open, Remove, Receipt bool
+ Choices []string
// Task is a task card's task.
Task *taskLine
}
@@ -109,9 +111,12 @@ func cardView(c wire.Card, choices []string, tasks map[string]wire.Task) chatCar
v.Open = c.State == wire.CardHomeSet || c.State == wire.CardHomeAsk
case wire.CardAccess:
reach := strings.Join(c.Options, ", ")
- v.Agent, v.Namespace = c.Choice, "<namespace>"
- if c.Name != "" {
- v.Namespace = c.Name
+ // The command names a namespace only when the person gave one
+ // with a repository; otherwise it keeps the placeholder and says
+ // what goes there.
+ v.Agent, v.Namespace, v.GrantHow = c.Choice, "<namespace>", copyText("chat.card.grant_how_unknown")
+ if ns := chat.GrantNamespace(c.Name); ns != "" {
+ v.Namespace, v.GrantHow = ns, copyText("chat.card.grant_how")
}
v.Line = fmt.Sprintf(copyText("chat.card.access"), c.Question, reach)
v.Open = c.State == wire.CardOpen
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index cd594640..cef04a86 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -1224,6 +1224,7 @@ var pageCopy = map[string]string{
"chat.card.access": "Equipo can't reach %s yet. Its agent reaches %s.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.grant": "Grant access", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.grant_how": "The namespace owner runs this once:", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "chat.card.grant_how_unknown": "The namespace owner runs this once. Replace <namespace> with the namespace that holds the repository.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11)
"chat.card.home": "New projects go to %s", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.home_cleared": "New projects go to the best-fitting existing repository", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.undo": "Undo", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html
index 9b8d8a4c..af588e91 100644
--- a/internal/equipo/templates/chat.html
+++ b/internal/equipo/templates/chat.html
@@ -8,7 +8,7 @@
{{else if eq .Kind "home"}}<p equipo-card-line>{{icon "folder"}}<span>{{.Line}}</span></p><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}"><button rst-btn="primary" name="choice" value="confirm" type="submit">{{copy "chat.card.confirm"}}</button></form>
{{else if eq .Kind "merge"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{range .Options}}<button rst-btn="{{if eq . "merge"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-merge-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
{{else if or (eq .Kind "merge_ships") (eq .Kind "merge_policy") (eq .Kind "merge_receipt")}}{{if eq .Kind "merge_receipt"}}<div equipo-card-line equipo-markdown data-merge-receipt>{{chatMarkdown .Line}}</div>{{else}}<p equipo-card-line>{{.Line}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{range .Options}}<button rst-btn="{{if or (eq . "save") (eq . "not_ships")}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-merge-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
-{{else if eq .Kind "access"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<details equipo-grant><summary rst-btn>{{copy "chat.card.grant"}}</summary><p>{{copy "chat.card.grant_how"}}</p><code>amadan agent grant {{.Agent}} {{.Namespace}}</code><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><button rst-btn name="choice" value="check" type="submit" data-grant-check>{{copy "chat.card.grant_check"}}</button></form></details>{{end}}
+{{else if eq .Kind "access"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<details equipo-grant><summary rst-btn>{{copy "chat.card.grant"}}</summary><p>{{.GrantHow}}</p><code>amadan agent grant {{.Agent}} {{.Namespace}}</code><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><button rst-btn name="choice" value="check" type="submit" data-grant-check>{{copy "chat.card.grant_check"}}</button></form></details>{{end}}
{{end}}</li>{{end}}
{{define "work-task-receipt"}}{{with .Task}}<p equipo-card-line>{{icon "check-circle"}}<span><a href="/tasks/{{.ID}}">{{.Title}}</a></span><span equipo-stage data-stage="{{.Stage}}" data-needs="{{.NeedsYou}}">{{.StageLine}}</span></p>{{if and .Pushed (not .MergedLine)}}<p equipo-card-note data-pushed><span>{{.Pushed}}</span><a href="{{.URL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a></p>{{end}}{{if or .ChecksLine .ReviewLine}}<p equipo-card-note data-judged>{{with .ChecksLine}}<span data-checks>{{.}}</span>{{end}}{{with .ReviewLine}}<span data-verdict>{{.}}</span>{{end}}</p>{{end}}{{if .MergedLine}}<p equipo-card-note data-merged><span>{{.MergedLine}}</span><a href="{{.RepoURL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a></p>{{end}}{{end}}{{if .Open}}<button type="button" equipo-receipt-more aria-expanded="false" aria-controls="acts-{{.ID}}" aria-label="{{copy "chat.card.more"}}">⋯</button><span equipo-receipt-actions id="acts-{{.ID}}">{{template "work-task-actions" .Task}}</span>{{end}}{{end}}
{{define "message-files"}}{{with .}}<div equipo-message-files>{{range .}}{{if eq .Kind "image"}}<a equipo-file-thumb href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}"><img src="/conversation/attachments/{{.ID}}/preview" alt="{{.Name}}"{{if .Width}} width="{{.Width}}" height="{{.Height}}"{{end}} loading="lazy" decoding="async"></a>{{else}}<a equipo-file-chip href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}">{{icon "file-text"}}<span equipo-file-name>{{.Name}}</span><span equipo-file-size>{{fileSize .Size}}</span></a>{{end}}{{end}}</div>{{end}}{{end}}
diff --git a/internal/headless/engineering_test.go b/internal/headless/engineering_test.go
index a7e8e179..92759a89 100644
--- a/internal/headless/engineering_test.go
+++ b/internal/headless/engineering_test.go
@@ -283,3 +283,44 @@ func scenarioGrant(t *testing.T, env *Env) {
t.Fatalf("allowlist %+v %v", list.Allowed, err)
}
}
+
+// A repository the agent reaches but nobody has pushed to yet, through
+// the coordinator's own tools on the real runner: status offers it,
+// add_project adds it, find names it and the read tools say it has no
+// commits yet. Nothing calls it unreachable or puts up an access card.
+func scenarioEmptyRepo(t *testing.T, env *Env) {
+ if env.Live || env.GrantEmpty == nil {
+ t.Skip("local forge only")
+ }
+ const repo = "amadan.net/paulca/threatmin"
+ env.GrantEmpty(t, repo)
+ s := open(t, env)
+ s.keep()
+ s.wait(t, "runner online", 30*time.Second, func(c *thintest.Conversation) bool { return c.Runner.Online })
+ deadline := time.Now().Add(45 * time.Second)
+ for found, empty := env.Indexed(t, repo); !found || !empty; found, empty = env.Indexed(t, repo) {
+ if time.Now().After(deadline) {
+ t.Fatalf("not catalogued as empty: found %v", found)
+ }
+ time.Sleep(200 * time.Millisecond)
+ }
+ sent := s.send(t, "Look at threatmin. tool:status\ntool:add_project:paulca/threatmin\ntool:find:threatmin\ntool:read_file:paulca/threatmin|README.md\ntool:search_code:paulca/threatmin|main")
+ s.waitTurn(t, sent.Turn.ID, wire.TurnReplied)
+ r := s.reply(t, sent.Turn.ID).Text
+ if !strings.Contains(r, `"paulca/threatmin"`) || !strings.Contains(r, "[add_project: Added paulca/threatmin.") || strings.Count(r, "no commits yet") < 3 {
+ t.Fatalf("reply %s", r)
+ }
+ for _, bad := range []string{"Could not read that", "not one Equipo's agent can reach", "amadan agent grant"} {
+ if strings.Contains(r, bad) {
+ t.Fatalf("reply says %q: %s", bad, r)
+ }
+ }
+ if _, ok := s.project("paulca/threatmin"); !ok {
+ t.Fatal("no project")
+ }
+ s.conv.Locked(func(c *thintest.Conversation) {
+ if k := cards(c, sent.Turn.ID, wire.CardAccess); len(k) != 0 {
+ t.Fatalf("access card %+v", k)
+ }
+ })
+}
diff --git a/internal/headless/env_test.go b/internal/headless/env_test.go
index 30330f66..47bc8d51 100644
--- a/internal/headless/env_test.go
+++ b/internal/headless/env_test.go
@@ -29,6 +29,7 @@ import (
"amadan.net/oficina/equipo/internal/testci"
"amadan.net/oficina/equipo/internal/thintest"
"amadan.net/oficina/equipo/internal/toolproxy"
+ "amadan.net/oficina/equipo/internal/wire"
"amadan.net/rastrillo/rastrillo/budget"
_ "modernc.org/sqlite"
)
@@ -99,6 +100,12 @@ type Env struct {
// GrantNow makes a repository reachable without restarting the
// runner, like a grant on the hub (local only).
GrantNow func(t *testing.T, repo string)
+ // GrantEmpty makes a new repository with no commits reachable, then
+ // restarts the runner (local only).
+ GrantEmpty func(t *testing.T, repo string)
+ // Indexed reports whether the instance's newest hello catalogues repo,
+ // and whether as empty (local only).
+ Indexed func(t *testing.T, repo string) (found, empty bool)
// KeptSessions counts the step sessions the runner keeps on disk
// (local only).
KeptSessions func(t *testing.T) int
@@ -343,8 +350,33 @@ func localEnv(t *testing.T) (*Env, *thintest.Instance, *localRunner) {
return len(dirs)
},
GrantNow: func(t *testing.T, repo string) { forge.grant(t, root, repo) },
- Grant: func(t *testing.T, repo string) { forge.grant(t, root, repo); r.stop(t); r.start(t) },
- Revoke: func(t *testing.T, repo string) { forge.revoke(repo); r.stop(t); r.start(t) },
+ GrantEmpty: func(t *testing.T, repo string) {
+ forge.grantEmpty(t, repo)
+ r.stop(t)
+ r.start(t)
+ },
+ Indexed: func(t *testing.T, repo string) (bool, bool) {
+ rows, err := inst.DB.Writer().Query("SELECT hello FROM runner_sessions WHERE hello <> ''")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer rows.Close()
+ for rows.Next() {
+ var raw string
+ var h wire.Hello
+ if rows.Scan(&raw) != nil || json.Unmarshal([]byte(raw), &h) != nil {
+ continue
+ }
+ for _, e := range h.Catalog {
+ if e.Repo == repo {
+ return true, e.Empty
+ }
+ }
+ }
+ return false, false
+ },
+ Grant: func(t *testing.T, repo string) { forge.grant(t, root, repo); r.stop(t); r.start(t) },
+ Revoke: func(t *testing.T, repo string) { forge.revoke(repo); r.stop(t); r.start(t) },
AgeEvents: func(t *testing.T) bool {
if _, err := inst.DB.Writer().Exec("UPDATE chat_events SET created_at = ?", time.Now().Add(-48*time.Hour)); err != nil {
t.Fatal(err)
diff --git a/internal/headless/projects_test.go b/internal/headless/projects_test.go
index 4190f45f..e5c4bc07 100644
--- a/internal/headless/projects_test.go
+++ b/internal/headless/projects_test.go
@@ -125,6 +125,19 @@ func (f *localForge) grant(t *testing.T, root, repo string) {
f.mu.Unlock()
}
+// grantEmpty makes a new repository with no commits reachable, like a
+// repository created on the hub and not pushed to yet.
+func (f *localForge) grantEmpty(t *testing.T, repo string) {
+ t.Helper()
+ if err := os.MkdirAll(f.root, 0700); err != nil {
+ t.Fatal(err)
+ }
+ gitRun(t, f.root, "init", "-q", "--bare", "-b", "main", f.path(repo))
+ f.mu.Lock()
+ f.hidden = append(f.hidden, repo)
+ f.mu.Unlock()
+}
+
// revoke makes a repository unreachable again.
func (f *localForge) revoke(repo string) {
f.mu.Lock()
diff --git a/internal/headless/scenarios_test.go b/internal/headless/scenarios_test.go
index f0adff21..fad75e36 100644
--- a/internal/headless/scenarios_test.go
+++ b/internal/headless/scenarios_test.go
@@ -453,6 +453,7 @@ var scenarios = []struct {
{"3_step_contained", scenarioStepContained},
{"4_step_crash", scenarioStepCrash},
{"3_grant", scenarioGrant},
+ {"3_empty_repo", scenarioEmptyRepo},
{"4_review", scenarioReview},
{"4_checks_honest", scenarioChecksHonest},
{"4_witness", scenarioReviewWitness},
diff --git a/internal/runner/thin/bridge.go b/internal/runner/thin/bridge.go
index 41e3067d..7d53018b 100644
--- a/internal/runner/thin/bridge.go
+++ b/internal/runner/thin/bridge.go
@@ -5,6 +5,7 @@ import (
"context"
"crypto/rand"
"encoding/json"
+ "errors"
"io"
"log/slog"
"os"
@@ -35,6 +36,7 @@ const (
toolCloneLater = " It is not cloned on this machine yet; that is retried when work starts."
toolBadArgs = "The input is not valid for this tool."
toolReadError = "Could not read that. Check the repository name and path, then try once more."
+ toolEmptyRead = "That repository has no commits yet, so there is nothing to read."
toolNoteError = "Your notebook was not saved: at most 40 entries of one line (400 bytes) each, 12 KB in all."
toolNoNotes = "Your notebook is empty."
)
@@ -145,6 +147,10 @@ func (b *bridge) call(ctx context.Context, person, turn string, attempt int64, n
return toolBadArgs, true
}
res := b.roundTrip(ctx, call)
+ if !res.IsError && res.Code == "empty" {
+ // Reachable and empty: an answer, not a failed read.
+ return res.Text, false
+ }
if res.IsError || res.Code != "read" || res.Repo == "" {
return res.Text, true
}
@@ -160,6 +166,9 @@ func (b *bridge) call(ctx context.Context, person, turn string, attempt int64, n
} else {
text, err = b.Index.ReadFile(rctx, res.Repo, in.Path, in.Start)
}
+ if errors.Is(err, ErrEmptyRepo) {
+ return toolEmptyRead, false
+ }
if err != nil {
b.log("read tool", err)
return toolReadError, true
diff --git a/internal/runner/thin/contract_test.go b/internal/runner/thin/contract_test.go
index ea029b6d..3ab508a8 100644
--- a/internal/runner/thin/contract_test.go
+++ b/internal/runner/thin/contract_test.go
@@ -140,6 +140,13 @@ func write(t *testing.T, c *websocket.Conn, raw []byte) {
}
func startLink(t *testing.T, origin string, coord Coordinator, seed ...func(*State)) (*Link, *State, context.CancelFunc, chan error) {
+ t.Helper()
+ return startLinkWith(t, origin, coord, nil, seed...)
+}
+
+// startLinkWith is startLink with hello, when set, as the runner's hello,
+// in place before the link first dials.
+func startLinkWith(t *testing.T, origin string, coord Coordinator, hello func() wire.Hello, seed ...func(*State)) (*Link, *State, context.CancelFunc, chan error) {
t.Helper()
ctx, cancel := context.WithCancel(context.Background())
state, err := OpenState(ctx, t.TempDir())
@@ -157,6 +164,9 @@ func startLink(t *testing.T, origin string, coord Coordinator, seed ...func(*Sta
link := &Link{Logger: slog.New(slog.NewTextHandler(os.Stderr, nil)), Origin: origin, Token: "token", State: state, Role: testEnrolledRole, Files: &Files{State: state, SessionRoot: sessions}, Hello: func() wire.Hello {
return wire.Hello{Repos: []string{"amadan.net/oficina/sample"}, CreateIn: []string{}, Catalog: []wire.RepoInfo{}, Connections: []wire.HeldConnection{{LocalID: "claude-a", Person: "owner@example.com", Provider: "claude", Kind: "subscription", Label: "owner@example.com", State: "healthy"}}, Versions: map[string]string{"runner": "test", "claude": "2.1.312"}}
}}
+ if hello != nil {
+ link.Hello = hello
+ }
engine := &Engine{State: state, Emit: link.Delta, Notify: link.Notify, Authorize: link.Confirm, Open: func(string, runner.AccountBinding) (Coordinator, error) { return coord, nil }}
link.Engine = engine
if err = engine.Start(ctx); err != nil {
diff --git a/internal/runner/thin/forge.go b/internal/runner/thin/forge.go
index 93829d86..5a30e282 100644
--- a/internal/runner/thin/forge.go
+++ b/internal/runner/thin/forge.go
@@ -53,6 +53,10 @@ type Forge interface {
// ErrNoCreate means repositories cannot be created in that namespace.
var ErrNoCreate = errors.New("repository creation is not available here")
+// ErrEmptyRepo means the forge serves the repository and it has no
+// commits yet: no branch, nothing to read. It is not an access failure.
+var ErrEmptyRepo = errors.New("the repository has no commits yet")
+
var (
repoKey = regexp.MustCompile(`^amadan\.net/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$`)
newName = regexp.MustCompile(`^[a-z0-9][a-z0-9.-]{1,38}$`)
@@ -464,6 +468,31 @@ func (c *Clones) DefaultBranch(ctx context.Context, repo string) (string, error)
if err != nil {
return "", err
}
+ out, err := c.lsRemote(ctx, remote, "--symref", "--", remote.URL, "HEAD")
+ if err != nil {
+ return "", err
+ }
+ for _, line := range strings.Split(string(out), "\n") {
+ if rest, ok := strings.CutPrefix(line, "ref: refs/heads/"); ok {
+ b, _, _ := strings.Cut(rest, "\t")
+ if validBranch(b) {
+ return b, nil
+ }
+ }
+ }
+ // No branch at HEAD. A repository with no refs at all is empty; one
+ // with refs but none at HEAD is not readable here, as before.
+ if strings.TrimSpace(string(out)) == "" {
+ if all, err := c.lsRemote(ctx, remote, "--", remote.URL); err == nil && strings.TrimSpace(string(all)) == "" {
+ return "", ErrEmptyRepo
+ }
+ }
+ return "", ErrNoCreate
+}
+
+// lsRemote runs git ls-remote against a resolved remote, its password in
+// a header and never in the URL or the environment's config files.
+func (c *Clones) lsRemote(ctx context.Context, remote workspace.Remote, args ...string) ([]byte, error) {
env := workspace.GitEnvironment()
env["HOME"] = "/nonexistent"
protocol := "https"
@@ -474,23 +503,11 @@ func (c *Clones) DefaultBranch(ctx context.Context, repo string) (string, error)
env["GIT_CONFIG_KEY_9"] = "http.extraHeader"
env["GIT_CONFIG_VALUE_9"] = "Authorization: Basic " + base64.StdEncoding.EncodeToString([]byte("x:"+remote.GitPassword))
}
- cmd := groupCommand(ctx, c.Git, "-c", "protocol."+protocol+".allow=always", "-c", "http.followRedirects=false", "ls-remote", "--symref", "--", remote.URL, "HEAD")
+ cmd := groupCommand(ctx, c.Git, append([]string{"-c", "protocol." + protocol + ".allow=always", "-c", "http.followRedirects=false", "ls-remote"}, args...)...)
cmd.Dir = c.Root
for k, v := range env {
cmd.Env = append(cmd.Env, k+"="+v)
}
cmd.Stderr = io.Discard
- out, err := cmd.Output()
- if err != nil {
- return "", err
- }
- for _, line := range strings.Split(string(out), "\n") {
- if rest, ok := strings.CutPrefix(line, "ref: refs/heads/"); ok {
- b, _, _ := strings.Cut(rest, "\t")
- if validBranch(b) {
- return b, nil
- }
- }
- }
- return "", ErrNoCreate
+ return cmd.Output()
}
diff --git a/internal/runner/thin/index.go b/internal/runner/thin/index.go
index 565002dc..86263e2e 100644
--- a/internal/runner/thin/index.go
+++ b/internal/runner/thin/index.go
@@ -115,16 +115,22 @@ func (x *Index) Loop(ctx context.Context) {
}
// Delta drops what the agent no longer reaches and fetches only what is
-// new, keeping every other entry as it is.
+// new, or was empty (its first commit may have arrived), keeping every
+// other entry as it is.
func (x *Index) Delta(ctx context.Context) {
repos := x.Forge.Reachable(ctx)
if len(repos) > wire.MaxCatalog {
repos = repos[:wire.MaxCatalog]
}
have := map[string]bool{}
+ empty := map[string]wire.RepoInfo{}
var out []wire.RepoInfo
for _, e := range x.Catalog() {
- if slices.Contains(repos, e.Repo) {
+ switch {
+ case !slices.Contains(repos, e.Repo):
+ case e.Empty:
+ empty[e.Repo] = e
+ default:
out = append(out, e)
have[e.Repo] = true
}
@@ -149,6 +155,9 @@ func (x *Index) Delta(ctx context.Context) {
if x.Logger != nil {
x.Logger.Warn("index", "repo", repo, "err", sanitize(err))
}
+ if prev, ok := empty[repo]; ok {
+ out = append(out, prev)
+ }
continue
}
out = append(out, e)
@@ -227,6 +236,11 @@ func (x *Index) entry(ctx context.Context, repo string) (wire.RepoInfo, error) {
fctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
defer cancel()
branch, err := x.Clones.DefaultBranch(fctx, repo)
+ if errors.Is(err, ErrEmptyRepo) {
+ // Reachable, nothing pushed yet: listed by name, so the
+ // coordinator can say it is empty rather than out of reach.
+ return wire.RepoInfo{Repo: repo, Names: bounded([]string{path.Base(repo)}, wire.MaxRepoNames), Hints: []string{}, Empty: true}, nil
+ }
if err != nil {
return wire.RepoInfo{}, err
}
@@ -671,13 +685,18 @@ func numberedLines(out []byte, start int) string {
return clip(b.String(), maxToolOutput)
}
-// ready makes sure the index has a clone of repo to read.
+// ready makes sure the index has a clone of repo to read. An empty
+// repository has nothing to read (ErrEmptyRepo).
func (x *Index) ready(ctx context.Context, repo string) (string, error) {
+ catalog := x.Catalog()
+ if slices.ContainsFunc(catalog, func(e wire.RepoInfo) bool { return e.Repo == repo && e.Empty }) {
+ return "", ErrEmptyRepo
+ }
dir := x.Clones.Path(repo)
if _, err := os.Stat(dir); err == nil {
return dir, nil
}
- for _, e := range x.Catalog() {
+ for _, e := range catalog {
if e.Repo == repo {
return dir, x.Clones.Shallow(ctx, repo, e.DefaultBranch)
}
diff --git a/internal/runner/thin/index_empty_test.go b/internal/runner/thin/index_empty_test.go
new file mode 100644
index 00000000..ceac0dee
--- /dev/null
+++ b/internal/runner/thin/index_empty_test.go
@@ -0,0 +1,132 @@
+package thin
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "os"
+ "path/filepath"
+ "slices"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/runner/workspace"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// pathForge serves the index: every repository is a local bare repository,
+// read over file:// like the local forge in the headless suite.
+type pathForge struct {
+ countingForge
+ root string
+}
+
+func (f *pathForge) path(repo string) string {
+ return filepath.Join(f.root, strings.ReplaceAll(strings.TrimPrefix(repo, "amadan.net/"), "/", "__")+".git")
+}
+
+func (f *pathForge) Remote(_ context.Context, repo string) (workspace.Remote, error) {
+ if !slices.Contains(f.repos, repo) {
+ return workspace.Remote{}, workspace.ErrGitPassword
+ }
+ return workspace.Remote{URL: f.path(repo)}, nil
+}
+
+// A reachable repository with no commits yet is in the catalog, marked
+// empty: it is not an access failure. A repository with commits but no
+// branch at HEAD, and one the forge cannot serve, stay out as before.
+// The first commit is seen on the next delta, and reads of an empty
+// repository say it is empty rather than failing.
+func TestIndexListsEmptyRepository(t *testing.T) {
+ root := t.TempDir()
+ f := &pathForge{root: filepath.Join(root, "forge")}
+ const (
+ full = "amadan.net/oficina/sample"
+ empty = "amadan.net/paulca/threatmin"
+ headless = "amadan.net/paulca/detached"
+ gone = "amadan.net/paulca/gone"
+ )
+ f.repos = []string{full, empty, headless, gone}
+ seed := filepath.Join(root, "seed")
+ os.MkdirAll(seed, 0700)
+ os.WriteFile(filepath.Join(seed, "README.md"), []byte("# Sample\n\nA sample.\n"), 0600)
+ hostileGit(t, seed, "init", "-q", "-b", "main")
+ hostileGit(t, seed, "add", "-A")
+ hostileGit(t, seed, "commit", "-q", "-m", "seed")
+ os.MkdirAll(f.root, 0700)
+ hostileGit(t, root, "clone", "-q", "--bare", seed, f.path(full))
+ hostileGit(t, root, "init", "-q", "--bare", "-b", "main", f.path(empty))
+ // Commits on dev only, HEAD naming a main that does not exist.
+ hostileGit(t, root, "clone", "-q", "--bare", seed, f.path(headless))
+ hostileGit(t, f.path(headless), "branch", "-m", "main", "dev")
+ hostileGit(t, f.path(headless), "symbolic-ref", "HEAD", "refs/heads/main")
+
+ os.MkdirAll(filepath.Join(root, "work"), 0700)
+ x := &Index{Forge: f, Clones: &Clones{Root: filepath.Join(root, "work"), Git: "git", Forge: f}}
+ ctx := context.Background()
+ x.Refresh(ctx)
+ byRepo := map[string]wire.RepoInfo{}
+ for _, e := range x.Catalog() {
+ byRepo[e.Repo] = e
+ }
+ if e, ok := byRepo[full]; !ok || e.Empty || e.DefaultBranch != "main" {
+ t.Fatalf("full repository: %+v", e)
+ }
+ e, ok := byRepo[empty]
+ if !ok || !e.Empty || e.DefaultBranch != "" || e.HeadSHA != "" || !slices.Equal(e.Names, []string{"threatmin"}) || e.Hints == nil {
+ t.Fatalf("empty repository: %+v (present %v)", e, ok)
+ }
+ if _, ok := byRepo[headless]; ok {
+ t.Fatal("a repository with commits but no default branch is listed")
+ }
+ if _, ok := byRepo[gone]; ok {
+ t.Fatal("a repository the forge cannot serve is listed")
+ }
+ for _, read := range []func() (string, error){
+ func() (string, error) { return x.ReadFile(ctx, empty, "README.md", 1) },
+ func() (string, error) { return x.SearchCode(ctx, empty, "x") },
+ } {
+ if _, err := read(); !errors.Is(err, ErrEmptyRepo) {
+ t.Fatalf("read of an empty repository: %v", err)
+ }
+ }
+
+ // The first commit arrives; a delta (what a grant check or a new
+ // repository kicks) sees it without waiting for the hourly refresh.
+ hostileGit(t, seed, "push", "-q", f.path(empty), "main")
+ x.Delta(ctx)
+ for _, e := range x.Catalog() {
+ if e.Repo == empty && (e.Empty || e.DefaultBranch != "main" || len(e.HeadSHA) != 40) {
+ t.Fatalf("after the first commit: %+v", e)
+ }
+ }
+ if out, err := x.ReadFile(ctx, empty, "README.md", 1); err != nil || !strings.Contains(out, "1\t# Sample") {
+ t.Fatalf("read after the first commit: %q %v", out, err)
+ }
+}
+
+// The coordinator's read tools on an empty repository: the instance's
+// "empty" answer reaches the model as it is, not as a failed read; and if
+// the instance authorised a read the runner's own index finds empty, the
+// model is told it is empty, never "Could not read that".
+func TestBridgeReadsOfEmptyRepository(t *testing.T) {
+ const repo = "amadan.net/paulca/threatmin"
+ x := &Index{Clones: &Clones{Root: t.TempDir(), Git: "git"}}
+ x.catalog = []wire.RepoInfo{{Repo: repo, Names: []string{"threatmin"}, Hints: []string{}, Empty: true}}
+ answer := wire.ToolResult{Code: "empty", Repo: repo, Text: "paulca/threatmin has no commits yet."}
+ b := &bridge{Index: x, trip: func(context.Context, wire.ToolCall) wire.ToolResult { return answer }}
+ for _, name := range []string{wire.ToolReadFile, wire.ToolSearchCode} {
+ args := `{"repo":"paulca/threatmin","path":"README.md"}`
+ if name == wire.ToolSearchCode {
+ args = `{"repo":"paulca/threatmin","query":"x"}`
+ }
+ if text, isErr := b.Call(context.Background(), "p", "t", 1, name, "u1", json.RawMessage(args)); isErr || text != answer.Text {
+ t.Fatalf("%s, instance says empty: %q %v", name, text, isErr)
+ }
+ }
+ answer = wire.ToolResult{Code: "read", Repo: repo}
+ text, isErr := b.Call(context.Background(), "p", "t", 1, wire.ToolReadFile, "u2", json.RawMessage(`{"repo":"paulca/threatmin","path":"README.md"}`))
+ if isErr || text != toolEmptyRead || text == toolReadError {
+ t.Fatalf("runner finds it empty: %q %v", text, isErr)
+ }
+}
diff --git a/internal/runner/thin/link.go b/internal/runner/thin/link.go
index 9f282014..3e400f64 100644
--- a/internal/runner/thin/link.go
+++ b/internal/runner/thin/link.go
@@ -472,6 +472,10 @@ func (l *Link) handshake(ctx context.Context, offer int) (*websocket.Conn, *wire
l.info("connected", "host", host, "took", took(start))
c.SetReadLimit(wire.MaxFrameBytes)
hello := l.Hello()
+ // Said before the instance says its protocol: never an empty
+ // repository, which an older instance's strict decoder refuses. The
+ // next hello carries them once the welcome says protocol 6.
+ held := wire.WithoutEmptyRepos(&hello)
l.mu.Lock()
hello.Generation, hello.Protocol, l.proto = l.generation, offer, offer
l.mu.Unlock()
@@ -520,6 +524,9 @@ func (l *Link) handshake(ctx context.Context, offer int) (*websocket.Conn, *wire
}
l.mu.Lock()
l.proto, l.role = min(spoken, offer), role
+ if held && l.proto >= wire.ProtocolEmptyRepos {
+ l.helloSoon = true
+ }
l.mu.Unlock()
l.info("welcome", "protocol", min(spoken, offer), "role", role, "generation", welcome.Generation)
return c, welcome, nil
diff --git a/internal/runner/thin/protocol_test.go b/internal/runner/thin/protocol_test.go
index 58067ab4..bae8749a 100644
--- a/internal/runner/thin/protocol_test.go
+++ b/internal/runner/thin/protocol_test.go
@@ -256,3 +256,44 @@ func TestUnknownRoleLearnsFromProtocol2(t *testing.T) {
t.Fatalf("role not learned: %q", role)
}
}
+
+// The first hello goes out before the instance has said which protocol
+// it speaks, and an older instance's strict decoder refuses a field it
+// does not know (and the runner would then fall back to protocol 1): so
+// it never says a repository is empty. After a protocol 6 welcome the
+// next hello, sent at once rather than at the heartbeat, carries the
+// empty repository; at protocol 5 no hello ever does.
+func TestHandshakeHelloLeavesOutEmptyRepos(t *testing.T) {
+ const empty = "amadan.net/paulca/threatmin"
+ hello := func() wire.Hello {
+ return wire.Hello{Repos: []string{"amadan.net/oficina/sample", empty}, CreateIn: []string{}, Catalog: []wire.RepoInfo{
+ {Repo: "amadan.net/oficina/sample", DefaultBranch: "main", Names: []string{"sample"}, Hints: []string{}},
+ {Repo: empty, Names: []string{"threatmin"}, Hints: []string{}, Empty: true},
+ }, Connections: []wire.HeldConnection{}, Versions: map[string]string{"runner": "test", "claude": "2.1.312"}}
+ }
+ for _, protocol := range []int{wire.ProtocolHostedChecks, wire.ProtocolEmptyRepos} {
+ inst := newFakeInstance(t)
+ link, _, _, _ := startLinkWith(t, inst.url, &stubCoordinator{}, hello)
+ c := <-inst.conns
+ _, raw := read(t, c, wire.FrameHello)
+ if strings.Contains(string(raw), `"empty"`) || !strings.Contains(string(raw), `"repo":"amadan.net/oficina/sample"`) || !strings.Contains(string(raw), `"protocol":`+itoa(int64(wire.ProtocolCurrent))) {
+ t.Fatalf("handshake hello: %s", raw)
+ }
+ welcome, _ := json.Marshal(wire.Frame{ID: "w-e", Type: wire.FrameWelcome, Data: json.RawMessage(`{"generation":3,"runner_id":"RUNNER1","protocol":` + itoa(int64(protocol)) + `,"role":"primary"}`)})
+ write(t, c, welcome)
+ read(t, c, wire.FrameSync)
+ if protocol < wire.ProtocolEmptyRepos {
+ link.HelloSoon()
+ }
+ _, raw = read(t, c, wire.FrameHello)
+ if got := strings.Contains(string(raw), `"empty":true`); got != (protocol >= wire.ProtocolEmptyRepos) {
+ t.Fatalf("protocol %d hello: %s", protocol, raw)
+ }
+ var f wire.Frame
+ _ = json.Unmarshal(raw, &f)
+ var h wire.Hello
+ if err := wire.Strict(f.Data, &h); err != nil || len(h.Repos) != 2 {
+ t.Fatalf("protocol %d hello %+v %v", protocol, h, err)
+ }
+ }
+}
diff --git a/internal/thintest/empty_repo_contract_test.go b/internal/thintest/empty_repo_contract_test.go
new file mode 100644
index 00000000..ffb9a1df
--- /dev/null
+++ b/internal/thintest/empty_repo_contract_test.go
@@ -0,0 +1,98 @@
+package thintest
+
+import (
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/equipo/chat"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// The three paths agree about a repository the agent reaches: status
+// offers it, add_project adds it, and find and the read tools name it.
+// Empty (no commits yet) is said as empty, and one the runner has not
+// read yet as not read yet; neither is "unreachable", and neither puts
+// an access card in the conversation. A repository the agent does not
+// reach is still unreachable.
+func TestContractEmptyRepository(t *testing.T) {
+ r := newToolRigAt(t, wire.ProtocolEmptyRepos)
+ h := primaryAt(toolHello(r.runner.Welcome.Generation), wire.ProtocolEmptyRepos)
+ h.Repos = append(h.Repos, "amadan.net/paulca/threatmin", "amadan.net/paulca/later")
+ h.Catalog = append(h.Catalog, wire.RepoInfo{Repo: "amadan.net/paulca/threatmin", Names: []string{"threatmin"}, Hints: []string{}, Empty: true})
+ if err := r.runner.Send(r.ctx, "h-empty", wire.FrameHello, h); err != nil {
+ t.Fatal(err)
+ }
+ status := r.call("e1", wire.ToolStatus, map[string]string{})
+ if !strings.Contains(status.Text, `"paulca/threatmin"`) {
+ t.Fatalf("status: %s", status.Text)
+ }
+ if res := r.call("e2", wire.ToolAddProject, map[string]string{"repo": "paulca/threatmin"}); res.IsError || res.Code != "added" {
+ t.Fatalf("add: %+v", res)
+ }
+ for i, c := range []struct {
+ name string
+ args map[string]string
+ }{
+ {wire.ToolReadFile, map[string]string{"repo": "paulca/threatmin", "path": "README.md"}},
+ {wire.ToolSearchCode, map[string]string{"repo": "amadan.net/paulca/threatmin", "query": "main"}},
+ } {
+ res := r.call("e3-"+itoa(i), c.name, c.args)
+ if res.IsError || res.Code != "empty" || res.Repo != "amadan.net/paulca/threatmin" || !strings.Contains(res.Text, "paulca/threatmin") || !strings.Contains(res.Text, "no commits yet") || strings.Contains(res.Text, "reach") {
+ t.Fatalf("%s of an empty repository: %+v", c.name, res)
+ }
+ }
+ for _, q := range []string{"threatmin", "paulca/threatmin", "Threatmin"} {
+ found := r.call("e4-"+q, wire.ToolFind, map[string]string{"query": q})
+ if found.Code != "found" || !strings.Contains(found.Text, "paulca/threatmin") || !strings.Contains(found.Text, "no commits yet") {
+ t.Fatalf("find %q: %+v", q, found)
+ }
+ }
+ // In the allowlist, not in the catalog: the runner has not read it.
+ if res := r.call("e5", wire.ToolReadFile, map[string]string{"repo": "paulca/later", "path": "README.md"}); !res.IsError || res.Code != "not_indexed" || !strings.Contains(res.Text, "paulca/later") || strings.Contains(res.Text, "Use find") {
+ t.Fatalf("read before the index: %+v", res)
+ }
+ if found := r.call("e6", wire.ToolFind, map[string]string{"query": "later"}); found.Code != "found" || !strings.Contains(found.Text, "paulca/later") {
+ t.Fatalf("find before the index: %+v", found)
+ }
+ if snap, _ := r.client.Snapshot(r.ctx); func() int {
+ n := 0
+ for _, k := range snap.Cards {
+ if k.Kind == wire.CardAccess {
+ n++
+ }
+ }
+ return n
+ }() != 0 {
+ t.Fatal("an access card for a repository the agent reaches")
+ }
+ if res := r.call("e7", wire.ToolReadFile, map[string]string{"repo": "oficina/secret", "path": "README.md"}); !res.IsError || res.Code != "unreachable" {
+ t.Fatalf("read outside the allowlist: %+v", res)
+ }
+ // What the agent reaches is every namespace it is granted, read or
+ // not yet read: paulca is among them.
+ if none := r.call("e8", wire.ToolFind, map[string]string{"query": "Moonbeam"}); none.Code != "none" || !strings.Contains(none.Text, "It reaches: oficina, paulca.") {
+ t.Fatalf("find nothing: %+v", none)
+ }
+}
+
+// An access card's name is what was looked for; the grant command names
+// a namespace only when the person gave one ("acme/moonbeam"). A bare
+// name is a repository or a product as often as a namespace, so the
+// command keeps the <namespace> placeholder rather than guess
+// ("threatmin" is a repository in paulca).
+func TestAccessName(t *testing.T) {
+ for q, want := range map[string]string{
+ "Woodstar": "woodstar", "the Woodstar iOS app": "woodstar", "Moon Beam": "moon", "¿Qué?": "", "my app": "", "x": "",
+ "paulca/threatmin": "paulca/threatmin", "amadan.net/paulca/threatmin": "paulca/threatmin", "the acme/Moonbeam repo": "acme/moonbeam",
+ "a/b/c": "", "/threatmin": "",
+ } {
+ if got := chat.AccessName(q); got != want {
+ t.Fatalf("AccessName(%q) = %q, want %q", q, got, want)
+ }
+ }
+ for name, want := range map[string]string{"woodstar": "", "threatmin": "", "paulca/threatmin": "paulca", "": ""} {
+ if got := chat.GrantNamespace(name); got != want {
+ t.Fatalf("GrantNamespace(%q) = %q, want %q", name, got, want)
+ }
+ }
+}
diff --git a/internal/thintest/pages_test.go b/internal/thintest/pages_test.go
index a6d2ff80..bf6627f2 100644
--- a/internal/thintest/pages_test.go
+++ b/internal/thintest/pages_test.go
@@ -2,6 +2,7 @@ package thintest
import (
"context"
+ "html"
"io"
"net/http"
"net/url"
@@ -237,8 +238,13 @@ func TestPagesGrantCard(t *testing.T) {
return card.ID != ""
})
page := r.get(owner, "/conversation", 200)
- if !strings.Contains(page, "amadan agent grant equipo-test moonbeam") || !strings.Contains(page, `data-grant-check`) {
- t.Fatal("grant card lacks the command or the check")
+ // "Moonbeam" names no namespace: the command keeps the placeholder
+ // and says what goes there, rather than guess one.
+ if !strings.Contains(page, "amadan agent grant equipo-test &lt;namespace&gt;") || strings.Contains(page, "grant equipo-test moonbeam") || !strings.Contains(page, `data-grant-check`) {
+ t.Fatal("grant card lacks the command or the check, or guesses a namespace")
+ }
+ if !strings.Contains(page, html.EscapeString(equipo.RunnerText("chat.card.grant_how_unknown"))) {
+ t.Fatal("grant card does not say what goes in place of the namespace")
}
if status, _ := r.post(owner, "/conversation/cards/"+card.ID+"/answer", url.Values{"choice": {"check"}, "revision": {"1"}}); status != 303 {
t.Fatalf("check: %d", status)
@@ -253,6 +259,45 @@ func TestPagesGrantCard(t *testing.T) {
if !strings.Contains(page, "Moonbeam is reachable now.") || strings.Contains(page, "amadan agent grant") {
t.Fatal("resolved card still asks")
}
+ // A repository named with its namespace: the command names that
+ // namespace, and only that repository resolves the card.
+ r.next("acme")
+ r.call("g2", wire.ToolFind, map[string]string{"query": "acme/Stardust"})
+ var named wire.Card
+ r.wait("named access card", func(c *Conversation) bool {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardAccess && k.State == wire.CardOpen {
+ named = k
+ }
+ }
+ return named.ID != ""
+ })
+ page = r.get(owner, "/conversation", 200)
+ if !strings.Contains(page, "amadan agent grant equipo-test acme</code>") || !strings.Contains(page, html.EscapeString(equipo.RunnerText("chat.card.grant_how"))) {
+ t.Fatal("grant card does not name the namespace given")
+ }
+ hello.Catalog = append(hello.Catalog, wire.RepoInfo{Repo: "amadan.net/acme/other", Names: []string{"other"}, Hints: []string{}})
+ if err := r.runner.Send(r.ctx, "h-pg2", wire.FrameHello, hello); err != nil {
+ t.Fatal(err)
+ }
+ r.call("g3", wire.ToolStatus, map[string]string{})
+ if c, _ := r.client.Snapshot(r.ctx); cardState(c.Cards, named.ID) != wire.CardOpen {
+ t.Fatal("resolved by another repository in the namespace")
+ }
+ hello.Catalog = append(hello.Catalog, wire.RepoInfo{Repo: "amadan.net/acme/stardust", Names: []string{"stardust"}, Hints: []string{}})
+ if err := r.runner.Send(r.ctx, "h-pg3", wire.FrameHello, hello); err != nil {
+ t.Fatal(err)
+ }
+ r.wait("named resolved", func(c *Conversation) bool { return c.Cards[named.ID].State == wire.CardResolved })
+}
+
+func cardState(cards []wire.Card, id string) string {
+ for _, k := range cards {
+ if k.ID == id {
+ return k.State
+ }
+ }
+ return ""
}
// railOf is the sidebar of a rendered page.
diff --git a/internal/thintest/tasks_contract_test.go b/internal/thintest/tasks_contract_test.go
index 00d4aa04..cde9504a 100644
--- a/internal/thintest/tasks_contract_test.go
+++ b/internal/thintest/tasks_contract_test.go
@@ -5,7 +5,6 @@ import (
"strings"
"testing"
- "amadan.net/oficina/equipo/internal/equipo/chat"
"amadan.net/oficina/equipo/internal/wire"
)
@@ -412,14 +411,6 @@ func TestContractGrantCard(t *testing.T) {
}
}
-func TestNamespaceGuess(t *testing.T) {
- for q, want := range map[string]string{"Woodstar": "woodstar", "the Woodstar iOS app": "woodstar", "Moon Beam": "moon", "¿Qué?": "", "my app": "", "x": ""} {
- if got := chat.NamespaceGuess(q); got != want {
- t.Fatalf("NamespaceGuess(%q) = %q, want %q", q, got, want)
- }
- }
-}
-
// TestContractSyncBeforeReplay: the runner reported a failure without
// termination proof and lost the connection before the ack; on
// reconnect its sync (attempt present, termination unverified) arrives
diff --git a/internal/thintest/tools_contract_test.go b/internal/thintest/tools_contract_test.go
index 87ce928e..5851c960 100644
--- a/internal/thintest/tools_contract_test.go
+++ b/internal/thintest/tools_contract_test.go
@@ -159,9 +159,13 @@ func TestContractTools(t *testing.T) {
if found.Code != "found" || !strings.Contains(found.Text, "oficina/sample: calls itself Woodstar") {
t.Fatalf("find: %+v", found)
}
- if res := r.call("u5", wire.ToolReadFile, map[string]string{"repo": "oficina/equipo", "path": "README.md"}); !res.IsError || res.Code != "unreachable" {
+ // On the runner's list but not read yet: said so, not "unreachable".
+ if res := r.call("u5", wire.ToolReadFile, map[string]string{"repo": "oficina/equipo", "path": "README.md"}); !res.IsError || res.Code != "not_indexed" {
t.Fatalf("read outside the catalog: %+v", res)
}
+ if res := r.call("u5b", wire.ToolReadFile, map[string]string{"repo": "oficina/secret", "path": "README.md"}); !res.IsError || res.Code != "unreachable" {
+ t.Fatalf("read outside the allowlist: %+v", res)
+ }
if res := r.call("u6", wire.ToolSearchCode, map[string]string{"repo": "oficina/sample", "query": "Edge"}); res.IsError || res.Code != "read" || res.Repo != "amadan.net/oficina/sample" {
t.Fatalf("read: %+v", res)
}
diff --git a/internal/wire/frames.go b/internal/wire/frames.go
index c8a9f20f..c01dc2f2 100644
--- a/internal/wire/frames.go
+++ b/internal/wire/frames.go
@@ -328,6 +328,11 @@ type RepoInfo struct {
HeadSubject string `json:"head_subject"`
Gate string `json:"gate"`
ChecksReason string `json:"checks_reason"`
+ // Protocol 6: Empty is a repository the agent reaches that has no
+ // commits yet, so nothing to read. Its entry has the repository's
+ // name and nothing from a default branch. Encode drops such entries
+ // for an older instance, to which they were never in the catalog.
+ Empty bool `json:"empty,omitempty"`
// Protocol 2: the repository's gate calls Xcode's tools or it is an
// Xcode project (NeedsMacOS), and it has a shared scheme for the iOS
// simulator (Simulator). The instance derives checks' needs from these.
diff --git a/internal/wire/runners.go b/internal/wire/runners.go
index 1ae18b72..3a919985 100644
--- a/internal/wire/runners.go
+++ b/internal/wire/runners.go
@@ -27,6 +27,7 @@ const (
Protocol3 = 3
Protocol4 = 4
Protocol5 = 5
+ Protocol6 = 6
// ProtocolSpend is the first protocol with a fix round's Feedback and
// a usage row's Turns; Encode drops both below it.
ProtocolSpend = Protocol3
@@ -38,7 +39,12 @@ const (
// checks dispatch's offer and the report's hosted binding); Encode
// drops both below it, so the runner runs its own gate as before.
ProtocolHostedChecks = Protocol5
- ProtocolCurrent = ProtocolHostedChecks
+ // ProtocolEmptyRepos is the first protocol whose catalog lists a
+ // reachable repository with no commits yet (RepoInfo.Empty); Encode
+ // drops those entries below it, so an older instance sees the catalog
+ // it always did.
+ ProtocolEmptyRepos = Protocol6
+ ProtocolCurrent = ProtocolEmptyRepos
)
// Runner roles. A person's first runner is the primary: the coordinator,
@@ -366,7 +372,8 @@ func Speaks(protocol int, kind string) bool { return protocol >= Protocol2 || !p
var ErrProtocol = errors.New("wire: frame not in this protocol")
// Encode returns f as the given protocol speaks it. Below
-// ProtocolHostedChecks the hosted checks fields are dropped; below
+// ProtocolEmptyRepos a hello's empty repositories are dropped; below
+// ProtocolHostedChecks the hosted checks fields too; below
// ProtocolMergeFacts the merge authority fields too; below
// ProtocolSpend the spend fields too; at protocol 1 it is exactly the
// slice 4 frame and field set: protocol 2 fields are dropped and a
@@ -383,8 +390,11 @@ func Encode(f Frame, protocol int) (Frame, error) {
return Frame{}, err
}
changed := false
+ if h, ok := body.(*Hello); ok && protocol < ProtocolEmptyRepos {
+ changed = WithoutEmptyRepos(h)
+ }
if protocol < ProtocolHostedChecks {
- changed = downgradeHostedChecks(body)
+ changed = downgradeHostedChecks(body) || changed
}
if protocol < ProtocolMergeFacts {
changed = downgradeMergeFacts(body) || changed
@@ -514,3 +524,17 @@ func HelloProtocol(h Hello) int {
// Spoken is the protocol both ends speak: the lower of the runner's and
// this build's.
func Spoken(runner int) int { return max(Protocol1, min(runner, ProtocolCurrent)) }
+
+// WithoutEmptyRepos drops a hello's empty repositories from its catalog
+// (in a new slice, so the caller's catalog is untouched). The runner's
+// first hello on a connection is sent before the instance says which
+// protocol it speaks, and an older instance's strict decoder would refuse
+// it; the runner sends them once the welcome says protocol 6. It reports
+// whether any was dropped.
+func WithoutEmptyRepos(h *Hello) bool {
+ if !slices.ContainsFunc(h.Catalog, func(e RepoInfo) bool { return e.Empty }) {
+ return false
+ }
+ h.Catalog = slices.DeleteFunc(slices.Clone(h.Catalog), func(e RepoInfo) bool { return e.Empty })
+ return true
+}
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go
index ecf72828..8da0c9ca 100644
--- a/internal/wire/runners_test.go
+++ b/internal/wire/runners_test.go
@@ -286,7 +286,54 @@ func TestEncodeBelowProtocol5DropsHostedChecks(t *testing.T) {
}
}
}
- if wire.ProtocolCurrent != wire.ProtocolHostedChecks {
+}
+
+// Protocol 6 says a reachable repository is empty (no commits yet). An
+// older instance's strict decoder knows no "empty", and to it an empty
+// repository was never in the catalog: below protocol 6 its entry is
+// gone, every other entry is as it was, and a hello without one is sent
+// unchanged. WithoutEmptyRepos is the same cut, for a hello sent before
+// the instance has said which protocol it speaks.
+func TestEncodeBelowProtocol6DropsEmptyRepos(t *testing.T) {
+ full := wire.RepoInfo{Repo: "amadan.net/oficina/sample", DefaultBranch: "main", Names: []string{"sample"}, Hints: []string{}}
+ empty := wire.RepoInfo{Repo: "amadan.net/paulca/threatmin", Names: []string{"threatmin"}, Hints: []string{}, Empty: true}
+ hello := wire.Hello{Repos: []string{full.Repo, empty.Repo}, CreateIn: []string{}, Catalog: []wire.RepoInfo{full, empty}, Connections: []wire.HeldConnection{}, Protocol: wire.ProtocolCurrent}
+ f, err := wire.NewFrame("h1", wire.FrameHello, hello)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !strings.Contains(string(f.Data), `"empty":true`) {
+ t.Fatalf("the empty mark is not on the wire: %s", f.Data)
+ }
+ if same, err := wire.Encode(f, wire.ProtocolEmptyRepos); err != nil || !bytes.Equal(same.Data, f.Data) {
+ t.Fatalf("changed at protocol 6: %v", err)
+ }
+ for _, p := range []int{wire.ProtocolHostedChecks, wire.ProtocolMergeFacts, wire.ProtocolSpend, wire.Protocol2, wire.Protocol1} {
+ old, err := wire.Encode(f, p)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var h wire.Hello
+ if err := wire.Strict(old.Data, &h); err != nil {
+ t.Fatalf("protocol %d does not decode: %v", p, err)
+ }
+ if strings.Contains(string(old.Data), `"empty"`) || len(h.Catalog) != 1 || h.Catalog[0].Repo != full.Repo || len(h.Repos) != 2 {
+ t.Fatalf("protocol %d: %s", p, old.Data)
+ }
+ }
+ plain, _ := wire.NewFrame("h2", wire.FrameHello, wire.Hello{Repos: []string{full.Repo}, CreateIn: []string{}, Catalog: []wire.RepoInfo{full}, Connections: []wire.HeldConnection{}, Protocol: wire.ProtocolCurrent})
+ if old, err := wire.Encode(plain, wire.ProtocolHostedChecks); err != nil || !bytes.Equal(old.Data, plain.Data) {
+ t.Fatalf("a hello without an empty repository changed: %v", err)
+ }
+ cut := hello
+ cut.Catalog = append([]wire.RepoInfo(nil), hello.Catalog...)
+ if !wire.WithoutEmptyRepos(&cut) || len(cut.Catalog) != 1 || cut.Catalog[0].Repo != full.Repo || len(hello.Catalog) != 2 {
+ t.Fatalf("handshake cut %+v", cut.Catalog)
+ }
+ if wire.WithoutEmptyRepos(&cut) {
+ t.Fatal("a second cut reported a change")
+ }
+ if wire.ProtocolCurrent != wire.ProtocolEmptyRepos || wire.ProtocolEmptyRepos != 6 || wire.ProtocolHostedChecks != 5 {
t.Fatalf("current protocol %d", wire.ProtocolCurrent)
}
}