Skip to content

[log] Add debug logging to guard registry - #16363

Merged
lpcox merged 1 commit into
mainfrom
log/guard-registry-0bc716d083cae992
Nov 12, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/guard-registry-0bc716d083cae992

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds 6 debug log calls to internal/guard/registry.go using the existing logRegistry logger: Has, HasNonNoopSourceGuard (write-sink skip, source guard found, none found), Close (count and per-guard), and RegisterGuardType. No side effects in log arguments.

Validation: go vet and go test ./internal/guard pass; go build succeeds.

Note: all files lacking loggers were either already processed or in packages that would cause import cycles with internal/logger, so this file with sparse coverage was chosen.

Generated by Go Logger Enhancement · copilot · auto (Claude Sonnet 5.5) · ~36 AIC · ⊞ 6.5K · ◷

@github-actions github-actions Bot added automation enhancement New feature or request labels Nov 11, 2026
@lpcox
lpcox marked this pull request as ready for review November 12, 2026 01:11
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 01:11

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.

🟢 Approval recommended

No active review issues are reported, and the change is limited to adding debug observability around existing guard-registry operations.

No open issues 🎉

What changed in this PR

Adds debug-level observability to the guard registry while preserving existing guard behavior and registry semantics.

Changes:

  • Logs guard lookup and source-guard detection decisions, including skipped write-sink guards.
  • Logs guard shutdown counts and individual closures.
  • Logs dynamic guard-type registrations.
File Description
internal/​guard/​registry.go Adds debug logging to guard lookups, source-guard detection, shutdown, and guard-type registration.

Review effort: Lite (auto)

@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 (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) all 6 targets absent from gateway tool catalog (23 read-only tools only) BLOCKED ⚠️
C CLI reads (list_issues, get_file_contents via proxied github CLI) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh not authenticated — not attempted BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh not authenticated — not attempted BLOCKED ⚠️

Overall: INCONCLUSIVE

(⚠️ = INCONCLUSIVE — Part B: none of the 6 write tools were present in the gateway-exposed catalog at all (backend runs with GITHUB_READ_ONLY=1 per gh-aw framework), so gateway-level call-time blocking could not be independently exercised. Parts D/E: gh auth status showed no authenticated host in this run, so REST/GraphQL write rejection via token scope could not be confirmed. No write leaked in any probe.)

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

@lpcox
lpcox merged commit d1bad73 into main Nov 12, 2026
27 of 28 checks passed
@lpcox
lpcox deleted the log/guard-registry-0bc716d083cae992 branch November 12, 2026 01:16
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.

2 participants