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

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

Offen
#412 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
cli cost-finops enhancement observability
Vorherrschende Sprache
TypeScript
Sterne
143
Forks
46
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
20

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der Prüfung der Abnahmekriterien in API_CONTRACT.md und der Antworttypen in cli/src/types.ts; sehen Sie sich anschließend die vorhandenen CLI API-Client-Tests unter cli/test/ an. Als abgeschlossen gilt die Aufgabe, wenn es einen dokumentierten stabilen Stats-Endpunkt, Tabellen- und JSON-Ausgabe mit den angeforderten Filtern und ausführlichen Details, gemockte Tests sowie einen Benutzerleitfaden gibt, der Metrikdefinitionen und Einschränkungen abdeckt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, github, typescript
Bereich
analytics, api, cli, documentation, testing
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.