feat(cli): add deterministic minimality and coding-style patch reviews - #628
Open
tdullien1 wants to merge 13 commits into
Open
feat(cli): add deterministic minimality and coding-style patch reviews#628tdullien1 wants to merge 13 commits into
tdullien1 wants to merge 13 commits into
Conversation
# Conflicts: # sdk/typescript/src/cli.ts
tdullien1
marked this pull request as ready for review
August 24, 2026 12:21
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ianw-oai
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add opt-in, programmatically enforced review stages for generated security patches so minimality and local coding style are independently evaluated before a patch or draft pull request is accepted.
Problem description
There are two primary impacts from this:
Impact of PR
--review-minimalityand--review-styleflags to both patching entry points.--max-review-revisionsdetermines how often a stage should be retried.Enabling these two steps reduces median patch/PR size by 50%+ in my experiments, and greatly reduces my own annoyance at overbroad "slop" patches that are difficult to review and test. The generated patches are more expensive (impact on token use still has to be quantified); the current PR keeps the original workflow intact, so the cost increase is optional.
A follow-on PR will add @soyeon-oai's risk analysis skill into this, including into the deterministic workflow.
Individual example
On a specific issue, CARCOD-8726, the initial patch author prompt creates a patch with 281 lines of production-code change (not counting tests etc.) due to an overly ambitious refactoring attempt and writing test harnesses to compensate for missing dependencies. Iterative reviews bring this down to 27 lines of production code changed. Manual review / human-expert curated change is 17 lines of code, so these changes reduce the fix size from approximately 10x human expert to approximately 2x human expert (on a single change).
-- End of human-authored PR description --
Changes
--review-minimalityand--review-styleflags to both patching entry points.--max-review-revisionsfor bounded author revisions and restart earlier reviews after later-stage changes.Testing
bun test --timeout 30000 tests-ts/cli-skills.test.ts tests-ts/cli-patch.test.ts— 66 tests passed.node scripts/generate-models.cjs --check— passed.node node_modules/typescript/bin/tsc --noEmit— passed.node node_modules/prettier/bin/prettier.cjs --check --ignore-path .gitignore --ignore-path .prettierignore '**/*.{cjs,mjs,js,ts,tsx,json,md}'— passed.cli.test.tsrun encounters existing bulk-scan fixture failures that reproduce unchanged on the original branch.Risk and rollout
Both review stages are opt-in and disabled by default. Reviewers run read-only and cannot apply or merge patches. Explicit revision budgets bound corrective loops, and malformed, blocked, or inconsistent verdicts stop patch publication. No risk-assessment bundle, schema, or external artifact contract is included.
Public disclosure review