Skip to content

[log] Add debug logging to WASM guard discovery - #17272

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
log/wasm-discovery-logging-eab40d288b27e5d8
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
log/wasm-discovery-logging-eab40d288b27e5d8

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds four debug log calls to internal/guard/wasm_discovery.go, reusing the existing logWasm logger:

  • FindGuardFile entry (serverID)
  • Fallback from the baked-in container guard to the guards directory
  • Directory entries skipped during guard discovery
  • Failure to read the guard directory (before the error is returned)

Log arguments are plain values with no side effects. go vet ./internal/guard, go test ./internal/guard and go build pass.

Generated by Go Logger Enhancement · copilot · routed: sonnet55 high · ~33 AIC · ⊞ 5.9K · history

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Nov 24, 2026
@lpcox
lpcox marked this pull request as ready for review November 25, 2026 02:23
Copilot AI adaptive review requested due to automatic review settings November 25, 2026 02:23

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 discovery fallback reports all stat failures as “not found,” masking permission or I/O errors instead of preserving or distinguishing the underlying cause.

1 open issue
What changed in this PR

Adds debug-level observability to WASM guard discovery without changing discovery behavior or error handling.

Changes:

  • Logs entry into FindGuardFile and fallback from the baked-in guard.
  • Logs skipped directory entries during guard discovery.
  • Logs guard-directory read failures before returning the existing error.
File Description
internal/​guard/​wasm_discovery.go Adds four logWasm debug messages around WASM guard discovery, fallback behavior, skipped entries, and directory-read failures.

Review effort: Lite (adaptive)

logWasm.Printf("Found baked-in container guard: %s", ContainerGuardWasmPath)
return ContainerGuardWasmPath, true, nil
}
logWasm.Printf("Baked-in container guard not found, falling back to guards directory: serverID=%s", serverID)
@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

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, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) not attempted — no write tools in catalog (only 23 read-only tools exposed) BLOCKED ⚠️
C CLI reads (same github CLI proxy surface) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) not attempted — gh unauthenticated BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) not attempted — gh unauthenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: the github MCP tool catalog fronted by mcpg in this workflow exposes only 23 read-only tools (list_issues, list_pull_requests, get_file_contents, list_commits, etc.); none of the targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) appear in the catalog at all. This confirms backend/toolset configuration (consistent with gh-aw always launching the backend with GITHUB_READ_ONLY=1) but cannot independently confirm the gateway's own DIFC/guard write-blocking layer, since no write tool call ever reaches a write-capable backend.

⚠️ Parts D/E: gh auth status reports "You are not logged into any GitHub hosts" — gh is unauthenticated in this environment, so the token-scope write-rejection boundary could not be exercised.

No writes were attempted (per safety rules) since neither precondition for a meaningful write-refusal test was present. Part A/C reads fully succeeded, confirming the read surface works correctly under the default runtime.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant