Skip to content

[log] Add debug logging to FilterAndConvertLabeledData#8250

Merged
lpcox merged 1 commit into
mainfrom
log/difc-pipeline-decisions-c5f5c992a46e486c
Jun 29, 2026
Merged

[log] Add debug logging to FilterAndConvertLabeledData#8250
lpcox merged 1 commit into
mainfrom
log/difc-pipeline-decisions-c5f5c992a46e486c

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds 5 debug logging calls to FilterAndConvertLabeledData in internal/difc/pipeline_decisions.go — the core Phase 5 fine-grained filtering function of the DIFC pipeline.

The existing logPipeline logger (declared in the same file) is reused; no new logger is added.

Logging Added

Location Log message
Function entry operation, mode, hasData
labeledData == nil early return confirmation message
Collection path itemCount before filtering
Collection blocked filteredCount, mode
Collection allowed accessible and filtered counts
Single item path confirmation message

Why This Function

FilterAndConvertLabeledData is the central dispatch point for Phase 5 DIFC filtering decisions, yet previously had zero logging while all surrounding functions (EvaluateCoarseAccess, ShouldBypassCoarseDeny, ShouldBlockFilteredResponse, etc.) were already logged. This gap made it impossible to observe collection filtering outcomes (blocked vs. partially filtered) via DEBUG=difc:*.

Generated by Go Logger Enhancement · 356 AIC · ⊞ 8.3K ·

…isions.go

Add 5 logPipeline calls to FilterAndConvertLabeledData, covering:
- Function entry with operation, enforcement mode, and data presence
- Early return when labeledData is nil
- Collection item count before filtering
- Blocked response with filtered count and mode
- Filtered collection result with accessible/filtered counts
- Single item path

The existing logPipeline logger (declared in the same file) is reused.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Jun 28, 2026
@lpcox
lpcox requested a review from Copilot June 29, 2026 02:59
@lpcox
lpcox marked this pull request as ready for review June 29, 2026 03:00

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.

Pull request overview

This PR adds DIFC Phase 5 debug visibility by instrumenting FilterAndConvertLabeledData (the fine-grained filtering decision/dispatch point) with additional logPipeline debug logs, aligning it with the surrounding pipeline functions that already emit DEBUG=difc:* traces.

Changes:

  • Log function entry with operation, mode, and whether labeled data is present.
  • Log key branch decisions/outcomes for collection filtering (pre-filter item count, strict-mode block, accessible vs filtered counts).
  • Log the non-collection (“single labeled item”) path for easier trace correlation.
Show a summary per file
File Description
internal/difc/pipeline_decisions.go Adds debug logs in FilterAndConvertLabeledData to trace Phase 5 filtering flow and outcomes under DEBUG=difc:*.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Low

@lpcox
lpcox merged commit b43b677 into main Jun 29, 2026
24 checks passed
@lpcox
lpcox deleted the log/difc-pipeline-decisions-c5f5c992a46e486c branch June 29, 2026 03:09
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