Skip to content

fix: make native review JSON contract explicit - #732

Open
fscfede-beep wants to merge 1 commit into
openai:mainfrom
fscfede-beep:fix/native-review-json-contract-679
Open

fix: make native review JSON contract explicit#732
fscfede-beep wants to merge 1 commit into
openai:mainfrom
fscfede-beep:fix/native-review-json-contract-679

Conversation

@fscfede-beep

Copy link
Copy Markdown

Summary

Fixes #679.

The built-in review path intentionally returns prose rather than schema-shaped findings, but its --json payload previously omitted result, rawOutput, and parseError entirely. Consumers could not distinguish "no structured output exists" from a parse failure.

This makes the contract explicit without heuristically parsing reviewer prose:

  • result: null
  • rawOutput: the native review text
  • parseError: an actionable explanation that built-in review returns prose and adversarial-review should be used for structured output
  • reasoningSummary: exposed consistently with the structured review path

Human-readable review output is unchanged.

Validation

Windows 11 / Node 26.3.1:

  • test-first reproduction failed on main because payload.result was undefined
  • native JSON contract + existing review regressions: 3 passed, 0 failed
  • node --check plugins/codex/scripts/codex-companion.mjs
  • git diff --check

@fscfede-beep
fscfede-beep requested a review from a team September 4, 2026 18:08

@sylvesterkaczmarek sylvesterkaczmarek 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.

Making the JSON contract explicit is preferable to heuristic prose parsing. result: null distinguishes “no structured result exists” from a successful empty findings set, while rawOutput preserves the native reviewer output and parseError tells structured consumers which command owns that contract. Mirroring reasoningSummary at the same level also keeps the native and adversarial paths easier to consume consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review --json emits no result (and no parseError): the built-in reviewer path never produces schema-shaped output, unlike adversarial-review

2 participants