Skip to content

feat(dev): bring run_inner to parity with dev-runner.sh — log shipper on the live path#40

Merged
I-am-nothing merged 1 commit into
mainfrom
feat/38-dev-runner-parity
Jul 4, 2026
Merged

feat(dev): bring run_inner to parity with dev-runner.sh — log shipper on the live path#40
I-am-nothing merged 1 commit into
mainfrom
feat/38-dev-runner-parity

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

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.

Validation

cargo check, cargo clippy --all-targets --all-features, and cargo fmt --check clean; 151 tests pass.

Closes #38

🤖 Generated with Claude Code

…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>
@I-am-nothing I-am-nothing merged commit 283af89 into main Jul 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(dev): bring run_inner to parity with dev-runner.sh and restore the log shipper in the live runner

1 participant