Repository navigation
Preserve singleton REST responses with nested labels - #15007
Conversation
Co-authored-by: lpcox <[email protected]>
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Root-array label responses lose approved integrity and can be incorrectly filtered or rejected.
1 open finding
What changed in this PR
Updates the GitHub guard to preserve singleton REST responses containing nested label metadata.
Changes:
- Excludes
labelsfrom generic collection inference. - Handles
get_labelswrappers explicitly. - Adds singleton tests with empty and nonempty labels.
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/labels/response_paths.rs | Adds method-specific label-wrapper extraction. |
| guards/github-guard/rust-guard/src/labels/helpers.rs | Removes generic label-array inference and adds regression tests. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write succeeded or leaked on any surface in this run.
|

The proxy treated a pull request’s nested
/labelsarray as the response collection. For unlabeled PRs, this reduced a valid singleton response to[]; labeled PRs were vulnerable to the same shape corruption.labelsfrom generic REST collection inference.issue_read(method=get_labels)labeling for label-list responses.labelsarrays.{ "number": 42, "title": "Pull request", "labels": [] }This response remains a top-level object rather than being serialized as
[].