Skip to content

Modernize PHP error handling with FastForward integration and fire tests - #3

Open
coisa wants to merge 4 commits into
masterfrom
codex/error-handler-fire-tests
Open

coisa wants to merge 4 commits into
masterfrom
codex/error-handler-fire-tests

Conversation

@coisa

@coisa coisa commented Sep 15, 2026

Copy link
Copy Markdown
Owner

The previous release could report an uncaught exception and still exit successfully, accumulate shutdown callbacks when re-registered, and retry a failing reporter. This change reproduces and fixes those failures, then adds a service provider following FastForward's current callable definitions so applications can adopt the library through their container.

The unreleased next major targets PHP 8.3–8.5. It includes current Composer tooling, lowest/highest dependency CI, bounded fire tests, English API/migration/testing guides, static Pages documentation and weekly Dependabot updates. The existing coisa/error-handler package and CoiSA\ErrorHandler namespace remain current; a possible future move to php-fast-forward has not been performed.

The provider implements Interop\Container\ServiceProviderInterface and reuses the existing PSR-11 factories. Resolving services never registers PHP callbacks. A process-handler alias and reusable factory services keep middleware handlers independent from the cached process service. FastForward remains optional at runtime; only the small Interop interface package is a new runtime dependency.

The tested application wiring merges library definitions first and application definitions last in one AggregateServiceProvider. This prevents an explicitly required reporter's PSR construction failure from falling back to the silent default. FastForward may still translate the cause to not-found; the contract promises failed construction, not preservation of the original exception. Integration guide and runnable example use this composition.

AGENTS.md and the portable coisa-error-handler skill explain the actual public APIs, process/HTTP scopes, private reporting, fresh factories and verification. The skill retains its Composer package identity and public source link when copied into another project. No global skill installation is required.

Current head: 75137ca20aa825c6816b4c0b686a4a46fbd04003; PR base: f7284cdf9bda3fadfe33f107d2c0fed3e38962cd. Full local runtime evidence below was recorded at 8646c73971ef9c6024048202a508cbb66960a274. The later five-file skill identity/documentation change received separate independent approval; runtime, dependencies and workflows are unchanged. Current-head CI passed separately.

Acceptance Executed evidence
Complete local validation PHP 8.5.10: 118 tests / 196 assertions, maximum PHPStan, PSR formatting, Composer validation, 27 bounded failure scenarios and three loopback HTTP responses
Real FastForward integration Container 1.6.0; 18 focused cases / 52 assertions covering reporter overrides, optional discovery, PSR-14 dispatch, custom callbacks, nested middleware and renderer failure
Required reporter failure Four silent-fallback cases reproduced before changing composition; all six PSR/not-found/application-error regressions pass with valid HTTP dependencies and merged definitions
Executable examples and production dependencies Provider example exits 0 with exact expected stdout and empty stderr; existing CLI example asserts failure exit 1; an isolated production-only installation loads core and 13 provider definitions without FastForward
Independent review and skill behavior Approved matching runtime/provider content for all 18 files; bounded forward-tests exercise private reporting, nested HTTP, uncaught exit 1 and renderer failure. The five-file package naming delta was independently approved; skill metadata, 27 references and exact provider-example output pass
CI Run 35043605725 passed all five PHP jobs on the current head: 8.3 lowest/highest, 8.4 highest and 8.5 locked/highest, including both examples and production-only autoload. DCO and Mergeable also passed

The baseline fire-test results and earlier platform evidence remain in the testing contract. Migration guidance covers exit status 1 for uncaught exceptions, reverse-order unregistration, reporter failure handling and redacted HTTP responses.

Limits: FPM, Apache, Windows, concurrent request runtimes, arbitrary OOM recovery and remote logger delivery require application-specific validation. PHP callbacks are process-wide. Renderers must balance removable buffers and must not close caller-owned buffers. Pages publication is manual and restricted to master; no merge, release, transfer or deployment is included.

Closes #2.

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T01:25:59.001242Z 75137ca New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
@coisa coisa changed the title Modernize for PHP 8.3–8.5 with fire tests and documentation Modernize PHP error handling with FastForward integration and fire tests Sep 16, 2026
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
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.

Modernize PHP support and prove failure handling with isolated tests

1 participant