Skip to content

Commit 9d4076a

Browse files
CopilotPuchaczov
andauthored
Add comprehensive AI agent documentation for Musoq architecture and development (#108)
* Initial plan * Complete comprehensive AI agent documentation for Musoq Co-authored-by: Puchaczov <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Puchaczov <[email protected]> Co-authored-by: Jakub Puchała <[email protected]>
1 parent 027a3ca commit 9d4076a

File tree

6 files changed

+3089
-0
lines changed

6 files changed

+3089
-0
lines changed

.copilot/INDEX.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# .copilot Documentation Index
2+
3+
This directory contains comprehensive documentation for AI agents working with the Musoq SQL query engine codebase.
4+
5+
## Documentation Files
6+
7+
### 📖 [README.md](./README.md)
8+
**Main documentation entry point** - Comprehensive overview covering architecture, components, development workflow, and testing strategies. Start here for a complete understanding of the Musoq system.
9+
10+
**Key Topics:**
11+
- Quick start and essential understanding
12+
- Architecture overview and design principles
13+
- Core component deep dive (Parser, Schema, Converter, Evaluator, Plugins)
14+
- Plugin development basics
15+
- Query processing pipeline
16+
- Development workflow and project structure
17+
- API usage patterns
18+
- Testing strategies
19+
- Build and deployment
20+
- Troubleshooting guide
21+
- Key files reference
22+
23+
### 🏗️ [architecture-deep-dive.md](./architecture-deep-dive.md)
24+
**Detailed technical architecture** - In-depth analysis of each component's internal architecture, design patterns, and integration strategies.
25+
26+
**Key Topics:**
27+
- Component architecture details
28+
- Parser module internals (AST, lexing, precedence)
29+
- Schema module abstractions (ISchema, RowSource, data flow)
30+
- Converter build chain pipeline
31+
- Evaluator compilation and execution
32+
- Plugin system architecture
33+
- Integration patterns
34+
- Performance considerations
35+
- Memory management and optimization
36+
37+
### 🔌 [plugin-development-guide.md](./plugin-development-guide.md)
38+
**Complete plugin development reference** - Step-by-step guide for creating data sources and function libraries.
39+
40+
**Key Topics:**
41+
- Data source plugin creation (schema, row source, entities)
42+
- Advanced row source patterns (chunking, parameterization)
43+
- Dynamic schema support and runtime column discovery
44+
- Function library development (basic, generic, aggregation)
45+
- Complex function examples (JSON, HTTP/Web)
46+
- Plugin registration and deployment
47+
- Testing plugin development
48+
- Best practices for performance and error handling
49+
50+
### 🛠️ [development-debugging-guide.md](./development-debugging-guide.md)
51+
**Development environment and debugging** - Comprehensive guide for setting up development environment and debugging techniques.
52+
53+
**Key Topics:**
54+
- Development environment setup
55+
- Component-specific development cycles
56+
- Debugging techniques (AST, code generation, execution, schema resolution)
57+
- Testing strategies (unit, integration, performance)
58+
- Build and CI/CD configuration
59+
- Troubleshooting common issues (parse errors, schema failures, compilation errors)
60+
- Performance optimization and profiling
61+
62+
### 💻 [api-usage-examples.md](./api-usage-examples.md)
63+
**Practical API usage and examples** - Real-world examples and usage patterns for integrating Musoq.
64+
65+
**Key Topics:**
66+
- Core API overview (InstanceCreator, analysis API)
67+
- Schema provider implementation patterns
68+
- Data source examples (in-memory, REST API, database)
69+
- Advanced usage patterns (parameterization, dynamic registration, streaming)
70+
- Query analysis and optimization
71+
- Error handling and logging
72+
- Testing API usage
73+
74+
## Quick Navigation
75+
76+
### For New Contributors
77+
1. Start with [README.md](./README.md) - Quick Start section
78+
2. Read [architecture-deep-dive.md](./architecture-deep-dive.md) - Component Architecture
79+
3. Follow [development-debugging-guide.md](./development-debugging-guide.md) - Development Environment Setup
80+
81+
### For Plugin Developers
82+
1. Review [README.md](./README.md) - Plugin Development section
83+
2. Follow [plugin-development-guide.md](./plugin-development-guide.md) - Complete guide
84+
3. Reference [api-usage-examples.md](./api-usage-examples.md) - Data source examples
85+
86+
### For API Integration
87+
1. Study [api-usage-examples.md](./api-usage-examples.md) - Core API and examples
88+
2. Reference [README.md](./README.md) - API Usage Patterns
89+
3. Check [development-debugging-guide.md](./development-debugging-guide.md) - Testing strategies
90+
91+
### For Debugging Issues
92+
1. Check [development-debugging-guide.md](./development-debugging-guide.md) - Troubleshooting section
93+
2. Review [README.md](./README.md) - Troubleshooting Guide
94+
3. Use [architecture-deep-dive.md](./architecture-deep-dive.md) - Component internals
95+
96+
### For Performance Optimization
97+
1. Review [architecture-deep-dive.md](./architecture-deep-dive.md) - Performance Considerations
98+
2. Check [development-debugging-guide.md](./development-debugging-guide.md) - Performance Optimization
99+
3. Study [plugin-development-guide.md](./plugin-development-guide.md) - Best Practices
100+
101+
## Key Concepts Quick Reference
102+
103+
### Core Architecture
104+
- **Parser**: SQL → AST (Abstract Syntax Tree)
105+
- **Schema**: Data source abstraction and contracts
106+
- **Converter**: AST → C# code generation
107+
- **Evaluator**: Dynamic compilation and execution
108+
- **Plugins**: Extensible function library
109+
110+
### Data Flow
111+
```
112+
SQL Query → Lexer → Parser → AST → Converter → C# Code → Compiler → Assembly → Executor → Results
113+
```
114+
115+
### Essential Classes
116+
- `Parser` - Main parsing logic
117+
- `ISchema` - Plugin interface for data sources
118+
- `RowSource` - Data iteration abstraction
119+
- `CompiledQuery` - Executable query wrapper
120+
- `InstanceCreator` - Main API entry point
121+
122+
### Plugin Pattern
123+
```csharp
124+
ISchemaSchemaBaseYourSchema
125+
126+
RowSourceYourRowSource
127+
128+
Your Entity Classes
129+
```
130+
131+
### Testing Pattern
132+
```csharp
133+
[TestClass]
134+
public class YourTests : BasicEntityTestBase
135+
{
136+
[TestMethod]
137+
public void Should_Test_Feature()
138+
{
139+
var vm = CreateAndRunVirtualMachine(query, data);
140+
var results = vm.Run();
141+
// Assertions
142+
}
143+
}
144+
```
145+
146+
---
147+
148+
This documentation is designed specifically for AI agents and provides comprehensive coverage of the Musoq codebase for development, debugging, and extension purposes.

0 commit comments

Comments
 (0)