64 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, estimate, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | estimate | must_haves | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 19.7-generic-mcp-module | 01 | execute | 1 |
|
true |
|
|
|
Planner decision P-01 (the "set link" input gap, D-34): 19.6.1's pact.AdminActionExtension record actions carry no input, and D-34 says admins set and remove links on the Administrators screen through that seam. "Remove link" fits a plain record action. "Set link" needs one value (which frontend user). The smallest additive framework change is a prompted record action: pact.AdminRecordAction gains an optional Prompt *pact.AdminActionPrompt (label, placeholder, comment, max length; phrase keys or text) and pact.AdminRecordActionInput gains Value string. The record response's meta.actions[] entry gains prompt only when set; the SPA confirm dialog shows one text input for such an action and posts the existing AdminActionRequest key payload as a JSON string; cabana accepts payload only for a prompted action (the 422 refusal for every other record action is unchanged), trims it, refuses an empty or over-long value with 422 on payload, and hands it to Run as Value. No console command is the only way to link: plan 03's link_frontend_account action uses this Prompt and unlink_frontend_account is a plain Danger action.
Planner decision P-02 (My Profile seam shape, D-04 part 1, Claude's discretion): a contribution interface, not an AdminController extension: pact.HasAccountContributions returns []pact.AccountContribution{Name, Label, Description, Status, Actions}; each pact.AccountAction{Name, Label, Confirm, Danger, Permissions, Applies, Run} runs for the signed-in admin only (AccountActionInput{AdminID}) and may answer a URL the SPA opens in a new tab (the link-proof site URL of D-05). Names are generic; cabana never names the user plugin or MCP.
Planner decision P-03 (marker shape, D-17): bouncer.Dispatch{Guards []string, Principal *Principal, Credential any} under an unexported context key; WithDispatch is the only setter (the phase gate in plan 05 proves only modules/pier and tests call it) and Dispatched(ctx, guardName) the reader, which answers only when the marker lists that exact guard name. bouncer's Registry.Middleware and cabana's ResolveBackend honour it, so the user plugin's user.api_token (the bouncer api_token guard) and Journal's requireBackendPrincipal need no code change for the marker; Journal's optionalBackendPrincipal short-circuit is plan 04's one-line fix.
Planner decision P-04 (pact stays SDK-free, D-33): every plugin-facing type lands in modules/pact with no import of the MCP SDK, jsonschema-go or bouncer; pact.MCPDispatch.Principal is any (pier asserts *bouncer.Principal). Guard providers register in a *pact.MCPGuards registry published on the app (find-or-publish pattern), the oas_at_ verifier is published as pact.MCPTokenVerifier, the personal-token resolver as pact.MCPPersonalTokenResolver, the link service as pact.MCPLinkedBackendResolver, and plugins fire pact.MCPSubjectChanged on the festival bus.
Purpose: plans 02-04 build on published contracts instead of discovering them; the framework release in plan 02 carries these seams together with 19.6.1.
Output: the seams above, their smoke tests (unit tests proper are plan 05), README and docs updates in the same commits, the regenerated admin OpenAPI and the rebuilt modules/boardwalk/dist.
<execution_context>
@/.claude/msd-core/workflows/execute-plan.md
@/.claude/msd-core/templates/summary.md
</execution_context>
<project_rules>
- Several Claude sessions work in this repo at once. Before touching
modules/cabana,modules/surforadmin/, rungit status --shortand leave other sessions' uncommitted edits alone. Never editadmin/src/state/useSettings.tsoradmin/src/components/shell/SettingsPanel.vue(a quick task owns them). - Stage files by explicit path, never
git add -A. One logical change per commit; planning docs and code in separate commits; no co-author tags. Do not push or tag in this plan. - Framework code, READMEs and docs never name a consuming application or a specific plugin (use
acme/blog). The docs checker (go run ./cmd/summer docs:build --check) refuses a Go code block withoutsrc=and an identifier that does not exist; a module API change updates that module's README and the affected docs page in the same commit. go vet ./...andgo test -short ./...green at every commit. A change inadmin/rebuildsmodules/boardwalk/dist(npm --prefix admin run build) in the same task and passesscripts/check-admin-dist.sh; a swag annotation change passesscripts/check-admin-openapi.sh. </project_rules>
bouncer (`modules/bouncer/dispatch.go`, new): `type Dispatch struct { Guards []string; Principal *Principal; Credential any }`; `func WithDispatch(ctx context.Context, d *Dispatch) context.Context` stores it under an unexported `dispatchKey struct{}` (nil ctx becomes Background, as WithUser does); `func Dispatched(ctx context.Context, guard string) (*Dispatch, bool)` returns the marker only when `d.Principal != nil` and `guard` is one of `d.Guards` (exact string compare, no wildcard). Document in the type comment that the marker is context-only, that nothing reads a header, cookie or query for it, and that only an in-process dispatcher may set it. In `registry.go` `Middleware`, before `authenticate(ng.g, r)`: `if d, ok := Dispatched(r.Context(), name); ok` then use `d.Principal` and `d.Credential` (WithUser, WithCredential when non-nil) and call next; no guard method runs. Keep every existing error string.
cabana: in `token_guard.go` `ResolveBackend`, before the `authorizationBearer(r) == ""` short-circuit, take `bouncer.Dispatched(r.Context(), "backend")`; when present, require `d.Principal.Backend == true` (a frontend marker is refused with ErrUnauthenticated), apply the existing cover check (`scopeCoversAll` when `Scope != nil && !Scope.Full`) and return `r.WithContext(...)` exactly as lines 222-226 do, with the credential when non-nil. New file `token_resolver.go` (additive exports pier uses; names are final): `func ResolveBackendToken(ctx context.Context, app *backpack.App, raw string) (*bouncer.Principal, *BackendAPIToken, []string, error)` resolves a `g15_` token without the method filter (same `wellFormedAPIToken`, `hashAPIToken`, `FindUsableByHash`, constant-time compare, `users.FindByID`, `stampLastUsed`, `logTokenAuth` with path "mcp" when the request is absent — pass a nil-safe logging variant) and returns the stored scope names; `func ScopeLimitFor(app *backpack.App, scopes []string, method string) (*bouncer.ScopeLimit, int, int)` wraps `methodFilterScopes(reg.tokenScopes, scopes, method)` using the Registry looked up from the app; `func BackendPrincipal(ctx context.Context, app *backpack.App, id uint) (*bouncer.Principal, error)` returns the admin principal through the published backend users provider (Backend, IsSuperuser, PermissionGrants set; nil, nil when the admin does not exist or is deactivated). Reuse the resolver cabana publishes (`*backendResolver` holds the composite guard; add unexported accessors rather than duplicating the lookups).
surf: add `handlers map[string]http.Handler` to Router, filled by a new `compileHandlers() error` that wraps every route once (key `method + " " + path`) and is called by `compile()` (which then uses the map) and by BuildRouter's validation loop (replace the throwaway `r.wrap(rt)` loop with `compileHandlers`); add `func (r *Router) Handler(method, pattern string) (http.Handler, bool)` in `routetable.go` (nil-safe; false before compile). Do not change route ordering, overlap families or the mux.
Smoke tests (`-short`, no Docker): `modules/surf/dispatch_smoke_test.go` `TestDispatchSmoke`: a fake plugin registers a bouncer guard `acme` (a CredentialGuard whose AuthenticateCredential always fails and which implements UnauthorizedWriter with a 401 JSON body) under middleware name `acme.auth`, and a route `GET /acme/items/{id}` behind it whose handler writes `bouncer.User(ctx).ID` and `r.PathValue("id")`; after `BuildRouter` + `compileHandlers` (through `Assemble` or the exported path the test needs), `Handler("GET", "/acme/items/{id}")` is found; a request built with `httptest.NewRequest`, `SetPathValue("id","7")`, `Pattern` set, and a context carrying `WithDispatch(&Dispatch{Guards: []string{"acme"}, Principal: &Principal{ID: 42}})` answers 200 with id 42 and 7; the same request without the marker answers 401; a request with headers `X-Summer-Dispatch: 42`, `Authorization: Dispatch 42` and a cookie answers 401 (nothing reads headers); a marker listing guard `other` answers 401. `modules/bouncer/dispatch_smoke_test.go` `TestDispatchedSmoke`: Dispatched returns false for a nil principal, an unlisted guard and a plain context. `modules/cabana/dispatch_smoke_test.go` `TestDispatchMarkerSmoke`: with an app that has no published resolver, `ResolveBackend(app, r-with-backend-marker, "acme.*")` returns a principal whose ID matches; the same with `Backend: false` returns ErrUnauthenticated; a scoped marker whose Scope does not cover `acme.*` returns ErrTokenScope.
Docs in the same commit: bouncer README (Features + API reference rows for Dispatch, WithDispatch, Dispatched), cabana README (ResolveBackendToken, ScopeLimitFor, BackendPrincipal, marker paragraph in the ResolveBackend row), surf README (Handler row), `docs/services/authentication.md` (new paragraph under "Guards and middleware": the pre-resolved principal marker, who may set it, what honours it), `docs/services/routing.md` (Handler lookup under "Testing and listing routes"). No Go code block without `src=`.
go vet ./... && go test -count=1 -short ./modules/bouncer/... ./modules/cabana/... ./modules/surf/... && go test -count=1 -short -run '^(TestDispatchSmoke|TestDispatchedSmoke|TestDispatchMarkerSmoke)$' -v ./modules/surf ./modules/bouncer ./modules/cabana 2>&1 | grep -c -- '^--- PASS: Test' | grep -qx 3 && go -C examples/hello test -count=1 ./... && go test -count=1 -run '^TestDocsTree$' ./cmd/summer && go run ./cmd/summer docs:build --check
non-zero exit, "FAIL" in the output, or the PASS count line is not exactly 3
- `grep -c "func WithDispatch(" modules/bouncer/dispatch.go` prints 1 and `grep -c "func Dispatched(" modules/bouncer/dispatch.go` prints 1
- `grep -n "Dispatched(r.Context(), name)" modules/bouncer/registry.go` prints one line that comes before the line containing `authenticate(ng.g, r)`
- `grep -c "bouncer.Dispatched(" modules/cabana/token_guard.go` prints 1 and `grep -c "func ResolveBackendToken(\|func ScopeLimitFor(\|func BackendPrincipal(" modules/cabana/token_resolver.go` prints 3
- `grep -c "func (r \*Router) Handler(" modules/surf/routetable.go` prints 1 and `grep -c "func (r \*Router) compileHandlers(" modules/surf/router.go` prints 1
- `go test -count=1 -short -run '^TestDispatchSmoke$' -v ./modules/surf 2>&1 | grep -q -- '^--- PASS: TestDispatchSmoke'`
- `go test -count=1 -short -run '^TestDispatchMarkerSmoke$' -v ./modules/cabana 2>&1 | grep -q -- '^--- PASS: TestDispatchMarkerSmoke'`
- Every pre-existing test in modules/bouncer, modules/cabana and modules/surf passes unchanged (no existing test file modified in this task)
- `grep -c "Dispatched" modules/bouncer/README.md docs/services/authentication.md` prints a non-zero count for both files
A marker-carrying in-process call runs a guarded route through surf's compiled chain as the pre-resolved principal; HTTP requests cannot forge it; cabana's ResolveBackend honours a backend marker and refuses a frontend one; the handler lookup, the additive token resolvers and their docs are committed.
Task 2: Streaming route kind, the tagged pier mount hook, wristband's configurable MCP scope set and cooler's key prefix export
modules/surf/router.go, modules/surf/streaming.go, modules/surf/pier_off.go, modules/surf/streaming_smoke_test.go, modules/surf/pier_mount_smoke_test.go, modules/surf/README.md, modules/wristband/authorize.go, modules/wristband/server.go, modules/wristband/mcp_scopes_smoke_test.go, modules/wristband/README.md, modules/cooler/cooler.go, modules/cooler/README.md, docs/services/routing.md, docs/services/oauth-server.md
- modules/surf/router.go (route struct, wrap 408-491 including the rt.raw ? recoverBare : recoverJSON choice, recoverJSON/recoverBare/bufferedResponse 786-860, BuildRouter 624-654 where mountAPIDocs and cabana.Activate run)
- modules/surf/apidocs.go 88-165 (config-gated mount, apiDocsPath, collision check against r.seen, BindPlugin, GroupRaw)
- modules/surf/accesslog.go (statusRecorder: Flush and Unwrap pass through; confirm the outer layers do not buffer)
- modules/lagoon/attach/s3_on.go, s3_off.go, bucket.go 24-28 (the build-tag pattern and the exported tag constant)
- internal/build/manifest.go 20-30 and 86-110 (build.tags) and internal/build/manifest_tags_smoke_test.go
- modules/wristband/authorize.go 15-30 and 205-225 (authorizeAllowedScopes, parseAuthorizeScopes) and server.go 28-45, 90-105, 160-195 (Options.ScopesSupported, DefaultOptions, Metadata)
- modules/wristband/*_test.go that cover parseAuthorizeScopes or scope errors (grep "unsupported value" and "scopes_supported")
- modules/cooler/cooler.go 310-365 (OpenRedis, openFromConfig, RedisURLKey, keyPrefix) and modules/cooler/README.md Configuration
- .planning/phases/19.7-generic-mcp-module/19.7-RESEARCH.md § "Pitfall 1", § "Pitfall 5", § "Pattern 1", § "Open Question 2" and CONTEXT D-30, D-33
- .planning/phases/19.7-generic-mcp-module/19.7-PATTERNS.md § "FW/modules/surf/pier_on.go / pier_off.go" and § "FW/modules/wristband/authorize.go"
surf streaming kind (Pitfall 1): add `stream bool` to `route`; in `wrap`, when `rt.stream` is set wrap with a new `recoverStream(pages, next)` (in `streaming.go`) instead of recoverJSON/recoverBare: it serves `next` directly on the real ResponseWriter (no bufferedResponse, so `http.Flusher` reaches the client), recovers a panic by writing wire's opaque 500 only when nothing has been written yet (track with a small `headerSentWriter` that records the first WriteHeader/Write and implements Flush and Unwrap), otherwise it only aborts and marks the request panicked; keep constraints, orgSlot, named middleware, body limit, locale, the CORS profile and recordPattern exactly as other routes. Add `func (r *Router) MountStream(method, path string, h http.Handler, middleware ...string) error` which registers one raw+stream route under the currently bound plugin (same validation as the raw group path, `seen` collision error naming the owner) and the `surf.MCPBuildTag = "summercms_mcp"` constant.
pier hook (D-30, D-33): package-level `var mountPier func(r *Router, app *backpack.App, plugins []party.Plugin) error` in `router.go`; in `BuildRouter`, after the `admin != nil` block and before `compileHandlers`, read `app.Config.Bool("mcp.enabled")`: false → nothing; true and `mountPier == nil` → return the error `surf: mcp.enabled is true but this binary was built without the summercms_mcp tag (summer.yaml build.tags)`; true and set → call it and return its error. `pier_off.go` carries `//go:build !summercms_mcp` and a comment that the tagged counterpart (plan 02's `pier_on.go`) sets the hook; it declares nothing else (the var lives in router.go so both builds compile). Also add the inline-throttle note: pier will use the existing `throttle:<max>,<minutes>` inline spelling, so no bucket registration is added here.
wristband (Pitfall 5, D-21): `parseAuthorizeScopes(raw string, allowed map[string]bool)`; the Server builds `allowed` from `s.opts.ScopesSupported` (empty → the four PHP defaults, so `authorizeAllowedScopes` stays as the default set and every existing test passes unchanged); `Authorize` passes the server's set. Metadata already lists `s.opts.ScopesSupported`. Smoke `TestMCPScopesSmoke`: a server whose Options.ScopesSupported appends `backend` accepts `scope=read backend` at authorize (no `invalid_scope`) and lists it in metadata; the default server still answers the unsupported-value error for `backend`.
cooler: export `func KeyPrefix(cfg *compass.Config) string` (wrapping keyPrefix; document the `<prefix>` rule in the README API reference) so pier's keys are `<prefix>mcp:...`; no other cooler change (pier opens Redis lazily with `cooler.OpenRedis` and `RedisURLKey`).
Smoke tests: `TestStreamingRouteSmoke` (surf): a stream route handler writes `event: a` + flush, waits for a channel, writes `event: b`; served through `httptest.NewServer`, a client reading the body incrementally receives the first event before the test closes the channel (a buffered route in the same test does not deliver until the handler returns); a panic after the first flush ends the body without a 500 status rewrite; a panic before any write answers 500. `TestPierMountSmoke` (surf): with `mcp.enabled` unset BuildRouter mounts no route whose pattern starts with `/mcp` or `/.well-known/oauth-protected-resource` and `Routes()` is identical to a build without the key; with `mcp.enabled: true` (and no tag in this test binary) BuildRouter's error contains `summercms_mcp`.
Docs in the same commits: surf README (Features: streaming route kind and the mcp hook; API reference: MountStream, MCPBuildTag; Configuration: `mcp.enabled` is read here only to call the hook), `docs/services/routing.md` (new section "Streaming routes"), wristband README + `docs/services/oauth-server.md` (ScopesSupported governs the authorize allow-list), cooler README (KeyPrefix).
go vet ./... && go test -count=1 -short ./modules/surf/... ./modules/wristband/... ./modules/cooler/... && go test -count=1 -short -run '^(TestStreamingRouteSmoke|TestPierMountSmoke|TestMCPScopesSmoke)$' -v ./modules/surf ./modules/wristband 2>&1 | grep -c -- '^--- PASS: Test' | grep -qx 3 && go -C examples/hello test -count=1 ./... && go test -count=1 -run '^TestDocsTree$' ./cmd/summer && go run ./cmd/summer docs:build --check
non-zero exit, "FAIL" in the output, or the PASS count line is not exactly 3
- `grep -c "func (r \*Router) MountStream(" modules/surf/streaming.go` prints 1 and `grep -c "func recoverStream(" modules/surf/streaming.go` prints 1
- `grep -c "MCPBuildTag = \"summercms_mcp\"" modules/surf/*.go` prints 1 and `head -1 modules/surf/pier_off.go` prints `//go:build !summercms_mcp`
- `grep -c "var mountPier func" modules/surf/router.go` prints 1 and `grep -c "built without the summercms_mcp tag" modules/surf/router.go` prints 1
- `grep -c "func parseAuthorizeScopes(raw string, allowed map\[string\]bool)" modules/wristband/authorize.go` prints 1
- `grep -c "func KeyPrefix(" modules/cooler/cooler.go` prints 1
- `go test -count=1 -short ./modules/wristband/...` passes with no existing wristband test modified
- `go test -count=1 -short -run '^TestStreamingRouteSmoke$' -v ./modules/surf 2>&1 | grep -q -- '^--- PASS: TestStreamingRouteSmoke'`
- `grep -c "Streaming routes" docs/services/routing.md` prints 1
A stream route flushes to the client mid-handler, mcp.enabled is inert without the tag and fails boot by name with it missing, wristband's MCP scope set follows Options.ScopesSupported with an unchanged default, and cooler exposes KeyPrefix; docs and READMEs updated.
Task 3: SDK-free pact contracts: MCP tools, prompts, guards, verifiers, link resolver, subject events, frontend permissions, prompted record actions and account contributions
The pact types are a published framework API that plugins compile against (D-28 recorded costly; the user chose the tools/prompts/resources-ready shape).
modules/pact/mcp.go, modules/pact/capabilities.go, modules/pact/capabilities_test.go, modules/pact/README.md, docs/plugins/registration.md
- modules/pact/capabilities.go (Permission/HasPermissions 548-558, TokenScope/HasTokenScopes 562-573, AdminActionExtension 378-412, AdminRecordAction 343-364, AdminActionInput 232-250 and its Payload comment, the import list at the top: pact imports bonfire but not bouncer)
- modules/pact/capabilities_test.go 300-390 (compile-time discovery test shape)
- modules/pact/README.md § "API reference"
- docs/plugins/registration.md § "Capability interfaces"
- .planning/phases/19.7-generic-mcp-module/19.7-RESEARCH.md § "Pattern 2", § "Pattern 5", § "Pattern 6" (credential for user.scope), § "Code Examples: Annotations from method", § "Frontend tool needs a new route"
- .planning/phases/19.7-generic-mcp-module/19.7-CONTEXT.md D-09, D-10..D-16, D-23, D-26, D-28, D-34, D-35
New file `modules/pact/mcp.go` (standard library imports only, plus nothing from the SDK, jsonschema-go or bouncer). Types, all exported, names final:
- `HasMCP interface { MCP() MCP }`; `MCP struct { Tools []MCPTool; Prompts []MCPPrompt }` with a doc comment that resources are a later field (CONTEXT Deferred Ideas) and that the struct form keeps that addition non-breaking (D-28).
- `MCPTool struct { Name, Title, Description string; Guard string; Method, Path string; Input any; Output any; Permissions []string; ReadOnly, Destructive, Idempotent, OpenWorld *bool }`. Doc comment lists the boot failures the module enforces (D-10 route not found, D-12 duplicate or invalid name, D-15 route not token-guarded and no Guard, Input not a struct, a `path:"x"` tag without a `{x}` segment or a segment without a tag), the argument mapping (D-11: `path:"id"` fills `{id}`, `query:"q"` goes to the query string, remaining `json` fields form the body, `jsonschema:"description"` tags describe), the result rule (D-13) and the annotation derivation (D-14: GET read-only+idempotent, PUT idempotent, DELETE destructive, nil pointer means derived).
- `MCPPrompt struct { Name, Title, Description string; Guard string; Permissions []string; Arguments []MCPPromptArgument; Render func(ctx context.Context, args map[string]string) ([]MCPPromptMessage, error) }`, `MCPPromptArgument struct { Name, Description string; Required bool }`, `MCPPromptMessage struct { Role, Text string }` (Role `user` or `assistant`).
- Guard providers: `MCPGuard interface { MCPGuardName() string; MCPTokenGuarded(middleware []string) bool; MCPRequirements(middleware []string) (MCPRequirements, error); MCPAllows(ctx context.Context, subject MCPSubject, req MCPRequirements, permissions []string) (bool, error); MCPDispatch(ctx context.Context, subject MCPSubject, method string) (MCPDispatch, error) }`; `MCPRequirements struct { Scopes []string; Permissions []string }`; `MCPSubject struct { Guard string; UserID uint; Scopes []string; ClientID string; TokenID uint }`; `MCPDispatch struct { Principal any; Credential any; Guards []string }` (Principal is the bouncer principal as `any`, see P-04); `MCPGuards` registry type with `NewMCPGuards()`, `Register(g MCPGuard) error` (empty or duplicate name fails with a `pact: ...` error naming the guard), `Lookup(name string) (MCPGuard, bool)`, `Names() []string` (sorted), safe for concurrent use.
- Token verification: `MCPTokenVerifier interface { MCPVerifyToken(ctx context.Context, raw string) (MCPGrant, error); MCPResource() string }`, `MCPGrant struct { UserID uint; ClientID string; TokenID uint; Scopes []string; ExpiresAt time.Time }`, `var ErrMCPTokenInvalid = errors.New("pact: mcp token invalid")`; `MCPPersonalTokenResolver interface { MCPResolvePersonalToken(ctx context.Context, raw string) (MCPSubject, bool, error) }` (false when the prefix is not the resolver's).
- Link: `MCPLinkedBackendResolver interface { LinkedBackendUser(ctx context.Context, frontendUserID uint) (LinkedBackendUser, bool, error) }`, `LinkedBackendUser struct { ID uint; Login string; DisplayName string }`.
- Event: `MCPSubjectChanged struct { Guard string; UserID uint; Kind string }` with constants `MCPSubjectPermissions = "permissions"`, `MCPSubjectLink = "link"`, `MCPSubjectRevoked = "revoked"`, `MCPSubjectDeleted = "deleted"`; doc comment: fired through the festival bus by whoever changes a subject's permissions, link, grants or existence (D-26 sources).
- Frontend permissions (D-09): `FrontendPermission struct { Code, Label, Tab, Comment string }`, `HasFrontendPermissions interface { FrontendPermissions() []FrontendPermission }`.
In `capabilities.go` (additive): `AdminActionPrompt struct { Label, Placeholder, Comment string; MaxLength int }` (phrase keys or text; MaxLength 0 means 255); `AdminRecordAction.Prompt *AdminActionPrompt` with a `json:"-"`-free field (it is not serialized by pact) and a doc sentence replacing "A record action carries no input beyond the record." in the AdminActionExtension comment with the prompt rule (P-01); `AdminRecordActionInput.Value string` ("the trimmed prompt answer; empty for an action without a Prompt"). Account seam (P-02): `HasAccountContributions interface { AccountContributions() []AccountContribution }`, `AccountContribution struct { Name, Label, Description string; Status func(ctx context.Context, adminID uint) (string, error); Actions []AccountAction }`, `AccountAction struct { Name, Label, Confirm string; Danger bool; Permissions []string; Applies func(ctx context.Context, adminID uint) (bool, error); Run func(ctx context.Context, in AccountActionInput) (AccountActionResult, error) }`, `AccountActionInput struct { AdminID uint }`, `AccountActionResult struct { Message, URL string }`; doc comments list the boot failures cabana enforces (identifier names, duplicate contribution or action name across plugins, nil Run, empty Label) and that Status and Applies must be pure reads.
Tests in `capabilities_test.go`: compile-time discovery of HasMCP, HasFrontendPermissions and HasAccountContributions on sample plugins (type assertions), MCPGuards register/duplicate/lookup/sorted names, and a struct-literal test that every new type is constructible without importing anything outside pact (a `go list -deps ./modules/pact` assertion in the test that the dependency list contains neither `modelcontextprotocol` nor `jsonschema-go` nor `modules/bouncer`).
Docs: pact README API reference rows for every new type and interface; `docs/plugins/registration.md` capability table rows for HasMCP, HasFrontendPermissions, HasAccountContributions, and a sentence on AdminRecordAction.Prompt. The MCP usage page itself is plan 02's `docs/services/mcp.md`.
go vet ./modules/pact/... && go test -count=1 -short ./modules/pact/... && DEPS=$(go list -deps ./modules/pact) && ! printf '%s\n' "$DEPS" | grep -q 'modelcontextprotocol\|jsonschema-go\|modules/bouncer' && go test -count=1 -run '^TestDocsTree$' ./cmd/summer && go run ./cmd/summer docs:build --check
non-zero exit, "FAIL" in the output, `go list -deps` failing (the captured assignment short-circuits the chain), or any dependency line matching modelcontextprotocol, jsonschema-go or modules/bouncer
- `grep -c "type HasMCP interface\|type MCPTool struct\|type MCPPrompt struct\|type MCPGuard interface\|type MCPGuards struct\|type MCPTokenVerifier interface\|type MCPLinkedBackendResolver interface\|type MCPSubjectChanged struct\|type HasFrontendPermissions interface" modules/pact/mcp.go` prints 9
- `grep -c "type AdminActionPrompt struct\|type HasAccountContributions interface\|type AccountContribution struct\|type AccountAction struct\|type AccountActionResult struct" modules/pact/capabilities.go` prints 5
- `grep -c "Prompt \*AdminActionPrompt" modules/pact/capabilities.go` prints 1 and `grep -c "Value string" modules/pact/capabilities.go` prints at least 1
- `DEPS=$(go list -deps ./modules/pact) && ! printf '%s\n' "$DEPS" | grep -q 'modelcontextprotocol\|jsonschema-go\|modules/bouncer'` exits 0 (a failing `go list` fails the criterion rather than passing it)
- `grep -c "HasMCP\|HasFrontendPermissions\|HasAccountContributions" docs/plugins/registration.md` prints at least 3
- `go test -count=1 -short ./modules/pact/...` passes
Every plugin-facing contract of the phase compiles in pact without the SDK; discovery tests pass; README and registration docs list them.
Task 4: cabana server side: the account contribution routes, the prompted record action and backend subject-changed events
modules/cabana/account_contributions.go, modules/cabana/account_contributions_smoke_test.go, modules/cabana/record_action_prompt_smoke_test.go, modules/cabana/action_extensions.go, modules/cabana/actions.go, modules/cabana/crud.go, modules/cabana/schema_types.go, modules/cabana/http.go, modules/cabana/admin_openapi.go, modules/cabana/subject_events.go, modules/cabana/README.md, modules/phrasebook/backend/lang/en/lang.yaml, modules/phrasebook/backend/lang/pl/lang.yaml, admin/openapi/admin.json, admin/src/api/schema.d.ts, docs/backend/admin-controllers.md, docs/backend/users-and-permissions.md
- modules/cabana/action_extensions.go (compileActionExtensions, checkContributedAction, wrapAdministratorsContributedRun)
- modules/cabana/actions.go 187-260 and 327-345 (recordAction handler, the payload refusal at line 211-214, recordActionOf, allowAction, decodeActionRequest)
- modules/cabana/crud.go 548-640 (offeredRecordActions, CRUDService.RecordAction)
- modules/cabana/schema_types.go 229-236 (RecordAction JSON) and admin_openapi.go 95-125, 755-790 (AdminProfile, AdminActionRequest, AdminActionResult swag types)
- modules/cabana/http.go 78-235 (Activate: where compileActionExtensions and compileContributions run) and 284-300 (the /account routes block)
- modules/cabana/account.go 1-80 and auth.go 340-362 (handler shape, WriteData, interactiveOnly, requireAjax)
- modules/cabana/account_tokens.go (accountTokenRevoke: where the backend revoked event is fired)
- modules/cabana/backend_users_admin.go (FormAfterUpdate/role and permission changes, deactivate and delete record and bulk actions: where backend permissions/deleted events are fired) and backend_roles_admin.go (role save)
- modules/cabana/example_action_extension_test.go and administrators_harness_test.go (test env shapes)
- modules/festival/bus.go 40-90 (Bus.Fire)
- scripts/check-admin-openapi.sh (what regenerates admin/openapi/admin.json and schema.d.ts)
- .planning/phases/19.6.1-backend-administrators-screen/19.6.1-01-SUMMARY.md and 19.6.1-04-SUMMARY.md (the seam and the outranking wrap)
- .planning/phases/19.7-generic-mcp-module/19.7-PATTERNS.md § "FW/modules/cabana/account_contributions.go"
Account contributions (P-02, D-04 part 1), new `account_contributions.go`: `compileAccountContributions(reg *Registry, plugins []party.Plugin) error` collects `pact.HasAccountContributions` in activation order into `reg.accountContributions` (ordered slice + map by name); boot errors with the `cabana: plugin %s contributes account section %q ...` prefix for a non-identifier name, a name another plugin already contributed, an empty Label, an action with a non-identifier name, a duplicate action name within the section, a nil Run or an empty action Label. Call it in `Activate` right after `compileActionExtensions`. Handlers: `accountContributionsList` (GET) answers `WriteData(w, 200, []AccountContributionView, map[string]any{})` where each view is `{name, label, description, status, actions: [{name, label, confirm, danger}]}` with label/description/confirm/status translated through `translateKey`, `status` from `Status(ctx, principal.ID)` (omitted when the func is nil or returns ""), actions filtered by `Allows(principal, action.Permissions)` and `Applies(ctx, principal.ID)`; `accountContributionAction` (POST `{name}/actions/{action}`): 404 `not_found` for an unknown section or action, 403 through `allowAction`, 409 `actionConflict` when Applies is false, then `Run(ctx, pact.AccountActionInput{AdminID: principal.ID})` inside `s.transaction` (ctx carries the tx as record actions do) and answers `WriteData(w, 200, AccountActionResultView{Message (translated), URL}, nil)`; the audit log line `cabana: account contribution action` carries admin_id, section and action. Routes in `http.go` next to the tokens routes: `g.Get("/account/contributions", interactiveOnly(s.accountContributionsList))` and `g.Post("/account/contributions/{name}/actions/{action}", interactiveOnly(requireAjax(s.accountContributionAction)))`. Swag-annotate both (types `AccountContributionView`, `AccountContributionActionView`, `AccountActionResultView` in admin_openapi.go). Every existing `/account*`, `/auth/me` and record payload stays byte-identical (nothing in account.go changes).
Prompted record action (P-01, D-34): `RecordAction` gains `Prompt *RecordActionPrompt` with JSON `prompt,omitempty` and `RecordActionPrompt{Label, Placeholder, Comment string; MaxLength int}` (`label`, `placeholder,omitempty`, `comment,omitempty`, `max_length`); `offeredRecordActions` fills it (translated) when the action declares a Prompt; `checkContributedAction` and the owner-action compile (`compileRecordActions`) refuse a Prompt with an empty Label. `recordAction` handler: when the registered action has a Prompt, `in.Payload` must be a JSON string (decode with encoding/json into a string; anything else is 422 on `payload` "The payload must be a string."), trimmed, non-empty and at most MaxLength (0 means 255) runes, else 422 on `payload` with the new phrase `backend::lang.form.action_prompt_required` / `action_prompt_too_long` (en + pl); the existing refusal for `record_id`, `values` and for `payload` on an action without a Prompt is unchanged. Add `func (s CRUDService) RecordActionWithValue(ctx, cc, id, name, value string)` carrying the value into `pact.AdminRecordActionInput{RecordID, Record, Value}`; keep `RecordAction(ctx, cc, id, name)` as a wrapper with an empty value (exported signature unchanged).
Backend subject events (D-26 sources on the backend side), new `subject_events.go`: `fireSubjectChanged(ctx, app, kind string, adminIDs ...uint)` fires `pact.MCPSubjectChanged{Guard: "backend", UserID: id, Kind: kind}` for each id through `app.Events` when the bus exists (errors logged, never failing the save). Call it with `MCPSubjectRevoked` from the account token revoke path, with `MCPSubjectPermissions` after an Administrators save that changed role_id, permissions or is_superuser (the FormAfterUpdate snapshot already knows the prior role) and after a Roles save that changed permissions (one event per admin holding that role, ids read inside the same tx), and with `MCPSubjectDeleted` after deactivate, delete and their bulk forms.
Smoke tests (-short, through the harness shape of `backend_screens_test.go`/`example_action_extension_test.go`, no Postgres): `TestAccountContributionsSmoke` (a fake plugin contributes one section with a status and two actions; GET lists it with translated labels and omits an action whose Applies is false; POST runs the action and returns its URL; a `g15_` token or raw bearer gets 403 interactive_only; boot refuses a duplicate name across two plugins); `TestRecordActionPromptSmoke` (a contributed prompted action on a controller of the test plugin: the show payload carries `prompt` with `max_length`; POST with `{"payload":" acme "}` hands `Value == "acme"` to Run; `{"payload":""}` and `{"payload":123}` are 422 on payload; an action without a Prompt still refuses `payload`; the record response of a controller without prompted actions has no `prompt` key).
Then `scripts/check-admin-openapi.sh` (regenerates `admin/openapi/admin.json` and `admin/src/api/schema.d.ts`; commit them). Docs in the same commit: cabana README (Features: account contributions, prompted record actions, backend subject events; Admin API routes table: the two routes; API reference rows), `docs/backend/users-and-permissions.md` § "My account" (plugins can add sections and actions), `docs/backend/admin-controllers.md` § "Adding record actions to another controller" (the Prompt). Any Go example block needs `src=` pointing at a tested example file (extend `example_action_extension_test.go` with a prompted action example and add `example_account_contribution_test.go` if a code block is used).
go vet ./... && go test -count=1 -short ./modules/cabana/... ./modules/pact/... && go test -count=1 -short -run '^(TestAccountContributionsSmoke|TestRecordActionPromptSmoke)$' -v ./modules/cabana 2>&1 | grep -c -- '^--- PASS: Test' | grep -qx 2 && scripts/check-admin-openapi.sh --check && go -C examples/hello test -count=1 ./... && go test -count=1 -run '^TestDocsTree$' ./cmd/summer && go run ./cmd/summer docs:build --check
non-zero exit, "FAIL" in the output, the PASS count line is not exactly 2, or check-admin-openapi reports a difference
- `grep -c "func compileAccountContributions(" modules/cabana/account_contributions.go` prints 1 and `grep -c "account/contributions" modules/cabana/http.go` prints 2
- `grep -c "Prompt \*RecordActionPrompt" modules/cabana/schema_types.go` prints 1 and `grep -c "json:\"prompt,omitempty\"" modules/cabana/schema_types.go` prints 1
- `grep -c "func (s CRUDService) RecordActionWithValue(" modules/cabana/crud.go` prints 1 and `grep -c "func (s CRUDService) RecordAction(" modules/cabana/crud.go` prints 1
- `grep -c "func fireSubjectChanged(" modules/cabana/subject_events.go` prints 1 and `grep -c "fireSubjectChanged(" modules/cabana/account_tokens.go modules/cabana/backend_users_admin.go modules/cabana/backend_roles_admin.go` shows a non-zero count for each of the three files
- `grep -c "action_prompt_required" modules/phrasebook/backend/lang/en/lang.yaml modules/phrasebook/backend/lang/pl/lang.yaml` prints 1 for each file
- `grep -c "AccountContributionView" admin/openapi/admin.json` prints a non-zero count and `scripts/check-admin-openapi.sh --check` exits 0
- account.go untouched by the phase: `git rev-parse -q --verify '51d088a^{commit}' >/dev/null && git diff --quiet 51d088a -- modules/cabana/account.go` exits 0 (51d088a is the framework HEAD when this plan was written; the file must be byte-identical to that commit, and an unknown base or a git error exits non-zero instead of passing)
- Both smoke tests print `--- PASS`
cabana lists and runs plugin account contributions behind interactiveOnly, accepts a prompt value only for prompted record actions, fires backend subject-changed events, and the OpenAPI document, schema types and docs are regenerated and committed; existing account and record payloads unchanged.
Task 5: Admin SPA: the account contributions section, the prompt input in the record action confirm dialog, and the rebuilt embedded admin
admin/src/components/ui/confirm.ts, admin/src/components/ui/ConfirmDialog.vue, admin/src/components/form/RecordActions.vue, admin/src/components/account/AccountContributions.vue, admin/src/views/AccountView.vue, admin/src/api/types.ts, admin/tests/account/AccountContributions.test.ts, admin/tests/form/RecordActionsPrompt.test.ts, modules/boardwalk/dist
- admin/src/components/form/RecordActions.vue (confirm.ask at 49-56, api.POST with body {} at 59-62, the toast and emit paths 74-95)
- admin/src/components/ui/confirm.ts (ConfirmRequest, useConfirm) and admin/src/components/ui/ConfirmDialog.vue (props, the danger variant, busy handling)
- admin/src/views/AccountView.vue (ApiTokensPanel placement, api.PUT and showToast usage, the section markup 248-300) and admin/src/components/account/ApiTokensPanel.vue (a self-loading account panel: the pattern to copy)
- admin/src/api/types.ts 55-70 (how Schemas types are exported) and admin/src/api/schema.d.ts (regenerated in Task 4: cabana.RecordAction.prompt, cabana.AccountContributionView)
- admin/tests/views/AccountView.test.ts 1-60 and admin/tests/helpers.ts (mountApp, API, envelope, requestsTo) and admin/tests/form/PreviewView.test.ts (record action tests)
- admin/tests/form/FormView.test.ts "field triggers on the form" block (how 19.6.1 added SPA backstops)
- scripts/check-admin-dist.sh and .planning/notes/2026-10-07-embedded-admin-release-gate.md
confirm.ts: `ConfirmRequest` gains `prompt?: { label: string; placeholder?: string; comment?: string; maxLength: number }`; `useConfirm` keeps a `value = ref('')` reset on ask/settle and `ask` resolves with the typed value available to the caller (return `Promise` unchanged, expose `value`). ConfirmDialog.vue: optional `prompt` prop renders a labelled text input (`id` from the dialog id prefix, `maxlength`, `autocomplete="off"`, `aria-describedby` on the comment, autofocus when present) above the buttons; the confirm button is disabled while the trimmed value is empty; Enter in the input confirms. RecordActions.vue: pass `action.prompt` into `confirm.ask`; when the action has a prompt, POST `body: { payload: value.trim() }`, otherwise `body: {}` exactly as today; a 422 on `payload` shows the server's detail text as a danger toast and keeps the dialog closed.
AccountContributions.vue (new, under components/account): on mount `api.GET('/account/contributions')`; renders nothing when the list is empty; for each section a card (same classes as the avatar card: `rounded-card border border-border bg-surface p-7 shadow-card`) with `h2` label, muted description, a `status` line (`data-account-contribution-status`) and one outline Button per action; an action with `confirm` or `danger` goes through `useConfirm` + ConfirmDialog (danger variant), then `api.POST('/account/contributions/{name}/actions/{action}')`; on success show `message` as a toast, reload the list, and when `url` is present open it with `window.open(url, '_blank', 'noopener')` and also render it as a visible link (`data-account-contribution-url`, `rel="noopener noreferrer"`, `target="_blank"`) so a blocked popup still leaves a way through; 409 shows `backend::lang.form.action_stale` and reloads; 403 shows `backend::lang.list.action_forbidden`. Labels, descriptions, statuses and messages come from the server already translated and render as text (no `v-html`). AccountView.vue mounts `<AccountContributions />` after `ApiTokensPanel`. types.ts exports `AccountContribution`, `AccountContributionAction`, `AccountActionResult` from the regenerated schema.
Vitest smokes: `admin/tests/account/AccountContributions.test.ts` (list renders two sections with statuses; an action with a URL posts, shows the toast and renders the link; an empty list renders no card; a 409 shows the stale toast and refetches) and `admin/tests/form/RecordActionsPrompt.test.ts` (a prompted action renders the input, the confirm button is disabled until a value is typed, the POST body is `{ payload: 'acme' }`; an action without a prompt still posts `{}`). Then `npm --prefix admin run typecheck`, `npm --prefix admin run test`, `npm --prefix admin run build`, commit `modules/boardwalk/dist` (one `chore` commit, as 19.6.1-02 did), `scripts/check-admin-dist.sh`. Do not run `npm ci` (node_modules is shared with other sessions) unless `npm ls` reports an inconsistent tree.
scripts/check-admin-openapi.sh --check && npm --prefix admin run typecheck && npm --prefix admin run test && scripts/check-admin-dist.sh
non-zero exit, a vitest summary line that is not all passing, or check-admin-dist reporting that modules/boardwalk/dist differs from a fresh build
Sign in to a locally served admin (any app with an admin, e.g. `go -C examples/hello run .` if it serves the admin, otherwise skip to plan 03's user plugin env) and open My account: with no plugin contributing, the page is unchanged. On a preview screen of a controller with a prompted contributed action (plan 03's Administrators link action), the confirm dialog shows one text input and the confirm button is disabled until text is typed.
- `grep -c "prompt" admin/src/components/ui/confirm.ts` prints at least 2 and `grep -c "maxlength" admin/src/components/ui/ConfirmDialog.vue` prints at least 1
- `grep -c "payload: " admin/src/components/form/RecordActions.vue` prints at least 1 and `grep -c "body: {}" admin/src/components/form/RecordActions.vue` prints at least 1
- `test -f admin/src/components/account/AccountContributions.vue` and `grep -c "AccountContributions" admin/src/views/AccountView.vue` prints at least 2
- `grep -c "v-html" admin/src/components/account/AccountContributions.vue` prints 0
- `npm --prefix admin run test 2>&1 | grep -E 'Test Files +[0-9]+ passed' | grep -qv failed`
- `scripts/check-admin-dist.sh` prints that modules/boardwalk/dist matches a fresh build
- `git status --short admin/src/state/useSettings.ts admin/src/components/shell/SettingsPanel.vue` shows no change made by this task (those files belong to another session)
The admin shows plugin account sections on My account, asks for a prompt value before running a prompted record action, and the embedded build matches the committed dist.
<artifacts_this_phase_produces>
Artifacts this phase produces (plan 01 owns these; later plans add theirs)
Go (framework)
modules/bouncer/dispatch.go:Dispatch,WithDispatch,Dispatchedmodules/cabana/token_resolver.go:ResolveBackendToken,ScopeLimitFor,BackendPrincipalmodules/cabana/account_contributions.go:compileAccountContributions, handlersaccountContributionsList,accountContributionAction; swag typesAccountContributionView,AccountContributionActionView,AccountActionResultViewmodules/cabana/schema_types.go:RecordAction.Prompt,RecordActionPromptmodules/cabana/crud.go:CRUDService.RecordActionWithValuemodules/cabana/subject_events.go:fireSubjectChangedmodules/surf/streaming.go:(*Router).MountStream,recoverStream,MCPBuildTagmodules/surf/routetable.go:(*Router).Handler;modules/surf/router.go:compileHandlers,mountPierhook,route.streammodules/surf/pier_off.go(//go:build !summercms_mcp)modules/wristband/authorize.go:parseAuthorizeScopes(raw, allowed)overOptions.ScopesSupportedmodules/cooler/cooler.go:KeyPrefixmodules/pact/mcp.go:HasMCP,MCP,MCPTool,MCPPrompt,MCPPromptArgument,MCPPromptMessage,MCPGuard,MCPGuards,NewMCPGuards,MCPRequirements,MCPSubject,MCPDispatch,MCPTokenVerifier,MCPGrant,ErrMCPTokenInvalid,MCPPersonalTokenResolver,MCPLinkedBackendResolver,LinkedBackendUser,MCPSubjectChanged,MCPSubjectPermissions,MCPSubjectLink,MCPSubjectRevoked,MCPSubjectDeleted,FrontendPermission,HasFrontendPermissionsmodules/pact/capabilities.go:AdminActionPrompt,AdminRecordAction.Prompt,AdminRecordActionInput.Value,HasAccountContributions,AccountContribution,AccountAction,AccountActionInput,AccountActionResult
Routes (cabana admin API): GET {api}/account/contributions, POST {api}/account/contributions/{name}/actions/{action}
Config keys read by the framework in this plan: mcp.enabled (surf hook only; the full mcp.* set is plan 02's)
Build tag: summercms_mcp (hook only; the tagged pier_on.go is plan 02's)
Phrases: backend::lang.form.action_prompt_required, backend::lang.form.action_prompt_too_long (en, pl)
Admin SPA: admin/src/components/account/AccountContributions.vue; ConfirmRequest.prompt; regenerated admin/openapi/admin.json, admin/src/api/schema.d.ts; rebuilt modules/boardwalk/dist
Phase-wide identifiers fixed by this plan for plans 02-05: config namespace mcp.* (mcp.enabled, mcp.path default /mcp, mcp.allow_personal_tokens, mcp.sessions.store memory|redis, mcp.sessions.idle_ttl 30m, mcp.sessions.max_per_binding 20, mcp.resource, mcp.throttle 120,1, mcp.allowed_origins, mcp.call_timeout 30s, mcp.max_result_bytes 1048576); guard names user and backend; tool prefix = last dot-segment of the plugin ID + _; permission code golem15.users.manage_backend_links; tables golem15_user_backend_links, golem15_user_backend_link_requests; session binding keys oauth:<client_id>:<user_id>, pat:user:<token_id>, pat:backend:<token_id>; Redis keys <cooler.KeyPrefix>mcp:s:<id> and channel <prefix>mcp:events.
</artifacts_this_phase_produces>
<threat_model>
Trust Boundaries
| Boundary | Description |
|---|---|
| HTTP request to a guarded route | untrusted headers, cookies and bodies cross into bouncer guards and cabana resolvers |
| in-process dispatcher to route handler | a trusted framework caller (pier, plan 02) hands a pre-resolved principal through the context |
| admin SPA to cabana account and action routes | the signed-in admin's browser sends action names and prompt values |
| plugin contributions to cabana at boot | plugin-declared names, labels, prompts and Run funcs are merged into the admin |
| authorize request to wristband | an MCP client's scope string crosses into the allow-list check |
STRIDE Threat Register
| Threat ID | Category | Component | Severity | Disposition | Mitigation Plan |
|---|---|---|---|---|---|
| T-19.7-01 | Spoofing | bouncer dispatch marker | high | mitigate | Context-only value under an unexported key; Dispatched is the only reader and no code path reads a header, cookie or query for it; TestDispatchSmoke sends forged headers and a cookie and gets 401; plan 05's gate greps that only modules/pier calls the setter outside tests |
| T-19.7-02 | Elevation | cabana ResolveBackend with a marker | high | mitigate | A marker is honoured only when it lists guard backend and its principal has Backend == true; a frontend marker is ErrUnauthenticated; cover codes are still checked against a scoped principal (TestDispatchMarkerSmoke) |
| T-19.7-03 | Elevation | surf Handler lookup | medium | mitigate | Handler returns the fully wrapped chain (constraints, named middleware, body limit, recovery), never the bare handler; TestDispatchSmoke proves the guard middleware still runs in-process |
| T-19.7-04 | Tampering | streaming route recovery | medium | mitigate | recoverStream writes an opaque 500 only before the first byte; after that a panic aborts the body and marks the request panicked; it never writes the panic value (TestStreamingRouteSmoke) |
| T-19.7-05 | Denial of Service | mcp.enabled without the tag | low | mitigate | Boot fails with an error naming summercms_mcp instead of serving a half-mounted endpoint (TestPierMountSmoke) |
| T-19.7-06 | Elevation | account contribution actions | high | mitigate | Routes behind the backend guard and interactiveOnly (personal tokens refused), requireAjax on POST, allowAction for the action's Permissions, Applies re-checked before Run, Run receives only the signed-in admin's id (TestAccountContributionsSmoke) |
| T-19.7-07 | Tampering | prompted record action value | medium | mitigate | payload accepted only for actions that declare a Prompt and only as a JSON string, trimmed, non-empty, capped at MaxLength runes; every other record action keeps the 422 refusal (TestRecordActionPromptSmoke); the action's own Run validates the meaning of the value |
| T-19.7-08 | Information Disclosure | account contribution rendering in the SPA | low | mitigate | Labels, statuses, messages and URLs render as text and attributes only (no v-html); the URL opens with noopener |
| T-19.7-09 | Elevation | wristband MCP scope allow-list | medium | mitigate | The allowed set is exactly Options.ScopesSupported; the default is unchanged and TestMCPScopesSmoke proves backend is refused on a default server and accepted only when the host lists it |
| </threat_model> |
<success_criteria>
- All five tasks committed; every acceptance criterion above holds
- No existing test modified except where a test asserted the absence of a key this plan adds (none expected); every pre-existing cabana, surf, bouncer, wristband, pact and admin test passes unchanged
mcp.enabledabsent: the framework behaves exactly as at the plan's base commit (route table, payloads, admin build apart from the two new account routes and thepromptkey that appears only for prompted actions)- Planner decisions P-01..P-04 are implemented as written and named in the SUMMARY </success_criteria>