Files
clide/docs/ADRs/0002-sidecar-language-go.md
T
jpmschweitzerandClaude 9522625304 retire Go sidecar; adopt Dart core (ADR 0005)
ADR 0005 supersedes ADR 0002. The "sidecar vs app" split was
load-bearing on Go-vs-Dart being a meaningful boundary. Going
all-Dart collapses that — the daemon becomes clide --daemon mode
of the same AOT binary the CLI lives in, both sharing lib/ with
the Flutter app. The one native gap (Dart's multi-threaded VM
can't safely fork+exec) is filled by a small C supporter tool —
ptyc, Project Terminal Controller, peer of pql — rather than
introducing a second core language.

ADR 0006 defines the CLI/event surface on top of that Dart core:
subsystem list (pane/tab/editor/panel/tree/git/pql/canvas/graph/
theme/settings/project), command shape, versioned JSON event
schema, pql-parity exit codes, and command-event duality as the
operational form of user/Claude parity.

Deleted: sidecar/cmd, sidecar/go.mod, every sidecar/internal
package. Rewritten: Makefile (dart compile exe, flutter
analyze/format/test, build-linux/build-macos, ptyc-build),
ci/*.sh, .githooks/pre-push (no more GOBIN PATH dance),
.gitignore (Flutter/Dart at repo root, ptyc section),
project.yaml (drop module: and go_version:), CLAUDE.md
(guardrails, dependencies, commands refreshed).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-21 00:28:27 +02:00

46 lines
1.9 KiB
Markdown

# ADR 0002 — Sidecar language: Go
**Status:** superseded by [ADR 0005](0005-dart-core-ptyc-peer.md)
**Date:** 2026-04-20 (ported from the claudian lineage)
**Superseded:** 2026-04-20 — the "separate language" premise dissolved once we chose Dart for the core; see 0005 for the rationale.
## Context
The Clide sidecar owns PTYs, subprocesses, file watchers, git
shelling-out, and the IPC server. It ships as a single static binary
that also serves as the `clide` CLI in one-shot mode. The Flutter
desktop app talks to it over IPC; Claude talks to it via the CLI.
Language candidates were Go and Rust.
Related hard constraint: **no heavy lifting in the UI layer.** The
Flutter app stays focused on rendering and interaction. Everything
heavy (PTYs, subprocesses, file watching, git, pql invocations)
lives in the sidecar. Reason: keep the UI layer thin and the
security-sensitive surface auditable in one language.
## Decision
The sidecar/CLI is written in Go.
Rationale:
- **Matches pql.** pql is Go; Clide wraps pql and reaches into its
idioms constantly. Shared toolchain and shared patterns cut
cognitive overhead.
- **Static binary.** Single artifact, trivial cross-compile, no
runtime dependencies on the user's machine.
- **PTY story is fine.** `creack/pty` covers what we need; Rust's
crates are marginally nicer but not decisive.
- **Muscle memory.** Build pipeline, `project.yaml` conventions,
goreleaser setup, exit-code contract, diagnostic format — all
already established in pql and portable one-to-one.
## Consequences
- Module path: `git.schweitz.net/jpmschweitzer/clide/sidecar`.
- Layout mirrors pql: `cmd/clide/main.go`, `internal/cli`,
`internal/version` (ldflag-stamped `Version`, `Commit`, `Date`),
`internal/diag` (exit codes + stderr-JSON diagnostics).
- Same Makefile shape: version read from `project.yaml` via awk,
stamped via `-ldflags -X`.