Skip to content

[log] Add debug logging to difc/capabilities.go#1168

Merged
lpcox merged 1 commit intomainfrom
log/difc-capabilities-logging-9549b926ee26c49d
Feb 20, 2026
Merged

[log] Add debug logging to difc/capabilities.go#1168
lpcox merged 1 commit intomainfrom
log/difc-capabilities-logging-9549b926ee26c49d

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Adds a debug logger (logCapabilities) to internal/difc/capabilities.go following the project's pkg:filename naming convention already established in this package.

Changes

  • Added "github.com/github/gh-aw-mcpg/internal/logger" import
  • Added var logCapabilities = logger.New("difc:capabilities") logger declaration
  • Added 5 meaningful logging calls:
    • NewCapabilities() — logs creation of a new capabilities set
    • Add(tag) — logs the specific tag being added
    • AddAll(tags) — logs the count of tags being added in bulk
    • Remove(tag) — logs the specific tag being removed
    • Clear() — logs when all capabilities are cleared

Why this file?

The DIFC (Decentralized Information Flow Control) capabilities set manages which tags are globally available in the system. Debug logging here helps troubleshoot:

  • When capabilities are initialized and populated
  • Which tags are added/removed during agent configuration
  • Unexpected capability resets

Follows existing conventions

The difc package already has descriptive logger variables in:

  • evaluator.go: var logEvaluator = logger.New("difc:evaluator")
  • agent.go: var logAgent = logger.New("difc:agent")

This PR follows the same pattern with var logCapabilities = logger.New("difc:capabilities").

Testing

Enable with DEBUG=difc:capabilities ./awmg --config config.toml

AI generated by Go Logger Enhancement

Add a debug logger to the Capabilities type to help troubleshoot
DIFC tag management operations. Logs are emitted for:
- NewCapabilities: creation of a new capabilities set
- Add: individual tag additions with tag name
- AddAll: bulk tag additions with count
- Remove: tag removal with tag name
- Clear: clearing all capabilities

Follows the pkg:filename logger naming convention used in
difc/evaluator.go (logEvaluator) and difc/agent.go (logAgent).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Feb 20, 2026
@lpcox lpcox marked this pull request as ready for review February 20, 2026 18:23
Copilot AI review requested due to automatic review settings February 20, 2026 18:23
@lpcox lpcox merged commit 8c3ff1d into main Feb 20, 2026
3 checks passed
@lpcox lpcox deleted the log/difc-capabilities-logging-9549b926ee26c49d branch February 20, 2026 18:23
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

This PR adds debug logging to the internal/difc/capabilities.go file, following the established logging conventions already in place for other DIFC package files (agent.go and evaluator.go). The logging helps troubleshoot DIFC capability initialization and modifications during agent configuration.

Changes:

  • Added debug logger with namespace difc:capabilities following the package:component naming convention
  • Added logging to all mutating operations: NewCapabilities(), Add(), AddAll(), Remove(), and Clear()

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

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