From 95db7ba527aa47a5e0131651abb63197e64b4bb2 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Wed, 5 Aug 2026 14:32:51 +0200 Subject: [PATCH 01/44] docs(stack): align runtime architecture documentation --- docs/adr/0010-process-manager-architecture.md | 29 - .../adr/0012-compiled-bun-runtime-dispatch.md | 72 - .../0013-live-e2e-bypasses-replay-server.md | 5 +- docs/adr/README.md | 2 - packages/process-compose/README.md | 49 +- packages/process-compose/docs/architecture.md | 1088 +++---------- packages/stack/README.md | 31 +- packages/stack/docs/architecture.md | 1394 +++-------------- packages/stack/docs/detach-mode.md | 620 ++------ packages/stack/src/daemon-node.ts | 3 + packages/stack/src/node.ts | 8 +- 11 files changed, 640 insertions(+), 2661 deletions(-) delete mode 100644 docs/adr/0010-process-manager-architecture.md delete mode 100644 docs/adr/0012-compiled-bun-runtime-dispatch.md diff --git a/docs/adr/0010-process-manager-architecture.md b/docs/adr/0010-process-manager-architecture.md deleted file mode 100644 index f988489d14..0000000000 --- a/docs/adr/0010-process-manager-architecture.md +++ /dev/null @@ -1,29 +0,0 @@ -# 0010. Process Manager Architecture - -**Status**: proposed -**Date**: 2026-02-10 - -## Problem Statement - -ADR 0004 identifies the process manager as "significant infrastructure to build and maintain" for the local-first workflow. `PLAN_PROCESS_COMPOSE.md` exists as an implementation plan but isn't part of the ADR system. - -The plan ports a subset of process-compose (Go) to TypeScript. Scope includes: HTTP API server, log output, start/stop/status/shutdown. Explicitly excludes: TUI, WebSocket streaming, scaling, namespaces, scheduling, hot-reload. - -## Key Decisions to Cover - -- **Why port process-compose to TypeScript** instead of: (a) using the Go binary directly, (b) using Docker Compose, (c) building from scratch without process-compose's model -- **Process lifecycle**: YAML config format, dependency resolution (`depends_on` with `process_healthy` / `process_completed_successfully`), readiness probes (exec, HTTP GET) -- **Signal handling**: How SIGTERM/SIGINT propagate to child processes, graceful shutdown ordering -- **HTTP API**: Endpoints, what `supabase dev` calls, how the TUI (React-Ink) connects to it -- **Logging**: Per-process log files, log rotation, how logs surface in the TUI -- **Health checks**: Probe types, intervals, failure thresholds, restart policies -- **Embedded binaries vs Docker containers**: How native binaries and Docker containers coexist - -## Related Decisions - -- [ADR 0004](0004-cli-design-goals-and-workflows.md): CLI Design Goals — local-first workflow, `supabase dev` orchestrator -- [ADR 0007](0007-realtime-progress-in-command-handlers.md): Real-time Progress — progress reporting from process manager phases - -## See Also - -- [PLAN_PROCESS_COMPOSE.md](../../PLAN_PROCESS_COMPOSE.md): Detailed implementation plan diff --git a/docs/adr/0012-compiled-bun-runtime-dispatch.md b/docs/adr/0012-compiled-bun-runtime-dispatch.md deleted file mode 100644 index 4795a1168a..0000000000 --- a/docs/adr/0012-compiled-bun-runtime-dispatch.md +++ /dev/null @@ -1,72 +0,0 @@ -# 0012. Compiled Bun Runtime Dispatch - -**Status**: proposed -**Date**: 2026-05-13 - -## Problem Statement - -ADR 0011 chooses Bun `--compile` single-file executables as the TypeScript CLI packaging format. That artifact shape matches the existing Go CLI distribution model, but compiled Bun does not behave exactly like `bun