feat(cli): assess patch risk on request - #664
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsFinding details are still loading. Check the individual review comments. ℹ️ 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1851875a73
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1851875 to
7b3f03d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b3f03d6fc
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7b3f03d to
e862877
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e862877f02
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1061b62 to
203e169
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 203e169630
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
53916e5 to
8b72d46
Compare
8b72d46 to
63e7de4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63e7de42ad
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
63e7de4 to
5ffbda5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ffbda52c4
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ef05f7d to
711c48c
Compare
5ffbda5 to
4983b48
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4983b489d6
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Add an opt-in
patch --assess-patch-riskpath that assesses only the completed patch, returns the full report in the command result, and adds the concise Markdown summary to a draft pull request body when--create-pris also selected. Supplied file, literal, and Linear issue patches can now use the same draft pull request path.Changes
--assess-patch-riskonly to the existingpatchcommandpatchRisk.report--create-pr, requiring a clean starting worktree and publishing only files changed by the patch runpatch --resume-prretries the same publicationTesting
pnpm run types— passedpnpm run build— passedpnpm run format— passedgit diff --check— passednpx --yes bun@1.3.13 test --timeout 30000 ./tests-ts/cli-patch.test.ts ./tests-ts/cli-skills.test.ts ./tests-ts/patch-risk-contract.test.ts— 69 passed at the rebased feature headnpx --yes bun@1.3.13 test --timeout 30000 ./tests-ts/cli-patch.test.ts --test-name-pattern "creates a draft pull request with the Linear patch-risk summary"— passed after the public fixture identifier was replaced with a synthetic valuenpx --yes bun@1.3.13 test --timeout 30000 ./tests-ts— 1,905 passed, 30 platform skips, and one sandbox-only process-inspection failure on the preceding feature headnpx --yes bun@1.3.13 test --timeout 30000 ./tests-ts/publication-integration.test.ts --test-name-pattern "keeps no-signal SDK publication in the host process group"— passed outside the restricted process-inspection sandboxRisk and rollout
The public flag defaults to off, so existing patch commands are unchanged. The assessment is advisory and never changes the patch or merge state. An explicitly requested assessment failure stops the command before pull request publication. Supplied-issue pull request creation now requires a clean worktree so pre-existing changes cannot be included. With both flags selected, model-authored concise Markdown is included in the draft pull request body; the validated JSON stays in the local command result. No pull request comment is created.
Public disclosure review
Change impact
One opt-in patch flow now fixes supplied issues, assesses the generated-only tree delta, and puts only the concise risk summary into the draft pull request body.
Source evidence (5)
sdk/typescript/src/cli.ts:L4013-L4067— Supplied issues start from a clean tree, then the CLI computes the generated file delta, optionally assesses it, and creates the draft pull request.sdk/typescript/src/cli.ts:L4955-L4986— The pull request body keeps only the concise summary, while one recognized issue identifier or a deterministic digest names the patch branch.sdk/typescript/src/cli.ts:L5128-L5169— Publication persists the exact body, rejects a dirty supplied-issue base, and lists only files changed during the patch run.sdk/typescript/tests-ts/cli-patch.test.ts:L248-L390— The E2E runs the exact Linear-style flag combination against real temporary Git repositories and verifies the immutable artifact, branch, commit, push, summary-only body, and local full report.sdk/typescript/README.md:L833-L875— The CLI documentation describes the opt-in assessment, supplied-issue draft pull request, and clean-worktree requirement.Collection limit
pr-walkthroughREST collector hit GitHub's authenticated core rate limit. The current PR identity and exact base/head SHAs were recollected through GitHub GraphQL, and the source ranges above were verified from the exact local Git objects.