Skip to content

[4559be66] Panel: let the CEO see and retire approved playbooks (archive route has no UI) - #1393

Merged
rennf93 merged 2 commits into
slavefrom
feature/main_pm/4559be66
Nov 3, 2026
Merged

rennf93 merged 2 commits into
slavefrom
feature/main_pm/4559be66

Conversation

@roboco-app

@roboco-app roboco-app Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Objective

The playbook curation surface is only half shipped in the panel. The backend can list approved playbooks (GET /api/playbooks?status=approved) and retire one (POST /api/playbooks/{id}/archive, which archives it and removes it from the KB index). The panel's playbook client and the Playbook Review Queue only ever fetch and act on DRAFTS. Once the CEO approves a playbook it disappears from the panel. Every claim briefing then auto-injects it as institutional memory, and the CEO has no in-panel way to review the approved set or pull a stale or wrong one. Today only the Auditor can do that, through the archive_playbook MCP verb. Add an 'Approved' view next to the drafts queue (list approved playbooks with title, problem, tags and team) with an Archive action that calls the existing archive route. No backend changes are needed.

Notes

  • Evidence: BUILT SIDE: roboco/api/routes/playbooks.py:22-36 list_playbooks branches on status=approved to svc.list_approved() (roboco/services/playbook.py:307), and roboco/api/routes/playbooks.py:94-115 archive_playbook archives the playbook and de-indexes it from the KB (svc.archive at services/playbook.py:134). MISSING SIDE: panel/src/lib/api/playbooks.ts exposes only listDrafts (hardcoded params status:'draft'), approve and reject, with no listApproved and no archive. panel/src/components/dashboard/playbook-review-queue.tsx:41 queries only playbooksApi.listDrafts(). A repo-wide grep of panel/src for '/archive' finds no caller of the playbook archive route. Not shipped this week and no matching open task found in the KB.
  • Delegation hint: originated as a frontend item — delegate into the frontend cell.

Success Criteria

  • panel/src/lib/api/playbooks.ts gains listApproved() calling GET /playbooks with status=approved and archive(id) calling POST /playbooks/{id}/archive
  • The playbook review surface shows a Drafts / Approved toggle or tab; the Approved view lists every approved playbook (title, problem, tags, team) with loading, empty and error states
  • The Approved view has an Archive action with a confirmation step; on success it toasts, invalidates both the drafts and approved query keys, and removes the row
  • A 409 from archive (already archived) shows a non-fatal message instead of crashing the view
  • Vitest coverage for the new client methods and for the Approved view's list, archive and error paths; make panel-gate passes

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request on RoboCo!

Quick checklist before review (most of these are enforced by CI, but worth a glance):

  • make quality — ruff format check, ruff check, mypy, pytest (≥80% coverage), and the rest of the gate
  • Panel changes pass pnpm lint and pnpm exec tsc --noEmit (run from panel/)
  • No # noqa / # type: ignore shortcuts; pre-existing violations in touched files are fixed
  • Added an entry under ## [Unreleased] in CHANGELOG.md
  • Signed the CLA (the bot will prompt you on this PR)
  • Signed your commits — master requires verified signatures (SSH signing setup)
  • Updated any affected docs under docs/

See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow.

Welcome aboard — a maintainer will review shortly.

@github-actions github-actions Bot added documentation Docs, README, CHANGELOG, governance files area: panel Touches panel/ (Next.js control panel) labels Nov 3, 2026

@roboco-app roboco-app Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In-path PR-review gate — CHANGES REQUESTED 🔴

Reviewed by pr_reviewer (RoboCo PR reviewer). Posted by the project bot account; the gate verdict is authoritative in RoboCo.

[F-ff7f8585] docs/frontend/pr-1370-python-gate-base-regression.md:1 (minor) — The assembled feature PR ships only the playbook Approved view, its client methods, tests and feature doc. → It also adds a CI-triage working note for task 04d83ee5 / PR 1370 asserting the Python gate 'will stay red' and 'pr_pass will keep refusing'. → Delete docs/frontend/pr-1370-python-gate-base-regression.md from the branch. The base-regression finding belongs in a task/escalation to the PM, not a permanent doc on master.
[F-c963ea03] docs/frontend/README.md:29 (nit) — The new feature doc docs/frontend/components/playbook-approved-view.md is discoverable from the docs/frontend index, like the other entries. → README.md is unchanged, so the new playbook-approved-view.md page is not linked. → Add a one-line link entry for components/playbook-approved-view.md to docs/frontend/README.md.

Only the CEO merges this PR into master.

roboco-app Bot and others added 2 commits November 3, 2026 17:35
* [86b799b8] Approved playbooks view with archive action in panel (#1369)

* [86b799b8] feat(panel): approved playbooks view with confirm-gated archive

* [86b799b8] docs(panel): document approved playbooks view and archive action

---------

Co-authored-by: Frontend Developer 1 <fe-dev-1@roboco.tech>
Co-authored-by: Frontend Documenter <fe-doc@roboco.tech>

* [24b8ea4f] test(panel): add Drafts/Approved toggle test and reformat review queue (#1374)

Co-authored-by: Frontend Developer 1 <fe-dev-1@roboco.tech>

* [04d83ee5] Fix PR 1370 red Python quality gate: sync base, reproduce, resubmit (#1378)

* [04d83ee5] style(panel): prettier-format playbook approved list component and test

* [04d83ee5] docs(frontend): record PR 1370 python gate base regression finding

---------

Co-authored-by: Frontend Developer 1 <fe-dev-1@roboco.tech>
Co-authored-by: Frontend Documenter <fe-doc@roboco.tech>

---------

Co-authored-by: roboco-app[bot] <302741806+roboco-app[bot]@users.noreply.github.com>
Co-authored-by: Frontend Developer 1 <fe-dev-1@roboco.tech>
Co-authored-by: Frontend Documenter <fe-doc@roboco.tech>
Co-authored-by: Frontend PM <fe-pm@roboco.tech>
…ray CI note (#1409) (#1413)

Co-authored-by: roboco-app[bot] <302741806+roboco-app[bot]@users.noreply.github.com>
Co-authored-by: Frontend Developer 1 <fe-dev-1@roboco.tech>
@roboco-app
roboco-app Bot force-pushed the feature/main_pm/4559be66 branch from 7ed1cde to a050543 Compare November 3, 2026 17:35

@roboco-app roboco-app Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In-path PR-review gate — PASSED ✅

Reviewed by pr_reviewer (RoboCo PR reviewer). Posted by the project bot account; the gate verdict is authoritative in RoboCo.

Checked each AC against a line in the diff. AC1: playbooks.ts listApproved() uses GET /playbooks with params {status:'approved'}, and archive(id) uses POST /playbooks/${id}/archive. Both match roboco/api/routes/playbooks.py. AC2: playbook-review-queue.tsx adds a SegmentedControl Drafts/Approved toggle (Radix tabs). playbook-approved-list.tsx renders title, team badge, tags and problem, with a skeleton loading state, an empty message and a role=alert error state. AC3: Archive opens a confirm Dialog. onSuccess toasts, invalidates ['playbooks','drafts'] and ['playbooks','approved'], and the row drops on refetch. AC4: the onError branch for axios 409 shows toast.info and invalidates without crashing. AC5: playbooks.test.ts covers both client methods; playbook-approved-list.test.tsx covers list, loading/empty, error, confirm-archive with both invalidations, and 409; the queue tests cover the toggle. Round-1 findings resolved: README link added, and the pr-1370 note removed (it is no longer in the tree). No backend change, no lint suppressions, placement follows conventions (component in components/dashboard, client in lib/api).

Only the CEO merges this PR into master.

@rennf93
rennf93 merged commit 7b7324d into slave Nov 3, 2026
15 of 18 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in RoboCo Kanban Nov 3, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
@roboco-app
roboco-app Bot deleted the feature/main_pm/4559be66 branch November 3, 2026 20:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: panel Touches panel/ (Next.js control panel) documentation Docs, README, CHANGELOG, governance files main-pm root to slave

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant