Skip to content

[guard-coverage] Add set_issue_fields to github-guard write classification and DIFC rules#4049

Merged
lpcox merged 3 commits intomainfrom
copilot/fix-guard-coverage-gap-set-issue-fields
Apr 18, 2026
Merged

[guard-coverage] Add set_issue_fields to github-guard write classification and DIFC rules#4049
lpcox merged 3 commits intomainfrom
copilot/fix-guard-coverage-gap-set-issue-fields

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

Guard coverage drifted after upstream added set_issue_fields: it was not classified as a mutating MCP operation and had no explicit DIFC labeling path, so it fell through default handling.

This PR adds classification and labeling coverage, and incorporates review feedback to clarify scope semantics (org-level field definitions vs repo-scoped issue mutation target).

  • Write-operation classification (tools.rs)

    • Added set_issue_fields to READ_WRITE_OPERATIONS.
    • Added a dedicated classification test for set_issue_fields.
    • Clarified inline comments to avoid implying it is a generic org-scoped mutation.
  • DIFC labeling (tool_rules.rs)

    • Added an explicit set_issue_fields match arm in apply_tool_labels (separate from the generic granular issue PATCH group) with documented scope rationale.
    • Labeling remains:
      • secrecy: repo visibility scoped
      • integrity: writer scoped (writer_integrity(repo_id, ...))
  • Coverage hardening (labels/mod.rs, tools.rs tests)

    • Added a dedicated DIFC labeling test for set_issue_fields.
    • Kept granular issue update loop tests focused on update_issue_* tools, with set_issue_fields validated independently to prevent scope ambiguity regressions.
// Issue custom field mutation (field definitions are org-level; target issue is repo-scoped)
"set_issue_fields", // GraphQL — sets custom field values on a specific repository issue

> [!WARNING]
>
>

Copilot AI changed the title [WIP] Fix guard coverage gap for set_issue_fields operation [guard-coverage] Add set_issue_fields to github-guard write classification and DIFC rules Apr 18, 2026
Copilot AI requested a review from lpcox April 18, 2026 01:06
@lpcox lpcox marked this pull request as ready for review April 18, 2026 01:14
Copilot AI review requested due to automatic review settings April 18, 2026 01:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Aligns the set_issue_fields MCP tool with existing write/mutation handling in the GitHub rust-guard by adding explicit operation classification and DIFC labeling coverage, and extending tests to prevent coverage drift.

Changes:

  • Added set_issue_fields to READ_WRITE_OPERATIONS and extended classification tests.
  • Added set_issue_fields to apply_tool_labels granular write match arm for repo-scoped secrecy + writer integrity.
  • Extended DIFC labeling tests to include set_issue_fields alongside other granular issue update tools.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/tools.rs Classifies set_issue_fields as read-write and adds coverage in the granular issue update classification test.
guards/github-guard/rust-guard/src/labels/tool_rules.rs Adds set_issue_fields to the granular write labeling arm (repo visibility secrecy + writer integrity).
guards/github-guard/rust-guard/src/labels/mod.rs Extends the granular issue update DIFC test set to include set_issue_fields.

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: 2

Comment on lines 99 to 103
"update_issue_state", // PATCH — opens or closes an issue
"update_issue_title", // PATCH — modifies issue title
"update_issue_type", // PATCH — modifies issue type
"set_issue_fields", // GraphQL — sets org-level custom field values on an issue

Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The new set_issue_fields entry is described as setting org-level custom field values, but it’s grouped with repo-scoped granular issue PATCH tools. Please reconcile the scope in the comment/grouping (or move it near projects_write-related tooling) so future readers don’t assume it follows the same repo-scoped semantics as update_issue_* tools.

Copilot uses AI. Check for mistakes.
Comment on lines 543 to 547
| "update_issue_state"
| "update_issue_title"
| "update_issue_type"
| "set_issue_fields"
| "add_sub_issue"
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

set_issue_fields is added under the "Granular repo-scoped write operations" match arm, but its name/comment imply it may be an org-scoped Projects/custom-fields mutation. Please confirm the tool’s scope and argument shape and adjust labeling accordingly (e.g., if it’s truly org-scoped, it may need baseline_scope = owner / writer_integrity(owner, ...) similar to projects_write, rather than repo visibility secrecy + writer_integrity(repo_id, ...)).

Copilot uses AI. Check for mistakes.
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented Apr 18, 2026

@copilot address this review feedback #4049 (review)

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot address this review feedback #4049 (review)

Addressed in 20642f1. I clarified set_issue_fields scope semantics by separating it from the generic granular issue PATCH grouping, added explicit repo-scoped rationale in tool_rules.rs, and added dedicated tests for set_issue_fields classification and labeling.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build2410220249/b514/launcher.test /tmp/go-build2410220249/b514/launcher.test -test.testlogfile=/tmp/go-build2410220249/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cfg�� olang.org/grpc@v-errorsas olang.org/grpc@v-ifaceassert x_amd64/vet -p ions =0 x_amd64/vet .cfg�� 1257892/b385/_pkg_.a 1257892/b288/_cgo_.o x_amd64/vet 1257892/b288/_x0runc g/grpc/status 1257892/b288/_x003.o x_amd64/vet (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build2410220249/b496/config.test /tmp/go-build2410220249/b496/config.test -test.testlogfile=/tmp/go-build2410220249/b496/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build2410220249/b389/vet.cfg @v1.1.3/cpu/cpu.go1.25.8 1257892/b151/ x_amd64/vet /tmp/go-build425/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet ternal/engine/wa-atomic lcache/go/1.25.8-bool x_amd64/vet 1257�� CsQlTmGwP -I x_amd64/vet --gdwarf-5 --64 -o x_amd64/vet (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build2410220249/b514/launcher.test /tmp/go-build2410220249/b514/launcher.test -test.testlogfile=/tmp/go-build2410220249/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cfg�� olang.org/grpc@v-errorsas olang.org/grpc@v-ifaceassert x_amd64/vet -p ions =0 x_amd64/vet .cfg�� 1257892/b385/_pkg_.a 1257892/b288/_cgo_.o x_amd64/vet 1257892/b288/_x0runc g/grpc/status 1257892/b288/_x003.o x_amd64/vet (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build2410220249/b514/launcher.test /tmp/go-build2410220249/b514/launcher.test -test.testlogfile=/tmp/go-build2410220249/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cfg�� olang.org/grpc@v-errorsas olang.org/grpc@v-ifaceassert x_amd64/vet -p ions =0 x_amd64/vet .cfg�� 1257892/b385/_pkg_.a 1257892/b288/_cgo_.o x_amd64/vet 1257892/b288/_x0runc g/grpc/status 1257892/b288/_x003.o x_amd64/vet (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build2410220249/b523/mcp.test /tmp/go-build2410220249/b523/mcp.test -test.testlogfile=/tmp/go-build2410220249/b523/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cfg�� olang.org/grpc@v1.80.0/backoff.go olang.org/grpc@v1.80.0/balancer_wrapper.go x_amd64/vet --gdwarf-5 telabs/wazero/in-qE -o x_amd64/vet .cfg�� /auth/apikey.go /auth/header.go x_amd64/vet -I 1257892/b468/ -imultiarch x_amd64/vet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@lpcox lpcox merged commit 7ccee20 into main Apr 18, 2026
20 checks passed
@lpcox lpcox deleted the copilot/fix-guard-coverage-gap-set-issue-fields branch April 18, 2026 01:51
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.

[guard-coverage] Guard coverage gap: 1 operation from github-mcp-server not fully covered

3 participants