Skip to content

Model gh codespace stop as a guarded write operation - #8764

Merged
lpcox merged 2 commits into
mainfrom
copilot/guard-coverage-fix
Jul 6, 2026
Merged

Model gh codespace stop as a guarded write operation#8764
lpcox merged 2 commits into
mainfrom
copilot/guard-coverage-fix

Conversation

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The GitHub guard had a CLI-only coverage gap: gh codespace stop could reach a write endpoint without a modeled guard entry. This change closes that gap by classifying the operation explicitly in the Rust guard’s write-operation set.

  • What changed

    • Added stop_codespace to WRITE_OPERATIONS in guards/github-guard/rust-guard/src/tools.rs
    • Kept the list ordering intact for binary_search-based classification
  • Regression coverage

    • Extended the existing CLI gap regression test to assert that stop_codespace is treated as a write operation
    • Reuses the current pattern for other CLI-only modeled operations rather than introducing new test structure
  • Example

    pub const WRITE_OPERATIONS: &[&str] = &[
        // ...
        "stop_codespace", // gh codespace stop — POST /user|/orgs/.../codespaces/.../stop
        // ...
    ];

Copilot AI changed the title [WIP] Fix guard coverage gap for GitHub CLI operation Model gh codespace stop as a guarded write operation Jul 6, 2026
Copilot AI requested a review from lpcox July 6, 2026 03:43
Copilot finished work on behalf of lpcox July 6, 2026 03:43
@lpcox
lpcox marked this pull request as ready for review July 6, 2026 12:52
Copilot AI review requested due to automatic review settings July 6, 2026 12:52

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 a GitHub guard classification gap by explicitly modeling gh codespace stop as a write operation in the Rust GitHub guard, ensuring the gateway’s DIFC enforcement treats it as a guarded write.

Changes:

  • Added stop_codespace to the WRITE_OPERATIONS set used for binary_search-based write classification.
  • Extended the existing CLI-coverage regression test to assert stop_codespace is recognized as a write operation.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/tools.rs Adds stop_codespace to the sorted write-operation list and updates the CLI gap regression test accordingly.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Low

@lpcox
lpcox merged commit b00d829 into main Jul 6, 2026
43 checks passed
@lpcox
lpcox deleted the copilot/guard-coverage-fix branch July 6, 2026 12:56
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 / GitHub CLI not fully covered

3 participants