From e238537fc204c17b18f3acd1809b7b69e4d0bc3c Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sat, 21 Nov 2026 02:52:38 +0100 Subject: [PATCH] docs(32.2): phase verification report --- .../32.2-VERIFICATION.md | 289 ++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-VERIFICATION.md diff --git a/.planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-VERIFICATION.md b/.planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-VERIFICATION.md new file mode 100644 index 00000000..9034c596 --- /dev/null +++ b/.planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-VERIFICATION.md @@ -0,0 +1,289 @@ +--- +phase: 32.2-mcp-oauth-with-administrator-subjects +verified: 2026-11-21T01:50:18Z +status: human_needed +score: 4/5 roadmap success criteria verified (SC-5 partial: docs and tests verified, release held) +covered_files: + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-01-PLAN.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-01-SUMMARY.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-02-PLAN.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-02-SUMMARY.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-03-PLAN.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-03-SUMMARY.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-04-PLAN.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-04-SUMMARY.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-05-PLAN.md + - .planning/phases/32.2-mcp-oauth-with-administrator-subjects/32.2-05-SUMMARY.md + - admin/src/api/types.ts + - admin/src/app/pageTitle.ts + - admin/src/app/router.ts + - admin/src/components/account/AccountContributions.vue + - admin/src/views/ConnectView.vue + - admin/src/views/LoginView.vue + - admin/tests/account/AccountContributions.test.ts + - admin/tests/app/router.test.ts + - admin/tests/smoke/account-items.smoke.test.ts + - admin/tests/smoke/connect.smoke.test.ts + - admin/tests/views/ConnectView.test.ts + - admin/tests/views/LoginView.test.ts + - docs/backend/admin-spa.md + - docs/backend/users-and-permissions.md + - docs/plugins/registration.md + - docs/services/events.md + - docs/services/mcp.md + - docs/services/oauth-server.md + - modules/cabana/README.md + - modules/cabana/account.go + - modules/cabana/account_contributions.go + - modules/cabana/account_items_smoke_test.go + - modules/cabana/account_items_test.go + - modules/cabana/admin_events.go + - modules/cabana/admin_openapi.go + - modules/cabana/backend_access_revoked_smoke_test.go + - modules/cabana/backend_access_revoked_test.go + - modules/cabana/backend_roles_admin.go + - modules/cabana/backend_users_admin.go + - modules/cabana/commands.go + - modules/cabana/contracts.go + - modules/cabana/export_test.go + - modules/cabana/http.go + - modules/cabana/mcp_admin_consent_test.go + - modules/cabana/mcp_consent.go + - modules/cabana/mcp_consent_smoke_test.go + - modules/cabana/openapi_conformance_test.go + - modules/cabana/phase10_coverage_test.go + - modules/cabana/phase10_csrf_test.go + - modules/cabana/security_coverage_test.go + - modules/cabana/token_routes_test.go + - modules/cabana/token_scope_names_test.go + - modules/cabana/token_scopes_export.go + - modules/pact/README.md + - modules/pact/capabilities.go + - modules/pact/mcp.go + - modules/phrasebook/backend/lang/en/lang.yaml + - modules/phrasebook/backend/lang/pl/lang.yaml + - modules/pier/README.md + - modules/pier/backend_guard.go + - modules/pier/backend_only_grant_test.go + - modules/pier/backend_subject_smoke_test.go + - modules/pier/identity.go + - modules/wristband/README.md + - modules/wristband/authorize.go + - modules/wristband/consent_path_smoke_test.go + - modules/wristband/consent_path_test.go + - modules/wristband/server.go +covered_digest: "v2:sha256:86b5eea8e8068bf2e020b2d37be27f44223397447c083980b6ea461008d034b6" +# The fingerprint tool refuses files outside the project root, so the sibling +# repositories cannot be fingerprinted. They were verified at these commits: +# ../sm-oauthserver-plugin HEAD 1124fd1 (6 commits ahead of origin/master 7b9899f = v0.1.7) +# ../sm-grzybyfunkcjonalne-app HEAD df554d5 (4 ahead of origin/master), submodule working tree at 4c209c1, committed gitlink 7b9899f +behavior_unverified: 0 +overrides_applied: 0 +coincidental_reliance_items: + - truth: "SC-4: sm-grzybyfunkcjonalne-app mounts golem15.oauthserver in backend mode and the local stack completes discovery, registration, sign-in and a Journal tool call over OAuth" + reason: undeclared-precondition + harden: "The smoke and the app tests pass only because the submodule working tree sits at the unpushed plugin commit 4c209c1. The committed app state (gitlink 7b9899f, go.mod v0.1.7, plugins.gen.go Version v0.1.7) predates backend mode, so a fresh clone builds a user-mode OAuth server with OIDC (review PA-CR-01). Close it with the release pointer bump (gitlink, go.mod require, regenerated plugins.gen.go) and add the check-deploy guard PA-CR-01 proposes, so the committed state cannot silently regress." +human_verification: + - test: "Live connector check (cross-site SameSite=Strict admin cookie, D-03 / RESEARCH A2). After the production deploy, add https://grzybyfunkcjonalne.pl/mcp as a connector in Claude while signed in to /gfadmin, start the OAuth sign-in, then call a Journal tool and revoke the connection on My account. Procedure: ../sm-grzybyfunkcjonalne-app/DEPLOY.md, section 'Live connector check (deferred)'; 32.2-VALIDATION.md, Manual-Only Verifications row 1." + expected: "After the cross-site redirect from Claude, the /gfadmin/connect consent card shows the signed-in administrator, not the login screen. If it shows login, signing in must return to the same consent request." + why_human: "A localhost stack is same-site, so neither the smoke script nor any test can reproduce the cross-site navigation chain. Status: UNVERIFIED (not passed, not failed). No test in the phase claims to cover it." + status: unverified + - test: "Live connector scope behaviour (32.2-VALIDATION.md, Manual-Only Verifications row 2). In the same live run, note which scope value Claude sends to /oauth/mcp/authorize and whether the consent card offers the expected scopes." + expected: "The consent card lists grantable catalog scopes (journal, journal:read and so on). If Claude asks only for offline_access, the card currently shows 'no grantable scope' with Deny only (review FW-WR-01, deferred-items.md); in that case the WR-01 fix is needed before the connector is usable." + why_human: "Depends on the real Claude connector's authorize request, which cannot be reproduced locally." + status: unverified + - test: "Production resource override (review PA-WR-09). During the deploy, check that SUMMER_GOLEM15__OAUTHSERVER__MCP__RESOURCE is set in go/.env and that GET /.well-known/oauth-protected-resource/mcp .resource equals the authorization server's resource (https://grzybyfunkcjonalne.pl/mcp)." + expected: "Both resources are the public https URL; the committed loopback default (http://127.0.0.1:8096/mcp) is not served." + why_human: "Deploy-time environment; a missing key only logs a warning, and nothing in check-deploy or the boot test checks it." + status: unverified + - test: "SC-5 release go-ahead. 32.2-05-release-decision.txt records hold (framework-base v0.6.6, plugin-base v0.1.7). Decide whether to run plan 05 task 5's tag-and-publish branch: framework next free v0.6 patch (v0.6.7 if still free, must contain b1b96d85), sm-oauthserver-plugin v0.1.8 requiring that tag, push the plugin, then the grzyby pointer bump as its own commit (gitlink, go.mod require, regenerated plugins.gen.go), then the two changelog posts the same day." + expected: "Tags v0.6.x and v0.1.8 on origin, plugin go.mod on the framework tag, app gitlink and go.mod on v0.1.8, two changelog URLs recorded in 32.2-05-changelog-published.txt; task 5's automated verify passes on the tag-and-publish branch." + why_human: "Releases are gated on the user's word (project memory: tag only at phase completion after verification). SC-5 is NOT met until this runs; it is a pending user decision, not a code gap." + status: pending +--- + +# Phase 32.2: MCP OAuth with administrator subjects Verification Report + +**Phase Goal:** As an editor of a blog-only application whose MCP tools are backend-guarded (Journal) and which has no frontend users, I want to add the site's `/mcp` as a connector and sign in once as my administrator account over OAuth, so that agents no longer need a hand-copied `g15_` personal token. Delivered as an additive, off-by-default backend-subject mode of `sm-oauthserver-plugin`. +**Verified:** 2026-11-21T01:50:18Z +**Status:** human_needed +**Re-verification:** No, initial verification +**Mode:** mvp + +## MVP user-story guard + +`msd_run query user-story.validate` answers `valid: false` with "Story must start with "As a [user role],"". The only cause is the article: the goal reads "As **an** editor", and the canonical regex requires the literal `As a `. The role, capability and outcome slots are all present and well formed, and every plan restates the same story. Verification proceeds; the discrepancy is reported as a warning. Either the validator should accept "As an", or the ROADMAP goal can be reworded ("As a blog editor ..."). + +## User Flow Coverage + +Outcome clause: "agents no longer need a hand-copied `g15_` personal token". + +| # | Step | Expected | Evidence in codebase | Status | +|---|------|----------|----------------------|--------| +| 1 | Add `/mcp` as a connector | Anonymous `/mcp` answers 401 with `resource_metadata`; protected-resource and authorization-server metadata point at `/oauth/mcp/*` | grzyby smoke steps 1-3 (re-run here, pass); nginx `= /.well-known/oauth-authorization-server` and `^~ /oauth/mcp/` in both vhosts; check-deploy ok | VERIFIED (locally) | +| 2 | Client registers and starts authorize | DCR 201; authorize 302 to `/gfadmin/connect?request=` | smoke steps 4-6; plugin `servers.go` ConsentPath = `cabana.AdminPrefix + "/connect"`; wristband `consentPath()` | VERIFIED | +| 3 | Sign in once as the administrator | Anonymous visitor of `/connect` goes through the normal admin login and back | router `/connect` without shell/public; `router.test.ts` "sends an anonymous visitor of /connect to login ... returns there"; smoke step 7 (cookie login) | VERIFIED (same-site); cross-site cookie UNVERIFIED (human item 1) | +| 4 | Consent | Card shows client, redirect host, grantable scopes, Stay connected; Allow issues a code | `ConnectView.vue`; cabana `GET/POST {api}/mcp/consent/{request}`; plugin `MCPAdminConsent` provider; smoke step 8; `ConnectView.test.ts` (30 tests) | VERIFIED | +| 5 | Token exchange | Access and refresh token whose rows name the administrator only | smoke step 9; `TestBackendModeSmoke`, `TestBackendGrantRows` (user_id NULL, backend_user_id set) | VERIFIED | +| 6 | Agent calls a Journal tool | tools/list contains `journal_list_posts`; tools/call succeeds | smoke step 10 (11 tools, isError false) | VERIFIED (locally) | +| 7 | `g15_` tokens keep working | Same tool list and call with a personal token | smoke step 11; `TestBackendGrantToolsMatchPersonalToken` (OAuth and `g15_` tool lists equal name for name) | VERIFIED | +| 8 | Access ends when it should | Password change, deactivate, delete, role/permission change or My account revoke ends the grant | smoke step 12 (401 after password change); `TestBackendCascade`, `TestBackendRevokeFromAccount`, `TestBackendAccessRevokedEvent` | VERIFIED | + +The outcome holds on a local stack built from the working trees. On the committed app master it does not hold yet (the pinned plugin v0.1.7 has no backend mode; see SC-4 and SC-5). + +## Goal Achievement + +### Observable Truths (ROADMAP success criteria) + +| # | Truth | Status | Evidence | +|---|-------|--------|----------| +| SC-1 | Backend mode: authorize recognises a signed-in administrator, sends an anonymous browser through admin login and back, shows a branded consent page; the grant carries `BackendUserID` and no frontend user. Mode off (default): every existing flow and test of sm-oauthserver-plugin and sm-bm-app passes unchanged. | VERIFIED | Handoff `{issuer}{ConsentPath}?request=` (`wristband/authorize.go:189`), default byte-identical (`TestAuthorizeConsentPath`, `TestConsentPathSmoke`). Consent card `admin/src/views/ConnectView.vue` (LoginView palette and wordmark) over cabana `mcp_consent.go`, interactive-only, X-Requested-With, 16 KiB cap, scope policy = `scopeOverlaps` + `validateTokenScopes`. Grant rows user_id NULL / backend_user_id set (`TestBackendModeSmoke`, `TestBackendGrantRows`, `TestBackendSubjectMigration`). User consent routes and OIDC unmounted in backend mode (`routes.go:45,71,93`; `TestBackendMode`). Mode off: full plugin suite re-run here (`go test -count=1 ./...`, exit 0, 115 s) and sm-bm-app through a scratch go.work against the new plugin and framework (`go test -tags summercms_mcp ./...`, exit 0). Wording note: the ROADMAP says "server-rendered"; D-03 (user-selected in 32.2-DISCUSSION-LOG.md, "Admin SPA route ✓") moved consent into the admin SPA because the `SameSite=Strict`, `Path=` cookie never reaches `/oauth/mcp/authorize`. The intent (a branded consent page shown to the signed-in administrator) is met; consider updating the SC-1 wording. | +| SC-2 | pier resolves such a grant straight to the backend subject, no link lookup; tools/list and calls are capped by cabana permissions and granted scopes like a scope-limited `g15_` token. | VERIFIED | `pier/identity.go` `resolveBackendGrant` (branch before the UserID==0 refusal; binding `oauth:backend::`; no Frontend; `ScopeLimited: true`); `backend_guard.go:112` widens the ScopeLimitFor condition only by `ScopeLimited`. Tests re-run here: `TestBackendOnlyGrant` (no resolver calls, distinct bindings, fingerprint), `TestLinkedGrantNoScopeLimit` (user-mode linked grants unchanged), `TestBackendSubjectSmoke` (real /mcp request, read tool listed, write tool hidden), and `TestBackendGrantToolsMatchPersonalToken` (`-tags summercms_mcp`: acme:read lists/calls only the read tool, acme lists/calls the write tool, both equal the `g15_` token lists). | +| SC-3 | Revoking the grant (My account connected-apps list), or deleting, deactivating or re-passwording the administrator, ends the grant's tokens and open MCP sessions (`MCPSubjectChanged`). | VERIFIED | cabana `BackendAccessRevokedEvent` fired in-transaction at delete, deactivate, password set, own password change, `admin:reset-password` (now `lagoon.Transaction`, fix b1b96d85), user role/permissions/superuser and role permission changes (`backend_users_admin.go:235,291,856,861`; `backend_roles_admin.go:201`; `account.go:399`; `commands.go:169`); the three after-commit `fireSubjectChanged` calls are unchanged. Plugin `BackendCascade` (backend mode only, `plugin.go:121-124`) calls `RevokeBackendGrants` and `FireBackendRevokedAfterCommit` (Guard backend, Kind revoked, ClientID), which pier's `revokedMatch` matches through `subjectFor("backend")`. My account section `mcp_connections` with Danger `revoke` (`account.go`), admin-wide screen gated by `golem15.oauthserver.manage_mcp_connections`. Tests re-run here: `TestBackendAccessRevokedEvent` (all seven sites, rollback on listener error), `TestBackendCascade`, `TestBackendRevokeFromAccount`, `TestBackendRevocationSmoke`, `TestBackendAccountSmoke`, and in `TestBackendGrantToolsMatchPersonalToken` the open session of a revoked client answers 401 while the other client's session keeps working; smoke step 12 shows the same after a password change. | +| SC-4 | grzyby mounts golem15.oauthserver in backend mode, its proxy routes discovery and `/oauth/mcp/*` to Go, and an MCP client completes discovery, registration, sign-in and a Journal tool call over OAuth on a local stack; `g15_` tokens keep working. | VERIFIED (coincidental-reliance) | `config/golem15.oauthserver.yaml` (oidc.enabled false, mcp.enabled true, mcp.subject backend); `.gitmodules`, go.work use, go.mod require + replace, summer.yaml, build.sh, plugins.gen.go list golem15.oauthserver; config/mcp.yaml keeps `allow_personal_tokens: true`. `scripts/smoke-mcp-oauth.sh` re-run here: all twelve steps, "ok (12 steps)", no token, code or g15_ value in the output. `scripts/check-deploy.sh` re-run: ok. App `go vet -tags summercms_mcp,nodynamic ./...` clean. The client is scripted; the real Claude connector is human item 1. Caveat: this holds only with the submodule working tree at the unpushed plugin commit 4c209c1. The committed gitlink, go.mod and plugins.gen.go pin v0.1.7, which has no backend mode (review PA-CR-01). That is closed by the SC-5 pointer bump. | +| SC-5 | Module READMEs, `docs/` pages and the app's DEPLOY.md updated; new code has unit tests in the phase's last plan; the framework and sm-oauthserver-plugin get patch tags. | PARTIAL (release held) | Docs: pact, wristband, pier, cabana READMEs name the new identifiers; `docs/services/{mcp,oauth-server,events}.md`, `docs/backend/{users-and-permissions,admin-spa}.md`, `docs/plugins/registration.md` updated; `summer docs:build --check` re-run: "no problems found"; no consuming application named in framework code or docs (`git grep -i grzyby` over modules, docs, admin/src, phrasebook is empty). Plugin README has "Backend-subject mode", config rows and the MCP connections screen. DEPLOY.md MCP section covers OAuth sign-in, config, minimum plugin version, migration, nginx, local check, rollback and "Live connector check (deferred)". Tests: plan 05 is the tests plan; all named tests pass (see spot-checks). Tags: NOT met. `32.2-05-release-decision.txt` = hold; no v0.6.7 tag in summercms.go (highest v0.6.6), no v0.1.8 on the plugin's origin, plugin still requires framework v0.6.0 through a replace, app pointer not bumped, no changelog posts. Routed to human item 4 (user decision, not a code gap). | + +**Score:** 4/5 roadmap truths verified (0 present-but-behavior-unverified). SC-5 is partial and pending the user's release go-ahead. + +### Plan must_haves (merged under the SCs above) + +| Plan | Must-have group | Status | Notes | +|------|-----------------|--------|-------| +| 01 | wristband ConsentPath/DefaultScopes, pact grant shape, pier branch, cabana consent endpoint, TokenScopeNames/Labels, account items, BackendAccessRevokedEvent, docs | VERIFIED | Two documented deviations: item action route is `POST {api}/account/contribution-items/{name}/{item}/actions/{action}` (the planned path overlapped controller routes and surf refused boot); a requested `*` is offered on consent as on `g15_` creation (review FW-IN-01). Role delete fires nothing because deleting a held role is refused. | +| 02 | /connect route, ConnectView states, switch account, login hint, scope rules, account item rows, regenerated openapi, rebuilt dist | VERIFIED | `check-admin-openapi.sh --check` exit 0; `check-admin-dist.sh` "matches a fresh build"; no admin/src change after dist commit ee754b6b. The planned "sign-out failure shows decide_failed" is coded (`ConnectView.vue` catch) but unreachable because `logout()` never throws; the test pins that the switch still reaches login. | +| 03 | config keys and boot refusals, migration, store/verifier branches, consent provider, revocation listener, My account section, MCP connections screen, README | VERIFIED | Bulk revoke is Detached (derived table cannot `FOR UPDATE`); consent last_used_at stamped by the verifier. `Requires()` still `[golem15.user]`. | +| 04 | app wiring, smoke, nginx, check-deploy, DEPLOY.md, UI backstop recorded as unverified | VERIFIED (local) | Rollback documented with `MCP__SUBJECT=user` too (the single-key rollback fails boot). Committed state caveat as in SC-4. | +| 05 | tracer tools test, framework/SPA/plugin unit tests, regression runs, release checkpoint | VERIFIED except the release truth | Four UI backstops (`verification: backstop`) have explicit passing evidence: ConnectView.test.ts (`*` rule, no auto-allow and window.location.assign, switch round trip, forbidden schemes), router.test.ts, AccountContributions.test.ts (null items unchanged, `[]` empty block, `:title` confirm). The fifth backstop (cross-site cookie) is human item 1, unverified. The release truth is human item 4. | + +### Required Artifacts + +| Artifact | Expected | Status | Details | +|----------|----------|--------|---------| +| `modules/pact/mcp.go` | MCPGrant.Subject, MCPGrantSubjectBackend, ScopeLimited, MCPAdminConsent + types + sentinels | VERIFIED | lines 140-147, 289-394 | +| `modules/pact/capabilities.go` | Items/ItemActions/ItemsEmpty, AccountItem*, ErrAccountItemNotFound | VERIFIED | lines 613-673 | +| `modules/wristband/server.go`, `authorize.go` | ConsentPath, DefaultScopes | VERIFIED | used at authorize.go:189, 199-222 | +| `modules/pier/identity.go`, `backend_guard.go` | backend-only branch, ScopeLimited condition and fingerprint | VERIFIED | identity.go:218, 245-274, 115; backend_guard.go:112 | +| `modules/cabana/mcp_consent.go` | GET/POST consent handlers | VERIFIED | mounted http.go:354-355 in the backend group | +| `modules/cabana/token_scopes_export.go` | TokenScopeNames, TokenScopeLabels | VERIFIED | used by the plugin's servers.go:210 and account.go:106 | +| `modules/cabana/admin_events.go` | BackendAccessRevokedEvent, six reasons, fire helper | VERIFIED | 8 call sites | +| `admin/src/views/ConnectView.vue` | consent card, all states | VERIFIED | window.location.assign after scheme deny-list | +| `admin/src/components/account/AccountContributions.vue` | item rows and actions | VERIFIED | data-account-item, -items-empty, -item-action | +| `modules/boardwalk/dist` | rebuilt SPA | VERIFIED | check-admin-dist passes | +| `../sm-oauthserver-plugin/updates/202611200001_...go` | additive migration with rollback | VERIFIED | partial unique index, NOT VALID checks, rollback deletes backend rows | +| `../sm-oauthserver-plugin/classes/mcp_backend_subject.go` | locks, RevokeBackendGrants, after-commit events | VERIFIED | | +| `../sm-oauthserver-plugin/classes/mcp_verifier.go` | backend branch | VERIFIED | verifyBackend, BackendPrincipal + tokens_valid_after | +| `../sm-oauthserver-plugin/controllers/mcp_admin_consent.go` | pact.MCPAdminConsent | VERIFIED | published in backend mode (plugin.go:108) | +| `../sm-oauthserver-plugin/classes/backend_cascade.go` | listener | VERIFIED | registered in backend mode only | +| `../sm-oauthserver-plugin/account.go`, `controllers/mcp_connections.go` | My account section, admin screen | VERIFIED | | +| `../sm-grzybyfunkcjonalne-app/config/golem15.oauthserver.yaml` | backend mode, OIDC off | VERIFIED | | +| `../sm-grzybyfunkcjonalne-app/scripts/smoke-mcp-oauth.sh` | twelve-step proof | VERIFIED | re-run, pass | +| `../sm-grzybyfunkcjonalne-app/deploy/nginx/*.conf` | OAuth locations | VERIFIED | production:229,249; staging:232,253 | + +### Key Link Verification + +| From | To | Via | Status | +|------|----|-----|--------| +| wristband authorize | Options.ConsentPath | handoff URL | WIRED | +| pier resolveBackendGrant | backend guard ScopeLimitFor | MCPSubject.ScopeLimited | WIRED (TestBackendSubjectSmoke) | +| cabana mcp_consent.go | pact.MCPAdminConsent | `app.Lookup` at request time | WIRED | +| cabana save sites | admin_events.go | fireBackendAccessRevoked with the save's tx | WIRED (TestBackendAccessRevokedEvent) | +| ConnectView | cabana /mcp/consent/{request} | openapi-fetch typed by schema.d.ts | WIRED | +| AccountContributions | cabana /account/contribution-items/... | openapi-fetch | WIRED (path differs from plan text, documented) | +| plugin servers.go | cabana.TokenScopeNames, wristband ConsentPath/DefaultScopes | backend-mode NewServers | WIRED | +| plugin Boot | pact.MCPAdminConsent | app.Publish in backend mode | WIRED | +| plugin BackendCascade | pier session teardown | MCPSubjectChanged revoked + ClientID after commit | WIRED | +| grzyby config mcp.resource | pier resource | equal string; production via env | WIRED locally; production is human item 3 | + +### Data-Flow Trace (Level 4) + +| Artifact | Data | Source | Real data | Status | +|----------|------|--------|-----------|--------| +| ConnectView | consent request | cabana Show → plugin provider → wristband `PendingRequest` (mcp_codes row) | yes | FLOWING (smoke step 8) | +| ConnectView fact box | admin login/name/email | cabana loads `backend_users` | yes | FLOWING | +| My account `mcp_connections` | items | consents ⋈ clients for the administrator | yes | FLOWING (TestBackendAccountSmoke) | +| MCP connections screen | rows | derived table over backend consents ⋈ backend_users ⋈ clients | yes | FLOWING | + +### Behavioral Spot-Checks (run in this verification) + +| Behavior | Command | Result | Status | +|----------|---------|--------|--------| +| Framework phase tests | `go test -count=1 -run 'TestAuthorizeConsentPath\|TestAuthorizeDefaultScopes\|TestConsentPathSmoke\|TestBackendOnlyGrant\|TestLinkedGrantNoScopeLimit\|TestBackendSubjectSmoke\|TestTokenScopeNames\|TestMCPAdminConsent$\|TestAccountContributionItems\|TestBackendAccessRevokedEvent' -v ./modules/wristband ./modules/pier ./modules/cabana` | 11 top-level PASS, no SKIP | PASS | +| Plugin backend-mode tests | `go -C ../sm-oauthserver-plugin test -count=1 -tags summercms_mcp -run 'TestBackendGrantToolsMatchPersonalToken\|TestBackendModeSmoke\|TestBackendRevocationSmoke\|TestBackendAccountSmoke\|TestBackendMode$\|TestBackendConsent\|TestBackendSubjectMigration\|TestBackendGrantRows\|TestBackendRevokeFromAccount\|TestBackendCascade' -v .` | 10 PASS, no SKIP | PASS | +| Plugin full suite (user mode unchanged) | `go -C ../sm-oauthserver-plugin test -count=1 ./...` | ok, exit 0 | PASS | +| sm-bm-app against the new plugin | scratch go.work, `go -C ../sm-bm-app test -count=1 -tags summercms_mcp ./...` | ok, exit 0; sm-bm-app tree unchanged | PASS | +| Admin SPA consent and items | `npm --prefix admin run test -- ConnectView router LoginView AccountContributions connect.smoke account-items.smoke` | 6 files, 96 tests pass | PASS | +| grzyby local proof | `bash ../sm-grzybyfunkcjonalne-app/scripts/smoke-mcp-oauth.sh` | "ok (12 steps)"; secret grep count 0 | PASS | +| grzyby deploy guard | `bash ../sm-grzybyfunkcjonalne-app/scripts/check-deploy.sh` | "check-deploy: ok" | PASS | +| Docs, contract, dist | `summer docs:build --check`; `check-admin-openapi.sh --check`; `check-admin-dist.sh` | no problems; exit 0; matches a fresh build | PASS | +| Vet | `go vet ./...` (framework); app `go vet -tags summercms_mcp,nodynamic ./...` | clean | PASS | + +### Probe Execution + +Step 7c: no probe scripts are declared by the phase and no `scripts/*/tests/probe-*.sh` applies; the grzyby smoke above is the phase's runnable check and was executed by the verifier. + +### Requirements Coverage + +No requirement IDs are registered for this phase in REQUIREMENTS.md (ROADMAP: "Requirements: TBD"). Plans declare SC-1..SC-5 as stand-ins; coverage is as in the truths table. No orphaned requirements. + +### Code Review Findings: goal-blocking assessment + +All 29 findings in 32.2-REVIEW-DISPOSITION.md are still open. None makes a must-have truth false as stated; none is classified a goal-blocking gap. Grouped by what they gate: + +**Release gate (must be closed by or before the release):** +- PA-CR-01 (critical): committed app master pins v0.1.7 without backend mode. Closed by the SC-5 pointer bump itself. Do not push or deploy app master before that commit. The proposed check-deploy guard is recommended so the state cannot recur. + +**Recommended before tagging (security or correctness of a published contract; the tags are costly to revise):** +- PA-WR-03: a consent decision racing a password change or deactivation can mint a grant past the cutoff (neither the decision nor the code exchange re-checks the administrator under the lock). Narrow race, but it weakens SC-3's guarantee. +- PA-WR-01: administrator refresh takes a second pool connection inside the rotation transaction (confirmed: `refreshUserUsable` calls `cabana.BackendPrincipal`, which reads through the app's users finder, not `t.db`). Pool exhaustion under concurrent refreshes. +- FW-WR-03: pier treats an unknown `MCPGrant.Subject` as a user grant (fail-open on a new public field). +- FW-WR-01: an `offline_access`-only authorize ends on "no grantable scope". Pre-existing in user mode, but it may make the real connector unusable; tied to human item 2. +- PA-WR-02: transient lookup errors become terminal `invalid_grant`/401 in backend mode only. +- PA-WR-05 and PA-WR-07: backend grants keep verifying after a mode switch, and the documented rollback leaves them alive for a later re-enable. + +**Hardening (no change to the phase goal):** FW-WR-02, FW-WR-04, FW-WR-05, FW-WR-06, PA-WR-04, PA-WR-06, PA-WR-08 (smoke puts throwaway secrets on argv, contradicting its own header and the 32.2-04 SUMMARY claim), PA-WR-09 (covered by human item 3), and all info findings. + +### Anti-Patterns Found + +| File | Line | Pattern | Severity | Impact | +|------|------|---------|----------|--------| +| phase diffs (framework 45eb34e5..HEAD, plugin 7b9899f..HEAD, app c06a2d8..HEAD) | - | TBD/FIXME/XXX added | none found | - | +| same | - | TODO/HACK/placeholder added | none found | - | +| `../sm-grzybyfunkcjonalne-app/scripts/smoke-mcp-oauth.sh` | 344, 372, 391, 420-421 | secrets on process argv despite the header's claim | Warning | Throwaway values; false guarantee in a script others will copy (PA-WR-08) | +| `admin/src/views/ConnectView.vue` | switchAccount catch | unreachable error branch (`logout()` never throws) | Info | Behaviour is fine; the planned inline alert never shows | + +### Human Verification Required + +#### 1. Live connector check (cross-site cookie), status UNVERIFIED + +**Test:** After the production deploy, add `https://grzybyfunkcjonalne.pl/mcp` as a connector in Claude while signed in to `/gfadmin`, complete the sign-in, call a Journal tool, then revoke the connection on My account. See `../sm-grzybyfunkcjonalne-app/DEPLOY.md`, "Live connector check (deferred)", and 32.2-VALIDATION.md, Manual-Only Verifications row 1. +**Expected:** The consent card shows the signed-in administrator, not the login screen, after the cross-site redirect. +**Why human:** The `SameSite=Strict` admin cookie on a cross-site navigation chain cannot be reproduced on localhost. Not passed, not failed. + +#### 2. Connector scope behaviour, status UNVERIFIED + +**Test:** In the same run, note the scope value Claude sends and what the card offers. +**Expected:** Grantable catalog scopes appear. If Claude sends only `offline_access`, the card shows "no grantable scope" and FW-WR-01 must be fixed first. +**Why human:** Depends on the real connector's request (VALIDATION.md manual row 2). + +#### 3. Production MCP resource, status UNVERIFIED + +**Test:** Check that `SUMMER_GOLEM15__OAUTHSERVER__MCP__RESOURCE` is set and that the protected-resource `.resource` equals the authorization server's resource. +**Expected:** Both are `https://grzybyfunkcjonalne.pl/mcp`. +**Why human:** Deploy-time environment, unchecked by any guard (PA-WR-09). + +#### 4. SC-5 release go-ahead, status PENDING + +**Test:** Decide whether to run plan 05 task 5's tag-and-publish branch in its documented order (framework v0.6 patch containing b1b96d85, plugin v0.1.8 on that tag, plugin push, app pointer bump commit, two changelog posts). +**Expected:** Task 5's automated verify passes on the tag-and-publish branch. +**Why human:** The release needs the user's word; the checkpoint answered hold. SC-5 stays unmet until then. + +### Gaps Summary + +No code gaps block the phase goal. SC-1 to SC-4 are achieved and were re-proven by the verifier: an administrator signs in over OAuth through the admin SPA consent card, the grant names only the administrator, pier caps it exactly like a `g15_` token with the same scopes, every D-13 change and the My account revoke end it, and the first consumer completes the whole flow locally while `g15_` tokens keep working. User mode is unchanged (full plugin suite and sm-bm-app pass against the new code). + +What remains is release and live evidence, not implementation: SC-5's tags, the plugin push, the app pointer bump (which also closes PA-CR-01) and the changelog posts wait for the user's go-ahead, and the cross-site cookie, connector scope behaviour and production resource can only be checked after the deferred deploy. Seven review warnings (PA-WR-03, PA-WR-01, FW-WR-03, FW-WR-01, PA-WR-02, PA-WR-05, PA-WR-07) are worth triaging before tagging, because the tags publish the pact, wristband and plugin contracts to other applications. + +--- + +_Verified: 2026-11-21T01:50:18Z_ +_Verifier: Claude (msd-verifier)_