[PR #2502] [CLOSED] fix(cli): report analysis failures as not-ok in full-output envelopes #5279

Closed
opened 2026-10-31 01:05:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2502
Author: @chqcjq
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/cli-full-output-error-envelope


📝 Commits (1)

  • 308fb48 fix(cli): report analysis failures as not-ok in full-output envelopes

📊 Changes

1 file changed (+11 additions, -1 deletions)

View changed files

📝 src/cli/streamedJsonOutput.ts (+11 -1)

📄 Description

Fixes #2273.

Problem

With --full-output, every REA analysis/domain failure is wrapped in a success envelope: {"ok": true, "data": { <error projection> }}. The process still exits 1. The envelope's ok field disagrees with the exit code exactly for the errors that matter most.

Root cause

createStreamedCliJsonOutput wraps every non-undefined result as { ok: true, data: ... } without checking whether the result is an error projection.

Fix

The full-output envelope now checks whether the result is an analysis error projection (has error and code fields). Error projections are wrapped as { ok: false, error: ... } instead of { ok: true, data: ... }.

Verification

  • rea inspect-managed-artifact C:\nonexistent.dll --format json --full-output now returns {"ok":false,"error":{...}} with exit code 1.
  • Successful analysis still returns {"ok":true,"data":{...}} with exit code 0.
  • npm run check, docs:check, and verify:test-discovery (943 files) all pass.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2502 **Author:** [@chqcjq](https://github.com/chqcjq) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/cli-full-output-error-envelope` --- ### 📝 Commits (1) - [`308fb48`](https://github.com/morluto/rea/commit/308fb4821c965985a168ab235fe29541433640cf) fix(cli): report analysis failures as not-ok in full-output envelopes ### 📊 Changes **1 file changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/streamedJsonOutput.ts` (+11 -1) </details> ### 📄 Description Fixes #2273. ## Problem With `--full-output`, every REA analysis/domain failure is wrapped in a success envelope: `{"ok": true, "data": { <error projection> }}`. The process still exits 1. The envelope's `ok` field disagrees with the exit code exactly for the errors that matter most. ## Root cause `createStreamedCliJsonOutput` wraps every non-undefined result as `{ ok: true, data: ... }` without checking whether the result is an error projection. ## Fix The full-output envelope now checks whether the result is an analysis error projection (has `error` and `code` fields). Error projections are wrapped as `{ ok: false, error: ... }` instead of `{ ok: true, data: ... }`. ## Verification - `rea inspect-managed-artifact C:\nonexistent.dll --format json --full-output` now returns `{"ok":false,"error":{...}}` with exit code 1. - Successful analysis still returns `{"ok":true,"data":{...}}` with exit code 0. - `npm run check`, `docs:check`, and `verify:test-discovery` (943 files) all pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:24 +00:00
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#5279
No description provided.