| 1 | # Connection availability |
| 2 | |
| 3 | The relocation fix passes the local fake CLI flow and the production no-turn |
| 4 | preflight. Deployment and instance receipt of the new heartbeat are pending the |
| 5 | controller. No deployment, push, merge or message as Paul was performed. |
| 6 | |
| 7 | ## Root cause |
| 8 | |
| 9 | The read-only instance query returned both unavailable reports from transaction |
| 10 | 5152, written 2026-11-06 12:32:22 UTC. The unit was active on release 8989033. |
| 11 | `claude-a` reported `f415d19a3841596750d28113f2217f380e0955b4fb8fd4dc9a9ef1052f66fac4`. |
| 12 | `claude-b` reported `9b5b1e544a1fd642682a8911ec3d1fe696b6356c438c012e5d3706874340199f`. |
| 13 | These were constructed implement-policy hashes, not the fallback binding hashes. |
| 14 | All five installed binary digests passed `VerifyInstalled`. |
| 15 | |
| 16 | `discoverNamespaces` constructed only the implement policy. It required both |
| 17 | installed binary verification and an exact implement certificate before running |
| 18 | the CLI preflight. A failed certificate comparison left the default |
| 19 | `capability_unverified` reason. The account/version probe and dependency probe |
| 20 | therefore never ran. There is no missing startup registration or additional |
| 21 | model capability trial to perform. |
| 22 | |
| 23 | `policyTemplate` retains runtime binary source paths as well as their digests. |
| 24 | The live gate used these two source paths: |
| 25 | |
| 26 | - `/home/paulca/.local/share/equipo/try/bin/claude` |
| 27 | - `/home/paulca/.local/share/equipo/try/bin/equipo-tool-proxy` |
| 28 | |
| 29 | The enrolled service used the same bytes at these paths: |
| 30 | |
| 31 | - `/home/paulca/.local/share/claude/versions/2.1.312` |
| 32 | - `/home/paulca/.local/share/equipo-runner/releases/8989033/equipo-tool-proxy` |
| 33 | |
| 34 | A temporary diagnostic called the production policy constructor on only the |
| 35 | `paul@tito.io` binding. With the service paths it reproduced the reported hash. |
| 36 | Changing just those two executable paths to the gate paths reproduced all three |
| 37 | existing certificates exactly: |
| 38 | |
| 39 | | Action | Certified hash | |
| 40 | |---|---| |
| 41 | | implement | `07f4d97e1629d285c30411766ba75135ad7adb599fd8e50321d781e5b88c7e54` | |
| 42 | | review | `19832014cb5aa65fb42d2cd29661d336752b7ad58efef7a8fc4a4e42ee6ed269` | |
| 43 | | coordinate | `3ba26b99cbfb29041600d32d0eb4c2fa53174ff8bb8d79ad4d65180c654b53cf` | |
| 44 | |
| 45 | The second binding belongs to `paul@keymail.dev`. These certificates bind the |
| 46 | first account and home. Relocation does not make the second account certified. |
| 47 | |
| 48 | ## Change |
| 49 | |
| 50 | The release manifest records the two live-gate paths as `policy_source` metadata |
| 51 | on the existing binary entries. Certificate comparison can substitute those |
| 52 | source paths for read-only executable mounts. Digests, mount targets, access |
| 53 | modes, account identity, home, model, settings, denied paths, tools and versions |
| 54 | remain in the comparison. The original concrete manifest and policy hash remain |
| 55 | unchanged and continue to protect launch attestation and source validation. |
| 56 | Neither evidence artifacts nor certified hashes were rewritten. |
| 57 | |
| 58 | Discovery now tries certified actions, preferring coordinate, instead of |
| 59 | requiring implement. Only a matching certificate followed by a successful |
| 60 | preflight makes a connection available. It reports the matching certified tuple |
| 61 | so the instance can verify isolation. Specialist and coordinator launch guards |
| 62 | use the same relocation-aware comparison and still require installed pins and |
| 63 | confined selection. Every launch still checks its own action; availability does |
| 64 | not certify an uncertified action. |
| 65 | |
| 66 | The CLI preflight checks the account/version and dependency startup without a |
| 67 | model turn. Its successful result is cached by binding, credential-generation |
| 68 | fingerprint and actual policy hash. Construction and certificate checks still |
| 69 | run on each discovery. Changed credentials require another preflight. |
| 70 | |
| 71 | The report-selection code lives in the existing certified package. New discovery |
| 72 | tests have their own package to stay inside source and test budgets. The existing |
| 73 | fake coordinator launcher was moved unchanged into a reusable fixture file. No |
| 74 | budget was raised. No application copy or README changed. The controller report |
| 75 | is an agent handoff; no copy-review server was started. |
| 76 | |
| 77 | Future certificates must record the binary source paths used by their own live |
| 78 | gate if their binaries will move. These optional paths describe the original |
| 79 | certificate; they are not installation paths or a mechanism to certify new |
| 80 | accounts. Other changes to the exact policy still require certification. |
| 81 | |
| 82 | ## Verification |
| 83 | |
| 84 | Go commands use `CGO_ENABLED=0`; the full gate pins Go 1.26.10. Go caches stayed |
| 85 | at their defaults. Scratch was under the existing on-disk `$TMPDIR`. |
| 86 | |
| 87 | 1. Before the relocation implementation, `go test ./internal/runner/provider |
| 88 | -run '^TestPolicyBinaryRelocation$' -count=1` failed with |
| 89 | `identical relocated binary lost certification`. |
| 90 | 2. The final targeted run covers `TestPolicyBinaryRelocation`, |
| 91 | `TestConnectionAvailableGuards`, `TestConnectionAvailableCoordinatorFakeCLI`, |
| 92 | `TestDirectClaimRevalidates`, `TestRuntimeMountsStandaloneToolProxy` and |
| 93 | `TestCoordinatorSessionProductionWiring`. All passed. |
| 94 | 3. `TestConnectionAvailableCoordinatorFakeCLI` uses a synthetic certificate and |
| 95 | actual local CLI subprocesses. It exercises account preflight, relocated |
| 96 | policy comparison, HTTP heartbeat, instance isolation verification, automatic |
| 97 | binding, admitted coordinator claim, runner journal, tool proxy, reply and |
| 98 | delivered turn. The adapter and namespace containment are simulated; this is |
| 99 | not live isolation evidence. |
| 100 | 4. The discovery guards cover coordinator-only and review-only certificates, |
| 101 | absent certificates, wrong actions, another binding, changed binary bytes, |
| 102 | failed installed verification, failed account preflight, sign-in maintenance |
| 103 | and failed cleanup. Provider tests also cover settings, denied paths, targets, |
| 104 | writable mounts, manifest integrity, policy-hash integrity and invalid paths. |
| 105 | 5. Mutation checks removed relocation, concrete manifest validation, policy hash |
| 106 | validation, installed verification, preflight, exact action/hash matching and |
| 107 | support for coordinator-only discovery. Each targeted test failed at its |
| 108 | assertion. All mutations were restored. The first cleanup mutation contained |
| 109 | a substitution typo and failed compilation; a corrected cleanup mutation is |
| 110 | recorded in the final results below. |
| 111 | |
| 112 | The mutation commands were `go test ./internal/runner/provider -run |
| 113 | '^TestPolicyBinaryRelocation$' -count=1`, its `manifest` and `hash` subtests, |
| 114 | and the `uninstalled`, `preflight`, `cleanup`, `wrong-action` discovery subtests |
| 115 | plus `TestConnectionAvailableCoordinatorFakeCLI`. Discovery tests initially lived |
| 116 | in `internal/plan3test`; their final location is |
| 117 | `internal/runner/certified/discoverytest`. |
| 118 | |
| 119 | ### Production preflight |
| 120 | |
| 121 | The unit was stopped briefly and restarted in a `finally` block. An initial |
| 122 | test-binary diagnostic was refused because containment requires its runner path |
| 123 | to identify the current executable. No provider was launched by that attempt. |
| 124 | A scratch build of the real command then ran `preflight` with the service's |
| 125 | configuration and exited 0. It reported: |
| 126 | |
| 127 | ```json |
| 128 | { |
| 129 | "LocalID": "claude-a", |
| 130 | "Available": true, |
| 131 | "ReadIsolation": true, |
| 132 | "UnavailableReason": "", |
| 133 | "IsolationConfigHash": "3ba26b99cbfb29041600d32d0eb4c2fa53174ff8bb8d79ad4d65180c654b53cf", |
| 134 | "ObservedAccountID": "paul@tito.io" |
| 135 | } |
| 136 | ``` |
| 137 | |
| 138 | `claude-b` remained unavailable with `capability_unverified`; its CLI was not |
| 139 | launched. No model turns were used, against the authorized ceiling of 15. No |
| 140 | credential file contents were inspected or printed by the diagnostic harness; |
| 141 | the production account code performed its normal staging and validation. |
| 142 | |
| 143 | This foreground preflight does not send a heartbeat. It proves that the updated |
| 144 | runner can produce the report, not that the deployed instance has received it. |
| 145 | The original unit was active again on release 8989033 after the check. |
| 146 | |
| 147 | ## Controller deployment and receipt check |
| 148 | |
| 149 | Run these steps only after the controller has reviewed, pushed and integrated |
| 150 | the commit. This agent has not run them. Keep the existing enrollment and account |
| 151 | bindings. Re-enrollment is unnecessary. |
| 152 | |
| 153 | 1. In the clean integrated checkout, load the existing service configuration and |
| 154 | build the versioned release: |
| 155 | |
| 156 | ```sh |
| 157 | set -a |
| 158 | . "$HOME/.local/share/equipo-runner/service.env" |
| 159 | set +a |
| 160 | make release |
| 161 | connection_version=$(git rev-parse --short HEAD) |
| 162 | carlos deploy --app equipo --account oficina --channel edge --timeout 5m \ |
| 163 | "releases/equipo-linux-arm64-$connection_version" |
| 164 | ``` |
| 165 | |
| 166 | 2. Update the local runner to the same version. The following script preserves |
| 167 | the existing environment and unit except for their executable paths: |
| 168 | |
| 169 | ```sh |
| 170 | export connection_version |
| 171 | python3 - <<'PY' |
| 172 | import os, pathlib, shutil, subprocess |
| 173 | version = os.environ['connection_version'] |
| 174 | home = pathlib.Path.home() |
| 175 | root = home / '.local/share/equipo-runner' |
| 176 | source = pathlib.Path('releases') / ('equipo-runner-linux-amd64-' + version) |
| 177 | destination = root / 'releases' / version |
| 178 | unit = home / '.config/systemd/user/equipo-runner.service' |
| 179 | env = root / 'service.env' |
| 180 | old_unit, old_env = unit.read_text(), env.read_text() |
| 181 | assert sum(x.startswith('ExecStart=') for x in old_unit.splitlines()) == 1 |
| 182 | assert sum(x.startswith('EQUIPO_TOOL_PROXY_PATH=') for x in old_env.splitlines()) == 1 |
| 183 | subprocess.run(['systemctl', '--user', 'stop', 'equipo-runner.service'], check=True) |
| 184 | try: |
| 185 | destination.mkdir(mode=0o700, exist_ok=False) |
| 186 | for name in ('equipo-runner', 'equipo-tool-proxy', 'install-manifest.json'): |
| 187 | shutil.copy2(source / name, destination / name) |
| 188 | unit.write_text('\n'.join( |
| 189 | 'ExecStart=' + str(destination / 'equipo-runner') + ' run' |
| 190 | if x.startswith('ExecStart=') else x for x in old_unit.splitlines()) + '\n') |
| 191 | env.write_text('\n'.join( |
| 192 | 'EQUIPO_TOOL_PROXY_PATH="' + str(destination / 'equipo-tool-proxy') + '"' |
| 193 | if x.startswith('EQUIPO_TOOL_PROXY_PATH=') else x for x in old_env.splitlines()) + '\n') |
| 194 | subprocess.run(['systemctl', '--user', 'daemon-reload'], check=True) |
| 195 | except BaseException: |
| 196 | unit.write_text(old_unit) |
| 197 | env.write_text(old_env) |
| 198 | subprocess.run(['systemctl', '--user', 'daemon-reload'], check=True) |
| 199 | raise |
| 200 | finally: |
| 201 | subprocess.run(['systemctl', '--user', 'start', 'equipo-runner.service'], check=True) |
| 202 | PY |
| 203 | systemctl --user is-active equipo-runner.service |
| 204 | ``` |
| 205 | |
| 206 | 3. After the next heartbeat, query the read-only replica. Confirm its snapshot |
| 207 | and `last_seen` are newer than the runner update. Repeat if the replica lags. |
| 208 | |
| 209 | ```sh |
| 210 | carlos db query --app equipo --account oficina --sql " |
| 211 | SELECT local_id, last_seen, |
| 212 | json_extract(reports_json, '\$[0].Available') AS available, |
| 213 | json_extract(reports_json, '\$[0].ReadIsolation') AS read_isolation, |
| 214 | json_extract(reports_json, '\$[0].UnavailableReason') AS reason, |
| 215 | json_extract(reports_json, '\$[0].IsolationConfigHash') AS policy_hash |
| 216 | FROM connections ORDER BY local_id" |
| 217 | ``` |
| 218 | |
| 219 | For `claude-a`, require `available=1`, `read_isolation=1`, an empty reason and |
| 220 | the coordinator hash printed above. `claude-b` must remain unavailable. |
| 221 | Save this output as the missing deployed receipt evidence. |
| 222 | |
| 223 | 4. Paul sends a new message himself. Do not send or retry one as Paul. Verify |
| 224 | the coordinator binds to `claude-a` and its new turn reaches `delivered`: |
| 225 | |
| 226 | ```sh |
| 227 | carlos db query --app equipo --account oficina --sql " |
| 228 | SELECT b.id, b.person, c.local_id, b.generation |
| 229 | FROM coordinator_bindings b JOIN connections c ON c.id=b.connection_id" |
| 230 | carlos db query --app equipo --account oficina --sql " |
| 231 | SELECT id, message_id, state FROM coordinator_turns ORDER BY rowid DESC LIMIT 5" |
| 232 | ``` |
| 233 | |
| 234 | An existing finished setup note is not a queued request. The fresh message |
| 235 | supplies the request for this check. Record the turn ID and final state. |
| 236 | |
| 237 | ## Final gate and handoff |
| 238 | |
| 239 | The first `make -k ci` exited 2. It found six unclassified references: five |
| 240 | already in the controller brief and one in the new regression test. The same |
| 241 | inventory failure caused `TestDirectDeadReferencesRepository` to fail. Staticcheck |
| 242 | also required `http.StatusConflict` instead of literal 409 in the new fixture. |
| 243 | Both issues were corrected. All other test assertions passed: 34 packages ran, |
| 244 | one failed on that inventory check. Adapter, namespace and migration checks |
| 245 | passed. Performance passed, including a cold boot median of 116ms against 500ms. |
| 246 | |
| 247 | Local timing warnings were runner 352.369s/330s, provider 21.388s/15s, Claude |
| 248 | adapter 46.973s/45s and Codex adapter 39.399s/35s. These would fail their budgets |
| 249 | in CI mode. No timing allowance was changed. |
| 250 | |
| 251 | The corrected cleanup mutation failed at `cleanup failure hidden <nil>`. |
| 252 | Restoring the guard made the final targeted tests pass: provider 0.309s, |
| 253 | discovery 6.027s and the existing coordinator HTTP acceptance test 4.225s. |
| 254 | `make copy-release-check direct-release-check` also passed with the installed |
| 255 | binary paths. The existing evidence remains byte-identical. |
| 256 | |
| 257 | The first permitted full `make -k ci` rerun exited 0. All 35 test packages |
| 258 | passed, with no cached packages and eight packages without tests. The test phase |
| 259 | took 362.191s. Build, vet, formatting, staticcheck, vulnerability scanning, |
| 260 | secret scanning, reference inventory, size budgets, adapter, namespace, |
| 261 | migration and performance checks passed. Cold boot median was 121ms against |
| 262 | 500ms. Total full gate runs: two; no second rerun was needed. |
| 263 | |
| 264 | The rerun retained local timing warnings: runner 360.185s/330s, provider |
| 265 | 21.488s/15s, Claude adapter 47.208s/45s and Codex adapter 39.783s/35s. Exit 0 |
| 266 | establishes the local gate result, not CI-mode timing compliance. |
| 267 | |
| 268 | A second read-only instance query, transaction 5291 written at |
| 269 | 2026-11-06 12:52:12 UTC, returned no coordinator bindings. The controller can |
| 270 | therefore test initial automatic binding with Paul's next message after the |
| 271 | update. Receipt of an available heartbeat and a delivered production turn |
| 272 | remain pending deployment; neither is claimed here. |
| 273 | |
| 274 | Task scratch and diagnostic sources were removed. No task server or background |
| 275 | process remains. The existing unit is active on release 8989033, as requested. |
| 276 | The changes and this report are committed on `connection-available`; the |
| 277 | controller owns push, integration and deployment. The workspace is safe to close. |
| 278 | |