Skip to content

Add synthetic guard coverage for CLI-only issue, repository, and Projects v2 mutations#7888

Merged
lpcox merged 4 commits into
mainfrom
copilot/guard-coverage-add-cli-mutations
Jun 21, 2026
Merged

Add synthetic guard coverage for CLI-only issue, repository, and Projects v2 mutations#7888
lpcox merged 4 commits into
mainfrom
copilot/guard-coverage-add-cli-mutations

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

The GitHub guard already covered the upstream github-mcp-server tool surface, but it still missed 7 mutating operations reachable through gh. Those gaps meant CLI-only repository deletion, issue deletion, and several Projects v2 mutations could bypass the guard’s synthetic tool classification and DIFC labeling.

  • Add missing synthetic write operations

    • Extend WRITE_OPERATIONS in the Rust guard to cover:
      • delete_repository
      • delete_issue
      • update_project
      • delete_project
      • copy_project
      • link_project
      • unlink_project
  • Align DIFC labeling with existing mutation patterns

    • Treat delete_issue and delete_repository as repo-scoped destructive writes, using the same secrecy/integrity rules as other repository mutations.
    • Fold the new Projects v2 synthetic operations into the existing org-scoped projects_write labeling path so they inherit owner-scoped writer integrity consistently.
  • Lock in coverage with focused guard tests

    • Add classification coverage for the new synthetic write operations.
    • Add label-parity tests proving the new Projects operations behave the same as projects_write.
    • Add repo-scoped write tests for delete_issue and delete_repository.

Example of the new coverage shape:

"projects_write"
| "copy_project"
| "delete_project"
| "link_project"
| "unlink_project"
| "update_project" => {
    if !owner.is_empty() {
        baseline_scope = Cow::Borrowed(owner.as_str());
        integrity = writer_integrity(&baseline_scope, ctx);
    }
}

GitHub Advanced Security started work on behalf of lpcox June 21, 2026 16:11 View session
GitHub Advanced Security finished work on behalf of lpcox June 21, 2026 16:13
Copilot AI changed the title [WIP] Add CLI-only mutations to guard coverage Add synthetic guard coverage for CLI-only issue, repository, and Projects v2 mutations Jun 21, 2026
Copilot AI requested a review from lpcox June 21, 2026 16:18
Copilot finished work on behalf of lpcox June 21, 2026 16:18
GitHub Advanced Security started work on behalf of lpcox June 21, 2026 16:26 View session
GitHub Advanced Security finished work on behalf of lpcox June 21, 2026 16:28
@lpcox lpcox marked this pull request as ready for review June 21, 2026 17:10
Copilot AI review requested due to automatic review settings June 21, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR closes synthetic-guard coverage gaps for mutating operations reachable via gh (CLI-only) by extending the Rust GitHub guard’s write-operation classification and ensuring DIFC labels for these operations match existing mutation patterns.

Changes:

  • Extend WRITE_OPERATIONS to include CLI-only mutations: delete_repository, delete_issue, and several Projects v2 operations (copy_project, update_project, delete_project, link_project, unlink_project).
  • Apply labeling rules so delete_issue/delete_repository are treated as repo-scoped destructive writes, and the new Projects v2 operations inherit the existing org-scoped projects_write labeling path.
  • Add/extend focused unit tests to lock in classification coverage and label parity.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/tools.rs Adds new synthetic CLI-only mutating operations to the write-operation classifier and extends coverage tests.
guards/github-guard/rust-guard/src/labels/tool_rules.rs Ensures new synthetic operations follow existing repo-scoped and Projects v2 labeling paths for secrecy/integrity.
guards/github-guard/rust-guard/src/labels/mod.rs Adds parity/regression tests validating Projects alias labeling and repo-scoped write integrity for destructive deletes.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment thread guards/github-guard/rust-guard/src/labels/tool_rules.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
GitHub Advanced Security started work on behalf of lpcox June 21, 2026 17:15 View session
GitHub Advanced Security finished work on behalf of lpcox June 21, 2026 17:16
@lpcox

lpcox commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

@copilot fix failing ci checks

Both tls.go and tls_config.go declared MinTLSVersion, NewServerTLSConfig,
and NewClientTLSConfig, causing a redeclaration compile error. The tls_config.go
file was accidentally introduced in the previous session; tls.go is the
canonical file that exists on main. Remove the duplicate and its test file.

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix failing ci checks

Fixed in 51a0bb8. The failures were caused by internal/httputil/tls_config.go (and its test file) being accidentally introduced alongside internal/httputil/tls.go in the previous commit — both declared the same symbols (MinTLSVersion, NewServerTLSConfig, NewClientTLSConfig), causing a redeclaration compile error. tls_config.go is not present on main; I've removed it and its test file to restore clean compilation.

Copilot finished work on behalf of lpcox June 21, 2026 17:25
GitHub Advanced Security started work on behalf of lpcox June 21, 2026 17:28 View session
GitHub Advanced Security finished work on behalf of lpcox June 21, 2026 17:30
@lpcox lpcox merged commit c02fd60 into main Jun 21, 2026
27 checks passed
@lpcox lpcox deleted the copilot/guard-coverage-add-cli-mutations branch June 21, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants