Farm Agent architecture

Farm Agent architecture An architecture diagram generated by Archify. Control Plane · Farm Agent Contract v1 · Architecture component Control Plane Farm Agent Contract v1 ContractClient · Wire protocol · Zod both ways · Architecture component ContractClient Wire protocol · Zod both ways FarmAgent · Heartbeat · sync · lease loops · Architecture component · outbound HTTPS only FarmAgent Heartbeat · sync · lease loops outbound HTTPS only DeviceManager · What devices exist · Architecture component DeviceManager What devices exist JobRunner · One job · one terminal call · Architecture component JobRunner One job · one terminal call MediaManager · Download · verify · cache · Architecture component MediaManager Download · verify · cache ScenarioEngine · Login · publish, per platform · Architecture component · no coordinates ScenarioEngine Login · publish, per platform no coordinates DeviceDriver · The interface a real agent implements · Architecture component · the seam DeviceDriver The interface a real agent implements the seam SimulatedDriver · Ships today · Driver implementations — swap without touching anything above SimulatedDriver Ships today TotalControl · Android · to build · Driver implementations — swap without touching anything above TotalControl Android · to build Appium / XCUITest · iOS · to build · Driver implementations — swap without touching anything above Appium / XCUITest iOS · to build register · heartbeat · lease · report every call inventory leased job resolve assets run scenario device-agnostic steps Driver implementations — swap without touching anything above

Three independent loops

  • • Heartbeat every 20s — carries health and in-flight job ids
  • • Device sync every 30s — full inventory reconciliation
  • • Job lease every 5s — declare devices, receive fencing tokens

Every job ends once

  • • succeed · fail · needs-attention · release — exactly one
  • • A clean shutdown releases, so nothing burns an attempt
  • • A raw stack trace is never reported to the Control Plane

The driver seam

  • • Coordinates, selectors and ADB live below this line only
  • • tapAction takes a semantic name, never a screen position
  • • A challenge stops the job — there is no bypass path