v2 Stage 1: schema foundation + L1#77
Open
rahlk wants to merge 14 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #69. Stacked on
feat/v2-stage0-scalpel-spike— review that PR first.Stage 1 — canonical schema v2 foundation + L1:
Analysisenvelope (schema_version: "2.0.0",language,max_level,k_limit,application).PyApplication/PyModule/PyClass/PyCallable(+id/kind/span/body; modulesource; dropped per-nodecodeand the separateprogram_graphssection);Spanwith byte offsets.can://durable ids (schema/ids.py,schema/assign_ids.py); L1bodycallnodes; relativesymbol_tablekeys.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.