[GH-ISSUE #2581] fix(install): diagnose an empty installed version as unreadable #898

Closed
opened 2026-10-15 18:29:25 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2581

Summary

When the installed command exits successfully without reporting a version, the installer prints a version mismatch with an empty actual value. It correctly rejects the installation, but selects a diagnostic meant for a different reported version rather than the documented unreadable-version message.

Steps to reproduce

Run the following fixture from the repository root on macOS with supported Node.js and curl available. Its npm replacement creates only a disposable installed executable; it performs no package installation or setup.

fixture=$(mktemp -d)
mkdir -p "$fixture/bin" "$fixture/prefix/bin"
cat > "$fixture/bin/npm" <<'SH'
#!/bin/sh
if [ "$1" = prefix ]; then printf '%s\n' "$FIXTURE_PREFIX"; exit 0; fi
cp "$FIXTURE_REA_SOURCE" "$FIXTURE_PREFIX/bin/rea"
chmod +x "$FIXTURE_PREFIX/bin/rea"
SH
chmod +x "$fixture/bin/npm"
printf '#!/bin/sh\nexit 0\n' > "$fixture/rea-source"
PATH="$fixture/bin:$PATH" FIXTURE_PREFIX="$fixture/prefix" FIXTURE_REA_SOURCE="$fixture/rea-source" bash install.sh --version 0.3.0 --no-setup
rm -rf "$fixture"

For controls, rerun the complete fixture separately with the installed-command fixture changed to print only spaces, print 9.9.9, exit 1, or print 0.3.0.

Expected behavior

An installed executable that provides no version should produce REA installation failed: the installed REA version could not be read. Reinstall the requested version, then retry. A nonempty different version should retain the mismatch message, while the requested version should pass the identity check.

Actual behavior

Successful empty output exits 1 with REA installation failed: installed version does not match 0.3.0. Reinstall the requested version, then retry. Whitespace-only output gives the same result. The different-version control reports a populated mismatch; the nonzero-exit control reports an unreadable version; the matching-version control succeeds. The incorrect empty-output message does not cause installation to be accepted.

Evidence

  • Expected source: docs/user-visible-errors.csv:112 describes the unreadable-version route; docs/user-visible-errors.csv:113 describes mismatch only when a different version is reported.
  • Failure source: install.sh:166 accepts successful empty output as a read, then install.sh:167 emits the mismatch diagnostic for the resulting empty value.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

All five fixture variants ran through the actual installer after its npm and executable-presence checks. The fixture copied an executable to a disposable global-prefix directory; no real npm package was installed.

Restoration check

Successful empty and whitespace-only version output must fail with the unreadable-version diagnostic. A nonempty different version must still fail with its reported mismatch, a nonzero version command must retain the unreadable-version diagnostic, and the matching version must still succeed.

Runtime or environment

Source baseline 8b181716ac, macOS, Bash 5.3.20, Node.js 26.10.0, and a disposable npm/install-command fixture.

Triage assessment

  • Impact level: P3
  • Assessment status: supported
  • Impact basis: The wrong diagnosis sentence contains a blank actual version, but the installer still rejects the result and prints the same reinstall recovery instruction. No acceptance or configuration behavior changes.
  • Workaround status: available
  • Workaround basis: The existing message already gives the same recovery action as the unreadable-version route, so callers receive usable recovery guidance despite the incorrect diagnosis.
Originally created by @coygeek on GitHub (Oct 13, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2581 ## Summary When the installed command exits successfully without reporting a version, the installer prints a version mismatch with an empty actual value. It correctly rejects the installation, but selects a diagnostic meant for a different reported version rather than the documented unreadable-version message. ## Steps to reproduce Run the following fixture from the repository root on macOS with supported Node.js and curl available. Its npm replacement creates only a disposable installed executable; it performs no package installation or setup. ```bash fixture=$(mktemp -d) mkdir -p "$fixture/bin" "$fixture/prefix/bin" cat > "$fixture/bin/npm" <<'SH' #!/bin/sh if [ "$1" = prefix ]; then printf '%s\n' "$FIXTURE_PREFIX"; exit 0; fi cp "$FIXTURE_REA_SOURCE" "$FIXTURE_PREFIX/bin/rea" chmod +x "$FIXTURE_PREFIX/bin/rea" SH chmod +x "$fixture/bin/npm" printf '#!/bin/sh\nexit 0\n' > "$fixture/rea-source" PATH="$fixture/bin:$PATH" FIXTURE_PREFIX="$fixture/prefix" FIXTURE_REA_SOURCE="$fixture/rea-source" bash install.sh --version 0.3.0 --no-setup rm -rf "$fixture" ``` For controls, rerun the complete fixture separately with the installed-command fixture changed to print only spaces, print `9.9.9`, exit 1, or print `0.3.0`. ## Expected behavior An installed executable that provides no version should produce `REA installation failed: the installed REA version could not be read. Reinstall the requested version, then retry.` A nonempty different version should retain the mismatch message, while the requested version should pass the identity check. ## Actual behavior Successful empty output exits 1 with `REA installation failed: installed version does not match 0.3.0. Reinstall the requested version, then retry.` Whitespace-only output gives the same result. The different-version control reports a populated mismatch; the nonzero-exit control reports an unreadable version; the matching-version control succeeds. The incorrect empty-output message does not cause installation to be accepted. ## Evidence - Expected source: docs/user-visible-errors.csv:112 describes the unreadable-version route; docs/user-visible-errors.csv:113 describes mismatch only when a different version is reported. - Failure source: install.sh:166 accepts successful empty output as a read, then install.sh:167 emits the mismatch diagnostic for the resulting empty value. - Evidence provenance: observed - Local verification: reproduced - Reproduction completeness: complete All five fixture variants ran through the actual installer after its npm and executable-presence checks. The fixture copied an executable to a disposable global-prefix directory; no real npm package was installed. ## Restoration check Successful empty and whitespace-only version output must fail with the unreadable-version diagnostic. A nonempty different version must still fail with its reported mismatch, a nonzero version command must retain the unreadable-version diagnostic, and the matching version must still succeed. ## Runtime or environment Source baseline 8b181716aca2cb467be499cba226abfb5ae19141, macOS, Bash 5.3.20, Node.js 26.10.0, and a disposable npm/install-command fixture. ## Triage assessment - Impact level: P3 - Assessment status: supported - Impact basis: The wrong diagnosis sentence contains a blank actual version, but the installer still rejects the result and prints the same reinstall recovery instruction. No acceptance or configuration behavior changes. - Workaround status: available - Workaround basis: The existing message already gives the same recovery action as the unreadable-version route, so callers receive usable recovery guidance despite the incorrect diagnosis.
bsakaguchi 2026-10-15 18:29:25 +00:00
Author
Owner

@morluto commented on GitHub (Oct 14, 2026):

Addressed on main in ec56c1da0.

An installed command with empty successful version output now receives the unreadable-version diagnostic.

Validation: Installer boundary controls passed for empty, whitespace, mismatched, failing and matching version output.

Verification scope: No installation of unrelated software.

<!-- gh-comment-id:6158663002 --> @morluto commented on GitHub (Oct 14, 2026): Addressed on main in [ec56c1da0](https://github.com/morluto/rea/commit/ec56c1da0). An installed command with empty successful version output now receives the unreadable-version diagnostic. Validation: Installer boundary controls passed for empty, whitespace, mismatched, failing and matching version output. Verification scope: No installation of unrelated software.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#898
No description provided.