Skip to content

[log] Add debug logging to config/guard_policy_public.go - #17109

Merged
lpcox merged 1 commit into
mainfrom
log/guard-policy-public-logging-39a361546203d5f9
Nov 22, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/guard-policy-public-logging-39a361546203d5f9

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds debug logging (config:guard_policy_public, via logger.ForFile()) to internal/config/guard_policy_public.go.

Logged: early-return paths (nil / write-sink-only policy, nil raw map), allow-only creation, forcing repos=public, inapplicable map policies, and canonical allow-only key injection. Log arguments have no side effects.

Validation: go vet ./internal/config, go test ./internal/config, and go build -o awmg all pass.

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

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

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

The reviewed change is limited to adding debug observability around existing public-repository policy paths, with no active review issues identified.

No open issues 🎉

What changed in this PR

Adds debug logging to internal/config/guard_policy_public.go to make public-repository policy decisions and early-return paths observable without changing policy behavior.

Changes:

  • Initializes the config:guard_policy_public file-scoped logger.
  • Logs nil, write-sink-only, policy creation, map handling, and canonical key injection paths.
  • Logs public-repository enforcement decisions while preserving existing policy transformations.
File Description
internal/​config/​guard_policy_public.go Adds debug logging around ForcePublicRepos and ForcePublicReposInMap policy decisions and mutation paths.

Review effort: Lite (adaptive)

@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 AWF container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED PASS
B MCP writes (reaction, star, issue, comment, branch, file, PR) all 7 write targets absent from the github tool catalog (23 tools, all read-only) - no write attempted BLOCKED INCONCLUSIVE
C CLI reads data returned ALLOWED PASS
D CLI REST writes (reaction, star, issue, comment) gh not authenticated (no GH_TOKEN) - boundary not exercised BLOCKED INCONCLUSIVE
E CLI GraphQL mutations (addReaction, addStar, createIssue) gh not authenticated - boundary not exercised BLOCKED INCONCLUSIVE

Overall: INCONCLUSIVE

Part B: the gh-aw tools.github wrapper forces GITHUB_READ_ONLY=1 on the backend, so write tools are structurally never registered - this proves backend/toolset config, not mcpg's own gateway-level block, hence INCONCLUSIVE rather than PASS.
Parts D/E: gh auth status reports not logged in in this job, so REST/GraphQL write-rejection could not be independently exercised in this run.

No write succeeded; no artifact was created or leaked in any part of this test.

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

@lpcox
lpcox merged commit b77ea7b into main Nov 22, 2026
28 checks passed
@lpcox
lpcox deleted the log/guard-policy-public-logging-39a361546203d5f9 branch November 22, 2026 23:40
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