| 1 | # Brief: real end-to-end coordinator path, and why turns are never claimed |
| 2 | |
| 3 | Branch `e2e-coordinator` from main 0fa1a48 (DEPLOYED). Paul's messages now |
| 4 | create coordinator turns (instance DB `coordinator_turns`: four rows, all |
| 5 | `state=queued`, `job_id=0`, empty `claim`; binding auto-bound to claude-a, |
| 6 | later switched by Paul to claude-b). The docs-t1 runner (unit |
| 7 | equipo-runner.service, service.env, release 0fa1a48) is online, |
| 8 | heartbeats, reports claude-a Available=1 (claude-b unavailable: certs |
| 9 | are per account), but never claims a coordinator turn. Each half is |
| 10 | tested with fakes; the bridge has never run for real. Paul (2026-11-06): |
| 11 | "It feels like maybe there's a websocket or protocol or connector bridge |
| 12 | missing that needs its own set of unit tests here." He is right; stop |
| 13 | discovering this through him. |
| 14 | |
| 15 | Deliver: |
| 16 | 1. Diagnose the claim gap with evidence: what the runner polls for, what |
| 17 | the instance offers, the conditions for a coordinator turn to be |
| 18 | claimable (binding/connection/selection/certification/person/runner |
| 19 | ownership — note the runner belongs to paul@tito.io and the binding |
| 20 | to claude-b now), and why none is satisfied. Read-only instance DB via |
| 21 | `carlos db query --app equipo --account oficina`. |
| 22 | 2. A REAL local end-to-end harness, `make e2e-live` (opt-in, never in |
| 23 | default CI): starts the actual instance binary on 127.0.0.1 with a |
| 24 | scratch DB and EQUIPO_EXECUTION_ENABLED, a test team/person, enrols a |
| 25 | scratch runner against it (no device-code human step: use the test |
| 26 | seam the enrolment tests use, never in production builds), uses the |
| 27 | pinned Claude 2.1.312 and ONE dedicated home (claude-a, paul@tito.io) |
| 28 | through the production launcher, sends a coordinator message through |
| 29 | the same HTTP/form path the browser uses, and waits for a coordinator |
| 30 | reply in the feed; also proves the propose_project card appears when |
| 31 | asked about an unknown repo. Fails with the exact stage that broke. |
| 32 | Small prompts; budget per run <= 6 model turns. Certification of the |
| 33 | policy is required as in production (use the release manifest; if a |
| 34 | test-only certificate is needed, generate it only in the harness). |
| 35 | 3. Contract tests at the instance<->runner boundary for the coordinator |
| 36 | path: recorded request/response fixtures shared by both sides |
| 37 | (poll/claim/heartbeat/turn delivery/reply), so either side drifting |
| 38 | fails CI. |
| 39 | 4. Fix the claim gap (and anything else the harness finds) until |
| 40 | `make e2e-live` passes twice in a row. |
| 41 | 5. Optimistic send (Paul): the sent message appears in the feed the |
| 42 | instant Enter is pressed (client-side pending bubble), reconciled |
| 43 | with the server copy; show a subtle sending state only if the post |
| 44 | takes >500 ms; on failure the bubble shows retry. Test it. |
| 45 | AUTHORISATION: live model use only via the harness on claude-a, <= 30 |
| 46 | turns total; do not touch the production instance data or Paul's |
| 47 | conversation; do not stop the docs-t1 runner service. New strings |
| 48 | `// COPY REVIEW PENDING`. Targeted tests, ONE full `make -k ci` (rerun at |
| 49 | most twice). Commit subject < 80, body `Co-Authored-By: Astra |
| 50 | <noreply@openai.com>`; commit only, the controller pushes. |
| 51 | CONTROLLER-REPORT-e2e-coordinator.md. Loopback only; stop servers; |
| 52 | scratch removed; no copy-review server. Print a five-line summary. |
| 53 | |