MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestEffortBackfill_FailingSecondChunkThenRerun
A crash between chunks: the second chunk fails, no marker; a re-run owes every candidate, one row each, and writes the marker.
internal/decision/effort_backfill_test.go:210
FunctionTestEffortBackfill_FailureLeavesNoMarker
(t *testing.T)
internal/decision/effort_backfill_test.go:193
FunctionTestEffortBackfill_HoldsNextChunkUntilDrainedThenCancelWritesNoMarker
With chunk 0's jobs left claimable, chunk 1 is not owed; a cancel in the wait returns ctx.Err() with no chunk-1 job and no marker.
internal/decision/effort_backfill_test.go:595
FunctionTestEffortBackfill_LiveReaskInterleavesWithChunks
Pacing (TASK-3921). The drain wait is ONE condition, marked "THE DRAIN-WAIT LINE" in waitChunkDrained (effort_backfill.go); making it return at once m
internal/decision/effort_backfill_test.go:559
FunctionTestEffortBackfill_NoCallsOnlyJobs
(t *testing.T)
internal/decision/effort_backfill_test.go:287
FunctionTestEffortBackfill_NoStartAfterStop
After Stop() a start does nothing: no run, no state left behind.
internal/server/effort_backfill_lifecycle_test.go:144
FunctionTestEffortBackfill_ReplaceCancelsTheOldRunAndTheNewOneCompletes
Replacing the runner mid-backfill cancels the old run, and the new run completes: both items owed, marker set, the old run having written nothing.
internal/server/effort_backfill_lifecycle_test.go:194
FunctionTestEffortBackfill_RespectsDebounce
The backfill's jobs go through the installed debounce: an item evaluated 10 minutes ago waits out the hour, one evaluated 2 hours ago does not.
internal/decision/effort_backfill_test.go:260
FunctionTestEffortBackfill_RunsOnceAndSkipsUnasked
(t *testing.T)
internal/decision/effort_backfill_test.go:137
FunctionTestEffortBackfill_StopCancelsARunningBackfill
Stop() while a backfill is parked mid-run cancels it, the goroutine exits (bg drains), and the marker is never written.
internal/server/effort_backfill_lifecycle_test.go:129
FunctionTestEffortBackfill_StoreFailureMidRunWritesNoMarker
A chunk whose WRITE fails in the store, not in the test hook, must stop the run before the marker. The hook only breaks the table: the error has to co
internal/decision/effort_backfill_test.go:516
FunctionTestEffortLevel
(t *testing.T)
internal/decision/effort_read_test.go:17
FunctionTestElapsedFastForward
(t *testing.T)
internal/schedule/caps_test.go:70
FunctionTestElapsedFastForwardCount
(t *testing.T)
internal/schedule/caps_test.go:93
FunctionTestEmailVerification_CreateLookupConsume
TestEmailVerification_CreateLookupConsume covers the happy path: mint → non-destructive lookup → consume flips users.email_verified_at → single-use.
internal/store/email_verification_test.go:59
FunctionTestEmailVerification_ExpiredRejected
TestEmailVerification_ExpiredRejected: an expired token validates as nil and cannot be consumed, and its consume leaves the user unverified.
internal/store/email_verification_test.go:118
FunctionTestEmailVerification_HashAtRest
TestEmailVerification_HashAtRest: the plaintext is never stored — the column holds the SHA-256 hex of the plaintext.
internal/store/email_verification_test.go:171
FunctionTestEmailVerification_ResendInvalidatesPrior
TestEmailVerification_ResendInvalidatesPrior: minting a new token invalidates the previous unused one (so resend-verification burns the old link).
internal/store/email_verification_test.go:139
FunctionTestEmailVerifiedBackfill
TestEmailVerifiedBackfill covers DR-3's UNCONDITIONAL backfill: every row that predates the column must come out VERIFIED so no existing / OAuth / sel
internal/store/users_email_verified_test.go:68
FunctionTestEmailVerifiedBothScanPaths
TestEmailVerifiedBothScanPaths guards the two-scan-site foot-gun: the field must round-trip through scanUser (GetUser/ListUsers) AND the inline scan i
internal/store/users_email_verified_test.go:159
FunctionTestEmitBulkItemEventTx_PartitionsByMemberWorkspace
TestEmitBulkItemEventTx_PartitionsByMemberWorkspace pins the multi-tenancy property: a member snapshot must never be published under a workspace that
internal/store/event_outbox_test.go:931
FunctionTestEmitJSON_ProducesValidJSON
(t *testing.T)
internal/cmdhelp/json_test.go:412
FunctionTestEmitJSON_VersionPatternMatchesSpec
(t *testing.T)
internal/cmdhelp/json_test.go:448
FunctionTestEmittedJSON_ValidatesAgainstSchema_AfterDynamicResolution
(t *testing.T)
internal/cmdhelp/schema_test.go:60
FunctionTestEmittedJSON_ValidatesAgainstSchema_NoWorkspaceFallback
(t *testing.T)
internal/cmdhelp/schema_test.go:93
FunctionTestEmittedJSON_ValidatesAgainstSchema_StaticTree
(t *testing.T)
internal/cmdhelp/schema_test.go:38
FunctionTestEmptyMultiRelation_ANonEmptyListIsUntouched
CONTROLS. Every leg above asserts that something CHANGED; a normalisation that rewrote every multi_relation value, or that ran on every type, would sa
internal/items/multi_relation_normalise_test.go:84
FunctionTestEmptyMultiRelation_AnEmptyMultiSelectIsUntouched
(t *testing.T)
internal/items/multi_relation_normalise_test.go:95
FunctionTestEmptyMultiRelation_FullWriteBecomesAnAbsentKey
(t *testing.T)
internal/items/multi_relation_normalise_test.go:28
FunctionTestEmptyMultiRelation_FullWriteOnARequiredFieldIsRefusedForFree
(t *testing.T)
internal/items/multi_relation_normalise_test.go:38
FunctionTestEmptyMultiRelation_PartialWriteIsACLEAR_NotAnAbsence
(t *testing.T)
internal/items/multi_relation_normalise_test.go:53
FunctionTestEmptyMultiRelation_PartialWriteOnARequiredFieldIsRefused
(t *testing.T)
internal/items/multi_relation_normalise_test.go:70
FunctionTestEmptyPatch
(t *testing.T)
internal/diff/diff_test.go:45
FunctionTestEmptyRelationFilterMatchesEverySpelling
(t *testing.T)
internal/store/bug3028_relation_blank_test.go:36
FunctionTestEmptyScopeSeesNothing
TestEmptyScopeSeesNothing pins the non-nil-empty case, which is a THIRD state that reads like the second: nil CollectionIDs means unrestricted, and an
internal/store/reminders_test.go:888
FunctionTestEmptyWorkspaceStillGetsDefaults
TestEmptyWorkspaceStillGetsDefaults verifies the rescue path still works for a workspace that genuinely has zero collections — the original intent of
internal/store/collections_test.go:768
FunctionTestEnabled
(t *testing.T)
internal/decision/config_test.go:187
FunctionTestEncodeDefaultsVersion
(t *testing.T)
internal/artifact/encode_test.go:116
FunctionTestEncodeDeterministic
(t *testing.T)
internal/artifact/encode_test.go:93
FunctionTestEncodeGolden
(t *testing.T)
internal/artifact/encode_test.go:60
FunctionTestEncodeUnknownKind
(t *testing.T)
internal/artifact/encode_test.go:109
FunctionTestEncryptDecrypt
(t *testing.T)
internal/store/encryption_test.go:10
FunctionTestEncryptDecryptEmpty
(t *testing.T)
internal/store/encryption_test.go:77
FunctionTestEncryptWebhookSecretsAtRest_OnlyTheMovedRowIsSkipped
The untouched rows in the same pass are still encrypted: the compare-and-set skips only the row that moved.
internal/store/bug3805_secret_backfill_race_test.go:96
FunctionTestEncryptWebhookSecretsAtRest_RotationDuringPassSurvives
(t *testing.T)
internal/store/bug3805_secret_backfill_race_test.go:33
FunctionTestEncryptWithoutKey
(t *testing.T)
internal/store/encryption_test.go:62
FunctionTestEndedReminderCarrierWithMilestoneNotReused
A legacy create on an ended carrier with a forecast or selection must not retarget it: the milestone is changed only through the commitment surface.
internal/store/reminder_commitment_milestone_test.go:131
FunctionTestEndedReminderCreateRefusals
(t *testing.T)
internal/store/reminder_unreadable_test.go:297
FunctionTestEnsureAgentDMValidatesOwner
TASK-4038 r4: a malformed owner id is refused as input before any SQL runs.
internal/store/conversations_test.go:943
FunctionTestEnsureBootstrapToken_ConcurrentRace
TestEnsureBootstrapToken_ConcurrentRace ensures the temp+hardlink pattern protects against two simultaneous startups racing on the same data directory
internal/server/bootstrap_test.go:150
FunctionTestEnsureBootstrapToken_EmptyFileIsAnError
TestEnsureBootstrapToken_EmptyFileIsAnError protects against a partially- created token file being silently treated as valid (which would leave any X-
internal/server/bootstrap_test.go:105
FunctionTestEnsureBootstrapToken_GeneratesAndPersists
TestEnsureBootstrapToken_GeneratesAndPersists verifies a fresh data directory yields a freshly-generated token written with mode 0600 in the expected
internal/server/bootstrap_test.go:16
FunctionTestEnsureBootstrapToken_LoadsExisting
TestEnsureBootstrapToken_LoadsExisting verifies a second call against the same data directory returns the same token (D1: persists across restarts; do
internal/server/bootstrap_test.go:60
FunctionTestEnsureBootstrapToken_ReadOnlyDataDir
TestEnsureBootstrapToken_ReadOnlyDataDir verifies D7: failure to persist is reported as an error (caller treats it as non-fatal at startup). Server mu
internal/server/bootstrap_test.go:125
FunctionTestEnsureBootstrapToken_RejectsOverlyPermissiveFile
TestEnsureBootstrapToken_RejectsOverlyPermissiveFile mirrors the EnsureEncryptionKey check — an operator who accidentally chmods the token file 0644 h
internal/server/bootstrap_test.go:80
FunctionTestEnsureEncryptionKey_ClusteredWithPreSeededFileStillLoads
(t *testing.T)
internal/config/encryption_key_test.go:105
FunctionTestEnsureEncryptionKey_ConcurrentStartIsRaceSafe
(t *testing.T)
internal/config/encryption_key_test.go:141
FunctionTestEnsureEncryptionKey_GeneratesWhenMissing
(t *testing.T)
internal/config/encryption_key_test.go:18
FunctionTestEnsureEncryptionKey_IsIdempotentAcrossRestarts
(t *testing.T)
internal/config/encryption_key_test.go:175
FunctionTestEnsureEncryptionKey_LoadsFromFile
(t *testing.T)
internal/config/encryption_key_test.go:48
FunctionTestEnsureEncryptionKey_RefusesToGenerateWhenClustered
(t *testing.T)
internal/config/encryption_key_test.go:90
FunctionTestEnsureEncryptionKey_RejectsWorldReadableFile
(t *testing.T)
internal/config/encryption_key_test.go:122
FunctionTestEnsureEncryptionKey_RespectsConfigured
(t *testing.T)
internal/config/encryption_key_test.go:67
FunctionTestEnsureServerSkipsWhenClientDoesNotManageLocalServer
(t *testing.T)
internal/cli/server_test.go:10
FunctionTestEnsureServer_DoesNotSpawnOverAServerThatAnswersNon200
(t *testing.T)
internal/cli/server_answers_test.go:37
FunctionTestEnsureServer_IgnoresAMarkerThatIsNotLive
A marker that is not live is not honoured. Each case must spawn, because a stale marker that blocked auto-start would turn a crashed refresh into a pe
internal/cli/refresh_marker_test.go:139
FunctionTestEnsureServer_RefusesRatherThanSpawnsOverAPortThatNeverServes
A holder that never serves is refused, not spawned over, once the wait runs out.
internal/cli/server_answers_test.go:97
FunctionTestEnsureServer_RefusesRatherThanSpawnsWhenALiveRefreshMissesItsDeadline
(t *testing.T)
internal/cli/refresh_marker_test.go:117
FunctionTestEnsureServer_SpawnsWhenTheMarkerIsRemovedMidWait
The refresh ended (its trap removed the marker) without anything answering: the auto-start is legitimate again, and the waiting call makes it.
internal/cli/refresh_marker_test.go:180
FunctionTestEnsureServer_SpawnsWithoutAMarker
The control for everything below: with no marker, an unhealthy server is auto-started, exactly as before. Without this leg the counter could be broken
internal/cli/refresh_marker_test.go:83
FunctionTestEnsureServer_WaitsForALiveRefreshInsteadOfSpawning
(t *testing.T)
internal/cli/refresh_marker_test.go:93
FunctionTestEnsureServer_WaitsForAServerStillStartingInsteadOfSpawning
The other half: `pad server start` binds before it migrates, so a starting server holds the port but answers nothing yet. A listener that has not begu
internal/cli/server_answers_test.go:64
FunctionTestEnsureStructuredEntryIDs
(t *testing.T)
internal/models/structured_entry_ids_test.go:30
FunctionTestEnsureStructuredEntryIDsLeavesACleanBlobAlone
(t *testing.T)
internal/models/structured_entry_ids_test.go:99
FunctionTestEnsureStructuredEntryIDsSkipsWhatTheTimelineCannotRead
BUG-2788: the repair touches only what the timeline can read, and only a blob that is exactly one JSON value.
internal/models/structured_entry_ids_test.go:134
FunctionTestEnsureUniqueUsernameReserved
(t *testing.T)
internal/store/reserved_usernames_test.go:5
FunctionTestEnsureWorkspaceNameDrivenStillWorks
TestEnsureWorkspaceNameDrivenStillWorks: the legacy name-driven path (no --workspace flag) must keep behaving as before — match by name and link witho
cmd/pad/init_test.go:213
FunctionTestEnsureWorkspaceSlugAttachExisting
TestEnsureWorkspaceSlugAttachExisting: --workspace <slug> on a fresh dir links to the existing workspace and writes .pad.toml.
cmd/pad/init_test.go:47
FunctionTestEnsureWorkspaceSlugIdempotent
TestEnsureWorkspaceSlugIdempotent: re-running with the same slug a directory is already linked to is a no-op (returns the workspace, doesn't error).
cmd/pad/init_test.go:174
FunctionTestEnsureWorkspaceSlugNotFound
TestEnsureWorkspaceSlugNotFound: a missing slug must produce a clear error AND must NOT silently fall through to "create a workspace named after the s
cmd/pad/init_test.go:91
FunctionTestEnsureWorkspaceSlugRefusesClobber
TestEnsureWorkspaceSlugRefusesClobber: when the CWD is already linked to a different workspace, a slug attach must error rather than rewrite the link.
cmd/pad/init_test.go:135
FunctionTestEnvConfigEmptyWhenUnset
(t *testing.T)
internal/decision/config_test.go:145
FunctionTestEnvConfigReadsAndTrims
(t *testing.T)
internal/decision/config_test.go:133
FunctionTestEnvDispatch_ValidationErrorIsStructured
TestEnvDispatch_ValidationErrorIsStructured drives env.Dispatch with a missing-arg input and confirms the resulting error result is a structured valid
internal/mcp/bug987_test.go:240
FunctionTestEnvTokenNotice
envTokenNotice is the login/logout disclosure line (gh-style): present exactly when PAD_TOKEN is set.
cmd/pad/env_token_override_test.go:182
FunctionTestEnvToken_SetReturnsTrimmed
PAD_TOKEN is an explicit per-process override, so it must win exactly when set to something non-blank and be invisible otherwise.
internal/cli/env_token_test.go:27
FunctionTestEnvToken_UnsetReturnsEmpty
(t *testing.T)
internal/cli/env_token_test.go:34
FunctionTestEnvToken_WhitespaceOnlyReturnsEmpty
(t *testing.T)
internal/cli/env_token_test.go:41
FunctionTestEpochChangeSignalsEverySubscriber
TestEpochChangeSignalsEverySubscriber and its sibling below cover the other two per-instance arms. The sequence-gap arm was tested first because it is
internal/watchevents/gap_signal_test.go:155
FunctionTestEpochGenerationsAreMintedByRedisAndIncrease
(t *testing.T)
internal/events/redis_idspace_test.go:603
FunctionTestEscapeMarkdownCell_StripsNonSGRSequences
(t *testing.T)
internal/cli/format_ansi_test.go:77
FunctionTestEscapeModule
(t *testing.T)
cmd/depages/main_test.go:82
FunctionTestEscapeTableCell
(t *testing.T)
internal/urlimport/openapi_test.go:264
FunctionTestEventIDsAreMonotonic
(t *testing.T)
internal/events/bus_test.go:280
FunctionTestEventsHeartbeatDefaultsOff
The precise contract, stated because the sentence above is easy to read as something stronger than it is: an unparseable value is IGNORED, not read as
internal/config/redis_stream_config_test.go:271
FunctionTestEventsHeartbeatDoesNotMoveTheWatchFlag
TestEventsHeartbeatDoesNotMoveTheWatchFlag is the OTHER direction of the cross-check above, and it exists because verifying one direction of a two-fla
internal/config/redis_stream_config_test.go:430
FunctionTestEventsHeartbeatEnvMapping
--------------------------------------------------------------------------- BUG-2738's phase-2 flip. Structurally these mirror the EventsPublishEpoch
internal/config/redis_stream_config_test.go:201
FunctionTestEventsHeartbeatIgnoresANonBooleanValue
TestEventsHeartbeatIgnoresANonBooleanValue. READ THIS COMMENT BEFORE "FIXING" THIS TEST TO MATCH ITS EPOCH TWIN. The assertion is identical to TestEv
internal/config/redis_stream_config_test.go:243
FunctionTestEventsHeartbeatPrecedenceBetweenEnvAndFile
The rollback procedure tells an operator to make the EFFECTIVE value false and warns that unsetting the environment variable is not the same thing. Bo
internal/config/redis_stream_config_test.go:309
FunctionTestEventsHeartbeatRoundTripsThroughTheConfigFile
The TOML tag, for the same reason its epoch twin has one: the env-var test above says nothing about the file, and a wrong or missing `toml:"events_hea
internal/config/redis_stream_config_test.go:284
← previousnext →19,501–19,600 of 28,840, ranked by callers