Repository navigation
Align direct-file integrity with PR content restrictions - #15654
Merged
Merged
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix PR reviews blocked by diff/file-list integrity labels
Align direct-file integrity with PR content restrictions
Oct 28, 2026
lpcox
marked this pull request as ready for review
October 28, 2026 03:44
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical labeling gaps still allow arbitrary revision content to receive approved integrity through resource-bearing responses and proxy paths that discard revision provenance.
4 open issues
What changed in this PR
Centralizes revision-integrity handling in the GitHub guard to align direct-file reads with the PR-content restrictions described in #15653.
Changes:
- Shares SHA/ref integrity rules across resource, item, and path labels, with SHA taking precedence.
- Adds regression coverage for revision reads, response shapes, and PR metadata trust boundaries.
- Documents limitations of reviews at
approvedintegrity and policy options for isolated reviewers.
| File | Description |
|---|---|
internal/proxy/pr_content_guard_test.go |
Adds compiled-guard filtering regressions. |
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Applies shared integrity rules to file resources. |
guards/github-guard/rust-guard/src/labels/response_paths.rs |
Aligns file path labels and updates expectations. |
guards/github-guard/rust-guard/src/labels/response_items.rs |
Applies shared integrity rules to file items. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Tests revision consistency and metadata/content separation. |
guards/github-guard/rust-guard/src/labels/helpers.rs |
Introduces the shared revision-integrity helper. |
guards/github-guard/docs/LABELING.md |
Explains file and PR-content labeling boundaries. |
docs/CONFIGURATION.md |
Documents review limitations and explicit policy choices. |
Review effort: Max
| } | ||
| } | ||
| match tool_args.get("ref") { | ||
| None => merged_integrity(repo_full_name, ctx), |
| } else { | ||
| writer_integrity(&repo_full_name, ctx) | ||
| }; | ||
| let file_integrity = file_content_integrity(tool_args, &repo_full_name, ctx); |
Comment on lines
+2048
to
+2050
| Some(Value::String(branch_ref)) if is_default_branch_ref(branch_ref) => { | ||
| merged_integrity(repo_full_name, ctx) | ||
| } |
| Some(Value::String(branch_ref)) if is_default_branch_ref(branch_ref) => { | ||
| merged_integrity(repo_full_name, ctx) | ||
| } | ||
| _ => none_integrity(repo_full_name, ctx), |
Collaborator
|
@copilot address review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Contributor
Author
Addressed the review feedback in |
This was referenced Oct 28, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


PR diffs and file lists are denied at
min-integrity: approved, while direct reads of the same head revision could succeed without content endorsement. This change closes that inconsistency without promoting patch trust from PR metadata.Consistent provenance enforcement
noneto non-emptyshaand non-defaultrefreads;shatakes precedence overref.Explicit review boundary
approvedremains unsupported without revision-bound endorsement.approvedand reporting incomplete coverage from explicitly accepting untrusted input in an isolated reviewer.Regression coverage