|
| 1 | +# Integration & Pluggability Guide 🔌 |
| 2 | + |
| 3 | +CommitVigil is designed with a **"Source-Agnostic"** core. While Slack and Git are the primary supported platforms, the system can be easily extended to any tool that supports Webhooks or REST APIs. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 1. Inbound Ingestion (Incoming Data) |
| 8 | +The system can ingest commitments from any source via the `/api/v1/ingest/raw` endpoint. |
| 9 | + |
| 10 | +### Examples: |
| 11 | +* **Jira**: Set up a Jira Webhook that triggers on "Issue Commented" and send the comment body to CommitVigil. |
| 12 | +* **Linear**: Sync Linear comments to track engineering promises made in task descriptions. |
| 13 | +* **Calendly**: Map calendar bookings to commitments (e.g., "I will have the demo ready by the meeting time"). |
| 14 | + |
| 15 | +### How to Implement: |
| 16 | +Simply call the endpoint with the raw text and a `user_id`: |
| 17 | +```bash |
| 18 | +curl -X POST "$API_URL/api/v1/ingest/raw?user_id=john_dev&raw_text=I promise to fix the DB by Friday" |
| 19 | +``` |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 2. Outbound Notifications (Interventions) |
| 24 | +Currently, CommitVigil uses the `SlackConnector` for follow-ups. However, the architecture is modular. |
| 25 | + |
| 26 | +### Adding a New Tool (e.g., MS Teams or Discord): |
| 27 | +1. **Create a Connector**: Add a new file in `src/core/` (e.g., `teams.py`) following the `SlackConnector` pattern. |
| 28 | +2. **Update the Worker**: In `src/worker.py`, update the `send_follow_up` function to route messages to your new connector: |
| 29 | + |
| 30 | +```python |
| 31 | +# src/worker.py |
| 32 | +async def send_follow_up(user_id: str, message: str, slack_id: str | None = None, teams_webhook: str | None = None): |
| 33 | + if teams_webhook: |
| 34 | + await TeamsConnector.send(message, teams_webhook) |
| 35 | + else: |
| 36 | + await SlackConnector.send_notification(message, slack_id) |
| 37 | +``` |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## 3. The "Tool-Agnostic" Brain |
| 42 | +The core reasoning engine (`CommitVigilBrain`) never interacts with Slack or Git directly. It processes **semantic commitments** and returns **behavioral decisions**. This means you can swap the entire communication layer without touching the AI logic. |
| 43 | + |
| 44 | +### Supported Data Formats: |
| 45 | +* **JSON API**: For direct application integration. |
| 46 | +* **Markdown**: For documentation and PR reviews. |
| 47 | +* **HTML**: For executive reporting. |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## 🚀 Future Golden Paths |
| 52 | +* **Jira Adapter**: Automatically close Jira tickets when the "Fulfillment Analysis" confirms the task is done in Git. |
| 53 | +* **Email Gateway**: Send "Professional Nudges" via SendGrid for high-context executive summaries. |
0 commit comments