Skip to content

[log] Add debug logging to difc/pipeline_decisions#4457

Merged
lpcox merged 1 commit intomainfrom
log/pipeline-decisions-debug-logging-47defa69fe380a14
Apr 24, 2026
Merged

[log] Add debug logging to difc/pipeline_decisions#4457
lpcox merged 1 commit intomainfrom
log/pipeline-decisions-debug-logging-47defa69fe380a14

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Adds debug logging to internal/difc/pipeline_decisions.go using the project's logger framework.

Changes

  • Added var logPipeline = logger.New("difc:pipeline_decisions") logger declaration
  • Added import for github.com/github/gh-aw-mcpg/internal/logger
  • Added logging to all 4 pipeline decision functions:
    • ShouldBypassCoarseDeny — logs operation type and bypass decision
    • ShouldCallLabelResponse — logs operation, enforcement mode, and result
    • ShouldBlockFilteredResponse — logs mode, filtered count, and block decision
    • ShouldAccumulateReadLabels — logs operation, enforcement mode, and accumulate decision

Why This File

These four functions control critical DIFC pipeline branching:

  • Whether the pipeline bypasses coarse-grained denial to allow per-item filtering
  • Whether guards are asked to label response data
  • Whether filtered responses block the whole response
  • Whether read labels accumulate back to the agent

Logging their inputs and decisions helps troubleshoot unexpected DIFC enforcement behavior during development and production debugging.

Validation

  • go build ./... — passes
  • go vet ./... — passes
  • go test ./internal/difc/... — passes

Generated by Go Logger Enhancement · ● 1.4M ·

Log each pipeline decision function's inputs and result to help
troubleshoot DIFC enforcement behavior during development.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Apr 24, 2026
@lpcox lpcox marked this pull request as ready for review April 24, 2026 14:59
Copilot AI review requested due to automatic review settings April 24, 2026 14:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds debug-level observability to DIFC pipeline branching by introducing a dedicated logger in internal/difc/pipeline_decisions.go, making it easier to trace why specific enforcement paths were taken at runtime.

Changes:

  • Added a difc:pipeline_decisions debug logger using the project’s internal/logger framework.
  • Logged inputs and boolean outcomes for the four key pipeline decision helpers.
Show a summary per file
File Description
internal/difc/pipeline_decisions.go Introduces a package-level debug logger and emits decision-tracing logs from pipeline predicate functions.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@lpcox lpcox merged commit 4920226 into main Apr 24, 2026
26 checks passed
@lpcox lpcox deleted the log/pipeline-decisions-debug-logging-47defa69fe380a14 branch April 24, 2026 15:19
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