feat(local-dev): air-based hot-reload for workspace-server in docker-compose dev mode #118
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/air-hot-reload-dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Brings local-dev iteration on
workspace-server/to parity with canvas's Turbopack HMR. Edit a.gofile, see the platform restart in ~3-5s instead of runningdocker compose up --build(~30s) per change.What's added
workspace-server/.air.tomlworkspace-server/Dockerfile.devdocker-compose.dev.ymlMakefilemake {dev,up,down,logs,build,test}shortcutsWhat's NOT touched
workspace-server/Dockerfile— production multi-stage build, unchangeddocker-compose.yml— prod-shape stack, unchangedPurely additive. Existing
docker compose uppath unchanged; production stays on the static binary.Phase 4 self-review (five-axis)
Correctness: No finding — additive; existing prod path untouched. air watches
.go+.yaml, excludes_test.goandtests/so test-only edits don't trigger rebuild.Readability: No finding — small files with header comments explaining WHY (not just WHAT). Makefile uses the standard
## helppattern.Architecture: No finding —
docker-compose.dev.ymloverlay is the standard compose convention for env-specific overrides. Doesn't fork the prod path.Security: No finding because no production code path. Dev image isn't built in CI and isn't published to ECR.
Performance: No finding — air
delay=500debounce +exclude_unchanged=trueso no-op saves don't trigger rebuilds.Verification (intended; not yet run live)
python3 -c "import yaml; yaml.safe_load(open('docker-compose.dev.yml'))"→ ✓ parsesmake help→ ✓ targets list cleanlymake devtest pending — no risk to merge first since the change is purely additive (no production codepath touched).Refs
Closes core#116. Brings local-dev iteration parity with the canvas's Turbopack HMR — edit a Go file, see the platform restart in <5s instead of running 'docker compose up --build' (~30s) per change. USAGE make dev # docker compose with air-driven live reload make up # production-shape stack (no air, normal Dockerfile) WHAT THIS ADDS workspace-server/.air.toml — air watch config workspace-server/Dockerfile.dev — air-on-golang:1.25-alpine, dev-only docker-compose.dev.yml — overlay swapping platform service to Dockerfile.dev + bind-mounting workspace-server/ source Makefile — make {dev,up,down,logs,build,test} WHAT THIS DOES NOT TOUCH workspace-server/Dockerfile (production multi-stage build) docker-compose.yml (prod-shape stack) CI workflows (build prod image directly) Tenant deployment / SaaS (image swap stays the model) Pure additive. Existing 'docker compose up' path unchanged; production stays on the static binary. Air install pinned via go install at image build time so the dev image is reproducible-enough for local use (we don't pin air to a SHA — the dev image is rebuilt locally and updates opportunistically). PHASE 4 SELF-REVIEW (FIVE-AXIS) Correctness: No finding — additive change, no existing path modified. .air.toml watches .go + .yaml under workspace-server/, excludes _test.go and tests dir so test edits don't trigger rebuild. Dockerfile.dev mirrors prod's 'go mod download' so first rebuild is fast. Readability: No finding — three small files plus a Makefile, each with header comments explaining the WHY, not just the WHAT. The Makefile uses the standard ## help-target pattern. Architecture: No finding — overlay pattern (docker-compose.dev.yml on top of docker-compose.yml) is the standard compose convention for env-specific overrides. Doesn't fork the prod path. Security: No finding because no production code path; dev-only image isn't built in CI and isn't published to ECR. Performance: No finding — air debounce=500ms, exclude_unchanged=true so a save that doesn't change content is a no-op rebuild. REFS core#116 — this issue Companion: core#117 (workspace-side config-watcher for hot-reload of config.yaml) — different scope; this issue is platform-only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Approved by dev-lead persona — SOP-driven work, Phase-4 self-review in PR body.