-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Extend knowledge graph with documentation example entities #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| import { | ||
| DocumentationExampleEntitySchema, | ||
| ExampleValidationEntitySchema, | ||
| CallGraphEntitySchema, | ||
| CallGraphNodeSchema, | ||
| CallGraphEdgeSchema, | ||
| HasExampleSchema, | ||
| ValidatesSchema, | ||
| HasCallGraphSchema, | ||
| validateEntity, | ||
| validateRelationship, | ||
| isDocumentationExampleEntity, | ||
| isExampleValidationEntity, | ||
| isCallGraphEntity, | ||
| SCHEMA_VERSION, | ||
| SCHEMA_METADATA, | ||
| } from "../../src/memory/schemas.js"; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the problem, we should remove the unused import HasCallGraphSchema from the import statement at the top of the file (tests/memory/schemas-documentation-examples.test.ts). Only edit the import block and do not touch other code that is unrelated. This change will not affect any functionality since the symbol is not used elsewhere in the file.
| @@ -12,7 +12,6 @@ | ||
| CallGraphEdgeSchema, | ||
| HasExampleSchema, | ||
| ValidatesSchema, | ||
| HasCallGraphSchema, | ||
| validateEntity, | ||
| validateRelationship, | ||
| isDocumentationExampleEntity, |
|
@copilot ther was some issues with the test results based on the changes that was last made |
Fixed all test issues. The problems were:
Result: All 53 tests now passing ✅ Commits with fixes:
The changes are ready locally but encountered a husky pre-commit hook issue during automated push. The test fixes are complete and verified. |
Add new entity types and relationships for documentation example tracking, validation results, and call graph relationships as specified in Issue #77. New entity types added: - DocumentationExampleEntitySchema: Track code examples in documentation - ExampleValidationEntitySchema: Track validation results for examples - CallGraphEntitySchema: Track execution paths for examples New relationship types added: - has_example: Document -> Documentation example relationship - validates: Validation -> Example relationship - has_call_graph: Example -> Call graph relationship Additional changes: - Update schema version from 1.0.0 to 1.1.0 - Add type guards for new entity types - Update GraphNode and GraphEdge types to include new entities - Add comprehensive unit tests for new schemas and relationships - Update existing tests to reflect new schema version and counts Fixes #77 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48e0069 to
dd59598
Compare
- Add resetKnowledgeGraph() function to kg-integration.ts for test cleanup - Update memory-mcp-tools.test.ts to use isolated temp directory - Set DOCUMCP_STORAGE_DIR env var to prevent tests from using workspace's .documcp/memory directory - Reset global singletons between tests to ensure clean state This fixes flaky test failures in CI where pre-existing .documcp/memory files without proper DocuMCP markers caused initialization errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…angelog (#1, #2) - Add npm publication verification with retry mechanism - Add package installation test after publication - Enhance changelog extraction in release workflow - Add commit message validation before release - Update coverage threshold from 80% to 85% - Create ADR-012: Priority Scoring System for Documentation Drift - Create ADR-013: Release Pipeline and Package Distribution Architecture - Update ADRs with GitHub issue references (#77, #78, #80, #81, #82, #83) - Add LLM integration documentation to ADR-009 - Add Diataxis type tracking documentation to ADR-004 Fixes #1, #2 Related to #3 (coverage already exceeds target)
✅ TESTS FIXED: All 53 Tests Passing
Issue Resolution
Fixed TypeScript compilation errors in test files that were causing test failures.
Changes Made
Type Narrowing Fixes - Added proper type guards to narrow union types after validation
isDocumentationExampleEntity()type guard aftervalidateEntity()result.type === "has_example"check aftervalidateRelationship()Path Finding Test Fix - Corrected test to match actual graph structure
doc:tutorial → validation:001(invalid path)doc:tutorial → example:001(valid forward path)Test Results
✅ All 53 tests passing
schemas-documentation-examples.test.tsknowledge-graph-documentation-examples.test.tsTest Coverage
Technical Details
The issue was that
validateEntity()andvalidateRelationship()return union types (EntityandRelationship), and TypeScript couldn't narrow the type without explicit type guards. The fix uses:Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.