Repository navigation
Add decision engine v1 - #20
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Adds the first version of PatchGate’s decision engine, extending scan reports with evidence/decision artifacts and enabling decision replay from saved outputs.
Changes:
- Introduces evidence and decision schema types with hard-gate, score, waiver, and runtime result layers.
- Adds critical supply-chain hard-gate evaluation and embeds decision summaries in CLI/text/GitHub outputs.
- Adds
patchgate decision replayplus documentation and tests for decision artifacts and replay behavior.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/patchgate-core/src/model.rs |
Adds evidence/decision schema models and decision evaluation logic. |
crates/patchgate-core/src/runner.rs |
Refreshes decisions after scan evaluation and tests supply-chain hard-gate behavior. |
crates/patchgate-core/src/lib.rs |
Re-exports new decision/evidence public types. |
crates/patchgate-core/Cargo.toml |
Adds chrono for waiver expiration validation. |
crates/patchgate-config/src/types.rs |
Extends waiver entries with decision binding fields. |
crates/patchgate-cli/src/main.rs |
Adds decision replay command and enriches scan/comment output with decision summaries. |
crates/patchgate-cli/tests/scan_integration.rs |
Adds integration coverage for emitted decision/evidence and replay from scan reports. |
docs/02_config_reference.md |
Documents waiver binding fields and critical supply-chain scoping. |
docs/03_cli_reference.md |
Documents patchgate decision replay. |
config/policy.toml.example |
Updates waiver example comments for decision v1 bindings. |
Cargo.lock |
Records the new core dependency on chrono. |
Comments suppressed due to low confidence (1)
crates/patchgate-cli/src/main.rs:8284
- The hard-gate failure summary is built from
gate.evidence_ids, which includes waived evidence as well as unwaived evidence for a mixed gate. This can display waived findings as the reason the gate failed; filter out waived evidence IDs before rendering the failure summary or include only unwaived IDs in failed gate results.
let evidence = gate
.evidence_ids
.iter()
.take(2)
.map(|id| evidence_summary_for_comment(report, id))
.collect::<Vec<_>>()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ 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
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacegit diff --check