aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
feat(agent): PR scope creep check in pr_review workflow
- Lingua principale
- TypeScript
- Stelle
- 143
- Fork
- 46
- Merge medio
- 3g 9h
- PR unite (30g)
- 20
Descrizione
**Context:** ROADMAP.md → Agent quality → PR scope creep check (`pr_review`)
**Related:** pr-risk-classifier draft, #425
---
## Component
Agent (Python runtime)
## Describe the feature
Advisory-first scope analysis in `coding/pr-review-v1` comparing **declared intent** (task description / issue / PR narrative) to the **actual diff** and touched areas.
Structured output:
| Field | Values / content |
|-------|------------------|
| `scope_rating` | `within_scope`, `mild_expansion`, `significant_expansion`, `likely_scope_creep` |
| `confidence` | numeric or enum |
| `rationale` | files touched, API/schema/config changes, unrelated dependency churn |
**Rollout:** non-blocking reviewer guidance first; optional policy gates for high-risk repos later.
## Use case
Agents often expand beyond the stated task. Reviewers need early signal before deep review. Teams want consistent scope discipline without blocking low-risk expansions by default.
## Proposed solution
1. Extend `pr_review` workflow step to invoke scope analysis after diff is available.
2. Post structured comment via GitHub Reviews API (advisory section).
3. Emit `scope_analysis` event to `TaskEventsTable`.
4. Unit tests with golden fixtures for rating boundaries.
5. Document prompt and output schema in `docs/design/WORKFLOWS.md`.
## Other information
- Design context: `docs/design/EVALUATION.md`, `agent/workflows/`.
- [ ] This might be a breaking change
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con il workflow `pr_review` in `agent/workflows/` e il contesto di progettazione in `docs/design/EVALUATION.md` e `docs/design/WORKFLOWS.md`; esamina come il diff diventa disponibile e come vengono emessi gli eventi di `TaskEventsTable`. Il lavoro è completo quando sono presenti valutazioni dell'ambito, un output di revisione consultiva, un evento `scope_analysis`, fixture di confine golden e il supporto documentato per prompt/schema per il flusso proposto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- github, python
- Ambito
- api, backend, documentation, testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100