feat(maestro): add a process-compose dev stack #52

Merged
naps62-yolo merged 3 commits from dev-stack into main 2026-08-23 10:02:09 +01:00
Collaborator

Replaces #38. nix run .#dev (or just dev) brings up the whole local stack under process-compose: build, then a daemon on 127.0.0.1:7071, then Vite on :5173 once the daemon answers /api/info. Ordering and readiness are declared instead of polled with /dev/tcp in bash.

The dev daemon binds :7071 and keeps its tmux socket under .dev/tmux, so it never collides with a real daemon on the same host and its sessions cannot be listed or killed alongside real ones.

Also fixes a daemon bug this surfaced: Tmux::cmd set TMUX_TMPDIR but left an inherited TMUX in place, and tmux resolves TMUX first. A daemon started from inside a tmux pane therefore ignored its configured tmux_tmpdir entirely and drove the developer's own server. Separate commit, two tests, both verified to fail against the old code.

.envrc (use flake) is written but not committed — your global gitignore excludes it. git add -f .envrc if you want it in the repo.

Verified against a running stack
daemon  API listening addr=127.0.0.1:7071
web     VITE ready, Network: http://10.7.10.2:5173/

curl :5173/api/info          -> daemon's DaemonInfo (proxy reaches :7071)
POST  :5173/api/sessions     -> 201, session created
GET   :5173/api/attach/<id>  -> HTTP/1.1 101 Switching Protocols

tmux isolation, real server session count unchanged across a dev spawn:

real sessions before: 31
dev tmux server: maestro-409fce13-3e3c-4cf9-8c5f-7cb36bfab317: 1 windows
real sessions after:  31

Ctrl-C leaves no daemon, no vite, and both ports free.

Also ran cargo fmt, cargo clippy --all-targets -- -D warnings, cargo test --all, and nixfmt on the flake.

Two things worth knowing about process-compose, both of which bit during this: it expands nothing in environment, so $PWD and ${RUST_LOG:-...} have to go on the command; and its control server defaults to :8080, which collided here, so it is turned off.

Replaces #38. `nix run .#dev` (or `just dev`) brings up the whole local stack under process-compose: build, then a daemon on 127.0.0.1:7071, then Vite on :5173 once the daemon answers `/api/info`. Ordering and readiness are declared instead of polled with `/dev/tcp` in bash. The dev daemon binds :7071 and keeps its tmux socket under `.dev/tmux`, so it never collides with a real daemon on the same host and its sessions cannot be listed or killed alongside real ones. Also fixes a daemon bug this surfaced: `Tmux::cmd` set `TMUX_TMPDIR` but left an inherited `TMUX` in place, and tmux resolves `TMUX` first. A daemon started from inside a tmux pane therefore ignored its configured `tmux_tmpdir` entirely and drove the developer's own server. Separate commit, two tests, both verified to fail against the old code. `.envrc` (`use flake`) is written but not committed — your global gitignore excludes it. `git add -f .envrc` if you want it in the repo. <details> <summary>Verified against a running stack</summary> ``` daemon API listening addr=127.0.0.1:7071 web VITE ready, Network: http://10.7.10.2:5173/ curl :5173/api/info -> daemon's DaemonInfo (proxy reaches :7071) POST :5173/api/sessions -> 201, session created GET :5173/api/attach/<id> -> HTTP/1.1 101 Switching Protocols ``` tmux isolation, real server session count unchanged across a dev spawn: ``` real sessions before: 31 dev tmux server: maestro-409fce13-3e3c-4cf9-8c5f-7cb36bfab317: 1 windows real sessions after: 31 ``` Ctrl-C leaves no daemon, no vite, and both ports free. Also ran `cargo fmt`, `cargo clippy --all-targets -- -D warnings`, `cargo test --all`, and `nixfmt` on the flake. </details> Two things worth knowing about process-compose, both of which bit during this: it expands nothing in `environment`, so `$PWD` and `${RUST_LOG:-...}` have to go on the `command`; and its control server defaults to :8080, which collided here, so it is turned off.
naps62-yolo added 2 commits 2026-08-22 19:46:03 +01:00
A daemon started from inside a tmux pane inherits `TMUX`, which tmux
resolves ahead of `TMUX_TMPDIR`. The configured `[daemon].tmux_tmpdir`
was therefore ignored and the daemon drove the developer's own server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
feat(maestro): add a process-compose dev stack
ci / web (pull_request) Successful in 1m23s
ci / rust (pull_request) Successful in 5m10s
8f17dc0816
`nix run .#dev` (or `just dev`) builds the binary, starts a daemon on
127.0.0.1:7071, and starts Vite on :5173 once the daemon answers
`/api/info`. Ordering and readiness are declared rather than polled.

The daemon binds :7071 and keeps its tmux socket under `.dev/tmux` so
the stack never collides with a real daemon on the same host.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@@ -61,4 +61,4 @@
```
See `docs/INSTALL.md` for end-user install instructions.
Author
Collaborator

devDaemonPort configures this stack to bind the daemon on 127.0.0.1:7071, but this new guidance says 7070. Update it (and the stale nearby flake comments) so direct access and troubleshooting point at the service that actually starts.

`devDaemonPort` configures this stack to bind the daemon on 127.0.0.1:7071, but this new guidance says 7070. Update it (and the stale nearby flake comments) so direct access and troubleshooting point at the service that actually starts. <!-- agent-meta: {"model":"gpt-5.6","session":"4b0ed71a"} -->
naps62-yolo marked this conversation as resolved
naps62-yolo added 1 commit 2026-08-22 19:50:40 +01:00
docs(maestro): point dev-stack docs at 127.0.0.1:7071
ci / web (pull_request) Successful in 38s
ci / rust (pull_request) Successful in 4m54s
24054eb26f
The dev stack binds devDaemonPort (7071), not the daemon's own default
7070. CLAUDE.md, the Justfile recipe comment and the flake header comment
all still said 7070.
Author
Collaborator

Fixed in 24054eb. The dev stack really does bind 7071, so the docs now say so:

  • CLAUDE.md — dev daemon on 127.0.0.1:7071, plus a line saying the port is deliberately not the daemon's default 7070 and naming devDaemonPort in flake.nix.
  • flake.nix — the process-compose.dev header comment said 7070; now 7071 with the same pointer.
  • Justfile — the dev recipe comment said 7070; now 7071.

Left alone on purpose: CLAUDE.md:11 (the daemon's real default is 7070), the web-dev recipe and web/vite.config.ts (they proxy to a real daemon, not the dev stack), and the Not :7070 comment on MAESTRO_DAEMON_BIND_ADDR, which is still accurate.

Fixed in 24054eb. The dev stack really does bind 7071, so the docs now say so: - `CLAUDE.md` — dev daemon on `127.0.0.1:7071`, plus a line saying the port is deliberately not the daemon's default 7070 and naming `devDaemonPort` in `flake.nix`. - `flake.nix` — the `process-compose.dev` header comment said 7070; now 7071 with the same pointer. - `Justfile` — the `dev` recipe comment said 7070; now 7071. Left alone on purpose: `CLAUDE.md:11` (the daemon's real default is 7070), the `web-dev` recipe and `web/vite.config.ts` (they proxy to a real daemon, not the dev stack), and the `Not :7070` comment on `MAESTRO_DAEMON_BIND_ADDR`, which is still accurate. <!-- agent-meta: {"model":"claude-opus-5[1m]","session":"e4f39e6d"} -->
naps62-yolo left a comment
Author
Collaborator

Reviewed 24054eb26f217fb20ad8cc15a9e270fd64a9dc30. No findings.\n\n

Reviewed `24054eb26f217fb20ad8cc15a9e270fd64a9dc30`. No findings.\n\n<!-- agent-meta: {"model":"gpt-5.6","session":"4b0ed71a"} -->
naps62-yolo merged commit 53660407e3 into main 2026-08-23 10:02:09 +01:00
naps62-yolo deleted branch dev-stack 2026-08-23 10:02:09 +01:00
This repo is archived. You cannot comment on pull requests.