Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Delegate frontend dev runtime to root wrapper

rcourtmanc087db5da594
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 47fdc4b41e..ab4ceeb0a8 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -253,6 +253,10 @@ operational parity with the repo-root entry surface for the canonical controls:
start, status, logs, stop, restart, managed backend restart, verification, and
the explicit foreground escape hatch. The only intentionally narrower frontend
workspace exception is the named `dev:frontend-only` raw Vite escape hatch.
+That parity may not be maintained by duplicating raw script paths in two
+package manifests. `frontend-modern/package.json` must delegate those managed
+commands back to the repo-root npm wrapper surface so the workspace-local entry
+points cannot silently drift away from the one canonical operator contract.
That foreground escape hatch contract also applies to `scripts/hot-dev.sh`
itself: its self-description and usage guidance must point operators back to
the canonical managed `npm run dev` path for normal work and reserve
@@ -260,8 +264,9 @@ the canonical managed `npm run dev` path for normal work and reserve
That same self-description rule applies to `scripts/hot-dev-bg.sh`: even
though it is the managed control surface underneath the wrappers, its usage
guidance must still point operators to the canonical repo-root `npm run dev`
-entrypoint for routine startup instead of teaching direct script invocation as
-the primary habit.
+entrypoint for routine startup and label raw subcommands as secondary
+troubleshooting controls instead of teaching direct script invocation as the
+primary habit.
That operator-guidance rule also applies to the managed launcher's recovery and
diagnostic messages: when `hot-dev-bg` tells users how to start, restart,
verify, supervise, or inspect the routine local dev runtime, it must route them
diff --git a/frontend-modern/package.json b/frontend-modern/package.json
index b5e8021adb..1a6197b1b6 100644
--- a/frontend-modern/package.json
+++ b/frontend-modern/package.json
@@ -14,14 +14,14 @@
},
"homepage": "https://github.com/rcourtman/Pulse",
"scripts": {
- "dev": "../scripts/hot-dev-bg.sh start --takeover",
- "dev:logs": "../scripts/hot-dev-bg.sh logs",
- "dev:restart": "../scripts/hot-dev-bg.sh restart --takeover",
- "dev:backend-restart": "../scripts/hot-dev-bg.sh backend-restart",
- "dev:status": "../scripts/hot-dev-bg.sh status",
- "dev:stop": "../scripts/hot-dev-bg.sh stop",
- "dev:verify": "../scripts/hot-dev-bg.sh verify --takeover",
- "dev:foreground": "../scripts/hot-dev.sh",
+ "dev": "npm --prefix .. run dev",
+ "dev:logs": "npm --prefix .. run dev:logs",
+ "dev:restart": "npm --prefix .. run dev:restart",
+ "dev:backend-restart": "npm --prefix .. run dev:backend-restart",
+ "dev:status": "npm --prefix .. run dev:status",
+ "dev:stop": "npm --prefix .. run dev:stop",
+ "dev:verify": "npm --prefix .. run dev:verify",
+ "dev:foreground": "npm --prefix .. run dev:foreground",
"dev:frontend-only": "vite",
"build": "node scripts/build-embed-assets.mjs",
"preview": "vite preview",
diff --git a/scripts/hot-dev-bg.sh b/scripts/hot-dev-bg.sh
index a500449345..a3f2860820 100755
--- a/scripts/hot-dev-bg.sh
+++ b/scripts/hot-dev-bg.sh
@@ -4,14 +4,12 @@
#
# Usage:
# npm run dev # Canonical managed dev runtime
-# ./scripts/hot-dev-bg.sh start [--takeover]
-# ./scripts/hot-dev-bg.sh stop
-# ./scripts/hot-dev-bg.sh restart
-# ./scripts/hot-dev-bg.sh backend-restart
-# ./scripts/hot-dev-bg.sh launchd-session [--takeover]
-# ./scripts/hot-dev-bg.sh verify [--takeover]
-# ./scripts/hot-dev-bg.sh status
-# ./scripts/hot-dev-bg.sh logs
+# npm run dev:status
+# npm run dev:logs
+# npm run dev:restart
+# npm run dev:backend-restart
+# npm run dev:verify
+# ./scripts/hot-dev-bg.sh <command> # Direct troubleshooting only
set -euo pipefail
@@ -918,7 +916,7 @@ Managed entrypoints:
npm run dev:verify
npm run dev:foreground
-Commands:
+Direct troubleshooting subcommands:
start [--takeover]
stop
restart
diff --git a/scripts/tests/test-hot-dev-bg.sh b/scripts/tests/test-hot-dev-bg.sh
index 06e9814692..cb3ca03461 100755
--- a/scripts/tests/test-hot-dev-bg.sh
+++ b/scripts/tests/test-hot-dev-bg.sh
@@ -505,14 +505,14 @@ for key in [
PY
)"
- assert_contains "frontend package exposes managed dev start" "${output}" "dev=../scripts/hot-dev-bg.sh start --takeover"
- assert_contains "frontend package exposes managed dev logs" "${output}" "dev:logs=../scripts/hot-dev-bg.sh logs"
- assert_contains "frontend package exposes managed dev restart" "${output}" "dev:restart=../scripts/hot-dev-bg.sh restart --takeover"
- assert_contains "frontend package exposes managed backend restart" "${output}" "dev:backend-restart=../scripts/hot-dev-bg.sh backend-restart"
- assert_contains "frontend package exposes managed dev status" "${output}" "dev:status=../scripts/hot-dev-bg.sh status"
- assert_contains "frontend package exposes managed dev stop" "${output}" "dev:stop=../scripts/hot-dev-bg.sh stop"
- assert_contains "frontend package exposes managed dev verify" "${output}" "dev:verify=../scripts/hot-dev-bg.sh verify --takeover"
- assert_contains "frontend package keeps foreground managed launcher" "${output}" "dev:foreground=../scripts/hot-dev.sh"
+ assert_contains "frontend package delegates managed dev start to repo-root wrapper" "${output}" "dev=npm --prefix .. run dev"
+ assert_contains "frontend package delegates managed dev logs to repo-root wrapper" "${output}" "dev:logs=npm --prefix .. run dev:logs"
+ assert_contains "frontend package delegates managed dev restart to repo-root wrapper" "${output}" "dev:restart=npm --prefix .. run dev:restart"
+ assert_contains "frontend package delegates managed backend restart to repo-root wrapper" "${output}" "dev:backend-restart=npm --prefix .. run dev:backend-restart"
+ assert_contains "frontend package delegates managed dev status to repo-root wrapper" "${output}" "dev:status=npm --prefix .. run dev:status"
+ assert_contains "frontend package delegates managed dev stop to repo-root wrapper" "${output}" "dev:stop=npm --prefix .. run dev:stop"
+ assert_contains "frontend package delegates managed dev verify to repo-root wrapper" "${output}" "dev:verify=npm --prefix .. run dev:verify"
+ assert_contains "frontend package delegates foreground escape hatch to repo-root wrapper" "${output}" "dev:foreground=npm --prefix .. run dev:foreground"
assert_contains "frontend package keeps explicit frontend-only escape hatch" "${output}" "dev:frontend-only=vite"
}
@@ -558,7 +558,7 @@ test_hot_dev_bg_script_advertises_managed_entrypoint() {
output="$(cat "${ROOT_DIR}/scripts/hot-dev-bg.sh")"
assert_contains "hot-dev-bg usage points to managed runtime first" "${output}" "npm run dev # Canonical managed dev runtime"
- assert_contains "hot-dev-bg still documents direct launcher start" "${output}" "./scripts/hot-dev-bg.sh start [--takeover]"
+ assert_contains "hot-dev-bg documents direct launcher as troubleshooting only" "${output}" "./scripts/hot-dev-bg.sh <command> # Direct troubleshooting only"
assert_contains "hot-dev-bg routes log guidance to managed wrapper" "${output}" "Check logs with: npm run dev:logs"
assert_contains "hot-dev-bg routes verify guidance to managed wrapper" "${output}" "Rerun with: npm run dev:verify"
assert_contains "hot-dev-bg routes launchd supervision guidance to managed wrapper" "${output}" "Rerun with: npm run dev"
@@ -571,7 +571,7 @@ test_hot_dev_bg_usage_prefers_managed_wrappers() {
assert_contains "hot-dev-bg usage shows managed entrypoints heading" "${output}" "Managed entrypoints:"
assert_contains "hot-dev-bg usage advertises npm dev wrapper" "${output}" "npm run dev"
assert_contains "hot-dev-bg usage advertises npm verify wrapper" "${output}" "npm run dev:verify"
- assert_contains "hot-dev-bg usage retains raw command list" "${output}" "Commands:"
+ assert_contains "hot-dev-bg usage labels raw commands as troubleshooting-only" "${output}" "Direct troubleshooting subcommands:"
assert_contains "hot-dev-bg usage retains direct start subcommand" "${output}" "start [--takeover]"
}
diff --git a/tests/integration/README.md b/tests/integration/README.md
index 13a094b0d5..8d0959c827 100644
--- a/tests/integration/README.md
+++ b/tests/integration/README.md
@@ -146,7 +146,7 @@ PULSE_E2E_SKIP_PLAYWRIGHT_INSTALL=1 \
npm test -- tests/16-dev-runtime-recovery.spec.ts tests/17-recovery-layout.spec.ts tests/18-patrol-runtime-state.spec.ts --project=chromium
```
-This mode attaches Playwright to the canonical dev browser entrypoint on `http://127.0.0.1:5173`, uses `scripts/hot-dev-bg.sh` as the runtime control surface, and writes browser runtime connection state for Playwright instead of targeting the backend port directly.
+This mode attaches Playwright to the canonical dev browser entrypoint on `http://127.0.0.1:5173`, uses the repo-root managed runtime wrappers as the control surface, and writes browser runtime connection state for Playwright instead of targeting the backend port directly. Those wrappers are backed by `scripts/hot-dev-bg.sh`, but the wrapper surface is the canonical operator contract.
When you run the wrapper as `npm run dev:verify`, the managed launcher hands a verification-lock path into the integration runner, and the runner holds that lock for the actual pretest, Playwright, and posttest lifetime so unrelated backend source churn does not invalidate the recovery proofs mid-run.
If the managed runtime is not already running, the harness starts it. If you need the harness to reclaim existing unmanaged `5173`/`7655` listeners first, add `PULSE_E2E_HOT_DEV_TAKEOVER=1`.