Skip to content

Commit f70b9ab

Browse files
committed
Merge branch '0.4' into feature/improve-doctor
2 parents 0e48dd2 + 5cca620 commit f70b9ab

249 files changed

Lines changed: 1429 additions & 614 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Build complete, long-term solutions, not MVPs or local workarounds. A broad chan
233233
These rules apply to all code, including ported code.
234234

235235
- **Laravel-style config files** — Group related settings under Laravel's standard section comment blocks, with concise, user-facing explanations.
236-
- Always use typed getters for values with one non-null type. Only use `get()` when null, union, or mixed values are meaningful. Add a test for any supported null behavior.
236+
- Choose the getter from the setting's supported values. Use the matching nullable getter for one type plus null. Reserve `get()` for unions no getter covers, arbitrary values, or diagnostics that inspect malformed input. Omit the getter's default for a required key and supply an explicit default (including null) when omission is allowed. Add a test for supported null behavior.
237237
- Cast environment-backed booleans and numbers in config files; if `null` is supported, cast only non-null values. Consumers must not repeat those casts. When a factory accepts raw configuration records, normalize types and documented optional defaults once at that boundary; never supply missing required members.
238238
- Required settings live in shipped config and must not have a code-level fallback, so missing or misspelled keys fail loudly.
239239
- Intentionally optional settings keep one owning fallback and remain discoverable in config or feature documentation. Document what omission or null means.
@@ -771,6 +771,8 @@ See the existing entries for database, Redis, Meilisearch, and Typesense as exam
771771

772772
Components is analyzed with its own `hypervel/phpstan` extension. [Static Analysis](src/docs/static-analysis.md#fixing-and-ignoring-diagnostics) is the source of truth for each diagnostic's intended fix and legitimate exceptions; the rules below add Components-specific requirements.
773773

774+
Components enables `noUntypedConfigReads` in production analysis. When no typed getter covers the accepted values or a diagnostic must inspect malformed input, keep the generic read and add a local `@phpstan-ignore hypervel.untypedConfigRead (reason)` explaining that contract.
775+
774776
**Keep `hypervel/phpstan` evolving** — Codify framework contracts and useful conventions. Prefer a simple framework fix when it prevents the mistake. Add rules for mistakes likely to recur in packages or apps, even when existing cases are already fixed. Check each proposed rule against real mistakes and realistic correct usage. Reject rules that flag correct code or need a growing list of exceptions to avoid doing so. Keep inference limits explicit. Reach peer consensus, then seek owner approval for a new rule. If an existing rule flags correct code, fix the analyzer and leave the correct code alone.
775777

776778
The main PHPStan configuration excludes `tests/`. Use `composer analyse:tests` for test-only rules.

‎composer.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"hypervel/guzzle-promises": "^3.1",
6464
"laravel/agent-detector": "^2.0.5",
6565
"laravel/serializable-closure": "^2.0.11",
66-
"lcobucci/jwt": "^5.6",
66+
"lcobucci/jwt": "^5.7",
6767
"league/commonmark": "^2.10.3",
6868
"league/flysystem": "^3.25.1",
6969
"league/flysystem-aws-s3-v3": "^3.25.1",
@@ -135,6 +135,7 @@
135135
"mockery/mockery": "^1.6.15",
136136
"opis/json-schema": "^2.6.0",
137137
"pda/pheanstalk": "^8.0.2",
138+
"phpstan/extension-installer": "^1.4.3",
138139
"phpstan/phpstan": "^2.3.6",
139140
"phpstan/phpstan-deprecation-rules": "^2.0.5",
140141
"phpunit/phpunit": "~13.4.3",
@@ -403,7 +404,8 @@
403404
"config": {
404405
"allow-plugins": {
405406
"php-http/discovery": true,
406-
"tbachert/spi": true
407+
"tbachert/spi": true,
408+
"phpstan/extension-installer": false
407409
},
408410
"sort-packages": true,
409411
"policy": {

‎docs/plans/2026-11-23-0439-nullable-configuration-getters.md‎

Lines changed: 111 additions & 0 deletions
Large diffs are not rendered by default.

‎docs/todo.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Release preparation
44

5-
- Before releasing Hypervel 0.4, ensure every split repository has a current `0.4` branch and a Packagist entry. Create the missing `hypervel/attributes`, `hypervel/workbench` and `hypervel/sentinel` repositories and registrations; Horizon and Telescope require Sentinel. Check these prerequisites before running `bin/release.sh`, which pushes the main repository's tag before checking out the component branches.
5+
- Before releasing Hypervel 0.4, ensure every split repository has a current `0.4` branch and a Packagist entry. Ensure the split job can access `hypervel/attributes`, `hypervel/phpstan`, and `hypervel/schema-parser`. The release script publishes the component tags before pushing the framework tag.
66
- Once the 0.4 splits are published, verify a full Composer installation of the `hypervel/hypervel` skeleton, re-enable its manually disabled `tests` workflow, and confirm the first CI run passes.
77
- Replace `psy/psysh` `dev-main` in the root and `src/tinker` manifests with the first stable release containing PsySH #951–#954. The latest stable release, v0.12.24, predates those changes.
88

‎phpstan.neon.dist‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ includes:
1010
parameters:
1111
tmpDir: .cache/phpstan
1212
level: 5
13+
noUntypedConfigReads: true
1314
parallel:
1415
jobSize: 20
1516
maximumNumberOfProcesses: 32

‎skeletons/hypervel/config/queue.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
|
185185
| Batches are stored in the database. Choose the database or Redis
186186
| driver to record the results of individual jobs in each batch.
187+
| Set "database" to null to use the default database connection.
187188
|
188189
*/
189190

‎skeletons/hypervel/resources/views/welcome.blade.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<title>{{ config('app.name', 'Hypervel') }}</title>
7+
<title>{{ config()->string('app.name') }}</title>
88

99
@fonts
1010

‎skeletons/react-starter-kit/config/queue.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
|
185185
| Batches are stored in the database. Choose the database or Redis
186186
| driver to record the results of individual jobs in each batch.
187+
| Set "database" to null to use the default database connection.
187188
|
188189
*/
189190

‎src/ai/src/AiManager.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ protected function ensureProviderSupports(string $contract, string $capability,
635635
*/
636636
public function getDefaultInstance(): string
637637
{
638+
// @phpstan-ignore hypervel.untypedConfigRead (The default provider may be a provider name or a Lab enum.)
638639
$default = $this->config->get('ai.default');
639640

640641
if ($default instanceof Lab) {
@@ -665,7 +666,7 @@ public function setDefaultInstance(string $name): void
665666
public function getInstanceConfig(string $name): array
666667
{
667668
$providers = CoroutineContext::get(self::ON_DEMAND_PROVIDERS_CONTEXT_KEY, []);
668-
$config = $providers[$name]['config'] ?? $this->config->get('ai.providers.' . $name);
669+
$config = $providers[$name]['config'] ?? $this->config->nullableArray('ai.providers.' . $name, null);
669670

670671
if ($config === null && str_starts_with($name, 'ondemand_')) {
671672
throw new InvalidArgumentException("On-demand provider [{$name}] was not built in this operation. Build it where the work runs, such as the agent's provider() method.");

‎src/ai/src/AiServiceProvider.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AiServiceProvider extends ServiceProvider
3535
public function register(): void
3636
{
3737
$this->app->singleton(ConversationStore::class, fn (): DatabaseConversationStore => new DatabaseConversationStore(
38-
config('ai.conversations.connection'),
38+
config()->nullableString('ai.conversations.connection', null),
3939
));
4040

4141
$this->mergeConfigFrom(__DIR__ . '/../config/ai.php', 'ai');

0 commit comments

Comments
 (0)