Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
67d2296
Use Monolog’s rotated-file finder for log retention
binaryfire Nov 29, 2026
1431bf7
Keep literal directories separate from filesystem glob patterns
binaryfire Nov 29, 2026
2b87afd
Bound numeric string length before validation arithmetic
binaryfire Nov 29, 2026
cea5da5
Document MariaDB 10.11.6 as the minimum supported version
binaryfire Nov 29, 2026
6ee26b0
Close the numeric validation and conversation query investigations
binaryfire Nov 29, 2026
731001c
Exercise the broadcast facade against a live Reverb server
binaryfire Nov 29, 2026
3c68c93
Test concurrent SMTP delivery against Mailpit in framework CI
binaryfire Nov 29, 2026
e6fbb05
Prepare fresh parallel databases for matching Testbench requirements
binaryfire Nov 29, 2026
8bf8c27
Merge branch '0.4' into framework/todo
binaryfire Nov 29, 2026
d39666a
Share one Excimer sampler across Sentry transaction profiles
binaryfire Nov 30, 2026
6dcfb43
Merge commit '170fd33146186ffa7b484ebe5a664ccd497c0a18' into framewor…
binaryfire Nov 30, 2026
9645f7f
Merge branch '0.4' into framework/todo
binaryfire Nov 30, 2026
780e05c
Clarify which column can identify rows for a write
binaryfire Nov 30, 2026
a94f74b
Allow the Saloon OAuth account model only when account caching is ena…
binaryfire Nov 30, 2026
a78ea11
Merge branch '0.4' into framework/todo
binaryfire Nov 30, 2026
c9e4017
Use built-in validation rule defaults when a callback returns null
binaryfire Nov 30, 2026
4eb2d78
Prepare copied worker database connections before checking their version
binaryfire Nov 30, 2026
f798087
Propagate cancellation during log writes and rotation
binaryfire Nov 30, 2026
3f60beb
Keep the selected checkout paths in the Sentry benchmark
binaryfire Nov 30, 2026
ed746d5
Require MariaDB patch releases with correct mixed UUID lookups
binaryfire Nov 30, 2026
2fd020a
Match the server before preparing a named parallel test database
binaryfire Nov 30, 2026
2f2c31d
Recognize equivalent server settings during parallel database setup
binaryfire Nov 30, 2026
a20e887
Preserve cancellation when pruning nested log directories
binaryfire Nov 30, 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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
# integration tests serially against database 0 on a local Cluster.
# REDIS_CLUSTER_HOSTS_AND_PORTS=127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002

# Mailpit Integration Tests
# Uncomment MAILPIT_HOST to run SMTP delivery tests against Mailpit.
# MAILPIT_HOST=127.0.0.1
# MAILPIT_SMTP_PORT=1025
# MAILPIT_HTTP_PORT=8025

# Mercure Integration Tests
# Uncomment MERCURE_URL to opt into real-hub broadcasting tests.
# Configure the hub with matching keys, issuer, cookie name, subscriptions,
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ jobs:
container:
image: ghcr.io/hypervel/components-ci:php${{ matrix.php }}-swoole-nightly

services:
mailpit:
image: axllent/mailpit:v1.34.0

steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
Expand All @@ -69,6 +73,8 @@ jobs:
run: COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o

- name: Run framework test suite
env:
MAILPIT_HOST: mailpit
run: vendor/bin/paratest -c phpunit.xml.dist

- name: Run Permission suite with the database cache store
Expand Down
14 changes: 2 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,25 +734,15 @@ For service suites outside the directory conventions above, register new test di

#### External service test traits

Integration tests that use an external service must use that service's test trait.

| Trait | Service | Key Env Vars |
|-------|---------|-------------|
| `InteractsWithRedis` | Redis / Redis Cluster / Valkey | `REDIS_HOST`, `REDIS_PORT`, `REDIS_CLUSTER_HOSTS_AND_PORTS` |
| `InteractsWithMeilisearch` | Meilisearch | `MEILISEARCH_HOST`, `MEILISEARCH_PORT`, `MEILISEARCH_KEY` |
| `InteractsWithTypesense` | Typesense | `TYPESENSE_HOST`, `TYPESENSE_PORT`, `TYPESENSE_API_KEY`, `TYPESENSE_PROTOCOL` |
| `InteractsWithAlgolia` | Algolia | `ALGOLIA_APP_ID`, `ALGOLIA_SECRET` |
| `InteractsWithServer` | Engine test servers (HTTP, TCP, WebSocket, HTTP/2) | `TEST_SERVER_HOST` |

This applies whether the test calls the service directly or reaches it through the package code under test.
Integration tests that use an external service, directly or through the code under test, must use the trait listed for it under [External Service Tests](src/docs/testing.md#external-service-tests).

These traits are required for external-service tests to work under ParaTest. Parallel workers share external services unless the trait isolates them. Tests that bypass the trait will leak state across workers and fail depending on timing.

The traits handle service-specific setup and cleanup. For example, `InteractsWithRedis` assigns each ParaTest worker its own Redis database and flushes it before and after each test. Redis Cluster only supports database zero, so Cluster suites run serially and flush that database between tests. Both approaches isolate the test keyspace without changing the Redis behavior being tested.

If a service is not configured, the trait skips the test before connecting. If the service is configured but unreachable or misconfigured, the test fails.

When adding integration tests for a new service type that has no trait yet, create one following this same pattern (per-worker isolation, skip-when-unconfigured, fail-when-unreachable).
If the service has no trait yet, create one following this pattern and add it to [External Service Tests](src/docs/testing.md#external-service-tests).

#### phpunit.xml.dist

Expand Down
8 changes: 5 additions & 3 deletions bin/sync-skeleton-config/sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
use RuntimeException;
use Throwable;

use function Hypervel\Filesystem\glob_quote;

require dirname(__DIR__, 2) . '/vendor/autoload.php';

class SkeletonConfigSync
Expand All @@ -43,7 +45,7 @@ public function run(string $root, bool $check): int

$sources = [];

foreach (glob($root . '/src/foundation/config/*.php') as $path) {
foreach (glob(glob_quote($root) . '/src/foundation/config/*.php') as $path) {
$sources[basename($path)] = file_get_contents($path);
}

Expand Down Expand Up @@ -88,7 +90,7 @@ public function run(string $root, bool $check): int
$this->validateKeys($options, ['files', 'preserve'], $skeleton);
$files = $options['files'] ?? [];
$preserved = $options['preserve'] ?? [];
$existing = array_map('basename', glob($root . "/skeletons/{$skeleton}/config/*.php"));
$existing = array_map('basename', glob(glob_quote($root . '/skeletons/' . $skeleton) . '/config/*.php'));

foreach ($preserved as $name) {
if (array_key_exists($name, $sources)) {
Expand Down Expand Up @@ -142,7 +144,7 @@ public function run(string $root, bool $check): int

// This directory contains only generated overrides. Removed rules must not
// leave obsolete stubs that config:publish would continue to prefer.
foreach (glob($root . '/src/foundation/config-stubs/*.php') as $path) {
foreach (glob(glob_quote($root) . '/src/foundation/config-stubs/*.php') as $path) {
$relative = 'src/foundation/config-stubs/' . basename($path);

if (! array_key_exists($relative, $expected)) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"league/flysystem-read-only": "^3.25.1",
"league/oauth2-server": "^9.4",
"league/uri": "^7.6",
"monolog/monolog": "^3.10",
"monolog/monolog": "^3.13",
"nesbot/carbon": "^3.13.1",
"nikic/php-parser": "^5.7",
"nunomaduro/termwind": "^2.0",
Expand Down
9 changes: 0 additions & 9 deletions docs/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
- Add native return types to the `test*` methods that lack them: about 5,600 methods in 490 files. `AGENTS.md` requires `: void` on test methods; a test that returns a value for `#[Depends]` takes its actual return type instead. Make the change as one approved sweep and add an automated check for missing test method return types.
- Integrate the resolution of [PHPUnit #7039](https://github.com/sebastianbergmann/phpunit/issues/7039) into `RunTestsInCoroutine` once PHPUnit 13.5 is released ([scheduled for December 4, 2026](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-13.5.md)); it adds `TestCase::suspendOutputBuffering()` and `resumeOutputBuffering()` ([PR #7040](https://github.com/sebastianbergmann/phpunit/pull/7040)). Follow the merged upstream design, including calling `parent::invokeTestMethod()` if capture is handled there. Add regression coverage for output expectations, flushed output and buffer cleanup; update the testing guidance and reassess output-related coroutine opt-outs. Lift the `~13.4.3` PHPUnit constraints in the root, Testbench and dogfood manifests, the testing package's suggestion and the `hypervel/hypervel` skeleton once Testbench's PHPUnit integration is verified on 13.5. Do not add a private-buffer adapter, maintained fork or ongoing Composer/vendor patches. Prefer supported subclass or method overrides; use AOP only as an absolute last resort. Never document a confirmed defect as an accepted limitation.

## AI and MCP

- Revisit conversation-history query plans when production evidence or newer database versions warrant it; this does not block the AI port. Reproduce with the stock migration, one oldest conversation containing 10,000 messages, then 999 other participants/conversations with 20 newer messages each. After updating statistics, inspect actual execution of `DatabaseConversationStore::latestConversationId()`, `getLatestConversationMessages(..., 100)` and the first/subsequent cursor pages. MySQL 9.5 and PostgreSQL chose reverse primary-key scans, examining 20,080 rows for 100 messages despite `(conversation_id, id)` being available; smaller targets at roughly 1% of the table used conversation indexes and did not scan other conversations. MariaDB 10.11 read history efficiently but filtered cursor IDs after seeking only the conversation, scanning preceding pages within it; SQLite 3.45 used both index bounds. The query shape matches Laravel's. Selecting IDs first, including through a bounded subquery joined back to messages, did not fix the MySQL/PostgreSQL plans. Include the similar latest-row queries in `pendingApprovalsFor()` and `pausedRowFor()` when investigating; their execution plans have not been measured. Test an index-derived scalar upper bound on message IDs with both oldest-only and interleaved conversations. A stored pointer needs maintenance across all supported writes; a stale low pointer would hide messages. Keep current queries and indexes unless a measured improvement preserves other workloads, configured/partitioned schemas and pagination behavior without unnecessary round trips or database-specific machinery.

## HTTP Client

- When a Swoole HTTP transport is available, compare it with cURL under concurrent Inertia SSR requests to a local server through the `inertia-ssr` connection.
Expand All @@ -42,13 +38,8 @@

- Port `spatie/typescript-transformer` as a general first-party Hypervel package, then add an optional Hypervel Data adapter that recognizes data classes and their existing mapping, Optional, lazy, and collection metadata. Keep TypeScript generation outside `hypervel/data`: the transformer must also support ordinary PHP classes and enums without making runtime data construction depend on filesystem discovery or code generation.

## Validation

- Adopt Brick Math 0.20's bounded parsing API for untrusted numeric validation inputs once the supported dependency graph permits it. Ramsey UUID currently limits Brick Math to 0.18, which has neither bounded parsing nor 0.20's parser-backtracking fix, so an intermediate upgrade would not address this issue. Preserve the configurable exponent-range behavior and cover delegated and compiled rules, oversized mantissas and exponents, malformed input, and `multiple_of`; do not add a local parsing workaround or disguise an incompatible Brick version with a Composer alias.

## Sentry

- Once a released Excimer includes `ExcimerProfiler::setSampleFilter()` ([Excimer change 1354126](https://gerrit.wikimedia.org/r/c/mediawiki/php/excimer/+/1354126)), compare native filtering with the transaction collector under concurrent load. Preserve request context ownership, idle intervals and SDK drop reporting.
- Once a Sentry PHP SDK release includes [sentry-php #2420](https://github.com/getsentry/sentry-php/pull/2420), require that release and register `Coroutine::causedByCancellation(...)` with `SentrySdk::setCancellationDetector()` in `SentryServiceProvider`. Verify that cancellation during a Sentry callback reaches the calling coroutine.

## Notifications
Expand Down
4 changes: 3 additions & 1 deletion src/ai/src/Tools/LoadSkill.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Stringable;
use Symfony\Component\Finder\SplFileInfo;

use function Hypervel\Filesystem\glob_quote;

class LoadSkill implements Tool, Transient
{
/**
Expand Down Expand Up @@ -224,7 +226,7 @@ protected function discover(string $directory): Collection
return new Collection(static::$discoveredSkills[$directory]);
}

$skills = collect(glob($directory . '/*/SKILL.md') ?: [])
$skills = collect(glob(glob_quote($directory) . '/*/SKILL.md') ?: [])
->map(fn (string $file): ?Skill => Skill::fromDirectory(dirname($file)))
->filter();

Expand Down
3 changes: 2 additions & 1 deletion src/console/src/MigrationGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Hypervel\Filesystem\Filesystem;
use RuntimeException;

use function Hypervel\Filesystem\glob_quote;
use function Hypervel\Filesystem\join_paths;

abstract class MigrationGeneratorCommand extends Command
Expand Down Expand Up @@ -92,7 +93,7 @@ protected function createBaseMigration(string $table, ?string $stubPath = null):
protected function migrationExists(string $table): bool
{
return $this->matchingMigrationFiles(
join_paths($this->hypervel->databasePath('migrations'), '*_*_*_*_create_' . $table . '_table.php')
join_paths(glob_quote($this->hypervel->databasePath('migrations')), '*_*_*_*_create_' . glob_quote($table) . '_table.php')
) !== [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"require": {
"php": "^8.4",
"hypervel/attributes": "^0.4",
"monolog/monolog": "^3.10",
"monolog/monolog": "^3.13",
"nesbot/carbon": "^3.13.1",
"psr/container": "^2.0.1",
"psr/http-message": "^2.0",
Expand Down
32 changes: 27 additions & 5 deletions src/database/src/Console/Migrations/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use RuntimeException;
use Throwable;

use function Hypervel\Filesystem\glob_quote_prefix;

abstract class BaseCommand extends Command
{
/**
Expand All @@ -33,19 +35,39 @@ protected function getMigrationPaths(): array
// use the path relative to the root of the installation folder so our database
// migrations may be run for any customized path from within the application.
if ($this->input->hasOption('path') && $this->option('path')) {
return (new Collection($this->option('path')))->map(function ($path) {
return ! $this->usingRealPath()
? $this->hypervel->basePath() . '/' . $path
: $path;
return (new Collection($this->option('path')))->flatMap(function ($path) {
if ($this->usingRealPath()) {
return [$path];
}

$base = $this->hypervel->basePath();

return $this->resolveMigrationPath($base . '/' . $path, $base);
})->all();
}

return array_merge(
$this->migrator->paths(),
[$this->getMigrationPath()]
$this->resolveMigrationPath($this->getMigrationPath(), $this->hypervel->databasePath(), $this->hypervel->basePath())
);
}

/**
* Expand a directory pattern when its application root needs quoting.
*
* @return string[]
*/
private function resolveMigrationPath(string $path, string ...$roots): array
{
$pattern = glob_quote_prefix($path, ...$roots);

if ($pattern === $path || str_ends_with($path, '.php') || is_dir($path)) {
return [$path];
}

return glob($pattern, GLOB_ONLYDIR) ?: [];
}

/**
* Determine if the given path(s) are pre-resolved "real" paths.
*/
Expand Down
6 changes: 4 additions & 2 deletions src/database/src/Migrations/MigrationCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use InvalidArgumentException;
use RuntimeException;

use function Hypervel\Filesystem\glob_quote;

class MigrationCreator
{
protected const string CURRENT_MIGRATION_PATH_CONTEXT_KEY_PREFIX = '__database.migration_creator.current_path.';
Expand Down Expand Up @@ -75,7 +77,7 @@ public function create(string $name, string $path, ?string $table = null, bool $
protected function ensureMigrationDoesntAlreadyExist(string $name, ?string $migrationPath = null): void
{
if (! empty($migrationPath)) {
$migrationFiles = $this->matchingFiles($migrationPath . '/*.php');
$migrationFiles = $this->matchingFiles(glob_quote($migrationPath) . '/*.php');

foreach ($migrationFiles as $migrationFile) {
$this->files->requireOnce($migrationFile);
Expand Down Expand Up @@ -199,7 +201,7 @@ protected function getDatePrefix(): string

$date = Date::now();

while ($this->matchingFiles($path . '/' . $date->format('Y_m_d_His') . '_*.php')) {
while ($this->matchingFiles(glob_quote($path) . '/' . $date->format('Y_m_d_His') . '_*.php')) {
$date = $date->addSecond();
}

Expand Down
10 changes: 9 additions & 1 deletion src/database/src/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
use Throwable;
use WeakReference;

use function Hypervel\Filesystem\glob_quote;

class Migrator
{
protected const string STATE_CONTEXT_KEY_PREFIX = '__database.migrator.';
Expand Down Expand Up @@ -633,7 +635,13 @@ protected function getMigrationClass(string $migrationName): string
public function getMigrationFiles(array|string $paths): array
{
return (new Collection($paths))
->flatMap(fn ($path) => str_ends_with($path, '.php') ? [$path] : $this->files->glob($path . '/*_*.php'))
->flatMap(function (string $path) {
if (str_ends_with($path, '.php')) {
return [$path];
}

return $this->files->glob((is_dir($path) ? glob_quote($path) : $path) . '/*_*.php');
})
->filter()
->values()
->keyBy(fn ($file) => $this->getMigrationName($file))
Expand Down
3 changes: 2 additions & 1 deletion src/database/src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5490,7 +5490,8 @@ public function getGrammar(): Grammar
}

/**
* Identify rows for limited or joined updates and deletes on SQLite tables without a rowid.
* Set the unique, non-null column that identifies rows for limited or joined SQLite writes.
* Joined mass pruning on MySQL and MariaDB also uses this column in place of the model's primary key.
*
* @return $this
*/
Expand Down
4 changes: 3 additions & 1 deletion src/di/src/Aop/ProxyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use InvalidArgumentException;
use Throwable;

use function Hypervel\Filesystem\glob_quote;

class ProxyManager
{
private const string FINGERPRINT_HEADER = '// Hypervel AOP fingerprint: ';
Expand Down Expand Up @@ -255,7 +257,7 @@ private function aopSourceFingerprint(): string
{
$sources = [];

foreach (glob(__DIR__ . '/*.php') as $path) {
foreach (glob(glob_quote(__DIR__) . '/*.php') as $path) {
$sources[basename($path)] = $this->filesystem->get($path);
}

Expand Down
4 changes: 2 additions & 2 deletions src/docs/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Use `array` for request-local test and scratch data. Use `worker-array` only whe
<a name="serializable-cached-objects"></a>
### Serializable Cached Objects

Hypervel applies one global class policy to PHP-serialized cache values. By default, `serializable_classes` is `false`, so PHP may instantiate only classes contributed by framework, package, and application providers. Auth and Sanctum contribute their configured root models and Hypervel contributes the standard Eloquent collection and pivot classes they use.
Hypervel applies one global class policy to PHP-serialized cache values. By default, `serializable_classes` is `false`, so PHP may instantiate only classes contributed by framework, package, and application providers. When their caching is enabled, Auth and Sanctum contribute their configured root models and the standard Eloquent collection and pivot classes they use.

Set this option to an array to add application-owned classes, or to `null` / `true` to allow every class:

Expand All @@ -97,7 +97,7 @@ Set this option to an array to add application-owned classes, or to `null` / `tr
],
```

You should generally list only the application-owned classes your cached values require. Allowing every class permits any class named in a cached value to be instantiated when the value is read.
You should generally list only the application-owned classes your cached values require. Allowing every class permits any class named in a cached value to be instantiated when the value is read. Even with an allowlist, only trusted code should be able to write to your cache.

Packages and applications may contribute classes lazily from a service provider's `boot` method. Contributions are combined with the configured array in registration order, and duplicates are removed:

Expand Down
2 changes: 1 addition & 1 deletion src/docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Almost every modern web application interacts with a database. Hypervel makes in

<div class="content-list" markdown="1">

- MariaDB 10.11+ ([Version Policy](https://mariadb.org/about/#maintenance-policy))
- MariaDB 10.11.11+ on 10.11, 11.4.5+ on 11.4, or a newer maintained series ([Version Policy](https://mariadb.org/about/#maintenance-policy))
- MySQL 5.7+ ([Version Policy](https://en.wikipedia.org/wiki/MySQL#Release_history))
- PostgreSQL 10.0+ ([Version Policy](https://www.postgresql.org/support/versioning/))
- SQLite 3.32.0+
Expand Down
Loading
Loading