Workbench Ops Actions — 100% Implementation Plan (P1.5)

Goal: Deliver production-quality Workbench Ops Actions in the Workbench UI with complete backend support, secure execution, observable run history, and zero gaps. This plan assumes P0.1 auth is active and enforced for privileged actions.


Outcomes (Definition of Done)


Scope (P1.5 Actions)

Primary actions (from docs/workdocs/last-mile-plan.md):

Simple UX enhancements (high impact, low complexity):


Assumptions / Constraints


Phase 0 — Alignment and Inventory

  1. Confirm exact action commands + parameters (source of truth).
  2. Confirm context list source:
  3. Confirm required scopes and roles for each action.

Phase 1 — Backend API and Execution Engine (Workbench BFF)

1.1 API Models and Routes

Add Ops models to services/workbench-bff/src/models.py:

Add routes in services/workbench-bff/src/api/routes.py or new ops_routes.py:

1.2 Ops Runner Adapter

Create services/workbench-bff/src/adapters/ops_runner.py:

1.3 Security and Authorization

Add server-side auth enforcement for ops endpoints:

1.4 Observability

1.5 Backend Tests


Phase 2 — Workbench UI (Operations Page)

2.1 Routing + Navigation

2.2 API Client + Types

Add apps/workbench/src/lib/operations-api.ts:

Add types in apps/workbench/src/types/operations.ts mirroring BFF models.

2.3 UI Components

Create apps/workbench/src/pages/Operations.tsx with:

Leverage existing UI patterns:

2.4 UX Enhancements (Simple + Powerful)

2.5 Frontend Authorization

2.6 UI Tests


Phase 3 — Wiring, Docs, QA

3.1 Service Wiring

3.2 Documentation

3.3 Manual QA Checklist


Detailed Action Definitions (Proposed)

Action ID Command Template Parameters Notes
validate_specs just spec-guard context?, report? Use --dir docs/specs/<ctx> for scoped runs; allow --report for JSON output
regenerate_code just pipeline <ctx> context Preferred per-context; add confirmation; optionally show changed files
gap_report just gap-report <ctx> --no-online --json context, noOnline? Parse JSON for UI summary

Risk Controls


Milestones and Sequencing

1) Backend ops API + allowlist runner (Phase 1.1–1.2) 2) Auth enforcement + audit log (Phase 1.3) 3) UI Operations page + typed API (Phase 2.1–2.3) 4) UX enhancements + tests (Phase 2.4–2.6) 5) Documentation + QA sign-off (Phase 3)


Files to Touch (Planned)

Backend:

Frontend:

Docs:


Open Questions (Resolve Before Implementation)