Protocol v1 is the standard: its artifacts count however
they are written. OCX's tools write them, and perform runs by hand, for people
and programs, as a convenience, never a requirement. Anyone may write the same
artifacts by other means, such as a verdict with fossil tag add or a run as a
forum post, and they count exactly the same. What a run's program writes
through a tool, the tool writes in the run's own clone, which reaches the
server as the run's user; what a person writes with a tool reaches the server
as that person, through its web page when the tool runs on a clone.
The tools
createwrites arun, on the server, or on another host through the server's web page, as the user signed in; what it takes and fills in is in USAGE.md, "Write a run". It refuses, writing nothing, a run a node would refuse as written, one with a key version 1 does not define among them (protocol v1, section 15).runstarts a manual run by hand: a run whoseprocess.manualis true, which its node does not start itself (protocol v1, section 10). Only a user holding admin or setup on the server may use it. The tool has the node decide the run as started by a person; the node hands it to a watcher, which makes its workspace and sandbox as for any run and writesstartedand thenendedas its node user. If several start it at once, the first to writestartedstarts it, and each of the others is refused, writing nothing; so is anyone starting a run alreadyended.attach(not built yet) joins a person's terminal to a running process whoseprocess.terminalis true: what they type reaches its STDIN, and they see what it shows, until they leave it running (protocol v1, section 8).stopwrites astopfor a run.postwrites a plain post in reply to a post, or a change to a ticket. It refuses text holding an OCX message, so a program's posts never carry one.auditwrites a verdict:passorfail, a note, and the objective it was judged against (verdicts).receiptwrites nothing. Given the hashes of artifacts, it says of each the user the server received it from, that user's capabilities there, the number of the server's receipt and the artifact's row number, which order what the server received, or that the server has not received it; given a user, that user's capabilities there. It never says the address an artifact came from, nor anything of one its caller may not read. It answers on the server; nodes and readers on clones ask it (Fossil, senders and nodes, section 3): signed in through Fossil's login page, a POST ofuandpto/login, whose cookie signs later requests in, thenGET /ext/ocx2-cgi/receipt?json&artifacts=HASH+HASHor?json&capabilities_of=USER, answered in the JSON every tool answers in.nodeis a node on a host other than the server's, such as a build host: on that host's clone, given the server's URL and a file of passwords only its account may read (its node user's, and each run user's it may run as), it signs in to the server, pulls, and acts on the runs among what the pull brought, as the server's node acts on what its hook is given; withcheck, on every run for the node, as when it starts. Run it as often as the node should learn of new runs.statuswrites nothing: it says who and where you are, and what this node offers: the limits it enforces.
Where they are offered, and what they answer
The command line, the web page and MCP offer every tool, but the web page has
no post, since a person posts in Fossil's own forum page, and node and
attach are offered on the command line alone, on their own hosts. Each tool checks its
input before anything happens, and naming a field it does not know is refused,
except the run's own keys given to create, which it writes as they are.
Every tool takes dry_run, which checks everything and writes nothing, and
every tool answers in one shape: {"tool", "dry_run", "log", "result",
"stopped"}.
result is the tool's output, once it has run to the end:
- for
create,stop,postandaudit, the hash of what it wrote, and forcreateandstop, what this host's node did with it at once; - for
node, the artifacts its pull brought and what it did with them; - for
receipt, for each hash, its sender, their capabilities and the receipt's number, or that the server has not received it; for each user, their capabilities; - for
run, the run and what this host's node did with it; - for
status, what it says.
stopped says why it did not run to the end, naming the field at fault.
Why: Clarity (typed input, one answer shape), Loose Coupling (the same tools from every place, and none required), Demonstrability (the dry run).