From 2f6e8f74f594b4b9db250724177f19abaed65602 Mon Sep 17 00:00:00 2001 From: vi70x3 Date: Mon, 25 May 2026 07:15:46 +0300 Subject: [PATCH 1/3] fix: update install.sh doctor readiness parsing to use current blockers schema The run_doctor() function was querying .readiness.ready and .readiness.checks[] which no longer exist in the doctor JSON output. Updated to use .readiness.blockers (empty array = ready) which is the current schema. Fixes #8 --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100755 => 100644 install.sh diff --git a/install.sh b/install.sh old mode 100755 new mode 100644 index f22087b..73c0b8c --- a/install.sh +++ b/install.sh @@ -443,20 +443,20 @@ run_doctor() { fi if command -v jq >/dev/null 2>&1 && printf '%s' "${out}" | jq -e . >/dev/null 2>&1; then - local ready - ready="$(printf '%s' "${out}" | jq -r '.readiness.ready // false')" + local blockers + blockers="$(printf '%s' "${out}" | jq -r '.readiness.blockers | length')" printf '%s\n' "${out}" | jq -r ' .readiness as $r | - "ready: \($r.ready)\n" + - ((($r.checks // []) | map(" - \(.name): \(.status)\(if .detail then " (\(.detail))" else "" end)") | join("\n"))) + "ready: \((($r.blockers | length) == 0) | tostring)\n" + + ((($r.blockers // []) | map(" - \(.)") | join("\n"))) ' - if [[ "${ready}" == "true" ]]; then + if [[ "${blockers}" -eq 0 ]]; then log_ok "doctor reports ready" else log_fail "doctor reports NOT ready" while IFS= read -r line; do FAILED_CHECKS+=("${line}") - done < <(printf '%s' "${out}" | jq -r '.readiness.checks[]? | select(.status != "ok") | "\(.name): \(.detail // .status)"') + done < <(printf '%s' "${out}" | jq -r '.readiness.blockers[]') return 1 fi else From bd9471cd8383b3fdee864c7491a6fd3cfde94ae5 Mon Sep 17 00:00:00 2001 From: vi70x3 Date: Mon, 25 May 2026 07:27:34 +0300 Subject: [PATCH 2/3] fix: harden jq parsing in run_doctor against missing/invalid blockers field Address code review feedback: - Use `if type == "array" then length else -1` to avoid false-ready when blockers is missing/null - Use `type == "array" and length == 0` for the display output - Restore `?` optional operator on `.readiness.blockers[]?` to prevent jq errors on missing field - Update raw fallback grep to match `"blockers": []` instead of the removed `"ready": true` - Add explicit -1 branch to report unexpected JSON structure --- install.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 73c0b8c..0e2e8d8 100644 --- a/install.sh +++ b/install.sh @@ -444,25 +444,28 @@ run_doctor() { if command -v jq >/dev/null 2>&1 && printf '%s' "${out}" | jq -e . >/dev/null 2>&1; then local blockers - blockers="$(printf '%s' "${out}" | jq -r '.readiness.blockers | length')" + blockers="$(printf '%s' "${out}" | jq -r '.readiness.blockers | if type == "array" then length else -1 end')" printf '%s\n' "${out}" | jq -r ' .readiness as $r | - "ready: \((($r.blockers | length) == 0) | tostring)\n" + + "ready: \($r.blockers | type == "array" and length == 0)\n" + ((($r.blockers // []) | map(" - \(.)") | join("\n"))) ' if [[ "${blockers}" -eq 0 ]]; then log_ok "doctor reports ready" + elif [[ "${blockers}" -eq -1 ]]; then + log_fail "doctor output missing blockers field — unexpected JSON structure" + return 1 else log_fail "doctor reports NOT ready" while IFS= read -r line; do FAILED_CHECKS+=("${line}") - done < <(printf '%s' "${out}" | jq -r '.readiness.blockers[]') + done < <(printf '%s' "${out}" | jq -r '.readiness.blockers[]?') return 1 fi else # Raw fallback. printf '%s\n' "${out}" - if printf '%s' "${out}" | grep -qiE '"ready"[[:space:]]*:[[:space:]]*true|ready: true'; then + if printf '%s' "${out}" | grep -qiE '"blockers"[[:space:]]*:[[:space:]]*\[\]'; then log_ok "doctor reports ready (raw)" else log_fail "doctor did not report ready (install jq for a structured summary)" From b0a1eaf65ba4cfb583a440c965cfdb35caf0f651 Mon Sep 17 00:00:00 2001 From: Avi Fenesh Date: Mon, 25 May 2026 12:27:57 +0300 Subject: [PATCH 3/3] fix: restore install.sh executable bit PR dropped the mode from 100755 to 100644, which breaks the documented './install.sh' entrypoint (README Option A) with a permission-denied error. Restore +x; content unchanged. --- install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 install.sh diff --git a/install.sh b/install.sh old mode 100644 new mode 100755