design draft

29. Where work runs

Status: unimplemented — design draft. This chapter is a plan for the owner to edit. It ships no code yet, and paths marked planned do not exist.

Premise

Members need a computer to run on. This chapter says which one: yours, one we host, or later a Pylon. It keeps the grant and the keys with the computer's owner.

Draft

A message from your phone that says "fix this issue" needs a machine with your repository on it. The front's decision includes this: does the work need a computer? If it does, the plan names one.

The first choice is your own computer. Coder runs where the work is, with your logins and your files, under a grant you control. Your phone reaches it by pairing. The phone can ask, and the computer's owner decides what is allowed. Keys stay on the computer.

The second choice is a computer we host, for when yours is off or when you have none. Episode 276 announces that service, and Episode 280 shows the operating system built for it. A hosted computer is a sandbox that we run on our own cloud account and that keeps to the same record and grant rules.

The third choice comes in chapter 70: another person's machine, paid in Bitcoin.

The protocol already separates the pieces. One record describes a host, one says how to reach it, and others carry terminals, control and environments. So the agent does not care which kind of computer it got. It has a plan, a grant and a place to run.

Episode 167 names what this is for: an agent that keeps working overnight.

What we build

A plan for what this chapter ships once the draft is approved:

  • A computer field in the plan, chosen from the computers you have paired or rented.
  • Pairing: a phone asks, the owner's policy decides, and keys stay on the host.
  • A hosted computer as a member, with its cost shown before it starts.

It builds on what exists today:

On the protocol (chapter 65):

RecordSchemaCarriageToday
A request to a host and its replyNIP-HOST's JSON; openagents.host.v1 (`host.proto`, spec 23.3) has a different shapeNostr kind 3188 envelope, or a REACH framecoax/lib/nostr/host writes the NIP's JSON, which is the definition for coder host (compliance plan). The schema file has no product consumer
How to reach a hostopenagents.reach.v1 (`reach.proto`, spec 23.4)Frames on a direct channelSchema file; no product consumer
Terminals and environmentsopenagents.terminal.v1, openagents.environment.v1 (spec 23.5, spec 23.2)Nostr kind 3188 envelope, or a REACH frameSpec sketch; no .proto file

The chapter's check

  • Source: the computer field in openagents/agent/computers.coax, with a fake paired host and a fake hosted computer, and the clock controlled.
  • Trace: a phone asks the paired computer to fix an issue. The owner's policy allows it, and the plan names that computer. With the computer off, the plan names a hosted computer and shows its cost before it starts.
  • Refusal: a phone that asks for more than the owner's policy allows is refused by the host, with a reason that names the policy. Nothing runs, and the phone's record holds no key material.
  • Independent check: the host request JSON is checked by hand against NIP-HOST's examples. The hosted cost shown equals the rate times the controlled clock's run time, worked by hand.

Planned paths: openagents/agent/computers.coax.

Sources

Open questions for the owner

  1. Does 1.0 offer hosted computers to everyone, and at what price? Episode 276 named one dollar an hour at the time.
  2. How does hosted compute fit inside the monthly cloud budget as use grows?