Skip to content

Add dead-simple orchestrator command with inherited run config#299

Open
mmprotest wants to merge 3 commits into
mainfrom
mmprotest/add-orchestrate-command-to-villani-code
Open

Add dead-simple orchestrator command with inherited run config#299
mmprotest wants to merge 3 commits into
mainfrom
mmprotest/add-orchestrate-command-to-villani-code

Conversation

@mmprotest

Copy link
Copy Markdown
Owner

Motivation

  • Provide a tiny orchestrator to improve long-horizon tasks by spawning scoped villani-code run subprocesses against the same live codebase while reusing the existing runner and avoiding a heavyweight framework.
  • Ensure the supervisor and worker subprocesses run with the exact effective run configuration received by the parent orchestrate command so runtime/provider/debug/approval flags (current and future) are preserved and forwarded automatically.

Description

  • Add villani-code orchestrate "..." CLI command that accepts the full run option surface plus orchestrator-only flags --max-workers, --max-worker-retries, --supervisor-timeout-seconds, and --worker-timeout-seconds, and prints a final JSON summary.
  • Refactor shared run option wiring into typed option aliases and a single _build_inherited_run_args(...) helper used by orchestrate so all run flags are inherited and forwarded unchanged to supervisor/worker/retry subprocess constructions.
  • Extend run with hidden machine-oriented flags --role, --result-json-path, and --parent-mission-id and add strict JSON artifact emission for child roles via _write_result_artifact.
  • Implement minimal orchestrator modules: villani_code/orchestrator.py (orchestration flow, subprocess construction, retries, mission artifacts), villani_code/orchestrator_models.py (typed contracts), villani_code/orchestrator_roles.py (supervisor/worker prompt builders), and villani_code/orchestrator_verify.py (snapshot helpers and deterministic verification with rollback).
  • Keep worker behavior effectful on the live repo (no git/worktrees), snapshot touched files before attempts, restore on failed verification, and run workers sequentially (no async or worker-to-worker chat).

Testing

  • Added tests/test_orchestrator.py with focused cases for flag inheritance, forwarding to supervisor/workers/retries, supervisor retry on invalid output, worker retry and snapshot restore, non-execution of success_criteria, no final verification when no worker succeeds, parent-mission authority, and supervisor multi-subtask bounds.
  • Ran the focused test suite: pytest -q tests/test_orchestrator.py tests/test_cli_debug_flags.py tests/test_cli_headless_optional_tui.py, and all tests passed (19 passed, 27 warnings).

Codex Task

…trator-and-worker-logic

Tighten orchestrator worker bounds, rollback, verification, and Windows guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant