# Playbook View — Quick Stats Clickable Implementation Plan

**Feature**: `FOB-PLAYBOOKS-VIEW_PLAYBOOK-1` — Quick Stats become drill-downs into playbook-scoped lists
**Feature File**: [`docs/features/act-2-playbooks/playbooks-view.feature`](../features/act-2-playbooks/playbooks-view.feature) (scenarios 25–26 implemented; see completion markers in that file)
**Branch**: `feature/playbooks-view-quick-stats-clickable`
**Status**: ✅ **COMPLETED** (BPE-07 Finalize Feature, 2026-04-30)
**Issue**: TBD (optional — link when GitHub issue/PR exist)

> Generated by following [`.windsurf/workflows/FeatureFactory/BPE/BPE-01-Plan_Feature.md`](../../.windsurf/workflows/FeatureFactory/BPE/BPE-01-Plan_Feature.md).

---

## 1. Architectural Alignment (BPE-01 Step 1)

Per [`docs/architecture/SAO.md`](../architecture/SAO.md):

- **HTMX + Graphviz UI**: server-rendered HTML; full-page navigation is acceptable for tile clicks (no HTMX swap needed for cross-section navigation).
- **URL convention** (SAO §"URL Routing Convention"): `/playbooks/<pk>/<entity>/` for playbook-scoped lists already used by Workflows, Phases, Skills, Rules, Artifacts. We extend this to Activities and Agents.
- **Service layer + thin views**: any new query helper goes into the service module for the relevant entity, never inline in the view (BPE-01 Step 6.1, SAO §"Service Layer + MCP Tools").
- **Test-first** + **integration tests without mocking** (BPE-01 Rule I).
- **Concise methods** (≤30 lines public, helpers private — BPE-01 Rule III).

## 2. User Journey Alignment (BPE-01 Step 2)

Per [`docs/features/user_journey.md`](../features/user_journey.md): the playbook detail screen is Maria's hub for a single playbook. The Quick Stats card today is informational only; making it a drill-down accelerates navigation from "I see I have 24 activities" to "show me those 24 activities." This stays consistent with the *static reference material* nature of playbooks (no work-item tracking introduced).

## 3. Feature Specification (BPE-01 Step 3)

The clickable behaviour is a refinement of the existing Quick Stats scenario [`FOB-PLAYBOOKS-VIEW_PLAYBOOK-03`](../features/act-2-playbooks/playbooks-view.feature). We add two new scenarios to the same feature file during execution:

```gherkin
  Scenario: FOB-PLAYBOOKS-VIEW_PLAYBOOK-25 Quick Stats tiles are clickable drill-downs
    Given Maria is on the playbook detail page for "React Frontend Development"
    And she sees the Quick Stats card with 7 tiles: Workflows, Phases, Activities, Artifacts, Agents, Skills, Rules
    Then each tile is rendered as an anchor with a visible hover affordance
    And each tile's link points to the playbook-scoped list URL for that entity
    And each link uses the playbook id of "React Frontend Development"

  Scenario: FOB-PLAYBOOKS-VIEW_PLAYBOOK-26 Clicking a Quick Stats tile opens the scoped list
    Given Maria is on the playbook detail page for "React Frontend Development"
    When she clicks the "Activities" tile in Quick Stats
    Then she navigates to /playbooks/<pk>/activities/
    And she sees only activities that belong to "React Frontend Development"
    And the page header indicates the playbook context
    # Repeat acceptance for: Workflows, Phases, Artifacts, Agents, Skills, Rules
```

Acceptance is verified per-tile (parametrised test, see §7).

## 4. Codebase Assessment (BPE-01 Step 4)

### 4.1 Reusable — playbook-scoped list URL exists, link only

Verified by reading the URL configs and templates:

| Tile | URL name | Path | View | Template |
|---|---|---|---|---|
| Workflows | `workflow_list` | `/playbooks/<int:playbook_pk>/workflows/` | `workflow_views.workflow_list` ([`methodology/workflow_views.py:154`](../../methodology/workflow_views.py)) | `templates/workflows/list.html` |
| Phases | `phase_list` | `/playbooks/<int:playbook_pk>/phases/` | `phase_views.phase_list` ([`methodology/phase_views.py:65`](../../methodology/phase_views.py)) | `templates/phases/list.html` |
| Skills | `skill_list` | `/playbooks/<int:playbook_pk>/skills/` | `skill_views.skill_list` ([`methodology/skill_views.py:96`](../../methodology/skill_views.py)) | `templates/skills/playbook_list.html` |
| Rules | `rule_list` | `/playbooks/<int:playbook_pk>/rules/` | `rule_views.rule_list` ([`methodology/rule_views.py:53`](../../methodology/rule_views.py)) | `templates/rules/playbook_list.html` |
| Artifacts | `artifact_list` | `/playbooks/<int:playbook_id>/artifacts/` | `artifact_views.artifact_list` (URL name registered in [`methodology/artifact_urls.py`](../../methodology/artifact_urls.py)) | exists |

> Note: `artifact_list` uses kwarg name `playbook_id` (not `playbook_pk`). The template tag must be `{% url 'artifact_list' playbook_id=playbook.pk %}`. Verify when wiring the link.

### 4.2 Missing — need new patterned scoped URLs

- **Activities** — only per-workflow scoped list exists (`activity_list` at `/playbooks/<pk>/workflows/<wpk>/activities/`). No `playbook_id`-only list.
- **Agents** — only global list exists (`agent_list` at `/agents/`). No playbook-scoped list.

Existing assets we will reuse:

- Service helpers — `AgentService.list_agents_for_playbook(playbook_id)` already exists ([`methodology/services/agent_service.py:78`](../../methodology/services/agent_service.py)). For activities, we'll add `ActivityService.list_activities_for_playbook(playbook_id, user)` (does not yet exist; verify and add).
- Templates — `templates/skills/playbook_list.html` and `templates/rules/playbook_list.html` are exemplars for naming pattern; we'll mirror them for activities and agents.
- Permission helper — `Playbook.author=request.user` ownership pattern is consistent across `phase_list` / `skill_list` / `rule_list`. We re-use it.

### 4.3 Frontend asset

[`templates/playbooks/detail.html`](../../templates/playbooks/detail.html) lines 257–308 contain the Quick Stats grid with seven tiles already tagged via `data-testid="stat-<entity>"`. The inner `<div class="p-3 border rounded">` is the wrap target for the new `<a>`.

### 4.4 Existing test coverage to preserve

- [`tests/integration/test_playbook_view_quick_stats_icons.py`](../../tests/integration/test_playbook_view_quick_stats_icons.py) — extracts each tile by `data-testid` and checks icons. Anchor wrapping must keep its regex valid; we'll re-run after edits.
- [`tests/integration/test_playbook_view_phase1.py`](../../tests/integration/test_playbook_view_phase1.py) — covers `pb_view_03_overview_tab_default`. Quick Stats counts must continue to render (the numbers are not removed, only wrapped).

### 4.5 Re-use vs. replace decision

**Decision: integrate, don't replace.** No existing element is being removed; we wrap the inner div with an `<a>`. New views are *additions* alongside (never replacing) existing global and per-workflow lists.

## 5. Clarifications (BPE-01 Step 5)

Already resolved during pre-plan dialogue:

- **Routing strategy**: Option B — playbook-scoped URLs where they exist; add patterned `/playbooks/<pk>/<entity>/` URLs where they don't (activities, agents). *Confirmed by user.*
- **Filter syntax `playbook=current_playbook`**: superseded by the path-style scoping (cleaner, idiomatic Django, matches existing 5 entities). *Confirmed by user.*
- **Hover affordance**: yes, add subtle CSS (cursor pointer + border highlight). *Default UX assumption — confirm during review.*
- **Whole-tile clickable**: yes, the entire card is the click target (better Fitts' law than just the number). *Default UX assumption — confirm during review.*

No outstanding questions. If any of the two assumptions above are wrong, please flag during plan approval.

## 6. Implementation Plan (BPE-01 Step 6)

### 6.0 Initial setup

- [x] **Re-read rules** before starting (BPE-01 Step 7):
  - [`do-test-first.mdc`](../../.cursor/rules/do-test-first.mdc)
  - [`do-not-mock-in-integration-tests.mdc`](../../.cursor/rules/do-not-mock-in-integration-tests.mdc)
  - [`do-write-concise-methods.mdc`](../../.cursor/rules/do-write-concise-methods.mdc)
  - [`do-informative-logging.mdc`](../../.cursor/rules/do-informative-logging.mdc)
  - [`do-small-increments.mdc`](../../.cursor/rules/do-small-increments.mdc)
  - [`do-follow-commit-convention.mdc`](../../.cursor/rules/do-follow-commit-convention.mdc)
  - [`tooltips.mdc`](../../.cursor/rules/tooltips.mdc)
  - [`keep-docstrings-consistent.mdc`](../../.cursor/rules/keep-docstrings-consistent.mdc)
  - [`do-diagrams-element-by-element.mdc`](../../.cursor/rules/do-diagrams-element-by-element.mdc) — for §6.4
  - [`do-view-drawio-diagrams.mdc`](../../.cursor/rules/do-view-drawio-diagrams.mdc) — for §6.4
  - [`do-look-via-human-eye.mdc`](../../.cursor/rules/do-look-via-human-eye.mdc) — for §6.5
- [x] Create branch `feature/playbooks-view-quick-stats-clickable` from current `main` (after `git pull`).
- [x] Add the two new Gherkin scenarios (§3) to [`docs/features/act-2-playbooks/playbooks-view.feature`](../features/act-2-playbooks/playbooks-view.feature).

### 6.1 Scenario A — Activities playbook-scoped list (`activity_list_for_playbook`)

**TDD order: tests first, then service, then view, then URL, then template, then run.**

1. **Tests (red)** — create [`tests/integration/test_activity_list_for_playbook.py`](../../tests/integration/test_activity_list_for_playbook.py):
   - `test_owner_sees_only_their_playbook_activities` — fixture: 2 playbooks each with 1 workflow + 2 activities, assert response 200 contains only the target playbook's activities.
   - `test_non_owner_blocked` — different user GETs the URL, expect 404 (matches `phase_list` pattern using `get_object_or_404(Playbook, pk=…, author=user)`).
   - `test_unauthenticated_redirects_to_login` — anonymous GET expects 302 to login.
   - `test_template_used` — assert `assertTemplateUsed` for the chosen template.
   - `test_zero_activities_renders_empty_state` — playbook with no activities renders "No activities yet" copy.
   - `test_url_resolves_with_reverse` — `reverse('activity_list_for_playbook', kwargs={'playbook_pk': pk})` returns `/playbooks/<pk>/activities/`.
2. **Service** — in [`methodology/services/activity_service.py`](../../methodology/services/activity_service.py) add:
   ```python
   @staticmethod
   def list_activities_for_playbook(playbook_id, user):
       """Return user's playbook activities across all its workflows."""
       return Activity.objects.filter(
           workflow__playbook_id=playbook_id,
           workflow__playbook__author=user,
       ).select_related('workflow', 'workflow__playbook', 'phase').order_by(
           'workflow__order', 'order'
       )
   ```
   Add a unit test in [`tests/unit/test_activity_service.py`](../../tests/unit/) (create if missing) verifying ordering and user-scoping.
3. **View** — in [`methodology/activity_views.py`](../../methodology/activity_views.py):
   ```python
   @login_required
   def activity_list_for_playbook(request, playbook_pk):
       playbook = get_object_or_404(Playbook, pk=playbook_pk, author=request.user)
       activities = ActivityService.list_activities_for_playbook(playbook_pk, request.user)
       logger.info(
           "User %s viewing activities for playbook %s (count=%d)",
           request.user.username, playbook_pk, activities.count(),
       )
       return render(request, 'activities/playbook_list.html', {
           'playbook': playbook,
           'activities': activities,
           'can_edit': playbook.can_edit(request.user),
       })
   ```
   Keep ≤30 lines; no inline logic.
4. **URL** — in [`mimir/urls.py`](../../mimir/urls.py) (rationale: `activity_urls.py` is mounted under `/playbooks/<pk>/workflows/<wpk>/activities/`, can't reuse it without restructuring):
   ```python
   path("playbooks/<int:playbook_pk>/activities/",
        activity_views.activity_list_for_playbook,
        name="activity_list_for_playbook"),
   ```
5. **Template** — create [`templates/activities/playbook_list.html`](../../templates/activities/playbook_list.html). Mirror structure of `templates/skills/playbook_list.html`:
   - Breadcrumb: Playbooks → {playbook.name} → Activities
   - Header `<h2><i class="fa-solid fa-list-check"></i> Activities</h2>`
   - Table with columns Name / Workflow / Phase / Actions
   - Empty state with link back to playbook detail
   - `data-testid="activities-playbook-list"` on root container
6. **Run tests** — make red tests green. Iterate.
7. **Commit** (BPE-01 Step 6.4, Angular convention):
   ```
   feat(activities): add playbook-scoped activity list at /playbooks/<pk>/activities/

   Adds activity_list_for_playbook view, ActivityService.list_activities_for_playbook,
   URL pattern, and templates/activities/playbook_list.html. Used as drill-down target
   from the playbook detail Quick Stats tile.

   Refs FOB-PLAYBOOKS-VIEW_PLAYBOOK-25/26
   ```

### 6.2 Scenario B — Agents playbook-scoped list (`agent_list_for_playbook`)

Mirrors §6.1.

1. **Tests (red)** — create [`tests/integration/test_agent_list_for_playbook.py`](../../tests/integration/test_agent_list_for_playbook.py) with the same six tests as §6.1.1, swapping Activity→Agent.
2. **Service** — `AgentService.list_agents_for_playbook(playbook_id)` already exists ([`methodology/services/agent_service.py:78`](../../methodology/services/agent_service.py)). Verify it user-scopes correctly; if not, add a `user` param and unit test.
3. **View** — in [`methodology/agent_views.py`](../../methodology/agent_views.py):
   ```python
   @login_required
   def agent_list_for_playbook(request, playbook_pk):
       playbook = get_object_or_404(Playbook, pk=playbook_pk, author=request.user)
       agents = AgentService.list_agents_for_playbook(playbook_pk)
       logger.info(
           "User %s viewing agents for playbook %s (count=%d)",
           request.user.username, playbook_pk, agents.count(),
       )
       return render(request, 'agents/playbook_list.html', {
           'playbook': playbook,
           'agents': agents,
           'can_edit': playbook.can_edit(request.user),
       })
   ```
4. **URL** — in [`mimir/urls.py`](../../mimir/urls.py):
   ```python
   path("playbooks/<int:playbook_pk>/agents/",
        agent_views.agent_list_for_playbook,
        name="agent_list_for_playbook"),
   ```
5. **Template** — create [`templates/agents/playbook_list.html`](../../templates/agents/playbook_list.html) (mirror structure of `templates/agents/list.html` but with playbook breadcrumb and no playbook column). `data-testid="agents-playbook-list"`.
6. **Run tests** — green.
7. **Commit**:
   ```
   feat(agents): add playbook-scoped agent list at /playbooks/<pk>/agents/

   Adds agent_list_for_playbook view, URL pattern, and
   templates/agents/playbook_list.html. Used as drill-down target from the playbook
   detail Quick Stats tile.

   Refs FOB-PLAYBOOKS-VIEW_PLAYBOOK-25/26
   ```

### 6.3 Scenario C — Frontend: make Quick Stats tiles clickable

1. **Tests (red)** — create [`tests/integration/test_playbook_view_quick_stats_clickable.py`](../../tests/integration/test_playbook_view_quick_stats_clickable.py). Parametrised test for each of the 7 tiles:
   - Asserts the response contains an `<a>` inside `data-testid="stat-<entity>"` whose `href` equals `reverse(<url_name>, kwargs={...})`.
   - Smoke-asserts GET on the resolved URL returns 200 for the owner (this transitively re-validates §6.1 and §6.2 from the user's clicked perspective).
   - Asserts each anchor has `data-testid="stat-<entity>-link"` for stable hooks.

   ```python
   STAT_LINKS = [
       ("workflows",  "workflow_list",                 {"playbook_pk": "pk"}),
       ("phases",     "phase_list",                    {"playbook_pk": "pk"}),
       ("activities", "activity_list_for_playbook",    {"playbook_pk": "pk"}),
       ("artifacts",  "artifact_list",                 {"playbook_id": "pk"}),
       ("agents",     "agent_list_for_playbook",       {"playbook_pk": "pk"}),
       ("skills",     "skill_list",                    {"playbook_pk": "pk"}),
       ("rules",      "rule_list",                     {"playbook_pk": "pk"}),
   ]
   ```

2. **Template edit** — in [`templates/playbooks/detail.html`](../../templates/playbooks/detail.html) lines 257–308, wrap each tile's inner `<div class="p-3 border rounded">…</div>` with an `<a>`:
   ```html
   <div class="col-md-4 mb-3" data-testid="stat-workflows">
       <a href="{% url 'workflow_list' playbook.pk %}"
          class="d-block text-decoration-none text-reset p-3 border rounded h-100 quick-stat-link"
          data-testid="stat-workflows-link"
          data-bs-toggle="tooltip"
          title="View workflows in this playbook">
           <i class="fa-solid fa-diagram-project fa-2x text-primary mb-2"></i>
           <h3 class="mb-0">{{ quick_stats.workflows }}</h3>
           <small class="text-muted">Workflows</small>
       </a>
   </div>
   ```
   Repeat with the URL bindings in the table from §4.1 / §6.1 / §6.2. **Watch the artifact kwarg name** (`playbook_id`, not `playbook_pk`).

3. **CSS** — add a small style block (or extend the existing one) in `detail.html`:
   ```css
   .quick-stat-link { transition: border-color .15s, transform .05s; cursor: pointer; }
   .quick-stat-link:hover, .quick-stat-link:focus { border-color: var(--bs-primary) !important; }
   .quick-stat-link:active { transform: translateY(1px); }
   ```

4. **Run tests** — green for the new test file *and* the existing icons test in [`tests/integration/test_playbook_view_quick_stats_icons.py`](../../tests/integration/test_playbook_view_quick_stats_icons.py). Adjust the icons test's regex only if `<a>` insertion breaks the greedy match (per §4.4).

5. **Commit**:
   ```
   feat(playbooks): make Quick Stats tiles clickable drill-downs

   Wraps each of the 7 Quick Stats tiles on the playbook detail page with an
   anchor pointing to the playbook-scoped list URL for that entity. Adds a
   subtle hover affordance and tooltip per .cursor/rules/tooltips.mdc.

   Closes FOB-PLAYBOOKS-VIEW_PLAYBOOK-25, FOB-PLAYBOOKS-VIEW_PLAYBOOK-26
   ```

### 6.4 Scenario D — Update Screen Flow diagram

Per [`do-diagrams-element-by-element.mdc`](../../.cursor/rules/do-diagrams-element-by-element.mdc) (one edit at a time, save between each) and [`do-view-drawio-diagrams.mdc`](../../.cursor/rules/do-view-drawio-diagrams.mdc) (export to PNG/SVG for visual verification).

**Target file**: [`docs/ux/2_dialogue-maps/screen-flow.drawio`](../ux/2_dialogue-maps/screen-flow.drawio)
**Target diagram**: `MVP Flow - Local FOB` (id `mvp-flow-v2`, lines 348–1329)
**Source node** (already exists): `v2-fob-playbooks-view` ("FOB-PLAYBOOKS-VIEW_PLAYBOOK")

**Existing target nodes to wire as Quick-Stats drill-downs:**

| Tile | Target cell id (existing) | Verified at line |
|---|---|---|
| Workflows | `v2-fob-workflows-list` | 660 |
| Phases | `v2-fob-phases-list` | 777 |
| Activities | `v2-fob-activities-list` | 861 |
| Artifacts | `v2-fob-artifacts-list` | 930 |
| Agents | `v2-fob-agents-list` | 1044 |
| Skills | `v2-fob-skills-list` | 987 |

**Missing target node — must add first:**

- Rules: there is no `v2-fob-rules-list` cell in the diagram. Before wiring the edge, add a new vertex cell:
  - **id**: `v2-fob-rules-list`
  - **value**: `FOB-RULES-\nLIST+FIND`
  - **style**: same as other entity list nodes (`rounded=0;whiteSpace=wrap;html=1;fillColor=#4682B4;strokeColor=#22c55e;fontSize=9;fontColor=#ffffff;strokeWidth=3;`) — match implementation status colour with the other live entities.
  - **placement**: in the bottom band of the MVP diagram next to skills/agents (positions to be picked when editing in draw.io app).

**Edges to add (7 total, all from `v2-fob-playbooks-view`):**

For each of the 7 target nodes above, insert one `<mxCell ... edge="1">` with:

- **id**: `v2-arrow-pb-stats-<entity>` (e.g. `v2-arrow-pb-stats-workflows`)
- **value** (edge label): `[Quick Stats]`
- **style**: `edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;strokeColor=#4682B4;fontSize=9;` (matches the existing `[Select]`/`[Edit]` blue arrows from the same source — see line 577).
- **source**: `v2-fob-playbooks-view`
- **target**: `v2-fob-<entity>-list`

**Editing procedure (per `do-diagrams-element-by-element.mdc`):**

1. Open the .drawio file in the draw.io app (`/Applications/draw.io.app`).
2. Switch to the `MVP Flow - Local FOB` tab.
3. Add the new `v2-fob-rules-list` vertex; **save**.
4. Add the 7 new edges one-by-one; **save after each**.
5. Export the updated diagram to PNG for review:
   ```bash
   /Applications/draw.io.app/Contents/MacOS/draw.io -x -f png \
     -p 2 \
     -o docs/ux/2_dialogue-maps/screen-flow-mvp-fob.png \
     docs/ux/2_dialogue-maps/screen-flow.drawio
   ```
   (use `-p 2` to select the third tab — `MVP Flow - Local FOB` — index 2; verify with the file's diagram order.)
6. Open the PNG (or `Read` it as an image) to visually confirm the 7 new arrows fan out from the playbook-view node to each of the 7 list nodes without overlapping existing edges (per [`do-look-via-human-eye.mdc`](../../.cursor/rules/do-look-via-human-eye.mdc)).
7. **No automated test** for the diagram — visual review is the gate.

**Commit:**

```
docs(ux): wire Quick Stats tiles in MVP Flow screen-flow diagram

Adds FOB-RULES-LIST+FIND vertex (was missing) and 7 [Quick Stats] edges from
FOB-PLAYBOOKS-VIEW_PLAYBOOK to each entity list screen, reflecting the new
clickable Quick Stats drill-down behaviour on the playbook detail page.

Refs FOB-PLAYBOOKS-VIEW_PLAYBOOK-25/26
```

### 6.5 Final verification

- [x] `pytest tests/integration/test_playbook_view_quick_stats_clickable.py tests/integration/test_playbook_view_quick_stats_icons.py tests/integration/test_playbook_view_phase1.py tests/integration/test_activity_list_for_playbook.py tests/integration/test_agent_list_for_playbook.py -v`
- [x] Full suite: `pytest -x` — no regressions.
- [x] Manually click each tile in the running app to confirm visual correctness (per [`do-look-via-human-eye.mdc`](../../.cursor/rules/do-look-via-human-eye.mdc)).
- [x] Re-open the exported `screen-flow-mvp-fob.png` to confirm the 7 new arrows + the new Rules node render correctly.

## 7. Tests Inventory (BPE-01 Step 6.3)

### Unit (in `tests/unit/`)

| Test | Validates |
|---|---|
| `test_activity_service.py::test_list_activities_for_playbook_returns_only_user_owned` | service user-scopes |
| `test_activity_service.py::test_list_activities_for_playbook_orders_by_workflow_then_activity` | service ordering |
| `test_agent_service.py::test_list_agents_for_playbook_user_scoped` (add only if not already covered) | service user-scopes |

### Integration (in `tests/integration/`, **NO MOCKING**, real DB)

| Test file | Tests |
|---|---|
| `test_activity_list_for_playbook.py` | 6 tests per §6.1.1 |
| `test_agent_list_for_playbook.py` | 6 tests per §6.2.1 |
| `test_playbook_view_quick_stats_clickable.py` | 1 parametrised test × 7 tiles (= 7 cases) for link presence + 1 parametrised test × 7 tiles for destination 200 = 14 cases total |

### Existing tests to keep green

| File | Why |
|---|---|
| `tests/integration/test_playbook_view_quick_stats_icons.py` | icon regex must still match |
| `tests/integration/test_playbook_view_phase1.py::test_pb_view_03_overview_tab_default` | counts still rendered |

## 8. GitHub Issue (BPE-01 Step 10)

After plan approval, open issue:

- **Title**: `[FOB-PLAYBOOKS-VIEW_PLAYBOOK-25/26] Make Quick Stats tiles clickable drill-downs`
- **Labels**: `Feature`, `easy`
- **Body**: paste §3 (Gherkin) + §6 (Implementation Plan) + link back to this file.

## 9. Out of Scope

- Server-side filter on global list pages via `?playbook=<pk>` query param (replaced by path-style scoping).
- New search/filter UI on destination pages (existing `?q=` is preserved on the global pages, but the scoped pages don't need it for v1).
- Changes to existing 5 already-scoped list views (workflow/phase/skill/rule/artifact) — link only.
- Visual restyle of the Quick Stats card beyond the hover affordance.

## 10. Success Criteria (BPE-01)

- All 6 + 6 + 14 = 26 new test cases pass.
- Existing icons + phase-1 tests still pass.
- Both new URLs resolve and render templates with playbook-scoped data only.
- Each of the 7 tiles is wrapped in an anchor pointing to the correct playbook-scoped URL.
- Hover affordance visible; tooltip present per `tooltips.mdc`.
- `MVP Flow - Local FOB` diagram in [`screen-flow.drawio`](../ux/2_dialogue-maps/screen-flow.drawio) shows the new `FOB-RULES-LIST+FIND` node and 7 `[Quick Stats]` arrows from `FOB-PLAYBOOKS-VIEW_PLAYBOOK` to each entity list screen; exported PNG visually verified.
- Four Angular-convention commits land on `feature/playbooks-view-quick-stats-clickable` (one per scenario A/B/C/D).
- Plan approved by user before implementation begins.

---

## BPE-07 Finalization (2026-04-30)

| Check | Result |
| --- | --- |
| Full test suite (`pytest`, testpaths `tests/`) | 725 passed, 4 skipped (known skips), 0 failed |
| E2E (`pytest tests/e2e` with default `addopts` overridden) | 7 passed |
| New `requirements.txt` entries | None (no new packages) |
| `screen-flow.drawio` MVP tab | `v2-fob-rules-list` + 7× `[Quick Stats]` edges; playbook view / list rows use green completion stroke per legend |
| Playwright E2E for Quick Stats drill-down | **Not present** — covered by integration tests (`test_playbook_view_quick_stats_clickable.py`); add E2E only if product wants browser journey |
