Skip to content

Complete scheduler, cache and framework test parity updates - #586

Merged
binaryfire merged 17 commits into
0.4from
laravel-parity-backlog
Sep 13, 2026
Merged

Complete scheduler, cache and framework test parity updates#586
binaryfire merged 17 commits into
0.4from
laravel-parity-backlog

Conversation

@binaryfire

@binaryfire binaryfire commented Sep 12, 2026

Copy link
Copy Markdown
Member

Summary

This continues the Laravel test updates and fixes the behavior they exposed in scheduler groups and cache expiration. It restores missing authentication, broadcasting, batching, process-concurrency and duration coverage while preserving Hypervel's coroutine execution and test isolation.

This is the next checkpoint in #61117. It includes the completed groups below; the remaining test cleanup continues separately. Source and tests were compared with Laravel 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Changes

Scheduler groups and task configuration

Apply inherited group attributes once. When a task has pending attributes, those attributes already contain the group's callbacks. Applying the group again duplicated lifecycle callbacks and macros. Use the pending attributes directly, following #60255.

Restore the applicable group, callback, macro, filter, frequency and run-command tests. This includes the scheduler history in #58926, #60133, #60144, #60148, #60190, #60197, #60712, #60311, #60469, #55624, #57621 and #59331. Background tests wait for their task coroutine before checking its outcome.

Remove the ineffective scheduled-task user() setting, its generated facade entry and the corresponding Telescope field. Coroutine tasks share the scheduler's OS user. Run the scheduler as the required user, or use exec() with an explicit command for an individual task. Document that adaptation and the schedule:run --once requirement for cron; Hypervel's long-running schedule:run replaces schedule:work.

Correct two tests that did not protect their intended behavior: the repeat-start test now uses a mutable clock so it checks the copy boundary, and the sub-minute maintenance test uses the correct elapsed-time direction and verifies that maintenance mode was entered.

Cache expiration and events

Make Cache::touch() require an explicit expiration and delegate positive lifetimes directly to the store. Remove the unnecessary read before changing the TTL. A zero or negative lifetime removes the item, including through all-mode Redis tags, rather than accidentally keeping it. Update the contract, generated facade, tests and documentation together. This completes the applicable history in #55954, #59121, #59864 and #60878.

Preserve numeric cache keys when emitting batch-read hit and miss events. PHP converts numeric-string array keys to integers; event constructors require strings. Normalize only at event construction, leaving returned keys and the path without listeners unchanged. Restore the original numeric-key regression from #48423.

Restore batched read and write event assertions and verify the store name on ordinary and tagged events. Complete manager resolution assertions while retaining custom repositories, explicitly disabled events and coroutine-local memoized stores. Restore applicable rate-limiter callback-result tests against Hypervel's native typed-policy implementation.

Authentication, broadcasting and batching tests

Complete required Mockery expectations and native fixture types across authentication providers, password brokers, token guards, broadcast drivers and the bus. Preserve optional lookup stubs and Hypervel's existing request isolation, guarded events, queue routing and dispatch-lock assertions.

Restore string-backed password-broker names alongside integer-zero cases, non-string token rejection, exact broadcast payloads and explicit missing-model deletion behavior from #61074. The Pusher authentication test now checks the real SDK's local signature against the known expected value instead of returning that value from a mock.

Keep stored and returned batch fixtures distinct and ensure the failed-add test reaches batch deletion. Restore the missing conditional delay case. Remove duplicate container resets where the test subscriber already owns cleanup, while retaining explicit job destruction and lock-release checks. Normalize the remaining Inertia and Sentry test imports to the established Mockery alias.

Process concurrency and time-dependent coverage

Restore real-process exception-constructor tests, including falsey arguments, from #54705 and #60822. Complete process and synchronous result ordering from #53135 and #55161, failed-child coverage from #53712, enum driver selection from #59801, and integer timeout coverage from #60105. The failed-child test terminates the child process explicitly so it reaches process-failure handling under Swoole.

Complete the applicable cleanup and coverage from #61199, #60761 and #60793. Retain immutable clock advances and caller-owned timezone restoration. Restore cookie-expiration and request-duration cases, freeze duration-test clocks before registering deadlines, and clean up both tables owned by the MySQL and MariaDB cast tests.

Restore the original view-clear command test alongside Hypervel's existing filesystem tests. Keep the initialized Blade compiler proxy and the real session exception handler where their state and deferred persistence are needed. Record the maintenance-view difference associated with #60595: running workers serve prepared maintenance responses; a reverse proxy or load balancer must serve a static page when Hypervel itself is unavailable.

Collection type analysis

Correct pad() return annotations to include preserved string keys across eager, lazy and Eloquent collections and the shared contract. Add focused type assertions and require PHPStan 2.2.14, which handles these key unions correctly. Suppress its verified generic-key false positives only at the four affected assignments; collection runtime behavior is unchanged.

Verification

The checkpoint was checked with composer fix: formatting, full source and type-fixture analysis, the full parallel suite, Testbench contracts and package installation tests. Each changed test file was also run during implementation. The collection annotation correction additionally passed full analysis on PHPStan 2.2.14, the affected collection suites, each changed type fixture, manifest consistency checks and formatting.

Dedicated validation covered Redis expiration behavior, MySQL and MariaDB casts, supported database session tests, scheduler outcomes, generated facades and the Telescope frontend build. Service-dependent cases retain their normal skips when no service is configured. CI runs the framework suite and supported service matrix.

Review in cubic

Summary by CodeRabbit

  • Breaking Changes

    • Cache touch now requires an expiration value; null is no longer accepted.
    • Zero, negative, or past expiration values remove the cached item.
    • Scheduled tasks no longer support assigning a different operating-system user.
  • Scheduling

    • schedule:run now runs continuously by default; use schedule:run --once for single executions.
    • Scheduled tasks run as the scheduler’s operating-system user.
  • Maintenance Mode

    • Maintenance responses are served by running workers; configure a reverse proxy or load balancer for static pages when workers are unavailable.
  • Documentation

    • Updated cache, scheduling, console, maintenance-mode, and porting guidance.

Port the remaining clock captures, expiry checks and cookie/request-duration
cases from Laravel's test cleanup history. Retain cumulative advances when
dates are immutable, and rely on the existing global clock reset instead of
duplicating cleanup in individual tests. Cookie expiry comparisons use the
equivalent isPast/isFuture methods with their existing zero-expiry guards.

Keep caller-owned timezone restoration in Testbench and the validation cases;
forcing UTC globally would change the environment of consuming packages.
Freeze DateTime duration tests before registering their deadline so crossing
a real second boundary cannot change the intended threshold.

Make the storage-cache touch test reach the original expiry boundary, preserve
the distinct explicit-TTL expired-lock case, and remove both tables owned by
the MySQL and MariaDB cast tests during teardown.

Upstream:
laravel/framework#60761
laravel/framework#60793
laravel/framework#61199
Porting source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: full composer fix, immediate affected-file checks, dedicated
MySQL/MariaDB cast tests and SQLite/MySQL/MariaDB/PostgreSQL session tests.
The final deterministic-clock adjustment passes its complete file and the
formatter. Existing Hypervel-specific coverage remains intact.
When a group seeds pending event attributes, apply that pending copy once and
return. Applying the group again duplicated lifecycle callbacks and macros.
Use the current Laravel merge order, remove unreachable dependency guards,
and retain Hypervel's coroutine execution and event observation boundaries.

Restore the complete applicable grouping, callback, quarterly-frequency and
run-command tests. Use a shared stateless event mutex fixture and join the
task coroutine owned by each background-command test before asserting its
outcome. Preserve mutable dates in the repeat-start test so it protects the
copy guard. Correct the reversed elapsed-time comparison that kept the
sub-minute maintenance test from ever entering maintenance mode.

Remove the ineffective scheduled-task user API and its pending attributes,
generated facade annotation and Telescope metadata/UI. Tasks share the
scheduler's OS user; document running the scheduler under the required user
or using an explicit system command. Keep the long-running schedule:run
replacement for schedule:work and document the --once cron adaptation.
Complete the linked maintenance-view deployment guidance alongside these
porting-guide changes.

Upstream scheduler history:
laravel/framework#58926
laravel/framework#60133
laravel/framework#60144
laravel/framework#60148
laravel/framework#60190
laravel/framework#60197
laravel/framework#60255
laravel/framework#60712
laravel/framework#60311
laravel/framework#60469
laravel/framework#55624
laravel/framework#57621
laravel/framework#59331

Related complete test and documentation reconciliation:
laravel/framework#60761
laravel/framework#60793
laravel/framework#61199
laravel/framework#60595
laravel/framework#61117
Porting source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: full composer fix, both complete scheduler suites after review
corrections, immediate test-file checks, facade regeneration and Telescope
frontend build. The repeat-start assertion fails when copy() is removed;
the maintenance-state assertion fails before correcting the elapsed-time
comparison. Formatting and diff checks pass.
…liation

Document that Hypervel serves rendered maintenance views through its running
workers instead of Laravel's pre-bootstrap maintenance.php stub. Record the
intentional omission at the source and matching test location, and point
deployments that need a page while Hypervel is unavailable to their reverse
proxy or load balancer. The shared porting guide contains the same deployment
action and links to the existing feature documentation.

The middleware and existing tests already cover the JSON redirect/template
guards from Laravel. Preserve those cases, remove the duplicate final clock
reset owned by the test subscriber, and complete native test-method typing.
No maintenance runtime behavior changes.

Upstream:
laravel/framework#60595
laravel/framework#60761
laravel/framework#61199
Porting source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

Validation: complete MaintenanceModeTest, full composer fix and diff checks.
Use real event dispatchers where the tests need normal dispatch behavior and
apply the current facade spy, swap and expectation forms. Preserve exact
event counts, the owning container bindings, command execution boundaries,
and Hypervel's atomic environment-file replacement coverage.

Keep Blade's initialized compiler behind its proxy mock: a constructor-free
partial mock lacks filesystem state when the real compile method runs.
Preserve the real session exception handler, which executes the deferred
session save, rather than replacing that behavior with a no-op spy.

Port the original view-clear test alongside the existing Hypervel filesystem
cases. It checks deletion of both compiled files and parallel-test directories
with successful native bool returns. Restore missing channel-list assertions,
retain the queue worker's fractional memory-limit contract, and update the
two upstream memory-test values without changing worker source behavior.

Upstream:
laravel/framework#61199
laravel/framework#61117
laravel/framework#59068
laravel/framework#59049
laravel/framework#60761
Porting source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2.

This completes the encountered cleanup slice; the wider 270-file #61117
port remains in progress. Existing Hypervel-specific tests are preserved.

Validation: each changed test file, the real session/view-clear baseline,
the database queue worker tests, and full composer fix all pass.
Bring in the merged scheduler and WebSocket lifecycle fixes from PR #584, along with the intervening coroutine and HTTP client changes already on 0.4.

Resolve the Laravel porting-guide conflict by retaining the scheduling command and user guidance, the process-isolation guidance, and the maintenance-mode section. The other files merge automatically.

Preserve all unfinished porting changes outside the merge commit. Updated the independent local Algolia installation to the merged dependency floor. The merged scheduler and HTTP client test files, configured formatting, full source and type-fixture analysis, and diff checks pass.
Reconcile the applicable CacheRateLimiterTest cases from Laravel PR #61117 against Hypervel’s policy-based rate limiter. Preserve every callback result, including false, empty arrays and strings, and distinct integer and float zero values.

Make the existing admission test observe that capacity is consumed before callback execution and that denied callbacks remain uncalled. Use the real worker-array store without restoring Laravel’s replaced primitive counter API. Complete the existing omission comments and inline helper method titles.

Validated the changed test file, the rate-limiter suite, repository formatting and full source and type-fixture analysis.

Upstream: laravel/framework#61117
Source revision: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2
PHP converts numeric-string array keys to integers. Batched cache reads passed those integer result keys to strictly typed hit and miss event constructors, causing a TypeError whenever the corresponding listeners were registered. Normalize the two event arguments to strings inside their existing listener guards. Returned maps and reads without listeners remain unchanged.

Restore the original numeric-key regression from Laravel PR #48423, which had been changed to alphabetic keys and no longer tested numeric-position defaults. Add a focused real-store test for numeric hit and miss event keys. Existing cached-null coverage remains unchanged.

Both constructor failures were reproduced before the correction. The repository tests, Cache suite, configured formatter and full source/type analysis pass.

Upstream: laravel/framework#48423
Encountered during: laravel/framework#61117
Source revision: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2
Require an explicit TTL and dispatch positive lifetimes directly to the
store. Remove an item through forget() when its computed lifetime is zero
or negative. The previous read-before-touch path could make an expired
item permanent in array stores and left Redis items alive after their
requested expiration.

Apply the same expiration boundary to all-mode tagged Redis caches,
retain enum-key normalization, and align the contract, any-mode override
and generated Cache facade. Removing the preliminary read also avoids
an unnecessary storage round trip and value deserialization. Cached-null
sentinels remain untouched by finite lifetime updates.

Reconcile the complete touch history against Laravel 13.x at
01d008c9b5f32cb7c5e50a9a22273113d810b2a2, including existing store
implementations and established unsupported-driver exclusions. Preserve
the pinned repository cases with immutable dates and Hypervel enum naming,
and retain real Redis sentinel and missing-key coverage. Remove obsolete
null-TTL rewrite tests and document removal for nonpositive lifetimes.

Validation: affected test files, Cache ParaTest, isolated Redis TTL
integration tests, generated-facade tests, configured formatting and full
source/type PHPStan checks pass. Existing environment-dependent skips
remain in the Cache suite.

Laravel PRs:
laravel/framework#55954
laravel/framework#59121
laravel/framework#59864
laravel/framework#60878
Restore the current upstream tests for transported exceptions, falsey
constructor arguments, failed child processes, keyed results, result order,
string-backed driver enums and integer timeouts. Keep the existing coroutine,
direct sync-driver and CarbonInterval coverage alongside these cases.

Select the process driver explicitly because Hypervel defaults to coroutines.
Extract the exception fixtures into separate PSR-4 files so fresh children can
autoload them. Terminate the failed-child fixture through Swoole's process
API: exit() inside its command coroutine throws a task exception and does not
produce the failed process result this test must exercise. Check the stable
exit-code message without depending on shell error-output wording.

Complete the modified test file's native typing and replace deprecated
substring assertions without changing their matching semantics. Add the
missing ProcessDriver::run throws annotation; runtime source is unchanged.

Ported from Laravel 13.x at 01d008c9b5f32cb7c5e50a9a22273113d810b2a2:
laravel/framework#54705
laravel/framework#60822
laravel/framework#53135
laravel/framework#53712
laravel/framework#55161
laravel/framework#59801
laravel/framework#60105
laravel/framework#59602
laravel/framework#54732

This completes the Concurrency assertion changes encountered in
laravel/framework#61049; the rest of that PR remains
under reconciliation.

Validation: changed-file PHPUnit and Concurrency ParaTest pass, scoped
formatting is clean, full source and type-fixture PHPStan passes, and facade
generation lint plus FacadeDocblocksTest pass.
Bring the merged PR 585 corrections into the continuation branch. Retain the continuation scheduling and maintenance porting guidance while deduplicating the shared scheduler process-isolation paragraph.

Preserve all uncommitted continuation work. Verified every previously modified file retained its exact contents and ran the automatically merged notification locale test successfully.
Reconcile the provider, password broker, token guard, verification listener and authorization middleware tests against the pinned Laravel 13.x tests. Use exact Mockery expectations for required calls while retaining default stubs, native fixture types and the existing coroutine-aware request and provider behavior.

Restore string-backed broker-name and non-string token coverage alongside the existing integer-zero and request-isolation cases. Capture password reset arguments locally, remove the unreachable throttled-notification stub, and leave global container cleanup with the PHPUnit subscriber. No authentication source behavior changes.

This completes these test files within the ongoing port of laravel/framework#61117, using source pin 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. The token input cases also reconcile the complete direct upstream commit laravel/framework@9b21ce0a9b.

Validation: immediate tests for every edited file, full composer fix for the checkpoint, and focused token-guard tests plus configured formatting after the final fixture-name correction.
Reconcile the Ably, Pusher, Redis and queued broadcast event tests against the pinned Laravel 13.x surface. Restore exact event payload checks and the explicit false missing-model deletion case while preserving Hypervel queue attributes, connection routing and channel authorization behavior.

Exercise the real Pusher SDK local authentication signer against the known upstream signature instead of returning the expected signature from a mock. Required signing and publishing calls use exact expectations; request lookup stubs remain loose where their call count is not the contract. Complete native callback and fixture types without changing production code.

Upstream: laravel/framework#61117 and the complete source/test reconciliation of laravel/framework#61074. Porting source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. The broader Mockery port remains in progress.

Validation: each changed test file passed immediately, full composer fix passed for the checkpoint, and both broadcaster files plus configured formatting passed after restoring the final request stubs.
Reconcile the five bus test files against Laravel 13.x, including the missing true Conditionable delay case. Preserve routing, guarded batch events, batch failure callbacks, deferred dispatch and unique-lock ownership assertions. Required calls now use exact Mockery expectations and fixture callbacks carry their actual native types.

Keep stored and returned batch mocks distinct, construct valid Batchable jobs before testing failed-add cleanup, and match native database batch result types. Preserve the two queue lookups and three connection lookups made by the bulk dispatch scenario. Remove only container cleanup already owned by the PHPUnit subscriber; retain explicit destruction and lock-release checks.

Upstream: laravel/framework#61117, source pin 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. This is one complete test-file group in the ongoing broader port, with no runtime source or public API changes.

Validation: immediate per-file PHPUnit runs, the complete Bus ParaTest suite, configured formatting, and full composer fix for the accumulated checkpoint.
Restore pinned Laravel batched read and putMany event checks and verify store names on ordinary and tagged cache events. Preserve Hypervel listener guards, failure and cancellation coverage, and tagged-cache payload behavior. Counted dispatch expectations replace redundant literal-true assertions.

Complete the manager fixture types, missing unbound-dispatcher assertion, strict default-driver assertion and required resolver expectations. Preserve custom repositories, explicit event disabling and coroutine-local memoized stores. No cache runtime behavior changes.

Upstream: laravel/framework#61117, using current source pin 01d008c9b5f32cb7c5e50a9a22273113d810b2a2. These two files are reconciled within the ongoing broader test port.

Validation: immediate PHPUnit runs for both files, configured formatting, and full composer fix across the accumulated checkpoint.
Normalize the remaining Mockery imports and calls in the SSR health-command and response tests to the framework-wide m alias. Assertions, test bodies and production behavior remain unchanged.

These local convention outliers were found while reconciling laravel/framework#61117. Hypervel retains its established alias rather than adopting a conflicting upstream spelling; this does not introduce an Inertia upstream catch-up.

Validation: both affected test files passed immediately and the full checkpoint passed composer fix.
Normalize the remaining Mockery imports and calls in the Sentry integration and meta-tag tests to the framework-wide m alias. Keep their existing span, route and output assertions unchanged.

These local convention outliers were found during laravel/framework#61117 reconciliation. The change follows the established Hypervel alias and introduces no Sentry runtime changes or additional upstream port.

Validation: both affected test files passed immediately and full composer fix passed for the checkpoint.
@binaryfire

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 23351af1-bcbd-41b0-ac7a-22ca891fbf92

📥 Commits

Reviewing files that changed from the base of the PR and between 6d8c245 and 3ad6b7c.

📒 Files selected for processing (10)
  • composer.json
  • src/collections/src/Collection.php
  • src/collections/src/Enumerable.php
  • src/collections/src/LazyCollection.php
  • src/database/composer.json
  • src/database/src/Eloquent/Collection.php
  • types/Collections/Collection.php
  • types/Collections/Enumerable.php
  • types/Collections/LazyCollection.php
  • types/Database/Eloquent/Collection.php

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 25a53b74-8132-4e11-8c28-b1bbffaa0e17

📥 Commits

Reviewing files that changed from the base of the PR and between f481ae2 and 6d8c245.

⛔ Files ignored due to path filters (1)
  • src/telescope/dist/app.js is excluded by !**/dist/**
📒 Files selected for processing (98)
  • src/cache/src/AnyModeTaggedCache.php
  • src/cache/src/Redis/AllTaggedCache.php
  • src/cache/src/Repository.php
  • src/concurrency/src/ProcessDriver.php
  • src/console/README.md
  • src/console/src/ConsoleServiceProvider.php
  • src/console/src/Scheduling/Event.php
  • src/console/src/Scheduling/ManagesAttributes.php
  • src/console/src/Scheduling/PendingEventAttributes.php
  • src/console/src/Scheduling/Schedule.php
  • src/contracts/src/Cache/Repository.php
  • src/docs/cache.md
  • src/docs/porting-from-laravel.md
  • src/docs/scheduling.md
  • src/docs/telescope.md
  • src/foundation/README.md
  • src/foundation/src/Console/DownCommand.php
  • src/rate-limiter/src/Limiter.php
  • src/support/src/Facades/Cache.php
  • src/support/src/Facades/Schedule.php
  • src/telescope/resources/js/screens/schedule/preview.vue
  • src/telescope/src/Watchers/ScheduleWatcher.php
  • src/testing/src/TestResponse.php
  • tests/Auth/AuthDatabaseTokenRepositoryTest.php
  • tests/Auth/AuthDatabaseUserProviderTest.php
  • tests/Auth/AuthEloquentUserProviderTest.php
  • tests/Auth/AuthListenersSendEmailVerificationNotificationHandleFunctionTest.php
  • tests/Auth/AuthPasswordBrokerManagerTest.php
  • tests/Auth/AuthPasswordBrokerTest.php
  • tests/Auth/AuthTokenGuardTest.php
  • tests/Auth/AuthenticateMiddlewareTest.php
  • tests/Auth/AuthorizeMiddlewareTest.php
  • tests/Broadcasting/AblyBroadcasterTest.php
  • tests/Broadcasting/BroadcastEventTest.php
  • tests/Broadcasting/PusherBroadcasterTest.php
  • tests/Broadcasting/RedisBroadcasterTest.php
  • tests/Bus/BusBatchTest.php
  • tests/Bus/BusBatchableTest.php
  • tests/Bus/BusDispatcherTest.php
  • tests/Bus/BusPendingBatchTest.php
  • tests/Bus/BusPendingDispatchTest.php
  • tests/Cache/CacheArrayStoreTest.php
  • tests/Cache/CacheEventsTest.php
  • tests/Cache/CacheFileStoreTest.php
  • tests/Cache/CacheManagerTest.php
  • tests/Cache/CacheRepositoryTest.php
  • tests/Cache/CacheSessionStoreTest.php
  • tests/Cache/CacheStorageStoreTest.php
  • tests/Cache/Redis/AllTaggedCacheTest.php
  • tests/Concurrency/ConcurrencyTest.php
  • tests/Concurrency/Fixtures/ExceptionWithFalseyParam.php
  • tests/Concurrency/Fixtures/ExceptionWithParam.php
  • tests/Concurrency/Fixtures/ExceptionWithoutParam.php
  • tests/Console/ConsoleApplicationResolveTest.php
  • tests/Console/Fixtures/FakeEventMutex.php
  • tests/Console/Scheduling/EventTest.php
  • tests/Console/Scheduling/FrequencyTest.php
  • tests/Console/Scheduling/ScheduleRunCommandTest.php
  • tests/Database/DatabaseEloquentBuilderTest.php
  • tests/Database/DatabaseEloquentFactoryTest.php
  • tests/Database/DatabaseQueryBuilderTest.php
  • tests/Foundation/Console/ChannelListCommandTest.php
  • tests/Foundation/Console/RouteListCommandTest.php
  • tests/Foundation/FoundationExceptionsHandlerTest.php
  • tests/Http/HttpClientTest.php
  • tests/Inertia/Commands/CheckSsrTest.php
  • tests/Inertia/ResponseTest.php
  • tests/Integration/Cache/Redis/TtlHandlingIntegrationTest.php
  • tests/Integration/Console/CommandDurationThresholdTest.php
  • tests/Integration/Console/EnvironmentDecryptCommandTest.php
  • tests/Integration/Console/EnvironmentEncryptCommandTest.php
  • tests/Integration/Console/Scheduling/CallbackEventTest.php
  • tests/Integration/Console/Scheduling/EventPingTest.php
  • tests/Integration/Console/Scheduling/ScheduleGroupTest.php
  • tests/Integration/Console/Scheduling/ScheduleRunCommandTest.php
  • tests/Integration/Console/Scheduling/SubMinuteSchedulingTest.php
  • tests/Integration/Cookie/CookieTest.php
  • tests/Integration/Database/MariaDb/EloquentCastTest.php
  • tests/Integration/Database/MySql/EloquentCastTest.php
  • tests/Integration/Foundation/Exceptions/RendererTest.php
  • tests/Integration/Foundation/MaintenanceModeTest.php
  • tests/Integration/Http/RequestDurationThresholdTest.php
  • tests/Integration/Mail/SendingMailWithLocaleTest.php
  • tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php
  • tests/Integration/Queue/WorkCommandTest.php
  • tests/Integration/Session/Database/DatabaseSessionHandlerTestCase.php
  • tests/Integration/View/BladeTest.php
  • tests/Integration/View/ClearCommandTest.php
  • tests/Queue/DatabaseFailedJobProviderTest.php
  • tests/Queue/FileFailedJobProviderTest.php
  • tests/Queue/QueuePauseResumeTest.php
  • tests/RateLimiter/LimiterTest.php
  • tests/Sentry/IntegrationMetaTagTest.php
  • tests/Sentry/IntegrationTest.php
  • tests/Session/ArraySessionHandlerTest.php
  • tests/Support/SleepTest.php
  • tests/Support/SupportLazyCollectionTest.php
  • tests/Telescope/Watchers/ScheduleWatcherTest.php
💤 Files with no reviewable changes (4)
  • src/console/src/Scheduling/PendingEventAttributes.php
  • src/telescope/src/Watchers/ScheduleWatcher.php
  • tests/Integration/Cache/Redis/TtlHandlingIntegrationTest.php
  • src/telescope/resources/js/screens/schedule/preview.vue

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change updates cache TTL behavior, coroutine scheduling and maintenance handling, concurrency error coverage, and extensive test typing and mock expectations. Documentation and Telescope scheduling metadata now match the updated runtime behavior.

Changes

Framework behavior and validation

Layer / File(s) Summary
Cache touch semantics
src/cache/..., src/contracts/src/Cache/Repository.php, src/support/src/Facades/Cache.php, src/docs/cache.md, tests/Cache/..., tests/Integration/Cache/...
touch now requires a TTL, forgets entries for non-positive TTLs, applies positive TTLs directly, and preserves string keys in cache events.
Coroutine scheduling and maintenance handling
src/console/..., src/foundation/..., src/docs/..., tests/Console/..., tests/Integration/Console/..., tests/Telescope/...
Scheduling no longer registers schedule:work or task user metadata. Maintenance responses rely on running workers instead of a pre-bootstrap stub.
Concurrency contracts and coverage
src/concurrency/src/ProcessDriver.php, tests/Concurrency/...
The process-driver contract documents throwable behavior. Tests cover process failures, exception parameters, timeouts, enum driver resolution, output mapping, and callback order.
Test typing and expectation modernization
tests/Auth/..., tests/Broadcasting/..., tests/Bus/..., tests/Database/..., tests/Http/..., tests/Queue/..., tests/Session/..., tests/Support/..., tests/Sentry/...
Tests add explicit return and parameter types, use stricter Mockery expectations, stabilize clock-based assertions, and add focused coverage for changed behavior.
Additional integration coverage and documentation
tests/Integration/..., src/docs/..., src/console/README.md, src/foundation/README.md
Integration tests cover request-duration thresholds, cookie expiry, view clearing, scheduling events, and maintenance mode. Documentation describes the updated scheduling and maintenance behavior.

Priority: ➖ Normal

Estimated code review effort: 5 (Critical) | ~90 minutes

Merge Risk: ⚪ Minimal · up to 6d8c2

The updated cache, scheduler, maintenance, concurrency, and test behavior has no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.96% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 585 functions across 50 files. (44 skippe… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the pull request's main focus: completing scheduler, cache, and framework test parity updates.
Full details: Docstring Coverage

Explanation

Docstring coverage is 24.96% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 585 functions across 50 files. (44 skipped: 6 unsupported, 38 over the file limit.)

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch laravel-parity-backlog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix scheduler groups and cache expiry with framework test parity

🐞 Bug fix 🧪 Tests ✨ Enhancement 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Prevent scheduler groups from applying inherited callbacks and macros twice.
• Make cache touch expiration explicit and preserve numeric keys in cache events.
• Restore broad Laravel parity coverage while retaining Hypervel coroutine isolation.
Diagram

graph TD
  A["Schedule API"] --> B["Group attributes"] --> C["Scheduled tasks"] --> D["Task events"]
  E["Cache API"] --> F["TTL handling"] --> G["Cache stores"] --> H["Cache events"]
Loading
High-Level Assessment

The current approach is appropriate: it follows Laravel 13.x semantics where compatible, while explicitly preserving Hypervel's coroutine scheduler, process model, and test isolation. Re-reading values during touch or reapplying scheduler groups would retain the exposed bugs, while blindly copying Laravel's process-user and scheduler-worker behavior would conflict with Hypervel's runtime architecture.

Files changed (99) +3502 / -1846

Enhancement (2) +1 / -8
app.jsRebuild Telescope without the scheduler user field +1/-1

Rebuild Telescope without the scheduler user field

• Updates the compiled Telescope application bundle to remove user display from scheduled command details.

src/telescope/dist/app.js

preview.vueRemove scheduler user from Telescope previews +0/-7

Remove scheduler user from Telescope previews

• Deletes the user row from scheduled task detail views.

src/telescope/resources/js/screens/schedule/preview.vue

Bug fix (10) +33 / -66
AnyModeTaggedCache.phpRequire an explicit tagged-cache touch expiration +1/-1

Require an explicit tagged-cache touch expiration

• Removes the nullable default TTL from unsupported any-mode tagged touch operations, keeping its signature aligned with the cache contract.

src/cache/src/AnyModeTaggedCache.php

AllTaggedCache.phpApply tagged cache expiration without reading values +6/-9

Apply tagged cache expiration without reading values

• Requires an explicit TTL, deletes entries for non-positive lifetimes, and delegates positive expirations directly to Redis tag operations.

src/cache/src/Redis/AllTaggedCache.php

Repository.phpCorrect cache touch and numeric-key event behavior +10/-10

Correct cache touch and numeric-key event behavior

• Eliminates the pre-touch read, removes entries for non-positive TTLs, and converts numeric array keys to strings only when constructing hit or miss events.

src/cache/src/Repository.php

ManagesAttributes.phpRemove ineffective scheduled-task user configuration +1/-14

Remove ineffective scheduled-task user configuration

• Removes the task user property and fluent user method because coroutine tasks share the scheduler process user.

src/console/src/Scheduling/ManagesAttributes.php

PendingEventAttributes.phpStop merging unsupported task users +0/-4

Stop merging unsupported task users

• Removes propagation of the deleted scheduler user attribute into concrete events.

src/console/src/Scheduling/PendingEventAttributes.php

Schedule.phpApply inherited scheduler attributes exactly once +11/-22

Apply inherited scheduler attributes exactly once

• Uses pending attributes without replaying the active group, preventing duplicate callbacks and macros. It also tightens event-list annotations and removes obsolete optional-package guards.

src/console/src/Scheduling/Schedule.php

Repository.phpRequire explicit expiration in the cache contract +2/-2

Require explicit expiration in the cache contract

• Changes touch to require an integer, DateInterval, or DateTimeInterface expiration rather than accepting an omitted or null TTL.

src/contracts/src/Cache/Repository.php

Cache.phpRegenerate the explicit cache touch facade signature +1/-1

Regenerate the explicit cache touch facade signature

• Updates generated facade metadata so touch requires a non-null expiration.

src/support/src/Facades/Cache.php

Schedule.phpRegenerate scheduler facade metadata +1/-2

Regenerate scheduler facade metadata

• Adds a precise event-list return type and removes the unsupported user method from the generated facade.

src/support/src/Facades/Schedule.php

ScheduleWatcher.phpStop recording scheduler user metadata +0/-1

Stop recording scheduler user metadata

• Removes the obsolete user field from Telescope schedule entries.

src/telescope/src/Watchers/ScheduleWatcher.php

Refactor (1) +2 / -2
TestResponse.phpUse canonical cookie expiration comparisons +2/-2

Use canonical cookie expiration comparisons

• Uses Carbon's isPast and isFuture helpers while preserving the session-cookie zero-expiration guards.

src/testing/src/TestResponse.php

Tests (75) +3431 / -1761
AuthDatabaseTokenRepositoryTest.phpStrengthen database token repository expectations +60/-47

Strengthen database token repository expectations

• Converts interactions to required expectations and makes password-reset token time boundaries deterministic.

tests/Auth/AuthDatabaseTokenRepositoryTest.php

AuthDatabaseUserProviderTest.phpType and tighten database user provider tests +52/-52

Type and tighten database user provider tests

• Adds native return and callback types while requiring expected query, hashing, retrieval, and rehash interactions.

tests/Auth/AuthDatabaseUserProviderTest.php

AuthEloquentUserProviderTest.phpType and tighten Eloquent authentication tests +66/-62

Type and tighten Eloquent authentication tests

• Adds typed fixtures and callbacks and strengthens expectations around token lookup, credentials, query callbacks, and password rehashing.

tests/Auth/AuthEloquentUserProviderTest.php

AuthListenersSendEmailVerificationNotificationHandleFunctionTest.phpAdd return types to verification listener tests +3/-3

Add return types to verification listener tests

• Adds void return declarations to email verification listener coverage.

tests/Auth/AuthListenersSendEmailVerificationNotificationHandleFunctionTest.php

AuthPasswordBrokerManagerTest.phpCover string and zero-backed password broker names +22/-7

Cover string and zero-backed password broker names

• Generalizes backed-enum assertions to verify both string names and integer-zero broker identifiers normalize and cache correctly.

tests/Auth/AuthPasswordBrokerManagerTest.php

AuthPasswordBrokerTest.phpStrengthen password broker callback and reset tests +38/-27

Strengthen password broker callback and reset tests

• Uses native interface fixtures, required expectations, typed callbacks, and local reset argument capture.

tests/Auth/AuthPasswordBrokerTest.php

AuthTokenGuardTest.phpCover non-string token rejection +81/-42

Cover non-string token rejection

• Adds user lookup and validation regressions for array tokens while tightening typed fixtures and preserving string-zero and request-isolation coverage.

tests/Auth/AuthTokenGuardTest.php

AuthenticateMiddlewareTest.phpUse a real request in authentication middleware tests +1/-1

Use a real request in authentication middleware tests

• Replaces the request mock with a concrete Request to preserve realistic middleware behavior.

tests/Auth/AuthenticateMiddlewareTest.php

AuthorizeMiddlewareTest.phpModernize authorization middleware fixtures +64/-66

Modernize authorization middleware fixtures

• Adds native types, concrete event and response collaborators, and centralized test cleanup while retaining route-model and enum authorization cases.

tests/Auth/AuthorizeMiddlewareTest.php

AblyBroadcasterTest.phpTighten Ably broadcaster authentication tests +26/-13

Tighten Ably broadcaster authentication tests

• Adds typed channel callbacks and fixtures and makes signature and unauthenticated-user interactions mandatory.

tests/Broadcasting/AblyBroadcasterTest.php

BroadcastEventTest.phpAssert exact broadcast event payloads +81/-26

Assert exact broadcast event payloads

• Strengthens connection and broadcast expectations, verifies exact payloads, and covers explicitly disabling deletion for missing models.

tests/Broadcasting/BroadcastEventTest.php

PusherBroadcasterTest.phpValidate Pusher authentication with the real SDK +44/-39

Validate Pusher authentication with the real SDK

• Replaces a mocked user-authentication result with a real local SDK signature and tightens channel, presence, trigger, and JSONP expectations.

tests/Broadcasting/PusherBroadcasterTest.php

RedisBroadcasterTest.phpStrengthen Redis broadcaster behavior coverage +37/-31

Strengthen Redis broadcaster behavior coverage

• Adds typed callbacks and mandatory expectations for authentication, cluster publishing, Lua publishing, prefixes, failures, and payload shape.

tests/Broadcasting/RedisBroadcasterTest.php

BusBatchTest.phpTighten batch lifecycle and repository tests +127/-92

Tighten batch lifecycle and repository tests

• Strengthens queue and event expectations, types callbacks and fixtures, and corrects PostgreSQL batch option serialization assertions.

tests/Bus/BusBatchTest.php

BusBatchableTest.phpAlign batchable job lookup tests +4/-6

Align batchable job lookup tests

• Requires repository lookups, preserves zero batch identifiers, and removes duplicate global container cleanup.

tests/Bus/BusBatchableTest.php

BusDispatcherTest.phpStrengthen bus dispatch routing assertions +85/-79

Strengthen bus dispatch routing assertions

• Requires queue route, delay, connection, and bulk dispatch interactions while adding native fixture types and relying on shared cleanup.

tests/Bus/BusDispatcherTest.php

BusPendingBatchTest.phpCorrect pending batch storage and failure tests +73/-62

Correct pending batch storage and failure tests

• Keeps stored and returned batch mocks distinct, requires deletion after failed job addition, and tightens conditional dispatch and callback coverage.

tests/Bus/BusPendingBatchTest.php

BusPendingDispatchTest.phpRestore conditional pending-dispatch delay coverage +99/-84

Restore conditional pending-dispatch delay coverage

• Adds the missing true-condition delay case and preserves explicit destructor dispatch, unique-lock metadata, and release assertions.

tests/Bus/BusPendingDispatchTest.php

CacheArrayStoreTest.phpMake array cache expiration tests deterministic +36/-19

Make array cache expiration tests deterministic

• Uses immutable clock captures, verifies exact expiry boundaries, and adds coverage preventing expired lock owners from refreshing locks.

tests/Cache/CacheArrayStoreTest.php

CacheEventsTest.phpRestore cache batch event and store-name assertions +119/-90

Restore cache batch event and store-name assertions

• Verifies store names on ordinary and tagged events and restores batched read and write event assertions with stricter expectations.

tests/Cache/CacheEventsTest.php

CacheFileStoreTest.phpStabilize file cache expiration tests +4/-5

Stabilize file cache expiration tests

• Captures a single immutable clock for expired increments and TTL-preserving updates.

tests/Cache/CacheFileStoreTest.php

CacheManagerTest.phpComplete cache manager resolution assertions +33/-25

Complete cache manager resolution assertions

• Tightens driver, dispatcher, session-store, custom repository, purge, and coroutine-local memoization coverage.

tests/Cache/CacheManagerTest.php

CacheRepositoryTest.phpTest explicit touch semantics and numeric keys +54/-40

Test explicit touch semantics and numeric keys

• Verifies direct TTL delegation, deletion for expired lifetimes, enum keys, and string event keys for numeric batched reads.

tests/Cache/CacheRepositoryTest.php

CacheSessionStoreTest.phpStabilize session cache store tests +33/-30

Stabilize session cache store tests

• Adds native types and uses cumulative immutable clock advances for expiration, touch, increment, and enumeration coverage.

tests/Cache/CacheSessionStoreTest.php

CacheStorageStoreTest.phpTest storage touch at the rounded expiry boundary +3/-2

Test storage touch at the rounded expiry boundary

• Starts from a whole second and advances cumulatively so the final assertion reaches the original expiration exactly.

tests/Cache/CacheStorageStoreTest.php

AllTaggedCacheTest.phpUpdate all-mode Redis touch semantics +6/-87

Update all-mode Redis touch semantics

• Removes null-TTL and pre-read expectations and verifies past or zero expirations delete tagged entries.

tests/Cache/Redis/AllTaggedCacheTest.php

ConcurrencyTest.phpRestore process concurrency parity coverage +276/-90

Restore process concurrency parity coverage

• Adds real-process exception reconstruction, falsey constructor arguments, failed-child handling, result ordering, enum driver selection, and integer timeout tests.

tests/Concurrency/ConcurrencyTest.php

ExceptionWithFalseyParam.phpAdd falsey exception argument fixture +18/-0

Add falsey exception argument fixture

• Introduces an exception fixture retaining zero, false, or empty-string constructor values across process boundaries.

tests/Concurrency/Fixtures/ExceptionWithFalseyParam.php

ExceptionWithParam.phpAdd multi-argument process exception fixture +24/-0

Add multi-argument process exception fixture

• Introduces an API-style exception with public constructor parameters for process reconstruction tests.

tests/Concurrency/Fixtures/ExceptionWithParam.php

ExceptionWithoutParam.phpAdd parameterless custom exception fixture +11/-0

Add parameterless custom exception fixture

• Introduces a simple custom exception for process propagation coverage.

tests/Concurrency/Fixtures/ExceptionWithoutParam.php

ConsoleApplicationResolveTest.phpStrengthen console command resolution coverage +86/-26

Strengthen console command resolution coverage

• Uses a real event dispatcher, adds native fixture types, verifies dynamic command retrieval, and preserves concurrent command-instance isolation tests.

tests/Console/ConsoleApplicationResolveTest.php

FakeEventMutex.phpAdd reusable scheduler mutex fixture +34/-0

Add reusable scheduler mutex fixture

• Introduces a deterministic EventMutex implementation that never acquires or reports locks.

tests/Console/Fixtures/FakeEventMutex.php

EventTest.phpRestore scheduler event callback and overlap tests +127/-43

Restore scheduler event callback and overlap tests

• Expands callback injection and invokable-filter coverage and verifies overlapping runs skip execution then reset state on success.

tests/Console/Scheduling/EventTest.php

FrequencyTest.phpComplete scheduler frequency parity tests +45/-42

Complete scheduler frequency parity tests

• Uses the shared fake mutex, adds native types, and restores quarterlyOn and macro frequency assertions.

tests/Console/Scheduling/FrequencyTest.php

ScheduleRunCommandTest.phpRecord continuous schedule-run test adaptation +2/-0

Record continuous schedule-run test adaptation

• Documents why a separate ScheduleWorkCommand test is not applicable to Hypervel's scheduler loop.

tests/Console/Scheduling/ScheduleRunCommandTest.php

DatabaseEloquentBuilderTest.phpUse shared clock cleanup for Eloquent updates +1/-3

Use shared clock cleanup for Eloquent updates

• Adds a void return type and removes redundant local test-clock cleanup.

tests/Database/DatabaseEloquentBuilderTest.php

DatabaseEloquentFactoryTest.phpUse shared clock cleanup for factory states +2/-6

Use shared clock cleanup for factory states

• Adds native test return types and removes duplicate clock resets from soft-delete factory coverage.

tests/Database/DatabaseEloquentFactoryTest.php

DatabaseQueryBuilderTest.phpUse immutable day boundaries in period tests +6/-6

Use immutable day boundaries in period tests

• Builds date periods from today without mutating repeated now instances and adds a native test return type.

tests/Database/DatabaseQueryBuilderTest.php

ChannelListCommandTest.phpRestore registered broadcast channel listing coverage +16/-3

Restore registered broadcast channel listing coverage

• Adds a real registered channel and verifies channel:list reports its pattern and count.

tests/Foundation/Console/ChannelListCommandTest.php

RouteListCommandTest.phpUse concrete dispatchers in route-list tests +22/-25

Use concrete dispatchers in route-list tests

• Replaces dispatcher mocks with real event dispatchers and adds native types across route and controller fixtures.

tests/Foundation/Console/RouteListCommandTest.php

FoundationExceptionsHandlerTest.phpUse an immutable daily boundary in exception throttling +1/-1

Use an immutable daily boundary in exception throttling

• Replaces a mutable start-of-day expression with CarbonImmutable::today.

tests/Foundation/FoundationExceptionsHandlerTest.php

HttpClientTest.phpNormalize HTTP middleware fixtures for Hypervel +6/-6

Normalize HTTP middleware fixtures for Hypervel

• Uses an immutable clock and Hypervel-specific user-agent and host values in global middleware coverage.

tests/Http/HttpClientTest.php

CheckSsrTest.phpNormalize the Inertia Mockery alias +3/-3

Normalize the Inertia Mockery alias

• Uses the established short Mockery alias in SSR health-check tests.

tests/Inertia/Commands/CheckSsrTest.php

ResponseTest.phpNormalize the Inertia response Mockery alias +2/-2

Normalize the Inertia response Mockery alias

• Uses the established short Mockery alias for promise property resolution.

tests/Inertia/ResponseTest.php

TtlHandlingIntegrationTest.phpRemove obsolete null-TTL tagged touch assertions +0/-10

Remove obsolete null-TTL tagged touch assertions

• Drops all-mode Redis expectations for making touched entries permanent now that touch requires an explicit expiration.

tests/Integration/Cache/Redis/TtlHandlingIntegrationTest.php

CommandDurationThresholdTest.phpStabilize command duration threshold coverage +33/-34

Stabilize command duration threshold coverage

• Captures immutable clocks, freezes DateTime deadlines before registration, and preserves configured timezone behavior across duration forms.

tests/Integration/Console/CommandDurationThresholdTest.php

EnvironmentDecryptCommandTest.phpUse facade filesystem spies for decryption tests +6/-4

Use facade filesystem spies for decryption tests

• Adopts the File facade spy, adds setup documentation, and corrects swapped test names for source and destination existence failures.

tests/Integration/Console/EnvironmentDecryptCommandTest.php

EnvironmentEncryptCommandTest.phpTighten readable environment encryption tests +46/-68

Tighten readable environment encryption tests

• Uses facade expectations and typed matchers for readable encryption, comments, multiline values, references, invalid lines, and special characters.

tests/Integration/Console/EnvironmentEncryptCommandTest.php

CallbackEventTest.phpRestore scheduled callback event injection tests +79/-15

Restore scheduled callback event injection tests

• Uses a deterministic mutex and verifies success, failure, output, exception propagation, and event parameter injection.

tests/Integration/Console/Scheduling/CallbackEventTest.php

EventPingTest.phpTighten scheduled ping failure coverage +5/-6

Tighten scheduled ping failure coverage

• Uses the shared fake mutex and requires transfer exceptions to be reported before subsequent callbacks.

tests/Integration/Console/Scheduling/EventPingTest.php

ScheduleGroupTest.phpRestore comprehensive scheduler group parity +354/-47

Restore comprehensive scheduler group parity

• Covers nested frequencies, pending attributes, macros, filters, lifecycle and output callbacks, ordering, and exactly-once inheritance.

tests/Integration/Console/Scheduling/ScheduleGroupTest.php

ScheduleRunCommandTest.phpAdd scheduler command outcome integration coverage +295/-0

Add scheduler command outcome integration coverage

• Tests foreground and background success and failure events, overlap skips, coroutine joining, and immutable repeat-start boundaries.

tests/Integration/Console/Scheduling/ScheduleRunCommandTest.php

SubMinuteSchedulingTest.phpCorrect sub-minute maintenance-mode timing +15/-6

Correct sub-minute maintenance-mode timing

• Fixes elapsed-time direction, verifies maintenance mode was entered, and retains worker-shared mutex behavior.

tests/Integration/Console/Scheduling/SubMinuteSchedulingTest.php

CookieTest.phpAdd session cookie expiration integration tests +60/-0

Add session cookie expiration integration tests

• Verifies expire-on-close cookies use zero expiration and lifetime-based cookies expire at the configured minute boundary.

tests/Integration/Cookie/CookieTest.php

EloquentCastTest.phpStabilize MariaDB integer timestamp cast tests +45/-43

Stabilize MariaDB integer timestamp cast tests

• Uses immutable cumulative clocks and native schema types and drops both test-owned tables during teardown.

tests/Integration/Database/MariaDb/EloquentCastTest.php

EloquentCastTest.phpStabilize MySQL integer timestamp cast tests +45/-43

Stabilize MySQL integer timestamp cast tests

• Uses immutable cumulative clocks and native schema types and drops both test-owned tables during teardown.

tests/Integration/Database/MySql/EloquentCastTest.php

RendererTest.phpTighten exception renderer integration fixtures +34/-18

Tighten exception renderer integration fixtures

• Adds native types and uses facade event swaps while preserving listener registration, previous exception, and Symfony fallback coverage.

tests/Integration/Foundation/Exceptions/RendererTest.php

MaintenanceModeTest.phpRecord Hypervel maintenance-mode test differences +2/-2

Record Hypervel maintenance-mode test differences

• Documents omission of Laravel's pre-bootstrap stub test and relies on global clock cleanup for retry cases.

tests/Integration/Foundation/MaintenanceModeTest.php

RequestDurationThresholdTest.phpAdd request lifecycle duration coverage +200/-0

Add request lifecycle duration coverage

• Tests interval, millisecond, and DateTime thresholds, exact boundaries, callback arguments, timezone ownership, state cleanup, and terminate-without-handle.

tests/Integration/Http/RequestDurationThresholdTest.php

SendingMailWithLocaleTest.phpAlign localized mail test cleanup and typing +6/-2

Align localized mail test cleanup and typing

• Adds fixture documentation and relies on global clock cleanup while preserving locale restoration assertions.

tests/Integration/Mail/SendingMailWithLocaleTest.php

SendingNotificationsWithLocaleTest.phpModernize localized notification fixtures +35/-13

Modernize localized notification fixtures

• Adds native types, Hypervel-specific addresses, and shared clock cleanup while preserving preferred and selected locale behavior.

tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php

WorkCommandTest.phpAlign queue worker integration coverage +29/-22

Align queue worker integration coverage

• Removes duplicate migrations, adds native types, normalizes configuration, and adjusts memory thresholds while retaining worker outcome assertions.

tests/Integration/Queue/WorkCommandTest.php

DatabaseSessionHandlerTestCase.phpUse cumulative clocks for database session collection +3/-3

Use cumulative clocks for database session collection

• Advances one captured immutable clock through database session garbage-collection boundaries.

tests/Integration/Session/Database/DatabaseSessionHandlerTestCase.php

BladeTest.phpPreserve initialized Blade compiler state in tests +3/-4

Preserve initialized Blade compiler state in tests

• Uses a partial mock of the configured compiler facade so unmatched compile calls retain initialized dependencies.

tests/Integration/View/BladeTest.php

ClearCommandTest.phpRestore view-clear command integration coverage +28/-0

Restore view-clear command integration coverage

• Verifies compiled files and parallel-test directories are removed through their appropriate filesystem operations.

tests/Integration/View/ClearCommandTest.php

DatabaseFailedJobProviderTest.phpUse immutable clocks for failed job pruning +5/-6

Use immutable clocks for failed job pruning

• Replaces Date facade time mutation with one captured CarbonImmutable clock across flush boundary assertions.

tests/Queue/DatabaseFailedJobProviderTest.php

FileFailedJobProviderTest.phpSimplify failed-job file test cleanup +41/-32

Simplify failed-job file test cleanup

• Relies on shared clock restoration, adds fixture documentation, and preserves failed-job ordering and payload assertions.

tests/Queue/FileFailedJobProviderTest.php

QueuePauseResumeTest.phpType queue pause and resume tests +18/-14

Type queue pause and resume tests

• Adds native return types and typed event listeners while removing redundant test-clock resets.

tests/Queue/QueuePauseResumeTest.php

LimiterTest.phpRestore rate-limiter callback result coverage +48/-4

Restore rate-limiter callback result coverage

• Verifies capacity is consumed before callbacks and preserves successful callback return values, including falsey values.

tests/RateLimiter/LimiterTest.php

IntegrationMetaTagTest.phpNormalize the Sentry meta-tag Mockery alias +2/-2

Normalize the Sentry meta-tag Mockery alias

• Uses the established short Mockery alias for span fixtures.

tests/Sentry/IntegrationMetaTagTest.php

IntegrationTest.phpNormalize the Sentry integration Mockery alias +2/-2

Normalize the Sentry integration Mockery alias

• Uses the established short Mockery alias for request fixtures.

tests/Sentry/IntegrationTest.php

ArraySessionHandlerTest.phpUse cumulative clocks for array sessions +7/-7

Use cumulative clocks for array sessions

• Captures immutable clocks for near-expiry, expired, and garbage-collection session boundaries.

tests/Session/ArraySessionHandlerTest.php

SleepTest.phpComplete immutable-clock cleanup in sleep tests +45/-45

Complete immutable-clock cleanup in sleep tests

• Adds native test types and uses captured immutable clocks for until, timestamp, negative-duration, fake-sleep, and assertion coverage.

tests/Support/SleepTest.php

SupportLazyCollectionTest.phpAlign lazy collection fixtures and cleanup +6/-13

Align lazy collection fixtures and cleanup

• Uses Hypervel-specific data, strict typed throttle callbacks, and shared clock and sleep cleanup.

tests/Support/SupportLazyCollectionTest.php

ScheduleWatcherTest.phpRemove scheduler user assertions from Telescope tests +1/-3

Remove scheduler user assertions from Telescope tests

• Drops user metadata setup and assertions and normalizes ignored-command configuration.

tests/Telescope/Watchers/ScheduleWatcherTest.php

Documentation (11) +35 / -9
ProcessDriver.phpDeclare process concurrency throwable behavior +3/-0

Declare process concurrency throwable behavior

• Documents that process-backed concurrent execution can propagate Throwable instances.

src/concurrency/src/ProcessDriver.php

README.mdDocument Hypervel scheduler process differences +6/-2

Document Hypervel scheduler process differences

• Explains continuous schedule:run behavior, the --once cron option, and why scheduled task user switching is unsupported.

src/console/README.md

ConsoleServiceProvider.phpRecord the intentional ScheduleWorkCommand omission +1/-0

Record the intentional ScheduleWorkCommand omission

• Clarifies that schedule:run already owns the continuous coroutine loop and replaces schedule:work.

src/console/src/ConsoleServiceProvider.php

Event.phpDocument in-process scheduled command execution +2/-0

Document in-process scheduled command execution

• Records why Laravel's shell-oriented buildCommand method is intentionally absent.

src/console/src/Scheduling/Event.php

cache.mdDocument cache touch deletion semantics +3/-1

Document cache touch deletion semantics

• Explains that zero, negative, and past expirations remove cache entries and updates any-mode tag guidance.

src/docs/cache.md

porting-from-laravel.mdDocument scheduler-user and maintenance-mode adaptations +8/-0

Document scheduler-user and maintenance-mode adaptations

• Adds migration guidance for scheduled task users and explains that running workers, not a pre-bootstrap stub, serve maintenance responses.

src/docs/porting-from-laravel.md

scheduling.mdClarify scheduler users, groups, and background outcomes +5/-3

Clarify scheduler users, groups, and background outcomes

• Documents OS-user behavior, callback and macro inheritance in groups, and observable background-task failures.

src/docs/scheduling.md

telescope.mdRemove task user from Telescope scheduler fields +1/-1

Remove task user from Telescope scheduler fields

• Updates scheduler watcher documentation to match removal of the unsupported user attribute.

src/docs/telescope.md

README.mdExplain Hypervel maintenance response topology +2/-0

Explain Hypervel maintenance response topology

• Clarifies that workers serve prepared responses and external infrastructure must handle complete application unavailability.

src/foundation/README.md

DownCommand.phpDocument omitted pre-bootstrap maintenance stub +2/-0

Document omitted pre-bootstrap maintenance stub

• Records that maintenance middleware in running workers replaces Laravel's generated maintenance.php stub.

src/foundation/src/Console/DownCommand.php

Limiter.phpAlign rate-limiter API difference documentation +2/-2

Align rate-limiter API difference documentation

• Updates the list of Laravel primitive counter APIs replaced by Hypervel's atomic policy decisions.

src/rate-limiter/src/Limiter.php

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 12, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Tagged cache cleanup scans deleted keys 🐞 Bug ➹ Performance
Description
AllTaggedCache::touch() sends zero and past expirations to the inherited Repository::forget(),
which deletes only the value key rather than its all-mode tag-set members. When an existing tagged
item, especially a forever item with a non-expiring tag score, is touched with a nonpositive TTL,
later tag flushes and pruning continue scanning that deleted key until an orphan-prune operation
runs.
Code

src/cache/src/Redis/AllTaggedCache.php[R215-218]

+        $seconds = $this->getSeconds($ttl);
-        if (is_null($ttl)) {
-            return $this->forever($key, $value);
+        if ($seconds <= 0) {
+            return $this->forget($key);
Evidence
The new branch calls the inherited plain deletion implementation. That implementation delegates only
to the store's value-key deletion, while all-mode touch maintains tag membership separately in
ZSETs; tag flush enumerates its work from those memberships, and orphan cleanup confirms missing
value keys are a distinct stale state.

src/cache/src/Redis/AllTaggedCache.php[211-225]
src/cache/src/Repository.php[817-826]
src/cache/src/Redis/Operations/AllTag/Touch.php[102-119]
src/cache/src/Redis/Operations/AllTag/Flush.php[40-63]
src/cache/src/Redis/Operations/AllTag/Prune.php[135-147]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A nonpositive TTL in all-mode Redis tagged cache `touch()` deletes only the value key through the inherited repository implementation. Its tag ZSET memberships remain, so deleted keys continue to be enumerated by tag operations.
## Fix Focus Areas
- src/cache/src/Redis/AllTaggedCache.php[215-218]
- src/cache/src/Redis/Operations/AllTag/Touch.php[102-119]
## Recommended Fix
Add a tag-aware deletion path that removes the namespaced value and its member from every current tag ZSET, atomically where Redis topology permits. Use that path for the nonpositive-TTL branch of `AllTaggedCache::touch()` rather than the inherited plain `forget()` implementation, and cover both expiring and forever tagged values.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/cache/src/Redis/AllTaggedCache.php
@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR expands framework test parity and adjusts scheduler grouping, cache expiration, scheduler API differences, generated facades, Telescope output, collection type declarations, and time-dependent test coverage.

  • Applies inherited scheduler-group attributes once to avoid duplicate callbacks and macros.
  • Requires an explicit cache-touch expiration and routes non-positive lifetimes through deletion.
  • Preserves numeric cache keys when constructing batch-read events.
  • Removes unsupported per-task scheduler users and documents Hypervel’s long-running scheduler and maintenance-mode behavior.
  • Adds broad authentication, broadcasting, batching, concurrency, duration, database, and integration coverage.
  • Updates collection key types for padding and raises the development PHPStan version.

Confidence Score: 4/5

The PR is not yet safe to merge because non-positive touch operations on all-mode Redis tagged entries can still leave stale tag memberships behind.

The previous cache finding remains outstanding: AllTaggedCache::touch() now calls $this->forget($key) for non-positive lifetimes, but that inherited deletion path removes the cached value without invoking the all-mode operation that also clears its tag ZSET memberships. No additional new actionable findings were identified in the changes since the previous review.

Files Needing Attention: src/cache/src/Redis/AllTaggedCache.php

Important Files Changed

Filename Overview
src/cache/src/Redis/AllTaggedCache.php Changes touch to delete items for non-positive TTLs, but the existing unresolved review finding remains because inherited forget still does not remove all-mode tag memberships.
src/cache/src/Repository.php Delegates positive touch lifetimes directly to stores, deletes for non-positive lifetimes, and string-normalizes numeric keys only at event construction.
src/console/src/Scheduling/Schedule.php Avoids applying scheduler group attributes twice when pending attributes already contain the inherited configuration.
src/console/src/Scheduling/ManagesAttributes.php Removes the ineffective scheduled-task OS-user property and fluent method.
src/testing/src/TestResponse.php Uses Carbon’s isPast and isFuture checks for cookie-expiration assertions.
src/collections/src/Collection.php Updates pad key annotations and adds targeted PHPStan suppressions for generic ArrayAccess assignments.
src/collections/src/LazyCollection.php Models pad results as containing preserved source keys and generated integer keys.
composer.json Raises the development PHPStan constraint without requiring a lockfile under repository policy.

Reviews (2): Last reviewed commit: "Correct collection key analysis for PHPS..." | Re-trigger Greptile

Comment on lines +217 to +218
if ($seconds <= 0) {
return $this->forget($key);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Tagged memberships remain orphaned

When an all-mode Redis cache item is touched with a zero, negative, or past expiration, this branch calls the inherited forget(). That deletes only the namespaced value and leaves its tag ZSET memberships behind. Finite memberships remain stale until their original expiration, while forever memberships use a score of -1 and remain until a global orphan-pruning pass. This can accumulate stale tag entries and retain Redis memory, so this path must remove both the value and its all-mode memberships.

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the existing all-mode deletion contract. A nonpositive touch() delegates to forget(), just as nonpositive put() and putMany() do. The value is deleted immediately; tag memberships are cleaned up later.

The retained metadata does consume space until a tag flush or pruning pass. cache:prune-stale-tags checks for missing values regardless of their expiration score, so it also removes orphaned memberships from forever entries. The cache documentation explains this behavior and recommends scheduling pruning.

We’re keeping that shared cleanup model. Adding eager cleanup only to touch() would make it inconsistent with the other deletion paths and require additional handling for concurrent writes across Redis Cluster slots.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s fair. Since touch() intentionally follows the same nonpositive-expiration path as put() and putMany(), eager membership cleanup here would be inconsistent with the existing all-mode deletion contract. The scheduled prune path checks cache-key existence independently of the sorted-set score, so it does remove orphaned forever memberships as described. I’m withdrawing this finding.

Collection::pad() preserves string keys while adding integer keys. Reflect
that behavior in the eager, lazy, Enumerable and Eloquent return annotations
and cover each boundary with a keyed type assertion. Keep existing list
assertions and all runtime implementations unchanged.

Require PHPStan 2.2.14 in the root and database development manifests. Older
versions incorrectly collapse the int|TKey union, so they cannot validate
these corrected return types.

The new analyzer also falsely rejects generic ArrayAccess keys at four
existing collection assignments. A standalone comparison with 2.2.13
confirms the regression, including when local generic types are explicit.
Ignore only that diagnostic at those four lines, explaining the limitation
without changing collection algorithms or adding runtime work.

Validated with full source and type-fixture analysis on installed PHPStan
2.2.14, formatting, each changed type fixture, Composer manifest consistency
and the existing eager, lazy and Eloquent collection suites under ParaTest.
@binaryfire

Copy link
Copy Markdown
Member Author

@coderabbitai @greptile-apps @qodo-free-for-open-source-projects

Fixed the collection analysis failure in 3ad6b7c. pad() annotations now include preserved string keys, with a type assertion for each collection boundary. PHPStan 2.2.14 is required for its corrected key-union inference. Its four verified false positives are suppressed only at the affected assignments, with no runtime changes.

We retained the existing all-mode tag cleanup behavior. Nonpositive touch() removes the value through forget(), consistently with the other deletion paths. The documented pruning command removes stale memberships, including those left by forever values. Both inline findings have replies explaining that tradeoff.

Full source and type-fixture analysis, formatting, manifest consistency checks and the affected collection suites pass locally. CodeRabbit found no additional code issues. The updated commit is now running through CI and the next review pass.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

@binaryfire Thanks for the detailed update. I will review the updated commit and its affected behavior.


✏️ Learnings added
Learnt from: binaryfire
URL: https://github.com/hypervel/components/pull/586

Timestamp: 2026-09-13T00:36:51.468Z
Learning: For this Hypervel codebase, collection `pad()` PHPDoc annotations must preserve string keys at collection boundaries. PHPStan 2.2.14 is required for corrected key-union inference. Verified PHPStan false positives may use narrowly scoped suppressions at the affected assignments when runtime behavior does not change.

Learnt from: binaryfire
URL: https://github.com/hypervel/components/pull/586

Timestamp: 2026-09-13T00:36:51.468Z
Learning: For Hypervel Redis all-mode tagged cache cleanup, nonpositive `touch()` lifetimes intentionally delete the value through `forget()` while stale tag memberships can remain. The documented pruning command removes stale memberships, including memberships left by forever values.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

Thanks for the clarification. The pad() key-union annotations, boundary assertions, and narrowly scoped PHPStan suppressions address the collection analysis concern without runtime changes. Retaining all-mode tag cleanup while routing nonpositive touch() values through forget() is also consistent with the stated deletion semantics, with stale forever memberships handled by pruning. No further action from my side.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

@coderabbitai @greptile-apps @qodo-free-for-open-source-projects

Fixed the collection analysis failure in 3ad6b7c. pad() annotations now include preserved string keys, with a type assertion for each collection boundary. PHPStan 2.2.14 is required for its corrected key-union inference. Its four verified false positives are suppressed only at the affected assignments, with no runtime changes.

We retained the existing all-mode tag cleanup behavior. Nonpositive touch() removes the value through forget(), consistently with the other deletion paths. The documented pruning command removes stale memberships, including those left by forever values. Both inline findings have replies explaining that tradeoff.

Full source and type-fixture analysis, formatting, manifest consistency checks and the affected collection suites pass locally. CodeRabbit found no additional code issues. The updated commit is now running through CI and the next review pass.

Thanks for the detailed update. The collection-analysis fixes, scoped suppressions, PHPStan requirement, and retained tag-cleanup behavior are noted. Since there are no active Qodo findings on this PR, no further action is needed from me; the next step is to review the CI results.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

Thanks for the update. The scoped collection-analysis fixes, PHPStan requirement, retained tag cleanup behavior, and validation results are noted. With no active findings remaining, I have no further action; CI results are the next checkpoint.

@binaryfire

Copy link
Copy Markdown
Member Author

@coderabbitai @greptile-apps @cubic-dev-ai @qodo-free-for-open-source-projects

The second review pass is complete. All CI tests and analysis checks pass on 3ad6b7c. No additional code changes were needed.

Qodo and Greptile withdrew the tag-cleanup findings after reviewing the existing deletion and pruning contract. Both inline threads have replies explaining the behavior. CodeRabbit's first review had no actionable findings; its second review was rate-limited, and Cubic was trial-limited.

The collection correction is committed and pushed. It fixes the pad() key annotations and handles the verified PHPStan diagnostics without changing runtime behavior.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@binaryfire Thanks for the update.

The reported validation on 3ad6b7c71 is consistent with the documented cache cleanup contract and the pad() PHPDoc correction. The first CodeRabbit review had no actionable findings. The second review did not complete because of rate limiting.


🧠 Learnings used
Learnt from: binaryfire
URL: https://github.com/hypervel/components/pull/586

Timestamp: 2026-09-13T00:36:51.558Z
Learning: For Hypervel Redis all-mode tagged cache cleanup, nonpositive `touch()` lifetimes intentionally delete the value through `forget()` while stale tag memberships can remain. The documented pruning command removes stale memberships, including memberships left by forever values.

Learnt from: binaryfire
URL: https://github.com/hypervel/components/pull/586

Timestamp: 2026-09-13T00:36:51.558Z
Learning: For this Hypervel codebase, collection `pad()` PHPDoc annotations must preserve string keys at collection boundaries. PHPStan 2.2.14 is required for corrected key-union inference. Verified PHPStan false positives may use narrowly scoped suppressions at the affected assignments when runtime behavior does not change.

You are interacting with an AI system.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

Thanks for the update. With CI and analysis passing on 3ad6b7c71, the collection annotation fix committed, and the tag-cleanup findings withdrawn after review, I have no additional findings or code changes to request.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

@coderabbitai @greptile-apps @cubic-dev-ai @qodo-free-for-open-source-projects

The second review pass is complete. All CI tests and analysis checks pass on 3ad6b7c. No additional code changes were needed.

Qodo and Greptile withdrew the tag-cleanup findings after reviewing the existing deletion and pruning contract. Both inline threads have replies explaining the behavior. CodeRabbit's first review had no actionable findings; its second review was rate-limited, and Cubic was trial-limited.

The collection correction is committed and pushed. It fixes the pad() key annotations and handles the verified PHPStan diagnostics without changing runtime behavior.

Thanks for the update. With CI and analysis checks passing on 3ad6b7c71, the tag-cleanup findings withdrawn, and the PHPStan annotation correction committed, I have no additional Qodo findings to report.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

Thanks for the update. With CI and analysis checks passing on 3ad6b7c71, the tag-cleanup findings withdrawn, and the PHPStan annotation correction committed, I have no additional findings to report.

@binaryfire
binaryfire merged commit 2be38c8 into 0.4 Sep 13, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant