feat(chief-tools): dynamic project-chief spawn/monitor/terminate (POC Phase 0+1)#9
Merged
Conversation
…, Phase 0+1)
Adds 4 new MCP tools for main:manager to delegate complex tasks to
dynamically-spawned chief sub-agents:
- chief_spawn(name, brief, lifetime, terminate_policy)
Creates an isolated kanban board + ready initial task assigned to
'chief-manager'. Dispatcher's per-board tick spawns a worker that
loads the chief-manager skill and owns the project end-to-end.
- chief_status(chief_id)
Aggregates the chief's board into a Main-friendly summary (alive,
stage, subtask counts, last comment, runtime). Designed for
periodic polling by main:manager without diving into ops detail.
- chief_list(include_archived)
Enumerates all chief boards on the host (filter: board.json has
kind=chief). Shows parent_chief_id links so Main can see the tree.
- chief_terminate(chief_id, force)
Cascade policy: recursively archives every sub-chief that lists
this chief as parent_chief_id. Independent policy returns NYI
(Phase 2). Optional force=true SIGTERMs running workers.
Architecture & lifecycle policies documented in
plans/dynamic-chief-spawn-and-lifecycle.md (in nnnet/AiManager).
Foundational changes in kanban_db.create_board / write_board_metadata:
adds meta_extra kwarg so chief metadata (kind, lifetime, parent_chief_id,
spawned_at, terminate_policy) can be persisted in board.json without
schema migration. Reserved keys (slug, db_path) cannot be overridden.
Skill: skills/devops/chief-manager/SKILL.md — defines worker behavior:
orient → decompose → monitor → heartbeat → complete pattern, what NOT
to do (no direct user communication, no recursion past depth 3), digest
shape for progress comments.
Tests: 14 new in tests/tools/test_chief_tools.py — spawn validation,
status aggregation, list filtering, cascade termination, recursion
depth guard, independent NYI rejection.
Note: the multi_board_env fixture in test_kanban_tools.py needed
kb.create_board('alt') explicit call — connect()'s no-resurrect guard
(from earlier fix/kanban-delete-active-board branch) refuses implicit
mkdir for non-default boards.
Phase 2-5 (independent policy, GC daemon, dashboard widget, etc) — see
the plan doc.
POC verification (manual, not deployed): all 167 tests in
tests/tools/test_kanban_tools.py + tests/tools/test_chief_tools.py +
tests/hermes_cli/test_kanban_db.py pass.
# Conflicts: # tests/tools/test_kanban_tools.py
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POC for dynamic project-chief spawn. Implements 4 MCP tools that let
main:manager (or another chief) create an isolated kanban board +
worker for a complex/long-running project, monitor its state, and
terminate it on demand.
Design reference:
plans/dynamic-chief-spawn-and-lifecycle.mdArchitecture
Lifecycle policy (
cascade|independent) fixed at spawn, stored inboard.json.meta_extra. Cascade implemented; independent is Phase 2 (NYI).Tools
chief_spawnassignee=chief-managerchief_statuschief_listchief_terminateFiles
tools/chief_tools.py(+695) — all four MCP tools + slugify/lifecycle helpersskills/devops/chief-manager/SKILL.md(+132) — behaviour contract for the chief workerhermes_cli/kanban_db.py(+21) —meta_extrasupport for board metadatatests/tools/test_chief_tools.py(+286) — unit-test all four tools, lifecycle paths, gatingtests/tools/test_kanban_tools.py(+12) — bump profile count 33 → 34 for new tool+1144 / −2 LoC, 5 files.
Test plan
pytest tests/tools/test_chief_tools.py tests/tools/test_kanban_tools.py -v -o "addopts="→ 85 passed in 7.15schief_spawn(brief='small test project')from main:manager session, verify board+task created, dispatcher spawns worker, worker loads chief-manager skill.Architecture note — relation to MC (Mission Control)
This PR introduces chief-spawn as a Hermes-INTERNAL orchestration primitive.
A follow-up PR will add an
mc_pipeline_runtool so a chief (or main:manager)can delegate heavy workflows to an external Mission Control backend when the
in-Hermes path isn't enough — see
_runtime-notes/merge-and-integration-plan.mdfor the full Hermes ↔ MC integration roadmap. The two systems are
complementary, not competing: chief = light-weight in-Hermes coordination;
MC = multi-framework execution engine with dashboard.
Rollback
Revert this PR. New tools are additive; existing tools unchanged.
🤖 Generated with Claude Code