diff --git a/.planning/phases/19.7-generic-mcp-module/19.7-VALIDATION.md b/.planning/phases/19.7-generic-mcp-module/19.7-VALIDATION.md index ff8eb141..68763799 100644 --- a/.planning/phases/19.7-generic-mcp-module/19.7-VALIDATION.md +++ b/.planning/phases/19.7-generic-mcp-module/19.7-VALIDATION.md @@ -4,8 +4,8 @@ slug: "generic-mcp-module" # status lifecycle: draft (seeded by plan-phase) → validated (set by validate-phase §6) # audit-milestone §5.5 distinguishes NOT-VALIDATED (draft) from PARTIAL (validated + nyquist_compliant: false) (#2117) status: draft -nyquist_compliant: false -wave_0_complete: false +nyquist_compliant: true +wave_0_complete: true created: "2026-10-21" --- @@ -31,7 +31,7 @@ created: "2026-10-21" - **After every task commit:** quick run command for the touched module(s) - **After every plan wave:** framework `go vet ./... && go test ./...` plus the touched plugin suites -- **Before `/msd-verify-work`:** `scripts/check-phase19.7.sh` green +- **Before `/msd-verify-work`:** `bash scripts/check-phase19.7.sh --all` green on a Docker host (every stage PASS, no NOT RUN docker) - **Max feedback latency:** 120 seconds --- @@ -42,33 +42,36 @@ Filled in by the planner per task; the behaviour → test map is: | Ref | Behavior | Test Type | Automated Command | File Exists | Status | |-----|----------|-----------|-------------------|-------------|--------| -| SC-1/D-30 | disabled → nothing mounted; enabled → `/mcp` mounted | unit | `go test -short ./modules/surf -run TestPierMount` | ❌ W0 | ⬜ pending | -| SC-1 | SSE stream flushes through the streaming route kind | unit | `go test -short ./modules/surf -run TestStreamingRoute` | ❌ W0 | ⬜ pending | -| SC-2/D-10..D-12 | binding/duplicate/name boot errors; prefixing | unit | `go test -short ./modules/pier -run TestCatalog` | ❌ W0 | ⬜ pending | -| D-11/D-13/D-14 | arg split, isError with route body, annotations | unit | `go test -short ./modules/pier -run TestDispatch` | ❌ W0 | ⬜ pending | -| D-15/D-16 | non-token routes refused; requirement union | unit | `go test -short ./modules/pier -run TestGuardRules` | ❌ W0 | ⬜ pending | -| D-17 | marker honoured in-process only; not forgeable from HTTP; frontend marker refused by backend guard | unit | `go test -short ./modules/bouncer ./modules/cabana -run TestDispatchMarker` | ❌ W0 | ⬜ pending | -| SC-3/D-20/D-23 | per-principal tools/list; read grant hides write tools | integration | `go test -short ./modules/pier -run TestToolsList` | ❌ W0 | ⬜ pending | -| D-25 | session binding, DELETE, cross-instance rehydration, TTL | integration | `go test -short ./modules/pier -run TestSessions` | ❌ W0 | ⬜ pending | -| D-26/D-27 | pub/sub list_changed; revocation ends session | integration | `go test -short ./modules/pier -run TestFanOut` | ❌ W0 | ⬜ pending | -| D-09 | plugin frontend permission codes in editors | Postgres | user plugin `go test ./... -run TestFrontendPermissionCatalog` | ❌ W0 | ⬜ pending | -| D-03..D-08 | link proof, one-shot, 1:1, admin set, per-request lookup | Postgres | user plugin `go test ./... -run TestBackendLink` | ❌ W0 | ⬜ pending | -| D-04 | account contribution seam; existing payloads unchanged | unit + vitest | `go test -short ./modules/cabana -run TestAccountContributions`; `npm --prefix admin run test` | ❌ W0 | ⬜ pending | -| D-21 | `backend` scope and consent line | unit + Postgres | `go test -short ./modules/wristband -run TestMCPScopes`; plugin `-run TestMCPConsent` | ❌ W0 | ⬜ pending | -| SC-4 | `oas_at_` verifier refuses OIDC/revoked/expired/foreign tokens | Postgres | oauthserver plugin `go test ./... -run TestMCPTokenVerifier` | ❌ W0 | ⬜ pending | -| SC-4/D-18 | end-to-end in sm-demo-app incl. unlink removes tools | e2e | `cd ../sm-demo-app && go test ./... -run TestMCPEndToEnd` | ❌ W0 | ⬜ pending | -| D-31 | consumers build and pass at bumped pins | build | `scripts/check-phase19.7.sh` stage `consumers` | ❌ W0 | ⬜ pending | +| SC-1/D-30/D-33 | disabled → nothing mounted; enabled without the tag → boot error; tagged → `/mcp` stream routes and PRM documents; collision names the owner | unit | `go test -short ./modules/surf -run '^TestPierMount$'` and `go test -short -tags summercms_mcp ./modules/surf -run '^TestPierMount$'` | ✅ `modules/surf/pier_mount_test.go` | ✅ green | +| SC-1 | SSE stream flushes through the streaming route kind; throttle, CORS profile and access-log pattern kept; buffered Flush a no-op | unit | `go test -short ./modules/surf -run '^TestStreamingRoute$'` | ✅ `modules/surf/streaming_test.go` | ✅ green | +| SC-2/D-10..D-12/D-14 | binding/duplicate/name boot errors; prefixing; annotations by method | unit | `go test -short ./modules/pier -run '^TestCatalog$'` | ✅ `modules/pier/catalog_test.go` | ✅ green | +| D-11/D-13 | arg split, omitted fields absent, no outer credentials, isError with the route body, `{"data":…}`, size cap, call timeout | unit | `go test -short ./modules/pier -run '^TestDispatch$'` | ✅ `modules/pier/dispatch_test.go` | ✅ green | +| D-15/D-16/D-22 | non-token routes refused; requirement union; method-aware provider; admin token scope per method | unit | `go test -short ./modules/pier -run '^TestGuardRules$'`; `go test -short ./modules/cabana -run '^TestScopeLimitForMethods$'` | ✅ `modules/pier/guard_rules_test.go`, `modules/cabana/scope_limit_for_test.go` | ✅ green | +| D-17 | marker honoured in-process only; not forgeable from HTTP; frontend marker refused by the backend guard and `ResolveBackend` | unit + Postgres | `go test -short ./modules/bouncer ./modules/cabana -run '^TestDispatchMarker$'`; Postgres part `go test ./modules/cabana -run '^TestDispatchMarker$'`; gate stage `marker` | ✅ `modules/bouncer/dispatch_test.go`, `modules/cabana/dispatch_marker_test.go` | ✅ green | +| SC-3/D-20/D-23 | per-principal tools/list; read grant hides write tools; no subject, no tool; unlisted call never reaches the route; union of guards | integration | `go test -short ./modules/pier -run '^TestToolsList$'` | ✅ `modules/pier/tools_list_test.go` | ✅ green | +| D-25 | session binding, DELETE, cross-instance rehydration, TTL, per-binding cap (Redis and memory) | integration | `go test -short ./modules/pier -run '^TestSessions$'` | ✅ `modules/pier/sessions_test.go` | ✅ green | +| D-26/D-27 | pub/sub list_changed; link change and cache bypass; revocation and deletion end sessions and evict stateless servers | integration | `go test -short ./modules/pier -run '^TestFanOut$'` | ✅ `modules/pier/fanout_test.go` | ✅ green | +| D-09 | plugin frontend permission codes in editors; duplicates dropped; saved codes granted | Postgres | user plugin `GOWORK=off go test . -run '^TestFrontendPermissionCatalog$'` | ✅ `plugins/golem15/user/frontend_permission_catalog_test.go` | ✅ green | +| D-03..D-08 | link proof, one-shot, fresh sign-in at the second, 1:1, admin set, events, per-request lookup | Postgres | user plugin `GOWORK=off go test . -run '^TestBackendLink$'` | ✅ `plugins/golem15/user/backend_link_test.go` | ✅ green | +| D-15/D-35 | user guard: parser refusals, deleted user, expired token, dispatch credential against `user.scope` | Postgres | user plugin `GOWORK=off go test . -run '^TestUserMCPGuard$'` | ✅ `plugins/golem15/user/mcp_guard_test.go` | ✅ green | +| D-04 | account contribution seam; Applies and permission filtering; 409; interactive only; transaction; existing payloads unchanged | unit + Postgres + vitest | `go test -short ./modules/cabana -run '^TestAccountContributions$'` (Postgres part without `-short`); `npm --prefix admin run test`; gate check `account.go` unchanged since 51d088a | ✅ `modules/cabana/account_contributions_test.go`, `admin/tests/account/AccountContributions.test.ts` | ✅ green | +| D-34 | prompted record actions: localized prompt, trim and cap, refusals, empty Value for a plain action | unit + Postgres + vitest | `go test -short ./modules/cabana -run '^TestRecordActionPrompt$'`; `go test ./modules/cabana -run '^TestRecordActionPromptRun$'`; `npm --prefix admin run test` | ✅ `modules/cabana/record_action_prompt_test.go`, `admin/tests/form/RecordActionsPrompt.test.ts` | ✅ green | +| D-21 | `backend` scope and consent line | unit + Postgres | `go test -short ./modules/wristband -run '^TestMCPScopes$'`; oauthserver plugin `go test . -run '^TestMCPConsent$'` | ✅ `modules/wristband/mcp_scopes_test.go`, `sm-oauthserver-plugin/mcp_consent_test.go` | ✅ green | +| SC-4 | `oas_at_` verifier refuses OIDC/revoked/expired/foreign/inactive-client/deleted-user tokens; conditional stamp | Postgres | oauthserver plugin `go test . -run '^TestMCPTokenVerifier$'` | ✅ `sm-oauthserver-plugin/mcp_verifier_test.go` | ✅ green | +| D-15/D-16 | Journal tools compile through pier; input keys are the routes' keys; prompt | unit | blog plugin `go test -short . -run '^TestJournalMCP$'` | ✅ `sm-journal-plugin/mcp_test.go` | ✅ green | +| SC-4/D-08/D-18/D-20/D-26 | end-to-end in sm-demo-app incl. unlink list_changed, read grant, revoked grant, personal tokens off | e2e | `cd ../sm-demo-app && go test -tags summercms_mcp . -run '^TestMCPEndToEnd$'` | ✅ `sm-demo-app/mcp_e2e_test.go` | ✅ green | +| D-31 | plugins additive against their pre-phase commits; consumers build and pass at bumped pins | build | `bash scripts/check-phase19.7.sh --plugins` and `--consumers` | ✅ `scripts/check-phase19.7.sh` | ✅ green | -*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky* +*Status legend: ✅ green · ❌ red · ⚠️ flaky. Every row is green as of the plan 05 gate run.* --- ## Wave 0 Requirements -- [ ] `scripts/check-phase19.7.sh` — phase gate (pattern: `scripts/check-phase19.4.sh`) -- [ ] pier test helpers: fake guard provider, fake verifier, two-instance harness on one miniredis, SDK client with a bearer-injecting `http.Client` -- [ ] user-plugin Postgres fixtures for links and frontend permission rows -- [ ] additive-API checks for sm-user-plugin, sm-journal-plugin, sm-oauthserver-plugin +- [x] `scripts/check-phase19.7.sh` — phase gate (pattern: `scripts/check-phase19.4.sh`) +- [x] pier test helpers: fake guard provider, fake verifier, two-instance harness on one miniredis, SDK client with a bearer-injecting `http.Client` (`modules/pier/helpers_test.go`) +- [x] user-plugin Postgres fixtures for links and frontend permission rows (the admin harness, `startLink`/`confirmLink`, the seeded permission rows) +- [x] additive-API checks for sm-user-plugin, sm-journal-plugin, sm-oauthserver-plugin (gate stage `plugins`) --- @@ -83,11 +86,11 @@ Filled in by the planner per task; the behaviour → test map is: ## Validation Sign-Off -- [ ] All tasks have `` verify or Wave 0 dependencies -- [ ] Sampling continuity: no 3 consecutive tasks without automated verify -- [ ] Wave 0 covers all MISSING references -- [ ] No watch-mode flags -- [ ] Feedback latency < 120s -- [ ] `nyquist_compliant: true` set in frontmatter +- [x] All tasks have `` verify or Wave 0 dependencies +- [x] Sampling continuity: no 3 consecutive tasks without automated verify +- [x] Wave 0 covers all MISSING references +- [x] No watch-mode flags +- [x] Feedback latency < 120s for the quick run (the full gate with Docker takes several minutes) +- [x] Nyquist compliance recorded in the frontmatter -**Approval:** pending +**Approval:** plan 19.7-05 (the gate passes in full)