Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Dev Trivedi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
194 changes: 120 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,152 @@
# Lintellect

Automated code review system built on AWS serverless infrastructure. Listens for pull request events via GitHub webhooks, fans out parallel review workers, merges results through an evidence gate, and posts structured feedback as PR comments.
Serverless pull request review pipeline that turns a GitHub webhook into parallel review packets, evidence-gated findings, and an operator dashboard.

Lintellect is a TypeScript monorepo for experimenting with review automation architecture: webhook ingestion, diff/context workers, provider adapters, schema validation, prompt runners, an evidence gate, and admin/dashboard surfaces. The repo is structured so the review pipeline can be tested locally while the deployment target remains AWS Lambda, Step Functions, S3, DynamoDB, and API Gateway.

![Lintellect dashboard setup](docs/screenshots/lintellect-dashboard-setup.png)

## Contents

- [At A Glance](#at-a-glance)
- [Screenshot](#screenshot)
- [Review Lifecycle](#review-lifecycle)
- [Architecture](#architecture)
- [Package Map](#package-map)
- [Schemas](#schemas)
- [Tech Stack](#tech-stack)
- [Run Locally](#run-locally)
- [Verification](#verification)
- [Deployment Notes](#deployment-notes)
- [Status](#status)
- [License](#license)

## At A Glance

| Area | Details |
|---|---|
| Product | Event-driven PR review pipeline |
| Users | Engineering teams that want structured review findings with evidence |
| Core value | Split review work into traceable packets and filter output through a quality gate before comments are posted |
| Runtime target | AWS Lambda + Step Functions |
| Local code | TypeScript workspaces with Vitest coverage |
| UI surface | Admin/dashboard packages for configuration and review visibility |

## Screenshot

The current dashboard/admin work shows the setup state for configuring provider and review pipeline settings.

![Lintellect setup screen](docs/screenshots/lintellect-dashboard-setup.png)

## Review Lifecycle

```mermaid
flowchart LR
A["GitHub pull request event"] --> B["Webhook handler validates signature"]
B --> C["Step Functions execution"]
C --> D["Diff worker extracts changed hunks"]
C --> E["Context worker gathers surrounding code"]
D --> F["Review packet builder"]
E --> F
F --> G["Prompt/provider runner"]
G --> H["Evidence gate"]
H --> I["Comment formatter"]
I --> J["GitHub PR comment"]
```

## Architecture

```mermaid
flowchart TD
GH["GitHub Webhook"] --> APIGW["API Gateway"]
APIGW --> WH["webhook Lambda"]
WH --> SFN["Step Functions state machine"]
SFN --> DIFF["diff-worker Lambda"]
SFN --> CTX["context-worker Lambda"]
DIFF --> S3["S3 review artifacts"]
CTX --> S3
S3 --> REVIEW["review-worker Lambda"]
REVIEW --> MERGE["merge-results Lambda"]
MERGE --> GATE["evidence-gate Lambda"]
GATE --> POST["comment-poster Lambda"]
POST --> PR["Pull request discussion"]
GATE --> DDB["DynamoDB review history"]
DASH["Dashboard API"] --> DDB
ADMIN["Admin UI"] --> DASH
```
GitHub PR → API Gateway → Webhook Lambda
AWS Step Functions
┌────────────────────────────┐
│ Parallel Map State │
│ ├── DiffWorker Lambda │
│ ├── ContextWorker Lambda │
│ └── ReviewWorker Lambda │
│ │ │
│ MergeResults Lambda │
│ │ │
│ EvidenceGate Lambda │
└────────────────────────────┘
CommentPoster Lambda → GitHub PR Comment
```

## Services
## Package Map

| Path | Responsibility |
|---|---|
| `packages/core` | Review packet building, schema validation, prompt runner, evidence gate tests |
| `packages/providers` | Provider abstraction and provider tests |
| `packages/api` | Dashboard API entrypoint |
| `packages/cli` | Local command surface |
| `packages/admin` | Admin UI |
| `packages/dashboard` | Dashboard UI |
| `schemas` | JSON schemas for packets, comments, job status, and provider config |
| `docs` | Pipeline, architecture, prompting, and testing notes |

| Lambda | Responsibility |
|--------|---------------|
| `webhook` | Validates GitHub signatures, starts Step Functions execution |
| `diff-worker` | Extracts and parses PR diff, identifies changed hunks |
| `context-worker` | Fetches surrounding file context from S3 / GitHub |
| `review-worker` | Runs review logic against diff + context |
| `merge-results` | Aggregates findings from parallel workers |
| `evidence-gate` | Filters low-confidence results, enforces quality threshold |
| `comment-poster` | Formats and posts review comments to the PR |
| `dashboard-api` | REST API for review history and metrics |
## Schemas

The pipeline is schema-first. Review packets, review output, comments, job status, and provider config are stored in `schemas/` so worker boundaries can validate structured data before a result reaches the evidence gate.

## Tech Stack

| Layer | Technology |
|-------|-----------|
| Infrastructure | AWS CDK (TypeScript) |
| Compute | AWS Lambda, AWS Step Functions |
| Storage | Amazon S3, Amazon DynamoDB |
| API | Amazon API Gateway |
| CI trigger | GitHub Webhooks |
| Language | TypeScript, Node.js |
|---|---|
| Language | TypeScript |
| Infrastructure | AWS CDK target, Lambda, Step Functions, API Gateway |
| Storage | S3 artifacts, DynamoDB history |
| Frontend | React/Vite packages |
| Testing | Vitest |
| Contracts | JSON Schema |

## Packages
## Run Locally

```
packages/
├── core/ # Shared types and utilities
├── providers/ # GitHub API client, S3/DynamoDB helpers
├── api/ # Dashboard REST API handlers
├── cli/ # Local development and deploy CLI
├── admin/ # Admin tooling
└── dashboard/ # Dashboard frontend assets
infra/
├── lib/ # CDK stack definitions
├── lambdas/ # Lambda function source code
└── step-functions/ # ASL state machine definitions
```bash
npm install
npm test
```

## Getting Started
Build all workspaces:

### Prerequisites
```bash
npm run build
```

- Node.js 18+
- AWS CLI configured with appropriate permissions
- GitHub App or webhook secret
Run the dashboard/admin package from its package directory when working on UI surfaces.

### Install
## Verification

```bash
npm install
```
Local build results:

### Deploy
| Command | Result |
|---|---|
| `npm run build` in `packages/admin` | Passed in the previous docs/screenshot pass |
| `npm run build` in `packages/dashboard` | Passed in the current README/build verification slice |

```bash
cd infra
npm install
npx cdk deploy
```
The checked dashboard build now passes. Core tests and package-specific tests should be run before publishing.

## Deployment Notes

### Run Tests
Production deployment expects:

```bash
npm test
GITHUB_WEBHOOK_SECRET=
GITHUB_TOKEN=
AWS_REGION=us-east-1
DYNAMO_TABLE_NAME=
S3_BUCKET_NAME=
```

## Environment Variables
Keep webhook secrets and provider credentials in environment variables or a secret manager.

```
GITHUB_WEBHOOK_SECRET=...
GITHUB_TOKEN=...
AWS_REGION=us-east-1
DYNAMO_TABLE_NAME=...
S3_BUCKET_NAME=...
```
## Status

The architecture and core contracts are useful and portfolio-worthy. The checked dashboard build now passes; before publishing, run core/package tests and verify deployment configuration with real provider credentials kept outside git.

## License

MIT
MIT. See [LICENSE](LICENSE).
Binary file added docs/screenshots/lintellect-dashboard-setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions packages/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default function App() {
const [providerList, setProviderList] = useState<LLMProvider[]>([])

// App config (setup)
const [appConfigured, setAppConfigured] = useState<boolean | null>(null)
const [, setAppConfigured] = useState<boolean | null>(null)
const [setupClientId, setSetupClientId] = useState('')
const [setupClientSecret, setSetupClientSecret] = useState('')
const [setupShowSecret, setSetupShowSecret] = useState(false)
Expand Down Expand Up @@ -163,7 +163,7 @@ export default function App() {
const [loading, setLoading] = useState(true)
const [actionLoading, setActionLoading] = useState('')
const [toast, setToast] = useState<{ msg: string; type: 'ok' | 'err' } | null>(null)
const toastTimer = useRef<ReturnType<typeof setTimeout>>()
const toastTimer = useRef<ReturnType<typeof setTimeout> | null>(null)

const showToast = (msg: string, type: 'ok' | 'err' = 'ok') => {
if (toastTimer.current) clearTimeout(toastTimer.current)
Expand Down Expand Up @@ -937,6 +937,8 @@ export default function App() {
</div>
)

if (!user) return null

/* ── Build inline comment map for diff viewer ── */
const commentsByFile: Record<string, ReviewComment[]> = {}
if (lintReview?.output) {
Expand Down
Loading