Skip to content

Commit 05fac0e

Browse files
committed
Add docs
1 parent 9576340 commit 05fac0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+17779
-7
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Documentation
33
on:
44
push:
55
branches:
6-
- gh-pages
6+
- main
77
paths:
88
- 'docs/**'
99
- 'mkdocs.yml'
@@ -19,11 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- name: Checkout gh-pages branch
22+
- name: Checkout main branch
2323
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
26-
ref: gh-pages
2726

2827
- name: Set up Python
2928
uses: actions/setup-python@v5

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,3 @@ $RECYCLE.BIN/
194194

195195
# Linux
196196
.directory
197-
198-
# Docs
199-
# docs/
200-
# mkdocs.yml

docs/about/changelog.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Changelog
2+
3+
All notable changes to DSPy Code will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
---
9+
10+
## [0.1.0] - 2025-11-21
11+
12+
### Added
13+
14+
- Initial release of DSPy Code (formerly DSPy CLI)
15+
- Interactive mode with natural language interface
16+
- Slash commands for all operations
17+
- Code generation for Signatures, Modules, and complete programs
18+
- Model connection support (Ollama, OpenAI, Anthropic, Gemini)
19+
- Built-in MCP client integration
20+
- Real GEPA optimization support
21+
- Codebase RAG for project understanding
22+
- Code validation and sandboxed execution
23+
- Project initialization (fresh and existing projects)
24+
- Session management with auto-save
25+
- Export/import functionality
26+
- Comprehensive documentation with MkDocs
27+
28+
### Changed
29+
30+
- Renamed from "DSPy CLI" to "DSPy Code" with tagline "Claude Code for DSPy"
31+
- Updated branding to Superagentic AI
32+
- Made all commands interactive-only (slash commands)
33+
- Moved codebase indexing to `/init` command
34+
- Enhanced error handling and user feedback
35+
36+
### Fixed
37+
38+
- Context sharing between interactive session and slash commands
39+
- Codebase indexing to use installed packages instead of reference directory
40+
- Permission handling for restricted environments
41+
- Model connection error messages
42+
43+
---
44+
45+
## [Unreleased]
46+
47+
### 🎯 MAJOR CHANGE: Everything in CWD (2024-11-24)
48+
49+
**BREAKING CHANGE**: All dspy-code data now stored in current working directory for better isolation and portability.
50+
51+
#### What Changed
52+
- **Cache location**: Moved from `~/.dspy_cli/cache/` to `.dspy_code/cache/` in CWD
53+
- **Session data**: Moved from `~/.dspy_cli/sessions/` to `.dspy_code/sessions/` in CWD
54+
- **Optimization workflows**: Moved from `~/.dspy_cli/optimization/` to `.dspy_code/optimization/` in CWD
55+
- **Export history**: Moved from `~/.dspy_cli/exports/` to `.dspy_code/exports/` in CWD
56+
- **Command history**: Moved from `~/.dspy_code_history` to `.dspy_code/history.txt` in CWD
57+
58+
#### Why This Matters
59+
**True CWD-only operation**: Everything (code, cache, packages) stays in your project directory
60+
**Enhanced security**: No home directory access at all
61+
**Perfect isolation**: Each project is completely self-contained
62+
**Easy cleanup**: Delete project folder to remove everything
63+
**Portability**: Zip entire project directory to share or backup
64+
**Simplicity**: One directory = one project with all its data
65+
66+
#### Recommended Setup
67+
**CRITICAL**: Always create virtual environment INSIDE your project:
68+
69+
```bash
70+
mkdir my-dspy-project
71+
cd my-dspy-project
72+
python -m venv .venv # Creates .venv IN project
73+
source .venv/bin/activate
74+
pip install dspy-code dspy
75+
dspy-code # Everything stays in my-dspy-project/
76+
```
77+
78+
#### Migration
79+
Your old data in `~/.dspy_cli/` will not be automatically migrated. This is intentional - each project now has its own isolated cache and sessions.
80+
81+
### 🚨 SECURITY FIXES (2024-11-24)
82+
83+
#### File System Access Protection
84+
- **CRITICAL**: Fixed RAG indexer recursively scanning entire file system including personal directories
85+
- **CRITICAL**: Added safety checks to prevent accessing iCloud Photos, Documents, Downloads, and other user directories
86+
- **CRITICAL**: Implemented strict path boundary validation to limit operations to current working directory only
87+
88+
#### Security Measures Added
89+
1. **Directory Safety Validation**
90+
- Blocks scanning of home directory (`~/`)
91+
- Blocks scanning of system directories (`/System`, `/Library`, `/usr`, `/private`)
92+
- Blocks scanning of user directories (Desktop, Documents, Downloads, Pictures, Photos, Music, Movies)
93+
- Blocks scanning of immediate home subdirectories
94+
95+
2. **Path Boundary Protection**
96+
- All file operations validated to stay within project directory
97+
- Symlink attack prevention - verifies files are actually within project
98+
- Maximum depth limiting (10 levels) to prevent infinite recursion
99+
- Explicit permission checks before accessing any file
100+
101+
3. **Startup Safety Checks**
102+
- Critical warning displayed if running from home directory
103+
- Warning displayed if running from user directories
104+
- Error and exit if running from system directories
105+
- Recommendations to use dedicated project directories with virtual environments
106+
107+
4. **Limited Scanning Scope**
108+
- RAG indexer only scans:
109+
- Installed packages in current virtual environment (not system-wide)
110+
- Specific project directories: `generated/`, `modules/`, `signatures/`, `programs/`, `optimizers/`, `src/`
111+
- Python files in current directory (non-recursive)
112+
- Excludes test files, cache directories, hidden files automatically
113+
114+
### Added
115+
- Comprehensive security test suite (`tests/test_security.py`)
116+
- Startup directory safety checks
117+
- Path boundary validation in all file operations
118+
- Project-specific command history
119+
- Complete CWD isolation
120+
- Security documentation page
121+
122+
### Changed
123+
- **BREAKING**: All dspy-code internal data now in `.dspy_code/` in CWD instead of `~/.dspy_cli/`
124+
- RAG indexer strictly limited to project directory
125+
- Project scanner respects path boundaries
126+
- All `rglob()` operations use safe wrappers with depth limits
127+
- `.gitignore` updated to include `.dspy_code/` and `.dspy_cache/`
128+
- Documentation updated to emphasize virtual environment in project directory
129+
130+
### Planned
131+
132+
- Enhanced MCP tool integration
133+
- Additional DSPy module templates
134+
- Improved optimization workflows
135+
- Extended evaluation capabilities
136+
- Performance optimizations
137+
138+
---
139+
140+
**For detailed development history, see [GitHub Commits](https://github.com/superagentic-ai/dspy-code/commits/main)**

docs/about/contributing.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Contributing to DSPy Code
2+
3+
Thank you for your interest in contributing to DSPy Code! We welcome contributions from the community.
4+
5+
**DSPy Code** is built by **[Superagentic AI](https://super-agentic.ai)** and is part of our commitment to open source leadership in the Agentic AI space.
6+
7+
---
8+
9+
## How to Contribute
10+
11+
### Reporting Bugs
12+
13+
If you find a bug, please open an issue on [GitHub](https://github.com/superagentic-ai/dspy-code/issues) with:
14+
15+
- A clear description of the bug
16+
- Steps to reproduce
17+
- Expected vs actual behavior
18+
- Your environment (OS, Python version, DSPy version)
19+
- Any relevant error messages or logs
20+
21+
### Suggesting Features
22+
23+
We welcome feature suggestions! Please open an issue with:
24+
25+
- A clear description of the feature
26+
- Use cases and examples
27+
- Why this feature would be valuable
28+
- Any implementation ideas (optional)
29+
30+
### Code Contributions
31+
32+
1. **Fork the repository**
33+
```bash
34+
git clone https://github.com/superagentic-ai/dspy-code.git
35+
cd dspy-code
36+
```
37+
38+
2. **Create a branch**
39+
```bash
40+
git checkout -b feature/your-feature-name
41+
```
42+
43+
3. **Set up development environment**
44+
```bash
45+
python -m venv venv
46+
source venv/bin/activate # On Windows: venv\Scripts\activate
47+
pip install -e ".[dev]"
48+
```
49+
50+
4. **Make your changes**
51+
- Follow the existing code style
52+
- Add tests for new features
53+
- Update documentation as needed
54+
- Ensure all tests pass
55+
56+
5. **Test your changes**
57+
```bash
58+
pytest tests/
59+
mkdocs build # Verify documentation builds
60+
```
61+
62+
6. **Commit your changes**
63+
```bash
64+
git commit -m "Add: Description of your changes"
65+
```
66+
67+
7. **Push and create a Pull Request**
68+
```bash
69+
git push origin feature/your-feature-name
70+
```
71+
72+
---
73+
74+
## Development Guidelines
75+
76+
### Code Style
77+
78+
- Follow PEP 8 Python style guide
79+
- Use type hints where appropriate
80+
- Write docstrings for all public functions and classes
81+
- Keep functions focused and single-purpose
82+
83+
### Testing
84+
85+
- Write tests for new features
86+
- Ensure existing tests still pass
87+
- Aim for good test coverage
88+
89+
### Documentation
90+
91+
- Update relevant documentation pages
92+
- Add examples for new features
93+
- Keep documentation clear and beginner-friendly
94+
95+
### Commit Messages
96+
97+
Use clear, descriptive commit messages:
98+
99+
```
100+
Add: Feature description
101+
Fix: Bug description
102+
Update: Change description
103+
Refactor: Refactoring description
104+
Docs: Documentation update
105+
```
106+
107+
---
108+
109+
## Project Structure
110+
111+
```
112+
dspy-code/
113+
├── dspy_code/ # Main package
114+
│ ├── commands/ # Slash command handlers
115+
│ ├── core/ # Core functionality
116+
│ ├── models/ # Code generation
117+
│ ├── optimization/ # GEPA integration
118+
│ ├── mcp/ # MCP client
119+
│ ├── rag/ # Codebase RAG
120+
│ └── ...
121+
├── docs/ # Documentation
122+
├── tests/ # Test suite
123+
├── examples/ # Example scripts
124+
└── pyproject.toml # Project configuration
125+
```
126+
127+
---
128+
129+
## Areas for Contribution
130+
131+
### High Priority
132+
133+
- Additional DSPy module templates
134+
- Enhanced MCP tool integrations
135+
- Performance optimizations
136+
- Extended validation rules
137+
- More evaluation metrics
138+
139+
### Documentation
140+
141+
- Tutorial improvements
142+
- Code examples
143+
- Best practices guides
144+
- Video tutorials (external)
145+
146+
### Testing
147+
148+
- Additional test coverage
149+
- Integration tests
150+
- Performance benchmarks
151+
152+
---
153+
154+
## Code of Conduct
155+
156+
We are committed to providing a welcoming and inclusive environment. Please:
157+
158+
- Be respectful and considerate
159+
- Welcome newcomers and help them learn
160+
- Focus on constructive feedback
161+
- Celebrate diverse perspectives
162+
163+
---
164+
165+
## Questions?
166+
167+
- **GitHub Issues**: [https://github.com/superagentic-ai/dspy-code/issues](https://github.com/superagentic-ai/dspy-code/issues)
168+
- **Website**: [https://super-agentic.ai](https://super-agentic.ai)
169+
170+
---
171+
172+
## Recognition
173+
174+
Contributors will be recognized in:
175+
176+
- Release notes
177+
- Project documentation
178+
- GitHub contributors page
179+
180+
Thank you for helping make DSPy Code better! 🚀
181+
182+
---
183+
184+
**Built by [Superagentic AI](https://super-agentic.ai) - The Home of Agentic AI**

0 commit comments

Comments
 (0)