aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

refactor(orchestration): pure decision-function orchestrator with CAS

Aperta
#477 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement orchestration
Lingua principale
TypeScript
Stelle
143
Fork
46
Merge medio
3g 9h
PR unite (30g)
20

Descrizione

**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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da ROADMAP.md e docs/design/ORCHESTRATOR.md, quindi traccia gli attuali handler di orchestrazione durevole menzionati nell’issue. Definisci i confini dello snapshot e dell’azione, copri decide(snapshot) con test unitari esaustivi e verifica che l’esecuzione utilizzi scritture condizionali con updated_at, preservando al contempo la compatibilità incrementale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, typescript
Ambito
backend-api-design, cloud, distributed-systems
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.