[log] Add debug logging to 5 pkg/ files#42640
Merged
Merged
Conversation
Add namespace-based debug loggers (logger.New with pkg:filename naming) and meaningful debug calls at control-flow decisions and state changes: - intent/resolver.go: attribution source decisions in ResolvePullRequest/ResolveIssue - workflow/skills_frontmatter.go: skill validation and parsing counts - cli/logs_usage_activity.go: summary load path/schema fallback and backfill - importinpututil/import_input.go: import input path resolution outcomes - workflow/lsp_validation.go: LSP support validation decisions Logger arguments only read fields / call len(); no side effects. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
🎉 This pull request is included in a new release. Release: |
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 structured debug logging to 5
pkg/files using the existingpkg/loggerpackage. All changes are observability-only; no logic is modified.Changes
pkg/cli/logs_usage_activity.gocli:logs_usage_activitypkg/importinpututil/import_input.goimportinpututil:import_inputpkg/intent/resolver.gointent:resolverpkg/workflow/lsp_validation.goworkflow:lsp_validationpkg/workflow/skills_frontmatter.goworkflow:skills_frontmatterPer-file details
pkg/cli/logs_usage_activity.goloadUsageActivitySummary: logs JSON parse failure, schema mismatch (with expected/actual values), and successful load path.applyUsageActivitySummaryToResult: logs firewall analysis backfill (total/allowed/blocked request counts) and MCP tool usage backfill (server count).pkg/importinpututil/import_input.goResolvePathValue: logs top-level key lookup result, parent key not found, parent key not amap[string]any, and dotted sub-key lookup result.FormatResolvedValue: logs the nil-value early-exit branch.pkg/intent/resolver.goResolvePullRequest: logs entry parameters (nodeID, explicitIntent present, closing issue count, label count) and each resolution branch (explicit metadata, single closing issue, label fallback, unlinked, ambiguous).ResolveIssue: logs entry parameters and the no-labels unlinked branch.pkg/workflow/lsp_validation.govalidateLSPSupport: logs entry (LSP config count), unsupported engine rejection, and validation success.pkg/workflow/skills_frontmatter.govalidateFrontmatterSkills: logs entry with skill entry count.parseRawSkillReferences: logs entry with raw skill count and final parsed ref count.Pattern
Each file follows the same convention:
Log calls use
Printf(formatted) orPrint(plain) and are placed at key decision points — successful paths, error/skip branches, and backfill triggers — to support debug tracing without changing runtime behaviour.Testing
No new tests required. Existing tests cover the unchanged logic; debug log output is gated behind the logger's debug level and does not affect observable behaviour.