|
| 1 | +# Contributing to Aletheia-Superhuman Validation |
| 2 | + |
| 3 | +Thank you for your interest in contributing! This project aims to advance formal reasoning and scientific validation in the OpenCode ecosystem. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +Be respectful, collaborative, and scientifically rigorous. |
| 8 | + |
| 9 | +## Getting Started |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | +- Python 3.11+ |
| 13 | +- Lean 4 (elan 4.2.2) |
| 14 | +- Git & GitHub |
| 15 | + |
| 16 | +### Setup Development Environment |
| 17 | +```bash |
| 18 | +git clone https://github.com/[USER]/aletheia-superhuman-validation.git |
| 19 | +cd aletheia-superhuman-validation |
| 20 | + |
| 21 | +# Create virtual environment |
| 22 | +python -m venv venv |
| 23 | +source venv/bin/activate # or venv\Scripts\activate on Windows |
| 24 | + |
| 25 | +# Install dependencies |
| 26 | +pip install -r requirements.txt |
| 27 | +``` |
| 28 | + |
| 29 | +### Running Tests |
| 30 | +```bash |
| 31 | +# Verify reproducibility (sample) |
| 32 | +cd reproducibility |
| 33 | +python verify_reproducibility.py --seed 42 --sample 50 |
| 34 | + |
| 35 | +# Full batch (if you have Lean 4 installed) |
| 36 | +cd ../scripts |
| 37 | +python spec_batch_processor.py --batch "phase2_validation_full" --size "large" --lean-check |
| 38 | +``` |
| 39 | + |
| 40 | +## How to Contribute |
| 41 | + |
| 42 | +### 1. Report Issues |
| 43 | +- **Bug Reports**: Use [GitHub Issues](https://github.com/[USER]/aletheia-superhuman-validation/issues) |
| 44 | +- **Include**: Error messages, reproduction steps, environment snapshot |
| 45 | +- **Label**: `bug`, `critical` (if blocking), `question` |
| 46 | + |
| 47 | +### 2. Suggest Improvements |
| 48 | +- **Discussions**: Use [GitHub Discussions](https://github.com/[USER]/aletheia-superhuman-validation/discussions) |
| 49 | +- **Propose**: New reasoning types, optimizations, new problem domains |
| 50 | +- **Reference**: Relevant papers, benchmarks, or metrics |
| 51 | + |
| 52 | +### 3. Submit Pull Requests |
| 53 | + |
| 54 | +#### Branch Naming (Conventional Commits v1.0.0) |
| 55 | +``` |
| 56 | +feature/[feature-name] # New features (SPEC-017, new reasoner, etc) |
| 57 | +fix/[bug-name] # Bug fixes |
| 58 | +docs/[doc-name] # Documentation only |
| 59 | +refactor/[component] # Code refactoring |
| 60 | +perf/[optimization] # Performance improvements |
| 61 | +test/[test-coverage] # Test additions |
| 62 | +``` |
| 63 | + |
| 64 | +Example: `feature/spec-017-proof-search`, `fix/lean4-windows-path` |
| 65 | + |
| 66 | +#### Commit Message Format |
| 67 | +``` |
| 68 | +type(scope): subject line (50 chars max) |
| 69 | +
|
| 70 | +Body paragraph (wrapped at 72 chars): |
| 71 | +Explain the *what* and *why*, not *how*. |
| 72 | +
|
| 73 | +- Bullet point 1 |
| 74 | +- Bullet point 2 |
| 75 | +
|
| 76 | +Closes #123 (if applicable) |
| 77 | +``` |
| 78 | + |
| 79 | +Example: |
| 80 | +``` |
| 81 | +feat(spec-014): add timeout handling for Lean subprocess |
| 82 | +
|
| 83 | +Add 30-second timeout for subprocess calls to Lean.exe. |
| 84 | +Prevents hanging on malformed proof states. |
| 85 | +
|
| 86 | +- Add timeout parameter to run_spec_014_lean() |
| 87 | +- Log timeout events with problem metadata |
| 88 | +- Skip failed problems (don't hard-fail) |
| 89 | +
|
| 90 | +Closes #42 |
| 91 | +``` |
| 92 | + |
| 93 | +#### Pull Request Checklist |
| 94 | +- [ ] Branch is up-to-date with `main` |
| 95 | +- [ ] Code follows Python style (PEP 8, type hints) |
| 96 | +- [ ] Tests pass: `python verify_reproducibility.py --seed 42 --sample 50` |
| 97 | +- [ ] Documentation updated if applicable |
| 98 | +- [ ] Commit messages follow Conventional Commits v1.0.0 |
| 99 | +- [ ] No hardcoded paths (use `os.path.expanduser()`, `Path`) |
| 100 | +- [ ] Windows compatibility tested (or noted as known issue) |
| 101 | + |
| 102 | +### 4. Add New SPEC Modules |
| 103 | + |
| 104 | +If proposing SPEC-017, SPEC-018, etc: |
| 105 | + |
| 106 | +1. **Create spec_017.py** in `scripts/` |
| 107 | + ```python |
| 108 | + from spec_base import SpecModuleBase, SpecModuleResult |
| 109 | + |
| 110 | + class Spec017: |
| 111 | + """Brief description of SPEC-017.""" |
| 112 | + |
| 113 | + def process(self, problem: dict) -> SpecModuleResult: |
| 114 | + # Implementation |
| 115 | + return SpecModuleResult( |
| 116 | + module_name="spec_017", |
| 117 | + status="COMPLETED", |
| 118 | + success=True, |
| 119 | + output="Result description", |
| 120 | + error=None, |
| 121 | + time_ms=elapsed_time |
| 122 | + ) |
| 123 | + ``` |
| 124 | + |
| 125 | +2. **Add tests** in `tests/test_spec_017.py` |
| 126 | + ```python |
| 127 | + import unittest |
| 128 | + from spec_017 import Spec017 |
| 129 | + |
| 130 | + class TestSpec017(unittest.TestCase): |
| 131 | + def test_basic_functionality(self): |
| 132 | + spec = Spec017() |
| 133 | + result = spec.process({...}) |
| 134 | + self.assertTrue(result.success) |
| 135 | + ``` |
| 136 | + |
| 137 | +3. **Update `spec_batch_processor.py`** to integrate |
| 138 | + ```python |
| 139 | + from spec_017 import Spec017 |
| 140 | + |
| 141 | + # In SpecModule.process(): |
| 142 | + spec_017_result = Spec017().process(problem) |
| 143 | + results['spec_017_result'] = spec_017_result.to_dict() |
| 144 | + ``` |
| 145 | + |
| 146 | +4. **Document in ADR-007** (new architecture decision) |
| 147 | + |
| 148 | +### 5. Add New Problem Domains |
| 149 | + |
| 150 | +If extending beyond Erdős problems: |
| 151 | + |
| 152 | +1. **Create new dataset** in `data/` (e.g., `data/topology_100.json`) |
| 153 | +2. **Add metadata schema** (erdos_number → domain-specific identifier) |
| 154 | +3. **Test on sample** (10-20 problems) first |
| 155 | +4. **Document domain specifics** in new ADR |
| 156 | +5. **Report metrics** in new report file |
| 157 | + |
| 158 | +Example structure: |
| 159 | +```json |
| 160 | +{ |
| 161 | + "problems": [ |
| 162 | + { |
| 163 | + "identifier": "topology_001", |
| 164 | + "domain": "topology", |
| 165 | + "statement": "Prove that ...", |
| 166 | + "difficulty": "medium", |
| 167 | + "prize": "$1000" |
| 168 | + } |
| 169 | + ] |
| 170 | +} |
| 171 | +``` |
| 172 | + |
| 173 | +## Development Practices |
| 174 | + |
| 175 | +### Code Style |
| 176 | +- Follow **PEP 8** (max line length: 100 chars) |
| 177 | +- Use **type hints** (Python 3.10+ feature) |
| 178 | +- Add **docstrings** (Google style) |
| 179 | + |
| 180 | +Example: |
| 181 | +```python |
| 182 | +def process_problem(problem: dict, timeout_sec: int = 30) -> SpecModuleResult: |
| 183 | + """Process a single Lean problem through SPEC pipeline. |
| 184 | + |
| 185 | + Args: |
| 186 | + problem: Problem dict with 'filename', 'statement', 'proof_sketch' |
| 187 | + timeout_sec: Max seconds before subprocess kill |
| 188 | + |
| 189 | + Returns: |
| 190 | + SpecModuleResult with success status and timing info |
| 191 | + |
| 192 | + Raises: |
| 193 | + TimeoutError: If Lean subprocess exceeds timeout_sec |
| 194 | + """ |
| 195 | +``` |
| 196 | + |
| 197 | +### Testing |
| 198 | +- Write **unit tests** for new functions |
| 199 | +- Test **Windows + Linux paths** (use `Path`) |
| 200 | +- Add **determinism tests** (same seed = same result) |
| 201 | +- Run full batch before submitting PR |
| 202 | + |
| 203 | +### Reproducibility |
| 204 | +- **All randomness must use seed=42** or configurable seed |
| 205 | +- **Document hyperparameters** in docstring + config |
| 206 | +- **No hardcoded paths** — use `os.path.expanduser()` or `Path` |
| 207 | +- **Log every subprocess call** with command + environment |
| 208 | + |
| 209 | +## Review Process |
| 210 | + |
| 211 | +1. **Automated Checks** (GitHub Actions) |
| 212 | + - ✅ Python formatting (black, ruff) |
| 213 | + - ✅ Type checking (mypy) |
| 214 | + - ✅ Unit tests |
| 215 | + - ✅ Reproducibility sample (50 problems) |
| 216 | + |
| 217 | +2. **Code Review** (Maintainers) |
| 218 | + - Scientific soundness |
| 219 | + - Performance impact |
| 220 | + - Documentation completeness |
| 221 | + - Backward compatibility |
| 222 | + |
| 223 | +3. **Approval & Merge** |
| 224 | + - 1 approval required |
| 225 | + - CI/CD green |
| 226 | + - Squash-merge to main with conventional commit |
| 227 | + |
| 228 | +## Release Process |
| 229 | + |
| 230 | +### For Maintainers |
| 231 | + |
| 232 | +1. **Update version** in `setup.py`, `__init__.py` |
| 233 | +2. **Write CHANGELOG.md** entry |
| 234 | +3. **Create release branch**: `release/v1.1.0` |
| 235 | +4. **Merge to main** with PR |
| 236 | +5. **Create GitHub Release** with release notes |
| 237 | +6. **Tag**: `git tag -a v1.1.0 -m "Release v1.1.0"` |
| 238 | +7. **Push**: `git push origin v1.1.0` |
| 239 | + |
| 240 | +## Questions? |
| 241 | + |
| 242 | +- **Bug?** → [Issues](https://github.com/[USER]/aletheia-superhuman-validation/issues) |
| 243 | +- **Idea?** → [Discussions](https://github.com/[USER]/aletheia-superhuman-validation/discussions) |
| 244 | +- **Question?** → [Discussions > Q&A](https://github.com/[USER]/aletheia-superhuman-validation/discussions) |
| 245 | + |
| 246 | +--- |
| 247 | + |
| 248 | +**Thank you for helping advance formal reasoning in OpenCode!** 🎓 |
0 commit comments