mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* feat(relay): director edge override for moving hosts to the relay edge (dark by default) Directors with ORCA_RELAY_EDGE_CELL_URL seed an existing-only 'edge' cell (registered with the admission selector so deploy workflows carry it) and answer a host cohort (hash bucket, allow/deny lists, region scope) on the edge before the reserve and database lanes. The epoch rises only on a cell change; a host still holding units on its old cell is told to retry. Phone resolve and the invite move answer edge rows without moving anything; old cells answer WRONG_CELL to phones of moved hosts. Unset URL keeps today's behaviour. * feat(relay): director pushes host data to the relay edge on a move and takes it back before any move away With ORCA_RELAY_EDGE_ADMIN_SIGNING_KEY set (its own key, never the assignment lease key), a move onto the edge pushes the host's relay_devices and a location hint under the row lock and commits only after the edge accepts; an edge holding a newer epoch is re-minted above once. Before any lane may re-place an edge row, the director exports (refused while the desktop is connected; the edge freezes the host), replaces the host's Postgres devices, places it as today, then fences the edge with the new cell and epoch. Idle regional rehome skips edge rows. Unset key: unchanged. * fix(relay): a deferred edge move keeps the host on today's path instead of a 503 loop A host still holding old-cell units (a pairing invite holds one for its 10 min TTL) or whose push the edge did not take now stays where it is and moves on a later ask. 503 stays for a held row lock and for a desktop still connected to the edge on the way out. * relay: director refuses an edge URL without the edge admin key The deployed edge keeps host data in its objects; without the key the director could not push it and hosts would land on an edge holding none of their devices. * relay: edge cohort by account (ORCA_RELAY_EDGE_ALLOW_USERS) Every host of a listed account (relay token sub) joins the edge cohort, in any region; a denied host still stays off. For the team's own accounts before any share rollout. * relay: edge modules follow main's relay module moves * relay: satisfy the changed-lines lint gate in the edge cohort code Braces on every if, T[] arrays, type aliases, one ternary, and a justified max-lines header on edge-relay.ts. No behaviour change: relay unit 845 passed. * relay: move edge cohort config and row helpers to edge-relay-cohort.ts Keeps edge-relay.ts under the 300-line limit without a max-lines disable. Code moved verbatim; edge-relay.ts re-exports what other modules import. Relay unit 845 passed.