Repository navigation
Implement diff correctness gates - #21
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a "diff correctness" check pipeline that replaces the text-only patch parser with a NUL-safe raw/numstat collection pass plus typed file metadata (path id, file kind, path-safety flags), introduces a pr scope using merge-base(base, head)…head, switches the default generated-code mode to decay, and wires CI/docs to use the new merge-base flow with fail-closed enforce semantics.
Changes:
- New
DiffOptions,ScopeMode::Pr,DiffFileMetadata,FileKind,PathSafetyFlag,evaluate_diff_correctness(DIFF-001..010) and--head-refCLI flag with merge-base resolution and on-demandgit fetch. - NUL-safe
parse_raw_status_z+apply_numstat_z+ patch sample collector, symlink/LFS classification, case-insensitive (with NFC normalization) collision detection, and a fail-closed report when the changed-file limit is exceeded. - CI workflow drops the manual
git resetPR materialization in favor of--scope prwith--base-ref/--head-ref, default[generated_code].modeflips fromexcludetodecay, and docs/config examples updated.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/patchgate-core/src/runner.rs | Core diff pipeline rewrite, new diff-correctness checks, PR scope, metadata, classification |
| crates/patchgate-core/src/model.rs | Adds DiffCorrectness check id, plugin file metadata fields, raw-path-id-aware evidence digest |
| crates/patchgate-core/src/lib.rs | Re-exports new diff types |
| crates/patchgate-core/Cargo.toml + Cargo.lock | Adds unicode-normalization dep |
| crates/patchgate-core/tests/scope_mode_boundaries.rs | New PR scope + special-path/binary/submodule/symlink/LFS fixtures |
| crates/patchgate-core/tests/runner_integration_flow.rs | Bumps expected check count from 3→4 |
| crates/patchgate-config/src/types.rs | Default generated_code.mode → decay |
| crates/patchgate-config/src/lib.rs | Allows pr in scope.mode; default test updated |
| crates/patchgate-cli/src/main.rs | --head-ref flag, PR base/head resolution + fetch, fail-closed report path, enforce overrides on_exceed |
| config/policy.toml.example | Documents pr scope and decay default |
| docs/02_config_reference.md, docs/03_cli_reference.md, README.md | Doc updates for new scope/flags/defaults |
| docs/patchgate-action.yml | Switches workflow to --scope pr with merge-base, drops manual git reset |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e30d71e3da
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
Validation
Notes
Behavior Change
[generated_code].modenow defaults todecayrather thanexclude; repos that need the previous skip semantics should pingenerated_code.mode = "exclude"in policy.