MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions11,926 in github.com/PerpetualSoftware/pad

↓ 20 callersFunctionmultiDefaultSchema
A `multi_relation` DEFAULT, and `required` on one (PLAN-2857 U4, codex round 1's P2 and P3). Both were the same defect in two places: a gate reading
internal/store/relation_multi_defaults_test.go:18
↓ 20 callersFunctionmustItem
(t *testing.T, srv *Server, wsID, collID, title string)
internal/server/authz_cross_workspace_test.go:114
↓ 20 callersFunctionu1RelationSchema
Referent validation for relation values (PLAN-2857 U1 / TASK-2878). These are the STORE-level rules — does the value name a live item in the declared
internal/store/relation_referents_test.go:21
↓ 20 callersFunctionwatchNotificationVisible
watchNotificationVisible decides whether a Notification should be delivered to a caller holding the given watch map. Extracted from the handler so the
internal/server/handlers_watch_events.go:628
↓ 20 callersFunctionwriteOutboxTx
writeOutboxTx appends one canonical event to the outbox on the caller's transaction. Two rejections, both deliberately hard errors that fail the encl
internal/store/event_outbox.go:368
↓ 19 callersFunctionCoerceFields
CoerceFields converts STRING field values to the type the collection schema declares, so every write door stores the same native type for the same inp
internal/items/coerce.go:46
↓ 19 callersMethodDeleteCollection
DeleteCollection soft-deletes a collection by id. When expectedUpdatedAt is non-empty it opts into optimistic-concurrency control (BUG-2265): the row'
internal/store/collections.go:748
↓ 19 callersMethodListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:741
↓ 19 callersMethodListen
Listen builds the HTTP server and binds addr, returning the listener without accepting on it yet. A failure here is the "address already in use" case,
internal/server/server.go:2172
↓ 19 callersFunctionLoadStore
LoadStore reads the credentials file and returns a usable CredentialStore. Returns an empty (but non-nil) store if the file doesn't exist — that's not
internal/cli/credentials.go:96
↓ 19 callersMethodSetWatchEventsBus
SetWatchEventsBus attaches the watch/nudge notification bus consumed by GET /api/v1/events/stream (TASK-2533). Nil-checked by every producer and by th
internal/server/server.go:848
↓ 19 callersMethodUserCount
UserCount returns the total number of registered users.
internal/store/users.go:578
↓ 19 callersFunctionbodyDecodesNUL
bodyDecodesNUL reports whether any string a handler could read out of this JSON body — an object key or a value, at any nesting depth, including insid
internal/server/middleware_request_text.go:488
↓ 19 callersFunctionclassifyExecError
classifyExecError turns an exec.Cmd failure (err + stderr) into a structured envelope. lookup is optional — when supplied, no_workspace errors get ava
internal/mcp/errors.go:490
↓ 19 callersFunctionequalSlice
equalSlice is a small helper for stable []string comparison; kept here so test files across the package can share it. catalog_test.go has equalString
internal/mcp/registry_test.go:188
↓ 19 callersFunctioninstallStub
(t *testing.T, dir, name string)
internal/buildtools/install_refresh_test.go:127
↓ 19 callersFunctionkillStub
(t *testing.T, name string)
internal/buildtools/install_refresh_test.go:140
↓ 19 callersFunctionnewGCClaimFixture
(t *testing.T)
internal/store/attachments_gc_claim_test.go:23
↓ 19 callersFunctionnewLocalOnlyBus
newLocalOnlyBus builds a RedisBus without starting its subscription, for the tests that exercise the local fan-out path directly. Constructing through
internal/watchevents/redis_bus_test.go:55
↓ 19 callersFunctionrequireScriptDeps
uniqueName returns a stub name that is unique per test and under the 15-character comm limit pgrep -x matches on. requireScriptDeps skips when the env
internal/buildtools/install_refresh_test.go:75
↓ 19 callersMethodrestrictedEditor
--- authorization: the four checks, in order -------------------------- restrictedEditor returns an editor in both workspaces whose membership in each
internal/server/handlers_items_copy_preflight_test.go:652
↓ 19 callersMethodsnapshot
()
internal/events/observer_test.go:109
↓ 19 callersFunctionuniqueName
(t *testing.T)
internal/buildtools/install_refresh_test.go:114
↓ 18 callersMethodError
()
internal/attachments/mime.go:502
↓ 18 callersFunctionExtractWikiLinks
ExtractWikiLinks scans `content` for [[...]] occurrences OUTSIDE any fenced or inline code region, parses each into a WikiLinkRef, and returns them in
internal/links/extract.go:510
↓ 18 callersMethodGetOAuthConnection
GetOAuthConnection fetches the connection row by request_id. Returns ErrOAuthConnectionNotFound if no row exists; any other error is a real I/O failur
internal/store/oauth_connections.go:106
↓ 18 callersMethodGetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:180
↓ 18 callersMethodPut
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:41
↓ 18 callersMethodSave
Save writes the persisted Pad config to disk.
internal/config/config.go:522
↓ 18 callersMethodUnsubscribe
Unsubscribe removes a local subscriber and closes its channel. Cancels the Redis subscription if this was the last local subscriber for the workspace.
internal/events/redis_bus.go:1251
↓ 18 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel. Safe to call with an already-removed channel — no-op in that case.
internal/collab/bus.go:102
↓ 18 callersFunctionassertAllowed
(t *testing.T, got CrossWorkspaceAccess, label string)
internal/server/authz_cross_workspace_test.go:186
↓ 18 callersMethodbearerHeaders
()
internal/server/handlers_items_test.go:2626
↓ 18 callersMethodbuildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:586
↓ 18 callersFunctionclientIP
clientIP extracts the client IP from RemoteAddr. This is safe because TrustedProxyRealIP runs earlier in the chain and — when a trusted proxy is confi
internal/server/middleware_ratelimit.go:532
↓ 18 callersFunctionconnectedAppsTestServer
Connected-apps handler tests (PLAN-943 TASK-954). What's covered: - GET /api/v1/connected-apps requires cloud mode (404 outside). - List returns onl
internal/server/handlers_connected_apps_test.go:50
↓ 18 callersMethodcopyOK
copyOK issues the copy as the owner and requires a 201.
internal/server/handlers_items_copy_test.go:94
↓ 18 callersFunctioncreateViaTx
Tests for createItemTx — the tx-taking counterpart of CreateItem (PLAN-2357 / DR-9a). Each test below pins one line of the DR-9a parity checklist: slu
internal/store/items_create_tx_test.go:22
↓ 18 callersFunctionfreePort
(t *testing.T)
internal/buildtools/install_refresh_test.go:145
↓ 18 callersMethodlogAuditEventForUser
logAuditEventForUser logs an audit event with an explicit user ID. Use this when the user isn't (yet) in the request context, e.g. after a successful
internal/server/handlers_documents.go:445
↓ 18 callersFunctionrelease
()
web/src/lib/a11y/viewerBackdrop.ts:233
↓ 18 callersFunctionrequireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 callersMethodreset
(reason string)
internal/watchevents/observer.go:180
↓ 18 callersMethodseedNeverAttached
seedNeverAttached inserts a never-attached attachment row aged past any grace cutoff a test will use.
internal/store/attachments_gc_claim_test.go:42
↓ 18 callersFunctionsetupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 18 callersMethodstoredRelation
storedRelation reads owner_ref back out of the database. Deliberately not the response body: a handler that echoed the right thing while writing the w
internal/server/relation_referents_doors_test.go:141
↓ 17 callersMethodApplyExternalContent
ApplyExternalContent routes an external content update through a designated applier when an active room exists. Returns nil on success; one of the sen
internal/collab/applier.go:253
↓ 17 callersMethodGetItemIncludeDeleted
GetItemIncludeDeleted finds an item by id including soft-deleted items. Used by code paths that need to act on records the user already owns even thou
internal/store/items.go:1014
↓ 17 callersMethodListWorkspaces
(ctx context.Context)
internal/mcp/errors.go:322
↓ 17 callersMethodRestoreItem
RestoreItem un-archives a soft-deleted item and bumps the workspace-scoped seq so delta-sync clients re-materialize the row. Same lock + subquery shap
internal/store/items.go:3108
↓ 17 callersMethodSetCloudSidecar
SetCloudSidecar installs the reverse pad → pad-cloud client. Called from cmd/pad/main.go when PAD_CLOUD_SIDECAR_URL + PAD_CLOUD_SECRET are set. When u
internal/server/server.go:645
↓ 17 callersMethodSetEventBus
SetEventBus attaches an event bus for real-time SSE streaming.
internal/server/server.go:840
↓ 17 callersFunctionSniffMIME
SniffMIME detects the MIME type from the leading bytes of a payload using net/http's stdlib detector (the same RFC 6838 algorithm browsers use). The r
internal/attachments/mime.go:249
↓ 17 callersMethodValidateSession
ValidateSession hashes the provided token, looks it up, checks expiry, and returns the session info including the associated user and binding metadata
internal/store/sessions.go:62
↓ 17 callersFunction__resetViewerBackdropForTests
()
web/src/lib/a11y/viewerBackdrop.ts:496
↓ 17 callersMethodacquireWorkspaceSeqLock
acquireWorkspaceSeqLock takes a Postgres advisory transaction lock keyed on the workspace ID so concurrent seq-bumping mutations serialize. The lock a
internal/store/items.go:122
↓ 17 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:345
↓ 17 callersMethodcallAs
callAs is `call` with an explicit user and workspace role, for the legs that need someone other than the fixture owner.
internal/server/relation_referents_doors_test.go:621
↓ 17 callersMethodcreateLink
createLink mints a share link for the fixture's item or collection.
internal/server/handlers_share_attachments_test.go:182
↓ 17 callersFunctiondoArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 17 callersMethodnewRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1947
↓ 17 callersFunctionreadFixture
readFixture loads one of the real encoder outputs described in testdata/README.md. Every ISO-BMFF acceptance assertion in this file runs on those byte
internal/attachments/mime_isobmff_test.go:16
↓ 17 callersMethodrelease
* Drop the lease. `released` is false on a repeat call (no-op). `stackEmpty` * reports whether any lease remains AFTER this release — the caller use
web/src/lib/a11y/viewerBackdrop.ts:37
↓ 17 callersMethodrunReminderTick
runReminderTick is one pass: fire every reminder whose instant has arrived. The store does the arbitration and writes each event in the same transact
internal/server/reminder_tick.go:141
↓ 17 callersFunctionseedParentAndChildren
seedParentAndChildren creates a plan + N child tasks with the given statuses (one per child), returning the parent and the slice of child refs in crea
internal/server/handlers_items_open_children_guard_test.go:24
↓ 17 callersMethodsetContent
setContent overwrites an item's markdown body.
internal/server/handlers_share_attachments_test.go:172
↓ 17 callersFunctiontestServerWithPresence
testServerWithPresence gives a server both the watch bus and the presence registry — the production pairing (cmd_server.go wires them on adjacent line
internal/server/handlers_sessions_test.go:19
↓ 17 callersFunctiontestStoreOAuth
Tests for the OAuth server constructor + audience strategy + storage adapter (PLAN-943 TASK-951 sub-PR B). Each layer is covered: - NewServer: requir
internal/oauth/server_test.go:40
↓ 16 callersMethodAdd
Add implements SessionPresence. Returns the generated id even when the Redis write fails. That is deliberate and it is the same posture the rest of t
internal/server/session_presence_redis.go:458
↓ 16 callersMethodCreateAccessToken
============================================================ Access tokens (handler/oauth2/storage.go AccessTokenStorage) ============================
internal/store/oauth.go:310
↓ 16 callersMethodCreateReminder
CreateReminder arms a reminder on an item. THE ITEM MUST BE A LIVE ITEM OF THIS WORKSPACE, and that is asserted by the INSERT itself rather than by a
internal/store/reminders.go:156
↓ 16 callersMethodCreateShareLink
CreateShareLink creates a new share link and returns it with the raw token. The raw token is only available in this response — it is not stored.
internal/store/share_links.go:47
↓ 16 callersMethodCreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:125
↓ 16 callersMethodGetPlatformSetting
GetPlatformSetting returns a single platform setting value, or empty string if not set.
internal/store/platform_settings.go:6
↓ 16 callersFunctionNewProcessor
NewProcessor returns the Processor compiled into this binary. Pure-Go build → pureGoProcessor. libvips build → vipsProcessor (Phase 2). Constructed o
internal/attachments/processor_purego.go:43
↓ 16 callersFunctionNewRedisSessionPresence
NewRedisSessionPresence returns a shared registry backed by client. The client is the SAME one the watch bus uses (cmd/pad/cmd_server.go dials once o
internal/server/session_presence_redis.go:420
↓ 16 callersMethodSetObserver
SetObserver attaches an Observer. Passing nil detaches. Safe to call after the bus is running; cmd/pad/cmd_server.go calls it at wiring time.
internal/watchevents/observer.go:157
↓ 16 callersMethodSetSessionPresence
SetSessionPresence attaches the live-session registry read by GET /api/v1/sessions and written by GET /api/v1/events/stream (PLAN-2558 S1). Nil-checke
internal/server/server.go:858
↓ 16 callersMethodSetUserPlan
SetUserPlan updates a user's billing plan.
internal/store/limits.go:327
↓ 16 callersFunctionWithTokenAllowedWorkspaces
WithTokenAllowedWorkspaces returns ctx decorated with the OAuth token's workspace allow-list set at consent time (TASK-952). The list is either a set
internal/server/context.go:150
↓ 16 callersFunctioncontextWithWorkspaceRoleForTest
contextWithWorkspaceRoleForTest / contextWithResolvedWorkspaceIDForTest stash the two values RequireWorkspaceAccess populates for the REQUEST's worksp
internal/server/authz_cross_workspace_test.go:19
↓ 16 callersMethodcycledCount
()
internal/events/observer_test.go:73
↓ 16 callersMethodfanOutFromRedis
fanOutFromRedis is the receive path: a message that arrived on the subscription identified by gen, carrying the ID space it belongs to. A zero epoch
internal/events/redis_bus.go:2444
↓ 16 callersMethodgetAsset
getAsset issues GET on the asset endpoint. rawQuery is appended verbatim (already URL-formed, no leading '?').
internal/server/handlers_share_attachments_test.go:214
↓ 16 callersFunctiongetOnlyAttachmentID
getOnlyAttachmentID returns the ID of the single live attachment row in a workspace — the test infrastructure uploads at most one blob per call, so th
internal/server/handlers_storage_test.go:410
↓ 16 callersFunctionimageRef
(id string)
internal/server/handlers_share_attachments_test.go:179
↓ 16 callersFunctionnewMovedToFixture
(t *testing.T)
internal/server/item_moved_to_test.go:49
↓ 16 callersFunctionsetupPushTest
setupPushTest mirrors setupItemOpenTest (item_open_test.go): points getClient()/getWorkspace() at a fake httptest server via the same urlFlag/workspac
cmd/pad/cmd_push_test.go:14
↓ 16 callersMethodwriteItemResolveError
writeItemResolveError distinguishes a soft-deleted (archived) item from a genuinely-missing one for mutation handlers. An archived item still appears
internal/server/handlers_items.go:978
↓ 15 callersMethodAdd
Add implements SessionPresence.
internal/server/session_presence.go:348
↓ 15 callersMethodClaimPendingOutboxEvents
ClaimPendingOutboxEvents claims up to limit pending events for one drain pass and returns them, oldest first. WHY A CLAIM AT ALL. Pad Cloud runs N in
internal/store/event_outbox.go:1792
↓ 15 callersMethodDeleteWorkspace
(slug string)
internal/store/workspaces.go:302
↓ 15 callersMethodFireDueReminders
THE FIRE-PATH INVARIANT, stated once so the next change is measured against it rather than against the last bug: THE CANDIDATE SCAN IS A HINT AND MA
internal/store/reminders.go:606
↓ 15 callersMethodIsConfigured
IsConfigured reports whether the client has an explicit global connection configuration, either from config.toml or an environment/flag override.
internal/config/config.go:564
↓ 15 callersMethodJSONExtractText
JSONExtractText returns SQL to extract a text value from a JSON column. SQLite: json_extract(col, '$.key') PostgreSQL: col->>'key'
internal/store/dialect.go:33
↓ 15 callersFunctionMigrateFields
MigrateFields maps field values from a source schema to a target schema. Fields with matching keys and compatible types are transferred. Incompatible
internal/items/migrate.go:62
↓ 15 callersMethodMoveItem
MoveItem moves an item to a different collection within the same workspace. It updates the collection_id and fields JSON. The item_number is preserved
internal/store/items.go:4942
↓ 15 callersMethodSeedDefaultCollections
SeedDefaultCollections rescues a workspace that ended up with zero collections by seeding it with the standard Software-shape Defaults(). It is intent
internal/store/collections.go:997
↓ 15 callersMethodUpdateItemWithParentLink
UpdateItemWithParentLink is UpdateItemWithPreCheck plus an OPTIONAL parent-link mutation applied inside the same transaction (BUG-2013). When parentLi
internal/store/items.go:2228
↓ 15 callersMethodarchiveSource
()
internal/server/item_moved_to_test.go:108
← previousnext →301–400 of 11,926, ranked by callers