feat(cli): add optional sequential patch review stages - #605
Draft
tdullien1 wants to merge 3 commits into
Draft
Conversation
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 three optional, sequential review stages that help generated security patches stay minimal, match repository conventions, and receive an evidence-backed risk assessment before publication.
Changes
--review-minimalityto remove unnecessary patch changes and unrelated refactoring.--review-styleto check applicable repository instructions, local coding patterns, and project style guides.--assess-patch-riskto assess final-patch applicability, blast radius, regression protection, recoverability, and uncertainty.patchandscan --patch, preserve their fixed execution order, and reject incompatible resume or report-only usage.Most of the third commit is the existing 3,533-line assessment schema and its required skill assets; the CLI integration itself remains small and uses the existing fix-finding workflow.
Testing
bun test --timeout 30000 tests-ts/cli-skills.test.ts tests-ts/cli-patch.test.ts --only-failures— 54 passed.bun test --timeout 30000 tests-ts/cli.test.ts tests-ts/runtime.test.ts --test-name-pattern 'exposes Incur help, schemas, manifests, and completions|projects only the unchanged external payload from the source checkout'— 2 passed.bun test --timeout 30000 tests-ts/update-notice.test.ts --only-failures— 12 passed.tsc -p tsconfig.build.json— passed.tsc --noEmit— passed.git diff origin/main...HEAD --check— passed.Risk and rollout
All three flags are disabled by default, so existing patching behavior remains unchanged. Optional reviewers run inside the existing generation workflow; the risk assessor is read-only and never applies or merges a patch. The plugin-shipping manifest explicitly includes only the assessment files needed at runtime.
Public disclosure review