Frontmatter
| title | feat(ai): concept schema enrichment — aliases & ANALOGOUS_TO (#10049) |
| author | tobiu |
| state | Merged |
| createdAt | Apr 17, 2026, 4:25 PM |
| updatedAt | Apr 17, 2026, 4:31 PM |
| closedAt | Apr 17, 2026, 4:31 PM |
| mergedAt | Apr 17, 2026, 4:31 PM |
| branches | dev ← agent/10049-concept-schema-enrichment |
| url | https://github.com/neomjs/neo/pull/10052 |
Merged

tobiu
commented on Apr 17, 2026, 4:30 PM
Input from Claude Opus 4.6 (Antigravity):
❋ # PR Review Summary
Status: Approved
Clean, narrowly scoped schema extension. The 3-layer separation (aliases → ANALOGOUS_TO → future embeddings) is architecturally sound. The
ext:prefix convention for external concepts prevents namespace pollution. Test coverage is comprehensive.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - Follows established ConceptService patterns (singleton, Map-based indexing, JSONL parsing). The alias/edge distinction correctly preserves the Teaching Test principle.[CONTENT_COMPLETENESS]: 95 - All new methods have full JSDoc with@summary,@param,@returns. Guide updated with schema tables, examples, and warning callouts. Only gap: no@seecross-reference fromresolveAliasto the guide's alias rules.[EXECUTION_QUALITY]: 92 - O(1) alias lookup via reverse Map is optimal. Duplicate detection during load prevents silent data corruption.loadGraph()properly clearsaliasIndexon reload. Minor:resolveAliaschecks direct ID match as fallback — solid defensive coding.[PRODUCTIVITY]: 100 - All #10049 acceptance criteria met: aliases field, ANALOGOUS_TO edge type, ConceptService APIs, guide documentation, and tests.[IMPACT]: 65 - Schema extension enabling future semantic search routing. Not yet consumed by any pipeline — value materializes when ChromaDB embedding (#10037) and DreamService integration land.[COMPLEXITY]: 40 - Straightforward Map indexing and edge type addition. No cross-component state synchronization or worker-thread concerns.[EFFORT_PROFILE]: Quick Win - High ROI (enables the entire semantic bridge pipeline) with low complexity (Map indexing, JSONL seeding).
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10049 (child of #10030)
- Related Graph Nodes: #10050 (description enrichment — prerequisite for quality embeddings), #10037 (ChromaDB concept embedding — downstream consumer), #10032 (ConceptService — parent implementation)
🧠 Graph Ingestion Notes
[KB_GAP]: N/A — The PR correctly distinguishes aliases from cross-framework analogues. No framework misunderstandings detected.[TOOLING_GAP]: Antigravity API instability caused multiple session interruptions during this PR's execution. The retry button injects "continue" as the prompt, causing context loss. This drove the creation of #10051 (Branch-Before-Code mandate) as a systemic mitigation.[RETROSPECTIVE]: The 3-layer design (deterministic aliases → relational ANALOGOUS_TO edges → semantic vectors) is the correct architecture for concept-to-file routing. Aliases handle exact matches, edges handle cross-framework mapping with forced distinction notes, and future ChromaDB embeddings handle fuzzy natural language queries. Each layer has a clear failure mode that doesn't cascade — a missing alias falls through to vector search; a missing ANALOGOUS_TO edge doesn't create false equivalence.
📋 Required Actions
No blocking changes required. LGTM.
- All 21 tests passing
- Guide documentation complete with WARNING callout on ANALOGOUS_TO semantics
- Production graph validates without errors
Summary
Extends the Concept Ontology schema with two new capabilities:
1. Deterministic Aliases (O(1) Lookup)
aliasesstring array on concept nodesConceptService.resolveAlias(term)— case-insensitive reverse lookup from any alias to its canonical conceptoff-main-thread, "setupClass" →setup-class)loadGraph()with error reporting2. ANALOGOUS_TO Edge Type (Cross-Framework Mapping)
ANALOGOUS_TOedge type connecting Neo.mjs concepts to external framework equivalentsext:prefix (e.g.,ext:react-context) to prevent ID collisionnotefield explaining how the Neo.mjs concept differsConceptService.getAnalogousConcepts(id)API for retrievalFiles Changed
ai/services/ConceptService.mjsaliasIndexMap, +resolveAlias(), +getAnalogousConcepts().neo-ai-data/concepts/nodes.jsonlaliaseson 6 concepts.neo-ai-data/concepts/edges.jsonlANALOGOUS_TOedges with ext: targetslearn/agentos/ConceptOntology.mdtest/.../ConceptService.spec.mjsDesign Decisions
Verification
Resolves #10049