aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
refactor(orchestration): pure decision-function orchestrator with CAS
- Vorherrschende Sprache
- TypeScript
- Sterne
- 143
- Forks
- 46
- Ø Merge
- 3 T. 9 Std.
- Gemergte PRs (30 T.)
- 20
Beschreibung
**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
Beitragsleitfaden
Rechercherichtung
Beginne mit ROADMAP.md und docs/design/ORCHESTRATOR.md und verfolge anschließend die in diesem Issue erwähnten aktuellen dauerhaften Orchestrierungs-Handler. Definiere die Grenzen von Snapshot und Aktion, decke decide(snapshot) mit umfassenden Unit-Tests ab und überprüfe, dass die Ausführung bedingte Schreibvorgänge mit updated_at verwendet und dabei die inkrementelle Kompatibilität bewahrt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, typescript
- Bereich
- backend-api-design, cloud, distributed-systems
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100