mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
chore(board): revive dormant board wiring — research key, pitch flow, auditor playbooks (#684)
* chore(compose): pass research key/provider + provisioning token/org through to the orchestrator ROBOCO_RESEARCH_API_KEY / ROBOCO_RESEARCH_PROVIDER and ROBOCO_PROVISIONING_TOKEN / ROBOCO_PROVISIONING_ORG were absent from every compose environment stanza, so .env values never reached the container: research silently ran on the NullProvider (empty results forever) and any approved pitch died on ProvisioningDisabledError. .env.example also falsely claimed the provisioning creds are panel-managed. * feat(board): pitch CEO notification + auditor playbook-draft surfacing A proposed pitch now nudges the CEO (APPROVAL notification + Telegram link to the Pitches tab, best-effort — a send failure never fails the verb). auditor_triage surfaces the oldest pending playbook draft once anomalies are clear — the curation verbs were granted but nothing ever pointed the Auditor at the review queue; the scheduled audit prompt names the discovery path. * docs(prompts): pitch doctrine section + auditor reply-only-dm drift fix board.md never mentioned the pitch verb, so no board agent ever had a reason to call it — it gets a dedicated section mirroring the roadmap/spotlight ones, plus a roadmap-exploration escape hatch (needs-its-own-repo ideas pitch instead). product-owner.md gains its missing propose_roadmap + pitch entries. The flat 'Auditor has no dm' claims are corrected to the real grant: never initiates, reply-only in a CEO-opened thread. Doctrine guarded by a prompt-content test. --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,7 @@ from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from uuid import uuid4
|
||||
|
||||
import pytest
|
||||
@@ -76,13 +76,44 @@ async def test_auditor_triage_returns_idle_when_no_anomalies() -> None:
|
||||
deps = _make_deps(task=task_svc)
|
||||
c = Choreographer(deps)
|
||||
|
||||
env = await c.auditor_triage(auditor_id)
|
||||
playbook_svc = AsyncMock()
|
||||
playbook_svc.list_drafts.return_value = []
|
||||
with patch(
|
||||
"roboco.services.playbook.get_playbook_service", return_value=playbook_svc
|
||||
):
|
||||
env = await c.auditor_triage(auditor_id)
|
||||
body = env.as_dict()
|
||||
assert body["status"] == "idle"
|
||||
assert body["task_id"] is None
|
||||
assert "i_am_idle" in body["next"]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_auditor_triage_surfaces_playbook_draft_when_no_anomalies() -> None:
|
||||
"""No anomalies, but a pending playbook draft — surfaced instead of idle
|
||||
so the Auditor's approve_playbook/reject_playbook duty is discoverable."""
|
||||
auditor_id = uuid4()
|
||||
task_svc = AsyncMock()
|
||||
task_svc.agent_for.return_value = MagicMock(role="auditor", team="board")
|
||||
task_svc.list_long_running_blocked.return_value = []
|
||||
deps = _make_deps(task=task_svc)
|
||||
c = Choreographer(deps)
|
||||
|
||||
draft = MagicMock(id=uuid4(), title="Rebase onto a live rung before cutting")
|
||||
playbook_svc = AsyncMock()
|
||||
playbook_svc.list_drafts.return_value = [draft]
|
||||
with patch(
|
||||
"roboco.services.playbook.get_playbook_service", return_value=playbook_svc
|
||||
):
|
||||
env = await c.auditor_triage(auditor_id)
|
||||
body = env.as_dict()
|
||||
assert body["status"] == "draft"
|
||||
assert body["task_id"] is None
|
||||
assert str(draft.id)[:8] in body["next"]
|
||||
assert "approve_playbook" in body["next"]
|
||||
assert "reject_playbook" in body["next"]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_auditor_triage_only_first_anomaly_surfaces() -> None:
|
||||
"""Auditor gets the most-stale blocked task; others wait until next call."""
|
||||
|
||||
Reference in New Issue
Block a user