feat: resolve stdlib call: attribute placeholders via CDN registry - #618
Merged
Merged
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Code Pathfinder Security ScanNo security issues detected.
Powered by Code Pathfinder |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #618 +/- ##
==========================================
+ Coverage 83.66% 83.77% +0.10%
==========================================
Files 155 155
Lines 21149 21298 +149
==========================================
+ Hits 17695 17843 +148
Misses 2801 2801
- Partials 653 654 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…stry When ResolveAttributePlaceholders encounters a call: placeholder like 'call:sqlite3.connect' that doesn't match a project function, it now falls back to checking the stdlib and third-party CDN registries for the function's return type or constructor. This resolves attribute types for stdlib calls (e.g., sqlite3.connect → sqlite3.Connection) and constructors (e.g., configparser.ConfigParser), enabling deep chain resolution through stdlib intermediate types. Project ReturnTypes lookup still takes priority over stdlib fallback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Edge case tests for resolveCallPlaceholderViaRegistry and tryRegistryLookup: - nil typeEngine safety - single-part funcName (no dots) skipped - unknown/empty return type skipped - stdlib checked before thirdparty (ordering guarantee) - thirdparty constructor fallback - unknown module stays unresolved Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion
Three fixes to complete the stdlib attribute type propagation:
1. extraction/attributes.go: Handle attribute nodes (dotted calls like
sqlite3.connect) in inferFromFunctionCall, not just identifiers. This
creates call:sqlite3.connect placeholders for self.conn = sqlite3.connect().
2. resolution/attribute.go: Use a silentLogger (io.Discard writer) for
stdlib/thirdparty registry lookups instead of nil, preventing panic
when modules need to be lazy-loaded from CDN during attribute resolution.
3. registry/{stdlib,thirdparty}_remote.go: Add GetCachedModule() method
for cache-only lookups without CDN downloads.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover all lines flagged by Codecov: - extraction/attributes.go: dotted call extraction (sqlite3.connect) - registry/stdlib_remote.go: GetCachedModule - registry/thirdparty_remote.go: GetCachedModule Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shivasurya
force-pushed
the
shiva/gap-stdlib-attr-propagation
branch
from
March 24, 2026 23:26
a3a8040 to
9f5e381
Compare
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
call:placeholders in the attribute registry using stdlib/third-party CDN registriessqlite3.connect()) ascall:placeholders in attribute extractionGetCachedModulemethod for cache-safe registry lookupssilentLoggerto prevent nil-pointer panics during lazy CDN module downloadsChanges
resolution/attribute.go: AddresolveCallPlaceholderViaRegistry+tryRegistryLookupfallback inResolveAttributePlaceholdersresolution/attribute_test.go: Tests for stdlib function, constructor, thirdparty, priority, edge casesextraction/attributes.go: Handleattributenodes (dotted calls) ininferFromFunctionCallregistry/stdlib_remote.go: AddGetCachedModulemethodregistry/thirdparty_remote.go: AddGetCachedModulemethodTest plan
resolveCallPlaceholderViaRegistryandtryRegistryLookup🤖 Generated with Claude Code