MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestStreamGaugeIsCorrectUnderConcurrency
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
FunctionTestStreamGaugeReachesMetricsThroughEitherWiringOrder
TestStreamGaugeReachesMetricsThroughEitherWiringOrder covers the seam that SetMetrics and SetSSELimits can be called in either order, plus the lazily-
internal/server/stream_admission_test.go:317
FunctionTestStreamIdentityChatParam
(t *testing.T)
internal/cli/chat_direction_state_test.go:21
FunctionTestStreamLimitRefusalContractIsIdenticalOnBothEndpoints
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
FunctionTestStreamPrincipalFallsBackToWorkspace
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
FunctionTestStreamWatchEvents_ParsesNotificationsAndTracksLastEventID
(t *testing.T)
cmd/pad/cmd_watch_test.go:289
FunctionTestStreamWatchEvents_ResyncLineRespectsConsent
A disarmed session is told nothing, a resync included — the same consent gate a notification takes.
cmd/pad/cmd_watch_test.go:448
FunctionTestStreamWatchEvents_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
FunctionTestStreamWatchEvents_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
FunctionTestStreamWatchEvents_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
FunctionTestStreamWatchEvents_SyncRequiredThenFreshNotification
TestStreamWatchEvents_SyncRequiredThenFreshNotification verifies the cursor stays cleared through sync_required but a notification arriving afterward
cmd/pad/cmd_watch_test.go:353
FunctionTestStripANSI_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
FunctionTestStripCobraUsageBlock
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
FunctionTestStripDuplicatedFieldsKeys
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
FunctionTestStripErrorPrefix
TestStripErrorPrefix locks the prefix-strip rules so they don't accidentally over- or under-trim.
internal/mcp/bug987_test.go:218
FunctionTestStripFrontmatter
(t *testing.T)
internal/cli/agents_test.go:50
FunctionTestStripReservedUnparentedViewFilter
(t *testing.T)
internal/server/handlers_views_unparented_test.go:8
FunctionTestStripReservedUnparentedViewFilter_DropsMalformedFilterShape
(t *testing.T)
internal/server/handlers_views_unparented_test.go:26
FunctionTestStripeCancelledBusyMessageByClass
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
FunctionTestStripeCustomerID_AnAdminUserMayReplace
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:146
FunctionTestStripeCustomerID_CompareAndSet
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:50
FunctionTestStripeCustomerID_ReplaceIsNotTheSidecars
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:84
FunctionTestStripeCustomerID_StoreCASIgnoresAnUnknownUser
(t *testing.T)
internal/server/task3549_stripe_customer_cas_test.go:101
FunctionTestStripeEventClaimLease
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
FunctionTestStripeEventClaimReadErrorIsNotAClaim
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
FunctionTestStripeEventProcessed_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
FunctionTestStripeEventProcessed_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
FunctionTestStripeEventUnmark_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
FunctionTestStripeEventUnmark_RejectsWrongSecret
TestStripeEventUnmark_RejectsWrongSecret verifies the cloud-secret gate is applied symmetrically with /stripe-event-processed.
internal/server/cloud_admin_gate_test.go:465
FunctionTestStripeEventUnmark_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
FunctionTestStripeEventUnmark_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
FunctionTestStripeEventUnmark_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
FunctionTestStripeEventUnmark_ValidatesEventIDPrefix
TestStripeEventUnmark_ValidatesEventIDPrefix verifies the handler rejects event IDs that don't start with 'evt_'.
internal/server/cloud_admin_gate_test.go:507
FunctionTestStripeEventUnmark_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
FunctionTestStructuralItemLinksAdvanceSourceSeqAndMetadata
(t *testing.T)
internal/store/items_test.go:141
FunctionTestStructuralLinkHandlersPublishFreshSourceEvent
(t *testing.T)
internal/server/handlers_unparented_test.go:215
FunctionTestStructuredEntryStdin_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
FunctionTestStructuredErrorCodeParityAcrossTransports
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
FunctionTestStructuredFieldIsAppendableAgreesWithTheGuard
(t *testing.T)
internal/models/item_appendable_agreement_test.go:24
FunctionTestStructuredFieldIsAppendableIgnoresForeignKeys
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
FunctionTestStructuredStateIsNeverTruncated
(t *testing.T)
internal/decision/decision_test.go:650
FunctionTestStructuredTimelineEntries_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
FunctionTestSubscribeAfterCloseIsRefused
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
FunctionTestSubscribeAfterCloseIsRefusedOnEveryDoor
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
FunctionTestSubscribeAndPublish
(t *testing.T)
internal/events/bus_test.go:10
FunctionTestSubscribeAndReplayIsAtomic
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
FunctionTestSubscribeAndReplaySinceRefusesAColdResume
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
FunctionTestSubscribeDoesNotHoldTheBusLockAcrossTheRedisDial
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
FunctionTestSubscribeDoesNotReturnBeforeRedisHasRegisteredIt
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
FunctionTestSubscribeIfAllowedBounds
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
FunctionTestSubtractKeepsOnlyNewPairs
(t *testing.T)
cmd/depages/main_test.go:88
FunctionTestSuggestedNextKeepsItsCapWithReminders
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
FunctionTestSuggestedNextSurvivesWithNoTaskCandidates
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
FunctionTestSuggestionsCarryTheItemsRealCollection
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
FunctionTestSupervisorAdversarialDeepNesting
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
FunctionTestSupervisorBaselineMeasurements
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
FunctionTestSupervisorBaselineProbeFailureRefuses
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
FunctionTestSupervisorClampAndEffectiveLog
(t *testing.T)
internal/materialize/supervisor_test.go:775
FunctionTestSupervisorClose
--------------------------------------------------------------------------- 7. Close
internal/materialize/supervisor_test.go:912
FunctionTestSupervisorCloseBeforeFirstJob
(t *testing.T)
internal/materialize/supervisor_test.go:961
FunctionTestSupervisorCloseDuringIdleStop
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
FunctionTestSupervisorCloseDuringJob
(t *testing.T)
internal/materialize/supervisor_test.go:935
FunctionTestSupervisorCrashAndBackoff
--------------------------------------------------------------------------- 4. crash, and the respawn backoff
internal/materialize/supervisor_test.go:530
FunctionTestSupervisorCtxCancelKillsWithoutBackoff
(t *testing.T)
internal/materialize/supervisor_test.go:611
FunctionTestSupervisorDeadlineKillsChild
--------------------------------------------------------------------------- 3. deadline: the child is killed, the next job gets a fresh one
internal/materialize/supervisor_test.go:427
FunctionTestSupervisorDeadlineScalesWithTheJob
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
FunctionTestSupervisorIdleExit
(t *testing.T)
internal/materialize/supervisor_test.go:992
FunctionTestSupervisorIdleExitDoesNotTripBackoff
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
FunctionTestSupervisorIdleTimeoutConfig
(t *testing.T)
internal/materialize/supervisor_test.go:1238
FunctionTestSupervisorIdleTimerDuringJob
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
FunctionTestSupervisorJobDuringIdleStop
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
FunctionTestSupervisorLazyStart
--------------------------------------------------------------------------- 1. lazy start
internal/materialize/supervisor_test.go:365
FunctionTestSupervisorMemoryCapPlatform
--------------------------------------------------------------------------- 5. memory cap TestSupervisorMemoryCapPlatform runs the cap this OS ships w
internal/materialize/supervisor_test.go:643
FunctionTestSupervisorNeverIdle
(t *testing.T)
internal/materialize/supervisor_test.go:1224
FunctionTestSupervisorOrphanedWorkerExits
--------------------------------------------------------------------------- the supervising process dies mid-job TestSupervisorOrphanedWorkerExits: wh
internal/materialize/supervisor_test.go:821
FunctionTestSupervisorProtocolErrors
(t *testing.T)
internal/materialize/supervisor_test.go:582
FunctionTestSupervisorRSSWatchdog
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
FunctionTestSupervisorRealWorkerParity
--------------------------------------------------------------------------- 2. a REAL worker reproduces the in-process Runner
internal/materialize/supervisor_test.go:391
FunctionTestSupervisorSoftDeadlineKeepsChild
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
FunctionTestSupervisorUnsupportedOSRefuses
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
FunctionTestSurfacedDecisions_HidesStagedKeys
(t *testing.T)
internal/decision/effort_backfill_test.go:338
FunctionTestSurfacedDecisions_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
FunctionTestSweepExpiredOAuthRows_BatchesAndCap
Batches: the cap stops one call and reports it; the next call finishes.
internal/store/oauth_sweep_test.go:126
FunctionTestSweepExpiredOAuthRows_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
FunctionTestSweepExpiredOAuthRows_ZeroCutoffSkipsTable
A zero cutoff leaves that table alone.
internal/store/oauth_sweep_test.go:103
FunctionTestSweepKeepsALockedDirWhosePidIsDead
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
FunctionTestSweepKeepsALocklessDirWhosePidIsAlive
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
FunctionTestSweepMCPAuditOlderThan_DeletesOldRowsOnly
(t *testing.T)
internal/store/mcp_audit_test.go:335
FunctionTestSweepRemovesAnUnlockedDirWhosePidIsAlive
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
FunctionTestSweepRemovesOnlyTheDead
(t *testing.T)
internal/testtmp/testtmp_test.go:13
FunctionTestSyncRequiredClearsTheClientCursor
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
FunctionTestSyncRequiredReasonDescribesTheActualCondition
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
FunctionTestSystemCollectionAccessBackfill
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
FunctionTestTASK1069_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
FunctionTestTASK1069_MCPBlockedReason
(t *testing.T)
internal/server/task1069_mcp_blocked_test.go:29
FunctionTestTASK1069_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
FunctionTestTASK1069_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
FunctionTestTASK1069_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
FunctionTestTASK1273_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
FunctionTestTASK1273_ASyncDropSignalsOnceAndEndsDelivery
(t *testing.T)
internal/collab/task1273_overflow_test.go:22
← previousnext →24,701–24,800 of 28,840, ranked by callers