DEV Community

chovy
chovy

Posted on Originally published at dev.profullstack.com

OpenFleet ships: logicsrc fleet, moshcode 0.99.0, and a Claude Code hook

This morning we published OpenFleet, the record an agent session carries about who spawned it and which human answers for it. The spec said what three tools would each have to add. By the afternoon all three do.

logicsrc fleet

@logicsrc/openfleet 0.1.0 is the record and ledger library, and logicsrc fleet (CLI 0.3.0) is the sysop tool the spec names. Five verbs: open and cap belong to the human and are refused with exit 4 from any process that carries a member id; tree folds the ledger and the records into one tree and joins the engine rosters for liveness; stop ends a member, a swarm or a whole fleet through each member's own engine; log says what happened and who did it. tree also enforces the ceiling's deadline and budget.

$ logicsrc fleet tree
anthony@dev  (implicit fleet, sysop anthony@dev, depth 1, hosts dev)
└─ swarm create-two-shell-script-1020  "create two shell scripts"  2/2 members  done
   ├─ create-two-shell-script-1020-1  create hello.sh bash  moshcode/claude  done  [bypass]  owns hello.sh
   └─ create-two-shell-script-1020-2  create bye.sh bash    moshcode/claude  done  [bypass]  owns bye.sh
Enter fullscreen mode Exit fullscreen mode

That tree was written by moshcode and read by logicsrc. Nothing on either side knows the other exists; the files are the contract.

moshcode 0.99.0

moshcode swarm now mints a swarm id before it plans, writes one record per pane, names the pane after its member id, and passes the five OPENFLEET_* variables into the pane beside the herd variables. The planner is asked which files each piece may write, and that answer becomes data on the record instead of a sentence in a prompt. The ledger gets swarm.spawn before the first pane starts, member.start when a prompt goes in, member.end for every pane, and one swarm.end with the synthesis and the verify verdicts. A swarm that would exceed the ceiling it inherited is refused before anything starts, and moshcode fleet offers the same five verbs over the same files.

Claude Code, through hooks

Claude Code is not ours to patch, but its hooks run in every session. logicsrc fleet hooks install adds five entries to your settings without touching anyone else's. On SessionStart the hook claims the record named in the environment, or writes a root record when there is none, and tells the model its member id and its piece. On the first prompt it writes member.start with the session's real permission mode, or refuses the prompt when the ceiling says no. On every Edit or Write it denies a path outside the member's owned files. On Stop and SessionEnd it writes member.end with the summary.

We proved it with a real session: a hand-written unclaimed record, a claude -p that inherited it, all five variables visible to its Bash tool, a write to other.txt denied and a write to ok.txt allowed, and a member.end line carrying the model's final message.

Two limits came out of the probing and are now in the spec. A background job dispatched from claude agents receives no launcher environment, so it is a root member unless a launcher writes its record first. And env-file exports reach a session's tools but not its later hooks, so the hooks key on the session id through a small file of their own.

Install: curl -fsSL https://logicsrc.com/install.sh | sh then logicsrc fleet hooks install; moshcode upgrade for the swarm side.

Top comments (0)