[log] Add debug logging to DIFC evaluator #430
Merged
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
This PR adds debug logging to
internal/difc/evaluator.goto improve troubleshooting of DIFC (Decentralized Information Flow Control) policy evaluation.Changes Made
File Modified:
internal/difc/evaluator.go(1 file, focused PR)Added logger infrastructure:
github.com/githubnext/gh-aw-mcpg/internal/loggervar log = logger.New("difc:evaluator")Added 9 logging calls:
Evaluate()- Log operation entry with operation type and resource descriptionevaluateRead()- Log read evaluation with agent secrecy/integrity labelsevaluateRead()- Log read denial for integrity check failuresevaluateRead()- Log read denial for secrecy check failuresevaluateRead()- Log read access allowedevaluateWrite()- Log write evaluation with agent secrecy/integrity labelsevaluateWrite()- Log write denial for integrity check failuresevaluateWrite()- Log write denial for secrecy check failuresevaluateWrite()- Log write access allowedFilterCollection()- Log collection filtering entry with operation and item countFilterCollection()- Log filtering results with accessible/filtered/total countsWhy This File?
Logging Guidelines Followed
✅ Logger naming convention:
difc:evaluatorfollowspkg:filenamepattern✅ No side effects: All log arguments are simple variables, no function calls
✅ Meaningful context: Includes operation type, resource description, agent labels, and tags
✅ Both allow and deny: Logs successful and failed access decisions
✅ Project guidelines: Follows AGENTS.md debug logging standards
Testing
The changes preserve all existing behavior and only add debug logging:
DEBUG=difc:*orDEBUG=*)Debug Output Example
Related
server:handlers,launcher:launcher,config:config