# Contributing

### **🔹 How to Contribute**

✔ **Report Bugs & Issues** – Open a GitHub issue for any problems.\
✔ **Suggest Features** – Request improvements or new functionalities.\
✔ **Submit Code Contributions** – Fork the repository and submit a pull request.\
✔ **Improve Documentation** – Help enhance API documentation and SDKs.

***

### **🔹 Reporting Issues**

Before submitting an issue, please:\
✔ Check if the issue has already been reported.\
✔ Provide **clear, detailed descriptions** of the problem.\
✔ Include **API endpoint, request parameters, and response examples** if relevant.

🚨 **Issue Submission Format**

```
### Issue Title: API returns incorrect response for `/facts`

**Description:**  
When requesting financial intelligence using `/facts?category=finance`, the response occasionally includes unrelated data.  

**Steps to Reproduce:**  
1. Call `/facts?category=finance`  
2. Observe unexpected entries in the response  

**Expected Behavior:**  
The response should contain only finance-related intelligence reports.  
```

### **🔹 Code Contribution Guidelines**

✔ Follow the **existing code structure** and **naming conventions**.\
✔ Ensure **all new features** include relevant **unit tests**.\
✔ Write **clear commit messages** explaining the purpose of changes.\
✔ Keep pull requests **small and focused** (one feature or fix at a time).

🚨 **Git Commit Message Format**

```sh
feat(api): Added support for AI-powered risk assessment queries
```

### **🔹 Submitting a Pull Request (PR)**

Before submitting a PR:\
✔ Ensure all changes are **thoroughly tested**.\
✔ Reference the related **GitHub issue** in your PR description.\
✔ Follow the **project’s code style guidelines**.\
✔ **Do not include API keys** or **sensitive data** in PRs.

🚨 **Creating a Pull Request**

```sh
git checkout -b feature-new-api-endpoint
git commit -m "feat(api): Added support for advanced filters in intelligence queries"
git push origin feature-new-api-endpoint
```

### **🔹 Code Style Guidelines**

✔ Use **PEP 8 (Python)** for formatting Python code.\
✔ Use **ESLint rules (JavaScript)** for JavaScript contributions.\
✔ Maintain **consistent indentation (4 spaces for Python, 2 spaces for JS).**\
✔ **Avoid unnecessary dependencies** and keep code **lightweight**.

🚨 **Python Code Style (PEP 8 Compliant)**

```python
class TruthAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://api.truthsatellit.space"

    def get_facts(self, category="general", limit=10):
        headers = {"Authorization": f"Bearer {self.api_key}"}
        response = requests.get(f"{self.base_url}/facts", headers=headers, params={"category": category, "limit": limit})
        return response.json()
```

### **🔹 Running Tests Locally**

Before submitting code, **run tests to ensure stability**.

🚨 **Code Example: Running Python Tests**

```
pytest tests/
```

### **🔹 Security Disclosures**

If you discover a security vulnerability, **DO NOT** report it in a public GitHub issue.\
Instead, **immediately contact:**\
📩 **<security@truthsatellit.space>**

Security issues should be reported privately to prevent exploits before fixes are released.

***

### **🔹 Contact & Support**

For general questions or assistance with contributions:\
📩 **Email:** <support@truthsatellit.space>\
🌍 **Website:** <https://truthsatellit.space>

***
