📣 New Release: codeanalyzer-python 1.0.0 #12
rahlk
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
codeanalyzer-python (canpy) v1.0.0
TL;DR —
canpy1.0.0 is a major, breaking release: the analyzer now emits the canonical CLDK schema v2 (schema_version 2.0.0) — one additive Code Property Graph tree — across four gated analysis levels (-a 1|2|3|4), in bothanalysis.jsonand the Neo4j projection. The 1.0 version marks the emitted contract as stable: it is key-for-key identical to the cross-language CLDK keystone, so one SDK model set parses every analyzer's output.Analysisenvelope. The flat top-levelsymbol_table/call_graph(and the separateprogram_graphssection) are gone. Migrate: readanalysis.application.symbol_tableandanalysis.application.call_graph; dataflow graphs are inline on each callable (body/cfg/cdg/ddg/summary).types/functions; classes and callables nestcallables/types. Migrate:classes→types,methods→callables,inner_classes/inner_callables→types/callables.{src, dst, prov, weight}. Thetype: "CALL_DEP"field and thesource/target/provenancekeys are gone; endpoints arecan://node ids and always join the id space — imported/builtin targets are homed inapplication.external_symbolsundercan://…/@external/<module>/<name>ids. Migrate: rename the keys; joindstagainst the tree orexternal_symbols.codeis dropped. Each module stores itssourceonce; every node carries a byte-offsetspan. Migrate: slicemodule.source[span.bytes[0]:span.bytes[1]].2.0.0. Nodes merge oncan://ids (:PyExternalincluded); the L3/L4 CPG overlay ships asPyCFGNode+PY_CFG_NEXT/PY_CDG/PY_DDG(withprov), plusPY_PARAM_IN/PY_PARAM_OUT/PY_SUMMARY;PY_CALLScarriesprov. Migrate: re-runcanpy --emit schemafor the machine-readable contract and rebuild graphs from scratch.Highlights
param_in/param_out/summary, alias-aware DDG via the optional Scalpel points-to oracle with an automatic type-based fallback). Each level is a strict superset of the one below.can://python/<app>/<file>/<type>/<callable-sig>ids on every callable and above; ordinal ids below; both projections share one identity.analyzer{name, version, config}, and the application recordsrepository{uri, revision, dirty}(credentials stripped from remote URIs).-a 4run (6,086 modules; 44,840 call edges; 3.28M dependence edges; 490 MB) passes every conformance gate with zero dangling edge endpoints and round-trips the schema models.Known limitation: the L2+ call graph can vary slightly between runs — PyCG's capped fixpoint is order-sensitive (tracked in #99).
SDK users: the CLDK python-sdk consumes this release via its schema-v2 uptake epic (python-sdk#238); until that ships, pin
codeanalyzer-python<1.0if you consumeanalysis.jsonthrough the SDK's current models.Upgrade
Or the shell installer:
Links
Beta Was this translation helpful? Give feedback.
All reactions