You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The analyzer emits the legacy v1 tree (combinedJsonObject.add("symbol_table", …), CodeAnalyzer.java) with JTypeis_* booleans, per-callable code, and flat start_line/end_line. Canonical schema v2 requires an additive CPG tree: an envelope, per-module source blob, byte-offset spans, can:// ids, structured decorators, nested metrics/refs, and bodycall nodes.
Scope boundary
L1 tree emission only — no call_graph edges (that is the L2 issue), no dataflow. Keep the JavaParser compute guts; rewrite only the emission layer. The v1 emitter is kept behind a flag as a superset oracle during transition. Pure structural emission — no analysis-engine changes.
L1 gate: output validates against the SDK Application; symbol_table non-empty, relative keys; a known module has source and the get_method_body slice = module.source[span.bytes]; call nodes carry callee:null; can:// ids stable across two runs; re-run reuses cache.
Monotonicity holds for L1; determinism -j N byte-identical to -j 1.
Plan (optional)
Design spec: https://github.com/codellm-devkit/codeanalyzer-java/blob/main/docs/design/specs/schema-v2-l3-l4-design.md
Problem
The analyzer emits the legacy v1 tree (
combinedJsonObject.add("symbol_table", …),CodeAnalyzer.java) withJTypeis_*booleans, per-callablecode, and flatstart_line/end_line. Canonical schema v2 requires an additive CPG tree: an envelope, per-modulesourceblob, byte-offset spans,can://ids, structured decorators, nested metrics/refs, andbodycallnodes.Scope boundary
L1 tree emission only — no
call_graphedges (that is the L2 issue), no dataflow. Keep the JavaParser compute guts; rewrite only the emission layer. The v1 emitter is kept behind a flag as a superset oracle during transition. Pure structural emission — no analysis-engine changes.Goals
{schema_version:"2.0.0", language:"java", max_level, analyzer{name,version}, application{id,kind,symbol_table}}module{id, kind:"module", span, source, package, imports, types, functions, content_hash}; byte offsets on every spantype.kind ∈ {class,interface,enum,record,annotation}+nesting{parent?,is_local?}(D4);base_types/interfaces; structureddecorators:[{name,args,span}](D2)callable{id, kind, signature, span, parameters, return_type, error_channel, modifiers, decorators, metrics{cyclomatic}, refs{types,fields}, body{}}(D1, D3);thrown_exceptions → error_channelbodycallnodes{kind:"call", span, callee:null, arguments:[local-id]}(callee backfilled at L2)can://java/<app>/<file>/<type>/<sig>id construction fromsignatureOf()(D8)Caveats and known risks
symbol_tablekeys must be relative (never absolute or..-prefixed).method,constructor,initializer(static/instance init blocks),lambda;is_variadicfor varargs.Definition of done
Application;symbol_tablenon-empty, relative keys; a knownmodulehassourceand theget_method_bodyslice =module.source[span.bytes];callnodes carrycallee:null;can://ids stable across two runs; re-run reuses cache.-j Nbyte-identical to-j 1.