Skip to content

Add decision engine v1 - #20

Merged
mt4110 merged 2 commits into
mainfrom
feat/phase211-220-decision-engine-v1
May 15, 2026
Merged

mt4110 merged 2 commits into
mainfrom
feat/phase211-220-decision-engine-v1

Conversation

@mt4110

@mt4110 mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add evidence and decision schema v1 with hard gate, score, waiver, and runtime layers.
  • Add critical supply-chain hard gate evaluation, decision replay, and PR comment decision summaries.
  • Document waiver bindings and decision replay, with golden and integration coverage for decision output.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • git diff --check

@mt4110
mt4110 marked this pull request as ready for review May 15, 2026 00:09
Copilot AI review requested due to automatic review settings May 15, 2026 00:09
@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@mt4110 mt4110 self-assigned this May 15, 2026
@mt4110 mt4110 added the main mainブランチ label May 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 replay plus 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.

Comment thread crates/patchgate-core/src/model.rs
Comment thread crates/patchgate-cli/src/main.rs Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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".

@mt4110
mt4110 merged commit 38aca39 into main May 15, 2026
18 checks passed
@mt4110
mt4110 deleted the feat/phase211-220-decision-engine-v1 branch May 15, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main mainブランチ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants