Skip to content

Commit af20a1f

Browse files
committed
Add AI policy for codegen and improved github template
1 parent 24245a3 commit af20a1f

File tree

6 files changed

+306
-12
lines changed

6 files changed

+306
-12
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: 💬 GitHub Discussions
4-
url: https://github.com/SuperagenticAI/dspy-code/discussions
5-
about: Ask questions, share ideas, and discuss with the community
63
- name: 📚 Documentation
7-
url: https://dspy-code.super-agentic.ai
4+
url: https://superagenticai.github.io/dspy-code/
85
about: Read the full documentation

.github/ISSUE_TEMPLATE/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ body:
3030
attributes:
3131
label: Documentation Location
3232
description: Where is the documentation issue? (URL or file path)
33-
placeholder: https://dspy-code.super-agentic.ai/guide/...
33+
placeholder: https://superagenticai.github.io/dspy-code/guide/...
3434
validations:
3535
required: true
3636

.github/SECURITY.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We actively support and provide security updates for the following versions:
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| 0.1.x | :white_check_mark: |
10+
| < 0.1.0 | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
**Please do not report security vulnerabilities through public GitHub issues.**
15+
16+
If you discover a security vulnerability, please report it via email to **[email protected]** with the following information:
17+
18+
* **Description**: A clear description of the vulnerability
19+
* **Impact**: The potential impact of the vulnerability
20+
* **Steps to Reproduce**: Detailed steps to reproduce the issue
21+
* **Suggested Fix**: If you have a suggested fix, please include it
22+
* **Affected Versions**: Which versions are affected
23+
24+
### What to Expect
25+
26+
* **Acknowledgment**: We will acknowledge receipt of your report within 48 hours
27+
* **Initial Assessment**: We will provide an initial assessment within 7 days
28+
* **Updates**: We will keep you informed of our progress
29+
* **Resolution**: We will work with you to understand and resolve the issue quickly
30+
* **Disclosure**: We will coordinate disclosure with you after the issue is resolved
31+
32+
### Security Best Practices
33+
34+
When reporting vulnerabilities:
35+
* Do not access or modify user data without explicit permission
36+
* Do not perform any actions that could harm users or their data
37+
* Do not disclose the vulnerability publicly until it has been resolved
38+
* Follow responsible disclosure practices
39+
40+
## Security Updates
41+
42+
Security updates will be released as patch versions (e.g., 0.1.1 → 0.1.2) and will be documented in the [CHANGELOG.md](../CHANGELOG.md).
43+
44+
## Security Considerations for Contributors
45+
46+
* Never commit secrets, API keys, or credentials
47+
* Use environment variables for sensitive configuration
48+
* Follow secure coding practices
49+
* Review dependencies for known vulnerabilities
50+
* Keep dependencies up to date
51+
52+
Thank you for helping keep DSPy Code secure! 🔒
53+

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pytest tests/
6767
## Additional Notes
6868

6969
<!-- Any additional information that reviewers should know -->
70+
<!-- If you used AI tools, see CONTRIBUTING.md for disclosure requirements -->
7071

7172
## Reviewer Notes
7273

AI-GENERATED-CODE-POLICY.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# AI-Generated Code Policy
2+
3+
## Summary
4+
We welcome contributions that used AI tools, provided they meet our quality, testing, security and licensing expectations. AI-generated code is treated the same as human-written code — it must be reviewed, tested, and owned by the contributor.
5+
6+
## Disclosure
7+
If you used AI to produce any part of your contribution, include the following in your PR description:
8+
- **Model/Agent** (e.g., "GPT-5 Thinking mini via Copilot")
9+
- **How AI was used** (e.g., "boilerplate, implementation draft, tests, docs")
10+
- **Manual validation** performed (linters, tests, security checks)
11+
12+
Simple autocompletion does not require disclosure. Substantial generation (functions, algorithms, large refactors, tests, docs) requires disclosure.
13+
14+
## Contributor responsibilities
15+
- You remain fully responsible for the code you submit. Understand, test, and be able to explain all changes.
16+
- All code (AI or human) must pass linters and tests and meet project coding standards.
17+
- Provide documentation and tests for non-trivial changes.
18+
19+
## IP, licensing, and security
20+
- By contributing you confirm you have the right to contribute the content (including AI outputs) under this project's license.
21+
- Do not submit content that includes proprietary, copyrighted, or secret data.
22+
- Avoid insecure patterns and secrets in contributions.
23+
24+
## Workflow rules
25+
- For **core**, API, or architectural changes open an **Issue** first and discuss; link the Issue from the PR.
26+
- Small bug fixes and docs may open PRs directly, but still follow disclosure and testing requirements.
27+
28+
## Maintainer rights
29+
Maintainers may reject or modify PRs that diverge from project goals, introduce undue complexity, or violate the above rules.
30+
31+
## Enforcement and updates
32+
This policy may be updated as the ecosystem evolves. If maintainers suspect problematic AI-generated content they may request provenance, tests, or rework.

CONTRIBUTING.md

Lines changed: 218 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,27 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/Supera
3131

3232
We welcome pull requests! For major changes, please open an issue first to discuss what you would like to change.
3333

34+
### AI-generated contributions
35+
36+
See [AI-GENERATED-CODE-POLICY.md](AI-GENERATED-CODE-POLICY.md) for our rules about contributions that use AI tools. If you used AI, please disclose the model/agent and how it was used in your PR description.
37+
3438
## Development Setup
3539

3640
### Prerequisites
3741

38-
* Python 3.10 or higher
42+
* Python 3.10 or higher (we support Python 3.10, 3.11, 3.12, and 3.13)
3943
* [uv](https://github.com/astral-sh/uv) (recommended) or pip
4044
* Git
4145

46+
### Supported Platforms
47+
48+
We test on:
49+
* Linux (Ubuntu)
50+
* macOS
51+
* Windows (limited testing)
52+
53+
If you encounter platform-specific issues, please report them with your OS details.
54+
4255
### Quick Setup
4356

4457
1. **Fork and clone the repository**
@@ -64,6 +77,8 @@ source .venv/bin/activate # On Windows: .venv\Scripts\activate
6477
pip install -e ".[dev,test,docs]"
6578
```
6679

80+
**Note:** The `-e` flag installs the package in "editable" or "development" mode. This means changes to the source code are immediately reflected without reinstalling. The `dspy-code` command will use your local development version.
81+
6782
3. **Install pre-commit hooks**
6883

6984
```bash
@@ -112,6 +127,16 @@ ruff check --fix .
112127
ruff format .
113128
```
114129

130+
### 4a. Type Checking (Optional but Recommended)
131+
132+
We use [mypy](https://mypy.readthedocs.io/) for static type checking:
133+
134+
```bash
135+
mypy dspy_code
136+
```
137+
138+
Note: Some third-party libraries (dspy, mcp, etc.) may not have complete type stubs, so some `ignore_missing_imports` exceptions are configured in `pyproject.toml`.
139+
115140
### 5. Commit
116141

117142
Use [Conventional Commits](https://www.conventionalcommits.org/):
@@ -139,6 +164,30 @@ git push origin feature/your-feature-name
139164

140165
Then create a pull request on GitHub.
141166

167+
**CI/CD Expectations:**
168+
* All PRs must pass CI checks (linting, formatting, tests)
169+
* Tests must pass on all supported Python versions (3.10, 3.11, 3.12, 3.13)
170+
* Code must pass Ruff linting and formatting checks
171+
* Coverage should not decrease significantly
172+
* Fix any CI failures before requesting review
173+
174+
### 7. Code Review Process
175+
176+
All pull requests require review before merging. Here's what reviewers look for:
177+
178+
* **Functionality**: Does the code work as intended?
179+
* **Tests**: Are there adequate tests covering the changes?
180+
* **Documentation**: Is the code documented appropriately?
181+
* **Style**: Does the code follow our coding standards?
182+
* **Breaking changes**: Are any breaking changes properly documented?
183+
* **Performance**: Are there any obvious performance issues?
184+
185+
**Review expectations:**
186+
* Be respectful and constructive in feedback
187+
* Respond to review comments promptly
188+
* Address all requested changes before requesting re-review
189+
* Keep PRs focused and reasonably sized (<500 lines when possible)
190+
142191
## Coding Standards
143192

144193
### Python Style
@@ -209,12 +258,24 @@ pytest -n auto
209258

210259
## Documentation
211260

212-
Documentation will be available on GitHub Pages once set up.
261+
Documentation is available at [https://superagenticai.github.io/dspy-code/](https://superagenticai.github.io/dspy-code/).
213262

214-
For now, refer to:
215-
- README.md for overview and quick start
216-
- Code docstrings for API documentation
217-
- Examples in `examples/` directory
263+
When updating documentation:
264+
* Update relevant docstrings for API changes
265+
* Update examples if behavior changes
266+
* Add new examples for new features
267+
* Update the main documentation site (in `docs/`) for user-facing changes
268+
* Follow the existing documentation style
269+
270+
### Changelog
271+
272+
We follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
273+
274+
When making changes:
275+
* Add entries to `CHANGELOG.md` under `[Unreleased]`
276+
* Use appropriate categories: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`
277+
* For breaking changes, clearly mark them and explain migration steps
278+
* Link to related issues/PRs when applicable
218279

219280
## Project Structure
220281

@@ -231,15 +292,165 @@ dspy-code/
231292
└── examples/ # Example scripts
232293
```
233294

295+
## Package Development
296+
297+
### Building the Package
298+
299+
To build the package locally:
300+
301+
```bash
302+
# Install build dependencies
303+
uv pip install build hatchling twine
304+
305+
# Build wheel and source distribution
306+
python -m build
307+
308+
# Check the built package
309+
twine check dist/*
310+
```
311+
312+
The built packages will be in the `dist/` directory:
313+
* `dspy_code-X.Y.Z-py3-none-any.whl` - Wheel distribution
314+
* `dspy_code-X.Y.Z.tar.gz` - Source distribution
315+
316+
### Testing Package Installation
317+
318+
Test installing the built package:
319+
320+
```bash
321+
# Install from wheel
322+
uv pip install dist/dspy_code-*.whl
323+
324+
# Or install from source
325+
uv pip install dist/dspy_code-*.tar.gz
326+
327+
# Verify installation
328+
dspy-code --version
329+
```
330+
331+
### Package Structure
332+
333+
The package uses modern Python packaging standards:
334+
* **`pyproject.toml`** - PEP 517/518 compliant build configuration
335+
* **`hatchling`** - Modern build backend (no setup.py needed)
336+
* **`MANIFEST.in`** - Controls which files are included in source distributions (README, LICENSE, CHANGELOG, etc.)
337+
* **Entry point** - `dspy-code` command defined in `[project.scripts]` mapping to `dspy_code.main:main`
338+
339+
When adding files that should be included in distributions:
340+
* Update `MANIFEST.in` for source distributions
341+
* Update `[tool.hatch.build.targets.sdist]` in `pyproject.toml` if needed
342+
* Test with `python -m build` to verify files are included
343+
344+
### Package Metadata
345+
346+
Package metadata is defined in `pyproject.toml`:
347+
* Version is managed in `[project]` section
348+
* Dependencies are listed in `[project.dependencies]`
349+
* Optional dependencies in `[project.optional-dependencies]`
350+
* Entry points in `[project.scripts]`
351+
* URLs (homepage, docs, etc.) in `[project.urls]`
352+
353+
When updating metadata:
354+
* Update version in `pyproject.toml` (we use semantic versioning)
355+
* Update `CHANGELOG.md` with release notes
356+
* Ensure classifiers match the current Python version support
357+
358+
## Release Process
359+
360+
We follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
361+
* **MAJOR** (x.0.0): Breaking changes
362+
* **MINOR** (0.x.0): New features, backwards compatible
363+
* **PATCH** (0.0.x): Bug fixes, backwards compatible
364+
365+
### Version Management
366+
367+
* Version is stored in `pyproject.toml` under `[project]``version`
368+
* Update version before each release
369+
* Tag releases in git: `git tag v0.1.2`
370+
* Version should match the release in CHANGELOG.md
371+
372+
### Breaking Changes
373+
374+
Breaking changes require:
375+
1. Opening an issue for discussion first
376+
2. Clear migration guide in the PR
377+
3. Deprecation warnings (if applicable) before removal
378+
4. Documentation updates
379+
5. Entry in CHANGELOG.md under "Changed" with "BREAKING CHANGE:" prefix
380+
381+
### Deprecation Policy
382+
383+
* Deprecated features will be marked with `@deprecated` in docstrings
384+
* Deprecation warnings will be shown for at least one minor version
385+
* Breaking changes will be announced in advance when possible
386+
387+
## Security
388+
389+
### Reporting Security Vulnerabilities
390+
391+
**Please do not report security vulnerabilities through public GitHub issues.**
392+
393+
Instead, please report them via email to **[email protected]** with:
394+
* Description of the vulnerability
395+
* Steps to reproduce
396+
* Potential impact
397+
* Suggested fix (if available)
398+
399+
We will acknowledge receipt within 48 hours and provide a timeline for addressing the issue.
400+
401+
For more details, see our [Security documentation](https://superagenticai.github.io/dspy-code/reference/security/).
402+
403+
## Dependency Management
404+
405+
* We use `uv` (recommended) or `pip` for dependency management
406+
* Dependencies are managed in `pyproject.toml`
407+
* When adding new dependencies:
408+
* Justify why it's needed
409+
* Check for license compatibility (MIT-compatible preferred)
410+
* Consider the dependency's maintenance status
411+
* Update version constraints appropriately
412+
* Security updates are handled via Dependabot
413+
414+
### Optional Dependencies
415+
416+
The package supports optional dependencies for different LLM providers:
417+
418+
* `dspy-code[openai]` - OpenAI SDK support
419+
* `dspy-code[anthropic]` - Anthropic SDK support
420+
* `dspy-code[gemini]` - Google Gemini SDK support
421+
* `dspy-code[llm-all]` - All LLM providers
422+
* `dspy-code[mcp-ws]` - WebSocket support for MCP servers
423+
424+
When adding new optional dependencies:
425+
* Add them to `[project.optional-dependencies]` in `pyproject.toml`
426+
* Document their purpose in the README
427+
* Ensure they're truly optional (the package should work without them)
428+
* Add appropriate error messages if features require them
429+
430+
## Performance Considerations
431+
432+
* Consider performance impact of new features
433+
* Use appropriate data structures and algorithms
434+
* Profile code if making performance-critical changes
435+
* Document any known performance trade-offs
436+
234437
## Getting Help
235438

236439
* 🐛 [Issue Tracker](https://github.com/SuperagenticAI/dspy-code/issues) - Report bugs
440+
* 📚 [Documentation](https://superagenticai.github.io/dspy-code/) - Full documentation
237441
* 📧 Email: [email protected]
238442

239-
## Maintainer
443+
## Maintainers
240444

241445
* [@Shashikant86](https://github.com/Shashikant86) - Lead Maintainer
242446

447+
## Contributor Recognition
448+
449+
All contributors are recognized in:
450+
* Git commit history
451+
* Release notes (for significant contributions)
452+
* Project documentation (when applicable)
453+
243454
## License
244455

245456
By contributing, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)