Skip to content

Commit bdfd746

Browse files
committed
docs: expand README for operators
1 parent 80d3de2 commit bdfd746

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,29 @@ uv run uvicorn app:app --reload
3434

3535
The service listens on `http://localhost:8000` by default.
3636

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+
3760
## Everyday Workflows
3861

3962
Plan a single idea:
@@ -74,6 +97,7 @@ PRD versioning essentials:
7497
- **Traces:** `/operators/traces` and `/operators/traces/{trace}` browse planner traces; async export via webhook or S3 when configured.
7598
- **Task queue:** `/tasks` and `/tasks/{id}` monitor background jobs.
7699
- **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`.
77101

78102
## Configuration Reference
79103

@@ -86,6 +110,10 @@ PRD versioning essentials:
86110
| `TRACE_DIR` / `TRACE_EXPORT_*` | Control on-disk traces and optional async exports. |
87111
| `TASK_QUEUE_WORKERS` | Number of background workers handling queued tasks. |
88112
| `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. |
89117

90118
See `config/agents.yaml`, `config/tools.yaml`, and `.env.example` for additional tunables.
91119

@@ -96,10 +124,17 @@ uv run ruff check . # lint
96124
uv run ruff format --check .
97125
uv run pytest # unit tests with coverage in CI
98126
docker compose up # optional Postgres/Redis/worker stack
127+
uv run mypy agent_pm # type checking parity with CI
99128
```
100129

101130
CI (GitHub Actions) runs lint + tests on every push and pull request.
102131

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+
103138
## Plugin Platform
104139

105140
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
116151

117152
Please open an issue or pull request with context, and run lint/tests before submitting.
118153

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.
159+
119160
## License
120161

121162
Released under the [MIT License](./LICENSE).

0 commit comments

Comments
 (0)