|
1 | | -# CommitGuard AI: The Accountability Specialist 🛡️ |
| 1 | +# CommitGuard AI: The Autonomous Accountability Platform 🛡️ |
2 | 2 |
|
3 | 3 |  |
4 | 4 |
|
5 | | -> **Automation Specialist Angle:** Automating the hardest part of human management using sentiment-aware AI agents. |
| 5 | +> **"One Engine. Two Worlds. Total Accountability."** |
6 | 6 |
|
7 | 7 | [**Full Documentation 📚**](https://daretechie.github.io/CommitGuard-AI/) |
8 | 8 |
|
| 9 | +--- |
9 | 10 |
|
| 11 | +## 🎭 Dual-Persona Versatility |
10 | 12 |
|
11 | | -**"CommitGuard AI provide 'Accountability as a Service.' CommitGuard predicts when a team member is likely to fail *before* the deadline and intervenes with the right behavioral tone to ensure delivery."** |
12 | | - |
13 | | -## 🆘 The Problem |
14 | | -In modern distributed teams, the **"Slack Stall"** is the #1 drain on project velocity. Project Managers are overwhelmed by vague promises like *"I'll get to it soon,"* which are often forgotten, leading to missed sprints and "bad guy" escalations. |
15 | | - |
16 | | -## ✅ The Solution: CommitGuard AI |
17 | | -CommitGuard AI is a standalone, agentic service designed to monitor and enforce professional commitments. It doesn't just "track tasks"; it acts as a proactive collaborator that: |
18 | | -1. **Extracts Vague Promises**: Automatically parses Slack threads to create structured commitment records. |
19 | | -2. **Predicts Failure**: Uses behavioral sentiment to flag burnout or deflection *before* the deadline passes. |
20 | | -3. **Automates Calibration**: Adjusts its tone—Supportive for burnout, Firm for repeat offenders—saving the PM from having to chase updates. |
21 | | - |
22 | | - |
23 | | -## 🚀 Key Features |
24 | | -- **Deterministic AI Agents**: Built with `FastAPI`, `instructor`, and `Pydantic` for structured, reliable JSON outputs. |
25 | | -- **Behavioral Analysis**: |
26 | | - - `ExcuseDetector`: Classifies reasons for commitment failure (Legitimate vs. Deflection vs. Burnout). |
27 | | - - `RiskAssessor`: Quantifies the probability of failure based on historical context. |
28 | | - - `ToneAdapter`: Dynamically shifts empathy levels (Supportive → Confrontational) based on performance. |
29 | | -- **Asynchronous Orchestration**: |
30 | | - - **Task Queue**: Uses `ARQ` + `Redis` to offload LLM latency from the main API thread. |
31 | | - - **Accountability Scheduler**: Uses `APScheduler` for precision, time-sensitive follow-up actions. |
32 | | -- **Elite Modular Architecture**: Pluggable **LLM Provider Factory** supporting OpenAI, Claude (Anthropic), and hermetic mock providers. |
33 | | -- **Identity Attribution**: Specialized logic to automatically extract commitment "Owners" from raw thread text. |
34 | | -- **Production Observability**: Structured JSON logging (`structlog`) and metrics instrumentation (`Prometheus`). |
35 | | -- **Resilient Test Suite**: Comprehensive `pytest` suite with **Mock Providers**, ensuring 100% reliability in offline environments. |
36 | | - |
37 | | - |
38 | | -## 🏗️ Architecture: Asynchronous Agentic Worker Pattern |
39 | | - |
40 | | -In production high-volume environments, we never block the user request for AI reasoning. CommitGuard AI uses an **event-driven architecture** where the API acts as a gateway and background workers handle the "Brain" logic. |
41 | | - |
42 | | -```mermaid |
43 | | -graph TD |
44 | | - User[Client Application] -->|POST /evaluate| API[FastAPI Gateway] |
45 | | - API -->|Enqueue Job| Redis[Redis Queue] |
46 | | - |
47 | | - subgraph "Worker Process" |
48 | | - Redis --> Worker[ARQ Worker] |
49 | | - Worker --> Brain[CommitGuard Brain] |
50 | | - Brain --> Excuse[Excuse Detector] |
51 | | - Brain --> Risk[Risk Scorer] |
52 | | - Brain --> Burnout[Burnout Guard] |
53 | | - Brain --> Tone[Tone Adapter] |
54 | | - |
55 | | - Tone --> Decision[Action Decision] |
56 | | - Decision --> Scheduler[APScheduler] |
57 | | - end |
58 | | - |
59 | | - Scheduler -->|Trigger Follow-up| User |
60 | | -``` |
| 13 | +CommitGuard AI is a multi-agent system designed for high-stakes enforcement. It adapts its identity based on the operational environment: |
61 | 14 |
|
62 | | -### Technical Significance: |
63 | | -1. **Vendor Agnostic**: Swap LLM providers (from OpenAI to Claude or local Llama) in 2 seconds via configuration. |
64 | | -2. **Deterministic Outputs**: Every agent uses Pydantic-enforced schemas to guarantee reliable downstream processing. |
65 | | -3. **Latency Decoupling**: The user receives a 202 Accepted response instantly, while the asynchronous worker handles reasoning out-of-band. |
66 | | -4. **Identity Attribution**: The agent doesn't just extract tasks; it identifies the specific human owner responsible for the commitment. |
| 15 | +### 1. The Behavioral Accountability Agent (Management) |
| 16 | +**Headline:** *"Autonomous AI Agents for High-Stakes Accountability & Performance Enforcement"* |
| 17 | +- **Problem:** Remote teams struggle with "commitment drift" and excuse-making. |
| 18 | +- **Solution:** Proactively monitor chat promises. |
| 19 | +- **Outcome:** Support burnout signals early; confront repeat deflection firmly. |
67 | 20 |
|
68 | | -## 💬 Slack Integration Guide |
| 21 | +### 2. The GitOps Accountability Engine (Engineering) |
| 22 | +**Headline:** *"AI-Driven GitOps Accountability: Guaranteeing Commitment Follow-Through"* |
| 23 | +- **Problem:** Small technical promises in commits/PRs (e.g., *"I'll fix this later"*) vanish into the noise. |
| 24 | +- **Solution:** NLP-driven monitoring of source code level commitments. |
| 25 | +- **Outcome:** 100% visibility into "soft commitments" made during the dev cycle. |
69 | 26 |
|
70 | | -### How to use it: |
71 | | -CommitGuard AI acts as a **Proactive Accountability Partner** in your workspace. |
| 27 | +--- |
72 | 28 |
|
73 | | -1. **Setup**: The manager creates an [Incoming Webhook](https://api.slack.com/messaging/webhooks) for your project channel. |
74 | | -2. **Configuration**: Add the URL to your `.env`: |
75 | | - ```bash |
76 | | - SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..." |
77 | | - ``` |
78 | | -3. **Automated Intervention**: |
79 | | - - When the developer updates the system with an excuse (via the `/evaluate` endpoint), the agent analyzes their history and sentiment. |
80 | | - - If the risk is **High** or **Critical**, CommitGuard will autonomously post a formatted "Burnout Alert" or "Accountability Warning" to the Slack channel. |
81 | | - - **Result**: You save 1-2 hours of manual follow-up time every day. |
| 29 | +## 🏗️ The Three-Stage Autonomous Pipeline |
| 30 | +Every commitment—whether from Slack or a Git Commit—passes through a deterministic reasoning loop: |
82 | 31 |
|
| 32 | +1. **Excuse Detection (`ExcuseDetector`)**: Classifies sentiment (Legitimate vs. Deflection vs. Burnout). |
| 33 | +2. **Predictive Risk Assessment (`RiskScorer`)**: Quantifies failure probability based on historical reliability. |
| 34 | +3. **Adaptive Pressure (`ToneAdapter`)**: Selects the psychological tone (Supportive → Firm → Confrontational) to ensure delivery. |
83 | 35 |
|
| 36 | +--- |
84 | 37 |
|
85 | | -## 💡 API Usage Examples |
| 38 | +## 🛠️ Core Tech Stack |
| 39 | +- **Framework**: FastAPI (Python 3.12+) |
| 40 | +- **LLM Orchestration**: Instructor + Pydantic (Deterministic JSON) |
| 41 | +- **Infrastructure**: PostgreSQL + Redis + ARQ |
| 42 | +- **Observability**: Prometheus + Structlog |
86 | 43 |
|
87 | | -### 1. Ingest a Raw Slack Promise |
88 | | -Automatically extracts who, what, and when from natural language. |
| 44 | +--- |
| 45 | + |
| 46 | +## 🚀 API Showcase |
| 47 | +### Raw Extraction (Slack/Commit/PR) |
89 | 48 | ```bash |
90 | 49 | curl -X 'POST' \ |
91 | | - 'http://localhost:8000/ingest/raw?user_id=john_dev&raw_text=I%20promise%20to%20fix%20the%20CSS%20bugs%20by%20tomorrow%20evening' \ |
92 | | - -H 'accept: application/json' |
| 50 | + 'http://localhost:8000/ingest/raw?user_id=dev_alpha&raw_text=Fixing%20auth%20logic.%20I%20promise%20to%20refactor%20the%20DB%20connector%20by%20Friday' |
93 | 51 | ``` |
94 | 52 |
|
95 | | -### 2. Evaluate a User Check-in |
96 | | -Triggers the agentic reasoning pipeline (Excuse analysis -> Risk Assessment -> Burnout Detection -> Notification). |
| 53 | +### Behavioral Evaluation |
97 | 54 | ```bash |
98 | 55 | curl -X 'POST' \ |
99 | 56 | 'http://localhost:8000/evaluate' \ |
100 | | - -H 'accept: application/json' \ |
101 | | - -H 'Content-Type: application/json' \ |
102 | 57 | -d '{ |
103 | | - "user_id": "john_dev", |
104 | | - "commitment": "fix the CSS bugs", |
105 | | - "check_in": "I am almost there but honestly I am extremely tired and might need more time" |
| 58 | + "user_id": "dev_alpha", |
| 59 | + "commitment": "refactor the DB connector", |
| 60 | + "check_in": "Spent all night on it, feeling pretty drained" |
106 | 61 | }' |
107 | 62 | ``` |
108 | 63 |
|
109 | 64 | --- |
110 | | - |
111 | | -## 🛠️ Tech Stack |
112 | | - |
113 | | -- **Framework**: FastAPI (Python 3.12+) |
114 | | -- **LLM Orchestration**: Instructor + Pydantic |
115 | | -- **Message Broker**: Redis |
116 | | -- **Task Queue**: ARQ |
117 | | -- **Job Scheduling**: APScheduler |
118 | | -- **Logging**: Structlog |
119 | | -- **Metrics**: Prometheus |
120 | | - |
121 | | -## 🚦 Getting Started |
122 | | - |
123 | | -### 1. Local Development (Poetry) |
124 | | -```bash |
125 | | -# Start Infrastructure |
126 | | -docker-compose up -d |
127 | | -
|
128 | | -# Start API |
129 | | -poetry run uvicorn src.main:app --reload |
130 | | -
|
131 | | -# Start Worker |
132 | | -poetry run arq src.worker.WorkerSettings |
133 | | -``` |
134 | | - |
135 | | -### 2. Production (Docker) |
136 | | -```bash |
137 | | -docker-compose up --build |
138 | | -``` |
139 | | - |
140 | | ---- |
141 | | - |
142 | | -*Built by [daretechie](https://github.com/daretechie) as a demonstration of high-ticket AI Agent Architecture.* |
| 65 | +*Built for High-Performance Teams and Elite Portfolios.* |
0 commit comments