Skip to content

docs: spec for the python-sdk canonical schema v2 migration (#309) - #318

Open
rahlk wants to merge 1 commit into
release/2.0from
docs/issue-309-canonical-v2-spec
Open

docs: spec for the python-sdk canonical schema v2 migration (#309)#318
rahlk wants to merge 1 commit into
release/2.0from
docs/issue-309-canonical-v2-spec

Conversation

@rahlk

@rahlk rahlk commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Design record for the SDK leg of codellm-devkit/.github#35, committed as provenance under docs/design/specs/.

The SDK is the last consumer still parsing schema v1. codeanalyzer-python 1.4.0, codeanalyzer-typescript 1.2.0 and codeanalyzer-java 3.0.1 all emit canonical v2, while pyproject.toml pins 0.3.1 / 0.4.3 and bundles the 2.4.1 JAR.

Locked decisions

  • D1 — the SDK models the intersection the three shipped analyzers actually emit, not an idealised contract. .github#36 never froze one and the analyzers have since diverged, so writing one model layer over all three is the extraction exercise COBOL support #36 describes, performed against real payloads.
  • D2 — shared base classes in cldk/models/cpg/, per-language subclasses that narrow the container maps and add typed extras. No generics, no untyped extra="allow".
  • D3 — 2.0.0, API-stable via a view layer. v2 models replace v1 outright; no parallel model layer, no deprecation window.
  • D4 — Python → TypeScript → Java → query layer, as 2.0.0-rc.N per leg. Each leg's pin bump and model migration land in one PR.
  • D5 — epic fixing caller method #35 keeps coordinating. python-sdk v2 model layer: one Node/Edge/Application #309 is rewritten, Backwards-compatibility policy for the v2 model layer #308 is closed as decided, per-leg children are filed at pickup.

Two findings

Epic #35's premise expired. It was written on the basis that v2 was unreleased on every analyzer and that reconciling before shipping would be cheaper. All three have since shipped their v2 majors while #36 — which was to freeze the contract first — is still open and codeanalyzer-schema holds only a README.

#309's Java blocker is withdrawn. codeanalyzer-java 3.0.1 emits JCallEdge{src, dst, prov, weight}, JIdEdge{src, dst} and a canonical body map. The rich-edge shape (JGraphEdges wrapping JMethodDetail) and the module-global _CALLABLES_LOOKUP_TABLE survive only in the SDK's own v1 models, so the Java leg's weight is legacy retirement, not an upstream dependency.

The spec also carries a nine-entry divergence register across the shipped analyzers, which is filed onto #36 as the extraction input.

Not in this PR

Docs only — no code, no pins moved. Implementation starts at leg 1 (shared layer + Python).

Design record for the SDK leg of codellm-devkit/.github#35. The SDK is the
last consumer still parsing v1: codeanalyzer-python 1.4.0, -typescript 1.2.0
and -java 3.0.1 all emit canonical v2, while pyproject pins 0.3.1 / 0.4.3 and
the 2.4.1 JAR.

Records five locked decisions:

- The SDK models the intersection the three shipped analyzers actually emit,
  not an idealised contract. .github#36 never froze one, and the analyzers
  have since diverged, so writing one model layer over all three is the
  extraction exercise #36 describes, done against real payloads.
- Shared base classes in cldk/models/cpg/ with per-language subclasses that
  narrow the container maps and add typed extras.
- 2.0.0, API-stable via a view layer; v2 models replace v1 outright, with no
  parallel model layer and no deprecation window.
- Python then TypeScript then Java then the query layer, as 2.0.0-rc.N per
  leg. Each leg's pin bump and model migration land in one PR.
- Epic #35 keeps coordinating; #309 is rewritten, #308 is closed as decided,
  per-leg children are filed at pickup.

Also records a nine-entry divergence register across the shipped analyzers,
and withdraws #309's Java blocker: codeanalyzer-java 3.0.1 emits identity-only
edges and a canonical body map, so the rich JGraphEdges shape survives only in
the SDK's own v1 models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant