aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
(cli): `bgagent stats` for agent contribution and quality metrics
- Lenguaje dominante
- TypeScript
- Estrellas
- 143
- Forks
- 46
- Merge medio
- 3 d 10 h
- PR fusionados (30 d)
- 24
Descripción
## Component
Scripts / CLI
## Describe the feature
Add `bgagent stats` to report aggregate outcomes over a time window: tasks submitted, PRs opened, merge rate, median revision cycles, CI pass rate, cost totals—filterable by repo and user.
## Use case
Operators adopting background agents need **outcome metrics**, not task counts alone. Roadmap **Evaluation pipeline** and operator dashboard cover backend aggregation; CLI users and platform teams want a quick, scriptable view for adoption reviews and executive summaries.
## Proposed solution
1. `GET /stats` (or query Tasks table + webhook-derived merge state) returning JSON aggregates.
2. CLI: `bgagent stats [--repo] [--since 30d] [--format table|json]`.
3. Reuse PR outcome signals from roadmap **PR outcome tracking** when available; v1 can use task terminal states + GitHub API sampling with documented limitations.
4. Document proxy vs. customer-impact metrics (merge rate is proxy; optional manual tags later).
## Other information
- Complements roadmap **Validation and risk analytics** and control panel—not a duplicate if scoped to CLI/API summary.
- Auth: same Cognito constraints as `list`/`status`.
## Acknowledgements
- [ ] I may be able to implement this feature
- [ ] This might be a breaking change
## Acceptance criteria
- [ ] API endpoint documented in `API_CONTRACT.md` with stable response shape mirrored in `cli/src/types.ts`.
- [ ] CLI prints table and JSON; respects `--verbose` for query details.
- [ ] Tests in `cli/test/` with mocked API client.
- [ ] User guide explains metric definitions and limitations.
Guía de contribución
Línea de trabajo
Empieza revisando los criterios de aceptación en API_CONTRACT.md y los tipos de respuesta en cli/src/types.ts; después, inspecciona las pruebas existentes del cliente de API de CLI en cli/test/. Se considera terminado cuando haya un endpoint de stats estable y documentado, salida en tabla y JSON con los filtros solicitados y detalles detallados, pruebas con mocks y una guía de usuario que cubra las definiciones y limitaciones de las métricas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- aws, github, typescript
- Área
- analytics, api, cli, documentation, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100