Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c1db6bc
Add test suite lifecycle robustness plan
binaryfire Jul 11, 2026
014e2ea
Make coroutine creation failures explicit
binaryfire Jul 12, 2026
602b9c2
Balance concurrent work when coroutine creation fails
binaryfire Jul 12, 2026
3f79c25
Handle coroutine exhaustion in connection health checks
binaryfire Jul 12, 2026
d43ef83
Harden Engine socket lifecycle
binaryfire Jul 12, 2026
b7d41f2
Return a controlled response on HTTP coroutine exhaustion
binaryfire Jul 12, 2026
2fe8e82
Make signal watcher registration transactional
binaryfire Jul 12, 2026
cf5883e
Own Redis subscriber background work transactionally
binaryfire Jul 12, 2026
1735480
Restore prompt state when animation startup fails
binaryfire Jul 12, 2026
56006c2
Resume worker exit coordination synchronously
binaryfire Jul 12, 2026
e69e14e
Make coordinator timers lifecycle safe
binaryfire Jul 12, 2026
f5a849c
Make coroutine test teardown exhaustive
binaryfire Jul 12, 2026
b1e34b2
Make test cleanup ownership explicit
binaryfire Jul 12, 2026
481c5fd
Harden pool ownership transitions
binaryfire Jul 12, 2026
3c06dcc
Retain pooled wrappers for testing database connections
binaryfire Jul 12, 2026
fc19cac
Make queue worker lifecycle explicitly owned
binaryfire Jul 12, 2026
104635a
Protect Horizon child process control
binaryfire Jul 12, 2026
ffe0635
Bound Horizon persistence and termination
binaryfire Jul 12, 2026
80eb497
Bound Swoole table lock acquisition
binaryfire Jul 12, 2026
f6b727c
Make Reverb Redis startup transactional
binaryfire Jul 12, 2026
69e9aa5
Keep compiled route caches collection local
binaryfire Jul 12, 2026
b6ff7eb
Isolate programmatic console execution from CLI globals
binaryfire Jul 12, 2026
380e978
Make polling watcher drivers own one lifecycle
binaryfire Jul 12, 2026
99deff1
Preserve framed filesystem watcher output
binaryfire Jul 12, 2026
383f1de
Make watcher teardown observable and bounded
binaryfire Jul 12, 2026
41851c1
Bound cache concurrency test IPC
binaryfire Jul 12, 2026
725a182
Own asynchronous integration test resources
binaryfire Jul 12, 2026
9e0bfbe
Add exhaustive test cleanup actions
binaryfire Jul 12, 2026
7c6aa85
Propagate resolved cache paths to subprocesses
binaryfire Jul 12, 2026
84111be
Make Testbench file owners restore exhaustively
binaryfire Jul 12, 2026
ca89c47
Verify Testbench process incarnation before cleanup
binaryfire Jul 12, 2026
ccc9418
Define empty pool frequency samples
binaryfire Jul 12, 2026
ba8cfee
Document asynchronous test ownership
binaryfire Jul 12, 2026
b06bd62
Honor the queue worker monitor interval
binaryfire Jul 12, 2026
5698f65
Honor filesystem read failures
binaryfire Jul 12, 2026
49b64a9
Make Testbench runtime creation transactional
binaryfire Jul 12, 2026
3041e50
Terminate forked test children on every exit path
binaryfire Jul 12, 2026
c61e1d9
Preserve test cleanup failure ordering
binaryfire Jul 12, 2026
0b3fdcc
Harden process restart lifecycle events
binaryfire Jul 12, 2026
88b864e
Tighten lifecycle regression tests
binaryfire Jul 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ Examples: `tests/Inertia/CoroutineIsolationTest.php`, `tests/Container/Coroutine

#### Static State and Test Cleanup

`AfterEachTestSubscriber` handles global cleanup between tests. It calls `flushState()` on framework classes that hold static state, and resets the container itself — `Container::flushState()` + `setInstance(null)` — plus `CoroutineContext::flush()`, with each test in a fresh coroutine. So container singleton/auto-singleton instance state and coroutine context don't leak between tests; only `static`/process-global state and live external resources need package cleanup, not mutable state on a container-cached instance. **Never add cleanup in `tearDown()`** — it's handled. `AfterEachTestSubscriber` is the one authoritative registry; don't register cleanup elsewhere.
`AfterEachTestSubscriber` handles framework-global cleanup between tests. It calls `flushState()` on framework classes that hold static state, and resets the container itself — `Container::flushState()` + `setInstance(null)` — plus `CoroutineContext::flush()`, with each test in a fresh coroutine. So container singleton/auto-singleton instance state and coroutine context don't leak between tests; only `static`/process-global state and live external resources need package cleanup, not mutable state on a container-cached instance. Do not duplicate framework-static resets in `tearDown()`; `AfterEachTestSubscriber` is their one authoritative registry. Tests still own resources they create, such as child coroutines, subscribers, processes, sockets, and temporary files, and must close or join them through exception-safe cleanup.

When porting source classes that use static properties for caching (e.g., `$booted`, `$globalScopes`, resolved config values, compiled formats):
1. Add a `public static function flushState(): void` method that resets the static properties to their initial values
Expand Down Expand Up @@ -627,7 +627,11 @@ A per-package base class is only justified when there is shared setUp logic —

**Always import as `m`:** Use `use Mockery as m;` and call `m::mock()`, `m::spy()`, etc. Never use the full `Mockery::` prefix.

**Never add `Mockery::close()` to tearDown.** It's handled globally by `AfterEachTestSubscriber` for all tests.
Framework base test cases own Mockery verification in `tearDown()` so unmet
expectations are attributed to the test that created them. The global
`AfterEachTestSubscriber` remains a fallback for tests using another base case
and always resets framework state even when Mockery verification fails. Tests
must not add their own `Mockery::close()` calls.

#### Docblocks and Types

Expand Down
2 changes: 0 additions & 2 deletions docs/ai/differences-vs-laravel.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,3 @@ Hypervel caches more aggressively than Laravel: any class resolved via `make()`
- `setUp()` / `tearDown()` run outside the test's coroutine. Use `setUpInCoroutine()` / `tearDownInCoroutine()` for code that must run inside it.
- Request and Response are coroutine-local. The `'request'` and `Hypervel\Http\Response::class` container bindings are `bind()` closures that read from `RequestContext` / `ResponseContext`. The Laravel pattern `$this->app->instance('request', $r)` (or `instance(Response::class, $r)`) doesn't apply — it overrides the closure with a worker-global value and bypasses the production resolution path. Use `RequestContext::set($r)` / `ResponseContext::set($r)` instead.
- After seeding via `RequestContext::set(...)`, `request()->merge([...])` works as in Laravel. Without seeding, each `request()` call returns a throwaway, so `merge()` is lost.
- Don't add `Mockery::close()` to `tearDown()` — handled globally.

6 changes: 2 additions & 4 deletions docs/plans/2026-07-01-fortify-passkeys-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

> Superseded note: the Fortify password broker inference described in this historical plan was later removed by `2026-07-06-auth-guard-declared-password-brokers.md`. Guards now declare password brokers with `auth.guards.{guard}.passwords`; `Fortify::passwordBrokerName()` no longer exists.

Date: 2026-07-01
## Scope

Author: Codex

Scope: port Laravel Fortify and Laravel Passkeys Server into the Hypervel components monorepo, with Swoole coroutine safety, worker-lifetime performance, clean Hypervel-native APIs, full tests, and updated Boost documentation.
Port Laravel Fortify and Laravel Passkeys Server into the Hypervel components monorepo, with Swoole coroutine safety, worker-lifetime performance, clean Hypervel-native APIs, full tests, and updated Boost documentation.

## Source Material Reviewed

Expand Down
6 changes: 2 additions & 4 deletions docs/plans/2026-07-03-fortify-otphp-chillerlan-refactor.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Fortify OTPHP And Chillerlan Refactor Plan

Date: 2026-07-03
## Scope

Author: Codex

Scope: refactor Hypervel Fortify two-factor authentication to use `spomky-labs/otphp` for TOTP and `chillerlan/php-qrcode` for QR SVG generation, while preserving Fortify's public API shape and making the final codebase read as if it was designed this way from the start.
Refactor Hypervel Fortify two-factor authentication to use `spomky-labs/otphp` for TOTP and `chillerlan/php-qrcode` for QR SVG generation, while preserving Fortify's public API shape and making the final codebase read as if it was designed this way from the start.

## Goal

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Testing After Each Cleanup Registrars Plan

Date: 2026-07-04
## Scope

Author: Codex

Scope: make Hypervel's after-each test cleanup extensible for apps and packages while keeping framework cleanup centralized, deterministic, and independent of application boot.
Make Hypervel's after-each test cleanup extensible for apps and packages while keeping framework cleanup centralized, deterministic, and independent of application boot.

## Goal

Expand Down
Loading