LearnNewsExamplesServices
Frontmatter
id8425
titleSwitch Class Hierarchy to JSON
stateClosed
labels
airefactoring
assigneestobiu
createdAtJan 8, 2026, 2:40 PM
updatedAtJan 8, 2026, 2:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/8425
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 8, 2026, 2:42 PM

Switch Class Hierarchy to JSON

Closed v11.19.0 airefactoring
tobiu
tobiu commented on Jan 8, 2026, 2:40 PM

The docs/output/class-hierarchy.yaml file is currently used for hierarchy tracking but is less optimal for programmatic consumption by the AI Knowledge Base services than JSON. The file's token efficiency for LLM consumption is outweighed by the need for robust, structured access via QueryService.

Tasks:

  1. Modify buildScripts/docs/jsdocx.mjs:
    • Stop generating class-hierarchy.yaml.
    • Start generating class-hierarchy.json containing the same key-value mapping (ClassName -> ParentClassName).
  2. Modify ai/mcp/server/knowledge-base/config.mjs:
    • Update hierarchyPath to point to docs/output/class-hierarchy.json.
  3. Modify ai/mcp/server/knowledge-base/services/VectorService.mjs:
    • Remove the logic that generates/writes dist/ai-class-hierarchy.json.
    • (Note: SourceParser logic remains to enrich vector metadata).
  4. Modify ai/mcp/server/knowledge-base/services/QueryService.mjs:
    • Ensure getClassHierarchy reads from the configured hierarchyPath.

Goal: Standardize on class-hierarchy.json as the single source of truth for class relationships, generated by the robust JSDoc parser.

tobiu added the ai label on Jan 8, 2026, 2:40 PM
tobiu added the refactoring label on Jan 8, 2026, 2:40 PM
tobiu assigned to @tobiu on Jan 8, 2026, 2:40 PM
tobiu referenced in commit 6a62379 - "refactor: Switch Class Hierarchy to JSON (#8425)" on Jan 8, 2026, 2:42 PM
tobiu
tobiu Jan 8, 2026, 2:42 PM

Input from Gemini 3 Pro:

✦ I have refactored the Class Hierarchy system to use a clean JSON artifact generated by the JSDoc pipeline.

Changes:

  1. buildScripts/docs/jsdocx.mjs: Switched from generating class-hierarchy.yaml to class-hierarchy.json. The format is a simple map: {"ClassName": "ParentClassName"}.
  2. ai/mcp/server/knowledge-base/config.mjs: Updated hierarchyPath to point to docs/output/class-hierarchy.json.
  3. ai/mcp/server/knowledge-base/services/VectorService.mjs: Removed the redundant code that was generating ai-class-hierarchy.json.
  4. ai/mcp/server/knowledge-base/services/QueryService.mjs: Updated getClassHierarchy to read the new JSON format and logic to handle the simplified key-value structure.

This removes redundancy and ensures the Knowledge Base relies on the authoritative JSDoc-derived hierarchy.

tobiu closed this issue on Jan 8, 2026, 2:42 PM