Skip to content

v2 Stage 1: schema foundation + L1#77

Open
rahlk wants to merge 14 commits into
feat/v2-stage0-scalpel-spikefrom
feat/v2-stage1-schema-l1
Open

v2 Stage 1: schema foundation + L1#77
rahlk wants to merge 14 commits into
feat/v2-stage0-scalpel-spikefrom
feat/v2-stage1-schema-l1

Conversation

@rahlk

@rahlk rahlk commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Part of #69. Stacked on feat/v2-stage0-scalpel-spike — review that PR first.

Stage 1 — canonical schema v2 foundation + L1:

  • Analysis envelope (schema_version: "2.0.0", language, max_level, k_limit, application).
  • Reshaped PyApplication/PyModule/PyClass/PyCallable (+id/kind/span/body; module source; dropped per-node code and the separate program_graphs section); Span with byte offsets.
  • can:// durable ids (schema/ids.py, schema/assign_ids.py); L1 body call nodes; relative symbol_table keys.
  • Neo4j L1 re-key onto can:// ids (two-projection agreement); cache stores the envelope + rebuilds stale v1 caches.

v2 suite 15/15. Legacy dataflow/neo4j suites are module-skipped pending their Stage 3/4/5 migration; remaining full-suite failures are pre-existing/environmental (PyCG & Ray on Python 3.14 — see #61).

Closes #71.

rahlk added 14 commits July 7, 2026 09:13
Adds assert_conformant() check verifying schema_version, relative symbol_table
keys, module sources, callable span validity, and absent null values. Fixes
core.py to emit relative paths for symbol_table keys per v2 schema spec.
…bling imports

- core.py: key Ray module_map by path relative to project_dir (was absolute),
  matching serial/single-file paths so can:// ids and cache lookups are portable
- delete test/__init__.py so pytest re-adds test/ to sys.path for bare
  sibling imports (from sample_graph_app import ...)
- test_v2_conformance.py: import conftest_v2 bare, matching repo convention
- conftest_v2.py: guard node kind access with .get("kind")
Key PyModule/PyClass/PyCallable Neo4j nodes on their canonical can:// id
(stamped by assign_ids) instead of the file_key / dotted signature, so the
JSON and Neo4j projections agree on node identity. Call-graph endpoints for
declared symbols resolve through the signature->id map; externals keep their
signature-keyed PyExternal identity. Update the declarative schema catalog's
merge keys to id (signature/file_key kept as regular props) and thread the id
map through emit_neo4j.
The analysis cache now persists the full v2 Analysis envelope (with
schema_version) instead of a bare PyApplication. On load, a payload that
fails Analysis validation or lacks schema_version 2.0.0 (e.g. an old v1
cache) is detected and treated as a cache miss so the analysis rebuilds
cleanly instead of silently reusing incompatible data.
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