Skip to content

docs(rfc): RFC-0058 Dynamic Workflow Capability - #363

Open
Million-mo wants to merge 1 commit into
wolf1069b:mainfrom
Million-mo:feat/rfc-0058-dynamic-workflow-capability
Open

docs(rfc): RFC-0058 Dynamic Workflow Capability#363
Million-mo wants to merge 1 commit into
wolf1069b:mainfrom
Million-mo:feat/rfc-0058-dynamic-workflow-capability

Conversation

@Million-mo

Copy link
Copy Markdown
Collaborator

Summary

Proposes RFC-0058: a new DynamicWorkflowCapability that lets the LLM author Python scripts to orchestrate subagents at scale, inspired by Claude Code dynamic workflows and pi-dynamic-workflows.

Motivation

AgentPool currently has two orchestration models:

  • Static graph workflows (YAML graph: section) — topology fixed at config-load time, cannot adapt at runtime
  • Dynamic team mode (RFC-0055) — LLM-driven via tool calls, but every intermediate result consumes the parent context

Neither handles tasks requiring 50+ parallel agents or iterative loops with unknown iteration counts without context degradation. This RFC addresses that gap with a script-based orchestration model where the plan lives in code, not in the LLM context window.

Key Design Decisions

  • Script language: Python (not JavaScript like Claude Code) — AgentPool is Python-native; ast module provides robust sandboxing without a JS runtime dependency
  • Sandbox: ast-level allowlist (no import, open, eval, dunder access) — sufficient for cooperative-LLM threat model
  • Primitives: agent(), parallel(), pipeline(), phase(), log(), budget — matching Claude Code / pi-dynamic-workflows proven API
  • Integration: Standard AbstractCapability subclass, registered via wolfharness.capabilities entry-point group
  • Resumability: In-session journal-based resume (cross-session deferred to v2)

Options Analyzed

Option Verdict
Python ast sandbox Recommended — expressive, no deps, Python-native
RestrictedPython library Marginal safety gain, adds external dep + 3.13 risk
Declarative YAML/JSON IR Safest but cannot express loops/conditionals

Related

  • RFC-0055 (Dynamic Team Mode — complementary, different scale)
  • RFC-0042 (Unified Lifecycle Architecture — Journal, SnapshotStore)
  • openspec/specs/static-graph-workflows/ (current static workflow baseline)

Checklist

  • All 12 RFC sections complete per template
  • 3 options analyzed with trade-offs
  • Evaluation criteria defined with weights
  • Technical design with file layout, data models, event types
  • Security analysis with threat model
  • Implementation plan with 5 phases / 4 weeks
  • 6 open questions documented

Proposes a DynamicWorkflowCapability that lets the LLM author Python
scripts to orchestrate subagents at scale, inspired by Claude Code's
dynamic workflows and pi-dynamic-workflows. Includes three-option
analysis (ast sandbox vs RestrictedPython vs declarative IR), full
technical design with primitives (agent/parallel/pipeline/phase/log),
budget tracking, journal-based resumability, and a 4-week
implementation plan.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant