You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,29 @@ uv run uvicorn app:app --reload
34
34
35
35
The service listens on `http://localhost:8000` by default.
36
36
37
+
## Architecture Overview
38
+
39
+
-**FastAPI application** powers planner, ticketing, and admin APIs with dependency-injected services and guardrails.
40
+
-**Connector suite** (GitHub, Slack, Gmail, Calendar, Google Drive, Notion) respects `settings.dry_run` and only mutates external systems when explicitly configured.
41
+
-**Background task queue** runs in-memory or via Redis, supporting retries, adaptive auto-requeue, and remediation playbooks.
42
+
-**Persistence layer** defaults to SQLite with optional Postgres; Redis stores queue state, heartbeats, and dead letters when enabled.
43
+
-**Observability stack** ships with structured logging, Prometheus metrics, trace storage/export, and optional PagerDuty/Slack alerts.
44
+
45
+
## Key Endpoints
46
+
47
+
| Path | Method | Purpose |
48
+
| --- | --- | --- |
49
+
|`/plan`| POST | Generate a PRD, ticket plan, and trace metadata for a single idea. |
50
+
|`/plan/batch`| POST | Submit multiple ideas for parallel planning. |
51
+
|`/ticket`| POST | Produce Jira-ready stories (dry-run safe). |
52
+
|`/prd/{plan_id}/versions`| GET/POST | List history or commit new PRD revisions. |
53
+
|`/sync/status`| GET | Inspect recent connector sync executions. |
54
+
|`/tasks/dead-letter`| GET/DELETE | Review or purge failed queue jobs. |
55
+
|`/health` / `/health/ready`| GET | Liveness and dependency probes for automation. |
56
+
|`/metrics`| GET | Expose Prometheus counters, histograms, and gauges. |
57
+
58
+
Additional plugin endpoints are outlined in [`docs/plugins.md`](./docs/plugins.md).
59
+
37
60
## Everyday Workflows
38
61
39
62
Plan a single idea:
@@ -74,6 +97,7 @@ PRD versioning essentials:
74
97
-**Traces:**`/operators/traces` and `/operators/traces/{trace}` browse planner traces; async export via webhook or S3 when configured.
75
98
-**Task queue:**`/tasks` and `/tasks/{id}` monitor background jobs.
76
99
-**Cost tracking:**`agent_pm.cost_tracking` utilities log token and USD usage when responses include usage metadata.
100
+
-**Alerts & playbooks:** Adaptive queue policies can requeue failures, post Slack digests, or trigger PagerDuty incidents through `task_queue_playbooks`.
77
101
78
102
## Configuration Reference
79
103
@@ -86,6 +110,10 @@ PRD versioning essentials:
86
110
|`TRACE_DIR` / `TRACE_EXPORT_*`| Control on-disk traces and optional async exports. |
87
111
|`TASK_QUEUE_WORKERS`| Number of background workers handling queued tasks. |
88
112
|`LOG_FORMAT`|`json` for structured logging or `text` for local debugging. |
113
+
|`TASK_QUEUE_BACKEND`| Choose `memory` (default) or `redis` for production-grade queuing. |
114
+
|`TASK_QUEUE_ALERT_*`| Tune alert thresholds, cooldowns, channels, and auto-requeue behaviour. |
115
+
|`PAGERDUTY_ROUTING_KEY` / `SLACK_*`| Enable incident escalation and Slack digests. |
116
+
|`GITHUB_*`, `GOOGLE_*`, `NOTION_*`, `GMAIL_*`| Provide connector credentials and scopes. |
89
117
90
118
See `config/agents.yaml`, `config/tools.yaml`, and `.env.example` for additional tunables.
91
119
@@ -96,10 +124,17 @@ uv run ruff check . # lint
96
124
uv run ruff format --check .
97
125
uv run pytest # unit tests with coverage in CI
98
126
docker compose up # optional Postgres/Redis/worker stack
127
+
uv run mypy agent_pm # type checking parity with CI
99
128
```
100
129
101
130
CI (GitHub Actions) runs lint + tests on every push and pull request.
102
131
132
+
### Formatting & Linting
133
+
134
+
-`uv run ruff format .` keeps code formatted.
135
+
-`uv run ruff check .` enforces style, import ordering, and safety rules.
136
+
-`uv run mypy agent_pm` maintains typing guarantees.
137
+
103
138
## Plugin Platform
104
139
105
140
Agent PM ships with a pluggable automation surface that can notify downstream systems, export telemetry, or react to alignment events. The registry loads plugin definitions from `config/plugins.yaml` and supports live lifecycle management:
@@ -116,6 +151,12 @@ For an in-depth walkthrough (configuration schema, lifecycle hooks, discovery fl
116
151
117
152
Please open an issue or pull request with context, and run lint/tests before submitting.
118
153
154
+
### Troubleshooting Checklist
155
+
156
+
- Confirm `.env` secrets before enabling write operations; keep `DRY_RUN=true` locally for safe iteration.
157
+
- Verify `REDIS_URL` and `DATABASE_URL` when running the optional docker-compose stack.
158
+
- Inspect `/metrics`, `/tasks/dead-letter`, and Slack/PagerDuty alerts if connectors begin failing or playbooks trigger repeatedly.
0 commit comments