Skip to content

feat(cli)!: export row-oriented results as JSON Lines - #5629

Merged
gensokyo-dev merged 5 commits into
morluto:mainfrom
vijaykiran06:feat/json-lines-row-results
Oct 23, 2026
Merged

gensokyo-dev merged 5 commits into
morluto:mainfrom
vijaykiran06:feat/json-lines-row-results

Conversation

@vijaykiran06

@vijaykiran06 vijaykiran06 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

--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 [email protected] 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.

- Support opt-in JSON Lines format (--format jsonl) for row-oriented results and collection views with clear record boundaries
- Preserve stable source identities and stream records deterministically line-by-line
- Emit final coverage and limitation metadata as a distinct line with https://rea.dev/schemas/jsonl-coverage-v1.json to prevent confusion with data rows
- Distinguish error outputs with https://rea.dev/schemas/jsonl-error-v1.json
- Reject non-row-oriented results that lack record boundaries with an unreadable_output error
- Document JSON Lines streaming conventions in docs/cli.md
- Add boundary tests covering empty results, multiline strings, partial coverage, large fields, and non-row rejection
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T18:00:41.938992Z 7c7b6f6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; both numbered findings are fixed and no new actionable issues remain.

Summary

Adds row-oriented JSON Lines output while keeping source context separate from data rows.

  • JSON Lines writes result records before their coverage and provenance.
  • One-shot CLI output waits for the command's final status.

Tests were not rerun because dependencies are absent. Whether another PR replaces this one could not be confirmed because GitHub access is unauthenticated.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Completed command result] --> B{Command failed?}
  B -->|Yes| E[Write error record]
  B -->|No| C[Apply output filter]
  C --> D{One clear record collection?}
  D -->|No| E
  D -->|Yes| F[Build shared record plan]
  F --> G{Token count requested?}
  G -->|Yes| H[Count each encoded line]
  G -->|No| I[Write rows and available context]
Loading

Reviews (4) · Last reviewed commit: "chore(cli): integrate current output con..." · Reviewed by Greptile

Comment thread src/cli/cliResultOutput.ts Resolved
Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/cli/jsonOutput.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 722274e9cd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/cli/cliResultOutput.ts Resolved
Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/cli/cliResultOutput.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ecd2f86bd1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/cli/cliResultOutput.ts Resolved
Comment thread docs/cli.md Resolved
Comment thread docs/cli.md Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Comment thread src/cli/jsonOutput.ts Resolved
Comment thread src/mcpDoctor.ts Resolved
Preserve complete non-row Evidence context, classify failures at their owner,
and share bounded record serialization with exact-output token estimates.
Retain SDK event streaming and await buffered diagnostics through finalization.

BREAKING CHANGE: object collection JSONL results emit rows followed by a
jsonl/v1 metadata record; unsupported document boundaries emit typed errors.
Use the parsed output controls from refreshed main throughout the launcher,
result renderer and reusable CLI driver. Share the single-record encoder
with token counting, including array-valued records.

Update legacy non-row consumers for the declared JSONL contract and verify
complete output plus token counting beyond the engine string limit.
@gensokyo-dev gensokyo-dev changed the title feat(cli): add JSON Lines output for row-oriented results (#5487) feat(cli)!: export row-oriented results as JSON Lines Oct 23, 2026
@gensokyo-dev

Copy link
Copy Markdown
Collaborator

@codex review

Updated head 7c7b6f6e2a3cebcf71eeb6142219193e193d1aaf refreshes this feature onto main 2443b949a, preserves complete Evidence context, shares single-record encoding with token counting, and covers SDK/cleanup outcomes. Local checks, 301 selected tests, and >engine-string-limit JSON/JSONL verification passed; exact evidence and limits are linked in the PR body.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 7c7b6f6e2a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

The final CI audit is complete for head 7c7b6f6e2a3cebcf71eeb6142219193e193d1aaf.

CI checked out merge 7251a0a934aab0d1b4263bc2494d21dad7f84ab2 against actual base 592c46b001e46072a68915d093519b89e6baab5f. The base and merge use byte-identical package manifests, lockfile and pinned toolchain. Both snapshots were built and the same selected cases were run sequentially: 10 failed, 2 passed, 228 not executed on each. All 10 failed case identities and complete diagnostics match after normalizing only the worktree path. No resource stop occurred.

Observed baseline failures:

  • IDA Unicode literal matching: 1.
  • Markdown authored formatter-capacity hook: 2.
  • CDP resource completeness: 1.
  • PE TeletexString handling: 1.
  • JavaScript literal/indirect loader ownership through CLI/MCP: 4.
  • Source-map ArtifactOperationError identity: 1.

The Portable tests report contains 4 failed / 19,095 passed / 74 skipped assertions. Six more failures were visible only in canceled shard logs, so the aggregate alone was insufficient: shard 6, shard 4, shard 5. All seven canceled shard logs were checked. Cancellation leaves incomplete coverage; this is not a green/full CI claim.

The feature's local validation remains 301 selected passing tests, npm run check, documentation checks, real retained semver Evidence equivalence, and independent >engine-string-limit JSON/JSONL output plus token-count verification. Codex completed on this head with no findings; Greptile reported 5/5 with no new actionable findings. Existing review threads have root-cause/fix/validation replies.

The maintainer has explicitly authorized bypass for failures not introduced by this PR. The observed failures above will therefore be bypassed without modifying their unrelated producers. Raw controls, complete failure-set comparison and original CI artifacts are retained under /tmp/rea-maintenance-20261023/5629/.

@gensokyo-dev
gensokyo-dev merged commit 5d2c8c2 into morluto:main Oct 23, 2026
35 of 46 checks passed
@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
@morluto morluto added area: cli CLI adapter and one-shot commands enhancement New feature or request labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add JSON Lines output for large row-oriented results

3 participants