Extract shared gist secrecy helper - #12031
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Centralizes gist visibility-to-secrecy labeling while preserving existing behavior.
Changes:
- Adds
gist_secrecy_for_itemwith focused tests. - Adds the
field_names::PUBLICconstant. - Reuses the helper in both response-labeling paths.
Show a summary per file
| File | Description |
|---|---|
labels/constants.rs |
Adds the shared PUBLIC field constant. |
labels/helpers.rs |
Adds and tests canonical gist secrecy logic. |
labels/response_items.rs |
Uses the shared helper for item labels. |
labels/response_paths.rs |
Uses the shared helper for path labels. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. The result is INCONCLUSIVE (not FAIL) per the defined criteria.
|
🔒 mcpg Read-Only Stress — gVisor (
|
| Part | Surface | Op | Result | Expected | Status |
|---|---|---|---|---|---|
| A1 | MCP | list_issues | 3 issues returned | ALLOWED | ✅ |
| A2 | MCP | list_pull_requests | 3 PRs returned | ALLOWED | ✅ |
| A3 | MCP | get_file_contents (README.md) | data returned | ALLOWED | ✅ |
| A4 | MCP | list_commits | 3 commits returned | ALLOWED | ✅ |
| B1 | MCP | add_issue_comment (reaction) | unknown tool — absent from catalog |
BLOCKED | |
| B2 | MCP | star_repository | unknown tool — absent from catalog |
BLOCKED | |
| B3 | MCP | issue_write (create) | unknown tool — absent from catalog |
BLOCKED | |
| B4 | MCP | add_issue_comment (body) | unknown tool — absent from catalog |
BLOCKED | |
| B5 | MCP | create_branch | unknown tool — absent from catalog |
BLOCKED | |
| B6 | MCP | create_or_update_file | unknown tool — absent from catalog |
BLOCKED | |
| B7 | MCP | create_pull_request | unknown tool — absent from catalog |
BLOCKED | |
| C1 | CLI | list_issues (github CLI) | data returned | ALLOWED | ✅ |
| C2 | CLI | get_file_contents (github CLI) | data returned | ALLOWED | ✅ |
| D1–D6 | CLI | REST writes (gh api) | gh unauthenticated (no GH_TOKEN) | BLOCKED | |
| E1–E3 | CLI | GraphQL mutations (gh api graphql) | gh unauthenticated (no GH_TOKEN) | BLOCKED |
Overall: INCONCLUSIVE
- Part B (all 7 targets): All write tools were absent from the MCP tool catalog (backend launched with
GITHUB_READ_ONLY=1). This confirms the gh-aw framework's own defense-in-depth guarantee. Gateway-level DIFC/guard enforcement could not be independently confirmed since no write-capable tool call reached the gateway's enforcement layer. Per the test methodology, this is INCONCLUSIVE (not FAIL). - Parts D & E:
ghis not authenticated in this environment (GH_TOKENnot set). REST and GraphQL write blocking via token-scope boundary could not be validated this run. No writes were attempted or succeeded. - No writes leaked through any surface.
Run: §33182947834
🔒 mcpg read-only stress (gVisor runtime) by Read-Only Stress: gVisor runtime
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No artifacts were created. Run ID: 33182948013.
|
Gist response labeling duplicated the same
publicfield lookup and public/private secrecy decision in both item-based and path-based labelers. This centralizes that rule so future gist secrecy changes happen in one place.Shared gist secrecy logic
gist_secrecy_for_item(item)inlabels/helpers.rs.publicdefaults to public/empty secrecy.Field-name constant
field_names::PUBLICto replace raw"public"lookups.Call-site cleanup
response_items.rsandresponse_paths.rsto use the shared helper.