Skip to content

[log] Add debug logging to cmd/flags_logging.go - #16060

Merged
lpcox merged 2 commits into
mainfrom
log/flags-logging-7416e45818a704db
Nov 6, 2026
Merged

lpcox merged 2 commits into
mainfrom
log/flags-logging-7416e45818a704db

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Adds a cmd:flags_logging debug logger to internal/cmd/flags_logging.go, with two calls: one when the logging flags are registered, and one reporting the default flag values (log-dir, payload-dir, wasm-cache-dir, payload-size-threshold, url-domain-audit).

The log arguments only read existing package variables and have no side effects.

Validation: go vet ./internal/cmd, go test ./internal/cmd and go build all pass.

Generated by Go Logger Enhancement · copilot · auto · ~27 AIC · ⊞ 6.3K · ◷

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

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

An active finding remains in internal/cmd/flags_logging.go because it uses logger.New instead of the repository’s preferred file-derived logger.ForFile constructor.

1 open issue
What changed in this PR

Adds debug logging to the logging-related CLI flag registration path in internal/cmd/flags_logging.go, exposing registration timing and resolved default values through the cmd:flags_logging namespace.

Changes:

  • Adds a dedicated cmd:flags_logging logger.
  • Logs when logging flags are registered.
  • Logs defaults for log, payload, WASM cache, payload threshold, and URL-domain auditing settings.

Review note: The logger should use the file-derived constructor rather than logger.New to match repository conventions and remain aligned if the file is renamed. (Nit, 2 votes.)

File Description
internal/​cmd/​flags_logging.go Defines the logging namespace and emits registration/default-value debug messages.

Review effort: Lite (auto)

Comment thread internal/cmd/flags_logging.go Resolved
@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

github-actions Bot commented Nov 6, 2026

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 OK
B MCP writes (add_issue_comment/star_repository/issue_write/create_branch/create_or_update_file/create_pull_request) all 7 targets absent from the 23-tool catalog - unknown tool BLOCKED WARN
C CLI reads (list_issues, get_file_contents via gateway-backed github CLI) data returned ALLOWED OK
D CLI REST writes (reaction/star/issue/comment) gh not authenticated in this environment - not attempted BLOCKED WARN
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh not authenticated - not attempted BLOCKED WARN

Overall: INCONCLUSIVE

Part B: all 7 targeted write tools were absent from the backend's exposed catalog (23 read-only tools only), consistent with gh-aw's GITHUB_READ_ONLY=1 always-on backend config. This proves backend/toolset configuration blocks the call before it reaches the gateway - it does NOT independently confirm mcpg's own gateway-level write-blocking layer (DIFC/guards), since no write tool ever reached a write-capable backend to be refused at call-time.

Parts D/E: gh auth status reported 'not logged into any GitHub hosts' - the proxied-CLI token-scope boundary could not be exercised this run.

No write leaked through any surface in this run. Full detail saved to /tmp/gh-aw/agent/readonly-stress-42239927023.txt on the runner.

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

@lpcox
lpcox merged commit ef4dc79 into main Nov 6, 2026
29 checks passed
@lpcox
lpcox deleted the log/flags-logging-7416e45818a704db branch November 6, 2026 15:21
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