MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestMCP_BUG3835_ReadingIdleClientGetsKeepalives
CONTROL: a reading client on an idle stream receives the comment, keeps its stream, and frees the slot when it closes the connection. Release on clien
internal/server/bug3835_mcp_keepalive_test.go:62
FunctionTestMCP_BUG3835_RefusedListenLeavesNothing
A subscriptions/listen POST over the budget is refused the same way, before the transport runs, so it leaves no session, subscription or goroutine. Th
internal/server/bug3835_mcp_keepalive_test.go:149
FunctionTestMCP_BUG3835_ToolCallSSEUpgradeEndsWithItsResponse
A tools/call POST that mcp-go upgrades to SSE mid-call takes no slot, gets keepalives while the call runs, and nothing follows its final event.
internal/server/bug3835_mcp_keepalive_test.go:466
FunctionTestMCP_BUG3835_UnservedModernVersionIsNotCounted
A modern header the transport does NOT serve is never a listen either: the body is not read, and at a full budget the request reaches mcp-go, whose un
internal/server/bug3835_mcp_keepalive_test.go:335
FunctionTestMCP_BUG3837_DeletedOAuthTokenEndsTheStream
A deleted token row (fosite ErrNotFound) ends the stream.
internal/server/bug3837_mcp_credential_tick_test.go:252
FunctionTestMCP_BUG3837_DeletedUserIsNotStillValid
A deleted user ends the stream, not "could not ask": GetUser reports a missing row as (nil, nil), and the tick reads nil as gone. Driven directly, bec
internal/server/bug3837_mcp_credential_tick_test.go:294
FunctionTestMCP_BUG3837_DisabledUserEndsTheStream
OAuth, because the PAT door already refuses a disabled user's token and fosite's introspection does not look at the user at all.
internal/server/bug3837_mcp_credential_tick_test.go:216
FunctionTestMCP_BUG3837_ExpiredOAuthTokenEndsTheStream
The lifespan leaves the fixture's setup seconds of margin before the token expires; the stream must be admitted on a live token.
internal/server/bug3837_mcp_credential_tick_test.go:207
FunctionTestMCP_BUG3837_LowercaseBearerIsReadLikeAdmission
The bearer scheme is case-insensitive (RFC 6750), and admission accepts "bearer <tok>". The tick must read the token the same way. A case-sensitive re
internal/server/bug3837_mcp_credential_tick_test.go:269
FunctionTestMCP_BUG3837_OAuthStoreFailureKeepsTheStream
A tick that cannot ask (a storage failure under fosite, which it wraps in the same outer error as a revoked token) keeps the stream, as the session an
internal/server/bug3837_mcp_credential_tick_test.go:233
FunctionTestMCP_BUG3837_RefreshRotationEndsTheStreamAndTheNewTokenOpensOne
Rotation ends the stream (BUG-3837): a refresh rotation flips the old access token inactive, so a live stream opened with it ends at its next tick, ev
internal/server/bug3837_mcp_credential_tick_test.go:319
FunctionTestMCP_BUG3837_RevokedOAuthGrantEndsGETAndListen
(t *testing.T)
internal/server/bug3837_mcp_credential_tick_test.go:188
FunctionTestMCP_BUG3837_RevokedPATEndsGETAndListen
(t *testing.T)
internal/server/bug3837_mcp_credential_tick_test.go:173
FunctionTestMCP_BUG3837_ToolCallIsNotTicked
The tick runs only on the long-lived doors (where admitMCPStream took a slot). A tool call is an ordinary request: its credential was checked at admis
internal/server/bug3837_mcp_credential_tick_test.go:372
FunctionTestMCP_BUG3837_TransientAccessErrorIsNotReadAsRevocation
The OAuth door classifies by the error fosite returns, and fosite's introspection tries the access token, then falls back to reading it as a refresh t
internal/server/bug3837_mcp_credential_tick_test.go:437
FunctionTestMCP_BUG3837_UserReadFailureKeepsTheStream
A user re-check that cannot ask (a storage failure reading the user) keeps the stream, as a credential door's store error does. OAuth, because fosite'
internal/server/bug3837_mcp_credential_tick_test.go:407
FunctionTestMCP_BadTokenFormat_Returns401WithWWWAuthenticate
TestMCP_BadTokenFormat_Returns401WithWWWAuthenticate covers the same envelope shape for a bearer that isn't even shaped like a pad PAT. Format-rejecti
internal/server/handlers_mcp_test.go:229
FunctionTestMCP_CloudModeOff_RoutesAbsent
TestMCP_CloudModeOff_RoutesAbsent verifies the negative case: a self-host with MCP off answers 404 on every MCP-related route (PLAN-2310 DR-5). The ro
internal/server/handlers_mcp_test.go:20
FunctionTestMCP_DiscoveryDoc_PathAwareWellKnown
TestMCP_DiscoveryDoc_PathAwareWellKnown pins the RFC 9728 §3.1 path-aware metadata URL (BUG-2266). A client configured with the path-suffixed transpor
internal/server/handlers_mcp_test.go:90
FunctionTestMCP_DiscoveryDoc_PopulatedFromConfig
TestMCP_DiscoveryDoc_PopulatedFromConfig verifies the protected- resource metadata document echoes the URLs we hand SetMCPTransport (no host-derived f
internal/server/handlers_mcp_test.go:47
FunctionTestMCP_DiscoveryRoutes_RequireOAuthAvailablePerRoute
TestMCP_DiscoveryRoutes_RequireOAuthAvailablePerRoute exercises the requireOAuthAvailable middleware ON each mounted discovery route (PLAN-2310 DR-5).
internal/server/handlers_mcp_test.go:146
FunctionTestMCP_NoToken_NoHostFallbackWhenPublicURLUnset
Note on legacy workspace-scoped tokens: MCPBearerAuth rejects PATs that have no user_id (the pre-migration-012 path). We don't have a full-stack test
internal/server/handlers_mcp_test.go:341
FunctionTestMCP_NoToken_Returns401WithWWWAuthenticate
TestMCP_NoToken_Returns401WithWWWAuthenticate covers the most important MCP discovery-flow case: a fresh client with no token hits mcp and gets the sp
internal/server/handlers_mcp_test.go:204
FunctionTestMCP_OAuthAccessToken_AudienceMismatch_Rejected
TestMCP_OAuthAccessToken_AudienceMismatch_Rejected pins the RFC 8707 anti-replay defense: even if a token is otherwise valid, mcp rejects it when the
internal/server/handlers_mcp_test.go:611
FunctionTestMCP_OAuthAccessToken_Authenticates
TestMCP_OAuthAccessToken_Authenticates is the primary happy-path test for sub-PR E: a token minted by the full /authorize → /token flow authenticates
internal/server/handlers_mcp_test.go:553
FunctionTestMCP_OAuthRefreshToken_RejectedAtMCP
TestMCP_OAuthRefreshToken_RejectedAtMCP pins the rule that refresh tokens are NOT valid bearers for resource calls. RFC 6749 §1.5 distinguishes refres
internal/server/handlers_mcp_test.go:665
FunctionTestMCP_OAuthScopeReadOnly_StashesPadReadScope
TestMCP_OAuthScopeReadOnly_StashesPadReadScope confirms that an OAuth token granted only `pad:read` reaches the in-process dispatcher with that scope
internal/server/handlers_mcp_test.go:784
FunctionTestMCP_PATPath_StillWorks
TestMCP_PATPath_StillWorks regresses the original TASK-950 PAT auth path. Sub-PR E added an OAuth branch; the PAT branch must keep working unchanged s
internal/server/handlers_mcp_test.go:737
FunctionTestMCP_ReadScopedPAT_StashesScopesInContext
TestMCP_ReadScopedPAT_RejectedOnWriteTool pins the security fix where a PAT with scopes `["read"]` must NOT be able to drive write tools through /mcp.
internal/server/handlers_mcp_test.go:397
FunctionTestMCP_RevokedOAuthToken_Rejected
TestMCP_RevokedOAuthToken_Rejected pins the rule that revocation takes effect immediately at the resource server. Mints a token, revokes it via /oauth
internal/server/handlers_mcp_test.go:697
FunctionTestMCP_ValidPAT_ReachesTransport
TestMCP_ValidPAT_ReachesTransport confirms the happy path: a real PAT for a real user authenticates, and the request reaches the downstream MCP transp
internal/server/handlers_mcp_test.go:256
FunctionTestMIMEFamiliesCoverAllowlist
TestMIMEFamiliesCoverAllowlist is the drift guard between this package's upload allowlist and the client's icon mapping. The allowlist is private Go d
internal/attachments/mime_families_test.go:47
FunctionTestMIMEFamiliesFixtureHasNoStrays
TestMIMEFamiliesFixtureHasNoStrays is the other direction: an entry in the fixture that is not (and is no longer) on the allowlist is dead weight, and
internal/attachments/mime_families_test.go:83
FunctionTestMIMEFamiliesKeysAreNormalized
TestMIMEFamiliesKeysAreNormalized keeps fixture lookups honest: the client normalizes a MIME (strip parameters, lowercase) before indexing this map, e
internal/attachments/mime_families_test.go:104
FunctionTestMagicOnlyRecognisesWhatValidationUsedToRefuse
TestMagicOnlyRecognisesWhatValidationUsedToRefuse is the WIDENING, asserted rather than described. Every input here was refused by the structural vali
internal/attachments/mime_magic_test.go:590
FunctionTestMagicStillHasToBeThere
TestMagicStillHasToBeThere keeps the recognisers honest in the only way that still applies: the magic must be present, in the right place, in full.
internal/attachments/mime_magic_test.go:674
FunctionTestMain
(m *testing.M)
internal/buildtools/install_refresh_test.go:47
FunctionTestMain
TestMain tears down storetest's process-wide template DB (IDEA-1914) after the suite finishes, so the lazily-built template file doesn't linger past t
internal/oauth/main_test.go:13
FunctionTestMain
TestMain lowers the bcrypt cost for the whole package. See BUG-1371 and internal/server/main_test.go for context — the same reasoning applies to inter
internal/store/main_test.go:19
FunctionTestMain
(m *testing.M)
internal/store/storetest/storetest_test.go:15
FunctionTestMain
TestMain pins the reader's PID namespace to the init namespace for the whole package (BUG-4090). Most tests here build owners by hand with no pid_ns,
internal/cli/main_test.go:21
FunctionTestMain
(m *testing.M)
internal/materialize/supervisor_test.go:41
FunctionTestMain
TestMain tears down storetest's process-wide template DB (IDEA-1914) after the suite finishes, so the lazily-built template file doesn't linger past t
internal/mcp/main_test.go:13
FunctionTestMain
TestMain lowers the bcrypt cost for the whole package. Without this, the suite's many bootstrapFirstUser calls run bcrypt at the production cost under
internal/server/main_test.go:20
FunctionTestMain
(m *testing.M)
cmd/pad/bug3142_stdio_classify_test.go:18
FunctionTestMain_BUG4066Child
The relative data-dir warning is once per process, so each case runs in a fresh child of this test binary (BUG4066_CHILD selects it).
cmd/pad/bug4066_relative_data_dir_test.go:16
FunctionTestMakeFanOutHandler_CompactModesKeepTheClientVisibleChannel
(t *testing.T)
internal/mcp/catalog_test.go:155
FunctionTestMakeFanOutHandler_DispatchesPerAction
TestMakeFanOutHandler_DispatchesPerAction verifies the handler reads `action` from the input, looks up the right ActionFn, and forwards.
internal/mcp/catalog_test.go:121
FunctionTestMakeFanOutHandler_MissingAction
TestMakeFanOutHandler_MissingAction returns a structured error listing valid actions so the agent can self-correct without a human round-trip. Wire-le
internal/mcp/catalog_test.go:220
FunctionTestMakeFanOutHandler_StripsActionFromInput
TestMakeFanOutHandler_StripsActionFromInput proves the routing `action` key never reaches the action handler — important because some downstream CLI c
internal/mcp/catalog_test.go:251
FunctionTestMakeFanOutHandler_UnknownAction
TestMakeFanOutHandler_UnknownAction is the symmetric case: action is set but not in the handler table. Same recovery pattern — list the valid actions
internal/mcp/catalog_test.go:292
FunctionTestMalformedConversationIDIsNotFound
TASK-4038 r6: malformed ids name no conversation, regardless of the SQL driver.
internal/store/conversations_test.go:881
FunctionTestMalformedFrameGetsNoSubtypeTwin
Strictness: a frame that does not parse exactly gets no subtype twin, even when an earlier row is its byte-for-byte subtype swap. Here the length pref
internal/store/bug3136_step2_twin_test.go:152
FunctionTestMalformedRowSkipped
A malformed frame is skipped and the rest still apply, as in a tab.
internal/materialize/materialize_test.go:287
FunctionTestMalformedRulesTable
(t *testing.T)
internal/schedule/rule_test.go:29
FunctionTestMalformedSpecFields
TestMalformedSpecFields covers the UNTIL forms, their year bounds and their relation to Start, then the Spec fields Compile checks: zone, Start year,
internal/schedule/rule_test.go:196
FunctionTestMalformedTraitsDoNotBreakTheInvariant
TestMalformedTraitsDoNotBreakTheInvariant covers the row nobody writes on purpose: a collections row whose traits blob is not valid JSON. SQLite's js
internal/store/trait_dedupe_test.go:312
FunctionTestManagedRefireOfTheSameOccurrenceIsANewNotification
A snooze-style re-fire of the SAME occurrence (the row re-armed and fired again) is a second notification. RED with the C1 key reminder:<id>:<occurren
internal/store/schedule_outstanding_test.go:100
FunctionTestManagedReminderOrdering
(t *testing.T)
internal/server/handlers_commitments_http_test.go:329
FunctionTestManagedReminderRefusalNamesResolve
The managed-reminder 409 names the ack command and the resolve door.
internal/server/handlers_commitments_resolve_test.go:287
FunctionTestManagedReminderRefusesDirectMutation
Rearm, ack and delete of a managed reminder are refused 409, armed or fired, and leave the row byte-unchanged.
internal/server/handlers_commitments_http_test.go:280
FunctionTestManagedReminderRefusesDirectStoreMutation
(t *testing.T)
internal/store/schedules_test.go:724
FunctionTestManagesLocalServerRequiresConfiguredLocalMode
(t *testing.T)
internal/config/config_test.go:123
FunctionTestMapCollectionCreate_AcceptsStructuredSchema
TestMapCollectionCreate_AcceptsStructuredSchema verifies that the MCP dispatcher accepts a typed `schema` object input (the path TASK-1335 adds for BU
internal/mcp/dispatch_http_project_test.go:692
FunctionTestMapCollectionCreate_EmptySchemaFallsThroughToFields
TestMapCollectionCreate_EmptySchemaFallsThroughToFields verifies the transport-symmetry fix: when a client sends schema=null or schema="" alongside fi
internal/mcp/dispatch_http_project_test.go:829
FunctionTestMapCollectionCreate_FieldsAndSchemaMutuallyExclusive
TestMapCollectionCreate_FieldsAndSchemaMutuallyExclusive ensures the dispatcher rejects requests that set both flags — mirrors the CLI-side guard so M
internal/mcp/dispatch_http_project_test.go:809
FunctionTestMapCollectionCreate_ParsesFieldsDSL
(t *testing.T)
internal/mcp/dispatch_http_project_test.go:574
FunctionTestMapCollectionCreate_RequiresNameAndWorkspace
--- collection create ---
internal/mcp/dispatch_http_project_test.go:565
FunctionTestMapCollectionCreate_SchemaAcceptsStringifiedJSON
TestMapCollectionCreate_SchemaAcceptsStringifiedJSON exercises the fallback shape for clients that can only pass strings — schema arrives as a JSON-en
internal/mcp/dispatch_http_project_test.go:780
FunctionTestMapCollectionCreate_SchemaBackfillsMissingLabel
TestMapCollectionCreate_SchemaBackfillsMissingLabel mirrors the CLI's label-backfill heuristic — a schema field omitting `label` should get one auto-f
internal/mcp/dispatch_http_project_test.go:742
FunctionTestMapCollectionCreate_SchemaMalformedJSON
TestMapCollectionCreate_SchemaMalformedJSON ensures a clear error when the stringified schema is invalid JSON.
internal/mcp/dispatch_http_project_test.go:863
FunctionTestMapCollectionUpdate_AcceptsFieldsDSL
TestMapCollectionUpdate_AcceptsFieldsDSL covers the second case: the catalog advertises `fields OR schema`, but the original mapper only handled `sche
internal/mcp/dispatch_http_routes_extras_test.go:303
FunctionTestMapCollectionUpdate_AcceptsSchemaString
TestMapCollectionUpdate_AcceptsSchemaString lets callers pass the pre-encoded JSON string form (mirrors what the CLI's collectionSchemaJSONFromFlags p
internal/mcp/dispatch_http_routes_extras_test.go:177
FunctionTestMapCollectionUpdate_BuildsPatchBody
--- Collections (TASK-1510 / PLAN-1496) --- TestMapCollectionUpdate_BuildsPatchBody confirms the mapper routes to the canonical PATCH endpoint and cop
internal/mcp/dispatch_http_routes_extras_test.go:91
FunctionTestMapCollectionUpdate_EmptySchemaDoesNotBlockFields
TestMapCollectionUpdate_EmptySchemaDoesNotBlockFields covers that optional empty params should normalize as "absent" before the mutual-exclusion check
internal/mcp/dispatch_http_routes_extras_test.go:216
FunctionTestMapCollectionUpdate_EmptyStringClearsField
TestMapCollectionUpdate_EmptyStringClearsField guards that the catalog advertises icon/description as clearable (the CLI flag help says `--icon "" / -
internal/mcp/dispatch_http_routes_extras_test.go:272
FunctionTestMapCollectionUpdate_EncodesSchemaObjectToString
TestMapCollectionUpdate_EncodesSchemaObjectToString verifies the MCP-friendly object form of the `schema` parameter gets re-marshaled to the JSON-stri
internal/mcp/dispatch_http_routes_extras_test.go:132
FunctionTestMapCollectionUpdate_OmitsEmptyFields
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:237
FunctionTestMapCollectionUpdate_RejectsFieldsAndSchemaTogether
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:359
FunctionTestMapCollectionUpdate_RequiresWorkspaceAndSlug
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:257
FunctionTestMapItemComment_RefusesABlankMessage
BUG-4265: the MCP comment action refuses an empty or whitespace-only message before building any request, so nothing is posted.
internal/mcp/bug4265_comment_blank_message_test.go:10
FunctionTestMapItemCreate_ExplicitFieldOverridesNamedFlag
(t *testing.T)
internal/mcp/dispatch_http_test.go:468
FunctionTestMapItemCreate_FieldsObjectKeepsJSONTypes
The remote /mcp door must carry the `fields` object's JSON types through to the request body (BUG-2850). This is the door the bug was reported agains
internal/mcp/dispatch_http_test.go:1029
FunctionTestMapItemCreate_LiftsAgentRoleIDFromFieldKVPToColumn
(t *testing.T)
internal/mcp/dispatch_http_test.go:544
FunctionTestMapItemCreate_LiftsAssignedUserIDFromFieldKVP
(t *testing.T)
internal/mcp/dispatch_http_test.go:580
FunctionTestMapItemCreate_PassesThroughAgentRoleID
(t *testing.T)
internal/mcp/dispatch_http_test.go:629
FunctionTestMapItemCreate_PassesThroughResolvedAgentRoleID
(t *testing.T)
internal/mcp/dispatch_http_test.go:519
FunctionTestMapItemCreate_PassesThroughResolvedAssignedUserID
(t *testing.T)
internal/mcp/dispatch_http_test.go:659
FunctionTestMapItemCreate_RequiresCollection
(t *testing.T)
internal/mcp/dispatch_http_test.go:766
FunctionTestMapItemCreate_RequiresWorkspace
(t *testing.T)
internal/mcp/dispatch_http_test.go:759
FunctionTestMapItemCreate_SendsRawCollectionSlug
(t *testing.T)
internal/mcp/dispatch_http_test.go:494
FunctionTestMapItemCreate_TopLevelAgentRoleIDWinsOverFieldKVP
(t *testing.T)
internal/mcp/dispatch_http_test.go:599
FunctionTestMapItemStarred_AllSetsIncludeTerminal
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:65
FunctionTestMapItemStarred_DefaultsHidesTerminalItems
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:49
FunctionTestMapItemStarred_RequiresWorkspace
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:78
FunctionTestMapItemUpdate_ExpectedSeq
BUG-3037 — the remote dispatcher must REFUSE a fractional expected_seq rather than truncate it. int64(42.7) is 42, which is a different row state — a
internal/mcp/bug3037_expected_seq_dispatch_test.go:15
FunctionTestMapKeyBytesCountTowardTheWalkBudget
(t *testing.T)
internal/logging/redaction_followups_test.go:1227
FunctionTestMapKeyMethodOutputIsCutByTheRedactor
(t *testing.T)
internal/logging/redaction_followups_test.go:1638
FunctionTestMapKeyTextByKind
(t *testing.T)
internal/logging/redaction_followups_test.go:1501
FunctionTestMapKeyTextRemainingRows
(t *testing.T)
internal/logging/redaction_followups_test.go:1549
← previousnext →21,201–21,300 of 28,840, ranked by callers