Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d89e51a
feat: add planner agent
techoneel Apr 1, 2026
a955740
feat: add orchestrator
techoneel Apr 1, 2026
e3aa40e
feat: add CI workflow
techoneel Apr 1, 2026
5760076
feat: add developer agent with Claude integration scaffold
techoneel Apr 1, 2026
af42dbb
feat: add developer prompt template
techoneel Apr 1, 2026
fa5757e
feat: add GitHub PR automation service
techoneel Apr 1, 2026
39bdf4c
feat: add QA agent for self-healing loop
techoneel Apr 1, 2026
f10ab17
feat: add self-healing workflow loop
techoneel Apr 1, 2026
68de581
feat: add context engine (RAG scaffold)
techoneel Apr 1, 2026
ae2fe6e
feat: add FAISS vector store for embeddings
techoneel Apr 1, 2026
ed0d6d6
feat: add embedding model using sentence-transformers
techoneel Apr 1, 2026
72deb5d
feat: add context engine v2 with embeddings
techoneel Apr 1, 2026
a932702
feat: add UI agent
techoneel Apr 1, 2026
69fbc3a
feat: add API agent
techoneel Apr 1, 2026
14dde1a
feat: add DB agent
techoneel Apr 1, 2026
0809921
feat: add multi-agent orchestrator for UI API DB
techoneel Apr 1, 2026
fb5b263
feat: add dependency-aware orchestrator (DB → API → UI chaining)
techoneel Apr 1, 2026
098052f
feat: add schema extractor for structured DB parsing
techoneel Apr 1, 2026
d118e12
feat: add API contract generator
techoneel Apr 1, 2026
26ac1c5
feat: add UI contract generator
techoneel Apr 1, 2026
d1f5584
feat: add contract-aware orchestrator
techoneel Apr 1, 2026
699ffac
feat: add contract validation layer
techoneel Apr 1, 2026
d81d20a
feat: add automated test generator
techoneel Apr 1, 2026
826afc5
feat: add validation and test orchestrator
techoneel Apr 1, 2026
b662a85
feat: add sprint manager for AI Agile orchestration
techoneel Apr 1, 2026
5517238
feat: add gate orchestrator with contract, test, and judge gates
techoneel Apr 1, 2026
e9a2c20
feat: add full pipeline orchestrator with QA loop and merge decision
techoneel Apr 1, 2026
65fc56e
feat: add CI pipeline for AI validation and tests
techoneel Apr 1, 2026
b906965
feat: add LLM judge module
techoneel Apr 1, 2026
09a6f16
feat: add GitHub auto merge service
techoneel Apr 1, 2026
048bec7
feat: add observability monitor
techoneel Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ai_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: AI Pipeline

on:
pull_request:

jobs:
ai-validation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: pip install pytest

- name: Run Tests
run: pytest || exit 1

- name: AI Gate Check
run: echo "AI gates passed"
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: CI
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "CI Running"
5 changes: 5 additions & 0 deletions ai/agents/api_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API Agent

class APIAgent:
def generate_api(self, task, context=""):
return f"# API code for: {task}"
5 changes: 5 additions & 0 deletions ai/agents/db_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DB Agent

class DBAgent:
def generate_schema(self, task, context=""):
return f"-- DB schema for: {task}"
26 changes: 26 additions & 0 deletions ai/agents/developer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Developer Agent (Claude Integration)

import os

class DeveloperAgent:
def __init__(self, client=None):
self.client = client # Claude client placeholder

def generate_code(self, task: str, context: str = "") -> str:
"""
Generate code using Claude (pseudo implementation)
"""
prompt = f"""
You are a senior software engineer.

Context:
{context}

Task:
{task}

Generate clean, production-ready code.
"""

# Placeholder for Claude API call
return f"# Generated code for: {task}\n"
4 changes: 4 additions & 0 deletions ai/agents/planner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Planner Agent

def plan(task: str):
return {"tasks": [task]}
11 changes: 11 additions & 0 deletions ai/agents/qa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# QA Agent (Self-Healing Loop)

class QAAgent:
def analyze_failure(self, logs: str) -> str:
"""Analyze CI/CD logs and return a fix suggestion"""
return f"Fix issues based on logs: {logs}"

def apply_fix(self, developer, task: str, logs: str) -> str:
"""Re-run developer agent with fix context"""
fix_task = self.analyze_failure(logs)
return developer.generate_code(f"{task}\nFix: {fix_task}")
5 changes: 5 additions & 0 deletions ai/agents/ui_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# UI Agent

class UIAgent:
def generate_ui(self, task, context=""):
return f"// UI code for: {task}"
45 changes: 45 additions & 0 deletions ai/agile/gate_orchestrator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Gate Orchestrator (Quality Gates)

class GateOrchestrator:
def __init__(self, threshold_score: int = 8):
self.threshold_score = threshold_score

def run_contract_gate(self, validation):
api_errors = validation.get("api_errors", [])
ui_errors = validation.get("ui_errors", [])
return {
"passed": len(api_errors) == 0 and len(ui_errors) == 0,
"errors": api_errors + ui_errors
}

def run_test_gate(self, validation):
# Placeholder: assume tests generated; CI should execute them
api_tests = validation.get("api_tests")
ui_tests = validation.get("ui_tests")
return {
"passed": bool(api_tests) and bool(ui_tests),
"errors": [] if (api_tests and ui_tests) else ["Missing tests"]
}

def run_llm_judge(self, artifacts):
# Placeholder scoring; replace with real LLM-as-judge
score = 8
return {
"passed": score >= self.threshold_score,
"score": score
}

def decide(self, validation, artifacts):
contract_gate = self.run_contract_gate(validation)
if not contract_gate["passed"]:
return {"action": "fix", "reason": contract_gate}

test_gate = self.run_test_gate(validation)
if not test_gate["passed"]:
return {"action": "fix", "reason": test_gate}

judge = self.run_llm_judge(artifacts)
if not judge["passed"]:
return {"action": "fix", "reason": judge}

return {"action": "merge", "reason": {"score": judge["score"]}}
40 changes: 40 additions & 0 deletions ai/agile/pipeline_orchestrator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Full Pipeline Orchestrator (CI + Auto Merge + QA Feedback)

from ai.agile.sprint_manager import SprintManager
from ai.agile.gate_orchestrator import GateOrchestrator
from ai.agents.qa import QAAgent

class PipelineOrchestrator:
def __init__(self):
self.sprint = SprintManager()
self.gates = GateOrchestrator()
self.qa = QAAgent()

def run(self, feature: str, max_retries: int = 2):
attempt = 0

while attempt <= max_retries:
result = self.sprint.run_sprint(feature)

decision = self.gates.decide(
result["validation"],
result["artifacts"]
)

if decision["action"] == "merge":
return {
"status": "merged",
"attempt": attempt,
"details": decision
}

# QA feedback loop
logs = str(decision["reason"])
self.qa.apply_fix(None, feature, logs)

attempt += 1

return {
"status": "failed",
"attempts": attempt
}
33 changes: 33 additions & 0 deletions ai/agile/sprint_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Sprint Manager (AI Agile)

from ai.workflows.contract_orchestrator import run_feature as run_contract_flow
from ai.workflows.validation_orchestrator import validate_and_generate_tests

class SprintManager:
def __init__(self):
self.backlog = []

def create_backlog(self, feature: str):
# naive decomposition; replace with Planner agent later
self.backlog = [
f"Design DB for {feature}",
f"Build API for {feature}",
f"Build UI for {feature}"
]
return self.backlog

def run_sprint(self, feature: str):
# End-to-end execution using contract-aware flow
result = run_contract_flow(feature)

validation = validate_and_generate_tests(
result.get("schema", {}),
result.get("api_contracts", []),
result.get("ui_contracts", [])
)

return {
"feature": feature,
"artifacts": result,
"validation": validation
}
27 changes: 27 additions & 0 deletions ai/context/context_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Context Engine (RAG for Repo Awareness)

from typing import List

class ContextEngine:
def __init__(self):
# Placeholder for vector DB / embeddings
self.index = {}

def index_repo(self, files: dict):
"""Index repository files (simple in-memory for now)"""
for path, content in files.items():
self.index[path] = content

def search(self, query: str, top_k: int = 3) -> List[str]:
"""Naive search (replace with embeddings later)"""
results = []
for path, content in self.index.items():
if query.lower() in content.lower():
results.append((path, content))

return [r[1] for r in results[:top_k]]

def get_context(self, task: str) -> str:
"""Fetch relevant context for a task"""
snippets = self.search(task)
return "\n\n".join(snippets)
19 changes: 19 additions & 0 deletions ai/context/context_engine_v2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Context Engine V2 (Embeddings + Vector DB)

from ai.context.vector_store import VectorStore
from ai.context.embedding_model import EmbeddingModel

class ContextEngineV2:
def __init__(self):
self.vector_store = VectorStore()
self.embedder = EmbeddingModel()

def index_repo(self, files: dict):
texts = list(files.values())
embeddings = self.embedder.encode(texts)
self.vector_store.add(embeddings, texts)

def get_context(self, task: str, top_k=3):
query_embedding = self.embedder.encode(task)[0]
results = self.vector_store.search(query_embedding, top_k)
return "\n\n".join(results)
12 changes: 12 additions & 0 deletions ai/context/embedding_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Embedding Model (placeholder)

from sentence_transformers import SentenceTransformer

class EmbeddingModel:
def __init__(self, model_name='all-MiniLM-L6-v2'):
self.model = SentenceTransformer(model_name)

def encode(self, texts):
if isinstance(texts, str):
texts = [texts]
return self.model.encode(texts).tolist()
17 changes: 17 additions & 0 deletions ai/context/vector_store.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Vector Store using FAISS (local)

import faiss
import numpy as np

class VectorStore:
def __init__(self, dim=384):
self.index = faiss.IndexFlatL2(dim)
self.texts = []

def add(self, embeddings, texts):
self.index.add(np.array(embeddings).astype('float32'))
self.texts.extend(texts)

def search(self, query_embedding, top_k=3):
D, I = self.index.search(np.array([query_embedding]).astype('float32'), top_k)
return [self.texts[i] for i in I[0] if i < len(self.texts)]
16 changes: 16 additions & 0 deletions ai/contracts/api_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# API Contract Generator

class APIContract:
def generate(self, task: str, schema: dict):
"""Generate structured API contract from schema"""
endpoints = []

for table, fields in schema.items():
endpoints.append({
"endpoint": f"/{table}",
"method": "POST",
"request": fields,
"response": ["id"] + fields
})

return endpoints
23 changes: 23 additions & 0 deletions ai/contracts/schema_extractor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Schema Extractor (Structured DB Parsing)

import re

class SchemaExtractor:
def extract(self, db_schema: str):
"""Extract tables and fields from SQL-like schema"""
tables = {}
current_table = None

for line in db_schema.splitlines():
line = line.strip()

if line.lower().startswith("create table"):
current_table = line.split()[2]
tables[current_table] = []

elif current_table and line and not line.startswith("--"):
field = re.split(r"\s+", line)[0]
if field.lower() not in ["primary", "foreign", ")"]:
tables[current_table].append(field)

return tables
15 changes: 15 additions & 0 deletions ai/contracts/ui_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# UI Contract Generator

class UIContract:
def generate(self, api_contracts):
"""Generate UI bindings from API contracts"""
ui_bindings = []

for api in api_contracts:
ui_bindings.append({
"form": api["endpoint"],
"fields": api["request"],
"submit_to": api["endpoint"]
})

return ui_bindings
12 changes: 12 additions & 0 deletions ai/observability/monitor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Observability Monitor

import datetime

class Monitor:
def track(self, event: str, data: dict = None):
timestamp = datetime.datetime.utcnow().isoformat()
print({
"timestamp": timestamp,
"event": event,
"data": data or {}
})
9 changes: 9 additions & 0 deletions ai/prompts/developer.prompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
You are a senior software engineer.

Rules:
- Follow existing codebase structure
- Reuse components if available
- Write clean, modular, production-ready code
- Include types and basic validation

Output only code.
Loading
Loading