feat(python-sdk): SDK metadata + CDN-indexed stubs for Go and Python classes - #661
Merged
Merged
Conversation
Adds handcrafted SDK_META dicts that drive sdk-manifest.json generation: - go_rule_meta.py: 72 Go classes, 221 methods covering handcrafted Go QueryType companions (stdlib + 3rd party: gin, echo, fiber, chi, gorilla mux, gorm, sqlx, pgx, mongo, redis, jwt, viper, yaml.v3, grpc, resty). - python_rule_meta.py: 100 Python class entries, 302 methods across 9 categories (web-frameworks, command-execution, databases, deserialization, http-clients, file-system, archives, crypto, templating). Generator + CDN indexers: - generate_sdk_manifest.py: reads *_rule_meta.py and emits sdk-manifest.json consumed by codepathfinder.dev. Now chains the two indexers below after handcrafted meta is written (--skip-cdn-index opts out). - index_python_from_cdn.py: fills stubs for every module in assets.codepathfinder.dev/registries/python3.11/stdlib/v1 and assets.codepathfinder.dev/registries/thirdparty/v1 that isn't already covered by python_rule_meta.py. Auto-categorizes into 10 buckets. - index_go_from_cdn.py: same pattern for assets.codepathfinder.dev/registries/go1.21/stdlib/v1 and assets.codepathfinder.dev/registries/go-thirdparty/v1. Resulting coverage in sdk-manifest.json: - Go: 204 classes / 1132 methods (100% of 167 stdlib + 25 third-party CDN). - Python: 429 classes / 2781 methods (100% of 211 stdlib + 208 third-party). Stubs carry role=neutral with a disclaimer in the description so they are discoverable without making unverified security claims. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…exers - Apply black formatting (line-length 88 from pyproject.toml) across go_rule_meta.py, python_rule_meta.py, and the three scripts. - Remove unused `inspect` import flagged by ruff in generate_sdk_manifest.py. - Fix mypy no-any-return on fetch_json() in both CDN indexers by binding json.loads(...) to an annotated local before returning. Matches the canonical lintPython task in sast-engine/build.gradle: black --check codepathfinder/ tests/ && ruff check codepathfinder/ tests/ && mypy codepathfinder/ All five files added in the previous commit now pass black, ruff, and mypy with no warnings. Pre-existing formatting drift in python_ir.py, go_rule.py, and tests/test_go_thirdparty_querytypes.py is out of scope for this branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 |
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 the handcrafted SDK metadata and CDN indexers that drive the new
/sdk/documentation on codepathfinder.dev.codepathfinder/go_rule_meta.py— 72 Go classes, 221 methods (Gin, Echo, Fiber, Chi, Gorilla Mux, GORM, sqlx, pgx, Mongo, Redis, JWT, Viper, YAML, gRPC, Resty + stdlib).codepathfinder/python_rule_meta.py— 100 Python class entries, 302 methods across 9 categories (web frameworks, command exec, databases, deserialization, HTTP clients, filesystem, archives, crypto, templating).scripts/generate_sdk_manifest.py— Reads each*_rule_meta.pyand emitssdk-manifest.jsonconsumed by the website. Chains the two indexers below automatically;--skip-cdn-indexopts out.scripts/index_python_from_cdn.py— Fills stubs for every Python module in theassets.codepathfinder.devCDN registries that isn't already covered by hand.scripts/index_go_from_cdn.py— Same pattern for Go stdlib and third-party CDN entries.Coverage in the published manifest
100% of 167 Go stdlib + 25 Go third-party + 211 Python stdlib + 208 Python third-party modules from the CDN are indexed. Stubs carry
role: neutralwith a clear banner so readers don't mistake auto-indexed metadata for verified security annotations.Lint status
Matches the canonical
lintPythontask insast-engine/build.gradle:black --check codepathfinder/go_rule_meta.py codepathfinder/python_rule_meta.py scripts/— all files left unchangedruff check codepathfinder/ scripts/— all checks passedmypyon the 5 new/modified files — no issues foundPre-existing formatting drift in
python_ir.py,go_rule.py, andtests/test_go_thirdparty_querytypes.pyis out of scope and left untouched.Test plan
cd python-sdk && python3 scripts/generate_sdk_manifest.pyruns end-to-end and regeneratessdk-manifest.jsonwithout raising (ignored output path requires cpf-website checkout adjacent).cd python-sdk && black --check codepathfinder/go_rule_meta.py codepathfinder/python_rule_meta.py scripts/passes.cd python-sdk && ruff check codepathfinder/go_rule_meta.py codepathfinder/python_rule_meta.py scripts/passes.cd python-sdk && mypy codepathfinder/go_rule_meta.py codepathfinder/python_rule_meta.py scripts/generate_sdk_manifest.py scripts/index_go_from_cdn.py scripts/index_python_from_cdn.pypasses.🤖 Generated with Claude Code