MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestCoerceFields_MultiRelationParsesAJSONArray
P13 — the CLI half of "a multi_relation is writable at all". Every string-carrying transport hands `coerceValue` raw text, and a JSON array is the onl
internal/items/multi_relation_normalise_test.go:114
FunctionTestCoerceFields_ScalarRelationStillTakesABareString
(t *testing.T)
internal/items/multi_relation_normalise_test.go:142
FunctionTestCoercePlaybookValueNumberRejectsBadInput
TestCoercePlaybookValueNumberRejectsBadInput verifies the number coercion rejects partial tokens, NaN, and Inf caught Sscanf("%g") accepting "1abc" si
internal/server/handlers_playbooks_test.go:372
FunctionTestCollabDemotionMakesConnReadOnly
TestCollabDemotionMakesConnReadOnly exercises the mid-session demotion path (TASK-265): an editor connected to a collab room who is demoted to viewer
internal/server/handlers_collab_test.go:976
FunctionTestCollabDialsDoNotSpendTheAPIBucket
The discriminating assertion is the SECOND loop: after a user has spent every collab dial token, their REST calls still have the whole API burst. Befo
internal/server/handlers_collab_bug1308_test.go:61
FunctionTestCollabDirectWrite_OpenChildrenRefusalAlsoLeavesTheOpLog
TestCollabDirectWrite_OpenChildrenRefusalAlsoLeavesTheOpLog covers a SECOND refusal from the same write, because the window is a property of the order
internal/server/handlers_collab_prune_atomicity_test.go:126
FunctionTestCollabDirectWrite_RefusedWriteLeavesTheOpLogIntact
(t *testing.T)
internal/server/handlers_collab_prune_atomicity_test.go:51
FunctionTestCollabDirectWrite_SuccessfulWriteStillPrunes
TestCollabDirectWrite_SuccessfulWriteStillPrunes is the counterfactual, and it is what stops the test above from passing under a fix that simply delet
internal/server/handlers_collab_prune_atomicity_test.go:91
FunctionTestCollabMaxPerUserEnvAndDefault
PAD_COLLAB_MAX_PER_USER reaches the config (BUG-1308), and its default is the measured one. The gate has its own tests in internal/server; this is the
internal/config/collab_limit_config_test.go:8
FunctionTestCollabMembershipRevalidationClosesOnRevoke
TestCollabMembershipRevalidationClosesOnRevoke is the auth-revalidation regression test (TASK-1256). With the reval interval shrunk to a few ms, the g
internal/server/handlers_collab_test.go:394
FunctionTestCollabObserverCountsAppendFailures
TASK-3574: AppendFailed lands on its own series.
internal/metrics/collab_observer_test.go:32
FunctionTestCollabObserverMapsEachReport
TASK-3501: the adapter maps each report to its own series, with counts that differ per series so a crossed wire cannot satisfy them.
internal/metrics/collab_observer_test.go:11
FunctionTestCollabSnapshotAcceptsCursorAtOrAboveMin
TestCollabSnapshotAcceptsCursorAtOrAboveMin is the negative test: a cursor at or above MIN passes the gate.
internal/server/handlers_items_collab_versions_test.go:301
FunctionTestCollabSnapshotCursorBelowMaxLeavesWatermark
TestCollabSnapshotCursorBelowMaxLeavesWatermark confirms a cursor below the current MAX (peer ops the flusher hasn't seen) does NOT advance the waterm
internal/store/items_collab_versions_test.go:303
FunctionTestCollabSnapshotCursorMatchesMaxAdvancesWatermark
TestCollabSnapshotCursorMatchesMaxAdvancesWatermark is the TASK-1319 happy path: a browser flush whose `OpLogCursor` matches the current MAX(op-log.id
internal/store/items_collab_versions_test.go:260
FunctionTestCollabSnapshotDoesNotAdvanceOpLogWatermark
TestCollabSnapshotDoesNotAdvanceOpLogWatermark is a regression guard for TASK-1309: a browser collab-snapshot PATCH (VersionSource="collab-snapshot")
internal/store/items_collab_versions_test.go:201
FunctionTestCollabSnapshotHTTPSourceStamping
TestCollabSnapshotHTTPSourceStamping is a regression guard for TASK-1267 (PLAN-1248 version-diff coexistence verification), covering the HTTP-handler
internal/server/handlers_items_collab_versions_test.go:45
FunctionTestCollabSnapshotNoCursorLeavesWatermark
TestCollabSnapshotNoCursorLeavesWatermark — backwards-compat check: a collab-snapshot PATCH without OpLogCursor (older client) preserves the conservat
internal/store/items_collab_versions_test.go:342
FunctionTestCollabSnapshotPreservesVersionDiff
TestCollabSnapshotPreservesVersionDiff is a regression guard for TASK-1267 (PLAN-1248 version-diff coexistence verification). The 5s collab-snapshot
internal/store/items_collab_versions_test.go:53
FunctionTestCollabSnapshotQueryOverridesBodyVersionSource
TestCollabSnapshotQueryOverridesBodyVersionSource is the TASK-1309 regression: a `?source=collab-snapshot` query MUST override any `version_source` fi
internal/server/handlers_items_collab_versions_test.go:163
FunctionTestCollabSnapshotRejectedBelowDurableRestoreBoundaryAfterRestart
TestCollabSnapshotRejectedBelowDurableRestoreBoundaryAfterRestart is the BUG-2264 residual-#1 guard for the COLLAB-SNAPSHOT flush vector: after a serv
internal/server/handlers_items_collab_versions_test.go:509
FunctionTestCollabSnapshotRejectedBelowRestoreBoundary
TestCollabSnapshotRejectedBelowRestoreBoundary is the BUG-2264 Invariant B guard at the HTTP boundary. Once a version restore reconciles the live Y.Do
internal/server/handlers_items_collab_versions_test.go:420
FunctionTestCollabSnapshotRejectsCursorBelowMin
TestCollabSnapshotRejectsCursorBelowMin is the TASK-1319 regression: a collab-snapshot PATCH whose op_log_cursor is below the current MIN(item_yjs_upd
internal/server/handlers_items_collab_versions_test.go:239
FunctionTestCollabSnapshotRejectsCursorOnEmptyOpLog
TestCollabSnapshotRejectsCursorOnEmptyOpLog mirrors the WS force_refresh predicate at the HTTP layer (TASK-1319). A non-zero cursor against an item wh
internal/server/handlers_items_collab_versions_test.go:339
FunctionTestCollabSnapshotRejectsCursorZeroOnNonEmptyOpLog
TestCollabSnapshotRejectsCursorZeroOnNonEmptyOpLog (TASK-1319): a stateful tab whose previous session disconnected before receiving any op_log_cursor
internal/server/handlers_items_collab_versions_test.go:377
FunctionTestCollabSocketCapIsPerUserWithinAWorkspace
Two authenticated users in ONE workspace hold separate caps: the principal is the user, not the workspace. A key that fell back to the workspace for e
internal/server/handlers_collab_bug1308_test.go:221
FunctionTestCollabSocketCapPerPrincipal
The socket gate: a principal holding PAD_COLLAB_MAX_PER_USER sockets is refused another with 429 collab_limit_exceeded and a Retry-After, and gets its
internal/server/handlers_collab_bug1308_test.go:153
FunctionTestCollabUpgradeAcceptsExplicitMatchingSchemaVersion
TestCollabUpgradeAcceptsExplicitMatchingSchemaVersion confirms the happy path of the handshake: a client that sends a schema_version matching the serv
internal/server/handlers_collab_test.go:574
FunctionTestCollabUpgradeFreshInstall
TestCollabUpgradeFreshInstall covers the no-users escape hatch: before any user is bootstrapped, the handler should grant access to the WS upgrade jus
internal/server/handlers_collab_test.go:90
FunctionTestCollabUpgradeMissingItemIDBadRequest
TestCollabUpgradeMissingItemIDBadRequest exercises the bad-request branch — chi's URL pattern requires the {itemID} segment to be present, so the rout
internal/server/handlers_collab_test.go:612
FunctionTestCollabUpgradeRejectsGuestWithSiblingItemGrantOnly
TestCollabUpgradeRejectsGuestWithSiblingItemGrantOnly is a regression test for an over-grant bug: a guest with an item-level grant on item A could upg
internal/server/handlers_collab_test.go:280
FunctionTestCollabUpgradeRejectsNonMember
TestCollabUpgradeRejectsNonMember confirms that an authenticated user who is NOT a member of the item's workspace gets 403, not 200, even though they'
internal/server/handlers_collab_test.go:148
FunctionTestCollabUpgradeRejectsRestrictedMemberForeignCollection
TestCollabUpgradeRejectsRestrictedMemberForeignCollection confirms that a member with collection_access="specific" scoped to one collection cannot upg
internal/server/handlers_collab_test.go:204
FunctionTestCollabUpgradeRejectsSchemaVersionMismatch
TestCollabUpgradeRejectsSchemaVersionMismatch is the TASK-1268 negative-handshake regression: a client announcing a different SCHEMA_VERSION than the
internal/server/handlers_collab_test.go:547
FunctionTestCollabUpgradeRejectsUnauthenticated
TestCollabUpgradeRejectsUnauthenticated verifies that once a user is bootstrapped (so the no-users escape hatch is closed), an unauthenticated upgrade
internal/server/handlers_collab_test.go:124
FunctionTestCollabUpgradeRejectsUnknownItem
TestCollabUpgradeRejectsUnknownItem covers the 404 path: a well-formed itemID that doesn't resolve to any item must surface as Not Found, not as a 401
internal/server/handlers_collab_test.go:370
FunctionTestCollabUpgradeUnavailableWithoutRoomManager
TestCollabUpgradeUnavailableWithoutRoomManager confirms the handler returns 503 when no RoomManager is wired (the SetCollabRoomManager call hasn't hap
internal/server/handlers_collab_test.go:522
FunctionTestCollabViewerIsReadOnly
TestCollabViewerIsReadOnly is the TASK-265 regression: a workspace VIEWER admitted to a collab room is a READ-ONLY participant. It keeps live view + p
internal/server/handlers_collab_test.go:685
FunctionTestCollab_StaysOpenWhileTheCredentialIsValid
(t *testing.T)
internal/server/handlers_stream_session_liveness_test.go:541
FunctionTestCollab_StopsWhenThePATIsRevoked
(t *testing.T)
internal/server/handlers_stream_session_liveness_test.go:402
FunctionTestCollab_StopsWhenTheSessionIsDestroyed
(t *testing.T)
internal/server/handlers_stream_session_liveness_test.go:349
FunctionTestCollapseAutosaveBursts
(t *testing.T)
internal/server/handlers_timeline_collapse_test.go:58
FunctionTestCollapseAutosaveBursts_ImportedNeverFoldsWithNative
BUG-3379: an imported autosave never folds into a native one or back. Both usually carry no user id, so the user check alone let them merge, and the r
internal/server/handlers_timeline_collapse_test.go:206
FunctionTestCollapseAutosaveBursts_LoneAutosaveHasNoRun
(t *testing.T)
internal/server/handlers_timeline_collapse_test.go:194
FunctionTestCollapseAutosaveBursts_RunDescribesDroppedRows
PLAN-2348 U3: the kept row says what it stands for, and two writers' autosaves are two runs.
internal/server/handlers_timeline_collapse_test.go:135
FunctionTestCollapseAutosaveBursts_SplitsByWriter
(t *testing.T)
internal/server/handlers_timeline_collapse_test.go:164
FunctionTestCollapseAutosaveBursts_UnknownCountsLeaveRunUncounted
(t *testing.T)
internal/server/handlers_timeline_collapse_test.go:182
FunctionTestCollapseChanges
(t *testing.T)
internal/store/activities_test.go:437
FunctionTestCollectServerInfoLocalRuntime
(t *testing.T)
cmd/pad/server_info_test.go:105
FunctionTestCollectServerInfoRemoteAuthenticated
(t *testing.T)
cmd/pad/server_info_test.go:18
FunctionTestCollectedReportCarriesDecisionProviderAndNoKey
(t *testing.T)
cmd/pad/server_info_decision_test.go:83
FunctionTestCollectionAccess_DefaultIsAll
(t *testing.T)
internal/store/permissions_test.go:307
FunctionTestCollectionAccessorsShareOneHydration
TestCollectionAccessorsShareOneHydration is the TASK-2368 outcome guard. Three accessors read a full collection row — GetCollection, GetCollectionAny
internal/store/collections_test.go:820
FunctionTestCollectionCRUD
--- Collection Tests ---
internal/store/items_test.go:217
FunctionTestCollectionCRUD
(t *testing.T)
internal/server/handlers_items_test.go:46
FunctionTestCollectionCheckboxProgress
TestCollectionCheckboxProgress covers the markdown-checkbox progress endpoint that pairs with /items-index (TASK-1349). Verifies SQL LENGTH/REPLACE ar
internal/server/handlers_items_test.go:1940
FunctionTestCollectionChildProgress
TestCollectionChildProgress covers the /collections/{coll}/child-progress endpoint introduced in BUG-1509. It verifies: - Happy path: items with linke
internal/server/handlers_items_test.go:2059
FunctionTestCollectionCompletedWorkValues_ParsesJSON
(t *testing.T)
internal/models/terminal_test.go:333
FunctionTestCollectionCreateValidation
(t *testing.T)
internal/server/handlers_items_test.go:128
FunctionTestCollectionDeleteDefaultRefused
(t *testing.T)
internal/store/items_test.go:308
FunctionTestCollectionGrantAndShareLinkDelete_ItemGrantOnly_HiddenCollection404
─── Item-grant-only must NOT promote to collection-wide delete/views ─ TestCollectionGrantAndShareLinkDelete_ItemGrantOnly_HiddenCollection404 extends
internal/server/handlers_grant_visibility_test.go:590
FunctionTestCollectionGrants_RestrictedOwner_HiddenCollection404
─── handleCreateCollectionGrant / handleListCollectionGrants ────────── TestCollectionGrants_RestrictedOwner_HiddenCollection404 pins the collection-l
internal/server/handlers_grant_visibility_test.go:282
FunctionTestCollectionIDForKindIgnoresInvisibleCollections
TestCollectionIDForKindIgnoresInvisibleCollections is the artifact-import half of the shadowing fix. Same failure shape as playbook resolution: with t
internal/server/handlers_collection_traits_test.go:323
FunctionTestCollectionItemList_ItemGrantOnly_DoesNotLeakSiblings
A VISIBILITY REGRESSION this branch introduced and then reverted, pinned so it cannot come back. The collection-item list was briefly "pinned" by set
internal/server/collection_resolve_test.go:473
FunctionTestCollectionListRoutesToMarkdown
(t *testing.T)
cmd/pad/format_markdown_routing_test.go:149
FunctionTestCollectionListWithItemCounts
(t *testing.T)
internal/store/items_test.go:341
FunctionTestCollectionNotFoundIsAuthoritative_Definitive_CachesVerdict
(t *testing.T)
internal/cli/capabilities_probe_test.go:31
FunctionTestCollectionNotFoundIsAuthoritative_Transient_FailsClosedAndReprobes
(t *testing.T)
internal/cli/capabilities_probe_test.go:64
FunctionTestCollectionPrefixRefusalClassifiesAsValidation
BUG-2951's load-bearing argument, measured rather than asserted. The stdio transport classifies a CLI failure by matching stderr PROSE. While the col
internal/mcp/collection_refusal_classification_test.go:24
FunctionTestCollectionPrefixRefusal_IsActionableAtEveryDoor
(t *testing.T)
internal/server/handlers_collections_refusal_status_test.go:46
FunctionTestCollectionSchemaJSONFromFlags_BackfillsMissingLabels
TestCollectionSchemaJSONFromFlags_BackfillsMissingLabels verifies that a schema field with no `label` gets one auto-filled from its `key` using Title-
cmd/pad/collection_create_schema_test.go:167
FunctionTestCollectionSchemaJSONFromFlags_BothEmptyReturnsEmptySchema
TestCollectionSchemaJSONFromFlags_BothEmptyReturnsEmptySchema verifies the no-flags case yields an empty schema (and no error).
cmd/pad/collection_create_schema_test.go:144
FunctionTestCollectionSchemaJSONFromFlags_BothFlagsError
TestCollectionSchemaJSONFromFlags_BothFlagsError checks the mutually-exclusive guard.
cmd/pad/collection_create_schema_test.go:83
FunctionTestCollectionSchemaJSONFromFlags_EmptyFallsThroughToFields
TestCollectionSchemaJSONFromFlags_EmptyFallsThroughToFields verifies that an empty --schema falls through to the --fields DSL parser (backward compat)
cmd/pad/collection_create_schema_test.go:120
FunctionTestCollectionSchemaJSONFromFlags_File
TestCollectionSchemaJSONFromFlags_File verifies the @<path> file path resolver.
cmd/pad/collection_create_schema_test.go:44
FunctionTestCollectionSchemaJSONFromFlags_Inline
TestCollectionSchemaJSONFromFlags_Inline verifies the inline JSON path: schemaInput is the literal JSON, gets unmarshaled then re-marshaled through th
cmd/pad/collection_create_schema_test.go:16
FunctionTestCollectionSchemaJSONFromFlags_MalformedJSON
TestCollectionSchemaJSONFromFlags_MalformedJSON ensures the unmarshal error is wrapped with the "invalid --schema JSON" prefix so users can see which
cmd/pad/collection_create_schema_test.go:96
FunctionTestCollectionSchemaJSONFromFlags_MissingFile
TestCollectionSchemaJSONFromFlags_MissingFile ensures a clear error when the @path target doesn't exist.
cmd/pad/collection_create_schema_test.go:108
FunctionTestCollectionSchemaJSONFromFlags_PreservesAllFieldDefProperties
TestCollectionSchemaJSONFromFlags_PreservesAllFieldDefProperties is the regression test for BUG-1284: confirms that every FieldDef property — not just
cmd/pad/collection_create_schema_test.go:198
FunctionTestCollectionSchemaJSONFromFlags_Stdin
TestCollectionSchemaJSONFromFlags_Stdin verifies the "-" stdin resolver.
cmd/pad/collection_create_schema_test.go:67
FunctionTestCollectionSchemaStdin_BlankRefused
collection create/update --schema -: a blank body is not JSON, so it is already refused.
cmd/pad/item_stdin_blank_test.go:278
FunctionTestCollectionShareLinksAndGrants_ItemGrantOnly_HiddenCollection404
─── Item-grant-only must NOT promote to collection-wide access ─────── TestCollectionShareLinksAndGrants_ItemGrantOnly_HiddenCollection404 pins the fo
internal/server/handlers_grant_visibility_test.go:330
FunctionTestCollectionShareLinks_RestrictedOwner_HiddenCollection404
─── handleCreateCollectionShareLink / handleListCollectionShareLinks ── TestCollectionShareLinks_RestrictedOwner_HiddenCollection404 pins the collecti
internal/server/handlers_grant_visibility_test.go:195
FunctionTestCollectionSlugCandidates
Unit-level coverage of the candidate generator, including the cases that must produce NOTHING rather than a surprising guess.
internal/server/collection_resolve_test.go:258
FunctionTestCollectionSlugUniqueness
(t *testing.T)
internal/store/items_test.go:1081
FunctionTestCollectionSlugWritersDoNoPoolIOUnderTheLock
TestCollectionSlugWritersDoNoPoolIOUnderTheLock is the guard for the invariant the fix introduces: everything CreateCollection and a renaming UpdateCo
internal/store/collections_slug_race_pg_test.go:274
FunctionTestCollectionSourceSurvivesExportImport
BUG-3447: collections.source is the only agent-activity signal an onboarding workspace has before its first item, and `pad db migrate` is this same ex
internal/store/bug3447_collection_source_export_test.go:13
FunctionTestCollectionStoreDoorsRefuseNonObjectSettings
BUG-3985: the store's own collection doors refuse settings that are not a JSON object. The HTTP decoder already does (IDEA-1488); these doors are the
internal/store/bug3985_settings_not_object_test.go:13
FunctionTestCollectionTracksWork
PLAN-3535: tracks_work is read, defaulted, carried and validated in one place.
internal/models/tracks_work_test.go:10
FunctionTestCollectionTraitsBackfill
TestCollectionTraitsBackfill exercises the backfill half of migration 080 (SQLite) / 058 (Postgres) — the part that protects EXISTING workspaces. Ord
internal/store/collection_traits_backfill_test.go:23
FunctionTestCollectionTraitsExplicitClear
TestCollectionTraitsExplicitClear proves the preservation above is not a one-way door: a caller that MEANS to clear declarations still can.
internal/server/handlers_collection_traits_test.go:58
FunctionTestCollectionTraitsRejectMalformed
TestCollectionTraitsRejectMalformed locks the fail-loud gate (SPEC-0 L6). A declaration that cannot be parsed or validated must be REFUSED, because a
internal/server/handlers_collection_traits_test.go:81
FunctionTestCollectionTraitsRoundTrip
TestCollectionTraitsRoundTrip guards the storage contract: what Validate accepts must survive a write/read cycle through the traits column.
internal/models/collection_traits_test.go:160
FunctionTestCollectionTraitsSurviveOrdinarySchemaEdit
TestCollectionTraitsSurviveOrdinarySchemaEdit is the property that decided traits get their own column instead of a key inside the schema JSON. Every
internal/server/handlers_collection_traits_test.go:21
FunctionTestCollectionTraitsValidate
(t *testing.T)
internal/models/collection_traits_test.go:38
FunctionTestCollectionTraitsWithRepeatedMembersAreStoredCollapsed
BUG-2896, the collection create and update doors. Traits sent in the STRING wire form were stored as the caller spelled them, so a repeated member was
internal/server/bug2896_collection_traits_duplicate_keys_test.go:19
FunctionTestCollectionTraitsWithoutRepeatsAreStoredVerbatim
The control direction: traits with no repeat are stored exactly as sent and the response carries no warnings key at all.
internal/server/bug2896_collection_traits_duplicate_keys_test.go:86
FunctionTestCollectionsSettingsDefaultsToEmptyObject
TestCollectionsSettingsDefaultsToEmptyObject is the companion guard: when an INSERT omits the settings column entirely, the column DEFAULT must materi
internal/store/collections_test.go:63
FunctionTestCollectionsSettingsNotNullEnforced
IDEA-1484: the BUG-1482 NULL-settings regression tests (TestListCollectionsMinimalHandlesNullSettings, TestGetCollectionHandlesNullSettings, TestListC
internal/store/collections_test.go:44
FunctionTestCollectionsSettingsShapeRepair_Postgres
TestCollectionsSettingsShapeRepair_Postgres is the Postgres counterpart. JSONB rejects invalid JSON at write time, so the survivable pathologies are S
internal/store/collections_settings_shape_repair_test.go:166
← previousnext →18,301–18,400 of 28,840, ranked by callers