Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dae2c73
fix(pipeline): reject undefined hub pipelines
binaryfire Jul 20, 2026
e7fbd73
fix(pipeline): isolate concrete builder resolutions
binaryfire Jul 20, 2026
a6bf0d2
test(pipeline): normalize the package test surface
binaryfire Jul 20, 2026
c42c451
fix(pipeline): declare the database dependency
binaryfire Jul 20, 2026
e335e72
test(pipeline): verify transaction connection routing
binaryfire Jul 20, 2026
bf81a6d
docs(pipeline): record the Laravel provenance
binaryfire Jul 20, 2026
8ccb70f
docs(audit): complete the Pipeline work unit
binaryfire Jul 20, 2026
a52b921
fix(bus): preserve unique job payload ownership
binaryfire Jul 20, 2026
5d34ed0
feat(bus): restore dispatcher and fake parity
binaryfire Jul 20, 2026
1304de6
fix(bus): harden batch lifecycle and repositories
binaryfire Jul 20, 2026
047500a
fix(bus): make debounce ownership atomic
binaryfire Jul 20, 2026
cecd10d
docs(bus): document dispatch and batch lifecycles
binaryfire Jul 20, 2026
49fd258
docs(audit): complete the bus lifecycle audit
binaryfire Jul 20, 2026
cd0d2fb
fix(core): harden stdout logger lifecycle
binaryfire Jul 20, 2026
1806bf4
fix(core): align native Swoole callback contracts
binaryfire Jul 20, 2026
621fe55
refactor(core): remove obsolete lifecycle surfaces
binaryfire Jul 20, 2026
137df56
chore(core): correct package metadata
binaryfire Jul 20, 2026
b244dc9
docs(core): document worker logging constraints
binaryfire Jul 20, 2026
5b295d0
docs(audit): complete the Core lifecycle audit
binaryfire Jul 20, 2026
99b080c
fix(bus): preserve bulk route boundaries
binaryfire Jul 20, 2026
3e66d28
test(testbench): correct dispatch test name
binaryfire Jul 20, 2026
b9929be
docs(audit): record collision-safe bulk routing
binaryfire Jul 20, 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

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions docs/plans/2026-07-12-framework-coroutine-state-lifecycle-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,9 @@ An exceptionally large shared work unit may receive its own linked detail plan w

This compact index routes the completed-work history that must be consulted with the full plan after compaction. Detailed history remains in the [companion ledger](2026-07-12-framework-coroutine-state-lifecycle-audit-ledger.md).

- **Active package or work unit:** `pipeline`
- **Ledger entries required for the active work:** `Normalize framework enum identifiers at string boundaries` (`support-02`).
- **Pending revalidation carried into the active work:** Revalidate `support-02` during the full Pipeline audit.
- **Active package or work unit:** `foundation`
- **Ledger entries required for the active work:** `Harden framework contracts and request-scoped state` (`view-01`); `Restore Conditionable proxy truthiness` (`testbench-01`); `Consolidate reflection metadata and correct callable inference` (`reflection-01`, `reflection-02`); `Preserve configuration identity across worker reloads` (`config-01`, `config-02`); `Correct explicit coroutine context targeting` (`context-01`, `context-04`); `Make coroutine creation and copied context failure-safe` (`coroutine-06`, `foundation-02`); `Make process concurrency transport lossless and reconstruct failures safely` (`concurrency-01`, `concurrency-03`); `Correct AOP proxy generation and publication` (`di-02`); `Harden filesystem I/O, streaming, and response teardown` (`http-02`, `filesystem-07`, `foundation-04`); `Correct event dispatch, queued-consumer isolation, and queue interoperability` (`events-01`, `events-04`, `events-06`, `foundation-01`); `Normalize framework enum identifiers at string boundaries` (`support-02`); `Harden encryption rotation, key publication, and global lifecycle state` (`encryption-03`); `Make custom server processes failure-safe` (`server-process-10`); `Make Bus dispatch, batches, and unique payloads lifecycle-safe` (`bus-03`, `bus-17`, `bus-18`); and `Harden Core lifecycle callbacks and stdout logging` (`core-01`, `core-05`).
- **Pending revalidation carried into the active work:** Revalidate `view-01`, `testbench-01`, `reflection-01`, `reflection-02`, `config-01`, `config-02`, `context-01`, `context-04`, `coroutine-06`, `foundation-02`, `concurrency-01`, `concurrency-03`, `di-02`, `http-02`, `filesystem-07`, `foundation-04`, `events-01`, `events-04`, `events-06`, `foundation-01`, `support-02`, `encryption-03`, `server-process-10`, `bus-03`, `bus-17`, `bus-18`, `core-01`, and `core-05` during the full Foundation audit.

Update these three lines when a package starts, completes, or gains a cross-package dependency. Name exact work-unit headings or shared finding IDs from the companion ledger; never use “see recent entries” or require a full-ledger reread.

Expand Down Expand Up @@ -1050,14 +1050,21 @@ Add one row only for a shared finding or changed lower-level assumption that ano
| `events-05` | `events`, `broadcasting` | later full `broadcasting` audit | `Correct event dispatch, queued-consumer isolation, and queue interoperability`; finding `events-05` |
| `events-06` | `events`, `foundation` | later full `foundation` audit | `Correct event dispatch, queued-consumer isolation, and queue interoperability`; finding `events-06` |
| `queue-11` | `queue` | `events` (revalidation complete), `broadcasting`; later full `queue` and `broadcasting` audits | `Correct event dispatch, queued-consumer isolation, and queue interoperability`; finding `queue-11` |
| `queue-12` | `bus`, `queue` | `events` (revalidation complete), `broadcasting`; later full `bus`, `queue`, and `broadcasting` audits | `Correct event dispatch, queued-consumer isolation, and queue interoperability`; finding `queue-12` |
| `queue-12` | `bus`, `queue` | `events` and `bus` (revalidation complete), `broadcasting`; later full `queue` and `broadcasting` audits | `Correct event dispatch, queued-consumer isolation, and queue interoperability`; finding `queue-12` |
| `foundation-01` | `foundation` | `support`; later full `foundation` and `support` audits | `Correct event dispatch, queued-consumer isolation, and queue interoperability`; finding `foundation-01` |
| `support-02` | `support` | `auth`, `broadcasting`, `bus`, `cache`, `concurrency`, `console`, `container`, `contracts`, `cookie`, `database`, `events`, `filesystem` (revalidation complete), `foundation`, `hashing` (revalidation complete), `horizon`, `inertia`, `jwt`, `log`, `mail`, `notifications`, `permission`, `pipeline`, `queue`, `redis`, `reverb`, `routing`, `sanctum`, `scout`, `session`, `socialite`, `telescope`, `testbench`, `translation`; later full consumer audits | `Normalize framework enum identifiers at string boundaries`; finding `support-02`; sibling findings `translation-01` and `reverb-03`; linked detail plan `2026-07-15-framework-enum-identifier-contracts.md` |
| `support-02` | `support` | `auth`, `broadcasting`, `bus` (revalidation complete), `cache`, `concurrency`, `console`, `container`, `contracts`, `cookie`, `database`, `events`, `filesystem` (revalidation complete), `foundation`, `hashing` (revalidation complete), `horizon`, `inertia`, `jwt`, `log`, `mail`, `notifications`, `permission`, `pipeline`, `queue`, `redis`, `reverb`, `routing`, `sanctum`, `scout`, `session`, `socialite`, `telescope`, `testbench`, `translation`; later full consumer audits | `Normalize framework enum identifiers at string boundaries`; finding `support-02`; sibling findings `translation-01` and `reverb-03`; linked detail plan `2026-07-15-framework-enum-identifier-contracts.md` |
| `auth-01` | `support`, `auth` | later full `auth` audit | `Correct Support utility boundaries and authentication timing isolation`; finding `auth-01` |
| `encryption-03` | `encryption` | `contracts`, `support`, and `filesystem` (revalidation complete), `foundation`; later full `foundation` audit | `Harden encryption rotation, key publication, and global lifecycle state`; finding `encryption-03` |
| `sanctum-01` | `sanctum` | `encryption`; later full `sanctum` audit | `Harden encryption rotation, key publication, and global lifecycle state`; finding `sanctum-01` |
| `process-02` | `process` | `concurrency` (revalidation complete) | `Make Process callbacks and pools failure-safe`; finding `process-02` |
| `server-process-10` | `server-process` | `foundation`; later full `foundation` audit | `Make custom server processes failure-safe`; finding `server-process-10` |
| `bus-03` | `bus`, `contracts`, `foundation` | `foundation`, `queue`; later full consumer audits | `Make Bus dispatch, batches, and unique payloads lifecycle-safe`; finding `bus-03` |
| `bus-10` | `bus`, `queue` | later full `queue` audit | `Make Bus dispatch, batches, and unique payloads lifecycle-safe`; finding `bus-10` |
| `bus-17` | `bus`, `foundation`, `queue`, `testing` | `log` (revalidation complete), `foundation`, `queue`, `testing`; later full consumer audits | `Make Bus dispatch, batches, and unique payloads lifecycle-safe`; finding `bus-17` |
| `bus-18` | `foundation`, `queue` | later full `foundation` and `queue` audits | `Make Bus dispatch, batches, and unique payloads lifecycle-safe`; finding `bus-18` |
| `core-01` | `core`, `foundation` | later full `foundation` audit | `Harden Core lifecycle callbacks and stdout logging`; finding `core-01` |
| `core-05` | `core`, `foundation` | later full `foundation` audit | `Harden Core lifecycle callbacks and stdout logging`; finding `core-05` |
| `core-06` | `core`, `server` | later full `server` audit | `Harden Core lifecycle callbacks and stdout logging`; finding `core-06` |

## Package checklist

Expand Down Expand Up @@ -1114,9 +1121,9 @@ The order is lower-level first where practical. Hypervel has cross-cutting depen

### Framework dispatch and runtime

- [ ] `pipeline`
- [ ] `bus`
- [ ] `core`
- [x] `pipeline`
- [x] `bus`
- [x] `core`
- [ ] `foundation`
- [ ] `console`
- [ ] `server`
Expand Down
2 changes: 2 additions & 0 deletions src/boost/docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ php artisan serve

By default, the HTTP server binds to `0.0.0.0:8000` with HTTP/2 enabled. You may configure the server host, port, worker count, max requests per worker, HTTP/2 support, and other Swoole settings using the `SERVER_HOST`, `SERVER_PORT`, `SERVER_WORKERS`, `SERVER_MAX_REQUESTS`, and `SERVER_HTTP2` environment variables read by `config/server.php`.

Swoole's `event_object` setting is not supported because Hypervel dispatches its own lifecycle event objects from the native server callbacks. Leave this setting disabled and use Hypervel's lifecycle events when integrating with server activity.

The `serve` command also accepts `--host` and `--port` options for overriding the HTTP server address for the current process. In production, prefer durable configuration in `config/server.php` and your environment.

<a name="directory-permissions"></a>
Expand Down
2 changes: 1 addition & 1 deletion src/boost/docs/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Hypervel's default logging configuration includes `stdout` and `stderr` channels

The `stdout` channel writes messages to `php://stdout`, while the `stderr` channel writes messages to `php://stderr`. You may customize their formatters using the `LOG_STDOUT_FORMATTER` and `LOG_STDERR_FORMATTER` environment variables.

Hypervel also uses a separate low-level stdout logger for server infrastructure such as connection pools, server lifecycle messages, and the response emitter. You may customize this logger's output format using the `STDOUT_LOG_FORMAT` environment variable. Supported values are `line` and `json`.
Hypervel also uses a separate low-level stdout logger for server infrastructure such as connection pools and server lifecycle messages. Configure its enabled levels using `app.stdout_log.level` and its output format using the `STDOUT_LOG_FORMAT` environment variable. Supported formats are `line` and `json`. Each worker loads these settings when it starts, so reload the server after changing them.

<a name="logging-deprecation-warnings"></a>
### Logging Deprecation Warnings
Expand Down
104 changes: 104 additions & 0 deletions src/boost/docs/queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
- [Dispatching Jobs](#dispatching-jobs)
- [Delayed Dispatching](#delayed-dispatching)
- [Synchronous Dispatching](#synchronous-dispatching)
- [Deferred Dispatching](#deferred-dispatching)
- [Bulk Dispatching](#bulk-dispatching)
- [Preparing Jobs Before Dispatch](#preparing-jobs-before-dispatch)
- [Jobs & Database Transactions](#jobs-and-database-transactions)
- [Job Chaining](#job-chaining)
- [Customizing The Queue and Connection](#customizing-the-queue-and-connection)
Expand All @@ -32,6 +35,7 @@
- [Chains and Batches](#chains-and-batches)
- [Adding Jobs to Batches](#adding-jobs-to-batches)
- [Inspecting Batches](#inspecting-batches)
- [Batch Events](#batch-events)
- [Cancelling Batches](#cancelling-batches)
- [Batch Failures](#batch-failures)
- [Pruning Batches](#pruning-batches)
Expand All @@ -56,6 +60,7 @@
- [Clearing Jobs From Queues](#clearing-jobs-from-queues)
- [Monitoring Your Queues](#monitoring-your-queues)
- [Testing](#testing)
- [Testing Bus Dispatches](#testing-bus-dispatches)
- [Faking a Subset of Jobs](#faking-a-subset-of-jobs)
- [Testing Job Chains](#testing-job-chains)
- [Testing Job Batches](#testing-job-batches)
Expand Down Expand Up @@ -1171,6 +1176,75 @@ RecordDelivery::dispatch($order)->onConnection('background');

The `background` and `deferred` drivers do not persist jobs to an external queue backend. Delayed jobs on these connections are scheduled with an in-memory timer and will be lost if the worker exits before the timer fires. Use a persistent queue connection such as `database`, `redis`, `sqs`, or `beanstalkd` for durable delayed work.

You may also chain `afterResponse` onto a dispatch to run the job synchronously when the current coroutine ends:

```php
ProcessPodcast::dispatch($podcast)->afterResponse();
```

The method accepts a boolean, which is useful when the choice is conditional. Passing `false` uses the job's normal dispatch path:

```php
ProcessPodcast::dispatch($podcast)->afterResponse($shouldDefer);
```

After-response dispatches use the synchronous connection and are not durable.

<a name="bulk-dispatching"></a>
### Bulk Dispatching

If you need to dispatch many independent jobs at once and do not need [batch](#job-batching) tracking or callbacks, you may use the `bulk` method of the `Bus` facade. Hypervel will group the jobs by their configured queue connection and queue name and push each group to the appropriate queue in bulk:

```php
use App\Jobs\ProcessUser;
use Hypervel\Support\Facades\Bus;

Bus::bulk(
$users->map(fn ($user) => new ProcessUser($user))
);
```

Bulk dispatch sends jobs directly to the selected queue driver and does not run the `PreparesForDispatch`, unique job, or debounce dispatch lifecycle. Dispatch jobs that use these features individually.

<a name="preparing-jobs-before-dispatch"></a>
### Preparing Jobs Before Dispatch

If a job needs to prepare or inspect its state before it is pushed onto the queue, the job may implement the `Hypervel\Contracts\Queue\PreparesForDispatch` interface. Hypervel will invoke the job's `prepareForDispatch` method before dispatching the job. If this method returns `false`, the job will not be dispatched; returning `true` or no value allows dispatch to continue:

```php
<?php

namespace App\Jobs;

use Hypervel\Contracts\Queue\PreparesForDispatch;
use Hypervel\Contracts\Queue\ShouldQueue;
use Hypervel\Foundation\Queue\Queueable;
use Hypervel\Support\Facades\Cache;

class SyncPodcasts implements PreparesForDispatch, ShouldQueue
{
use Queueable;

/**
* Create a new job instance.
*/
public function __construct(
public array $podcastIds,
) {
}

/**
* Prepare the job before dispatching.
*/
public function prepareForDispatch(): bool
{
return collect($this->podcastIds)
->reject(fn (int $id) => Cache::has("podcast-syncing:{$id}"))
->isNotEmpty();
}
}
```

<a name="jobs-and-database-transactions"></a>
### Jobs & Database Transactions

Expand Down Expand Up @@ -2217,6 +2291,11 @@ Route::get('/batch/{batchId}', function (string $batchId) {
});
```

<a name="batch-events"></a>
### Batch Events

Hypervel dispatches events as a batch moves through its lifecycle. You may listen for `BatchDispatched` after a batch is dispatched, `BatchStarted` when its first job is processed, `BatchFinished` when it is marked as finished, and `BatchCanceled` when it is canceled. Each event exposes the batch through its `$batch` property; `BatchCanceled` also exposes the exception that caused cancellation, when available.

<a name="cancelling-batches"></a>
### Cancelling Batches

Expand Down Expand Up @@ -3170,6 +3249,21 @@ Queue::assertClosurePushed(function (CallQueuedClosure $job) {
});
```

<a name="testing-bus-dispatches"></a>
### Testing Bus Dispatches

You may use the `Bus` facade to fake command and job dispatches. The `assertNothingDispatched` method checks normal, synchronous, and after-response dispatches:

```php
use Hypervel\Support\Facades\Bus;

Bus::fake();

// Perform the action under test...

Bus::assertNothingDispatched();
```

<a name="faking-a-subset-of-jobs"></a>
### Faking a Subset of Jobs

Expand Down Expand Up @@ -3328,6 +3422,16 @@ Bus::assertBatched(function (PendingBatch $batch) {
});
```

If you only need to assert the batch's jobs, you may pass the expected jobs directly:

```php
Bus::assertBatched([
new ProcessCsvRow(row: 1),
new ProcessCsvRow(row: 2),
new ProcessCsvRow(row: 3),
]);
```

The `hasJobs` method may be used on the pending batch to verify that the batch contains the expected jobs. The method accepts an array of job instances, class names, or closures:

```php
Expand Down
10 changes: 9 additions & 1 deletion src/bus/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
Bus for Hypervel
===

[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/hypervel/bus)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/hypervel/bus)

Ported from: https://github.com/laravel/framework/tree/13.x/src/Illuminate/Bus

## Differences From Laravel

Hypervel does not include Laravel's DynamoDB batch repository because DynamoDB is not a supported database backend.

`DatabaseBatchRepository::setConnection()` is intentionally omitted. The repository is shared for the worker lifetime, so mutating its connection would race across coroutines. Configure `queue.batching.database` instead; each repository operation resolves that connection when it runs.
Loading
Loading