aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
refactor(orchestration): pure decision-function orchestrator with CAS
- Ngôn ngữ chính
- TypeScript
- Star
- 143
- Fork
- 46
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 24
Mô tả
**Context:** ROADMAP.md → Pure decision function orchestrator refactor
**Related:** autonomous-feedback-loop draft
---
## Component
API or orchestration
## Describe the feature
Extract orchestrator decision logic into **pure functions**: `(frozen_snapshot) → typed_action`. Side-effect execution applies actions with **CAS guards** on DynamoDB `updated_at` to prevent stale writes. Prerequisite for autonomous feedback loop.
## Use case
Orchestrator logic is hard to unit test with I/O mocks. Competing durable workers risk race conditions. Complex state machines (PR watcher) need a testable core.
## Proposed solution
1. Define `OrchestratorSnapshot` and `OrchestratorAction` types.
2. Pure `decide(snapshot): Action` with exhaustive unit tests (no AWS mocks).
3. Executor applies action with `updated_at` conditional writes.
4. Incremental refactor from current durable handlers—no big-bang.
5. Document in `docs/design/ORCHESTRATOR.md`.
## Other information
- Explicit prerequisite for **autonomous feedback loop** draft.
- Design context: `docs/design/ORCHESTRATOR.md`.
- [x] This might be a breaking change
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với ROADMAP.md và docs/design/ORCHESTRATOR.md, sau đó lần theo các handler điều phối bền vững hiện tại được đề cập trong issue. Xác định ranh giới của snapshot và action, bao phủ decide(snapshot) bằng các unit test toàn diện, đồng thời xác minh rằng việc thực thi sử dụng các lần ghi có điều kiện với updated_at trong khi vẫn duy trì khả năng tương thích tăng dần.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, typescript
- Lĩnh vực
- backend-api-design, cloud, distributed-systems
- Loại issue
- Tái cấu trúc
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100