oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Coordinator end-to-end report
2
3Branch: `e2e-coordinator`, based on `0fa1a48`. No production writes, service
4changes, push or deployment. New interface strings are individually marked
5`// COPY REVIEW PENDING`; no copy-review server was started.
6
7## Diagnosis
8
9There is an HTTP bridge. The service calls task poll, then coordinator poll;
10task poll can hold the loop for 25 seconds. The coordinator endpoints are
11`POST /api/runner/v2/coordinator/{poll,claim,renew,tool,event,containment}`.
12Heartbeat is `POST /api/runner/v2/heartbeat`. Coordinator requests carry
13version 2 and capability `coordinator.v1`. The instance returns a fenced claim
14with the selected account, context, admission ticket and deadlines. The runner
15launches the provider, posts structured tool results and delivery events, then
16reports containment.
17
18Read-only evidence came from `carlos db query --app equipo --account oficina`.
19The replica had advanced beyond the brief's four queued rows:
20
21| Snapshot, UTC on 2026-11-06 | Evidence |
22| --- | --- |
23| 14:33:55, transaction 6000 | Binding generation 2 selects `claude-b`. Binding and runner both belong to `paul@tito.io`. Member is active at revision 1; binding member revision is 1. Connection and binding connection revisions are both 4. Neither connection nor runner is revoked. |
24| 14:34:25, transaction 6004 | Generation 1 turns are superseded. The first generation 2 turn is `waiting_connection`; later turns remain queued. Every job ID is zero and every claim is empty. This proves coordinator polling reaches the instance. |
25| 14:37:25, transaction 6025 | `claude-a` is available and confined, account `paul@tito.io`, policy `3ba26b99cbfb29041600d32d0eb4c2fa53174ff8bb8d79ad4d65180c654b53cf`. `claude-b` is unavailable and unconfined, account `paul@keymail.dev`, policy `8d121c4a565bf378c0eedaa256072a9f9e674c82b0506c5c8a88649f6cca9475`. Its report says `capability_unverified`. |
26| 14:53:48, transaction 6139 | `SELECT person,revision,limits FROM coordinator_limits` returns no rows. |
27| 14:54:58, transaction 6147 | `SELECT team_id,revision,config FROM budget_records` returns no rows. |
28| 15:17:38, transaction 6306 | Final recheck still selects unavailable `claude-b`; team-budget and coordinator-limit row counts are both zero. |
29
30The current binding cannot be claimed because its selected account is not
31certified. Switching to `claude-a` alone is insufficient: the team and personal
32coordinator budgets are both unset. Budget admission must continue to deny that
33state. The provider account's email is distinct from the authenticated runner's
34person; server ownership checks use the latter. No account substitution is
35appropriate without the person's choice.
36
37The instance also requires current roster and connection revisions, a fresh
38heartbeat, pinned identity and routing, a verified isolation tuple, a current
39binding generation, no earlier blocked turn or uncontained attempt, no task
40holding the account, and budget capacity. Claim repeats authority checks inside
41the write transaction. The production launcher separately verifies executable
42digests and the exact coordinator policy. None of these checks was removed.
43
44## Changes
45
46- Binding changes now verify selection eligibility inside the transaction before
47 cancelling or superseding existing work. An unavailable choice leaves the old
48 binding and generation intact. Settings disable unavailable choices.
49- Blocked conversation cards link to coordinator settings. Missing coordinator
50 limits link the owner to team limits, which must be set first.
51- Chat appends a pending bubble synchronously on submit, waits 500 ms before
52 showing Sending, and keeps Retry on failure. Retries reuse the original
53 idempotency key. Server HTML echoes only the viewing person's send keys;
54 reconciliation handles live feed replacement and identical message bodies.
55 Native form submission still works without JavaScript. Vendored scripts are
56 unchanged.
57- `make e2e-live` builds the actual instance and runner binaries, uses loopback
58 HTTP and a new database, signs in through the real email flow, and enrols a
59 scratch runner using the existing test-side approval helper. No test endpoint
60 or authentication bypass was added to either production binary.
61- The harness selects only dedicated `claude-a`, `paul@tito.io`, Claude 2.1.312.
62 It verifies installed binaries against the release manifest. Scratch paths
63 require an exact harness-only policy certificate; a Go build overlay embeds
64 it only in scratch binaries. The checked-in manifest and evidence are intact.
65- The final harness starts with both budgets absent, proves `budget_needed`,
66 then uses the owner team-budget and coordinator-limit forms to authorize six
67 calls. It sends two small messages through `/conversation`, waits for delivered
68 turns and checks the rendered reply and project-setup card. The unconfigured
69 repository is advertised with an empty fixture credential; no forge access
70 occurs. Each failure names its stage.
71- Five recorded request/response fixtures cover heartbeat, coordinator poll,
72 claim, post_message reply and delivery. Both the instance handler and runner
73 transport tests consume them. Recording excludes all headers and enrollment
74 traffic; the provider email, admission identifier and credential-home hash
75 are replaced with fixed fixture values.
76
77The harness reads installed tool paths and the dedicated account binding from
78`~/.local/share/equipo-runner/service.env`; `EQUIPO_E2E_ENV` can name another
79configuration. It copies only the selected binding metadata into scratch, not
80credentials. The existing dedicated home is leased through the production
81account lock. All test processes and scratch files are removed after each run.
82
83## Verification
84
85Initial failing tests and observed failures:
86
87- `CGO_ENABLED=0 go test ./internal/chatsend -count=1`
88- `EQUIPO_BROWSER_NO_JS=1 CGO_ENABLED=0 go test -tags browser ./internal/equipotest -run '^TestChatBrowser$' -count=1`
89- `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestCoordinatorRejectsUnavailableBinding$' -count=1`:
90 failed because an unavailable binding was accepted with no error. Passed after
91 transactional selection validation; the original binding remains intact.
92- `CGO_ENABLED=0 go test -tags browser ./internal/equipotest -run '^TestOptimisticChat$' -count=1`:
93 failed because there was no pending bubble before the POST completed.
94- Renaming the wire `turn_id` field to `turn_key` made both recorded-contract
95 tests fail. Restored it.
96- Removing the coordinator capability check made the instance contract test
97 fail. Restored it.
98- Changing the Sending timer from 500 ms to zero made the strengthened browser
99 test fail at its 250 ms assertion. Restored it. The first timing assertion was
100 too weak; it was strengthened after a mutation unexpectedly passed.
101- Replacing the server send key with a wrong key made reconciliation fail.
102 Restored it.
103- Removing viewer scoping made `TestRequestsStayWithViewer` expose the other
104 person's key and fail. Restored it; a database lookup error also fails closed.
105- Replacing the feed with a response captured before the POST made the browser
106 test lose the confirmed message. It now retains the last 50 confirmed sends
107 across stale live responses and passes.
108
109Passing targeted commands:
110
111- `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestCoordinator' -count=1`
112- `CGO_ENABLED=0 go test ./internal/runner/transporttest ./internal/runnerproto -run '^TestCoordinatorRecorded' -count=1`
113- `CGO_ENABLED=0 go test -tags browser ./internal/equipotest -run '^(TestOptimisticChat|TestChatBrowser)$' -count=1`
114
115The browser tests cover Enter, Shift+Enter, immediate display, delayed Sending,
116network failure, retry, a response lost after the write commits, identical text
117sent twice, live feed replacement, escaping, focus and scrolling.
118
119The final `make e2e-live` passed twice consecutively in **115.35 s and 115.18 s**.
120Both runs started without budgets, recovered through the owner forms, and
121checked the coordinator message element and the proposal's setup form in the
122rendered feed. Earlier runs caught scratch setup errors: missing budgets, an
123uncertified scratch policy and an unadvertised repository. The final HTML checks
124also prevent the person's own prompt from satisfying a reply assertion.
125
126Across eleven invocations, two failed before model dispatch, one dispatched one
127turn, and eight dispatched two each: **17 admitted coordinator turns**, below
128the authorized total of 30. Each run admitted at most two, below its six-call
129cap. No live model use occurred outside the harness.
130
131CI: the first full `make -k ci` found the brief's missing reference allowance,
132a numeric HTTP status in a contract test, and the three missing pending-copy
133inventory entries. It also hit `TestNamespaceStartingThreadExit`: `unix.Poll`
134returned `EINTR`, which the test mistook for process exit. The test helper now
135retries interrupted polling without accepting a dead process. Production
136containment code is unchanged. Build, vet, vulnerability scanning, secret
137scanning, size budgets, adapter tests, migration checks and performance passed.
138Timing notices under concurrent load included runner 358.194 s (330 s budget),
139provider 22.522 s (15 s), Claude adapter 49.642 s (45 s) and Codex adapter 41.092 s
140(35 s). No budget was raised.
141
142The one full rerun of `make -k ci` exited **0**: 36 tested packages, none failed;
143all remaining gates passed. It still reported timing overruns for runner
144355.421 s, provider 21.600 s, Claude adapter 47.512 s and Codex adapter 39.940 s.
145These are warnings locally and failures when CI enforces timing budgets. The
146controller should retain this timing caveat when assessing the branch; this
147session did not relax those limits or claim a hosted-CI pass.
148
149The post-commit secret scan identified four high-entropy fixture identifiers.
150They were replaced with fixed values, the shared contract tests were rerun,
151and the unpushed commit was amended. The final browser checks passed, including the stale-feed race and scriptless
152submission. Scratch instances, runners and browsers stopped through test
153cleanup. Task logs were removed after recording these results. The production
154service remained running; no merge, push or deployment was performed.
155
156## Controller action
157
158After reviewing and releasing this commit, Paul must explicitly choose
159`claude-a`, set the team budget in `/settings#budgets`, then set coordinator
160limits in `/settings/coordinator`. Choose real operating limits, not the
161harness's test values. Existing queued messages can then resume through normal
162polling. This session did not change those production settings or Paul's
163conversation. Copy approval remains a release step for the three marked strings.
164