Skip to content

v0.33.0 — sessions that outlive your terminal

Choose a tag to compare

@ralyodio ralyodio released this 09 Aug 18:23
eb73884

Sessions that outlive your terminal, and Moshpit names that a stock client will finally accept.

herd — the pit stops being a one-thing-at-a-time shell

moshcode start claude -d      # runs detached, hands the prompt straight back

/ps shows what is running and what state each session is in, /attach steps into one, and detaching leaves it running.

Two substrates behind one interface, because "requires tmux" was the wart worth removing rather than documenting:

tmux a single named server (socket moshcode). Full fidelity — resizing, scrollback, native attach.
pty no tmux: script(1) allocates the pty and the child is detached with its stdin on a FIFO held O_RDWR, so it never sees EOF when the pit exits. Attach replays the transcript and relays keystrokes.
none foreground passthrough, exactly as before — said once rather than implied.

Sessions carry semantic state — working / blocked / done / idle / unknown — under one rule: each session has exactly one authority. A live hook report suppresses screen classification entirely, and expires, so a crashed agent cannot read working forever. Screen rules ship beside each engine's install spec, are anchored to what a terminal actually draws rather than to English words, and are overridable in ~/.moshcode/herd/rules.json when they rot.

A blocked session can page you through the existing notify/ask fan-out, with your reply typed back into the session that was waiting. Only transitions notify, so a session sitting blocked does not page every five seconds.

One surface for humans and agents: every verb takes --json, wait exits 0/2/3 so scripts can branch, and moshscript gets herdStart / herdPrompt / herdWait / herdRead / herdList / herdKill as values rather than exit codes.

Moshpit names now verify in curl, without flags

Two independent reasons they did not.

dns enable never turned proxy mode on. Everything else existed — moshpit-proxy checks an origin against the registry pin and re-signs with a root this machine generated, dns enable installs that root, and the resolver knew how to point names at it. Nothing ever connected them, so names resolved straight to their origin and a stock client got a certificate no CA had signed. Trust was being installed for a proxy that was never on the path. dns enable now probes for the proxy and starts the bridge in proxy mode when it finds one; --no-proxy opts out.

The probe is a TLS handshake, not a connect, and that distinction is the whole safety of it. "Is something listening on 443" is answered yes by the nginx on any origin box — and proxy mode would then point every live Moshpit name on the machine at a web server that has never heard of them. So the probe completes a handshake and checks who issued the certificate. Nothing is trusted in the process: the peer certificate is read, not verified, and only the issuer name is taken from it. Every uncertain case refuses, because proxy mode with nothing behind it resolves every name and then refuses every connection — which looks like the sites are down while dig stays healthy.

dns trust would install a certificate authority as a trust anchor. It installed whatever the socket served, given a matching registry pin. But a pin proves the registry vouches for that key; it says nothing about whether trusting it is bounded. A certificate marked CA:TRUE may issue for any name — its SAN describes what it speaks for, not what it may sign — so trusting one to reach seo.rank also handed its holder google.com. It went unnoticed because openssl's req -x509 defaults to CA:TRUE, which made every origin serve exactly the shape that must be refused, indistinguishable from a correct one until someone trusted it.

Now refused, with the remedy printed rather than a dead end — re-issuing from the same key leaves the published pin untouched, so the fix costs no registry change and breaks no client holding the old pin.

Pairs with profullstack/moshpit-proxy#18 and #19, which fix what origins issue and make an already-deployed box repair itself.

Upgrading

moshcode upgrade