Files
3205443119 Fix: dependency spawn gate and cell ownership (#73)
* Cleanup + Missing greenlet error

* fix(messaging): persist a group's active-session pointer so posts reuse it

create_session and create_session_with_access_check set group.active_session_id
from session.id BEFORE the flush that materializes it — the id is a flush-time
uuid4 default, so the pointer was written as NULL and every post opened a fresh
session, fragmenting one conversation across many. Flush first, then link, the
same ordering the seed path already uses.

Two tests fabricated "two distinct sessions" by calling create_session twice on
one group, which only differed because of this bug; switch them to two groups so
they keep testing their real intent. Add a regression guard that the pointer is
actually persisted and a second create reuses the live session.

* fix(orchestrator): gate spawns on dependencies and keep cell tasks in their cell

The cross-task dependency check ran only on the dev dispatch path, so cell-PM,
Main-PM and board agents were spawned onto dependency-blocked tasks and flailed
unblock / escalate / notify against an unfinished upstream — climbing ownership
of cell work up to the board, which cannot drive it, and deadlocking the task.

- Move the dependency gate into the shared spawn readiness check so it covers
  every role, and auto-block the task so it leaves the pending pool until the
  upstream reaches a terminal state (then the existing auto-unblock revives it).
- Cell-ownership invariant: a backend/frontend/ux_ui task may only be worked or
  owned by its own cell. The readiness gate refuses a board or Main-PM spawn
  onto a cell task; reassign refuses and clears such an owner; and on
  dependency-clear a mis-owned cell task is re-homed to its cell's pending pool
  instead of reviving under an owner that cannot progress it.
- A dependency block is never a CEO signal: notify(target=ceo) is refused while
  the task is waiting on an unfinished upstream, with a remediate to idle and
  wait — the block clears on its own.

* Uploading images + Fixing pyproject.toml

* ++

* revert(orchestrator): drop the cell-ownership block pending a tooling audit

The cell-ownership invariant added earlier — a board / Main-PM role may never be
spawned onto or reassigned to a cell task, plus re-homing a mis-owned cell task
on dependency-clear — was too absolute. It forbids a higher role from stepping
in when something genuinely deeper is going on, and contradicts the existing
rule that main_pm may hold a task at awaiting_pm_review. The dependency spawn
gate already prevents the cascade that handed the board cell tasks; the deadlock
it guarded against will be addressed with a return-path approach after auditing
what tools the cell PMs actually need. Keeps the dependency gate and the CEO
dependency-block notify guard.

* docs(prompts): a dependency wait is wait-and-idle, not escalate

The cell-PM and Main-PM prompts told agents to escalate_up / retry unblock on a
blocked task without distinguishing a dependency wait (which auto-clears the
moment the upstream completes) from a real wedge — the source of the
escalate/unblock flail and the CEO-notification spam. Split the blocked-state
guidance: a cross-cell dependency wait = note + i_am_idle (do not escalate,
unblock, or notify the CEO); escalate only a genuinely broken upstream. Fix two
stale references to i_am_blocked, a developer-only verb the PMs do not have,
to escalate_up.

Correct the CLAUDE.md verb-surface table, which understated every role: it
listed 4 cell_pm verbs while the flow manifest derives the full set (11,
including unclaim and i_am_idle) from lifecycle.spec.intents_for_role.

* feat(gateway): cell_pm reassign verb — intra-cell developer hand-off

A cell PM can now hand a claimed/in_progress task to another developer in its
own cell without unclaim (which drops the work back to the pool and loses the
assignee). The branch is keyed to the task, so the work-in-progress is
preserved; the new dev is respawned to continue. Intra-cell only: the task must
be in the caller's cell and new_assignee must be a developer of that same cell.

Wired through every layer: the reassign IntentSpec (composes=(), cell_pm-only),
the choreographer verb + intra-cell guard, a reaper-safe
TaskService.reassign_active_claim (reseeds the claim heartbeat so the new dev
is not immediately reaped), the ReassignRequest schema, the cell_pm flow route,
and the MCP flow-server tool. Tracing-waived like unclaim (mechanical hand-off).
Regenerated lifecycle/verb artifacts; prompt + CLAUDE.md updated.

---------

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
2026-06-06 22:10:48 +02:00

13 KiB

Per-role verb shapes (autogenerated)

Run uv run python scripts/regenerate_verb_tables.py after changing any role config or schema. Role prompts reference this file's sections as the source of truth for verb signatures.

developer

Flow verbs

Verb Body schema
give_me_work give_me_work()
i_am_blocked `i_am_blocked(task_id: UUID, reason: str, blocker_type: str
i_am_done i_am_done(task_id: UUID, notes: str = '')
i_am_idle i_am_idle()
i_will_work_on `i_will_work_on(task_id: UUID, plan: str
open_pr open_pr(task_id: UUID)
resume resume(task_id: UUID)
unclaim unclaim(task_id: UUID)

Content (do) tools

Tool Body schema
commit `commit(message: str, files: list[str]
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
evidence evidence(task_id: UUID)
progress `progress(task_id: UUID, message: str, plan_step: str
pr_update pr_update(see do_server)
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

qa

Flow verbs

Verb Body schema
claim_review claim_review(task_id: UUID)
fail_review fail_review(task_id: UUID, issues: list[str])
give_me_work give_me_work()
i_am_blocked `i_am_blocked(task_id: UUID, reason: str, blocker_type: str
i_am_idle i_am_idle()
pass_review pass_review(task_id: UUID, notes: str)
resume resume(task_id: UUID)
unclaim unclaim(task_id: UUID)

Content (do) tools

Tool Body schema
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
evidence evidence(task_id: UUID)
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

documenter

Flow verbs

Verb Body schema
claim_doc_task claim_doc_task(task_id: UUID)
give_me_work give_me_work()
i_am_blocked `i_am_blocked(task_id: UUID, reason: str, blocker_type: str
i_am_idle i_am_idle()
i_documented i_documented(task_id: UUID, notes: str, files: list[str])
resume resume(task_id: UUID)
unclaim unclaim(task_id: UUID)

Content (do) tools

Tool Body schema
commit `commit(message: str, files: list[str]
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
evidence evidence(task_id: UUID)
progress `progress(task_id: UUID, message: str, plan_step: str
pr_update pr_update(see do_server)
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

cell_pm

Flow verbs

Verb Body schema
complete complete(task_id: UUID, notes: str)
delegate `delegate(parent_task_id: UUID, title: str, description: str, assigned_to: str, team: str, task_type: str, nature: str, estimated_complexity: str, acceptance_criteria: list[str], project_id: UUID
escalate_up escalate_up(task_id: UUID, reason: str)
give_me_work give_me_work()
i_am_idle i_am_idle()
i_will_plan `i_will_plan(task_id: UUID, plan: str, approach: str, sub_tasks: list[str
reassign reassign(task_id: UUID, new_assignee: str)
resume resume(task_id: UUID)
submit_up submit_up(task_id: UUID, notes: str)
triage triage()
unblock unblock(task_id: UUID, restore: bool = True)
unclaim unclaim(task_id: UUID)

Content (do) tools

Tool Body schema
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
notify `notify(target: str, text: str, priority: str = 'normal', task_id: UUID
evidence evidence(task_id: UUID)
open_session `open_session(task_id: UUID, channel: str, topic: str, relationship_type: str = 'discussion', group_id: UUID
link_session link_session(session_id: UUID, task_id: UUID, is_primary: bool = False, relationship_type: str = 'discussion')
pr_update pr_update(see do_server)
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

main_pm

Flow verbs

Verb Body schema
complete complete(task_id: UUID, notes: str)
delegate `delegate(parent_task_id: UUID, title: str, description: str, assigned_to: str, team: str, task_type: str, nature: str, estimated_complexity: str, acceptance_criteria: list[str], project_id: UUID
escalate_to_ceo escalate_to_ceo(task_id: UUID, reason: str)
escalate_up escalate_up(task_id: UUID, reason: str)
give_me_work give_me_work()
i_am_idle i_am_idle()
i_will_plan `i_will_plan(task_id: UUID, plan: str, approach: str, sub_tasks: list[str
resume resume(task_id: UUID)
triage triage()
triage_all triage_all()
unblock unblock(task_id: UUID, restore: bool = True)
unclaim unclaim(task_id: UUID)

Content (do) tools

Tool Body schema
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
notify `notify(target: str, text: str, priority: str = 'normal', task_id: UUID
evidence evidence(task_id: UUID)
open_session `open_session(task_id: UUID, channel: str, topic: str, relationship_type: str = 'discussion', group_id: UUID
link_session link_session(session_id: UUID, task_id: UUID, is_primary: bool = False, relationship_type: str = 'discussion')
pr_update pr_update(see do_server)
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

product_owner

Flow verbs

Verb Body schema
escalate_to_ceo escalate_to_ceo(task_id: UUID, reason: str)
i_am_idle i_am_idle()
triage triage()

Content (do) tools

Tool Body schema
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
notify `notify(target: str, text: str, priority: str = 'normal', task_id: UUID
evidence evidence(task_id: UUID)
open_session `open_session(task_id: UUID, channel: str, topic: str, relationship_type: str = 'discussion', group_id: UUID
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

head_marketing

Flow verbs

Verb Body schema
escalate_to_ceo escalate_to_ceo(task_id: UUID, reason: str)
i_am_idle i_am_idle()
triage triage()

Content (do) tools

Tool Body schema
note `note(text: str, scope: str = 'note', task_id: UUID
say `say(channel: str, text: str, task_id: UUID
dm `dm(recipient: str, text: str, task_id: UUID
notify `notify(target: str, text: str, priority: str = 'normal', task_id: UUID
evidence evidence(task_id: UUID)
open_session `open_session(task_id: UUID, channel: str, topic: str, relationship_type: str = 'discussion', group_id: UUID
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
notify_ack notify_ack(notification_id: UUID)
channels channels()

auditor

Flow verbs

Verb Body schema
i_am_idle i_am_idle()
triage triage()

Content (do) tools

Tool Body schema
note `note(text: str, scope: str = 'note', task_id: UUID
evidence evidence(task_id: UUID)
notify_list notify_list(unread_only: bool = True, pending_ack_only: bool = False, limit: int = 20)
notify_get notify_get(notification_id: UUID)
channels channels()