Skip to content

[log] Add debug logging to enclavegithub route matching - #12129

Merged
lpcox merged 2 commits into
mainfrom
log-enhance/enclavegithub-route-1788045923-7664f02709fcc810
Aug 30, 2026
Merged

[log] Add debug logging to enclavegithub route matching#12129
lpcox merged 2 commits into
mainfrom
log-enhance/enclavegithub-route-1788045923-7664f02709fcc810

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds debug logging to internal/enclavegithub/route.go, a file that previously had no logger.

Changes

  • Added a new logger: var logRoute = logger.New("enclavegithub:route") following the pkg:filename naming convention.
  • Added 5 meaningful logRoute.Printf calls inside MatchRoute:
    • Function entry logging the incoming path
    • When no route pattern matches the path
    • When repository normalization fails or is inconsistent
    • When a query parameter is rejected as unsupported
    • On successful route match, logging the resolved operation and repository

Validation

  • go build -o awmg . — succeeds
  • go vet ./internal/enclavegithub/... — clean
  • go test ./internal/enclavegithub/... -v — all tests pass (including TestMatchRoute and TestMatchRouteRejectsBroadSurface)
  • gofmt -l — no formatting issues

Single-file, focused change with no side effects introduced in log arguments.

Generated by Go Logger Enhancement · copilot · auto · 70.5 AIC · ⊞ 13K ·

Add logRoute logger (enclavegithub:route namespace) to MatchRoute,
logging path matching attempts, unmatched routes, repository
normalization failures, rejected query parameters, and successful
route matches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Aug 29, 2026
@lpcox
lpcox marked this pull request as ready for review August 30, 2026 15:58
Copilot AI balanced review requested due to automatic review settings August 30, 2026 15:58

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.

🟡 Changes recommended

The new logger should follow the repository’s logger.ForFile() convention.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds debug logging for enclave GitHub route matching and rejection paths.

Changes:

  • Adds route-level logging for entry, rejection, normalization, and success.
  • Introduces a dedicated logger namespace.
File summaries
File Description
internal/enclavegithub/route.go Adds route-matching diagnostics.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/enclavegithub/route.go Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default AWF

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues/PRs/commits, get_file_contents) data returned (status=200) ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 7 tools absent from catalog BLOCKED ⚠️
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) gh unauthenticated (GH_TOKEN not set) BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated (GH_TOKEN not set) BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: All 7 MCP write tools absent from catalog (23 read-only tools exposed). The backend runs with GITHUB_READ_ONLY=1, stripping write tools before they reach the gateway. This confirms the gh-aw defense-in-depth guarantee but does not independently confirm the gateway's own DIFC/guard write-enforcement layer.

⚠️ Parts D & E: gh is not authenticated (GH_TOKEN not set in this workflow). All CLI write attempts returned gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable (exit 4). Token-scope boundary cannot be validated in this run.

No writes leaked. No issues, comments, branches, files, PRs, reactions, or stars were created.

References: §33321775234

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — gvisor

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: gVisor (runsc) kernel-level isolation

Part Surface Op Result Expected Status
A MCP reads (list_issues/PRs/commits, get_file_contents) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 7 tools absent from 23-tool catalog BLOCKED ⚠️
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) gh unauthenticated — no GH_TOKEN BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated — no GH_TOKEN BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: GITHUB_READ_ONLY=1 suppresses all write tool registration at the backend — write tools were absent from the 23-tool catalog (unknown tool [-32602]). No write leaked, but mcpg's own DIFC/guard enforcement layer was not independently exercised. This is the expected structural limitation for any tools.github: workflow.

⚠️ Parts D & E: gh CLI is not authenticated in this environment (no GH_TOKEN). Both REST write and GraphQL mutation probes returned "set the GH_TOKEN environment variable" — no writes attempted. Token-scope boundary untestable in this run.

No writes leaked. Reads succeeded on both MCP and CLI surfaces.

References: §33321775284

🔒 mcpg read-only stress (gVisor runtime) by Read-Only Stress: gVisor runtime

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — docker-sbx

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: docker-sbx (KVM-isolated microVM)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all tools absent from catalog BLOCKED ⚠️
C CLI reads (github list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes gh unauthenticated (Bad credentials) BLOCKED ⚠️
E CLI GraphQL mutations gh unauthenticated (Bad credentials) BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: MCP catalog exposes only 23 read-only tools (backend runs with GITHUB_READ_ONLY=1). All 7 write tool calls returned Error [-32602]: unknown tool. This confirms gh-aw's own defense-in-depth (write tools never registered), but does not independently confirm mcpg's DIFC/guard enforcement layer, since no write-capable backend was reached.

⚠️ Parts D & E: GH_TOKEN is invalid (Bad credentials). REST write attempts and GraphQL mutations via gh api cannot be assessed in this run. Token-scope boundary not exercised.

No writes succeeded. No FAIL conditions detected.

References: §33321775250

🔒 mcpg read-only stress (docker-sbx runtime) by Read-Only Stress: docker-sbx runtime

@lpcox
lpcox merged commit d30c067 into main Aug 30, 2026
38 checks passed
@lpcox
lpcox deleted the log-enhance/enclavegithub-route-1788045923-7664f02709fcc810 branch August 30, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants