fix(health): resolve PR #330 review findings#333
Merged
Conversation
- health/ui.rs + platform.rs: remove legacy Node-era HTTP probes
(serve_health, serve_mode_check, asset checks) — the dashboard is
now a static export embedded in the Tauri binary; no com.meridiona.ui
launchd agent or HTTP port exists post-fold. meridian doctor was
reporting CRITICAL on every healthy post-fold install. Both checks now
return an Info line.
- health/capture.rs: fix capture_coverage datetime comparison. The
query used datetime('now', ?1) which produces '2026-06-23 17:00:00'
(space separator, no Z), while insert_capture_frame writes RFC 3339
'2026-06-24T16:00:00.000000Z' (T+Z). String comparison at index 10 had
'T' > ' ' so every row passed the filter — the 1-day coverage window
never excluded anything. Rewritten as julianday(timestamp) >
julianday('now', ?1) following the existing frame_freshness pattern.
- poll/mod.rs (supervise_mlx): add MLX_COOLING_TICKS=10 cooling period.
Budget-exhausted path now lets attempts grow past MLX_MAX_RESTARTS; at
MAX+COOLING ticks it resets to 0 so supervise() can kill any zombie on
port 7823 and attempt a new restart cycle. Prevents permanent wedge
after OOM/crash.
- bridge.ts (subscribe): replace silent .catch(() => {}) with retry-once-
after-2s for the cold-DB startup race (tray beats daemon on launch),
then console.warn on second failure so it is visible in DevTools.
- install-from-bundle.sh: add --ignore-scripts to both npm install lines
for screenpipe. The sudo path previously ran lifecycle scripts as root.
- mlx_server.rs (manifest_url): gate MERIDIAN_RUNTIME_MANIFEST_URL env-
var override behind #[cfg(debug_assertions)]. Kills the "env redirects
the manifest in production" half of the HIGH security finding. The
self-referential SHA-256 issue (manifest and tarball served from the
same origin) requires an out-of-band trust root and is deferred.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Summary
Addresses all review findings raised by @adityaharishch on PR #330. Targets
pre-mainso it is included in thepre-main → mainpromotion.Fixed
[HIGH CORRECTNESS]
meridian doctorexits non-zero on every healthy post-fold installsrc/health/ui.rs: Replaced the entire Node-era UI probe (HTTP GEThttp://localhost:3939,/_next/staticasset check,serve_mode_check) with a singleInfocheck: "dashboard embedded in the Tauri binary (no separate service)". Thecom.meridiona.uilaunchd agent no longer exists post-fold; probing for it always produced a falseCRITICAL.src/health/platform.rs: RemovedLABEL_UIconstant and replacedui_service()body with the sameInfocheck. The Node-era plist/PID check is gone.[HIGH CORRECTNESS] MLX restart-budget exhaustion permanently wedges
tray/src-tauri/src/poll/mod.rs: AddedMLX_COOLING_TICKS = 10. AfterMLX_MAX_RESTARTSconsecutive failures,attemptsnow increments through the cooling window. AtMAX_RESTARTS + COOLING_TICKS(~10 min), it resets to0—supervise()re-runs, kills any zombie holding port 7823 (via the existingKilledWedgedpath), and allows a fresh restart cycle. Previously the tray would stay wedged forever.[HIGH SECURITY]
MERIDIAN_RUNTIME_MANIFEST_URLredirectable in release buildstray/src-tauri/src/mlx_server.rs: Gated the runtime env-var override behind#[cfg(debug_assertions)]. A release binary can no longer be redirected to an attacker-controlled manifest via a compromised environment variable.pub_key). This is a follow-up design task; the env-var gate closes the more immediate attack surface.[MEDIUM CORRECTNESS]
capture_coveragedatetime comparison bugsrc/health/capture.rs:datetime('now', ?1)produces'2026-06-23 17:00:00'(space separator, no Z), butinsert_capture_framewrites RFC 3339'2026-06-24T16:00:00.000000Z'(T+Z). At index 10,'T'(0x54) >' '(0x20) — every row passed the filter, so the 1-day window never excluded anything and coverage ghosting went undetected. Fixed tojulianday(timestamp) > julianday('now', ?1)following theframe_freshnesspattern already in the same file.[MEDIUM CORRECTNESS]
subscribe()snapshot prime silently swallows errorsui/lib/bridge.ts: Replaced.catch(() => {})with retry-once-after-2s (targeted at the cold-DB startup race — tray can beat the daemon by ~1 s), thenconsole.warn(...)on second failure. The view can still stay blank if the DB never opens, but the error is now visible in DevTools rather than silently dropped.[MEDIUM SECURITY]
sudo npm installruns lifecycle scripts as rootscripts/install-from-bundle.sh: Added--ignore-scriptsto bothnpm install -glines (non-sudo and sudo paths). A compromisedscreenpipe@0.4.6tarball can no longer execute lifecycle scripts as root.Deferred (noted, not blocked)
install.shOO sha256: OpenObserve v0.90.3 tarball is downloaded without integrity verification. Fix requires sha256 of the official arm64 + amd64 tarballs. These need to be fetched from the OO release page and pinned — straightforward but requires the real values.build-mlx-runtime.shPBS version pin:releases/latestis resolved at build time without a sha256 check. Fix requires pinningPBS_RELEASE_TAGto a specific astral-sh/python-build-standalone release and verifying the downloaded archive.Test plan
cargo clippy -- -D warnings— clean ✅ (pre-push verified)cargo test— all passing ✅ (pre-push verified)meridian doctoron a post-fold install should showInfofor the ui group, notCritical/WarnMLX_MAX_RESTARTS; verifyattemptsincrements through cooling and resets at tick 15🤖 Generated with Claude Code
https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH