[PR #5629] [MERGED] feat(cli)!: export row-oriented results as JSON Lines #7004

Closed
opened 2026-11-01 21:44:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5629
Author: @vijaykiran06
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @gensokyo-dev

Base: main ← Head: feat/json-lines-row-results


📝 Commits (5)

  • 722274e feat(cli): add JSON Lines output for row-oriented results (#5487)
  • ecd2f86 fix(cli): preserve diagnostics, provenance, and nested collections in JSONL
  • 329a05b fix(cli): frame classified failures and reject unrepresented JSONL facets
  • 1430856 feat(cli)!: integrate row-oriented JSON Lines output
  • 7c7b6f6 chore(cli): integrate current output controls and verify JSONL consumers

📊 Changes

23 files changed (+1502 additions, -59 deletions)

View changed files

📝 docs/cli.md (+90 -0)
📝 docs/testing.md (+4 -2)
➕ docs/verification/cli-json-lines-2026-10-23.md (+134 -0)
📝 scripts/rea.mjs (+25 -20)
📝 scripts/verify/javascript/output.mjs (+78 -15)
📝 src/cli/cliResultOutput.ts (+100 -9)
➕ src/cli/jsonLines.ts (+226 -0)
➕ src/cli/jsonLinesOutput.ts (+111 -0)
📝 src/cli/jsonOutput.ts (+11 -2)
📝 src/cliOutput.ts (+2 -1)
📝 src/mcpDoctor.ts (+7 -2)
➕ tests/acceptance/jsonLinesCli.test.ts (+92 -0)
📝 tests/acceptance/managedCliOutput.test.ts (+9 -2)
📝 tests/boundary/cli/cliOutput.test.ts (+10 -1)
📝 tests/boundary/cli/dispatcher.test.ts (+40 -1)
📝 tests/boundary/cli/filteredArrayOutput.test.ts (+13 -1)
📝 tests/boundary/cli/javascriptApplicationJsonOutput.test.ts (+26 -1)
➕ tests/boundary/cli/jsonLinesOutput.test.ts (+451 -0)
📝 tests/boundary/cli/jsonOutput.test.ts (+9 -2)
📝 tests/boundary/cli/versionReportCli.test.ts (+9 -0)

...and 3 more files

📄 Description

--format jsonl now exports supported collections as one data record per line, followed by a jsonl/v1 metadata record that preserves non-row context, Evidence provenance, original coverage and unknowns. Classified and SDK-owned failures use explicit error records. CLI analysis/view workflows remain shared with MCP.

The renderer prepares one collection plan, streams bounded writes, and estimates the exact emitted representation one line at a time. It preserves SDK generator events and standalone version/MCP doctor diagnostics, and waits for final writes through worker cleanup outcomes.

BREAKING CHANGE: JSONL object collections use row + metadata framing; reports/scalar selections without a supported record boundary return an actionable error. Use --format json for a complete document. $rea is reserved on data records.

Fixes #5487.

Validation: npm run check, npm run docs:check (9 README tests), and 301 tests across 18 selected CLI/MCP/acceptance/consumer files passed. Real semver@7.8.5 analysis yielded 202 observation rows; all six refreshed before/after exports reconstructed identical full Evidence. Independent JSON/JSONL byte and digest checks passed beyond Node's string limit, including JSONL token counting from the actual file.

CI is not green: all 10 observed failures (including six found only in canceled shard logs) reproduce with identical normalized diagnostics on actual CI base 592c46b001e46072a68915d093519b89e6baab5f and merge 7251a0a934aab0d1b4263bc2494d21dad7f84ab2. Each selected control has 10 failed / 2 passed / 228 not executed; seven canceled shards leave incomplete coverage. Full attribution and limitations. Codex completed on this head without findings; Greptile reported 5/5 without new actionable findings.

Completed-export medians on refreshed main 2443b949a: elapsed 4.510 → 4.576 s, child CPU 5.876 → 5.987 s, peak family RSS 496.3 → 495.1 MiB. Framing adds 114 bytes / 37 heuristic tokens; no speedup or token reduction is claimed. The large JSONL serialization/counting fixture peaked at 186.0 MiB. Methods, exact commands and unmeasured scope: verification report.

Author readiness

Human owner: @vijaykiran06

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/5629 **Author:** [@vijaykiran06](https://github.com/vijaykiran06) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `feat/json-lines-row-results` --- ### 📝 Commits (5) - [`722274e`](https://github.com/morluto/rea/commit/722274e9cda242b019316d7dcffc820c90e3a418) feat(cli): add JSON Lines output for row-oriented results (#5487) - [`ecd2f86`](https://github.com/morluto/rea/commit/ecd2f86bd1162c0f551e92c37fccc0022b58d1f0) fix(cli): preserve diagnostics, provenance, and nested collections in JSONL - [`329a05b`](https://github.com/morluto/rea/commit/329a05b39f94dbf24dcdcbf0e8bc8f7699ad7bb5) fix(cli): frame classified failures and reject unrepresented JSONL facets - [`1430856`](https://github.com/morluto/rea/commit/143085688644b01c8c11ed615031fe9ef7806202) feat(cli)!: integrate row-oriented JSON Lines output - [`7c7b6f6`](https://github.com/morluto/rea/commit/7c7b6f6e2a3cebcf71eeb6142219193e193d1aaf) chore(cli): integrate current output controls and verify JSONL consumers ### 📊 Changes **23 files changed** (+1502 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `docs/cli.md` (+90 -0) 📝 `docs/testing.md` (+4 -2) ➕ `docs/verification/cli-json-lines-2026-10-23.md` (+134 -0) 📝 `scripts/rea.mjs` (+25 -20) 📝 `scripts/verify/javascript/output.mjs` (+78 -15) 📝 `src/cli/cliResultOutput.ts` (+100 -9) ➕ `src/cli/jsonLines.ts` (+226 -0) ➕ `src/cli/jsonLinesOutput.ts` (+111 -0) 📝 `src/cli/jsonOutput.ts` (+11 -2) 📝 `src/cliOutput.ts` (+2 -1) 📝 `src/mcpDoctor.ts` (+7 -2) ➕ `tests/acceptance/jsonLinesCli.test.ts` (+92 -0) 📝 `tests/acceptance/managedCliOutput.test.ts` (+9 -2) 📝 `tests/boundary/cli/cliOutput.test.ts` (+10 -1) 📝 `tests/boundary/cli/dispatcher.test.ts` (+40 -1) 📝 `tests/boundary/cli/filteredArrayOutput.test.ts` (+13 -1) 📝 `tests/boundary/cli/javascriptApplicationJsonOutput.test.ts` (+26 -1) ➕ `tests/boundary/cli/jsonLinesOutput.test.ts` (+451 -0) 📝 `tests/boundary/cli/jsonOutput.test.ts` (+9 -2) 📝 `tests/boundary/cli/versionReportCli.test.ts` (+9 -0) _...and 3 more files_ </details> ### 📄 Description `--format jsonl` now exports supported collections as one data record per line, followed by a `jsonl/v1` metadata record that preserves non-row context, Evidence provenance, original coverage and unknowns. Classified and SDK-owned failures use explicit error records. CLI analysis/view workflows remain shared with MCP. The renderer prepares one collection plan, streams bounded writes, and estimates the exact emitted representation one line at a time. It preserves SDK generator events and standalone version/MCP doctor diagnostics, and waits for final writes through worker cleanup outcomes. **BREAKING CHANGE:** JSONL object collections use row + metadata framing; reports/scalar selections without a supported record boundary return an actionable error. Use `--format json` for a complete document. `$rea` is reserved on data records. Fixes #5487. Validation: `npm run check`, `npm run docs:check` (9 README tests), and 301 tests across 18 selected CLI/MCP/acceptance/consumer files passed. Real `semver@7.8.5` analysis yielded 202 observation rows; all six refreshed before/after exports reconstructed identical full Evidence. Independent JSON/JSONL byte and digest checks passed beyond Node's string limit, including JSONL token counting from the actual file. CI is **not green**: all 10 observed failures (including six found only in canceled shard logs) reproduce with identical normalized diagnostics on actual CI base `592c46b001e46072a68915d093519b89e6baab5f` and merge `7251a0a934aab0d1b4263bc2494d21dad7f84ab2`. Each selected control has 10 failed / 2 passed / 228 not executed; seven canceled shards leave incomplete coverage. [Full attribution and limitations](https://github.com/morluto/rea/pull/5629#issuecomment-6371598601). Codex completed on this head without findings; Greptile reported 5/5 without new actionable findings. Completed-export medians on refreshed main `2443b949a`: elapsed 4.510 → 4.576 s, child CPU 5.876 → 5.987 s, peak family RSS 496.3 → 495.1 MiB. Framing adds 114 bytes / 37 heuristic tokens; no speedup or token reduction is claimed. The large JSONL serialization/counting fixture peaked at 186.0 MiB. Methods, exact commands and unmeasured scope: [verification report](https://github.com/vijaykiran06/rea/blob/7c7b6f6e2a3cebcf71eeb6142219193e193d1aaf/docs/verification/cli-json-lines-2026-10-23.md). ## Author readiness Human owner: @vijaykiran06 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:38 +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#7004
No description provided.