Project Info
Inspiration
Small engineering teams rarely have a dedicated incident commander on every shift. When production starts failing, one senior engineer becomes the integration layer across alerts, logs, deployments, code, tests, stakeholder updates, and the postmortem. Incident Commander AI keeps that chain evidence-backed, bounded, and human-controlled.
What it does
Incident Commander AI provides one incident room that: normalizes a production-style alert and redacts secret-shaped data; correlates telemetry, deploy history, repository evidence, and runbooks; ranks cited hypotheses and maps evidence to code; proposes a bounded remediation plan, then stops for human approval; creates a candidate patch inside an isolated workspace; reconstructs and verifies the patch with targeted tests, full tests, lint, typecheck, regression coverage, and deterministic risk review; requires a second, artifact-bound approval before recording a draft-PR package; and drafts stakeholder communications and an evidence-linked postmortem.
How we built it
The operator experience uses Next.js 15 and strict TypeScript. The API and workflow use FastAPI, Pydantic v2, SQLAlchemy, Alembic, PostgreSQL, and Redis. A bounded OpenAI Responses adapter uses strict Pydantic structured output for investigation synthesis. A credentialed smoke receipt proves a GPT-5.6 request returned gpt-5.6-sol, parsed into the schema, used store=false, and safely returned insufficient evidence for sparse synthetic input. The product and repository were developed side-by-side with Codex during Build Week. The codebase includes a fail-closed Codex CLI gateway with workspace-write confinement, network denial, a secret-free environment, and explicit engine provenance. The reliable recorded golden path uses deterministic fixture providers and never silently switches to a live provider when credentials are present. Challenges The hardest problem was separating intelligence from authority. Model output is only a typed proposal; deterministic code validates citations, budgets, approval bindings, verification artifacts, and risk before the workflow advances. We also made provenance visible so simulated evidence cannot be mistaken for a live OpenAI, Codex, or GitHub action. Accomplishments The complete two-approval path reaches RESOLUTION_DRAFTED. 185 backend tests, 20 web tests, 6 shared-contract tests, and 22 Chromium scenarios pass. Eight deterministic safety evaluations cover the golden path, insufficient evidence, flaky tests, risky migrations, redaction, prompt injection, noisy telemetry, and rollback cancellation. Five consecutive fresh-database CLI demos pass. Both production Docker images build; the PostgreSQL/Redis/API/web/worker stack reports healthy. Gitleaks and dependency security checks pass.
What we learned
Reliable agent products need an evidence model and an authorization model, not just a prompt. The most useful design decision was making agents capable of proposing and editing within a sandbox while the state machine alone decides what is grounded, approved, verified, and safe to expose.
What's next
Next steps are production evidence providers, deployment proof, optional Slack delivery, and a real draft-only GitHub integration for teams that explicitly enable those credentials and policies. Truthful demo disclosure The recorded golden demo uses deterministic fixture telemetry, a fixture code-agent, and a simulated offline draft PR for repeatability. A separate credentialed GPT-5.6 Responses smoke test proves strict structured output. No live GitHub write, production deployment, or credentialed Codex repository diff is claimed.
Incident Commander AI
AI incident commander for small engineering teams: evidence-grounded diagnosis, human-approved remediation, verified patches. Blueprint: docs/AI_INCIDENT_COMMANDER_MASTER_BLUEPRINT_v1.md.
Built side-by-side with Codex for OpenAI Build Week. The optional live investigation adapter targets GPT-5.6 through the Responses API when explicitly configured; the reproducible judging demo remains credential-free and clearly labelled simulated.
Status: M0-M9 complete and submitted to OpenAI Build Week. The deterministic demo completes the two-approval workflow through an explicitly simulated draft-PR package, communications, and an evidence-linked postmortem. No external credentials are required.
Public submission artifacts
- Demo video: https://youtu.be/-8zRF8RCuc8
- Devpost project: https://devpost.com/software/incident-commander-ai
- Source repository: https://github.com/AtchayamG/ai-incident-commander
- Final submission receipt: docs/submission/final-submission-receipt.md
Layout
| Path | What |
|---|---|
services/api | Python 3.12 FastAPI backend (Pydantic v2, strict mypy, ruff, pytest) |
apps/web | Next.js 15 App Router frontend (strict TypeScript, Vitest) |
packages/contracts | Shared TypeScript contract types mirroring the backend Pydantic models |
docs/adr | Architecture decisions, including the local-demo runtime boundary |
docs/architecture | System context, state machine, security model, demo architecture |
LICENSE | MIT license for public review and reuse |
Quick start
Docker (one command):
make docker-up # or: docker compose up -d --build
# web: http://localhost:3000 api: http://localhost:8000/docs
Native:
make setup # pnpm install + backend venv (Python 3.12) + dev deps
make dev-api # FastAPI on :8000
make dev-web # Next.js on :3000 (second terminal)
make bootstrap is an alias for the fresh-clone setup contract. make dev runs the Docker development stack in the foreground.
Windows or any host without GNU Make can use the underlying commands directly:
pnpm install --frozen-lockfile
uv sync --project services/api --extra dev
uv run --project services/api python -m uvicorn app.main:app --app-dir services/api --reload --port 8000
# second terminal
pnpm --filter @incident-commander/web dev
Quality gates
make lint # ruff + next lint + tsc
make typecheck # mypy --strict + tsc --noEmit
make test # backend, shared-contract, and web tests
make eval # eight deterministic safety scenarios
make secret-scan # Gitleaks over current tree and Git history
make demo-assert # five complete deterministic demo runs
make openai-smoke # optional credentialed GPT-5.6 structured-output proof
CI (.github/workflows/ci.yml) enforces backend/frontend gates, the web build, five deterministic demos, secret and dependency scans, and release-image builds on every push/PR to main.
Golden demo (no credentials)
make demo-reset # verify protected reset and RECEIVED seed state
make demo-run # one full run through RESOLUTION_DRAFTED
make demo-assert # five consecutive asserted runs
On Windows hosts without GNU Make, run the underlying command directly:
uv run --directory services/api python -m app.demo.runner --runs 5
Every run uses an ephemeral SQLite database, fixture investigation, and the fixture code-agent. It exercises both public approval endpoints and asserts RESOLUTION_DRAFTED, simulated provider provenance, communications, and the evidence-linked postmortem. It never contacts OpenAI or GitHub.
See docs/architecture/demo-architecture.md for the full walkthrough.
Architecture at a glance
flowchart LR
J["Judge / incident commander"] --> W["Next.js review UI"]
W --> A["FastAPI typed workflow API"]
A --> S["SQLAlchemy + PostgreSQL default stack"]
A -. "ephemeral test/demo runner" .-> Q["Deterministic SQLite store"]
A --> F["Fixture telemetry, investigation, code-agent, and PR providers"]
A -. "optional; fail closed" .-> O["OpenAI Responses API / Codex CLI / GitHub"]
A --> G["Two recorded human approval gates"]
G --> V["Sandbox policy + six-check verifier"]
The verified submission path is local and simulated where labelled. The default Compose stack uses PostgreSQL and Redis; the repeatability runner uses ephemeral SQLite. See ADR 009 for the remaining hosted-production boundary.
Verified baseline
- Backend: Ruff and strict mypy pass across 56 application source files; 185 tests pass.
- Frontend: lint, strict typecheck, 20 web tests, 6 shared-contract tests, and production build pass.
- Browser: 22 Chromium scenarios pass, including four-viewport overflow checks, internal-link validation, and a real local-API flow through both approvals.
- Evaluations: all 8 deterministic safety scenarios and 13 grader/mutation tests pass.
- Optional live integrations fail closed and never replace deterministic demo mode. A bounded credentialed GPT-5.6 structured-output receipt is documented separately and is never implied by fixture artifacts.
See task status, evidence checklist, GPT-5.6 receipt, and demo script for current proof and remaining limitations.
Principles
- Evidence passes a redaction boundary before persistence — raw payloads never do.
- Workflow state changes only through the deterministic state machine; model output is a typed proposal.
- External effects (patches, PRs) require recorded human approval.
- Simulated data is always labelled simulated.
Analysis
View
Metric
- 13
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- JavaScriptIn code
- Next.jsIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- RedisIn code
- TypeScriptIn code
- DockerClaimed
- PostgreSQLClaimed
9 of 11 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeCommits
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
1.2 MB
Source files
197
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
AtchayamG/ai-incident-commander
324 files · 6.9 MB · @ 5ddd68b
Structure
Interface
4 files · 1%Screens, components and styles rendered to the user.
API & routing
70 files · 22%Request entry points: routes, handlers and controllers.
Application logic
4 files · 1%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python48%
- Markdown23%
- TypeScript17%
- YAML12%
- CSS1%
- JavaScript0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
apps/web/package.json
npm · 13- @incident-commander/contracts
- next
- react
- react-dom
- +9 more
services/api/pyproject.toml
pypi · 12- alembic
- fastapi
- openai
- psycopg[binary]
- pydantic
- redis
- sqlalchemy
- uvicorn[standard]
- +4 more
packages/contracts/package.json
npm · 22 development-only dependencies.
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.