Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
28,840 in github.com/PerpetualSoftware/pad
⨍
Functions
28,840
◇
Types & classes
3,245
Function
TestStreamGaugeIsCorrectUnderConcurrency
TestStreamGaugeIsCorrectUnderConcurrency drives the gate hard from many goroutines and asserts the SCRAPED value matches the gate's own total. A coll
internal/server/stream_admission_test.go:531
Function
TestStreamGaugeReachesMetricsThroughEitherWiringOrder
TestStreamGaugeReachesMetricsThroughEitherWiringOrder covers the seam that SetMetrics and SetSSELimits can be called in either order, plus the lazily-
internal/server/stream_admission_test.go:317
Function
TestStreamIdentityChatParam
(t *testing.T)
internal/cli/chat_direction_state_test.go:21
Function
TestStreamLimitRefusalContractIsIdenticalOnBothEndpoints
TestStreamLimitRefusalContractIsIdenticalOnBothEndpoints pins what a refused client actually receives. Both endpoints must answer the same way, or a c
internal/server/stream_admission_test.go:672
Function
TestStreamPrincipalFallsBackToWorkspace
TestStreamPrincipalFallsBackToWorkspace covers the resolution order itself, which is where the fix actually lives: a request with no user must still p
internal/server/stream_admission_test.go:389
Function
TestStreamWatchEvents_ParsesNotificationsAndTracksLastEventID
(t *testing.T)
cmd/pad/cmd_watch_test.go:289
Function
TestStreamWatchEvents_ResyncLineRespectsConsent
A disarmed session is told nothing, a resync included — the same consent gate a notification takes.
cmd/pad/cmd_watch_test.go:448
Function
TestStreamWatchEvents_StopsWhenNotArmed
TestStreamWatchEvents_StopsWhenNotArmed is the per-notification gate: a session that isn't armed must NOT have events delivered — streamWatchEvents re
cmd/pad/cmd_watch_test.go:307
Function
TestStreamWatchEvents_SyncRequiredClearsLastEventID
TestStreamWatchEvents_SyncRequiredClearsLastEventID covers a regression: without this, a stale Last-Event-ID would be resent on every reconnect after
cmd/pad/cmd_watch_test.go:338
Function
TestStreamWatchEvents_SyncRequiredPrintsAResyncLine
THE CONSUMER IS TOLD (BUG-2743, BUG-2728 follow-through, #1518). Clearing the cursor is this process's recovery; the agent reading stdout cannot see a
cmd/pad/cmd_watch_test.go:413
Function
TestStreamWatchEvents_SyncRequiredThenFreshNotification
TestStreamWatchEvents_SyncRequiredThenFreshNotification verifies the cursor stays cleared through sync_required but a notification arriving afterward
cmd/pad/cmd_watch_test.go:353
Function
TestStripANSI_NonSGRSequences
#1076: "ANSI stripping" covered only SGR (ESC[…m), so non-SGR CSI sequences, OSC-8 hyperlinks, and stray C0 controls survived — including through the
internal/cli/format_ansi_test.go:12
Function
TestStripCobraUsageBlock
Tests covering BUG-987's MCP-layer fixes (Bugs 11, 12; Bugs 6, 8, 13, 14 land in their respective package tests). TestStripCobraUsageBlock verifies th
internal/mcp/bug987_test.go:21
Function
TestStripDuplicatedFieldsKeys
TestStripDuplicatedFieldsKeys covers the dedup helper behavior in isolation. Both implementation_notes and decision_log get dropped; other keys pass t
internal/mcp/bug992_test.go:10
Function
TestStripErrorPrefix
TestStripErrorPrefix locks the prefix-strip rules so they don't accidentally over- or under-trim.
internal/mcp/bug987_test.go:218
Function
TestStripFrontmatter
(t *testing.T)
internal/cli/agents_test.go:50
Function
TestStripReservedUnparentedViewFilter
(t *testing.T)
internal/server/handlers_views_unparented_test.go:8
Function
TestStripReservedUnparentedViewFilter_DropsMalformedFilterShape
(t *testing.T)
internal/server/handlers_views_unparented_test.go:26
Function
TestStripeCancelledBusyMessageByClass
A deletion that hit a bound after Stripe was cancelled is worded by class: a definitive rollback may say "try again to finish"; an unknown COMMIT outc
internal/server/task4278_remap_error_text_test.go:54
Function
TestStripeCustomerID_AnAdminUserMayReplace
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:146
Function
TestStripeCustomerID_CompareAndSet
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:50
Function
TestStripeCustomerID_ReplaceIsNotTheSidecars
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:84
Function
TestStripeCustomerID_StoreCASIgnoresAnUnknownUser
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:101
Function
TestStripeEventClaimLease
BUG-3561: the processed-event marker is a claim with a lease, not a final mark. A handler that dies after its claim no longer loses the event: the nex
internal/store/bug3561_event_lease_test.go:16
Function
TestStripeEventClaimReadErrorIsNotAClaim
Retro CONVE-735 finding on BUG-3561: after the insert conflicts and no takeover applies, ClaimStripeEvent reads the existing row. Only a row that is r
internal/store/bug3561_claim_read_error_test.go:16
Function
TestStripeEventProcessed_RecordsAndDetectsDuplicates
TestStripeEventProcessed_RecordsAndDetectsDuplicates verifies TASK-696: first call for a given event_id returns already_processed=false; a second call
internal/server/cloud_admin_gate_test.go:209
Function
TestStripeEventProcessed_ValidatesEventIDPrefix
TestStripeEventProcessed_ValidatesEventIDPrefix verifies the handler rejects event IDs that don't start with 'evt_', matching the existing 'cus_' pref
internal/server/cloud_admin_gate_test.go:586
Function
TestStripeEventUnmark_IdempotentWhenRowMissing
TestStripeEventUnmark_IdempotentWhenRowMissing verifies the unmark call succeeds with unmarked=false when the event ID was never marked. Either outcom
internal/server/cloud_admin_gate_test.go:436
Function
TestStripeEventUnmark_RejectsWrongSecret
TestStripeEventUnmark_RejectsWrongSecret verifies the cloud-secret gate is applied symmetrically with /stripe-event-processed.
internal/server/cloud_admin_gate_test.go:465
Function
TestStripeEventUnmark_RequiresProcessedAt
TestStripeEventUnmark_RequiresProcessedAt verifies that a missing processed_at field produces a 400 rather than falling back to any fallback-by-event-
internal/server/cloud_admin_gate_test.go:487
Function
TestStripeEventUnmark_RoundTripWithMarkProcessed
TestStripeEventUnmark_RoundTripWithMarkProcessed is the happy-path regression for TASK-736: a row previously written by /stripe-event-processed can be
internal/server/cloud_admin_gate_test.go:301
Function
TestStripeEventUnmark_StaleTokenIsNoOp
TestStripeEventUnmark_StaleTokenIsNoOp addresses the TASK-736 race- protection HIGH: a delayed unmark from an EARLIER failed attempt must NOT delete t
internal/server/cloud_admin_gate_test.go:360
Function
TestStripeEventUnmark_ValidatesEventIDPrefix
TestStripeEventUnmark_ValidatesEventIDPrefix verifies the handler rejects event IDs that don't start with 'evt_'.
internal/server/cloud_admin_gate_test.go:507
Function
TestStripeEventUnmark_WritesAuditLog
TestStripeEventUnmark_WritesAuditLog is the TASK-736 durable-audit finding fix: a successful unmark MUST emit an ActionStripeEventUnmarked audit entry
internal/server/cloud_admin_gate_test.go:540
Function
TestStructuralItemLinksAdvanceSourceSeqAndMetadata
(t *testing.T)
internal/store/items_test.go:141
Function
TestStructuralLinkHandlersPublishFreshSourceEvent
(t *testing.T)
internal/server/handlers_unparented_test.go:215
Function
TestStructuredEntryStdin_BlankIsNoDetails
The rest of the stdin population, each pinned by evidence rather than by reading. Population: `os.Stdin` in non-test cmd/pad files — item create/updat
cmd/pad/item_stdin_blank_test.go:249
Function
TestStructuredErrorCodeParityAcrossTransports
TestStructuredErrorCodeParityAcrossTransports asserts that the same "unknown code" rejection produces the same envelope shape from both transports — i
internal/mcp/open_children_passthrough_test.go:261
Function
TestStructuredFieldIsAppendableAgreesWithTheGuard
(t *testing.T)
internal/models/item_appendable_agreement_test.go:24
Function
TestStructuredFieldIsAppendableIgnoresForeignKeys
TestStructuredFieldIsAppendableIgnoresForeignKeys pins the scoping: an unreadable value under one key must not make a DIFFERENT key look unappendable,
internal/models/item_appendable_agreement_test.go:172
Function
TestStructuredStateIsNeverTruncated
(t *testing.T)
internal/decision/decision_test.go:650
Function
TestStructuredTimelineEntries_CursorPredicate
Unit-level coverage of the cursor predicate itself, including the nil-item guard the handler can't reach but callers could.
internal/server/handlers_timeline_structured_test.go:628
Function
TestSubscribeAfterCloseIsRefused
TestSubscribeAfterCloseIsRefused pins the closed-bus arm of the post-loop check (BUG-2764). Close drains the subscriber maps; a caller registering aft
internal/events/redis_subscribe_failed_test.go:271
Function
TestSubscribeAfterCloseIsRefusedOnEveryDoor
BUG-2737. A subscribe after Close used to be admitted by MemoryBus: it was registered and handed a channel that nothing would ever close, so an SSE ha
internal/events/subscribe_after_close_test.go:30
Function
TestSubscribeAndPublish
(t *testing.T)
internal/events/bus_test.go:10
Function
TestSubscribeAndReplayIsAtomic
TestSubscribeAndReplayIsAtomic is the load-bearing test for the duplicate window (BUG-2730's third strand). The guarantee is that an event is in the
internal/events/gap_signal_test.go:111
Function
TestSubscribeAndReplaySinceRefusesAColdResume
The same rule must reach SubscribeAndReplaySince, which is the path the SSE handler actually uses — EventsSince is documented as the standalone primit
internal/watchevents/cold_resume_test.go:112
Function
TestSubscribeDoesNotHoldTheBusLockAcrossTheRedisDial
TestSubscribeDoesNotHoldTheBusLockAcrossTheRedisDial is BUG-2748's regression test. THE DIAL MUST HANG, NOT FAIL. A refused connection returns immedi
internal/events/redis_subscribe_confirm_test.go:322
Function
TestSubscribeDoesNotReturnBeforeRedisHasRegisteredIt
TestSubscribeDoesNotReturnBeforeRedisHasRegisteredIt is BUG-2747's regression test. The bus has NO LOCAL FAN-OUT — every event, including one this ve
internal/events/redis_subscribe_confirm_test.go:211
Function
TestSubscribeIfAllowedBounds
TestSubscribeIfAllowedBounds covers the bus's per-workspace admission bound directly. It had no package-level test — it was exercised only through in
internal/events/subscribe_if_allowed_test.go:17
Function
TestSubtractKeepsOnlyNewPairs
(t *testing.T)
cmd/depages/main_test.go:88
Function
TestSuggestedNextKeepsItsCapWithReminders
TestSuggestedNextKeepsItsCapWithReminders. Prepending up to five reminders past a list capped at three returned eight entries, against consumers writ
internal/server/handlers_reminders_test.go:639
Function
TestSuggestedNextSurvivesWithNoTaskCandidates
TestSuggestedNextSurvivesWithNoTaskCandidates is the leg that catches the bug an earlier fix introduced: `limit` is reassigned to len(candidates), so
internal/server/handlers_reminders_test.go:677
Function
TestSuggestionsCarryTheItemsRealCollection
TestSuggestionsCarryTheItemsRealCollection. The orphan branch admits any collection (its own comment claimed otherwise, and the comment was wrong), w
internal/server/overdue_surfaces_test.go:209
Function
TestSupervisorAdversarialDeepNesting
TestSupervisorAdversarialDeepNesting sends the spike's shape — a ~1 MB deep-nesting update — to a REAL capped worker. In-process this is the input tha
internal/materialize/adversarial_test.go:91
Function
TestSupervisorBaselineMeasurements
TestSupervisorBaselineMeasurements records, for a REAL loaded worker, its address-space baseline and how much address space and resident memory the co
internal/materialize/measure_linux_test.go:49
Function
TestSupervisorBaselineProbeFailureRefuses
A worker whose memory baseline cannot be established is killed WITHOUT being sent a job, and the job fails with ErrNoMemoryCap. One WARN names the cau
internal/materialize/refuse_test.go:42
Function
TestSupervisorClampAndEffectiveLog
(t *testing.T)
internal/materialize/supervisor_test.go:775
Function
TestSupervisorClose
--------------------------------------------------------------------------- 7. Close
internal/materialize/supervisor_test.go:912
Function
TestSupervisorCloseBeforeFirstJob
(t *testing.T)
internal/materialize/supervisor_test.go:961
Function
TestSupervisorCloseDuringIdleStop
Close during an idle stop does not return while that worker still runs: the stop has already forgotten it, so Close must end and reap it itself.
internal/materialize/supervisor_test.go:1188
Function
TestSupervisorCloseDuringJob
(t *testing.T)
internal/materialize/supervisor_test.go:935
Function
TestSupervisorCrashAndBackoff
--------------------------------------------------------------------------- 4. crash, and the respawn backoff
internal/materialize/supervisor_test.go:530
Function
TestSupervisorCtxCancelKillsWithoutBackoff
(t *testing.T)
internal/materialize/supervisor_test.go:611
Function
TestSupervisorDeadlineKillsChild
--------------------------------------------------------------------------- 3. deadline: the child is killed, the next job gets a fresh one
internal/materialize/supervisor_test.go:427
Function
TestSupervisorDeadlineScalesWithTheJob
A job's deadline scales with its op-log (BUG-3521): the base for a small job, base + PerKiBTimeout per KiB for a large one, MaxTimeout at most. Read t
internal/materialize/supervisor_test.go:488
Function
TestSupervisorIdleExit
(t *testing.T)
internal/materialize/supervisor_test.go:992
Function
TestSupervisorIdleExitDoesNotTripBackoff
An idle stop is not a death: the backoff streak neither grows nor resets. crash (streak 1) → idle stop → crash (streak 2) must wait 2s; had the idle s
internal/materialize/supervisor_test.go:1027
Function
TestSupervisorIdleTimeoutConfig
(t *testing.T)
internal/materialize/supervisor_test.go:1238
Function
TestSupervisorIdleTimerDuringJob
The idle timer can fire while a job is running, because it measures from the END of the previous job. The stop must not take that worker: it runs only
internal/materialize/supervisor_test.go:1111
Function
TestSupervisorJobDuringIdleStop
A job that arrives while an idle stop is in progress is not lost: it waits for the job slot, finds no worker, and runs on a new one.
internal/materialize/supervisor_test.go:1061
Function
TestSupervisorLazyStart
--------------------------------------------------------------------------- 1. lazy start
internal/materialize/supervisor_test.go:365
Function
TestSupervisorMemoryCapPlatform
--------------------------------------------------------------------------- 5. memory cap TestSupervisorMemoryCapPlatform runs the cap this OS ships w
internal/materialize/supervisor_test.go:643
Function
TestSupervisorNeverIdle
(t *testing.T)
internal/materialize/supervisor_test.go:1224
Function
TestSupervisorOrphanedWorkerExits
--------------------------------------------------------------------------- the supervising process dies mid-job TestSupervisorOrphanedWorkerExits: wh
internal/materialize/supervisor_test.go:821
Function
TestSupervisorProtocolErrors
(t *testing.T)
internal/materialize/supervisor_test.go:582
Function
TestSupervisorRSSWatchdog
TestSupervisorRSSWatchdog drives the macOS mechanism (a parent-side RSS poll and kill) wherever a sampler exists, so it runs on Linux too.
internal/materialize/supervisor_test.go:697
Function
TestSupervisorRealWorkerParity
--------------------------------------------------------------------------- 2. a REAL worker reproduces the in-process Runner
internal/materialize/supervisor_test.go:391
Function
TestSupervisorSoftDeadlineKeepsChild
The child is asked to stop itself a little before the hard deadline, and a job its interrupt stops does not cost the worker.
internal/materialize/supervisor_test.go:462
Function
TestSupervisorUnsupportedOSRefuses
On an OS with no cap mechanism, no worker is ever started and every job is refused, with one WARN naming the OS.
internal/materialize/refuse_test.go:116
Function
TestSurfacedDecisions_HidesStagedKeys
(t *testing.T)
internal/decision/effort_backfill_test.go:338
Function
TestSurfacedDecisions_StagedKeysAreNotCounted
The staged keys are not counted anywhere: the score and choice rows would each read as below threshold, and the low high_stakes with them.
internal/decision/effort_backfill_test.go:351
Function
TestSweepExpiredOAuthRows_BatchesAndCap
Batches: the cap stops one call and reports it; the next call finishes.
internal/store/oauth_sweep_test.go:126
Function
TestSweepExpiredOAuthRows_PerTableCutoffs
Each table gets its own cutoff; a row one second below it goes, a row one second above it stays, and an inactive row is judged by age alone.
internal/store/oauth_sweep_test.go:54
Function
TestSweepExpiredOAuthRows_ZeroCutoffSkipsTable
A zero cutoff leaves that table alone.
internal/store/oauth_sweep_test.go:103
Function
TestSweepKeepsALockedDirWhosePidIsDead
BUG-4088: the pid in the name is not the owner. A sweeper in another PID namespace reads every live host pid as dead, which is what a dead pid is here
internal/testtmp/lock_unix_test.go:60
Function
TestSweepKeepsALocklessDirWhosePidIsAlive
A directory with no owner.lock was made before BUG-4088 and keeps the pid rule. So a lockless directory whose pid names some live, unrelated process s
internal/testtmp/lock_unix_test.go:96
Function
TestSweepMCPAuditOlderThan_DeletesOldRowsOnly
(t *testing.T)
internal/store/mcp_audit_test.go:335
Function
TestSweepRemovesAnUnlockedDirWhosePidIsAlive
The other direction: a pid recorded in another namespace can name an unrelated live process here. With an owner.lock that is free, the live pid must n
internal/testtmp/lock_unix_test.go:80
Function
TestSweepRemovesOnlyTheDead
(t *testing.T)
internal/testtmp/testtmp_test.go:13
Function
TestSyncRequiredClearsTheClientCursor
BUG-2731. A sync_required tells the client its cursor is unservable — and must RETIRE that cursor, or the client keeps sending it and every later reco
internal/server/handlers_events_resume_test.go:95
Function
TestSyncRequiredReasonDescribesTheActualCondition
The sync_required payload's reason text, asserted because it was CHANGED by this unit (it used to name buffer eviction, which is now one cause among s
internal/server/handlers_events_resume_test.go:197
Function
TestSystemCollectionAccessBackfill
TestSystemCollectionAccessBackfill runs migration 108 (SQLite) / 082 (Postgres) against a manufactured pre-upgrade state (TASK-3376). Before TASK-337
internal/store/system_collection_access_backfill_test.go:18
Function
TestTASK1069_HealthDoesNotLeakTheReason
The health flag says only THAT MCP is blocked. The reason names configuration and stays on the admin endpoint.
internal/server/task1069_mcp_blocked_test.go:79
Function
TestTASK1069_MCPBlockedReason
(t *testing.T)
internal/server/task1069_mcp_blocked_test.go:29
Function
TestTASK1069_PadCloudProductionEnvStarts
pad-cloud's PRODUCTION shape, through the real environment loading: its compose sets PAD_MCP_PUBLIC_URL=${MCP_PUBLIC_URL:-}, so the variable is PRESEN
cmd/pad/task1069_cloud_mcp_oauth_test.go:87
Function
TestTASK1069_ServerStartWiresBothChecks
CONVE-19: the wiring is a claim. The refusal sits in the cloud block and the self-host error runs off cloud; a test of the function passes with either
cmd/pad/task1069_cloud_mcp_oauth_test.go:64
Function
TestTASK1069_ValidateCloudMCPOAuth
TASK-1069: a cloud start that cannot construct the MCP OAuth server is refused, naming what to set, instead of serving /mcp PAT-only in silence.
cmd/pad/task1069_cloud_mcp_oauth_test.go:14
Function
TestTASK1273_ARealOverflowClosesThePeerOnce
End to end through a real overflow: the peer's writeLoop is held on its write lock, the bus fills its buffer and drops the next op, and the room close
internal/collab/task1273_overflow_test.go:172
Function
TestTASK1273_ASyncDropSignalsOnceAndEndsDelivery
(t *testing.T)
internal/collab/task1273_overflow_test.go:22
← previous
next →
24,701–24,800 of 28,840, ranked by callers