Skip to content

Conversation

@shivasurya
Copy link
Owner

Summary

Adds remote HTTP-based stdlib registry loading with automatic Python version detection and lazy module downloads.

Changes

  • Python version detector (.python-version, pyproject.toml)
  • Remote HTTP downloader with lazy loading and in-memory caching
  • Updated builder to use remote CDN instead of local files
  • CI/CD generates registries on deployment

Testing

All tests passing with mocked HTTP responses.

🤖 Generated with Claude Code

shivasurya and others added 2 commits November 1, 2025 21:26
Implements remote HTTP-based stdlib registry loading with automatic
Python version detection and on-demand module caching.

Changes:
- Add Python version detector (.python-version, pyproject.toml)
- Implement remote stdlib registry with lazy module loading
- Add in-memory caching with mutex protection
- Update builder to use remote CDN instead of local files
- Add comprehensive unit tests with mocked HTTP responses

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Updates Cloudflare Pages deployment to generate Python 3.14 stdlib
registries before building the docs site. Registries are generated
fresh on every deployment to ensure they stay up-to-date.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@codecov
Copy link

codecov bot commented Nov 2, 2025

Codecov Report

❌ Patch coverage is 85.20710% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.85%. Comparing base (5026a10) to head (e50a095).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sourcecode-parser/graph/callgraph/builder.go 47.82% 10 Missing and 2 partials ⚠️
...e-parser/graph/callgraph/stdlib_registry_remote.go 89.09% 6 Missing and 6 partials ⚠️
...-parser/graph/callgraph/python_version_detector.go 97.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
+ Coverage   74.16%   74.85%   +0.68%     
==========================================
  Files          45       47       +2     
  Lines        5291     5448     +157     
==========================================
+ Hits         3924     4078     +154     
+ Misses       1201     1194       -7     
- Partials      166      176      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya self-assigned this Nov 2, 2025
@shivasurya shivasurya added enhancement New feature or request go Pull requests that update go code labels Nov 2, 2025
- Use http.NewRequestWithContext instead of http.NewRequest (noctx)
- Add //nolint:nilnil directive for valid nil,nil return (nilnil)
- Replace if-else chains with switch statements (ifElseChain)

All tests passing, coverage maintained at 95.8%/98.6%.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@safedep
Copy link

safedep bot commented Nov 2, 2025

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@shivasurya shivasurya merged commit 62dc10d into main Nov 2, 2025
5 checks passed
@shivasurya shivasurya deleted the feat/stdlib-registry-remote branch November 2, 2025 01:44
shivasurya added a commit that referenced this pull request Nov 4, 2025
… dataflow

Implements statement-level extraction from Python AST to support
intra-procedural dataflow analysis and taint propagation.

This is PR #2 of the intra-procedural dataflow feature implementation.

**Key Features:**
- Extract assignments, augmented assignments, calls, and returns
- Build def-use information for each statement
- Conservative identifier extraction for security analysis
- Handle Python AST node wrapping (expression_statement)
- Filter Python keywords and 'self' references
- Extract method names from chained calls (obj.a.b.method)

**Implementation Details:**
- `ExtractStatements`: Main entry point, iterates function body
- `extractAssignment`: Handles simple assignments (x = expr)
  - Stores RHS expression in CallTarget field
  - Skips tuple unpacking (requires multiple defs)
  - Skips attribute/subscript assignments (no local defs)
- `extractAugmentedAssignment`: Handles x += expr (def and use)
- `extractCall`: Extracts function/method calls
  - CallTarget contains method name (not full chain)
  - CallArgs contains literal argument values
  - Uses contains all identifiers (recursive extraction)
- `extractReturn`: Handles return statements
  - Stores expression in CallTarget
- `extractIdentifiers`: Recursive identifier extraction
  - Filters Python keywords and 'self'
  - Deduplicates results

**Test Coverage:**
- 20+ comprehensive tests covering all statement types
- 87.3% overall coverage
- Edge cases: empty functions, control flow skipped, nested calls
- Tests for keyword filtering, deduplication, self references

**Compliance:**
- All tests passing
- Build successful
- Linter clean (nolint comments for false-positive unconvert warnings)

Related to #340

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
shivasurya added a commit that referenced this pull request Nov 4, 2025
… dataflow

Implements statement-level extraction from Python AST to support
intra-procedural dataflow analysis and taint propagation.

This is PR #2 of the intra-procedural dataflow feature implementation.

**Key Features:**
- Extract assignments, augmented assignments, calls, and returns
- Build def-use information for each statement
- Conservative identifier extraction for security analysis
- Handle Python AST node wrapping (expression_statement)
- Filter Python keywords and 'self' references
- Extract method names from chained calls (obj.a.b.method)

**Implementation Details:**
- `ExtractStatements`: Main entry point, iterates function body
- `extractAssignment`: Handles simple assignments (x = expr)
  - Stores RHS expression in CallTarget field
  - Skips tuple unpacking (requires multiple defs)
  - Skips attribute/subscript assignments (no local defs)
- `extractAugmentedAssignment`: Handles x += expr (def and use)
- `extractCall`: Extracts function/method calls
  - CallTarget contains method name (not full chain)
  - CallArgs contains literal argument values
  - Uses contains all identifiers (recursive extraction)
- `extractReturn`: Handles return statements
  - Stores expression in CallTarget
- `extractIdentifiers`: Recursive identifier extraction
  - Filters Python keywords and 'self'
  - Deduplicates results

**Test Coverage:**
- 20+ comprehensive tests covering all statement types
- 87.3% overall coverage
- Edge cases: empty functions, control flow skipped, nested calls
- Tests for keyword filtering, deduplication, self references

**Compliance:**
- All tests passing
- Build successful
- Linter clean (nolint comments for false-positive unconvert warnings)

Related to #340

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants