Skip to content

Commit 620ba5a

Browse files
committed
feat: initial v0.2.0 release
End-to-end demo of agno-dcp running a banking collections workflow under cryptographic governance. Identity (DCP-01), signed policy gating (DCP-02), tamper-evident audit chain (DCP-03), and offline-verifiable Compliance Bundles. FastAPI service with HTMX dashboard, SSE live audit log, SQLite storage, Docker + Fly.io deployment, CI matrix on Python 3.11/3.12/3.13. 20 tests, all green.
0 parents  commit 620ba5a

34 files changed

Lines changed: 2893 additions & 0 deletions

.env.example

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copy to .env and fill in values for local development.
2+
# In production (Fly.io), set these as Fly secrets instead.
3+
4+
# ── Demo configuration ────────────────────────────────────────
5+
DEMO_TITLE="DCP-AI Banking Demo"
6+
DEMO_BANK_NAME="Demo Trust Bank"
7+
DEMO_HUMAN_PRINCIPAL="ops@demo-trust-bank.example"
8+
9+
# Storage path (in containerized envs, mount a volume here)
10+
DCP_DB_PATH=app/data/agent.db
11+
12+
# ── LLM provider ──────────────────────────────────────────────
13+
# Options: mock | anthropic | openai
14+
# 'mock' is fully deterministic and requires zero API keys.
15+
LLM_PROVIDER=mock
16+
17+
# Required only if LLM_PROVIDER != mock
18+
ANTHROPIC_API_KEY=
19+
OPENAI_API_KEY=
20+
21+
# ── Application ───────────────────────────────────────────────
22+
APP_HOST=0.0.0.0
23+
APP_PORT=8000
24+
APP_LOG_LEVEL=INFO

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
name: test (py${{ matrix.python }})
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
python: ["3.11", "3.12", "3.13"]
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python }}
31+
cache: pip
32+
cache-dependency-path: pyproject.toml
33+
34+
- name: Install package + dev extras
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -e ".[dev]"
38+
39+
- name: Ruff (lint)
40+
run: ruff check .
41+
42+
- name: Ruff (format check)
43+
run: ruff format --check .
44+
45+
- name: pytest
46+
run: pytest -ra -q
47+
48+
docker:
49+
name: docker build smoke
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v3
56+
57+
- name: Build image
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: .
61+
file: docker/Dockerfile
62+
push: false
63+
tags: agno-dcp-demo:ci
64+
load: true
65+
66+
- name: Smoke (boot + healthz)
67+
run: |
68+
docker run -d --name demo -p 8000:8000 agno-dcp-demo:ci
69+
for i in {1..30}; do
70+
if curl -sf http://127.0.0.1:8000/healthz > /dev/null; then
71+
echo "Container ready after ${i}s"
72+
break
73+
fi
74+
sleep 1
75+
done
76+
curl -sf http://127.0.0.1:8000/healthz
77+
curl -sf http://127.0.0.1:8000/api/agent/info | python3 -m json.tool | head -10
78+
docker logs demo
79+
docker rm -f demo

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
# Use the FLY_API_TOKEN repository secret. Configure it once with:
9+
# fly tokens create deploy
10+
# then add the value at: Settings → Secrets → Actions → FLY_API_TOKEN
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: deploy-${{ github.ref }}
17+
cancel-in-progress: false
18+
19+
jobs:
20+
deploy:
21+
name: deploy to fly.io
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: production
25+
url: https://demo.dcp-ai.org
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Setup flyctl
30+
uses: superfly/flyctl-actions/setup-flyctl@master
31+
32+
- name: Deploy
33+
run: flyctl deploy --config fly/fly.toml --remote-only --strategy immediate
34+
env:
35+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.so
5+
.Python
6+
build/
7+
dist/
8+
*.egg-info/
9+
10+
# Virtualenv
11+
.venv/
12+
venv/
13+
env/
14+
15+
# Tooling
16+
.pytest_cache/
17+
.mypy_cache/
18+
.ruff_cache/
19+
.coverage
20+
htmlcov/
21+
coverage.xml
22+
23+
# Environment
24+
.env
25+
.env.local
26+
27+
# OS / IDE
28+
.DS_Store
29+
.vscode/
30+
.idea/
31+
*.swp
32+
33+
# Demo data (persistent volume in prod, local DB in dev)
34+
app/data/*.db
35+
app/data/*.sqlite
36+
app/data/*.sqlite3
37+
app/data/keys/
38+
bundles/
39+
*.zip
40+
41+
# Internal handoff / build notes — never commit (may contain local paths,
42+
# operator names, deployment specifics that don't belong in a public repo).
43+
IMPLEMENTATION_REPORT*.md
44+
HANDOFF*.md
45+
NOTES.local.md

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Changelog
2+
3+
All notable changes to `agno-dcp-demo` are recorded here.
4+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5+
6+
## [0.2.0] (2026-04-30)
7+
8+
Initial release of the end-to-end demo. Reads as a banking
9+
collections workflow.
10+
11+
### Added
12+
13+
* Singleton `DemoAgentService` that boots a `DCPAgent` (tier-3,
14+
strict mode) at app startup, persists its `CitizenshipBundle`
15+
beside the audit DB, and reuses the same identity across restarts.
16+
* Four tool mocks (`lookup_customer`, `propose_payment_plan`,
17+
`schedule_callback`, `send_confirmation`) with realistic banking
18+
fixtures.
19+
* Declarative YAML policy with seven rules including conservative
20+
payment plans, discount ceilings, balance escalation thresholds,
21+
and channel restrictions.
22+
* FastAPI service exposing eight HTTP routes:
23+
* `GET /` — single-page dashboard.
24+
* `POST /api/agent/run` — run an arbitrary tool through the gate.
25+
* `POST /api/agent/scenario` — run a pre-baked sequence.
26+
* `GET /api/agent/info` — agent identity + capability snapshot.
27+
* `GET /api/audit/entries` — paginated audit log.
28+
* `GET /api/audit/stream` — Server-Sent Events live feed.
29+
* `GET /api/audit/verify` — offline chain integrity verifier.
30+
* `POST /api/audit/export` — signed Compliance Bundle ZIP.
31+
* `POST /api/audit/reset` — wipe back to genesis (demo replay).
32+
* Banking-grade dashboard: HTMX + Tailwind CDN, dark theme, KPI
33+
strip, three one-click scenarios, live audit log with
34+
per-event-type styling, single-click verify and export buttons.
35+
* Multi-stage `Dockerfile` (uv builder + slim runtime, non-root
36+
user, healthcheck) and `docker-compose.yml` for local runs with a
37+
named volume.
38+
* Fly.io configuration (`fly/fly.toml`) targeting `scl` region with
39+
a 1 GB persistent volume and free-tier-friendly auto-stop.
40+
* CI workflow (Python 3.11/3.12/3.13 on Ubuntu plus a Docker build
41+
smoke) and an auto-deploy workflow that publishes to Fly on push
42+
to `main`.
43+
* Test suite covering agent service lifecycle, policy strict-mode
44+
denies, chain integrity after a workload, Compliance Bundle ZIP
45+
export, and every HTTP route.
46+
47+
### Notes
48+
49+
* Cryptographic primitives import from `agno-dcp >= 0.1.0` and
50+
`dcp-ai >= 2.8.1`. Bundles produced here are byte-exact compatible
51+
with every DCP-AI verifier.
52+
* No real LLM provider is required; the demo defaults to `mock` and
53+
the workflow is deterministic. Set `LLM_PROVIDER=anthropic` or
54+
`openai` plus the matching API key to swap in.
55+
* The persistent volume layout is documented in `fly/README.md`. The
56+
same shape works for any host with a writable `/app/data`.

CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing
2+
3+
Thanks for considering a contribution.
4+
5+
## Ground rules
6+
7+
* One concern per PR.
8+
* Tests for every change.
9+
* No silent except blocks; use the typed exceptions in
10+
`agno_dcp.exceptions` or add a new one.
11+
* Type hints on public functions; `mypy --strict` must pass.
12+
13+
## Local setup
14+
15+
```bash
16+
git clone https://github.com/dcp-ai-protocol/agno-dcp-demo.git
17+
cd agno-dcp-demo
18+
19+
python -m venv .venv && source .venv/bin/activate
20+
pip install -e ".[dev]"
21+
22+
uvicorn app.main:app --reload
23+
```
24+
25+
Open [http://localhost:8000](http://localhost:8000).
26+
27+
## Running checks
28+
29+
```bash
30+
ruff check .
31+
ruff format --check .
32+
pytest -ra
33+
```
34+
35+
## Building the container
36+
37+
```bash
38+
docker compose -f docker/docker-compose.yml up --build
39+
```
40+
41+
## Reporting security issues
42+
43+
Email `security@dcp-ai.org` rather than opening a public issue.
44+
45+
## Code of Conduct
46+
47+
Project follows the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
48+
Be technical, kind, and direct.

0 commit comments

Comments
 (0)