[GH-ISSUE #912] Unknown output filter silently returns no JSON with success exit #366

Closed
opened 2026-10-15 18:24:19 +00:00 by bsakaguchi · 0 comments
Owner

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

Observed behavior

analyze-javascript-application --format json --filter-output summary exits successfully but writes zero bytes to stdout and stderr. An incorrect selector silently removes the entire response, so a caller expecting JSON cannot distinguish an invalid projection from missing output.

Reproduced on macOS arm64, Node v22.22.2, REA checkout f1fe51f37f40b4c12df6d4935cf67e35e0ba7f14, using the built CLI and checked-in readiness fixture.

Reproduction

From the REA checkout:

node scripts/rea.mjs analyze-javascript-application tests/conformance/readiness/javascript-cli --format json --filter-output summary > result.json

Observed: exit code 0, result.json is empty, no stderr diagnostic. By contrast:

node scripts/rea.mjs analyze-javascript-application tests/conformance/readiness/javascript-cli --format json --filter-output normalized_result.summary

returns valid JSON (770 bytes in this build) and exits 0. A missing nested selector, normalized_result.not_a_field, returns a valid empty nested object instead. The zero-byte case appears specific to a missing single top-level selector.

Expected behavior

With --format json, always produce a valid JSON response. When a filter removes the entire result, expose an explicit empty projection or an actionable invalid-selector error instead of success with no response. If invalid selectors are rejected, preserve legitimate filters for optional fields and partial results.

The CLI's filtering/writing path is supplied by incur; an upstream fix may be appropriate. REA should still cover its observable JSON/exit-status contract with a regression test.

Originally created by @morluto on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/912 ## Observed behavior `analyze-javascript-application --format json --filter-output summary` exits successfully but writes zero bytes to stdout and stderr. An incorrect selector silently removes the entire response, so a caller expecting JSON cannot distinguish an invalid projection from missing output. Reproduced on macOS arm64, Node v22.22.2, REA checkout `f1fe51f37f40b4c12df6d4935cf67e35e0ba7f14`, using the built CLI and checked-in readiness fixture. ## Reproduction From the REA checkout: ```console node scripts/rea.mjs analyze-javascript-application tests/conformance/readiness/javascript-cli --format json --filter-output summary > result.json ``` Observed: exit code 0, `result.json` is empty, no stderr diagnostic. By contrast: ```console node scripts/rea.mjs analyze-javascript-application tests/conformance/readiness/javascript-cli --format json --filter-output normalized_result.summary ``` returns valid JSON (770 bytes in this build) and exits 0. A missing nested selector, `normalized_result.not_a_field`, returns a valid empty nested object instead. The zero-byte case appears specific to a missing single top-level selector. ## Expected behavior With `--format json`, always produce a valid JSON response. When a filter removes the entire result, expose an explicit empty projection or an actionable invalid-selector error instead of success with no response. If invalid selectors are rejected, preserve legitimate filters for optional fields and partial results. The CLI's filtering/writing path is supplied by `incur`; an upstream fix may be appropriate. REA should still cover its observable JSON/exit-status contract with a regression test.
bsakaguchi 2026-10-15 18:24:19 +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#366
No description provided.