From a3702d2934126c4c34eb74cfd139d1d8dff6ddc8 Mon Sep 17 00:00:00 2001 From: Jason Robert Date: Fri, 17 Apr 2026 17:41:22 -0400 Subject: [PATCH 01/13] feat(registry): add workflow registry system, replace init/templates Introduce a configurable named-registry system for distributing and running shared workflows. Registries can be GitHub repos or local directories, configured once in ~/.conductor/registries.toml and referenced by short name. - Add src/conductor/registry/ package (config, resolver, index, cache, github helpers, errors) - Add `conductor registry` CLI subcommand group (list, add, remove, set-default, update, show) - Modify run/resume/validate to accept registry refs (name[@registry][@version]) in addition to local file paths - Remove init/templates feature (init.py, templates/, test_init.py) - Add httpx dependency for GitHub API fetching - Add 133 new tests (unit + integration + CLI) - Update README, cli-reference, design doc, and conductor skill Supersedes PR #88. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .claude/skills/conductor/SKILL.md | 6 +- .../skills/conductor/references/execution.md | 43 +- README.md | 26 +- docs/cli-reference.md | 84 ++-- docs/design/registry.md | 280 +++++++++++ pyproject.toml | 1 + src/conductor/cli/app.py | 183 ++++--- src/conductor/cli/init.py | 171 ------- src/conductor/cli/registry.py | 230 +++++++++ src/conductor/registry/__init__.py | 3 + src/conductor/registry/cache.py | 270 ++++++++++ src/conductor/registry/config.py | 256 ++++++++++ src/conductor/registry/errors.py | 13 + src/conductor/registry/github.py | 176 +++++++ src/conductor/registry/index.py | 248 +++++++++ src/conductor/registry/resolver.py | 129 +++++ src/conductor/templates/human-gate.yaml | 49 -- src/conductor/templates/loop.yaml | 51 -- src/conductor/templates/simple.yaml | 22 - tests/test_cli/test_init.py | 255 ---------- tests/test_cli/test_registry_commands.py | 258 ++++++++++ tests/test_registry/__init__.py | 0 tests/test_registry/test_cache.py | 362 ++++++++++++++ tests/test_registry/test_config.py | 279 +++++++++++ tests/test_registry/test_github.py | 168 +++++++ tests/test_registry/test_index.py | 328 ++++++++++++ tests/test_registry/test_integration.py | 469 ++++++++++++++++++ tests/test_registry/test_resolver.py | 216 ++++++++ uv.lock | 2 + 29 files changed, 3861 insertions(+), 717 deletions(-) create mode 100644 docs/design/registry.md delete mode 100644 src/conductor/cli/init.py create mode 100644 src/conductor/cli/registry.py create mode 100644 src/conductor/registry/__init__.py create mode 100644 src/conductor/registry/cache.py create mode 100644 src/conductor/registry/config.py create mode 100644 src/conductor/registry/errors.py create mode 100644 src/conductor/registry/github.py create mode 100644 src/conductor/registry/index.py create mode 100644 src/conductor/registry/resolver.py delete mode 100644 src/conductor/templates/human-gate.yaml delete mode 100644 src/conductor/templates/loop.yaml delete mode 100644 src/conductor/templates/simple.yaml delete mode 100644 tests/test_cli/test_init.py create mode 100644 tests/test_cli/test_registry_commands.py create mode 100644 tests/test_registry/__init__.py create mode 100644 tests/test_registry/test_cache.py create mode 100644 tests/test_registry/test_config.py create mode 100644 tests/test_registry/test_github.py create mode 100644 tests/test_registry/test_index.py create mode 100644 tests/test_registry/test_integration.py create mode 100644 tests/test_registry/test_resolver.py diff --git a/.claude/skills/conductor/SKILL.md b/.claude/skills/conductor/SKILL.md index fb71f5b..c54094f 100644 --- a/.claude/skills/conductor/SKILL.md +++ b/.claude/skills/conductor/SKILL.md @@ -30,8 +30,9 @@ conductor run workflow.yaml --log-file auto # Log full debug outpu conductor run workflow.yaml --web --input q="Hello" # Real-time web dashboard conductor run workflow.yaml --web-bg --input q="Hello" # Background mode (prints URL, exits) conductor validate workflow.yaml # Validate only -conductor init my-workflow --template simple # Create from template -conductor templates # List templates +conductor registry add official myorg/workflows --default # Add a registry +conductor registry list official # List registry workflows +conductor run qa-bot@official@1.0.0 --input q="Hello" # Run from registry conductor stop # Stop background workflow conductor update # Check for and install latest version conductor resume workflow.yaml # Resume from last checkpoint @@ -102,5 +103,6 @@ For runtime config, context modes, limits, and cost tracking, see [references/au | `runtime` | Provider, model, temperature, max_tokens, MCP servers | | `--web` | Real-time web dashboard with DAG graph, live streaming, in-browser human gates | | `checkpoint` | Auto-saved on failure; resume with `conductor resume` | +| `registry` | Named workflow sources (GitHub repo or local dir) for sharing workflows | For pattern examples (linear, loop, conditional, parallel, for-each, human gate) and template syntax, see [references/authoring.md](references/authoring.md). diff --git a/.claude/skills/conductor/references/execution.md b/.claude/skills/conductor/references/execution.md index 6db4034..4afa5cd 100644 --- a/.claude/skills/conductor/references/execution.md +++ b/.claude/skills/conductor/references/execution.md @@ -195,40 +195,45 @@ Checks: - Parallel group agent references - For-each source format and reserved names -### conductor init +### conductor registry -Create workflow from template: +Manage workflow registries — named sources of shared workflows (GitHub repos or local directories). ```bash -conductor init [OPTIONS] +conductor registry [OPTIONS] ``` -| Option | Description | -|--------|-------------| -| `--template`, `-t TEMPLATE` | Template to use (default: simple) | -| `--output`, `-o PATH` | Output file path | +| Subcommand | Description | +|------------|-------------| +| `list [name]` | List registries, or workflows in a specific registry | +| `add ` | Add a registry (`--type github\|path`, `--default`) | +| `remove ` | Remove a registry | +| `set-default ` | Set the default registry | +| `update [name]` | Refresh index and re-resolve latest versions | +| `show ` | Show metadata for a workflow reference | **Examples:** ```bash -conductor init my-workflow -conductor init my-workflow --template loop -conductor init review -t human-gate -o ./workflows/review.yaml +conductor registry add official myorg/conductor-workflows --default +conductor registry add local /path/to/workflows --type path +conductor registry list # show configured registries +conductor registry list official # show workflows in a registry +conductor registry set-default official +conductor registry update # refresh all indexes +conductor registry show qa-bot@official@1.0.0 # show workflow metadata ``` -### conductor templates - -List available templates: +**Running from a registry:** ```bash -conductor templates +conductor run qa-bot # latest from default registry +conductor run qa-bot@official # latest from named registry +conductor run qa-bot@official@1.2.3 # explicit version +conductor run qa-bot@@1.2.3 # explicit version from default registry ``` -| Template | Description | -|----------|-------------| -| `simple` | Single agent with basic I/O | -| `loop` | Iterative refinement pattern | -| `human-gate` | Workflow with approval gate | +Registry workflows are cached locally at `~/.conductor/cache/registries/` and reused on subsequent runs. Explicit versions are immutable; `latest` is re-resolved on `conductor registry update`. ## Execution Flow diff --git a/README.md b/README.md index b7d4deb..97d430a 100644 --- a/README.md +++ b/README.md @@ -207,23 +207,29 @@ Validate a workflow file without executing. conductor validate ``` -### `conductor init` - -Create a new workflow from a template. +**Full CLI documentation:** [docs/cli-reference.md](docs/cli-reference.md) -```bash -conductor init --template