Problem
The graph schema uses two different patterns for distinguishing internal vs. external entities:
- Packages: Separate node labels (
Package vs ExternalPackage)
- Modules: A boolean property
is_external on the same Module label
This inconsistency was noted in the gdotv blog analysis (Part 2) as a schema design flaw.
The is_external property is defined in constants.py:191 as KEY_IS_EXTERNAL = "is_external" but is not part of the documented NODE_SCHEMAS in types_defs.py, not included in the protobuf schema, and not mentioned in the Cypher system prompts. This means LLM-generated Cypher queries cannot reliably distinguish external from internal modules.
Expected Behavior
Either:
- Create a dedicated
ExternalModule label (matching the Package/ExternalPackage pattern), or
- Unify both patterns to use boolean flags consistently
Option 1 is preferred for consistency and because it makes Cypher queries more natural (MATCH (m:ExternalModule) vs MATCH (m:Module {is_external: true})).
Affected Components
codebase_rag/constants.py (KEY_IS_EXTERNAL)
codebase_rag/types_defs.py (NODE_SCHEMAS)
codebase_rag/parsers/definition_processor.py (module node creation)
codebase_rag/schema_builder.py (schema text generation for LLM prompts)
codec/schema.proto (protobuf schema)
Problem
The graph schema uses two different patterns for distinguishing internal vs. external entities:
PackagevsExternalPackage)is_externalon the sameModulelabelThis inconsistency was noted in the gdotv blog analysis (Part 2) as a schema design flaw.
The
is_externalproperty is defined inconstants.py:191asKEY_IS_EXTERNAL = "is_external"but is not part of the documentedNODE_SCHEMASintypes_defs.py, not included in the protobuf schema, and not mentioned in the Cypher system prompts. This means LLM-generated Cypher queries cannot reliably distinguish external from internal modules.Expected Behavior
Either:
ExternalModulelabel (matching the Package/ExternalPackage pattern), orOption 1 is preferred for consistency and because it makes Cypher queries more natural (
MATCH (m:ExternalModule)vsMATCH (m:Module {is_external: true})).Affected Components
codebase_rag/constants.py(KEY_IS_EXTERNAL)codebase_rag/types_defs.py(NODE_SCHEMAS)codebase_rag/parsers/definition_processor.py(module node creation)codebase_rag/schema_builder.py(schema text generation for LLM prompts)codec/schema.proto(protobuf schema)