aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

(cli): `bgagent stats` for agent contribution and quality metrics

Aperta
#412 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
cli cost-finops enhancement observability
Lingua principale
TypeScript
Stelle
143
Fork
46
Merge medio
3g 9h
PR unite (30g)
20

Descrizione

## 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia esaminando i criteri di accettazione in API_CONTRACT.md e i tipi di risposta in cli/src/types.ts, quindi ispeziona i test esistenti del client API della CLI in cli/test/. Il lavoro è completato quando sono disponibili un endpoint stats stabile e documentato, un output in formato tabella e JSON con i filtri richiesti e dettagli verbosi, test con mock e una guida utente che copra le definizioni e le limitazioni delle metriche.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, github, typescript
Ambito
analytics, api, cli, documentation, testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.