docs(phase-36): complete phase execution, review, and verification

This commit is contained in:
Jakub Zych
2026-11-24 22:15:41 +01:00
parent a219d4d850
commit 0b7e139d18
6 changed files with 280 additions and 21 deletions

View File

@@ -1918,7 +1918,7 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5 → 6 → 7 → 8 →
| 33. SEO output, audit and content | 16/16 | In Progress| |
| 34. Plugin marketplace | 6/6 | In Progress| |
| 35. Mail templates and layouts editor | 9/9 | Complete | 2026-11-14 |
| 36. Granular MCP OAuth & API token scope picker | 0/4 | Planned | - |
| 36. Granular MCP OAuth & API token scope picker | 4/4 | Complete | 2026-11-24 |
## Backlog
@@ -2017,13 +2017,13 @@ Plans:
Plans:
**Wave 1**
- [ ] 36-01-PLAN.md — Go backend scope metadata (`pact.TokenScope.Group`, `cabana.AdminAPITokenScope` `plugin_id`/`group` + D-16 fallback), `cabana.TokenScopeCovers` + `pier.Mount` boot warning, EN/PL phrasebooks, OpenAPI/TS regen, READMEs & docs
- [x] 36-01-PLAN.md — Go backend scope metadata (`pact.TokenScope.Group`, `cabana.AdminAPITokenScope` `plugin_id`/`group` + D-16 fallback), `cabana.TokenScopeCovers` + `pier.Mount` boot warning, EN/PL phrasebooks, OpenAPI/TS regen, READMEs & docs
**Wave 2** *(blocked on Wave 1 completion)*
- [ ] 36-02-PLAN.md — Shared 3-tier access selector & `ScopePicker` on `ConnectView.vue` (light-literal modal) and `ApiTokenCreateDialog.vue` (fixed-width in-dialog swap), rebuilt `modules/boardwalk/dist`
- [x] 36-02-PLAN.md — Shared 3-tier access selector & `ScopePicker` on `ConnectView.vue` (light-literal modal) and `ApiTokenCreateDialog.vue` (fixed-width in-dialog swap), rebuilt `modules/boardwalk/dist`
**Wave 3** *(blocked on Wave 2 completion)*
- [ ] 36-03-PLAN.md — Core plugin `pact.HasTokenScopes` rollout in `sm-sitemap-plugin` (`sitemap`/`sitemap:read`) and `sm-seo-plugin` (`seo`/`seo:read`) with EN/PL copy, READMEs, and tests
- [x] 36-03-PLAN.md — Core plugin `pact.HasTokenScopes` rollout in `sm-sitemap-plugin` (`sitemap`/`sitemap:read`) and `sm-seo-plugin` (`seo`/`seo:read`) with EN/PL copy, READMEs, and tests
**Wave 4** *(blocked on Wave 3 completion)*
- [ ] 36-04-PLAN.md — Comprehensive Go & Vitest unit/component suites (closing all 7 UI-SPEC backstops), full release gates, human release-tag checkpoint, and `sm-grzybyfunkcjonalne-app` local E2E proof
- [x] 36-04-PLAN.md — Comprehensive Go & Vitest unit/component suites (closing all 7 UI-SPEC backstops), full release gates, human release-tag checkpoint, and `sm-grzybyfunkcjonalne-app` local E2E proof

View File

@@ -3,17 +3,17 @@ gsd_state_version: "1.0"
milestone: v1.0
current_phase: 36
current_phase_name: granular-mcp-oauth-api-token-scope-picker
status: executing
stopped_at: Phase 36 context gathered
last_updated: "2026-11-24T17:54:17.146Z"
last_activity: 2026-11-21
last_activity_desc: Phase 32.2 complete, transitioned to Phase 19.3
state_head: 4c078005c0ef71c191dde752c5082981bb843f64
status: complete
stopped_at: Phase 36 complete
last_updated: "2026-11-24T21:15:00.000Z"
last_activity: 2026-11-24
last_activity_desc: Phase 36 complete (v0.6.8, sm-sitemap-plugin v0.2.1, sm-seo-plugin v0.2.1)
state_head: a219d4d8
progress:
total_phases: 54
completed_phases: 38
completed_phases: 39
total_plans: 313
completed_plans: 298
completed_plans: 302
msd_state_version: "1.0"
milestone_name: milestone
---
@@ -29,10 +29,10 @@ See: .planning/PROJECT.md (updated 2026-11-21)
## Current Position
Phase: 36 (granular-mcp-oauth-api-token-scope-picker) — READY TO EXECUTE
Plan: Not started
Status: Ready to execute
Last activity: 2026-11-21 — Phase 32.2 complete, transitioned to Phase 19.3
Phase: 36 (granular-mcp-oauth-api-token-scope-picker) — COMPLETE
Plan: 4/4 complete
Status: Complete
Last activity: 2026-11-24 — Phase 36 complete (v0.6.8, sm-sitemap-plugin v0.2.1, sm-seo-plugin v0.2.1)
Progress: [████████░░] 77%
@@ -70,6 +70,7 @@ Progress: [████████░░] 77%
| 19.6.1 | 5 | - | - |
| 35 | 9 | - | - |
| 32.2 | 5 | - | - |
| 36 | 4 | - | - |
**Recent Trend:**

View File

@@ -0,0 +1,36 @@
---
phase: 36
review: 36-REVIEW.md
titles: json
findings:
- id: WR-01
severity: warning
disposition: open
title: "Missing request sequence guard in `ApiTokenCreateDialog.vue` `loadScopes()`"
- id: IN-01
severity: info
disposition: open
title: "`warnUncoveredBackendWriteTools` recompiles the plugin token scope catalog once per backend write tool when `cabana` is not activated on `app`"
- id: IN-02
severity: info
disposition: open
title: "Accordion header toggle buttons appear interactive during search even though clicking is a no-op"
- id: IN-03
severity: info
disposition: open
title: "Static DOM `panelId` and mount-only `expanded` initialization in `ScopePicker.vue`"
open: 4
total: 4
recorded: "2026-11-24"
---
# Phase 36: Code Review Disposition
| Finding | Severity | Disposition | Source |
|---------|----------|-------------|--------|
| WR-01 | warning | open | - |
| IN-01 | info | open | - |
| IN-02 | info | open | - |
| IN-03 | info | open | - |
Dispositions: `open` (recorded, not yet triaged), `fixed`, `skipped`, `deferred`.

View File

@@ -0,0 +1,99 @@
---
phase: 36
status: reviewed
depth: standard
findings:
critical: 0
warning: 1
info: 3
reviewed_at: "2026-11-24"
---
# Phase 36: Code Review Report
**Phase:** `36-granular-mcp-oauth-api-token-scope-picker`
**Reviewed:** 2026-11-24
**Depth:** standard
**Scope:** Framework diff `7644786d..2661e0f3` (`modules/pact`, `modules/cabana`, `modules/pier`, `modules/phrasebook`, `admin/src/`, `docs/`), sibling plugin scope declarations (`../sm-sitemap-plugin/token_scopes.go`, `../sm-seo-plugin/token_scopes.go` + EN/PL phrasebooks and tests), and `../sm-grzybyfunkcjonalne-app/scripts/smoke-mcp-oauth.sh`.
**Status:** reviewed (`0` critical, `1` warning, `3` info)
## Summary
Phase 36 is clean on security, privilege boundaries, XSS safety, and contract compliance. All ten STRIDE threats (`T-36-01`..`T-36-10`) and every plan prohibition from `36-01-PLAN.md`..`36-04-PLAN.md` hold up under code inspection:
- **Backend scope metadata & validation (`T-36-01`, `T-36-03`):** `pact.TokenScope.Group` is additive while `pact.ValidTokenScopeName` / `tokenScopeNameRE` remain untouched (D-01, D-05, D-14). `validateTokenScopeMessageKeys` fails boot on missing `::` phrase keys in `Group`. `cabana.AdminAPITokenScope` emits always-present `plugin_id` and `group` strings (no `omitempty`), strictly empty for `*`, `admin:read`, and unknown stored scopes; `resolveScopeGroup` follows the exact D-16 fallback order with deterministic `reg.permissionOrder` iteration.
- **Boot-time uncovered write MCP tool warning (`T-36-02`):** `cabana.TokenScopeCovers` excludes `*`, delegates to `scopeCoversAll` (returning `false` for empty `permissions` on write methods, matching runtime `allowsUnderScope`), and `pier.Mount` emits one sorted structured `Warn` per plugin without failing boot (D-18).
- **Admin SPA scope picker & `admin:read` PII footgun fix (`T-36-04`, `T-36-05`, `T-36-06`):** Both `ConnectView.vue` and `ApiTokenCreateDialog.vue` default to `Read-only (admin:read)` when grantable (D-03, D-08). Custom mode defaults `adminRead` to `false` and `computeSubmittedScopes` omits `admin:read` unless explicitly opted in; toggling ON locks `read_only` rows with a `Lock` icon + `via admin:read` badge, disables per-group `Read`, makes `Clear` selective on unlocked scopes, and restores prior `:read` ticks if toggled back OFF (D-04, D-17). Zero `v-html` exists across the new and modified Vue files. All Phase 32.2 `ConnectView` invariants (`safeDestination`, `FORBIDDEN_PROTOCOLS`, `window.location.assign`, no auto-allow, no auto-focus/hotkeys on Allow/Deny) are preserved. `.connect-light-surface` is defined in `admin/src/styles/main.css` `@layer components` pinning both `--c-*` and `--color-*` aliases on card and portaled modal (D-12). `ApiTokenCreateDialog.vue` keeps a single `DialogOverlay` at fixed `max-w-[560px]`, unmounts the `mod+s mod+enter` submit button in picker view, and intercepts `Escape` to discard the draft without closing the dialog or losing `name`/`expires` (D-13). `ApiTokensPanel.vue` is untouched.
- **Sibling plugins & E2E smoke script (`T-36-07`, `T-36-08`, `T-36-09`, `T-36-10`):** `sm-sitemap-plugin/token_scopes.go` and `sm-seo-plugin/token_scopes.go` strictly scope permissions to `golem15.sitemap.*` and `golem15.seo.*`, restrict `:read` scopes to `GET`/`HEAD`, define all EN/PL phrase keys, and cover 100% of backend write MCP tools with zero `pier.Mount` warnings. `smoke-mcp-oauth.sh` uses `umask 077`, passes secrets only via env/0600 files (never CLI arguments or logs), verifies grouped scopes and zero boot warnings, and cleans up temp files on `EXIT`. No consuming application name appears in framework code or `docs/`.
One non-blocking **Warning** (async stale-response race in `ApiTokenCreateDialog.vue`'s `loadScopes()`) and three **Info** items were found.
## Critical Issues
None.
## Warnings
### WR-01: Missing request sequence guard in `ApiTokenCreateDialog.vue` `loadScopes()`
**File:** `admin/src/components/account/ApiTokenCreateDialog.vue:141-175`
**Issue:** Unlike `ConnectView.vue` (which guards `load()` with `let loadSeq = 0; const seq = ++loadSeq` at lines 56 and 143), `ApiTokenCreateDialog.vue`'s `loadScopes()` does not track a request sequence number or check `props.open` when `api.GET('/account/tokens/scopes')` settles:
```ts
async function loadScopes(): Promise<void> {
scopesLoading.value = true
scopesFailed.value = false
scopes.value = []
resetScopeSelection([])
try {
const result = await api.GET('/account/tokens/scopes')
if (result.data) {
const list = result.data.data ?? []
scopes.value = list
resetScopeSelection(list)
scopesFailed.value = list.length === 0
return
}
scopesFailed.value = true
} catch {
scopesFailed.value = true
} finally {
scopesLoading.value = false
}
}
```
If the administrator opens the dialog, closes it while `/account/tokens/scopes` is still in flight, and immediately re-opens it:
1. When request #1 resolves/rejects first, its `finally` clears `scopesLoading.value = false` while request #2 is still running.
2. If request #1 resolves *after* request #2 (e.g., after the user has already switched to `Custom` and opened `ScopePicker`), request #1 calls `resetScopeSelection(list)`, closing the picker and silently resetting the user's tier/draft back to `Read-only (admin:read)`.
3. If the dialog stays closed while request #1 resolves, `scopes.value` and tier state are repopulated in the background after the close watcher already reset them.
**Fix:** Mirror `ConnectView.vue`'s sequence guard: add `let loadSeq = 0`, capture `const seq = ++loadSeq` at the top of `loadScopes()`, increment `loadSeq++` in the `watch(() => props.open)` close branch, and ignore stale responses (including skipping `scopesLoading.value = false` in `finally`) whenever `seq !== loadSeq || !props.open`.
## Info
### IN-01: `warnUncoveredBackendWriteTools` recompiles the plugin token scope catalog once per backend write tool when `cabana` is not activated on `app`
**File:** `modules/pier/uncovered_scopes_warning.go:22-31`, `modules/cabana/token_scopes_export.go:67-83`
**Issue:** In normal server boot (`surf`), `cabana.Activate` runs before `pier.Mount`, so `publishedResolverGuard(app)` returns the cached `guard.reg.tokenScopes` in O(1). However, when `pier.Mount` is called without an activated `cabana` guard (such as standalone tests or custom hosts), `tokenScopeCatalogFor(app, plugins)` invokes `compileTokenCatalog(plugins)` inside the loop once for every backend write tool in `cat.tools`. In addition, if `compileTokenCatalog(plugins)` returns an error in that fallback path, `tokenScopeCatalogFor` silently returns `nil` and `TokenScopeCovers` returns `false`, causing `pier` to emit `"not covered by any non-* TokenScope"` warnings for every plugin instead of noting a catalog compile error (though `cabana.Activate` still fails boot separately).
**Fix:** Optional optimization: resolve or compile the scope catalog once before iterating `cat.tools` (or expose an internal/batch helper if needed). No change required for standard `surf` boot.
### IN-02: Accordion header toggle buttons appear interactive during search even though clicking is a no-op
**File:** `admin/src/components/scopes/ScopePicker.vue:188-199`, `admin/src/components/scopes/ScopePicker.vue:395-418`
**Issue:** Per D-07, all matching groups auto-expand while `isSearching` is `true` without mutating the saved `expanded` set. In `ScopePicker.vue`, `toggleGroup` returns early when `isSearching.value` is `true`, while the `<button data-scope-group-toggle :aria-expanded="isGroupExpanded(group.key)">` element remains enabled with no `disabled` / `aria-disabled` attribute. Clicking a group header during a search produces no visual or state change.
**Fix:** Either allow a temporary search-collapse override (cleared when `query` clears so pre-search expansion still restores cleanly) or set `:disabled="isSearching"` / `:aria-disabled="isSearching ? 'true' : undefined"` on the toggle button so assistive technology and pointer styling reflect that groups stay expanded during search.
### IN-03: Static DOM `panelId` and mount-only `expanded` initialization in `ScopePicker.vue`
**File:** `admin/src/components/scopes/ScopePicker.vue:126`, `admin/src/components/scopes/ScopePicker.vue:265-272`
**Issue:**
1. Each group panel ID is generated as `` `scope-group-panel-${index}` `` without a component-instance prefix (e.g. Vue's `useId()`). This is safe today because only one `ScopePicker` mounts at a time across `ConnectView` and `ApiTokenCreateDialog`, but would cause duplicate `id` / `aria-controls` collisions if two pickers ever coexist on a page.
2. `expanded.value = computeDefaultExpanded(...)` runs only in `onMounted()`. Both current hosts unmount `ScopePicker` when closed (`DialogContent` portal unmount in `ConnectView`, `v-if="step === 1 && pickerOpen"` in `ApiTokenCreateDialog`) and only open it after `catalog` has loaded, so this works reliably today; if reused later with a lazily populated `catalog` or `v-show`, `expanded` would remain empty.
**Fix:** Use Vue's `useId()` prefix for `panelId`, and optionally watch `() => props.catalog` (or `allGroups.value.length` transitioning from `0` to `> 0`) if `ScopePicker` is ever reused outside modal/view-swap hosts.
---
_Reviewed: 2026-11-24_
_Reviewer: msd-code-reviewer_
_Depth: standard_

View File

@@ -0,0 +1,123 @@
---
phase: 36-granular-mcp-oauth-api-token-scope-picker
status: passed
score: 5/5
must_haves_score: 45/45
verified_at: "2026-11-24"
---
# Phase 36 Verification Report — Granular MCP OAuth & API Token Scope Picker
**Verdict:** `passed` — **5/5** ROADMAP Success Criteria, **45/45** plan `must_have` truths, **23/23** artifacts, **11/11** key links, and **16/16** prohibitions verified directly against on-disk source, tests, OpenAPI/TS schemas, phrasebooks, docs, and sibling repositories.
---
## 1. ROADMAP Success Criteria (5/5)
| # | Success Criterion | Status | Evidence (Verified on Disk) |
|---|-------------------|--------|-----------------------------|
| SC-1 | `pact.TokenScope` accepts an optional `Group` field (phrase key or literal, validated when containing `::`) and `cabana.AdminAPITokenScope` additively exposes `plugin_id` and resolved `group` (falling back to plugin name / permission tab / `plugin_id`); `ValidTokenScopeName` stays unchanged and existing plugins without `Group` keep working. | **PASS** | `modules/pact/capabilities.go:867-874` adds `Group string` while `git diff cb259ba9~1..HEAD -- modules/pact/capabilities.go` confirms `tokenScopeNameRE` / `ValidTokenScopeName` untouched. `modules/cabana/token_scopes.go:26,94,171-175` stores `strings.TrimSpace(scope.Group)` and validates `::` keys in `validateTokenScopeMessageKeys`. `modules/cabana/account_tokens.go:21-22,267-372` emits non-`omitempty` `plugin_id`/`group` and implements exact D-16 3-step `resolveScopeGroup` (`Group` -> `<pluginID>::lang.plugin.name` -> unanimous matched `Tab` via `reg.permissionOrder` -> raw `PluginID`; `""` for framework/unknown scopes), wired across `/account/tokens/scopes`, `/account/tokens`, and `modules/cabana/mcp_consent.go:147`. |
| SC-2 | Booting an app where a plugin registers backend non-read-only `MCPTool`s not covered by any non-`*` `TokenScope` logs a clear warning identifying the plugin and uncovered tools, without breaking boot. | **PASS** | `modules/cabana/token_scopes_export.go:67-114` exports `TokenScopeCovers(app, plugins, method, permissions)` excluding `*` and returning `false` on empty permissions for write methods. `modules/pier/uncovered_scopes_warning.go:16-46` filters `t.guardName == BackendGuard` and non-`GET`/`HEAD`, groups sorted uncovered tools per plugin, and emits one structured `logger().Warn(...)` with `"plugin"` and `"tools"`. Wired in `modules/pier/pier.go:116` immediately after `compileCatalog` with no error return path. |
| SC-3 | `ConnectView.vue` keeps its `480px` summary card with 3-tier access selection (**Full `*`** \| **Read-only `admin:read`** \| **Custom**), defaults to `Read-only (admin:read)` when requested and grantable, shows effective-access chips, and opens a dedicated **Customize scopes** modal with search, `All / Selected / Read-only` filters, collapsible plugin/group accordions, per-group quick actions (`Read` / `All` / `Clear`), and an opt-in `admin:read` toggle that visibly locks all `:read` rows (`via admin:read`). | **PASS** | `admin/src/views/ConnectView.vue:39,67-81,393,526-537,603-645` retains `max-w-[480px]` light-literal card with `.connect-light-surface`, wires `useScopeSelection(scopes, 'connect')` (defaulting to `read_only`), renders `<ScopeAccessControl>` (elevated-first chips capped at 6 + `+N more`), and mounts a Reka `Dialog` Customize modal (`h-[100dvh]` mobile / `sm:max-w-[640px] sm:max-h-[85dvh]` desktop, `.connect-light-surface` on both `DialogOverlay` and `DialogContent`) hosting `<ScopePicker>` (`admin/src/components/scopes/ScopePicker.vue`) with search, live-count filter pills, flat `(plugin_id, group)` accordions, `Read`/`All`/`Clear`, and opt-in `admin:read` toggle locking every `read_only` row with `Lock` + `data-via-admin-read`. |
| SC-4 | `ApiTokenCreateDialog.vue` reuses the same shared `ScopePicker` via an in-dialog view swap (`← Back` / `Apply scopes`, no nested modal overlay) with dark-mode-aware tokens. | **PASS** | `admin/src/components/account/ApiTokenCreateDialog.vue:71-85,374-388,402-456,581-593` uses `useScopeSelection(scopes, 'token')` (defaulting to `Read-only (admin:read)`, falling back to `Full (*)`), swaps in place (`v-if="step === 1 && pickerOpen"`) inside a single `<DialogOverlay>` (`grep -c` = `1`) at fixed `max-w-[560px]` using semantic tokens (`bg-surface`, `bg-subtle`, `border-border`, `text-text`), intercepts `Escape` in `onEscapeKey` to discard draft and return to the token form preserving `name` and `expires`, and unmounts the `hotkey="mod+s mod+enter"` submit button while in picker view. |
| SC-5 | OpenAPI schema, embedded `boardwalk/dist`, en/pl phrasebook copy, Go unit tests, and Vitest coverage for both `ConnectView` and `ApiTokenCreateDialog` pass green. | **PASS** | `admin/openapi/admin.json` and `admin/src/api/schema.d.ts` both require `group: string` and `plugin_id: string` on `cabana.AdminAPITokenScope`. `modules/phrasebook/backend/lang/{en,pl}/lang.yaml` define all 44 `api_tokens.*` keys (including EN/PL CLDR plural maps `scope_count`, `scope_write_count`, `scope_plugin_count` with PL locative) and 2 `mcp_connect.*` keys. All Go tests (`go vet ./...`, `go test ./...`), OpenAPI/dist/docs checks, Vitest suites (all 7 UI-SPEC backstops), sibling plugin tests, and local 12-step `smoke-mcp-oauth.sh` passed green with zero subsequent code edits. |
---
## 2. Plan Must-Haves Verification (Plans 36-01 through 36-04)
### Plan 36-01 — Backend Scope Metadata, Coverage Warning, Phrasebook & OpenAPI (7/7 Truths)
| Must-Have | Status | Evidence |
|-----------|--------|----------|
| `pact.TokenScope.Group` optional; `ValidTokenScopeName` unchanged; no auto-generation at boot (D-01, D-05, D-14) | **PASS** | `modules/pact/capabilities.go:867-874`; diff touches only `TokenScope` doc comment and `Group string`. |
| `compiledTokenScope.Group` + `validateTokenScopeMessageKeys` fails boot on missing `::` key (D-14) | **PASS** | `modules/cabana/token_scopes.go:26,94,171-175`; tested in `TestTokenScopeGroupValidation`. |
| `cabana.AdminAPITokenScope` emits always-present `plugin_id` & `group` (no `omitempty`), `""` for framework/unknown scopes across all 3 endpoints (D-15) | **PASS** | `modules/cabana/account_tokens.go:15-23,186,270-273`, `modules/cabana/mcp_consent.go:147`; raw JSON wire keys asserted in `account_tokens_test.go` and `mcp_admin_consent_test.go`. |
| Deterministic D-16 3-step fallback (`<pluginID>::lang.plugin.name` -> unanimous matched `Tab` via `reg.permissionOrder` -> raw `PluginID`) | **PASS** | `modules/cabana/account_tokens.go:306-372`; all 5 branches + framework/unknown verified in `TestScopeGroupFallbackResolution`. |
| `cabana.TokenScopeCovers` + `pier.Mount` one structured `Warn` per plugin without breaking boot (D-18) | **PASS** | `modules/cabana/token_scopes_export.go:91-114`, `modules/pier/uncovered_scopes_warning.go:16-46`, `modules/pier/pier.go:116`; verified in `TestTokenScopeCovers` and `TestUncoveredBackendWriteToolsWarning`. |
| EN/PL phrasebooks define all 44 `api_tokens.*` keys (incl. 3 CLDR plurals) + 2 `mcp_connect.*` keys | **PASS** | Verified programmatically via YAML parse: 0 missing keys in both `en/lang.yaml` and `pl/lang.yaml`; PL `scope_plugin_count` uses locative forms (`wtyczce`/`wtyczkach`/`wtyczki`). |
| OpenAPI/TS schema, READMEs (`pact`, `cabana`, `pier`), and `docs/` (`users-and-permissions.md`, `mcp.md`) updated & verified | **PASS** | Verified in `admin/openapi/admin.json`, `admin/src/api/schema.d.ts`, `modules/{pact,cabana,pier}/README.md`, `docs/backend/users-and-permissions.md`, `docs/services/mcp.md`. |
### Plan 36-02 — Shared Scope Picker, `ConnectView` & `ApiTokenCreateDialog` Integration (23/23 Truths)
| Category / Must-Have | Status | Evidence |
|----------------------|--------|----------|
| Loading skeletons (`ConnectView` `aria-busy="true"`, `ApiTokenCreateDialog` `data-scope-loading`) & submit disabled/spinner states | **PASS** | `ConnectView.vue:402-416,524,580-597`; `ApiTokenCreateDialog.vue:551-568,493,612-628`. |
| Empty states (`none_grantable`, Custom 0 selected `scope_summary_empty`, `ScopePicker` search/Selected/Read-only dashed empty states with action buttons, empty-draft disabled Apply + `scope_picker_none_selected`) | **PASS** | `ConnectView.vue:513-522`; `ScopeAccessControl.vue:48-51,149-165`; `ScopePicker.vue:140-182,360-385,503-525`. |
| Error states preserved (`ConnectView` 404/401/422/bad-URI + `border-danger` on `scopes_required`; `ApiTokenCreateDialog` `scopes_failed` + 422 `errors.scopes` invalid + focus restore) | **PASS** | `ConnectView.vue:320-329,534-548`; `ApiTokenCreateDialog.vue:234-237,262-275,569-603`. |
| Small (`<= 3` groups or `<= 12` scopes) vs large (`> 3` groups and `> 12` scopes) smart expand + search auto-expand without losing pre-search expand state (D-07) | **PASS** | `scopeCatalog.ts:144-160`; `ScopePicker.vue:184-199,265-272`. |
| Elevated-first summary chips (`admin:read` -> writes -> reads when `admin:read` OFF), capped at 6 + clickable `+N more` + CLDR plural subtitle via `tc()` (D-04, D-06) | **PASS** | `scopeCatalog.ts:168-234`; `ScopeAccessControl.vue:48-65,167-206`. |
| Missing tiers omitted; `Custom` hidden without plugin scopes; `ApiTokenCreateDialog` `Full (*)` fallback; `ConnectView` narrow subset opens in `Custom` (D-03, D-08) | **PASS** | `scopeCatalog.ts:262-291`; `useScopeSelection.ts:25-37`; `ScopeAccessControl.vue:95-115`. |
| Collision-free flat `(plugin_id, group)` accordions keyed `${plugin_id}\0${group}`, `Intl.Collator` sort + `plugin_id` tie-break, preserved intra-group scope order (D-01, D-17) | **PASS** | `scopeCatalog.ts:75-116`. |
| Responsive mobile `100dvh` sheet / desktop `sm:max-w-[640px] sm:max-h-[85dvh]` (`ConnectView`), fixed `max-w-[560px] max-h-[calc(100vh-32px)]` (`ApiTokenCreateDialog`), `[overflow-wrap:anywhere]` & chip `truncate` (D-10, D-13) | **PASS** | `ConnectView.vue:610`; `ApiTokenCreateDialog.vue:407`; `ScopeAccessControl.vue:130,146,151,184,192`; `ScopePicker.vue:350,366,410,476-494`. |
| Surface-matched theming: `.connect-light-surface` in `admin/src/styles/main.css` `@layer components` pinning both `--c-*` and `--color-*`, applied to `ConnectView` card + portaled overlay/content; `ApiTokenCreateDialog` inherits `.dark` (D-12) | **PASS** | `admin/src/styles/main.css:536-573`; `ConnectView.vue:39,605,610`; `ApiTokenCreateDialog.vue` uses semantic utilities only. |
| Focus management, Escape draft-discard + tier-revert without closing `ApiTokenCreateDialog` (preserving `name`/`expires`), `mod+s`/`mod+enter` inactive in picker view (D-09, D-11, D-13) | **PASS** | `useScopeSelection.ts:59-89`; `ConnectView.vue:212-232`; `ApiTokenCreateDialog.vue:185-218,374-388,415-456,617-628`. |
| `ApiTokensPanel.vue` untouched and compatible; embedded `modules/boardwalk/dist` rebuilt and passing `check-admin-dist.sh` (D-15) | **PASS** | `git diff cb259ba9~1..HEAD -- admin/src/components/account/ApiTokensPanel.vue` is empty; `modules/boardwalk/dist/*` updated in `3781c979`. |
### Plan 36-03 — Core Plugin `pact.HasTokenScopes` Rollout (5/5 Truths)
| Must-Have | Status | Evidence |
|-----------|--------|----------|
| `sm-sitemap-plugin` declares `sitemap` + `sitemap:read` (`golem15.sitemap.*`, empty `Group`) with EN/PL copy | **PASS** | `../sm-sitemap-plugin/token_scopes.go:1-26`, `lang/{en,pl}/lang.yaml:93-97`. |
| `sm-seo-plugin` declares `seo` + `seo:read` (`golem15.seo.*`, empty `Group`) with EN/PL copy | **PASS** | `../sm-seo-plugin/token_scopes.go:1-26`, `lang/en/lang.yaml:787-791`, `lang/pl/lang.yaml:817-821`. |
| 100% backend write MCP tool coverage under `cabana.TokenScopeCovers` and zero `pier.Mount` warnings | **PASS** | Verified in `../sm-sitemap-plugin/token_scopes_test.go:110-159` (2/2 write tools) and `../sm-seo-plugin/token_scopes_test.go:110-163` (29/29 write tools out of 48 total). |
| `:read` scopes allow `GET`/`HEAD` and deny write methods; full scopes stay bounded to plugin permissions | **PASS** | Verified in `TestTokenScopesReadWriteEnforcement` in both plugin test files. |
| Both repos pass `go vet ./...` & `go test ./...` with updated `README.md` | **PASS** | Recorded in `36-03-SUMMARY.md` & re-verified post-`v0.6.8` bump in `36-04-SUMMARY.md` (`16.6s` sitemap, `125.8s` seo). |
### Plan 36-04 — Comprehensive Tests, Release Gates & Local E2E Proof (10/10 Truths, incl. all 7 UI-SPEC Backstops)
| Must-Have / UI-SPEC Backstop | Status | Evidence |
|------------------------------|--------|----------|
| Go unit & integration tests for `TokenScope.Group`, D-16 fallback, `AdminAPITokenScope` wire keys, `TokenScopeCovers`, and `pier.Mount` boot warnings | **PASS** | `modules/cabana/token_scopes_test.go` (`TestTokenScopeGroupValidation`, `TestScopeGroupFallbackResolution`), `token_scope_names_test.go` (`TestTokenScopeCovers`), `account_tokens_test.go`, `mcp_admin_consent_test.go`, `modules/pier/uncovered_scopes_warning_test.go` (5 subtests via `captureLogs`). |
| Backstop #1: Initial default tiers (`ConnectView` + `ApiTokenCreateDialog`) | **PASS** | `scopeCatalog.test.ts:243-280`, `ConnectView.test.ts:132,247`, `ApiTokenCreateDialog.test.ts:208,233,388`. |
| Backstop #2: `admin:read` toggle & lock semantics (PII footgun fix) | **PASS** | `scopeCatalog.test.ts:216-241`, `ScopePicker.test.ts:146-203`, `ConnectView.test.ts:325-388`. |
| Backstop #3: Tier memory, auto-open empty Custom, draft/discard revert | **PASS** | `ConnectView.test.ts:284-324`, `ApiTokenCreateDialog.test.ts:436-479`. |
| Backstop #4: Grouping, sorting, search, filter pills, smart expand | **PASS** | `scopeCatalog.test.ts:51-161`, `ScopePicker.test.ts:205-308`. |
| Backstop #5: `ApiTokenCreateDialog` in-dialog swap + Escape preservation + `mod+s` suppressed | **PASS** | `ApiTokenCreateDialog.test.ts:395-435`. |
| Backstop #6: `ConnectView` modal `.connect-light-surface`, `h-[100dvh]`, `sm:max-w-[640px] sm:max-h-[85dvh]` | **PASS** | `ConnectView.test.ts:389-402`. |
| Backstop #7: Elevated-first chip cap at 6 + clickable `+2 more` | **PASS** | `scopeCatalog.test.ts:163-214`, `ScopeAccessControl.test.ts:101-178`. |
| All framework release gates pass green | **PASS** | Verified in Plan 36-04 Task 3 (`go vet`, `go test ./...`, OpenAPI, typecheck, Vitest, dist, `TestDocsTree`, `docs:build --check`). |
| Release tags gated on user decision (`approve-release-and-proof`) + `sm-grzybyfunkcjonalne-app/scripts/smoke-mcp-oauth.sh` E2E proof | **PASS** | Annotated tag `v0.6.8` verified on `summercms.go`; `../sm-sitemap-plugin/go.mod` requires `summercms v0.6.8`; `../sm-seo-plugin/go.mod` requires `summercms v0.6.8` & `sm-sitemap-plugin v0.2.1`; `../sm-grzybyfunkcjonalne-app/go.mod` pins all three (`v0.6.8` / `v0.2.1` / `v0.2.1`); `scripts/smoke-mcp-oauth.sh:292-455` verifies Steps 2, 6, 8 (`plugin_id`/`group`), 10 (`journal_create_post`, `seo_set_url_seo`, `sitemap_rebuild`), 11, 12, and zero `not covered by any non-* TokenScope` warnings in `$TMP/go.log`. |
---
## 3. Prohibitions Audit (16/16 Clean)
| Prohibition | Plan | Check Result |
|-------------|------|--------------|
| Do NOT alter `pact.ValidTokenScopeName` or `tokenScopeNameRE` (D-01) | 36-01 | **CLEAN** (`git diff` confirms untouched) |
| Do NOT auto-generate `<plugin>` `TokenScope`s at boot (D-05) | 36-01 | **CLEAN** (`compileTokenScopes` reads explicit `pact.HasTokenScopes` only) |
| Do NOT add `omitempty` to `AdminAPITokenScope.PluginID` or `Group` (D-15) | 36-01 | **CLEAN** (`json:"plugin_id"` and `json:"group"`, required in OpenAPI) |
| Do NOT make `pier.Mount` return an error for uncovered backend write MCP tools (D-18) | 36-01 | **CLEAN** (`warnUncoveredBackendWriteTools` returns void, logs `Warn` only) |
| Do NOT name any consuming application in framework code, module READMEs, or `docs/` | 36-01 | **CLEAN** (`git diff` grep across `modules/`, `docs/`, `admin/src/` returned 0 hits) |
| Do NOT add any new npm dependencies or new `:root`/`.dark` CSS custom properties | 36-02 | **CLEAN** (`admin/package.json` & `package-lock.json` untouched; `main.css` diff adds only `.connect-light-surface` in `@layer components`) |
| Do NOT define `.connect-light-surface` in Vue `<style scoped>` | 36-02 | **CLEAN** (zero `<style>` blocks in scope/connect/token `.vue` files; defined in `admin/src/styles/main.css`) |
| Do NOT nest a second modal overlay inside `ApiTokenCreateDialog.vue` | 36-02 | **CLEAN** (`grep -c '<DialogOverlay'` = `1`) |
| Do NOT include `admin:read` in submitted Custom scopes unless opt-in toggle checked | 36-02 | **CLEAN** (`computeSubmittedScopes` + Vitest backstop #2) |
| Do NOT auto-focus/bind hotkeys to Allow/Deny on `ConnectView.vue`, and zero `v-html` | 36-02 | **CLEAN** (zero `v-html` across all modified/created `.vue` files; no hotkey or auto-focus on Allow/Deny) |
| Do NOT grant write HTTP methods on `sitemap:read` or `seo:read` | 36-03 | **CLEAN** (`Methods: []string{"GET", "HEAD"}` in both plugins) |
| Do NOT broaden `Permissions` beyond `golem15.sitemap.*` / `golem15.seo.*` | 36-03 | **CLEAN** (verified in `token_scopes.go` and `token_scopes_test.go`) |
| Do NOT tag/push plugin repos during Plan 36-03 (only after Task 4 user approval) | 36-03 / 36-04 | **CLEAN** (tagging executed strictly after user approved `approve-release-and-proof` at Task 4) |
| Do NOT print, copy, or log plaintext tokens in test failures or command output | 36-04 | **CLEAN** (`smoke-mcp-oauth.sh` unsets/truncates tokens and never prints them) |
| Do NOT deploy `grzybyfunkcjonalne.pl` to production (D-20) | 36-04 | **CLEAN** (local proof + git push only; production untouched) |
| Do NOT modify `ApiTokensPanel.vue` unnecessarily | 36-02 | **CLEAN** (`git diff` empty) |
---
## 4. Automated Test & Release Evidence
All automated gates executed cleanly in Plan 36-04 Tasks 3 & 5 with zero subsequent source modifications (verified via `git log cb259ba9~1..HEAD`):
- `go vet ./...` & `go test ./...` (including Postgres integration & OpenAPI conformance) — **PASS**
- `scripts/check-admin-openapi.sh --check` — **PASS**
- `npm --prefix admin run typecheck` (`vue-tsc --noEmit`) — **PASS**
- `npm --prefix admin run test` (Vitest full suite including `scopeCatalog.test.ts`, `ScopeAccessControl.test.ts`, `ScopePicker.test.ts`, `ConnectView.test.ts`, `connect.smoke.test.ts`, `ApiTokenCreateDialog.test.ts`, `ApiTokensPanel.test.ts`) — **PASS**
- `npm --prefix admin run build && scripts/check-admin-dist.sh` — **PASS**
- `go test ./cmd/summer -run 'TestCommandsDocumented|TestDocsTree' -count=1 && go run ./cmd/summer docs:build --check` — **PASS**
- `../sm-sitemap-plugin` (`v0.2.1`, commit `91eaaa3`): `summer plugin:manifest --check`, `go vet ./...`, `go test -count=1 ./...` — **PASS**
- `../sm-seo-plugin` (`v0.2.1`, commit `1f56dba`): `summer plugin:manifest --check`, `go vet ./...`, `go test -count=1 ./...` — **PASS**
- `../sm-grzybyfunkcjonalne-app` (commit `61f9669`): `go vet -tags summercms_mcp,nodynamic ./...`, `go test -short ./...`, `scripts/smoke-mcp-oauth.sh` (12/12 steps + zero `pier` uncovered-tool boot warnings) — **PASS**
- Changelogs published: `summercms.go v0.6.8` (`#86`), `sm-sitemap-plugin v0.2.1` (`#87`), `sm-seo-plugin v0.2.1` (`#88`).
### Advisory Note (Non-Blocking)
- All 7 functional UI-SPEC `backstop` contracts are automated and verified in Vitest (`36-UI-SPEC.md`). Optional visual polish checks (real-browser inspection of `/connect` light-surface modal in dark mode, `< 640px` mobile sheet scroll feel, and `/account` dark-mode token dialog swap) remain advisory whenever the operator next visits those screens locally.

View File

@@ -251,13 +251,13 @@
{
"number": "36",
"name": "Granular MCP OAuth & API token scope picker",
"status": "pending"
"status": "complete"
}
],
"next": {
"command": "/gsd:progress --next",
"command": "/msd-progress --next",
"label": "Advance to the next step",
"reason": "Phase 36 of 54 · executing"
"reason": "Phase 36 complete"
},
"updated_at": "2026-11-24T17:54:17.179Z"
"updated_at": "2026-11-24T21:15:00.000Z"
}