Skip to content

Add independently verified Codex reviews - #606

Open
choijhyeok wants to merge 7 commits into
openai:mainfrom
choijhyeok:feat/verified-review
Open

Add independently verified Codex reviews#606
choijhyeok wants to merge 7 commits into
openai:mainfrom
choijhyeok:feat/verified-review

Conversation

@choijhyeok

Copy link
Copy Markdown

Why

A single review pass can mix real defects with style preferences, false positives, or findings that are difficult to reproduce. That leaves users choosing between acting on unverified feedback and manually re-investigating every finding.

This PR adds an explicit evidence step so review output is more trustworthy before code is changed or shipped.

What this adds

  • Adds /codex:verified-review: one native Codex review followed by a fresh, ephemeral, read-only verification turn.
  • Maps every native finding one-to-one to confirmed, false-positive, style-only, or unverified.
  • Supports working-tree and branch targets, foreground/background execution, and existing status/result/cancel flows.
  • Accepts repeated --check "<command>" values as the only user-authorized validation commands.
  • Fails closed on ambiguous native output, missing or duplicate finding mappings, missing or duplicate checks, and unauthorized command execution.

Benefits

  • Higher signal-to-noise: actionable defects stay distinct from style-only feedback and false positives.
  • Better auditability: each classification includes evidence plus exact check output.
  • Safer automation: verification remains read-only, while validation commands are an explicit trust boundary.
  • Predictable failure behavior: incomplete evidence is reported as unverified instead of being presented as certainty.
  • Better long-running UX: verified reviews work with background job status, result, and cancellation.

Safety and tradeoffs

  • The feature never edits reviewed files.
  • --check text is preserved exactly and only explicitly supplied commands count as authorized validation.
  • Other command executions are accepted only when Codex app-server classifies every action as read/list/search; unknown or executable actions fail closed.
  • A verified review uses an additional Codex turn, so it takes more time and usage than a normal review.
  • Background start/cancel/progress/completion transitions are serialized so cancellation cannot be overwritten.

Validation

  • 106/106 tests passing
  • npm run build
  • npm run check-version
  • git diff --check

Known gap

  • Live Windows app-server command-action classification was not exercised locally.

Native review output can mix actionable defects, style notes, and false positives.
Add a second read-only Codex pass that maps every native finding to evidence,
runs only explicitly authorized validation commands, and fails closed when
evidence or command accounting is ambiguous.

Constraint: Native Codex review output is Markdown and verifier command execution is a local trust boundary
Rejected: Trust a single review pass | no independent evidence or one-to-one finding accounting
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep verified review read-only and preserve exact --check command text
Tested: 106/106 tests, npm run build, npm run check-version, git diff --check
Not-tested: Live Windows app-server command action classification
@choijhyeok
choijhyeok requested a review from a team August 6, 2026 07:57

@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: 307ff56224

ℹ️ 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 plugins/codex/commands/verified-review.md Outdated
Claude Code expands slash-command arguments before Bash runs, so raw input
cannot safely be quoted inside the command template. Capture the exact input
in a blocking expansion hook and pass only a session/workspace-bound,
single-use UUID to the companion.

Constraint: Claude Code substitutes $ARGUMENTS before Bash parses the command
Rejected: Quote or base64 inside Bash | shell parsing occurs before safe encoding
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Never reintroduce raw slash arguments into verified-review shell commands
Tested: 111/111 tests; focused security tests 3/3; npm run build; npm run check-version; git diff --check; Sol high independent review
Not-tested: Claude Code versions without UserPromptExpansion support fail closed

@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: 3d59617c93

ℹ️ 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 plugins/codex/scripts/lib/args.mjs
Comment thread plugins/codex/scripts/codex-companion.mjs Outdated
Inline long-option parsing discarded text after a second equals sign, while
finding extraction erased indentation before deciding where findings began.
Preserve full inline values and parse native review structure before
normalizing its text.

Constraint: Explicit check commands must remain exact user-authorized input
Constraint: Native findings require stable one-to-one verification IDs
Rejected: Reject inline values containing equals signs | valid environment-assignment checks need them
Rejected: Normalize all review lines before parsing | indentation and fences carry finding structure
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Preserve raw option values and native review structure before normalization
Tested: 114/114 tests; npm run build; npm run check-version; node syntax; git diff --check; Sol high independent review
Not-tested: Unfenced column-zero diff markers remain syntactically ambiguous with top-level plus bullets

@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: 20316cd6be

ℹ️ 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 plugins/codex/commands/verified-review.md Outdated
The verified-review command protected companion invocation with captured input
but still suggested interpolating a user-provided base ref during size
estimation. Branch reviews now skip Bash sizing and use the safe background
default; only fixed working-tree commands remain.

Constraint: Raw slash-command refs must not enter model-generated shell commands
Rejected: Add a companion sizing subcommand | background-by-default closes the boundary without new runtime surface
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Never interpolate raw base or ref values into verified-review preflight Bash
Tested: 9/9 command tests; npm run build; npm run check-version; git diff --check; Sol high independent review
Not-tested: Tiny branch reviews now intentionally skip size-based foreground recommendations

@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: 042b8d36ce

ℹ️ 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 plugins/codex/scripts/codex-companion.mjs
Reuse the canonical review result shape validator before classifying verified findings, so incomplete verifier JSON cannot produce a successful exit.

Constraint: Verified review must not succeed without the complete result schema
Rejected: Duplicate verifier-only validation because rendering already owns the canonical shape check
Confidence: high
Scope-risk: narrow
Reversibility: clean
Tested: 115/115 tests; npm run build; npm run check-version; git diff --check

@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: 6bec4b2385

ℹ️ 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 plugins/codex/scripts/codex-companion.mjs
Comment thread plugins/codex/scripts/codex-companion.mjs
Validate every verified finding before accepting the verifier output. Record detached worker PIDs without overwriting cancellation, and route session cleanup through the same job lock.

Constraint: Verified reviews must fail closed and background workers must not outlive their Claude session
Rejected: New schema-validation dependency and worker handshake protocol
Confidence: high
Scope-risk: narrow
Reversibility: clean
Tested: 116/116 tests; npm run build; npm run check-version; git diff --check

@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: d3a1de1257

ℹ️ 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 plugins/codex/scripts/codex-companion.mjs Outdated
Comment thread plugins/codex/scripts/codex-companion.mjs
Serialize native findings as JSON so multiline evidence cannot become sibling prompt entries, and reject inverted verified-review line ranges before rendering.

Constraint: Verified evidence must retain exact finding boundaries and valid source ranges
Rejected: Custom escaping or schema-validation dependency
Confidence: high
Scope-risk: narrow
Reversibility: clean
Tested: 116/116 tests; npm run build; npm run check-version; git diff --check

@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: 981513e483

ℹ️ 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 on lines +601 to +603
const shapeError = validateReviewResultShape(parsed.parsed);
if (shapeError) {
return invalidVerifiedReview(parsed, shapeError);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce the verifier schema before succeeding

Fresh evidence beyond the earlier missing-field fix is that this path still only uses the loose renderer shape check, which accepts any non-empty verdict and any next_steps array contents; a verifier response like verdict: "bogus" with otherwise one-to-one findings therefore passes the remaining checks and exits successfully. In the verified-review flow that violates the supplied JSON schema/fail-closed contract and can publish an invalid “verified” result, so validate against VERIFIED_REVIEW_SCHEMA or mirror its enum and array-item checks before computing success.

Useful? React with 👍 / 👎.

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.

1 participant