Skip to content

Add deterministic, opt-in security patch review stages - #627

Draft
tdullien1 wants to merge 10 commits into
mainfrom
codex/deterministic-patch-review-stages
Draft

Add deterministic, opt-in security patch review stages#627
tdullien1 wants to merge 10 commits into
mainfrom
codex/deterministic-patch-review-stages

Conversation

@tdullien1

Copy link
Copy Markdown
Collaborator

Summary

Add optional, programmatically enforced review stages for generated security patches so patch scope, local coding conventions, and merge risk are evaluated independently before a patch or draft pull request is accepted.

Changes

  • Add opt-in --review-minimality, --review-style, and --assess-patch-risk stages to both patching entry points.
  • Run each selected reviewer in a separate read-only session, validate structured verdicts, and fail closed on blocked, malformed, or rejected reviews.
  • Add --max-review-revisions for bounded author revisions; restart earlier reviews after later-stage changes and reconcile conflicting reviewer decisions once.
  • Share a behavior-preserving, minimal-change policy and prior reviewer decisions across authors, revisions, and reviewers. Keep broader redesign proposals in PR comments or patch summaries rather than generated code.
  • Bundle the patch-risk assessment skill, schema, references, and deterministic patch-materialization utilities, including sparse-checkout support.
  • Add focused workflow coverage and document the optional flags and default behavior.

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.
  • Root README formatting and Python syntax checks for both risk-assessment scripts — passed.

Risk and rollout

All new 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; malformed, blocked, or inconsistent verdicts stop patch publication. The bundled risk-assessment schema accounts for most of the added lines.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

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