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

RFC: Workflow graph syntax compiled to step-runner IR

Đang mở
#565 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

agent-runtime registry RFC-proposal
Ngôn ngữ chính
TypeScript
Star
146
Fork
46
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
24

Mô tả

Primary area

Agent (Python runtime)

Related issue or feature request

  • WORKFLOWS.md — linear YAML steps today
  • ADR-014
  • #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). 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 flowretry_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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Đọc docs/design/WORKFLOWS.md và ADR-014 trước, sau đó kiểm tra các cấu trúc hiện có trong agent/workflows/schema/ và contracts/workflow-validation/. Công việc được đề xuất sẽ thêm agent/src/workflow/compiler/ và các golden fixtures bên dưới contracts/workflow-graph/; được xem là hoàn tất khi định dạng đồ thị và hành vi biên dịch được đặc tả đủ rõ để tạo ra step-runner IR đã được kiểm định, mà không thay đổi execution engine vượt quá phạm vi v1 đã nêu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python, typescript
Lĩnh vực
build-system, compilers, tooling
Loại issue
Tính năng
Độ 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
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.