Skip to content

v2 Stage 1: schema foundation + L1 #71

Description

@rahlk

Part of #69.

Stage 1 — v2 schema foundation + L1

Introduce the v2 model layer, the can:// id builders, source-per-module + byte-offset spans, the L1 body (call nodes), the JSON envelope, and the Neo4j L1 re-key. After this stage, -a 1 emits a v2-shaped tree in both projections. max_level=1.

Branch:feat/v2-stage1-schema-l1

Tasks (bite-sized TDD, detailed in the plan):

  1. Byte-offset Span model + line/col→byte helper (schema/py_schema.py).
  2. can:// durable-id builders (schema/ids.py) — locks the name(argnames) param-encoding decision.
  3. v2 model layer — BodyNode, split edge models (Cfg/Cdg/Ddg/Summary/ParamEdge), Analysis envelope; reshape PyApplication/PyModule/PyClass/PyCallable; dissolve PyProgramGraphs/PyFunctionGraphs/PySDGEndpoint/PySDGEdge/PyGraphNode/PyParamNode.
  4. Capture source per module + byte-offset spans in the symbol-table builder; drop the per-node code field.
  5. Stamp can:// ids across the tree (schema/assign_ids.py, returns signature→can://id).
  6. L1 body call nodes from call_sites (callee null; schema/l1_body.py).
  7. Emit the v2 Analysis envelope from the CLI; analyze() returns Analysis.
  8. Canonical-schema conformance gate helper + L1 assertion (test/conftest_v2.py).
  9. Neo4j L1 re-key onto can:// ids (two-projection agreement).
  10. Stale-v1 cache detection (rebuild instead of crash).

Gate (L1):-a 1 output round-trips the v2 models and passes assert_conformant(..., 1); symbol_table keys relative; get_method_body slices source via span bytes; cache reuse works and a stale v1 cache rebuilds; JSON callable ids == Neo4j merge keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions