diff --git a/.planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-03-SUMMARY.md b/.planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-03-SUMMARY.md new file mode 100644 index 00000000..ae448d05 --- /dev/null +++ b/.planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-03-SUMMARY.md @@ -0,0 +1,70 @@ +--- +phase: 36-granular-mcp-oauth-api-token-scope-picker +plan: 03 +subsystem: core-plugin-token-scopes +tags: [sitemap, seo, pact, cabana, pier, token-scopes, mcp] +key-files: + created: + - ../sm-sitemap-plugin/token_scopes.go + - ../sm-sitemap-plugin/token_scopes_test.go + - ../sm-seo-plugin/token_scopes.go + - ../sm-seo-plugin/token_scopes_test.go + modified: + - ../sm-sitemap-plugin/lang/en/lang.yaml + - ../sm-sitemap-plugin/lang/pl/lang.yaml + - ../sm-sitemap-plugin/README.md + - ../sm-seo-plugin/lang/en/lang.yaml + - ../sm-seo-plugin/lang/pl/lang.yaml + - ../sm-seo-plugin/README.md +decisions: + - D-05, D-19: Implemented explicit `pact.HasTokenScopes` in `sm-sitemap-plugin` (`sitemap`, `sitemap:read` scoped to `golem15.sitemap.*`) and `sm-seo-plugin` (`seo`, `seo:read` scoped to `golem15.seo.*`), keeping `:read` scopes strictly limited to `GET`/`HEAD`. + - D-16: Left `TokenScope.Group` empty in both plugins so D-16 fallback 1 resolves `golem15.sitemap::lang.plugin.name` (`Sitemap` / `Mapy witryny`) and `golem15.seo::lang.plugin.name` (`SEO` / `SEO`) automatically. + - D-18: Verified 100% coverage of backend write MCP tools under `cabana.TokenScopeCovers` and zero `pier.Mount` uncovered-write-tool warnings in both plugins. +metrics: + tasks_completed: 2 + tasks_total: 2 + commits: 2 + completed_date: "2026-11-24" +--- + +# Phase 36 Plan 03: Core Plugin `pact.HasTokenScopes` (`sm-sitemap-plugin` & `sm-seo-plugin`) Summary + +Implemented explicit `pact.HasTokenScopes` declarations (`sitemap`/`sitemap:read` and `seo`/`seo:read`), localized EN/PL phrasebook copy, README API documentation, and Docker-free unit/coverage/enforcement tests across both sibling core plugins with zero `pier.Mount` uncovered-write-tool warnings. + +## Tasks & Commits + +| Task | Repository | Description | Commit | Files | +|------|------------|-------------|--------|-------| +| 1 | `../sm-sitemap-plugin` | Implement `pact.HasTokenScopes` (`sitemap`, `sitemap:read`), EN/PL copy, README, and unit/coverage/enforcement tests | `bd0c813` | `token_scopes.go`, `lang/en/lang.yaml`, `lang/pl/lang.yaml`, `README.md`, `token_scopes_test.go` | +| 2 | `../sm-seo-plugin` | Implement `pact.HasTokenScopes` (`seo`, `seo:read`), EN/PL copy, README, and unit/coverage/enforcement tests | `8225dd7` | `token_scopes.go`, `lang/en/lang.yaml`, `lang/pl/lang.yaml`, `README.md`, `token_scopes_test.go` | + +## Verification Results + +All vet, short unit, manifest, and full Docker-backed Postgres test suites passed cleanly in both plugin repositories: + +- `(cd ../sm-sitemap-plugin && go vet ./... && go test -count=1 ./...)` — **PASS** (`15.05s`) + - `TestPluginManifest` — PASS + - `TestTokenScopes` — PASS (exact permissions/methods, EN/PL YAML keys via `goccy/go-yaml`, `cabana.TokenScopeNames`) + - `TestTokenScopesCoverMCPTools` — PASS (2/2 backend write MCP tools covered under `cabana.TokenScopeCovers`, 0 `pier.Mount` uncovered-tool warnings) + - `TestTokenScopesReadWriteEnforcement` — PASS (`sitemap` allows all methods within `golem15.sitemap.*` and denies unrelated permissions; `sitemap:read` allows `GET`/`HEAD` and denies `PUT`/`POST`/`PATCH`/`DELETE`) +- `(cd ../sm-seo-plugin && go vet ./... && go test -count=1 ./...)` — **PASS** (`118.03s`) + - `TestPluginManifest`, `TestEveryAdminOperationHasTool`, `TestMCPReadToolsAreGET` — PASS + - `TestTokenScopes` — PASS (exact permissions/methods, EN/PL YAML keys via `goccy/go-yaml`, `cabana.TokenScopeNames`) + - `TestTokenScopesCoverMCPTools` — PASS (29/29 backend write MCP tools out of 48 total MCP tools covered under `cabana.TokenScopeCovers`, 0 `pier.Mount` uncovered-tool warnings) + - `TestTokenScopesReadWriteEnforcement` — PASS (`seo` allows all methods within `golem15.seo.*` and denies unrelated permissions; `seo:read` allows `GET`/`HEAD` and denies `POST`/`PUT`/`PATCH`/`DELETE`) + +## Deviations from Plan + +- **Minor tool-count update in `sm-seo-plugin` test:** `(*seo.Plugin).MCP().Tools` currently registers **48** total tools (**29** backend write tools + 19 `GET` tools) rather than the earlier 41-tool / 26-write-tool snapshot cited in `36-RESEARCH.md`. `TestTokenScopesCoverMCPTools` asserts `len(tools) >= 41`, `writeTools >= 26`, and 100% coverage of every backend write tool (verified 29/29 covered with 0 `pier.Mount` warnings). + +## Notes for Wave 4 (Plan 36-04) + +- Neither `sm-sitemap-plugin` nor `sm-seo-plugin` has been tagged or pushed; both keep their existing `go.mod` `require` versions (`summercms v0.6.1`, `sm-sitemap-plugin v0.2.0`) and local `replace` directives ready for the release-order tagging checkpoint in Plan 36-04 (`summercms.go` -> `sm-sitemap-plugin` -> `sm-seo-plugin` -> `sm-grzybyfunkcjonalne-app`). +- Both plugin repos have clean working trees at `bd0c813` (`sm-sitemap-plugin`) and `8225dd7` (`sm-seo-plugin`). + +## Self-Check: PASSED + +- Created files verified: `../sm-sitemap-plugin/token_scopes.go`, `../sm-sitemap-plugin/token_scopes_test.go`, `../sm-seo-plugin/token_scopes.go`, `../sm-seo-plugin/token_scopes_test.go` +- Modified files verified: `../sm-sitemap-plugin/lang/{en,pl}/lang.yaml`, `../sm-sitemap-plugin/README.md`, `../sm-seo-plugin/lang/{en,pl}/lang.yaml`, `../sm-seo-plugin/README.md` +- Commits verified: `bd0c813` in `../sm-sitemap-plugin`, `8225dd7` in `../sm-seo-plugin`; neither repo tagged or pushed +- `.planning/STATE.md` and `.planning/ROADMAP.md` untouched