feat(dev): bring run_inner to parity with dev-runner.sh — log shipper on the live path#40
Merged
Merged
Conversation
…on the live path The compose runner ran scripts/dev-runner.sh (air hot-reload, dev-proxy, livereload, per-module token files — but no log shipper), while the Rust run_inner had the #36 shipper but none of the dev features, so it was never the live path and the developer Logcat stayed empty. run_inner now carries the full runner: - Polling hot-reload (new reload.rs): mtime scan of .go/.sql every 2s (excludes tmp/web/node_modules — bind mounts deliver no inotify), go build -buildvcs=false -o <tmp>/<slug> ., restart on change, keep the old process on a failed rebuild, and re-tap the new child's stdout/stderr into the forwarder + shipper on every restart. - In-process /_m/<slug>/* dev-proxy (new proxy.rs) on PROXY_PORT (default 8080): TrimPrefix semantics (empty→/, query preserved), raw duplex relay after the rewritten head so chunked/SSE/upgrades pass through; backend connect refused → 502 (startup race). - Deterministic PORT from 18080 in go.work order; livereload LR_PORT from 8089 per web-enabled module. - Per-module MS_PLATFORM_TOKEN_FILE=<root>/.ms-platform-token-<slug> (distinct token per tunnel; a shared file would 401 all but the first). - esbuild web watcher: npm install --silent then node esbuild.config.mjs --watch, output prefixed [<slug>:web]. - --watch is honored (was dead surface: run_inner(root, _args)); defaults on so the compose command stays `mirrorstack dev --all`, --watch=false gives the old one-shot behavior. - One-line warning when MS_DISPATCH_URL/MS_INTERNAL_SECRET are unset so a config-disabled Logcat is not silent. - Shutdown tears down supervisors, module children, and esbuild watchers, then lets the shipper threads flush their final batch. log_shipper.rs is untouched — putting run_inner on the live path is the point of mirrorstack-cli#38. Closes #38 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The compose runner ran scripts/dev-runner.sh (air hot-reload, dev-proxy, livereload, per-module token files — but no log shipper), while the Rust run_inner had the #36 shipper but none of the dev features, so it was never the live path and the developer Logcat stayed empty.
run_inner now carries the full runner:
reload.rs): mtime scan of.go/.sqlevery 2s (excludes tmp/web/node_modules — bind mounts deliver no inotify),go build -buildvcs=false -o <tmp>/<slug> ., restart on change, keep the old process on a failed rebuild, and re-tap the new child's stdout/stderr into the forwarder + shipper on every restart./_m/<slug>/*dev-proxy (newproxy.rs) on PROXY_PORT (default 8080): TrimPrefix semantics (empty→/, query preserved), raw duplex relay after the rewritten head so chunked/SSE/upgrades pass through; backend connect refused → 502 (startup race).MS_PLATFORM_TOKEN_FILE=<root>/.ms-platform-token-<slug>(distinct token per tunnel; a shared file would 401 all but the first).npm install --silentthennode esbuild.config.mjs --watch, output prefixed[<slug>:web].--watchis honored (was dead surface:run_inner(root, _args)); defaults on so the compose command staysmirrorstack dev --all,--watch=falsegives the old one-shot behavior.log_shipper.rsis untouched — putting run_inner on the live path is the point of mirrorstack-cli#38.Validation
cargo check,cargo clippy --all-targets --all-features, andcargo fmt --checkclean; 151 tests pass.Closes #38
🤖 Generated with Claude Code