MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestMCPApps_EmbeddedBundleSelfContained
(t *testing.T)
cmd/pad/mcp_apps_test.go:85
FunctionTestMCPApps_ItemToolCarriesUIMeta
(t *testing.T)
internal/mcp/apps_test.go:46
FunctionTestMCPApps_KillSwitch
(t *testing.T)
cmd/pad/mcp_apps_test.go:16
FunctionTestMCPApps_ResourceRead
(t *testing.T)
internal/mcp/apps_test.go:75
FunctionTestMCPAttachmentResource_CollectionGrantGuestCanRead
TestMCPAttachmentResource_CollectionGrantGuestCanRead — same, one level up the grant chain.
internal/mcp/resources_http_attachment_acl_test.go:182
FunctionTestMCPAttachmentResource_GrantGuestCanRead
TestMCPAttachmentResource_GrantGuestCanRead asserts the DR-10 gate reaches the MCP image resource in the permissive direction: a guest holding an item
internal/mcp/resources_http_attachment_acl_test.go:151
FunctionTestMCPAttachmentResource_SoftDeletedParentIsDenied
TestMCPAttachmentResource_SoftDeletedParentIsDenied — DR-13 reaches this surface too: archiving the parent takes the resource offline for a caller who
internal/mcp/resources_http_attachment_acl_test.go:262
FunctionTestMCPAttachmentResource_UngrantedUserIsDenied
TestMCPAttachmentResource_UngrantedUserIsDenied asserts the gate in the restrictive direction — the half that actually matters for security. The call
internal/mcp/resources_http_attachment_acl_test.go:212
FunctionTestMCPAuditListsBreakTimestampTiesByIDDescending
mcp_audit_log gets the same tie-break (BUG-2781): its rows are append-only, but rows sharing a second still come back in scan order, which can differ
internal/store/activities_paging_test.go:238
FunctionTestMCPAuditNames_EveryPath
TASK-2255 (C110): the admin MCP audit page names people and connections. Every resolution path, and an id that no longer resolves left out (the page t
internal/store/task2255_mcp_audit_names_test.go:13
FunctionTestMCPAuditToolNameSourceColumn
(t *testing.T)
internal/store/bug2819_provenance_test.go:91
FunctionTestMCPAudit_BUG2819_SourceIsRecordedThroughTheMiddleware
Through the router: a caller who names a tool "(unknown)" and a body the server cannot parse both used to be distinguishable only by the reserved "(sa
internal/server/bug2819_audit_source_test.go:53
FunctionTestMCPAudit_BufferFull_DropsAndIncrementsCounter
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:237
FunctionTestMCPAudit_ClassifyResult
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:374
FunctionTestMCPAudit_CleanedIdentityIsNotForgeable
TestMCPAudit_CleanedIdentityIsNotForgeable pins that a value which only became well-formed by cleaning cannot imitate a genuine one. An earlier fix c
internal/server/middleware_mcp_audit_test.go:589
FunctionTestMCPAudit_HashCanonicalJSON_IsOrderIndependent
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:181
FunctionTestMCPAudit_NoBearer_NoRow
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:137
FunctionTestMCPAudit_NonToolsCallMethod_RecordsMethodAsToolName
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:160
FunctionTestMCPAudit_ParseRequestBody
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:209
FunctionTestMCPAudit_RateLimited_RecordsDeniedRow
TestMCPAudit_RateLimited_RecordsDeniedRow pins the fix for a missing audit row: when MCPBearerAuth resolves the user + token but then rate-limits the
internal/server/middleware_mcp_audit_test.go:306
FunctionTestMCPAudit_RawMethodDecidesClassification
TestMCPAudit_RawMethodDecidesClassification pins that dispatch reads what the client SENT while only the stored value is cleaned. An earlier version
internal/server/middleware_mcp_audit_test.go:547
FunctionTestMCPAudit_RecordsToolCallWithToolNameAndArgsHash
(t *testing.T)
internal/server/middleware_mcp_audit_test.go:95
FunctionTestMCPAudit_SanitiseNeverEmptiesToolName
TestMCPAudit_SanitiseNeverEmptiesToolName covers the boundary the NUL-sanitising fix created and did not test. parseMCPRequestBody checks env.Method
internal/server/middleware_mcp_audit_test.go:503
FunctionTestMCPAudit_SynthesisedNamespaceIsReserved
TestMCPAudit_SynthesisedNamespaceIsReserved pins that a caller cannot name a tool so that its UNMODIFIED value collides with a value this server synth
internal/server/middleware_mcp_audit_test.go:686
FunctionTestMCPAudit_ToolNameCannotCarryANUL
TestMCPAudit_ToolNameCannotCarryANUL closes a door BUG-2803's own completeness map wrongly certified as safe. That map listed middleware_mcp_audit.go
internal/server/middleware_mcp_audit_test.go:421
FunctionTestMCPAvailabilityInPayloads
PLAN-2310 DR-7 (TASK-3303): the session payload and the admin stats carry mcp_available and oauth_available, evaluated per request, so the console can
internal/server/mcp_availability_payload_test.go:14
FunctionTestMCPBearerAuth_PATPathRecordsTheAPITokenKind
(t *testing.T)
internal/server/handlers_stream_session_liveness_test.go:938
FunctionTestMCPCapability_HTTPSelfHostPATAndAudit
TestMCPCapability_HTTPSelfHostPATAndAudit: on an http self-host with MCP on, a PAT reaches the real transport through /mcp, and the call is recorded i
cmd/pad/mcp_capability_test.go:452
FunctionTestMCPCapability_HostAllowlist
TestMCPCapability_HostAllowlist is PLAN-2310 DR-6's acceptance, over the production wiring: off cloud, every non-API DR-5 path refuses an unconfigured
cmd/pad/mcp_capability_test.go:519
FunctionTestMCPCapability_HostAllowlistBehindAProxy
TestMCPCapability_HostAllowlistBehindAProxy is the TASK-2319 rule: behind a proxy that rewrites Host to the backend's name, the public host arrives in
cmd/pad/mcp_capability_test.go:567
FunctionTestMCPCapability_HostAllowlistRunsBeforeAuthAuditAndLimits
TestMCPCapability_HostAllowlistRunsBeforeAuthAuditAndLimits: a request refused 421 writes no audit row and draws nothing from a rate limiter. Both hal
cmd/pad/mcp_capability_test.go:645
FunctionTestMCPCapability_RouteTable
TestMCPCapability_RouteTable drives every DR-5 route, through the router, in each state PLAN-2310's acceptance names, and asserts the gate refuses exa
cmd/pad/mcp_capability_test.go:212
FunctionTestMCPCapability_UpgradeChangesNothingWhileOff
TestMCPCapability_UpgradeChangesNothingWhileOff is the unit's headline evidence. It builds a store as an existing install has it (migrated, users pres
cmd/pad/mcp_capability_test.go:334
FunctionTestMCPConnectionStatsForUser_LastUsedAndCalls30d
(t *testing.T)
internal/store/mcp_audit_test.go:256
FunctionTestMCPFieldsKeepNumberLiterals_Remote
TestMCPFieldsKeepNumberLiterals_Remote drives the remote door: catalog → HTTPHandlerDispatcher → the real handler chain → the store, and reads the sto
internal/mcp/bug3217_fields_number_literals_test.go:40
FunctionTestMCPFieldsKeepNumberLiterals_Stdio
TestMCPFieldsKeepNumberLiterals_Stdio covers the local door, which the filing believed unaffected: a `fields` OBJECT number is stringified into a --fi
internal/mcp/bug3217_fields_number_literals_test.go:100
FunctionTestMCPFieldsNumberConflictCompare
TestMCPFieldsNumberConflictCompare pins the conflict pass. A `fields` number and a `field` entry naming the same key are ONE write when they are the s
internal/mcp/bug3217_fields_number_literals_test.go:136
FunctionTestMCPInstallCompactResultsRejectsUnsupportedClient
(t *testing.T)
cmd/pad/mcp_compact_results_test.go:43
FunctionTestMCPInstallCompactResultsUsesClientVisibleChannel
(t *testing.T)
cmd/pad/mcp_compact_results_test.go:11
FunctionTestMCPMetrics_IncrementsAndHistogramBuckets
TestMCPMetrics_IncrementsAndHistogramBuckets exercises the MCP-side metrics surface end-to-end: each metric must accept observations and return them t
internal/metrics/metrics_test.go:92
FunctionTestMCPOAuthAudience
TestMCPOAuthAudience covers DR-4's construction cases: OAuth is built exactly when the resolved auth-server URL is https, for the audience the resolve
cmd/pad/mcp_capability_test.go:403
FunctionTestMCPOAuthAudience_OriginFromTomlURL
The origin may come from the toml `url` key, not only PAD_URL: the same field, loaded by config.Load from the data directory's config.toml.
cmd/pad/mcp_capability_test.go:429
FunctionTestMCPPromptBudgets
(t *testing.T)
internal/mcp/prompt_budget_test.go:22
FunctionTestMCPPropertyName_RoundTrip
TestMCPPropertyName_RoundTrip locks the kebab→snake translation rule. Used by BuildCLIArgs and mergeDispatchInput to keep input keys snake_case across
internal/mcp/registry_test.go:168
FunctionTestMCPRateLimit_429EnvelopeShape
TestMCPRateLimit_429EnvelopeShape pins the wire shape of the 429 response: MCP-style `{error: {code, message}}` JSON envelope plus the standard rate-l
internal/server/handlers_mcp_test.go:1338
FunctionTestMCPRateLimit_DiscoveryDocsExempt
TestMCPRateLimit_DiscoveryDocsExempt verifies the per-token limiter is NOT applied to /.well-known/oauth-* paths. Discovery docs are polled by MCP cli
internal/server/handlers_mcp_test.go:1286
FunctionTestMCPRateLimit_InvalidBearerNotRateLimited
TestMCPRateLimit_InvalidBearerNotRateLimited pins the post-auth- validation property: a bearer that fails token validation must NOT consume a per-toke
internal/server/handlers_mcp_test.go:1162
FunctionTestMCPRateLimit_LimiterMapBoundedByValidTokensOnly
TestMCPRateLimit_LimiterMapBoundedByValidTokensOnly is the memory-DoS regression test. After 100 distinct invalid bearers, the per-token limiter map M
internal/server/handlers_mcp_test.go:1247
FunctionTestMCPRateLimit_NoBearer_NotCounted
TestMCPRateLimit_NoBearer_NotCounted verifies that a request without a Bearer header fails with 401 BEFORE the rate-limit check (because the limiter k
internal/server/handlers_mcp_test.go:1314
FunctionTestMCPRateLimit_OAuthRefreshTokenNotCounted
TestMCPRateLimit_OAuthRefreshTokenNotCounted pins that the OAuth-path rate limit must run AFTER all validation gates (refresh-vs-access, audience matc
internal/server/handlers_mcp_test.go:1197
FunctionTestMCPRateLimit_PerToken_BucketEnforced
===================================================================== Per-token rate limit on /mcp (TASK-959) ========================================
internal/server/handlers_mcp_test.go:1071
FunctionTestMCPRateLimit_PerToken_TwoTokensIndependent
TestMCPRateLimit_PerToken_TwoTokensIndependent pins the per-token isolation property: two different bearers MUST have independent buckets, even if the
internal/server/handlers_mcp_test.go:1110
FunctionTestMCPServeRejectsConflictingResultModes
(t *testing.T)
cmd/pad/mcp_compact_results_test.go:55
FunctionTestMCPSessionTracker_ConcurrentTouchEvict
TestMCPSessionTracker_ConcurrentTouchEvict exercises the mutex under concurrent load. Run with -race in CI; the assertion here is just that the final
internal/server/middleware_mcp_session_test.go:159
FunctionTestMCPSessionTracker_EvictRemovesAndFires
TestMCPSessionTracker_EvictRemovesAndFires verifies evict bumps onChange ONLY when an entry was actually present.
internal/server/middleware_mcp_session_test.go:69
FunctionTestMCPSessionTracker_NilOnChangeIsSafe
TestMCPSessionTracker_NilOnChangeIsSafe verifies the tracker works without an onChange callback (used by tests / non-metrics builds).
internal/server/middleware_mcp_session_test.go:143
FunctionTestMCPSessionTracker_OnChangeUnderLock
TestMCPSessionTracker_OnChangeUnderLock pins the fix for the race where onChange ran AFTER the mutex was released: concurrent touches could compute (n
internal/server/middleware_mcp_session_test.go:200
FunctionTestMCPSessionTracker_RunStopsCleanly
TestMCPSessionTracker_RunStopsCleanly verifies the run() loop exits promptly after shutdown(). Uses a tight sweep interval so the goroutine has cycled
internal/server/middleware_mcp_session_test.go:259
FunctionTestMCPSessionTracker_SweepEvictsStale
TestMCPSessionTracker_SweepEvictsStale exercises the TTL sweeper: entries older than ttl are removed, recent entries survive, and a single onChange ob
internal/server/middleware_mcp_session_test.go:97
FunctionTestMCPSessionTracker_TouchEmptyIDIsNoOp
TestMCPSessionTracker_TouchEmptyIDIsNoOp guards against a stray empty header dropping a phantom entry into the map.
internal/server/middleware_mcp_session_test.go:53
FunctionTestMCPSessionTracker_TouchInsertsAndDeduplicates
Tests for the MCP session tracker (PLAN-943 TASK-1120). The tracker replaces the naive +1/-1 active-sessions accounting with a map keyed by Mcp-Sessio
internal/server/middleware_mcp_session_test.go:22
FunctionTestMCPToolMetricsLabel_IsBoundedByTheKnownNames
BUG-2817: N distinct caller-invented tool names, sent through the REAL /mcp handler chain, add ONE label value between them. The control is a known na
internal/server/bug2817_metrics_label_bound_test.go:48
FunctionTestMCPToolMetricsLabel_UnwiredIsUnknown
With no predicate wired, every name is "unknown": an unwired server cannot mint caller-chosen series.
internal/server/bug2817_metrics_label_bound_test.go:92
FunctionTestMCPToolSurface_AuthedReturnsCatalog
TestMCPToolSurface_AuthedReturnsCatalog pins the happy path: an authenticated caller gets 200 with the nine catalog tools and read_only flags present
internal/server/handlers_mcp_tool_surface_test.go:67
FunctionTestMCPToolSurface_NoLeakage
TestMCPToolSurface_NoLeakage asserts the response carries only catalog descriptors — no internal route table, handler internals, or other server state
internal/server/handlers_mcp_tool_surface_test.go:130
FunctionTestMCPToolSurface_NotWired
TestMCPToolSurface_NotWired pins the nil-serializer path: when SetToolSurfaceHandler was never called, the endpoint 404s rather than panicking or retu
internal/server/handlers_mcp_tool_surface_test.go:160
FunctionTestMCPToolSurface_RequiresAuth
TestMCPToolSurface_RequiresAuth pins the auth gate: with a user present (no fresh-install bypass), an unauthenticated GET must 401.
internal/server/handlers_mcp_tool_surface_test.go:49
FunctionTestMCPUpdate_ClearAgentRoleBoolean
(t *testing.T)
internal/mcp/dispatch_http_clear_assignment_test.go:291
FunctionTestMCPUpdate_ClearAssignedUserBoolean
── IDEA-2584: clear_assigned_user / clear_agent_role over remote MCP ─────── The empty-string form (above) works but is undiscoverable — the catalog
internal/mcp/dispatch_http_clear_assignment_test.go:272
FunctionTestMCPUpdate_ClearConflictsAreRejected
TestMCPUpdate_ClearConflictsAreRejected mirrors the CLI's refusal so the two transports can't disagree about a contradiction. Both routes to a compet
internal/mcp/dispatch_http_clear_assignment_test.go:366
FunctionTestMCPUpdate_ClearFalseIsNotAClear
TestMCPUpdate_ClearFalseIsNotAClear is the guard that makes the boolean safe to declare in the schema at all. A client that fills every declared param
internal/mcp/dispatch_http_clear_assignment_test.go:314
FunctionTestMCPUpdate_ClearParentBoolean
(t *testing.T)
internal/mcp/dispatch_http_clear_parent_test.go:142
FunctionTestMCPUpdate_ClearParentConflictIsRejected
TestMCPUpdate_ClearParentConflictIsRejected mirrors TestMCPUpdate_ClearConflictsAreRejected: three routes to a competing value are covered. `parent` a
internal/mcp/dispatch_http_clear_parent_test.go:213
FunctionTestMCPUpdate_ClearParentFalseIsNotAClear
TestMCPUpdate_ClearParentFalseIsNotAClear is the same safety guard TestMCPUpdate_ClearFalseIsNotAClear pins for the assignment booleans: a client that
internal/mcp/dispatch_http_clear_parent_test.go:160
FunctionTestMCPUpdate_ClearParentRefusedWhenSchemaShadowsField
TestMCPUpdate_ClearParentRefusedWhenSchemaShadowsField promotes the empirical repro from the BUG-2078 investigation to a permanent regression test. BE
internal/mcp/dispatch_http_clear_parent_test.go:290
FunctionTestMCPUpdate_ContentPendingFlushRefusalAndOverride
(t *testing.T)
internal/mcp/bug3133_pending_guard_test.go:21
FunctionTestMCPUpdate_EmptyAgentRoleIDClearsRole
TestMCPUpdate_EmptyAgentRoleIDClearsRole is the sibling column.
internal/mcp/dispatch_http_clear_assignment_test.go:154
FunctionTestMCPUpdate_EmptyAssignAliasIsStillANoOp
TestMCPUpdate_EmptyAssignAliasIsStillANoOp pins the deliberate LIMIT of TASK-2571's fix, so the next reader finds a decision here rather than an overs
internal/mcp/dispatch_http_clear_assignment_test.go:246
FunctionTestMCPUpdate_EmptyAssignedUserIDClearsAssignment
TestMCPUpdate_EmptyAssignedUserIDClearsAssignment covers the top-level pass-through in mapItemUpdate.
internal/mcp/dispatch_http_clear_assignment_test.go:132
FunctionTestMCPUpdate_EmptyAssignmentViaFieldFlagClears
TestMCPUpdate_EmptyAssignmentViaFieldFlagClears covers the OTHER filter — liftFieldsToColumns — which is the path an agent actually reaches today: the
internal/mcp/dispatch_http_clear_assignment_test.go:177
FunctionTestMCPUpdate_EmptyParentIsStillANoOp
TestMCPUpdate_EmptyParentIsStillANoOp is the control leg: unlike clear_parent, the plain `parent` string keeps its "empty means not provided" meaning.
internal/mcp/dispatch_http_clear_parent_test.go:188
FunctionTestMCPUpdate_EmptyTagsStillFiltered
TestMCPUpdate_EmptyTagsStillFiltered is the control leg, and the reason this change is narrow rather than a blanket "stop filtering empty strings". `
internal/mcp/dispatch_http_clear_assignment_test.go:211
FunctionTestMCPWireGolden_Remote
(t *testing.T)
cmd/pad/mcp_wire_golden_test.go:82
FunctionTestMCPWireGolden_Stdio
(t *testing.T)
cmd/pad/mcp_wire_golden_test.go:50
FunctionTestMCP_AuthServerMetadata_MountedAndGated
TestMCP_AuthServerMetadata_MountedAndGated confirms the RFC 8414 authorization-server discovery doc is refused when the OAuth server isn't wired, even
internal/server/handlers_mcp_test.go:189
FunctionTestMCP_BUG3808_BothMountsAreBounded
Both MCP mounts serve the same mcp-go transport type, so both are bounded: each refuses a writer without a write deadline before its transport runs, a
internal/server/bug3808_mcp_stalled_reader_test.go:312
FunctionTestMCP_BUG3808_DeadStreamCancelsTheRequestContext
A failed Flush returns no error to the library, and with nothing queued its loop waits on its channels and ctx.Done() only. mcpBoundWrites must cancel
internal/server/bug3808_mcp_stalled_reader_test.go:291
FunctionTestMCP_BUG3808_ReadingClientKeepsTheGETStream
CONTROL: a client that keeps reading keeps its stream, for many times the write timeout, so the release above is the stall and not the bound firing on
internal/server/bug3808_mcp_stalled_reader_test.go:212
FunctionTestMCP_BUG3808_StalledReaderReleasesAHeaderOnlyDELETE
A DELETE answers with WriteHeader alone, so its response is committed by net/http after the transport returns, outside every Write and Flush the strea
internal/server/bug3808_mcp_stalled_reader_test.go:342
FunctionTestMCP_BUG3808_StalledReaderReleasesTheGETStream
Two frame sizes, so the blocked call is a Write (large frames overflow net/http's buffer inside Write) or a Flush (small ones never do). Either way th
internal/server/bug3808_mcp_stalled_reader_test.go:173
FunctionTestMCP_BUG3808_WriterWithoutDeadlineIsRefused
A writer that cannot take a write deadline is refused, on every method, before the transport runs: its writes could not be bounded.
internal/server/bug3808_mcp_stalled_reader_test.go:246
FunctionTestMCP_BUG3835_ArrayBodyIsRejectedByTheTransport
An array body is not counted, which is safe only because mcp-go refuses it outright: nothing is served and no stream is held.
internal/server/bug3835_mcp_keepalive_test.go:381
FunctionTestMCP_BUG3835_EveryAuthPathHasAPrincipal
Every credential /mcp accepts yields a non-empty principal: an empty one would skip the per-user bound. /mcp accepts a PAT or an OAuth access token (M
internal/server/bug3835_mcp_keepalive_test.go:410
FunctionTestMCP_BUG3835_GETOverTheBudgetIsAPlain429
Over the budget, a GET is a plain 429 sent before any SSE byte, and the transport never runs: no session is registered.
internal/server/bug3835_mcp_keepalive_test.go:90
FunctionTestMCP_BUG3835_IdleStalledGETEndsAndReleasesItsSlot
An IDLE GET stream whose client stopped reading ends, and frees its slot. Nothing is pumped: only the keepalive writes, so without it no write ever ha
internal/server/bug3835_mcp_keepalive_test.go:49
FunctionTestMCP_BUG3835_KeepaliveOnlyInsideALiveEventStream
Unit: the writer never sends a keepalive before the response is committed as an event stream, after a final event, or after the handler returned.
internal/server/bug3835_mcp_keepalive_test.go:534
FunctionTestMCP_BUG3835_LegacyPOSTIsNotReadForAdmission
A POST without a modern Mcp-Protocol-Version header is never a listen mcp-go serves (it answers a legacy-era listen METHOD_NOT_FOUND, and refuses a mo
internal/server/bug3835_mcp_keepalive_test.go:229
FunctionTestMCP_BUG3835_ListenDetectionMatchesMCPGo
Listen detection decodes exactly as mcp-go does, so no spelling of the body mcp-go would serve as a listen can skip the budget, and nothing else is co
internal/server/bug3835_mcp_keepalive_test.go:179
FunctionTestMCP_BUG3835_ListenWithoutAModernHeaderIsNeverServed
The gate's premise, pinned against mcp-go rather than read from it: a listen whose _meta is modern is served ONLY when the header is modern too, so a
internal/server/bug3835_mcp_keepalive_test.go:282
FunctionTestMCP_BUG3835_PanickingTransportStopsTheKeepalive
A transport that panics after committing an event stream still stops the keepalive before mcpBoundWrites unwinds: chi's Recoverer swallows the panic,
internal/server/bug3835_mcp_keepalive_test.go:586
← previousnext →21,101–21,200 of 28,840, ranked by callers