Repository navigation
Description
PROBLEM
The Neo4j projection emits only bare node labels (Application, Module, Class, Interface, Enum, TypeAlias, Namespace, Callable, External, AnonymousCallable, Package, Decorator, CallSite, Attribute, Variable; marker Entrypoint), which a shared multi-language database cannot attribute to TypeScript. This issue adds a TS-prefixed twin label to every node, additively, so downstream queries can namespace by language without breaking any existing consumer.
SCOPE BOUNDARY
Node labels only. Relationship types stay unprefixed (CALLS, HAS_MODULE, …) — their rename is breaking and lands with the v2/CanNode contract (stage 2). Merge labels (Symbol, Module, Package, Decorator, CallSite, Attribute, Variable, Application), uniqueness constraints, keys, and analysis.json are untouched. No in-place migration of existing databases.
GOALS
- Every
NodeLabelinsrc/build/neo4j/schema.tsdeclares itsTS-prefixed twin (e.g.Callable+TSCallable), and the marker set gainsTSEntrypointalongsideEntrypoint; the declarative schema remains the single source of truth. - Both writers (
cypher.tssnapshot andbolt.tsincremental) stamp both labels on every node; MERGE still targets the unchanged merge label + key. SCHEMA_VERSION→1.1.0(additive MINOR per the schema's own rule).- Conformance test (
test/neo4j-schema.test.ts) covers the twin labels;schema.neo4j.jsonand the README help block regenerated.
CAVEATS AND KNOWN RISKS
- Dual labels double the label count per node; Neo4j handles multi-labels natively, but any consumer doing
labels(n)[0]or exact-set label comparisons will see the new twin — additive, yet worth a release-note line. - The old branch
patch/ts-prefix-neo4j-schemais NOT a starting point: it rewrotecatalog.ts, which the refactor(neo4j): consolidate the graph schema into one source of truth (closes #15) #16 consolidation deleted. Re-author againstschema.ts; use the branch only as a checklist of touch points. - Bolt writer batches: ensure the twin label is applied in the same MERGE/SET statement so a crash mid-load never leaves half-labeled nodes.
DEFINITION OF DONE
- On the fixture app, for every declared label L:
MATCH (n:L)andMATCH (n:TSL)return identical counts; total relationship count is byte-identical to the pre-change graph. - Conformance test green;
:Applicationcarriesschema_version = "1.1.0". schema.neo4j.jsonregenerated and committed;bun run gen:readmeclean.
Delivers #8 additively (merge label deliberately stays shared — see the epic's design decisions).
Part of #64
Activity