Persistent daemon + thin networked client #9

Open
harry wants to merge 14 commits from feat/daemon-client-split into main

14 Commits

Author SHA1 Message Date
4051e7264b docs: mark daemon/client plan as implemented 2026-05-27 14:36:02 +01:00
63986e7e00 Fix data race on PTY master between Read and Close
pumpChild's PTY.Read raced Session.Shutdown's PTY.Close on the master
field (Close set it nil while Read read it). Benign at process exit on
main, but the daemon now runs Shutdown routinely (daemon stop). Guard
the field with a mutex, capturing the fd under the lock and doing the
blocking I/O outside it so Close still unblocks an in-flight Read.

Caught under: go test -race -run 'Daemon|NetClient|Owner' -count=5.
2026-05-27 14:35:33 +01:00
6d15626e05 add per-pane display ownership 2026-05-27 14:30:47 +01:00
63cb8a4388 add tcp daemon listener with token auth 2026-05-27 14:19:14 +01:00
5149224000 attach default client to local daemon 2026-05-27 14:09:51 +01:00
95b1967e9b Fix daemon shutdown hang and concurrent-send race
- daemon_net: close the client transport on context cancellation so the
  per-connection Recv loop unblocks; otherwise wg.Wait() in the accept loop
  hung on a still-connected client and the daemon never stopped.
- protocol: guard ConnTransport.Send with a mutex so the subscriber pump and
  command handlers can push frames concurrently without racing the bufio.Writer.

Fixes TestDaemonDetachReattachPreservesProcess (now passes under -race).
2026-05-27 13:59:47 +01:00
d07a09d64f add local daemon socket protocol 2026-05-27 13:55:38 +01:00
c56de27f44 fix scratchpad routing by caller project 2026-05-27 13:50:17 +01:00
80a14502c4 app: add loopback multi-project registry 2026-05-27 13:40:59 +01:00
08c7405c79 docs: add daemon client implementation plan 2026-05-27 13:25:59 +01:00
ec0c148164 Update PTY start call sites 2026-05-27 13:21:18 +01:00
9aecc8b7a2 Scaffold loopback daemon client split 2026-05-27 13:19:56 +01:00
e63bdad5e1 Add daemon client protocol frames 2026-05-27 13:19:42 +01:00
b72a32bbc6 Fix PTY workdir and process group teardown 2026-05-27 13:19:35 +01:00