aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
feat(agent): PR scope creep check in pr_review workflow
- Dominant language
- TypeScript
- Stars
- 143
- Forks
- 46
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 20
Description
**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
Contributor guide
Research direction
Start with the `pr_review` workflow in `agent/workflows/` and the design context in `docs/design/EVALUATION.md` and `docs/design/WORKFLOWS.md`; review how the diff becomes available and how `TaskEventsTable` events are emitted. Done means scope ratings, advisory review output, a `scope_analysis` event, golden boundary fixtures, and documented prompt/schema support the proposed flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, python
- Domain
- api, backend, documentation, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100