commit 6fbe43c45686dba084d2c0bbb759b6b05586855f
parent 1d9857abf0b672f7abd79ebc01c5dad1cfa1176b
Author: triesap <tyson@radroots.org>
Date: Tue, 21 Apr 2026 06:41:38 +0000
app: wire macos host proof lane
- run cargo metadata and the checked host proof from scripts/check.sh on macos
- make run_host.sh verify logging startup and print canonical repo-local log evidence
- extend test_host.sh to assert logging.initialized for normal and degraded launches
- keep the proof on the existing mounted app script surface without adding repo docs
Diffstat:
3 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/platforms/macos/Scripts/run_host.sh b/platforms/macos/Scripts/run_host.sh
@@ -32,6 +32,7 @@ forward_signal() {
require_command grep
require_command /usr/libexec/PlistBuddy
require_env RADROOTS_APP_LOCAL_LOG_ROOT
+require_env RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL
app_path="$("${script_dir}/build_host.sh")"
plist_path="${app_path}/Contents/Info.plist"
@@ -41,6 +42,7 @@ executable_name="$(
executable_path="${app_path}/Contents/MacOS/${executable_name}"
app_log_root="${RADROOTS_APP_LOCAL_LOG_ROOT}/apps/local/app/app-macos-native"
structured_log_file="${app_log_root}/${date_utc}.jsonl"
+latest_log_path="${app_log_root}/latest.jsonl"
stdout_file="${app_log_root}/raw/stdout.${date_utc}.log"
stderr_file="${app_log_root}/raw/stderr.${date_utc}.log"
@@ -51,6 +53,18 @@ trap 'forward_signal TERM' TERM
trap 'forward_signal INT' INT
trap 'forward_signal HUP' HUP
+stop_app_with_error() {
+ local message="$1"
+
+ if [[ -n "${app_pid:-}" ]] && kill -0 "${app_pid}" 2>/dev/null; then
+ kill "${app_pid}" 2>/dev/null || true
+ wait "${app_pid}" || true
+ fi
+
+ echo "${message}" >&2
+ exit 1
+}
+
"${executable_path}" "$@" >>"${stdout_file}" 2>>"${stderr_file}" &
app_pid="$!"
@@ -70,12 +84,30 @@ for _ in $(seq 1 100); do
done
if [[ "${launch_confirmed}" != "true" ]]; then
- if kill -0 "${app_pid}" 2>/dev/null; then
- kill "${app_pid}" 2>/dev/null || true
- wait "${app_pid}" || true
- fi
- echo "app launch did not emit runtime.launch within startup timeout" >&2
- exit 1
+ stop_app_with_error "app launch did not emit runtime.launch within startup timeout"
fi
+grep -q '"event":"logging.initialized"' "${structured_log_file}" 2>/dev/null || {
+ stop_app_with_error "app launch did not emit logging.initialized in ${structured_log_file}"
+}
+
+[[ -e "${latest_log_path}" ]] || {
+ stop_app_with_error "app launch did not create latest structured log alias: ${latest_log_path}"
+}
+
+[[ -f "${stdout_file}" ]] || {
+ stop_app_with_error "app launch did not create raw stdout log: ${stdout_file}"
+}
+
+[[ -f "${stderr_file}" ]] || {
+ stop_app_with_error "app launch did not create raw stderr log: ${stderr_file}"
+}
+
+printf 'radroots_app run: ready\n'
+printf 'relay=%s\n' "${RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL}"
+printf 'structured_log=%s\n' "${structured_log_file}"
+printf 'latest_log=%s\n' "${latest_log_path}"
+printf 'stdout_log=%s\n' "${stdout_file}"
+printf 'stderr_log=%s\n' "${stderr_file}"
+
wait "${app_pid}"
diff --git a/platforms/macos/Scripts/test_host.sh b/platforms/macos/Scripts/test_host.sh
@@ -169,6 +169,7 @@ RADROOTS_APP_LOCAL_LOG_ROOT="${local_log_root}" \
runner_pid="$!"
wait_for_log_event "${structured_log_file}" "runtime.launch" "${runner_pid}"
+wait_for_log_event "${structured_log_file}" "logging.initialized" "${runner_pid}"
assert_latest_alias "${latest_log_path}"
assert_raw_logs_exist "${stdout_file}" "${stderr_file}"
terminate_runner "${runner_pid}"
@@ -189,6 +190,7 @@ degraded_runner_pid="$!"
wait_for_log_event "${degraded_structured_log_file}" "runtime.launch" "${degraded_runner_pid}"
wait_for_log_event "${degraded_structured_log_file}" "runtime.degraded" "${degraded_runner_pid}"
+wait_for_log_event "${degraded_structured_log_file}" "logging.initialized" "${degraded_runner_pid}"
assert_latest_alias "${degraded_latest_log_path}"
assert_raw_logs_exist "${degraded_stdout_file}" "${degraded_stderr_file}"
grep -q '"startup_issue":"desktop runtime roots require HOME for macos"' "${degraded_structured_log_file}" || {
diff --git a/scripts/check.sh b/scripts/check.sh
@@ -5,4 +5,9 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
repo_root="$(git -C "${script_dir}" rev-parse --show-toplevel)"
cd "${repo_root}"
+cargo metadata --format-version 1 --no-deps
cargo check -p radroots_app
+
+if [[ "$(uname -s)" == "Darwin" ]]; then
+ "${repo_root}/platforms/macos/Scripts/test_host.sh"
+fi