feat(gateway): Wave 1 pre-gateway parity — sessions, progress, notify inbox

Closes empty-panel complaints (Sessions, Progress) and the i_am_idle
notification-inbox deadlock identified in the 2026-05-11 gap analysis.
All backend service methods already exist; this is pure MCP-surface
widening on top of the existing choreographer + ContentActions.

New MCP tools (roboco-do):
- progress(task_id, message, percentage)         — Progress tab writer
- open_session(task_id, channel, topic, ...)     — Sessions tab writer (PM+)
- link_session(session_id, task_id, ...)         — Idempotent task↔session
- notify_list(unread_only, pending_ack_only, limit)
- notify_get(notification_id)
- notify_ack(notification_id)

Wired through:
- roboco/api/schemas/v2/do.py — six new request schemas with Field constraints
  (Progress.percentage: ge=0, le=100; OpenSession.topic: max_length=200; etc.)
- roboco/api/routes/v2/do.py — six new POST routes, thin dispatchers
- roboco/services/gateway/content_actions.py — six new ContentActions methods
  forwarding to TaskService.add_progress, MessagingService.create_session_for_tasks
  /link_session_to_task, NotificationDeliveryService.list_for_agent / get_for_
  recipient_and_mark_read / acknowledge
- roboco/mcp/do_server.py — six new typed tool wrappers + registered in _TOOLS
- roboco/services/gateway/role_config.py — receivers (list/get/ack) added to
  every role except auditor (who gets list/get, no ack). Session verbs to
  PM-or-up. Progress to dev + doc.
- agents/prompts/roles/*.md — verb tables updated for developer / QA /
  documenter / cell_pm / main_pm. i_am_idle line points to notify_list as
  the deadlock resolution path.

Authorization:
- progress: assignee + active status (in_progress / verifying / awaiting_qa /
  awaiting_documentation)
- open_session: cell_pm / main_pm / product_owner / head_marketing / ceo
- link_session: caller must own the task
- notify_ack: caller must be a recipient (ValueError from service maps to
  not_authorized envelope)

Per-file ignore extended:
- roboco/services/gateway/**/*.py = [PLC0415, PLR0913] — same rationale as
  roboco/mcp/**: typed verb signatures are the agent-facing contract; bundling
  into dataclasses hides field-level schema the LLM needs at the tool layer.

Quality: ruff + mypy clean. 503 unit tests pass on touched surfaces.

Spec ref: docs/superpowers/specs/2026-05-11-pre-gateway-parity-design.md
This commit is contained in:
Renn F
2026-05-11 05:43:01 +02:00
parent 60bd9b175d
commit 8408d761ca
11 changed files with 611 additions and 13 deletions
+6
View File
@@ -164,6 +164,12 @@ select = [
# the LLM and bring back invented values like nature='standard'.
"roboco/mcp/**/*.py" = ["PLC0415", "PLR0913"]
"roboco/services/*.py" = ["PLC0415"]
# Gateway methods are typed verb surfaces — agent-facing kwargs reflect the
# verb contract (session topic, channel, relationship type, etc.). Bundling
# into a dataclass hides the field-by-field schema the LLM needs at the
# tool layer; we accept the >5 kwarg signatures here for the same reason
# they're accepted in `roboco/mcp/**`.
"roboco/services/gateway/**/*.py" = ["PLC0415", "PLR0913"]
"roboco/api/routes/*.py" = ["PLC0415"]
"roboco/runtime/*.py" = ["PLC0415"]
# Lifecycle validators: foundation/_validate_lifecycle is imported from the