[log] Add debug logging to package manifest imports and project file merge - #58707
Merged
pelikhan merged 1 commit intoSep 5, 2026
Merged
Conversation
…ject file merging Both files lacked debug instrumentation despite non-trivial control flow (import cycle/path-traversal detection, symlink validation, JSON merge/write).
This was referenced Sep 5, 2026
pelikhan
deleted the
log-enhance-package-manifest-imports-project-file-c4be4dc5c8718337
branch
September 5, 2026 03:50
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
Added debug logging to 2 files from the candidate manifest that genuinely lacked instrumentation. Uses
logger.New-backed variables that already exist for the package (addPackageManifestLog,addLog), following the one-logger-per-file/package convention inAGENTS.md.Files changed
pkg/cli/add_package_manifest_imports.go— logs manifest import-graph resolution (entry/result), import-cycle detection, and path-traversal rejection inreadLocalImportedManifest.pkg/cli/add_project_file.go— logs project-file merge entry, symlink-destination rejection, and successful write.Note on candidate selection
Of the 40 files in the deterministic candidate manifest, only these 2 genuinely lacked logging without producing duplicate or trivial instrumentation:
pkg/actionpins/*,pkg/agentdrain/*, mostpkg/cli/add_*.go) already have thorough logging through a shared package-level logger variable (e.g.actionPinsLog,addInteractiveLog,addPackageManifestLog) that the manifest's per-filevar log =detection heuristic does not recognize.pkg/actionpins/types.goandpkg/agentdrain/types.go/config.goare trivial (pure type definitions, or a single static-struct constructor) and were skipped per the avoid-trivial-files guidance.Kept the PR to these 2 quality additions rather than padding to 5 with duplicate or trivial logging.
Validation
make build— passedmake fmt(Go) — passed. Thefmt-cjs(prettier/npm) step failed with an unrelated 403 Forbidden response from the npm registry in this sandbox — no JS/TS files were touched by this change.Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
api.anthropic.comregistry.npmjs.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.