Skip to content

Commit 88ce957

Browse files
authored
Merge pull request #22 from SoftwareDevLabs/copilot/fix-acb24ff4-28a6-4a2c-b4e2-301c42151b9e
Add comprehensive .github/copilot-instructions.md for SDLC_core repository onboarding
2 parents 553dbb1 + 8b74543 commit 88ce957

File tree

2 files changed

+216
-0
lines changed

2 files changed

+216
-0
lines changed

.github/copilot-instructions.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# Copilot Instructions for SDLC_core
2+
3+
## Repository Summary
4+
5+
SDLC_core is a Python-based Software Development Life Cycle core project that provides AI/ML capabilities for software development workflows. The repository contains modules for LLM clients, intelligent agents, memory management, prompt engineering, document retrieval, skill execution, and various utilities. It combines Python core functionality with TypeScript Azure DevOps pipeline configurations.
6+
7+
**Repository Size**: ~25 directories, mixed Python/TypeScript codebase
8+
**Primary Language**: Python 3.10-3.12
9+
**Secondary**: TypeScript (Azure pipelines), Shell scripts
10+
**Project Type**: AI/ML library and tooling for SDLC workflows
11+
**Target Runtime**: Python 3.10+ with Azure DevOps integration
12+
13+
## Build and Validation Instructions
14+
15+
### Prerequisites
16+
17+
**CRITICAL**: Always run dependency installation before any build or test operations:
18+
19+
```bash
20+
# Install testing and analysis dependencies (requirements.txt is empty)
21+
pip install pytest pytest-cov mypy pylint
22+
```
23+
24+
### Environment Setup
25+
26+
```bash
27+
# Set Python path for proper module resolution
28+
export PYTHONPATH=.
29+
30+
# Verify Python version (3.10+ required)
31+
python --version
32+
```
33+
34+
### Build Steps
35+
36+
1. **Bootstrap** - No specific bootstrap required, Python-based project
37+
2. **Dependencies** - Manual installation required (empty requirements.txt):
38+
```bash
39+
pip install pytest pytest-cov mypy pylint
40+
```
41+
3. **Build** - No compilation step needed for Python modules
42+
4. **Validate** - Run linting and static analysis
43+
44+
### Testing
45+
46+
**CURRENT STATE**: Test infrastructure is set up with template files. All commands run cleanly.
47+
48+
```bash
49+
# Test framework validation (will show "no tests ran" for empty template files)
50+
PYTHONPATH=. python -m pytest test/ -v
51+
52+
# Run tests with coverage (when actual tests exist)
53+
PYTHONPATH=. python -m pytest test/ --cov=src/ --cov-report=xml
54+
55+
# Run specific test types (currently empty template structure)
56+
PYTHONPATH=. python -m pytest test/unit/ -v # Unit tests
57+
PYTHONPATH=. python -m pytest test/integration/ -v # Integration tests
58+
PYTHONPATH=. python -m pytest test/e2e/ -v # End-to-end tests
59+
```
60+
61+
**Test Structure** (template-ready):
62+
- `test/unit/` - Unit test templates for each src/ component
63+
- `test/integration/` - API and integration test templates
64+
- `test/smoke/` - Smoke test templates
65+
- `test/e2e/` - End-to-end workflow test templates
66+
67+
**VERIFIED**: All test commands run successfully with expected "no tests ran" output for template files.
68+
69+
### Linting and Static Analysis
70+
71+
```bash
72+
# Run pylint on all Python files (clean output)
73+
python -m pylint src/ --exit-zero
74+
75+
# Run mypy static analysis (works correctly with documented exclusion)
76+
python -m mypy src/ --ignore-missing-imports --exclude="src/llm/router.py"
77+
```
78+
79+
**SUCCESS**: mypy runs cleanly with documented parameters.
80+
**KNOWN ISSUES**:
81+
- Without exclusion, `mypy` reports duplicate "router" modules (`src/llm/router.py` and `src/fallback/router.py`)
82+
- Workaround documented above works correctly
83+
84+
### Validation Pipeline
85+
86+
The following GitHub Actions run automatically on push:
87+
- **Python Tests**: `.github/workflows/python-test-static.yml` (Python 3.11, pytest, mypy)
88+
- **Pylint**: `.github/workflows/pylint.yml` (Python 3.10-3.12)
89+
- **CodeQL**: Security analysis
90+
- **Super Linter**: Multi-language linting
91+
92+
**Time Requirements**:
93+
- Test suite: ~30 seconds
94+
- Full linting: ~45 seconds
95+
- Static analysis: ~20 seconds
96+
97+
## Project Layout and Architecture
98+
99+
### Core Architecture
100+
101+
```
102+
src/ → Core engine with modular components:
103+
├── agents/ → Agent classes (planner, executor, base agent)
104+
├── memory/ → Short-term and long-term memory modules
105+
├── pipelines/ → Chat flows, document processing, task routing
106+
├── retrieval/ → Vector search and document lookup
107+
├── skills/ → Web search, code execution capabilities
108+
├── vision_audio/ → Multimodal processing (image/audio)
109+
├── prompt_engineering/ → Template management, few-shot, chaining
110+
├── llm/ → OpenAI, Anthropic, custom LLM routing
111+
├── fallback/ → Recovery logic when LLMs fail
112+
├── guardrails/ → PII filters, output validation, safety
113+
├── handlers/ → Input/output processing, error management
114+
└── utils/ → Logging, caching, rate limiting, tokens
115+
```
116+
117+
### Configuration and Data
118+
119+
```
120+
config/ → YAML configurations for models, prompts, logging
121+
data/ → Prompts, embeddings, dynamic content
122+
examples/ → Minimal scripts demonstrating key features
123+
notebooks/ → Jupyter notebooks for experimentation
124+
```
125+
126+
### Build and Pipeline Infrastructure
127+
128+
```
129+
build/azure-pipelines/ → TypeScript build configurations
130+
├── common/ → Shared utilities (releaseBuild.ts, createBuild.ts)
131+
├── linux/ → Linux-specific build scripts
132+
├── win32/ → Windows build configurations
133+
└── config/ → Build configuration files
134+
```
135+
136+
### Testing Structure
137+
138+
```
139+
test/ → Comprehensive testing suite:
140+
├── unit/ → Component unit tests
141+
├── integration/ → API and service integration tests
142+
├── smoke/ → Basic functionality validation
143+
└── e2e/ → End-to-end workflow tests
144+
```
145+
146+
### Documentation and Process
147+
148+
```
149+
doc/ → Project documentation:
150+
├── submitting_code.md → Branch strategy (dev/main, inbox workflow)
151+
├── building.md → Build instructions (currently minimal)
152+
├── STYLE.md → Code style guidelines
153+
├── ORGANIZATION.md → Code organization principles
154+
└── specs/ → Feature specifications and templates
155+
```
156+
157+
### Key Dependencies and Architecture Notes
158+
159+
**Python Module Dependencies** (install manually):
160+
- `pytest`, `pytest-cov` - Testing framework
161+
- `mypy` - Static type checking
162+
- `pylint` - Code quality analysis
163+
164+
**Branch Strategy** (from doc/submitting_code.md):
165+
- `dev/main` - Primary development branch
166+
- `dev/<alias>/<feature>` - Feature branch pattern
167+
- `inbox` - Special branch for coordinating with Overall Tool Repo
168+
- Git2Git automation replicates commits to Overall Tool Repo
169+
170+
**Azure DevOps Integration**:
171+
- TypeScript build scripts in `build/azure-pipelines/`
172+
- Cosmos DB integration for build tracking
173+
- Environment variables: `VSCODE_QUALITY`, `BUILD_SOURCEVERSION`
174+
175+
## Root Directory Files
176+
177+
```
178+
.editorconfig → Editor configuration
179+
.gitattributes → Git file handling rules
180+
.gitignore → Git ignore patterns
181+
CODE_OF_CONDUCT.md → Community guidelines
182+
CONTRIBUTING.md → Contribution process and guidelines
183+
Dockerfile → Container configuration (empty)
184+
LICENSE.md → MIT License
185+
NOTICE.md → Legal notices and attributions
186+
README.md → Project overview and quick start
187+
SECURITY.md → Security policy and reporting
188+
SUPPORT.md → Support channels and help
189+
requirements.txt → Python dependencies (currently empty)
190+
setup.py → Python package setup (currently empty)
191+
```
192+
193+
## Critical Instructions for Coding Agents
194+
195+
**ALWAYS do the following before making changes:**
196+
197+
1. **Install dependencies**: `pip install pytest pytest-cov mypy pylint`
198+
2. **Set Python path**: `export PYTHONPATH=.` or prefix commands with `PYTHONPATH=.`
199+
3. **Test before changing**: `PYTHONPATH=. python -m pytest test/ -v` to validate current state
200+
4. **Check module imports**: Ensure new Python modules have proper `__init__.py` files
201+
5. **Follow branch naming**: Use `dev/<alias>/<feature>` pattern for feature branches
202+
203+
**NEVER do the following:**
204+
- Run tests without setting PYTHONPATH
205+
- Assume requirements.txt contains dependencies
206+
- Create modules named "router" (conflicts with existing router.py files)
207+
- Modify Azure pipeline scripts without TypeScript knowledge
208+
- Skip the inbox workflow when submitting to Overall Tool Repo
209+
210+
**For module changes in src/:**
211+
- Maintain clear module boundaries as shown in src/README.md
212+
- Update corresponding tests in test/unit/
213+
- Consider impact on LLM client routing and fallback logic
214+
- Verify no naming conflicts with existing modules
215+
216+
**Trust these instructions** - only search for additional information if these instructions are incomplete or found to be incorrect. The empty requirements.txt and specific PYTHONPATH requirements are documented limitations that require manual handling.

test/unit/llm/test_llm_integration.py

Whitespace-only changes.

0 commit comments

Comments
 (0)