Skip to content

feat: neo4j EXTENDS/IMPLEMENTS inheritance edges #33

Description

@rahlk

Type: feat · Branch:feat/issue-33-neo4j-inheritance-edges · Part of epic #26 · Lands last

Problem

Base classes / implemented interfaces are stored as string-array node props (src/build/neo4j/project.ts:151); REL_TYPES (src/build/neo4j/schema.ts:129-153) has no EXTENDS/IMPLEMENTS, and the spec's deferred edgeToSymbol gate (src/build/neo4j/rows.ts:88-98) is dead code. Class hierarchy is not graph-queryable, and the resolved-only structural guarantee is unwired (neo4j-projection.md:153,175).

Open sub-check (do FIRST)

Confirm against canonical-schema.md / the SDK model whether the JSON projection should also gain an inheritance edge list or keep the current base_classes props — match Java/Python (parity). Default for this issue: Neo4j edges + keep JSON props. Record the decision in .claude/SCHEMA_DECISIONS.md.

Change

  1. Resolve heritage signatures → declaring-node can:// ids in the emitter where idBySig lives (src/schema/v2/emit.ts); expose extends_ids / implements_ids on the V2 type node (drop unresolved/external supertypes).
  2. Add EXTENDS, IMPLEMENTS to REL_TYPES (src/build/neo4j/schema.ts); bun run gen:schema to refresh schema.neo4j.json.
  3. Emit the edges in project() (src/build/neo4j/project.ts) via the now-revived edgeToSymbol deferred gate (base class → EXTENDS, interface → IMPLEMENTS). Reviving the gate closes the dead-code finding.
  4. Add a first-party class-hierarchy fixture if none exists.

Acceptance

  • Class hierarchy graph-queryable via EXTENDS/IMPLEMENTS; edges non-dangling; conformance gate declares both rel types; checked-in schema.neo4j.json matches gen:schema.

Files:src/schema/v2/emit.ts, src/build/neo4j/schema.ts, schema.neo4j.json, src/build/neo4j/project.ts, src/build/neo4j/rows.ts, test + fixture, .claude/SCHEMA_DECISIONS.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions