aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
(orchestration): Context quality metrics on task completion
- Vorherrschende Sprache
- TypeScript
- Sterne
- 143
- Forks
- 46
- Ø Merge
- 3 T. 9 Std.
- Gemergte PRs (30 T.)
- 20
Beschreibung
## Component
API or orchestration
## Describe the feature
Emit and persist **context-quality signals** per task at completion: tool-call count, unique files touched, hydration token usage, retry/verify loops, turns consumed vs. budget, and optional “scope expansion” flag. Expose in API, CloudWatch metrics, and `bgagent stats`.
## Use case
High tool-call counts and repeated verify failures often indicate **missing harness context** rather than model weakness. Production teams use **tool calls per session** as a proxy: more curated skills/rules → fewer exploratory tool calls → faster task completion. Platform teams need this metric to prioritize repo onboarding and detect context drift after refactors.
## Proposed solution
1. Agent `progress_writer` / runner aggregates counters during execution.
2. Orchestrator writes `context_quality` object on task record and terminal `TaskEvent`.
3. CloudWatch embedded metric format for `ToolCallsPerTask`, `VerifyRetriesPerTask`.
4. Dashboard widget in operator dashboard; optional alarm on p95 tool calls per repo.
## Other information
- Complements roadmap **LLM-assisted trace analysis** (post-mortem) with cheap always-on counters.
- Pairs with **feature-service-catalog-context-hydration** and **Dynamic onboarding artifacts**.
## Acknowledgements
- [ ] I may be able to implement this feature
- [ ] This might be a breaking change
## Acceptance criteria
- [ ] Terminal tasks include `context_quality` in API responses when execution reached RUNNING.
- [ ] Metrics visible in CloudWatch with `repo` and `workflow_ref` dimensions.
- [ ] Documented interpretation guide in `EVALUATION.md`.
- [ ] Unit tests for aggregation logic in agent and handler layers.
Beitragsleitfaden
Rechercherichtung
Beginne damit, den Agenten progress_writer oder runner, den Task-Datensatz des Orchestrators und die Verarbeitung terminaler TaskEvent-Ereignisse sowie die Einstiegspunkte für das Operator-Dashboard und CloudWatch-Metriken zu lokalisieren. Verfolge, wie Abschlussdaten API-Antworten erreichen, und prüfe anschließend EVALUATION.md sowie die vorhandenen Handler- und Agententests. Als erledigt gilt die Aufgabe, wenn die aufgeführten Akzeptanzkriterien in Aggregation, Persistenz, Metriken, Dashboard-Sichtbarkeit, Dokumentation und Tests abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, typescript
- Bereich
- backend-api-design, observability-sre
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100