[log] Add debug logging to FilterAndConvertLabeledData#8250
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
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
This was referenced Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 5 debug logging calls to
FilterAndConvertLabeledDataininternal/difc/pipeline_decisions.go— the core Phase 5 fine-grained filtering function of the DIFC pipeline.The existing
logPipelinelogger (declared in the same file) is reused; no new logger is added.Logging Added
operation,mode,hasDatalabeledData == nilearly returnitemCountbefore filteringfilteredCount,modeaccessibleandfilteredcountsWhy This Function
FilterAndConvertLabeledDatais 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) viaDEBUG=difc:*.