aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
refactor(orchestration): pure decision-function orchestrator with CAS
- Lenguaje dominante
- TypeScript
- Estrellas
- 143
- Forks
- 46
- Merge medio
- 3 d 10 h
- PR fusionados (30 d)
- 24
Descripción
**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
Guía de contribución
Línea de trabajo
Comienza con ROADMAP.md y docs/design/ORCHESTRATOR.md; después, sigue los handlers actuales de orquestación durable mencionados en el issue. Define los límites del snapshot y de la acción, cubre decide(snapshot) con pruebas unitarias exhaustivas y verifica que la ejecución use escrituras condicionales con updated_at, preservando al mismo tiempo la compatibilidad incremental.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- aws, typescript
- Área
- backend-api-design, cloud, distributed-systems
- Tipo de issue
- Refactorización
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100