Skip to content

Repository files navigation

Granular — AI-Native Engineering Control Plane (ECP)

CI Pipeline Go Version Rust Version Python Version License: Apache-2.0

Granular is an enterprise-scale, production-grade AI-Native Engineering Control Plane (ECP) designed to unify the entire software delivery lifecycle into a single, intelligent engineering operating system.

Idea → Service Creation → Repository → Code → Pull Request → Build → Tests → Artifact → Deployment → Infrastructure → Telemetry → Alert → Incident → Change → Root Cause → Remediation → Verification → Learning

🏗️ Architecture

                         ┌──────────────────────────────┐
                         │       DEVELOPER PORTAL       │
                         │   Backstage / React 19 / TS  │
                         └──────────────┬───────────────┘
                                        │ REST / gRPC
                         ┌──────────────▼───────────────┐
                         │       CONTROL PLANE          │
                         │   Go 1.26 Modular Engine     │
                         │  Catalog│Graph│Deploy│Risk   │
                         └──────────────┬───────────────┘
                                        │
                         ┌──────────────▼───────────────┐
                         │       ENGINEERING GRAPH      │
                         │ Multi-Tenant Topology Engine │
                         └──────────────┬───────────────┘
                                        │
                         ┌──────────────▼───────────────┐
                         │        EVENT PLATFORM        │
                         │ NATS JetStream / Event Hub   │
                         └───────┬──────────────┬───────┘
                                 │              │
                    ┌────────────▼───┐      ┌───▼────────────┐
                    │  AI PLATFORM   │      │ RUST AGENT /   │
                    │ Claude/GPT/RAG │      │ K8s DISCOVERY  │
                    └────────────────┘      └────────────────┘

✨ Key Capabilities

Capability Description
📦 Service Catalog & Golden Paths Multi-tenant service registry with scaffolding templates for Go, Rust, and Python microservices with pre-baked Docker, Helm, CI, and OTel.
🕸️ Multi-Tenant Engineering Graph Relational topology graph connecting services, repos, PRs, commits, deployments, incidents, and SLOs with real-time upstream/downstream blast radius calculations.
⚡ 0-100 Change Risk Engine Explainable risk scoring analyzing database migrations, blast radius, test coverage, and service criticality (+22 DB changes, +20 Tier-1 service).
🚨 Causal Incident Correlation Automatically correlates telemetry anomalies (+18.4% error rate, +31% latency) to causal deployments with 91% confidence.
🤖 AI Platform & Zero Hallucination Evidence-grounded agents (IncidentAgent, ChangeAgent, SecurityAgent) with Prompt Injection Defense (DATA vs INSTRUCTION isolation) and Secret Redaction.
🔌 Model Context Protocol (MCP) FastMCP server exposing platform tools to LLMs and IDEs under strict authorization and audit policies.
🧪 Flaky Test Intelligence Intermittent failure rate tracking, flakiness score calculation, and policy-governed test quarantine.
🩺 Engineering Health & Tech Debt 0-100 quality scoring across 5 debt dimensions with explainable violations and remediation proposals.
🛡️ Policy-as-Code & ReBAC OpenFGA relationship-based authorization combined with OPA Rego governance rules for high-risk deployments.
🦀 Rust Node Telemetry Agent Memory-safe, high-performance node daemon collecting local metrics and Kubernetes pod discovery.
💻 Developer CLI (idp) Full-featured command line tool for services, deployments, rollbacks, incidents, risk, and health with formatted table and --json machine outputs.

📂 Repository Structure

.
├── .github/workflows/          # GitHub Actions CI/CD pipeline (7-stage quality gates)
├── apps/
│   └── developer-portal/       # Vite / React 19 / TypeScript developer portal UI
├── services/
│   └── control-plane/          # Go 1.26 Control Plane, Catalog, Graph, Risk, and Incident engines
├── ai/
│   ├── gateway/                # Multi-provider Model Gateway (Claude, OpenAI, Gemini)
│   ├── safety/                 # Prompt Guard (injection defense) & Secret Redactor
│   ├── tools/                  # Bounded, policy-checked Tool Registry
│   ├── rag/                    # Vector store with metadata filtering & tenant isolation
│   ├── agents/                 # IncidentAgent, ChangeAgent, SecurityAgent
│   ├── mcp/                    # Model Context Protocol (MCP) server
│   └── evaluation/             # Diagnostic accuracy and safety benchmark suite
├── agents/
│   └── rust-agent/             # Rust node telemetry daemon and K8s discovery agent
├── cli/
│   └── idp-cli/                # Developer CLI (`idp`) binary
├── schemas/
│   ├── events/                 # Canonical Event JSON Schema (30+ taxonomical event types)
│   └── openapi/                # OpenAPI 3.0 Platform API specification
├── policies/
│   └── opa/                    # OPA Rego rules (deployments, dual approval, agent sandbox)
├── templates/
│   └── golden-paths/           # Golden path templates (Go, Python, Dockerfile, catalog-info)
├── infrastructure/
│   ├── docker-compose.yml      # Local dev environment (PostgreSQL, NATS, OpenFGA, OPA, Prometheus)
│   └── openfga/                # OpenFGA authorization model definition
├── e2e/                        # End-to-End automated validation suite
├── Implementation.md           # Master production specification
├── WALKTHROUGH.md              # Detailed implementation walkthrough & verification matrix
└── Makefile                    # Developer bootstrap and automated test suite runner

🚀 Quickstart & Local Development

1. Prerequisites

  • Go: 1.26+
  • Rust / Cargo: 1.97+
  • Python: 3.12+
  • Node.js: 20+ & npm

2. Bootstrap & Run Control Plane

# Bootstrap dependencies
make bootstrap

# Run the Go Control Plane server (defaults to port 8088, configurable via PORT env var)
make dev

3. Launch Developer Portal UI

cd apps/developer-portal
npm install
npm run dev
# Portal accessible at http://localhost:3000

4. Use the Developer CLI

cd cli/idp-cli
go build -o idp.exe .

# List services
./idp service list

# Calculate change risk
./idp risk payment-api

# Inspect active incidents and AI correlation
./idp incident investigate INC-9281

# Execute deployment rollback
./idp deployment rollback dep-83921

🧪 Testing & Verification

Run the full cross-language test and verification suite with one command:

make test

Individual Subsystem Tests:

# Control Plane unit, integration, and demo scenario tests (Go)
make test-go

# Python AI Platform, Safety, and Evaluation benchmark
make test-python

# Rust Node Agent unit tests
make test-rust

# External HTTP Client E2E tests
make e2e

🎬 Demo Scenario

Granular includes a pre-seeded end-to-end verification scenario demonstrating automated incident correlation and recovery:

  1. Topology Registered: checkout-weborder-servicepayment-apiinventory-service
  2. Baseline State: payment-api deployed at version v2.14.6 (healthy telemetry).
  3. Change Evaluated: PR #1823 alters DB connection pool limits (evaluated as HIGH Risk: 78/100).
  4. Bad Release Deployed: payment-api v2.14.7 deployed (dep-83921), triggering socket timeouts and an HTTP 500 error surge (+18.4%).
  5. Incident Correlation: Control Plane ingests INC-9281 and correlates dep-83921 as the probable cause with 91% confidence.
  6. Evidence Citations: AI diagnostic report cites telemetry error surges, connection pool logs, and historical incident INC-8812.
  7. Automated Rollback: Operator approves rollback, restoring payment-api to v2.14.6, recovering baseline metrics, and logging an immutable audit record.

📄 Documentation

  • WALKTHROUGH.md — Comprehensive technical walkthrough, verification matrices, and demo walkthrough.
  • DEPLOYMENT.md — Production deployment guide for Cloud Run, Kubernetes, and Docker Compose.
  • Implementation.md — Master product specification and architectural principles.
  • OpenAPI 3.0 Spec — REST API endpoints and data contracts.

📜 License

Granular is licensed under the Apache 2.0 License.

About

AI-Native Engineering Control Plane (ECP) — Unifying service catalog, engineering graph, change risk scoring, causal incident correlation, and autonomous AI agents.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages