MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestClaimNotifications_SameTokenSameSecondIsDisjoint
Two claims that reuse one caller token and stamp the SAME claimed_at (second precision) over the same candidates must not read back each other's rows.
internal/store/task3939_push_dispatch_test.go:754
FunctionTestClaimNotifications_SettleStateAndLimit
Kills: dropping the settle predicate (the fresh row is claimed); dropping the state predicate (the sent row is claimed); ignoring limit.
internal/store/task3939_push_dispatch_test.go:95
FunctionTestClaimNotifications_StaleCandidateDoesNotSteal
The claim UPDATE is the arbiter: a candidate list gone stale (another claimer took the row in between) must not steal it. Kills: dropping the lease pr
internal/store/task3939_push_dispatch_test.go:174
FunctionTestClaimOrphanedVariant_RestoreRefusesAtClaimTime
TestClaimOrphanedVariant_RestoreRefusesAtClaimTime pins the gap in BUG-2388's restore-wins e2e leg (which only proved the restored row never became a
internal/store/attachments_gc_claim_test.go:360
FunctionTestClaimPIDFile_HoldsTheLockWhileRunning
TestClaimPIDFile_HoldsTheLockWhileRunning is the ownership claim itself: while a server is up, the file reports as OURS, which is the only state in wh
internal/cli/pid_file_test.go:53
FunctionTestClaimPIDFile_OverwritesAKeptLegacyRecord
TestClaimPIDFile_OverwritesAKeptLegacyRecord is the START half of the question: a legacy file kept as unprovable must not block a new server. `pad ser
internal/cli/pid_file_test.go:348
FunctionTestClaimPIDFile_ReleaseIsIdempotent
TestClaimPIDFile_ReleaseIsIdempotent covers the shutdown path, which calls release explicitly before the listener closes AND keeps it deferred as a ba
internal/cli/pid_file_test.go:131
FunctionTestClaimPIDFile_RetriesPastABriefProbe
TestClaimPIDFile_RetriesPastABriefProbe covers the interaction an earlier fix created: `stop`'s ownership probe holds the lock for an instant, and a s
internal/cli/pid_file_test.go:259
FunctionTestClaimPIDFile_WritesARecordAndReleasesIt
BUG-2965 and BUG-2969 together: the PID file must let `pad server stop` address the running server, and must not let it signal anything else. These a
internal/cli/pid_file_test.go:25
FunctionTestClaimPendingNotifications_ExpireCutoffBoundary
TASK-4032. The claim never selects a row created before expireCutoff, so it does not depend on the expiry sweep having run: a row created exactly at t
internal/store/task3939b_settle_test.go:272
FunctionTestClaimProtocol_FiledRaceSequence
TestClaimProtocol_FiledRaceSequence pins BUG-2415's exact interleaving at the store layer: the sweep's content scan finds no reference, a writer then
internal/store/attachments_gc_claim_test.go:276
FunctionTestClaimSoftDeleted_RefusesRestoredRow
(t *testing.T)
internal/store/attachments_gc_claim_test.go:238
FunctionTestClampGenerationSeed
A BROKEN HOST CLOCK MUST NOT BE FATAL (BUG-2740). The seed is an input, and an unset or misconfigured clock can report zero or a negative second. Bef
internal/events/redis_generation_guard_test.go:585
FunctionTestClassifyApplyOutcomeIsUnknownUnlessProven
TestClassifyApplyOutcomeIsUnknownUnlessProven covers the discriminator directly, including the cases the end-to-end tests cannot reach. An earlier ve
internal/server/handlers_items_content_route_test.go:379
FunctionTestClassifyCapabilityTier
(t *testing.T)
internal/store/connected_apps_test.go:264
FunctionTestClassifyDeleteAccountError
The account-deletion wrapper: an interruption before the COMMIT call is a proven rollback (definitive); one on the COMMIT call itself is unknown.
internal/store/runtime_pool_test.go:748
FunctionTestClassifyExecError
TestClassifyExecError covers the full taxonomy via the ExecDispatcher classifier. Each subtest pairs a stderr pattern with the expected ErrorCode. Hit
internal/mcp/errors_test.go:83
FunctionTestClassifyExecError_CannotPhrasingClassifiesAsValidation
TestClassifyExecError_CannotPhrasingClassifiesAsValidation pins the fix: server-side rejections phrased "cannot link an item to itself" / "cannot modi
internal/mcp/bug987_test.go:159
FunctionTestClassifyExecError_LastMarkerWins
TestClassifyExecError_LastMarkerWins confirms multiple markers resolve to the LAST one — a malicious earlier line can't pre-empt the CLI's actual fina
internal/mcp/open_children_passthrough_test.go:212
FunctionTestClassifyExecError_LookupFailureStillReturnsEnvelope
TestClassifyExecError_LookupFailureStillReturnsEnvelope ensures best-effort listing — when ListWorkspaces fails, we still surface the no_workspace err
internal/mcp/errors_test.go:137
FunctionTestClassifyExecError_MarkerEmbeddedMidLineIgnored
TestClassifyExecError_MarkerEmbeddedMidLineIgnored ensures a marker substring inside a quoted log message can't impersonate a real structured error. T
internal/mcp/open_children_passthrough_test.go:195
FunctionTestClassifyExecError_NoLegacyVerbPrefixInMessage
TestClassifyExecError_NoLegacyVerbPrefixInMessage pins the fix that drops the "pad <cmd> failed: " prefix from server_error fallback messages. The pre
internal/mcp/bug987_test.go:188
FunctionTestClassifyExecError_NoMarkerFallsThrough
TestClassifyExecError_NoMarkerFallsThrough confirms stderr WITHOUT the marker classifies via the existing regex matchers (validation / auth / item-not
internal/mcp/open_children_passthrough_test.go:136
FunctionTestClassifyExecError_OldMarkerVersionIgnored
TestClassifyExecError_OldMarkerVersionIgnored confirms that an older (or unrecognized future) marker version is ignored rather than parsed. Validates
internal/mcp/open_children_passthrough_test.go:176
FunctionTestClassifyExecError_OpenChildrenMarkerLiftsStructuredPayload
(t *testing.T)
internal/mcp/open_children_passthrough_test.go:103
FunctionTestClassifyExecError_PlanLimitMarkerLiftsStructuredPayload
TestClassifyExecError_PlanLimitMarkerLiftsStructuredPayload exercises the CLI-stdio MCP path (TASK-788): when cli.WritePlanLimitError writes the struc
internal/mcp/open_children_passthrough_test.go:368
FunctionTestClassifyExecError_PlanLimitWithoutMarkerFallsThrough
TestClassifyExecError_PlanLimitWithoutMarkerFallsThrough confirms that a plain "plan limit" text in stderr (no structured marker) does NOT produce Err
internal/mcp/open_children_passthrough_test.go:405
FunctionTestClassifyExecError_PlanLimitWorkspaceCreate
TestClassifyExecError_PlanLimitWorkspaceCreate exercises the workspace-create CLI-stdio path (TASK-788): WritePlanLimitError on the workspace-create c
internal/mcp/open_children_passthrough_test.go:422
FunctionTestClassifyExecError_StripsUsageBlock
TestClassifyExecError_StripsUsageBlock confirms classifyExecError removes Usage text BEFORE pattern matching and BEFORE placing the remaining stderr i
internal/mcp/bug987_test.go:75
FunctionTestClassifyExecError_UnknownStructuredCodeFallsThrough
TestClassifyExecError_UnknownStructuredCodeFallsThrough covers marker hardening: even with a well-formed pad-structured-error/v1 marker, a code that's
internal/mcp/open_children_passthrough_test.go:155
FunctionTestClassifyHTTPStatus
TestClassifyHTTPStatus covers the HTTP status → ErrorCode mapping. Each documented status maps to the expected code; unmapped statuses fall through to
internal/mcp/errors_test.go:158
FunctionTestClassifyHTTPStatus_AuthRequiredOn401
───────────────────────────────────────────────────────────────────── 401 / 403 / 404 / 409 / 422 / 5xx envelope round-trips ─────────────────────────
internal/mcp/dispatch_http_envelope_test.go:56
FunctionTestClassifyHTTPStatus_ConflictOn409
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:102
FunctionTestClassifyHTTPStatus_ConflictWithoutCodeFallsToErrConflict
TestClassifyHTTPStatus_ConflictWithoutCodeFallsToErrConflict pins the inverse: a 409 WITHOUT an upstream code (or with code="conflict" explicitly) sti
internal/mcp/open_children_passthrough_test.go:81
FunctionTestClassifyHTTPStatus_Generic403FallsToPermissionDenied
TestClassifyHTTPStatus_Generic403FallsToPermissionDenied confirms the inverse: a plain 403 without a plan_limit_exceeded code still collapses to ErrPe
internal/mcp/open_children_passthrough_test.go:345
FunctionTestClassifyHTTPStatus_HintsAreActionable
TestClassifyHTTPStatus_HintsAreActionable pins TASK-1079's hint improvements: hints reference the actual route + ref (or workspace slug) the dispatche
internal/mcp/dispatch_http_envelope_uniform_test.go:150
FunctionTestClassifyHTTPStatus_ItemNotFoundOn404Generic
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:79
FunctionTestClassifyHTTPStatus_KindAware
TestClassifyHTTPStatus_KindAware pins TASK-1078's resource-kind classification — 404s split into item_not_found / unknown_workspace / not_found based
internal/mcp/dispatch_http_envelope_uniform_test.go:117
FunctionTestClassifyHTTPStatus_OpenChildrenPreservesCodeAndDetails
(t *testing.T)
internal/mcp/open_children_passthrough_test.go:27
FunctionTestClassifyHTTPStatus_OtherClientStatusFallsToServerError
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:145
FunctionTestClassifyHTTPStatus_PermissionDeniedOn403
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:70
FunctionTestClassifyHTTPStatus_PlanLimitPreservesCodeAndDetails
─── TASK-788: plan_limit_exceeded — HTTP and stdio pass-through ────────────── TestClassifyHTTPStatus_PlanLimitPreservesCodeAndDetails exercises the H
internal/mcp/open_children_passthrough_test.go:292
FunctionTestClassifyHTTPStatus_ServerErrorOn500
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:131
FunctionTestClassifyHTTPStatus_UnknownConflictCodeFallsBackToErrConflict
TestClassifyHTTPStatus_UnknownConflictCodeFallsBackToErrConflict covers that HTTP and stdio must agree on the closed set of structured codes they surf
internal/mcp/open_children_passthrough_test.go:239
FunctionTestClassifyHTTPStatus_UnknownWorkspaceOn404WorkspaceBody
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:89
FunctionTestClassifyHTTPStatus_ValidationOn400
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:120
FunctionTestClassifyHTTPStatus_ValidationOn422
(t *testing.T)
internal/mcp/dispatch_http_envelope_test.go:111
FunctionTestClassifyHTTPStatus_WorkspaceMemberLimit
BUG-3098: an invitation accept refused by the workspace's member cap is addressed to the invitee. The classifier must keep its own code and must not g
internal/mcp/workspace_member_limit_test.go:14
FunctionTestClassifyMCPToolOutcome
BUG-3879: how a failed tool call's structured error code becomes the audit row's (result_status, error_kind).
internal/server/mcp_tool_outcome_test.go:12
FunctionTestClassifyScheduleChangesReportsOrphans
A carried move keeps every valid row; the classifier reports the rest, and the preview and the restore share it.
internal/store/schedule_copy_test.go:1306
FunctionTestClaudePlugin_ActivityHooks
(t *testing.T)
internal/mcp/claude_plugin_manifest_test.go:24
FunctionTestClaudePlugin_MarketplaceFollowsStableReleases
TASK-3487: the marketplace's pad entry follows STABLE releases. Its source is either the in-repo "./plugin" (before the first stable tag that carries
internal/mcp/claude_plugin_manifest_test.go:125
FunctionTestClaudePlugin_NoPinnedVersion
(t *testing.T)
internal/mcp/claude_plugin_manifest_test.go:104
FunctionTestCleanExpiredEmailVerifications
TestCleanExpiredEmailVerifications: the reaper's store method deletes expired AND used rows but keeps live ones. Exercised on both dialects via test-p
internal/store/email_verification_test.go:199
FunctionTestCleanExpiredSessions
(t *testing.T)
internal/store/sessions_test.go:129
FunctionTestCleanupMarkdown
(t *testing.T)
internal/urlimport/generic_test.go:108
FunctionTestCleanupStaleBootstrapToken
TestCleanupStaleBootstrapToken covers the D4 path: a token file left behind by a previous successful bootstrap whose `os.Remove` somehow failed. Start
internal/server/bootstrap_test.go:184
FunctionTestClientCannotClaimRecoveryVersionSource
A client cannot claim the recovery label for its own write.
internal/server/materialize_recovery_test.go:554
FunctionTestClientIP
(t *testing.T)
internal/server/middleware_ratelimit_test.go:141
FunctionTestClientIP_IPv6NotMangled
TestClientIP_IPv6NotMangled verifies the clientIP helper uses net.SplitHostPort correctly so IPv6 addresses aren't truncated at an internal colon. Aft
internal/server/middleware_session_ip_test.go:268
FunctionTestClientIP_IgnoresProxyHeaders
(t *testing.T)
internal/server/middleware_ratelimit_test.go:164
FunctionTestClientSendsResolvedAgentHeader
The resolver is only half the path: its value has to reach the wire as X-Pad-Agent, which is the header the server keys attribution on. The server-sid
internal/cli/agent_identity_test.go:104
FunctionTestCloneDoesNotShareTheNotificationProcessor
The clone gets its own push-notification processor rather than the source client's.
internal/accesskick/accesskick_test.go:80
FunctionTestCloseDoesNotLookLikeAResubscription
Close must not look like a resubscription. WHAT THIS DOES AND DOES NOT PIN, because the first version of this comment got it wrong and the mutation s
internal/watchevents/redis_reconnect_test.go:491
FunctionTestCloseDuringEstablishmentDoesNotLeakTheSubscription
TestCloseDuringEstablishmentDoesNotLeakTheSubscription covers this case. Close cancels the context BEFORE it takes the lock and drains wsSubs, so an
internal/events/redis_subscribe_confirm_test.go:870
FunctionTestClosingALiveRedisBusReleasesEverything
Close on a LIVE Redis bus: every subscriber channel closes so handlers exit, and the receive loops stop. Existing coverage only unsubscribes the last
internal/events/redis_uncovered_test.go:134
FunctionTestClosingTheBusDuringACycleInstallsNothing
TestClosingTheBusDuringACycleInstallsNothing covers this case. Close cancels b.ctx and drains wsSubs, but it does NOT join the maintenance goroutines
internal/events/redis_heartbeat_test.go:1775
FunctionTestClosingTheBusDuringAnIdleCycleIsSafe
TestClosingTheBusDuringAnIdleCycleIsSafe drives the one interleave the cycle path created and nothing else exercises: Close running while a cycle is b
internal/watchevents/heartbeat_test.go:823
FunctionTestClosingTheBusStillEndsAnInFlightDial
TestClosingTheBusStillEndsAnInFlightDial pins the half of the dial's context that BUG-2749 nearly removed. Before this unit the dial ran on the bus's
internal/events/redis_subscribe_cancel_test.go:533
FunctionTestClosingTheBusStillEndsTheSettleWindow
TestClosingTheBusStillEndsTheSettleWindow pins the half that threading the request context could have silently dropped. b.ctx is what lets Close cut
internal/watchevents/redis_bus_resume_test.go:495
FunctionTestClosingTheBusStopsTheMaintenanceLoop
TestClosingTheBusStopsTheMaintenanceLoop pins the teardown half of that wiring. ASSERTED ON THE GOROUTINE, NOT ON REDIS TRAFFIC, and the first versio
internal/events/redis_heartbeat_test.go:1825
FunctionTestCloudAdminGate_ActiveAdminSession_GarbageSecret_StillSucceeds
TestCloudAdminGate_ActiveAdminSession_GarbageSecret_StillSucceeds is the companion to the disabled-admin test above: a non-disabled admin session hitt
internal/server/cloud_admin_gate_test.go:1050
FunctionTestCloudAdminGate_BodySecret_BackwardCompat
TestCloudAdminGate_BodySecret_BackwardCompat verifies a POST with cloud_secret ONLY in the JSON body still works — the existing pad-cloud sidecar sent
internal/server/cloud_admin_gate_test.go:162
FunctionTestCloudAdminGate_BypassScopedToCloudPaths
TestCloudAdminGate_BypassScopedToCloudPaths verifies the regression from PR #182: setting X-Cloud-Secret on a NON-cloud-admin path must NOT bypass aut
internal/server/cloud_admin_gate_test.go:121
FunctionTestCloudAdminGate_DisabledAdminSession_GarbageSecret_RejectedByRequireAuth
TestCloudAdminGate_DisabledAdminSession_GarbageSecret_RejectedByRequireAuth is the regression test for the concrete gap BUG-1944's fix closes: before
internal/server/cloud_admin_gate_test.go:994
FunctionTestCloudAdminGate_GarbageSecretNoSession_ReachesHandlerRejection
TestCloudAdminGate_GarbageSecretNoSession_ReachesHandlerRejection is a regression lock for BUG-1944: RequireAuth's cloud-secret bypass must still fire
internal/server/cloud_admin_gate_test.go:959
FunctionTestCloudAdminGate_HeaderSecret_StillAuthenticates
TestCloudAdminGate_HeaderSecret_StillAuthenticates confirms the header form (the only supported sidecar auth after TASK-656) still works on the GET en
internal/server/cloud_admin_gate_test.go:928
FunctionTestCloudAdminGate_NoCloudSecret_RequiresAuth
TestCloudAdminGate_NoCloudSecret_RequiresAuth verifies that without X-Cloud-Secret/?cloud_secret the endpoint falls through to the normal auth gate —
internal/server/cloud_admin_gate_test.go:77
FunctionTestCloudAdminGate_QueryParamSecret_Rejected
TestCloudAdminGate_QueryParamSecret_Rejected verifies TASK-656 dropped the legacy ?cloud_secret= query-param — query values land in access logs, so ac
internal/server/cloud_admin_gate_test.go:185
FunctionTestCloudAdminGate_SelfHost_Returns404
TestCloudAdminGate_SelfHost_Returns404 verifies the cloud-admin endpoints disappear entirely when the server isn't in cloud mode — no "cloud mode not
internal/server/cloud_admin_gate_test.go:40
FunctionTestCloudAdminGate_ValidCloudSecret_PassesAuthAndCSRF
TestCloudAdminGate_ValidCloudSecret_PassesAuthAndCSRF verifies a sidecar POST with the right X-Cloud-Secret reaches the handler — CSRF is off because
internal/server/cloud_admin_gate_test.go:94
FunctionTestCloudBaseURLIsCanonicalAppURL
(t *testing.T)
internal/config/config_test.go:180
FunctionTestCloudContract
(t *testing.T)
internal/server/cloud_contract_test.go:68
FunctionTestCloudRegister_SeedFailure_RemovesTheWorkspaceAndSignupStillSucceeds
captureLogs lives in workspace_owner_compensation_test.go. --- seed failure --------------------------------------------------------- TestCloudRegiste
internal/server/handlers_cloud_autocreate_husk_test.go:69
FunctionTestCloudRegister_UnverifiableConfig_StaysClosed
--------------------------------------------------------------------- DR-6 guard: cloud WITHOUT a usable emailed-link path stays CLOSED, so no user is
internal/server/handlers_verify_email_test.go:323
FunctionTestCloudSignup_DuplicateEmail_Returns409
--------------------------------------------------------------------- DR-11: duplicate email at open signup keeps the clear 409. ---------------------
internal/server/handlers_verify_email_test.go:213
FunctionTestCloudSignup_UnverifiedThenVerifyUnblocksSameSession
--------------------------------------------------------------------- DR-6 + DR-5 + Wave 3a: cloud signup → unverified → verify → unblocked. ---------
internal/server/handlers_verify_email_test.go:108
FunctionTestCmdhelpVersion_WireFormat
(t *testing.T)
cmd/pad/help_cmdhelp_test.go:244
FunctionTestCobraUsagePatternDoesNotCaptureServerMessages
CONTROL: the pattern is anchored, so a server message that merely contains one of these phrases mid-sentence, and a genuinely transient failure, are n
internal/mcp/bug3142_cobra_usage_classification_test.go:73
FunctionTestCobraUsageRefusalsClassifyAsValidationFailed
BUG-3142, the classifier half. cobra and pflag refuse a bad argv before the command runs, and none of those refusals matched a stderr pattern, so the
internal/mcp/bug3142_cobra_usage_classification_test.go:18
FunctionTestCodeOrBlank
(t *testing.T)
internal/urlimport/openapi_test.go:241
FunctionTestCoerceFieldsDoesNotMutateItsInput
CoerceFields returns a NEW map. Two call sites re-marshal the map they pass in, so a function that quietly rewrote its argument would change what gets
internal/items/coerce_test.go:135
FunctionTestCoerceFieldsKeepsNumberLiterals
BUG-3202: a numeric string keeps its literal, so a value past float64's integer precision reaches the store with every digit. The forms ParseFloat acc
internal/items/coerce_test.go:182
FunctionTestCoerceFieldsLeavesStringTypedFieldsAlone
Types that are already strings must stay strings. A "coerce everything that parses" implementation would turn a text field holding "42" into a number
internal/items/coerce_test.go:57
FunctionTestCoerceFieldsLeavesUndeclaredKeysUntouched
Keys the schema does not declare are left exactly as they arrived. This is TODAY'S behaviour and the other half of BUG-2850 — the disposition (refuse
internal/items/coerce_test.go:124
FunctionTestCoerceFieldsLeavesUnparseableValuesForTheValidator
A value that will not parse is handed to the validator UNCHANGED, so the existing "must be a number" error still fires. Coercion must not invent an er
internal/items/coerce_test.go:74
FunctionTestCoerceFieldsPassesNonStringsThrough
Non-string values pass through untouched. This is not a re-typing pass over well-formed input — a caller already sending 42 keeps sending 42, and an i
internal/items/coerce_test.go:104
FunctionTestCoerceFieldsRefusesNonFiniteNumbers
NaN and ±Inf parse as floats and then cannot be marshalled: encoding/json fails, the downstream json.Marshal(fields) error is ignored, and the ENTIRE
internal/items/coerce_test.go:92
FunctionTestCoerceFieldsTypesDeclaredStrings
The defect this exists for: the remote /mcp door builds its field map with `dst[key] = val`, so a declared number field arrives as the STRING "42" and
internal/items/coerce_test.go:27
FunctionTestCoerceFields_MultiRelationLeavesUnparseableTextAlone
(t *testing.T)
internal/items/multi_relation_normalise_test.go:132
← previousnext →18,201–18,300 of 28,840, ranked by callers