Skip to content

python-sdk: Java models → schema v2 (two-layer views) #310

Description

@sinha108

Plan (optional)

Design spec: https://github.com/codellm-devkit/codeanalyzer-java/blob/main/docs/design/specs/schema-v2-l3-l4-design.md

Problem

The python-sdk Java models are v1 (JApplication{symbol_table, call_graph, system_dependency_graph}, rich JGraphEdges). They must load the analyzer's v2 output while keeping every public accessor's name, signature, and return type unchanged.

Scope boundary

The SDK Java model + view layer only — no analyzer changes, and no slice/taint/reachability queries (those are the separate SDK-queries issue). Starts after the analyzer's v2 release is cut (until then the old models can't parse v2). Reconcile the open cldk/models/cpg/ vs per-language projections.py question (seen on release/2.0) here — the shared layer likely already exists from the Python/TS v2 migration, so Java adds its views onto it.

Goals

  • Load the v2 envelope + CPG; Java views preserving accessor names/signatures/return types (.code/.call_sites become computed views over body/source)
  • AnalysisLevel gains L3/L4; new get_program_dependency_graph; get_system_dependency_graph returns the v2 SDG
  • Document the sanctioned semantic shifts (nx node keys → can:// ids; rich edges retire; envelope keys change; call-site payload thins)
  • Pin the analyzer v2 version once its release is cut

Caveats and known risks

  • Major SDK version bump, but not a breaking public API — names/signatures/return types frozen behind the view layer.
  • Consumers reaching past the public API (into nx node-key types or JSON string internals) can break — document each shift.

Definition of done

  • SDK model gates green: mocked + E2E against the facade load v2 output; public API unchanged (or the major bump + shims documented).
  • Parity with the committed spec; analyzer↔SDK versions pinned in lockstep.
  • (Slice/taint query gates are the separate SDK-queries issue, not this one.)

Metadata

Metadata

Assignees

Labels

breakingBreaking ChangesenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions