Repository navigation
fix(review): verdict trust: only the engine blocks, policy from the base branch, allowForceTier - #1722
fix(review): verdict trust: only the engine blocks, policy from the base branch, allowForceTier#1722RaghwendraSingh wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
8 issues found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/opencode/test/altimate/review.test.ts">
<violation number="1" location="packages/opencode/test/altimate/review.test.ts:145">
P2: This fixture update leaves the unknown-confidence regression test ineffective: `u()` has no engine evidence, so its findings are classified as catalog and excluded before confidence is evaluated. Add deterministic-engine evidence to `u()` (or reuse the engine fixture) so the test proves three unknown engine warnings cannot block.</violation>
</file>
<file name="packages/opencode/src/altimate/review/format.ts">
<violation number="1" location="packages/opencode/src/altimate/review/format.ts:221">
P2: This note misidentifies the policy file when the repository uses the supported `.altimate/review.yaml` or `.altimate/review.json` filename. Use a generic `review policy` label or carry the selected filename into the envelope before rendering.</violation>
</file>
<file name="packages/opencode/test/altimate/review-verdict-trust.test.ts">
<violation number="1" location="packages/opencode/test/altimate/review-verdict-trust.test.ts:115">
P3: These integration tests leak one temporary Git repository per case. Use the repository test fixture or remove each root in a `finally` block so repeated test runs do not accumulate temp directories.</violation>
</file>
<file name="packages/opencode/src/altimate/review/finding.ts">
<violation number="1" location="packages/opencode/src/altimate/review/finding.ts:104">
P1: `findingOrigin` trusts caller-supplied `origin`, so a catalog or untrusted finding can label itself `engine` and block. Always derive the origin from `evidence.tool` and overwrite any supplied origin before computing and signing the verdict.</violation>
<violation number="2" location="packages/opencode/src/altimate/review/finding.ts:107">
P1: The namespace prefix is too broad for the trust boundary: an unrecognized `altimate_core.*` tool is promoted to `engine` and can block. Replace the prefix check with an explicit allowlist of the known deterministic evidence tools so new tools remain catalog until classified.</violation>
</file>
<file name="packages/opencode/src/altimate/review/run.ts">
<violation number="1" location="packages/opencode/src/altimate/review/run.ts:415">
P2: `policy.hash` is stale whenever a CLI override changes the effective configuration, especially `--severity`, whose value is not signed elsewhere. Recompute the hash from the effective user-configured settings after applying overrides so the signed policy metadata identifies the settings that produced the verdict.
(Based on your team's feedback about hashing effective review settings.)</violation>
</file>
<file name="docs/docs/usage/dbt-pr-review.md">
<violation number="1" location="docs/docs/usage/dbt-pr-review.md:289">
P1: The base policy does not prevent workflow flags from relaxing the review: `--mode` and `--severity` override it after loading. Document these overrides and tell users to protect the workflow separately.</violation>
</file>
<file name="packages/opencode/src/altimate/review/git.ts">
<violation number="1" location="packages/opencode/src/altimate/review/git.ts:269">
P1: This catch treats every `git show` failure as a missing policy, so an unavailable or corrupt base object silently falls back to `DEFAULT_REVIEW_CONFIG` and can bypass the base branch's restrictions. Only suppress the expected missing-path error; rethrow other Git failures.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| if (f.origin) return f.origin | ||
| const tool = f.evidence?.tool ?? "" | ||
| if (tool === "ai-review") return "ai" | ||
| if (tool.startsWith("altimate_core.") || ENGINE_TOOLS.has(tool)) return "engine" |
There was a problem hiding this comment.
P1: The namespace prefix is too broad for the trust boundary: an unrecognized altimate_core.* tool is promoted to engine and can block. Replace the prefix check with an explicit allowlist of the known deterministic evidence tools so new tools remain catalog until classified.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/finding.ts, line 107:
<comment>The namespace prefix is too broad for the trust boundary: an unrecognized `altimate_core.*` tool is promoted to `engine` and can block. Replace the prefix check with an explicit allowlist of the known deterministic evidence tools so new tools remain catalog until classified.</comment>
<file context>
@@ -84,9 +84,36 @@ export const Finding = z.object({
+ if (f.origin) return f.origin
+ const tool = f.evidence?.tool ?? ""
+ if (tool === "ai-review") return "ai"
+ if (tool.startsWith("altimate_core.") || ENGINE_TOOLS.has(tool)) return "engine"
+ return "catalog"
+}
</file context>
| commit the PR branched from, so a PR cannot relax the rules it is reviewed | ||
| under (switch to `comment` mode, drop a `blockOn` category, exclude its own | ||
| paths). If the PR edits the file, the comment lists the changed settings; they | ||
| take effect after merge. The applied policy's hash is signed into the envelope | ||
| (`policy`). |
There was a problem hiding this comment.
P1: The base policy does not prevent workflow flags from relaxing the review: --mode and --severity override it after loading. Document these overrides and tell users to protect the workflow separately.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/docs/usage/dbt-pr-review.md, line 289:
<comment>The base policy does not prevent workflow flags from relaxing the review: `--mode` and `--severity` override it after loading. Document these overrides and tell users to protect the workflow separately.</comment>
<file context>
@@ -271,16 +271,32 @@ exclude:
+### Which policy applies, and what can block
+
+- **The base branch's `.altimate/review.yml` applies.** The file is read from the
+ commit the PR branched from, so a PR cannot relax the rules it is reviewed
+ under (switch to `comment` mode, drop a `blockOn` category, exclude its own
+ paths). If the PR edits the file, the comment lists the changed settings; they
</file context>
| commit the PR branched from, so a PR cannot relax the rules it is reviewed | |
| under (switch to `comment` mode, drop a `blockOn` category, exclude its own | |
| paths). If the PR edits the file, the comment lists the changed settings; they | |
| take effect after merge. The applied policy's hash is signed into the envelope | |
| (`policy`). | |
| merge-base, so changing `.altimate/review.yml` in a PR cannot relax the | |
| config-derived policy (for example, by dropping `blockOn` categories or | |
| excluding its own paths). Workflow flags such as `--mode` and `--severity` | |
| still override policy, so protect the workflow separately. If the PR edits the | |
| file, the comment lists the changed settings; they take effect after merge. | |
| The applied policy's hash is signed into the envelope (`policy`). |
| /** The layer a finding came from. Unknown or missing evidence counts as | ||
| * `catalog`, so a new detector can never block until it is classified. */ | ||
| export function findingOrigin(f: Pick<Finding, "evidence" | "origin">): FindingOrigin { | ||
| if (f.origin) return f.origin |
There was a problem hiding this comment.
P1: findingOrigin trusts caller-supplied origin, so a catalog or untrusted finding can label itself engine and block. Always derive the origin from evidence.tool and overwrite any supplied origin before computing and signing the verdict.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/finding.ts, line 104:
<comment>`findingOrigin` trusts caller-supplied `origin`, so a catalog or untrusted finding can label itself `engine` and block. Always derive the origin from `evidence.tool` and overwrite any supplied origin before computing and signing the verdict.</comment>
<file context>
@@ -84,9 +84,36 @@ export const Finding = z.object({
+/** The layer a finding came from. Unknown or missing evidence counts as
+ * `catalog`, so a new detector can never block until it is classified. */
+export function findingOrigin(f: Pick<Finding, "evidence" | "origin">): FindingOrigin {
+ if (f.origin) return f.origin
+ const tool = f.evidence?.tool ?? ""
+ if (tool === "ai-review") return "ai"
</file context>
| export async function showAtRef(cwd: string, ref: string, rel: string): Promise<string | undefined> { | ||
| try { | ||
| return await git(["show", `${ref}:${rel}`], cwd) | ||
| } catch { |
There was a problem hiding this comment.
P1: This catch treats every git show failure as a missing policy, so an unavailable or corrupt base object silently falls back to DEFAULT_REVIEW_CONFIG and can bypass the base branch's restrictions. Only suppress the expected missing-path error; rethrow other Git failures.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/git.ts, line 269:
<comment>This catch treats every `git show` failure as a missing policy, so an unavailable or corrupt base object silently falls back to `DEFAULT_REVIEW_CONFIG` and can bypass the base branch's restrictions. Only suppress the expected missing-path error; rethrow other Git failures.</comment>
<file context>
@@ -261,6 +261,16 @@ export async function resolveReviewBase(opts: ResolveBaseOptions): Promise<Resol
+export async function showAtRef(cwd: string, ref: string, rel: string): Promise<string | undefined> {
+ try {
+ return await git(["show", `${ref}:${rel}`], cwd)
+ } catch {
+ return undefined
+ }
</file context>
| notes.push(`${env.scope.outOfScopeFiles} changed file(s) outside the dbt project were not reviewed.`) | ||
| if (env.policy?.changedInPr?.length) { | ||
| notes.push( | ||
| `This PR changes the review policy (\`.altimate/review.yml\`: ${env.policy.changedInPr.join(", ")}). ` + |
There was a problem hiding this comment.
P2: This note misidentifies the policy file when the repository uses the supported .altimate/review.yaml or .altimate/review.json filename. Use a generic review policy label or carry the selected filename into the envelope before rendering.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/format.ts, line 221:
<comment>This note misidentifies the policy file when the repository uses the supported `.altimate/review.yaml` or `.altimate/review.json` filename. Use a generic `review policy` label or carry the selected filename into the envelope before rendering.</comment>
<file context>
@@ -216,6 +216,12 @@ export function coverageNotes(env: VerdictEnvelope): string[] {
notes.push(`${env.scope.outOfScopeFiles} changed file(s) outside the dbt project were not reviewed.`)
+ if (env.policy?.changedInPr?.length) {
+ notes.push(
+ `This PR changes the review policy (\`.altimate/review.yml\`: ${env.policy.changedInPr.join(", ")}). ` +
+ "The base branch's policy was applied; the change takes effect after merge.",
+ )
</file context>
| `This PR changes the review policy (\`.altimate/review.yml\`: ${env.policy.changedInPr.join(", ")}). ` + | |
| `This PR changes the review policy (${env.policy.changedInPr.join(", ")}). ` + |
| staleManifest, | ||
| layout, | ||
| suppressPortability: config.portability === undefined ? dialectKnown : !config.portability, | ||
| policy: { source: policy.source, hash: policy.hash, changedInPr: policy.changedInPr.length ? policy.changedInPr : undefined }, |
There was a problem hiding this comment.
P2: policy.hash is stale whenever a CLI override changes the effective configuration, especially --severity, whose value is not signed elsewhere. Recompute the hash from the effective user-configured settings after applying overrides so the signed policy metadata identifies the settings that produced the verdict.
(Based on your team's feedback about hashing effective review settings.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/run.ts, line 415:
<comment>`policy.hash` is stale whenever a CLI override changes the effective configuration, especially `--severity`, whose value is not signed elsewhere. Recompute the hash from the effective user-configured settings after applying overrides so the signed policy metadata identifies the settings that produced the verdict.
(Based on your team's feedback about hashing effective review settings.) </comment>
<file context>
@@ -392,6 +412,7 @@ export async function reviewPullRequest(opts: ReviewPullRequestOptions): Promise
staleManifest,
layout,
suppressPortability: config.portability === undefined ? dialectKnown : !config.portability,
+ policy: { source: policy.source, hash: policy.hash, changedInPr: policy.changedInPr.length ? policy.changedInPr : undefined },
scope: {
baseRef: resolved?.ref ?? opts.base,
</file context>
| }) | ||
|
|
||
| async function repo(baseYml: string | undefined, headYml: string | undefined) { | ||
| const root = await fs.realpath(await fs.mkdtemp(path.join(tmpdir(), "review-policy-"))) |
There was a problem hiding this comment.
P3: These integration tests leak one temporary Git repository per case. Use the repository test fixture or remove each root in a finally block so repeated test runs do not accumulate temp directories.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/test/altimate/review-verdict-trust.test.ts, line 115:
<comment>These integration tests leak one temporary Git repository per case. Use the repository test fixture or remove each root in a `finally` block so repeated test runs do not accumulate temp directories.</comment>
<file context>
@@ -0,0 +1,174 @@
+ })
+
+ async function repo(baseYml: string | undefined, headYml: string | undefined) {
+ const root = await fs.realpath(await fs.mkdtemp(path.join(tmpdir(), "review-policy-")))
+ await g(root, "init", "-q", "-b", "main")
+ await g(root, "config", "user.email", "t@test")
</file context>
|
|
||
| /** File content at a commit (`git show <ref>:<path>`), or undefined when the | ||
| * path does not exist there. `rel` is repository-relative, POSIX. */ | ||
| export async function showAtRef(cwd: string, ref: string, rel: string): Promise<string | undefined> { |
There was a problem hiding this comment.
WARNING: A failed git show is silently treated as "no config at the base commit"
readFirst treats the undefined returned here as "candidate absent" and moves on, so loadReviewPolicy falls back to DEFAULT_REVIEW_CONFIG (mode: comment, allowForceTier: true) and stamps policy.source: "default" — indistinguishable from "the base branch has no config". Any git-level failure (bad object, missing shallow history, permissions, git erroring for a reason other than the path being absent) therefore silently demotes a gate policy to the permissive default instead of surfacing it, which is the opposite of the trust property this PR adds. git cat-file -e <ref>:<path> (or checking the exit code/stderr) would distinguish "path missing at that commit" from "git failed" and let the latter throw.
| if (origin === "engine") return true | ||
| if (origin === "ai") return false | ||
| const rule = catalogRuleId(f) | ||
| return !!rule && rubric.blockingRules.includes(rule) |
There was a problem hiding this comment.
WARNING: blockingRules entries are matched by exact string and never validated
Rule ids are emitted by two catalogs with different conventions (rule-catalog uses hardcoded-credential, dbt-patterns uses pii_into_mart), and nothing checks that a configured id exists. A typo, a case difference, or the other convention therefore leaves the gate silently non-blocking — the exact failure mode a team opting a rule in wants to avoid — with no error and no note in the comment. Consider validating rubric.blockingRules against the known catalog ids when the rubric is resolved (warning when an entry matches nothing) and documenting where teams can find the ids.
| changedInPr: string[] | ||
| } | ||
|
|
||
| function canonical(value: unknown): string { |
There was a problem hiding this comment.
SUGGESTION: canonical duplicates stableStringify in verdict.ts
verdict.ts:278 already implements this exact algorithm (keys sorted at every depth, array order preserved, undefined dropped) for the signature body. Export that helper (or move it to a shared module) and use it for policyHash too: policy.hash is signed alongside the signature body, so the two canonicalizations should stay identical by construction instead of being two copies that can drift.
| }): Promise<ReviewPolicy> { | ||
| if (!opts.readBase) { | ||
| const config = await loadReviewConfig(opts.cwd) | ||
| const present = await readFirst((rel) => fs.readFile(path.join(opts.cwd, rel), "utf8").catch(() => undefined)) |
There was a problem hiding this comment.
SUGGESTION: The no-git branch reads the same candidate file twice
loadReviewConfig above has already scanned CANDIDATE_FILES and read the first existing file; this second readFirst repeats the same read sequence only to learn whether a file was present, and the candidate loop is now written a third time here. Folding both into one helper that returns { text, rel } | undefined (and parsing that text once) removes the extra I/O and the chance of the two passes disagreeing if the file changes between them.
| const out: string[] = [] | ||
| const keys = new Set([...Object.keys(base), ...Object.keys(head)]) as Set<keyof ReviewConfig> | ||
| for (const k of [...keys].sort()) { | ||
| if (canonical(base[k]) === canonical(head[k])) continue |
There was a problem hiding this comment.
SUGGESTION: Comparing parsed partial configs reports settings spelled out at their default values as changes
Representation, not effective policy, drives this comparison. A base file with mode: gate parses to rubric: {}; a PR that adds rubric:\n thresholds:\n warehouseCostMinRows: 1000000 (the default) parses to a full rubric.thresholds object, so the PR comment claims it "changes the review policy (rubric.thresholds)" that "takes effect after merge" even though the resolved rubric is identical. Comparing resolveRubric(...) results (and normalized top-level values) instead of the raw partials would keep the note to genuine behavior changes.
| throw new Error("--force-tier is disabled by `allowForceTier: false` in the base branch's .altimate/review.yml") | ||
| } | ||
| if (opts.manifestPath) config.manifestPath = opts.manifestPath | ||
| if (opts.mode) config.mode = opts.mode |
There was a problem hiding this comment.
SUGGESTION: policy.hash is computed before these overrides, so it can describe a different policy than the envelope
loadReviewPolicy hashes the file config, then this line and the severityThreshold override mutate config, and the envelope later records policy.hash next to mode: config.mode / severityThreshold. With --mode gate (which github/review/action.yml always passes) the signed hash says comment while the signed mode says gate, so an auditor cannot check that the hashed policy is the one that was applied. Hashing after the overrides, or documenting that the hash covers only the config file, would remove the ambiguity.
| title: "t", | ||
| body: "b", | ||
| file: `m_${Math.random()}.sql`, | ||
| evidence: { tool: "altimate_core.check", result: {} }, |
There was a problem hiding this comment.
SUGGESTION: This makes the unknown-confidence test pass for the wrong reason
Adding engine evidence to mk is right for the blocking assertions, but "unknown-confidence warnings do NOT accumulate into a block" (u() around line 168) builds findings with raw makeFinding and no evidence. Those are now catalog origin and ineligible regardless of confidence, so the f.confidence !== "unknown" clause in computeIdealVerdict is no longer exercised by that test. Giving u() engine evidence (altimate_core.equivalence) keeps it guarding the confidence rule.
| ### Which policy applies, and what can block | ||
|
|
||
| - **The base branch's `.altimate/review.yml` applies.** The file is read from the | ||
| commit the PR branched from, so a PR cannot relax the rules it is reviewed |
There was a problem hiding this comment.
SUGGESTION: The docs state a stronger trust boundary than the shipped path enforces
The policy file is base-scoped, but github/review/action.yml always passes --mode/--severity from the workflow (args=(--mode "$IN_MODE" ...)), and on pull_request events that workflow comes from the PR. A PR can therefore still switch the gate to comment mode by editing .github/workflows/*.yml — the PR description notes this as out of scope, but this bullet reads as if no PR-side edit can relax the gate. Adding that caveat (and pointing at CODEOWNERS / branch protection on .github/) would keep the doc accurate.
Code Review SummaryStatus: 8 Issues Found | Recommendation: Address before merge Overview
The design is sound and the core claims check out: Issue Details (click to expand)WARNING
SUGGESTION
Notes / assumptions: this review found no path where the new code makes a non-engine finding block, and the AI lane remains non-blocking. The documented residual gap (pre-supplied Files Reviewed (12 files)
Fix these issues in Kilo Cloud Reviewed by deepseek-v4.1-flash-1017 · Input: 253.8K · Output: 46K · Cached: 3.5M Review guidance: REVIEW.md from base branch |
…ase branch, `allowForceTier` - Findings carry `origin: engine | catalog | ai` (from `evidence.tool`; unknown tools count as catalog). Only engine findings count toward REQUEST_CHANGES, matching the documented promise; a pattern rule can be opted in by id via `rubric.blockingRules`. The AI lane never blocks. - `.altimate/review.yml` is read from the merge-base commit, so a PR cannot relax the rules it is judged by. Settings the PR changes are listed in the comment and envelope (`policy.changedInPr`) and take effect after merge. The applied policy's source and hash are signed into the envelope. - `allowForceTier: false` in the base policy rejects `--force-tier` (forced runs were already recorded as `tier_forced` in `review_run`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8ce9cec to
4004ec6
Compare
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
Issue for this PR
Closes #
Stacked on #1721, which is stacked on #1720 and #1719; merge in that order.
Type of change
What does this PR do?
The README and the docs promise "only the deterministic engine blocks". In the code, any three non-AI warnings, or one regex-catalog critical (
join-no-on,create-or-replace,pii_into_mart, …), produced REQUEST_CHANGES. Separately,.altimate/review.ymlwas read from the PR's own checkout. So a PR could setmode: comment, drop ablockOncategory,excludeits own paths, or narrowreviewers, and pass under its own relaxed rules.origin: engine | catalog | ai, derived fromevidence.tool. Unknown tools count ascatalog, so a new detector can't block until someone classifies it. Onlyenginefindings count toward REQUEST_CHANGES. A pattern rule a team trusts can be allowed to block viarubric.blockingRules: [<rule id>].originis stamped inbuildEnvelopeand covered by the signature..altimate/review.ymlis read at the merge-base commit (git show <base>:<path>). The PR's version is parsed only to list what it changes; those settings show in the comment and inpolicy.changedInPrand apply once merged. The envelope signspolicy.sourceandpolicy.hash. Callers without git (pre-supplied files and content) still read the working tree.--force-tier:allowForceTier: falsein the base policy rejects the flag. Forced runs were already recorded astier_forcedinreview_run.Behavior changes:
review.ymlno longer apply to that PR.pii_into_martregex-twin tests now expect COMMENT, and the verdict unit tests use engine evidence.Not covered here: CLI flags in the workflow file (
--mode,--severity) still override the policy. Onpull_requestevents GitHub runs the workflow from the PR, so a PR could edit those flags too. Branch protection on.github/(CODEOWNERS) is the usual control there.How did you verify your code works?
test/altimate/review-verdict-trust.test.ts(11 tests):blockingRulesopt-in, and engine criticals and warning patterns still blockingGITHUB_BASE_REF: a PR relaxingmode/exclude/aistill judged in gate mode with the change shown; a PR addingreview.ymlnot applied; an unchanged policy applied with no note;allowForceTier: falserejecting--force-tierbun typecheckis clean.Cost side effects
None. One extra local
git showper run.Screenshots / recordings
N/A (CLI).
Checklist
🤖 Generated with Claude Code
Summary by cubic
Makes the review verdict deterministic and tamper-proof: only the deterministic engine can block, and a PR can no longer relax the policy it is reviewed under.
Old behavior: any three non-AI warnings, or one regex-catalog critical, produced REQUEST_CHANGES, and
.altimate/review.ymlwas read from the PR's own checkout. Now pattern-rule criticals and warning counts only comment unlessrubric.blockingRulesopts a catalog rule in, and the policy comes from the merge-base commit so a PR's edits are listed but only take effect after merge.allowForceTier: falsein the base policy rejects--force-tier.Behavior changes
origin(engine|catalog|ai) derived fromevidence.tool, stamped in the envelope and covered by the signature; unknown tools count ascatalog, so a new detector can't block until classified.enginefindings count toward REQUEST_CHANGES; the AI lane never blocks.review.ymlshow in the comment andpolicy.changedInPr, apply after merge, and the applied policy's source and hash are signed into the envelope. Non-git callers still read the working tree.pull_requestevents.Written for commit 4004ec6. Summary will update on new commits.