feat: implement core/team_runner.py and cli/agency.py #1
Reference in New Issue
Block a user
Delete Branch "hans/team-runner"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is the final implementation item from the buildspec —
core/team_runner.pyandcli/agency.py.What's in this PR
core/team_runner.py— full orchestration engine: spawn loop, gate logic, escalation, all tier lifecycle handlingcli/agency.py—agency run,agency watch,agency approve,agency reject,agency inspect,agency pause,agency resumecommandsdocs/agent-teams-design.md+docs/agent-teams-buildspec.md— added to repo for agent orientationCLAUDE.md— agent quick referenceStatus
All 15 buildspec steps complete. Design is fully locked (8 open questions resolved in PRs #8 + #9).
- core/blackboard.py: add t3_task_lists table, extend event kinds to include full visibility vocabulary (gate_pending, gate_approved, gate_rejected, gate_paused, gate_resumed, path_amendment, log), and add query methods (get_events, get_latest_gate_event, get_t3_task_lists, all_t3_committed, get_briefs, get_workstreams, etc.) - core/team_runner.py: full run lifecycle orchestrator - Loads team.yaml + role_registry.yaml, instantiates all four adapter types - T1 Plan (two-phase: plan + accept), T2 Lead/Specialist/Synthesis, T3 Squad Lead with mesh draft/commit cycle and mesh-timeout escalation, T4 swarm+pipeline with dep-ordering, T5 fan-out + joint verdict - Async (asyncio.gather) for parallel workstream and T4/T5 fan-out - Gate logic: gate_pending → notify → poll blackboard → gate_approved/rejected - Path amendment monitor (background task) - EscalationHandler integrated into _dispatch_with_retry - T3 mesh timeout → T2 re-scope escalation - Terminal failure → notify + run status=failed - VCS branch creation + PR at T1 Accept phase - Runtime selection: coding_agent runtime for preferred_runtime="coding_agent", tier_runtime_map overrides, fallback to default runtime - cli/agency.py: agency CLI with subcommands - run: start pipeline, prints run_id + watch/inspect hints - watch: tails blackboard events live with ANSI-coloured output - inspect: run tree, --tier filter, --brief detail view - approve: write gate_approved directly to blackboard (universal gate path) - reject: write gate_rejected with --reason - pause: write gate_paused signal - resume: write gate_resumed signal Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.