aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
RFC: Workflow graph syntax compiled to step-runner IR
- 主要言語
- TypeScript
- スター
- 143
- フォーク
- 46
- 平均マージ
- 3日 10時間
- マージ済み PR(30日)
- 24
説明
## Primary area
Agent (Python runtime)
## Related issue or feature request
- [WORKFLOWS.md](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/blob/main/docs/design/WORKFLOWS.md) — linear YAML steps today
- [ADR-014](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/blob/main/docs/decisions/ADR-014-workflow-driven-tasks.md)
- #457 (fix loops / `retry_target` on verify steps)
- #230 (event-driven governance — sync checkpoints for plan-before-code)
## Summary
When linear YAML steps become limiting, introduce a **workflow graph authoring format** that compiles to the existing step-runner intermediate representation (ordered steps with explicit jump metadata). The runner execution engine stays unchanged in v1; the compiler is the new component.
## Use case and motivation
Current workflows are intentionally linear with one `run_agent` ([WORKFLOWS.md](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/blob/main/docs/design/WORKFLOWS.md)). Fix loops and human gates add control flow via fields on steps, but complex flows (parallel review, plan-revise loops, conditional skip) become awkward as YAML lists.
A graph syntax makes branching, loops, and parallelism **visible in review** and diffable. Compilation to IR keeps the runtime simple and testable.
## Proposal
### Authoring
- New workflow file with format TBD instead of `steps:` in YAML.
- Nodes map to step kinds; edges carry conditions (`outcome=succeeded`, human choice keys).
- `model` / stylesheet attributes on graph or nodes compile to per-step overrides.
### Compilation
- CDK synth-time and `agent` loader invoke compiler → normalized `steps` + `control_flow` IR validated by existing JSON Schema where possible.
- Golden fixtures in `contracts/workflow-graph/` (graph input → expected IR).
### Execution (phased)
- **v1:** Compiler emits linearized steps with `jump_to` metadata; runner gains minimal jump support.
- **v2:** Parallel fan-out (explicitly out of scope for #248 / #99 today).
## Out of scope
- Visual editor / web UI for graphs
- Meta-agents that generate graphs at runtime
- Replacing YAML for simple workflows — graph is opt-in
- Multi-`run_agent` without explicit RFC approval
## Potential challenges
- **Validator parity** — Graph cross-field rules must match YAML rules (cedar-parity lesson).
- **Resume/checkpoint** — Jump targets must serialize in `workflow_state.json`.
- **Authoring burden** — learning curve; mitigate with examples in `agent/workflows/`.
## Dependencies and integrations
- `agent/src/workflow/compiler/` (new)
- `agent/workflows/schema/`
- `cdk/` synth-time validation
- `contracts/workflow-validation/` corpus extension
## Alternative solutions
1. **YAML-only control flow** — `retry_target`, human gates via #230; sufficient for medium term.
2. **Python DSL** — More expressive but not reviewable by non-Python authors.
3. **Registry-stored graphs** — Phase 4 #246; local compiler still needed for dev.
---
**Note:** Non-triaged RFCs may not get timely review. PRs on non-triaged issues might not be accepted.
コントリビューションガイド
調査の方向性
まず docs/design/WORKFLOWS.md と ADR-014 を読み、その後、agent/workflows/schema/ と contracts/workflow-validation/ にある既存の構造を調査します。提案されている作業では、agent/src/workflow/compiler/ と contracts/workflow-graph/ 配下の golden fixtures を追加します。完了の条件は、実行エンジンを記載された v1 の範囲を超えて変更することなく、検証済みの step-runner IR を生成できるだけの十分な精度で、グラフ形式とコンパイル動作が仕様化されていることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python, typescript
- 領域
- build-system, compilers, tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100