Repository navigation
Release/v0.1.0 - #1
Merged
Merged
Conversation
Revised `README.md` to clarify the purpose and usage of the `develop` branch, emphasizing its role as the primary integration branch for ongoing development. Added PHPStan, PHPUnit, and Codecov badges for improved visibility of repository workflows. Updated references from `master` to `develop`, replaced outdated links, and removed non-essential community and support sections. Streamlined content to reflect the branch's intended audience: contributors and advanced users.
…ents This commit introduces the core implementation of the application kernel for the FireHub project, complete with lifecycle management features. Key updates include: - **`Application.php`**: Implements contract-driven lifecycle management for kernel states (creation, booting, termination) with support for bootstrappers and terminators. - **`composer.json`**: Adds dependencies for `the-firehub-project/runtime` and `the-firehub-project/core-standard`. - **Interfaces**: Defines contracts for bootstrappers and terminators, both globally and specifically for the application kernel. - **Exceptions**: Adds custom exception classes for invalid kernel states, boot failures, and shutdown errors. This establishes the functional foundation for managing kernel state transitions, enabling flexible component registration and robust error handling.
This commit introduces the following updates to enhance testing and structure around the application kernel: - **Unit Tests (`ApplicationTest.php`)**: Implements comprehensive tests to verify kernel lifecycle behaviors (state transitions, bootstrappers, terminators, and idempotency of operations). - **New Stubs**: Adds `BasicBootstrapper`, `BasicTerminator`, `EventBootTerm`, and `AppEventBootTerm` to simulate bootstrapper and terminator behavior for kernel tests. - **Exception Updates**: Improves documentation for `KernelBootException` and `KernelShutdownException`, clarifying their purposes. - **Lifecycle Behavior Enhancements**: Adjusts `Application` logic to uniformly handle exceptions using `Throwable` instead of specific exception types. These changes establish a robust testing foundation for the kernel lifecycle while improving clarity and extensibility of lifecycle-related components.
…te handling This update restructures the application kernel's lifecycle management for improved modularity and maintainability. Key changes: - **New Lifecycle Components**: Implements `Lifecycle`, `Controller`, and `Manager` classes to separate state transition logic from lifecycle operations. - **Unit Tests**: Replaces `ApplicationTest.php` with `LifecycleTest.php` and `ManagerTest.php` for component-specific testing, ensuring fine-grained validation of state transitions and execution order. - **Simplified Application**: Refactors `Application.php` to delegate lifecycle handling to `Controller`, reducing complexity and enhancing clarity. - **Removals**: Removes redundant initialization and termination methods, relying on `Manager` to handle bootstrapper and terminator execution. This refactor paves the way for scalable lifecycle extensions while preserving backward compatibility for existing integrations.
Updated the `composer.json` file to include additional dependencies: - **`ext-mbstring`**: Ensures multibyte string support is available for string operations. - **`the-firehub-project/foundation`**: Adds the Foundation package to align with ongoing kernel enhancements. These changes support compatibility and prepare the kernel for future extensions.
This commit introduces new components to manage application context and execution environments, as well as their associated tests: - **`Name.php`**: Adds an immutable, strongly-typed `Name` class for application identification. - **`Environment.php`**: Introduces an `Environment` enum to represent execution environments (production, staging, development, testing). - **`Context.php`**: Implements the `Context` class to encapsulate application metadata and environment in an immutable structure. Updates within the kernel integrate the `Context` component and provide a getter for application metadata. Other updates include: - Refactoring of lifecycle tests to align namespaces with related kernel classes. - New test classes for verifying application component behavior. These changes improve type safety, modularity, and testability of application metadata and environment management.
…fecycle Added new `Bootstrapper\Sequence` and `Terminator\Sequence` components to manage execution order of kernel lifecycle operations. Key updates include: - **`Bootstrapper\Sequence.php`** and **`Terminator\Sequence.php`**: Implement classes to manage registration and execution of bootstrappers and terminators in ascending order based on their defined execution order. - **Kernel Lifecycle Integration**: Updated `Lifecycle\Manager`, `Lifecycle\Controller`, and `Application` to leverage the new sequence components for orderly execution. - **Backward Compatibility**: Refactored lifecycle handling to use ordered sequences while preserving existing functionality and signatures (e.g., allowing default `order = 0` for consistent behavior). - **Bootstrapper and Terminator Execution**: Ensured that the system gracefully handles exceptions during sequence execution, either halting or propagating them as appropriate. These changes enhance the flexibility and reliability of lifecycle operations, ensuring predictable component execution while maintaining fault tolerance.
…nel lifecycle Enhanced unit tests across `Manager`, `Controller`, and `Application` to support and validate ordered execution of bootstrappers and terminators. Key updates include: - **Execution Order Support**: Modified test cases to register bootstrappers and terminators with explicit execution order, ensuring they execute in the expected sequence. - **New Test Scenarios**: Added `testInitializeUsesExecutionOrder` and `testTerminateUsesExecutionOrder` in `ManagerTest`, covering ascending and descending order handling. - **Default Order Validation**: Introduced `testDefaultExecutionOrder` in `ApplicationTest` to confirm backward compatibility with default (0) execution order. - **Refactored Registration**: Updated test bootstrapper and terminator registrations to include order parameters in multiple scenarios. These updates ensure correctness and reliability of the ordered execution mechanism while maintaining compatibility with existing functionality.
…ordering - Renamed `FAILED` state to `BOOT_FAILED` and introduced `SHUTDOWN_FAILED` for precise representation of lifecycle failure contexts. - Updated conditional checks in `fail()` and `beginShutdown()` to align with refined state transitions. - Enhanced sequence execution in `Manager`, `Controller`, and `Application` to ensure terminators and bootstrappers execute strictly based on their configured execution order. - Refined lifecycle documentation to clarify shutdown behaviors, failure states, and component order handling across multiple classes. These changes provide cleaner state handling, predictable execution order for lifecycle components, and clearer documentation for maintainers.
Updated the `Manager` class to be explicitly marked as `readonly`, ensuring all properties within the class remain immutable once initialized. This change reinforces strict immutability principles and aligns with best practices for maintaining predictable state in lifecycle components.
Revised the assertion in `LifecycleTest` to validate the newly renamed `BOOT_FAILED` state, replacing the outdated `FAILED` state. This update ensures test consistency with recent changes to lifecycle state definitions and improves clarity in failure scenarios.
…lication context Revised kernel implementation to remove the `Application` namespace and entirely decouple lifecycle management from application-specific components. Key changes include: - **Eliminated `Application` Components**: Removed `Bootstrapper`, `Context`, `Environment`, `Name`, and `Terminator` classes, simplifying kernel functionality. - **Renamed `Application` to `Kernel`**: Updated the main class to focus solely on kernel lifecycle, removing dependency on the application context. - **Simplified Lifecycle Logic**: Refactored bootstrapper and terminator registration to exclude `Application` qualifiers, reducing complexity and improving clarity. - **Namespace Adjustments**: Consolidated relevant kernel lifecycle contracts under the `Kernel` namespace instead of `Kernel\Application`. This update streamlines the kernel by focusing on its core functionality, removing unnecessary dependencies while preserving backward compatibility for lifecycle executions.
… lifecycle tests Replaced outdated application-focused kernel stubs (`AppEventBootTerm`, `EventBootTerm`) and unit tests (`ApplicationContextTest`) with new sequence-based tests for bootstrappers and terminators. Key updates: - **Removed Stubs and Tests**: Removed application-specific stubs and `ApplicationContextTest` to align with the decoupled kernel lifecycle. - **Sequence Tests**: Added comprehensive unit tests (`SequenceTest`, `ManagerTest`) to validate the ordered execution of bootstrappers and terminators. - **Test Enhancements**: Updated `LifecycleTest` with new scenarios for invalid transitions, lifecycle completion, and failure handling, ensuring compatibility with sequence-based execution. This commit simplifies the testing structure, focusing on kernel lifecycle behavior and emphasizing ordered component execution.
Updated the PHPDoc for `Lifecycle`, `Controller`, and `Manager` classes to include the `@internal` annotation, indicating these classes are intended for internal use only within the kernel package. This change helps prevent unintended usage outside the intended scope and reinforces clear boundaries for maintainers and contributors.
…tting Reordered "the-firehub-project/runtime" and other dependencies in multiple composer.json files across Kernel, Container, and Advanced-DataStructures-Capability directories to ensure consistent dependency order. No functional changes introduced.
Replaced `Bootstrapper\Sequence` and `Terminator\Sequence` with a unified, generic lifecycle engine (`Lifecycle\Engine`) and state mappings (`Lifecycle\States`). Key updates: - **Engine and State Management**: Introduced `Lifecycle\Engine` for reusable lifecycle execution across startup and shutdown phases, leveraging state mappings in `States`. - **New Exceptions**: Added `LifecycleExecutionException`, `InvalidLifecycleStateException`, and `DistinctEnumCaseException` under the `Lifecycle\Exception` namespace for granular error handling. - **State Transitions**: Defined distinct lifecycle states for initialization and cleanup phases using enumeration-based state validation. - **Simplified Controller Logic**: Refactored `Lifecycle\Controller` to delegate state transitions and execution handling to the `Engine` while preserving kernel-specific behaviors. - **Backward Compatibility**: Registered kernel bootstrappers and terminators as callbacks in the engine to maintain compatibility with existing contracts. These changes improve lifecycle maintainability, decouple kernel lifecycle phases, and introduce robust error handling and state transitions.
…ling Refactored the `Engine` class by removing the unused and unnecessary `storage` property, along with its associated anonymous class. Key updates: - **Lifecycle Simplification**: Streamlined the constructor by directly assigning the initial state without wrapping it in an intermediary object. - **Documentation Updates**: Removed the `@internal` annotation from `Engine` and added it to `Controller` for consistency with intended usage restrictions. These changes reduce complexity in the `Engine` implementation and align annotations with proper internal usage scopes.
Introduced support for declarative lifecycle dependency handling to enable better orchestration of parent-child lifecycle relationships. Key updates: - **New `Dependency` Classes**: Added `Lease`, `Registry`, and `Boundary` to manage lifecycle dependencies, enabling active tracking and safe termination of parent lifecycles. - **Dependency Constraints**: Prevented lifecycle termination while active dependencies exist, introducing `ActiveLifecycleDependenciesException` for enforcement. - **Parent Lifecycle Leasing**: Enabled dependent lifecycles to acquire and release parent lifecycle ties using the `Boundary` class, ensuring proper resource ownership. - **API Enhancements**: Added `dependencyBoundary()` in `Engine`, `Kernel`, and `Controller` for exposing dependency boundaries to clients. - **Simplified State Transitions**: Removed the `transition()` helper to streamline lifecycle state changes, directly updating states where applicable. These changes provide a robust dependency model, streamlining parent-child orchestration and improving lifecycle management safety and extensibility.
…imports Simplified code by removing the unused `isReleased()` method from the `Lease` class and cleaning up related comments in the `Engine`. Updated `Kernel` to streamline `use` statements by collapsing multi-line imports. These changes enhance code readability and maintainability without altering functionality.
…tion support Revised `Engine` to streamline lifecycle state management and allow flexible operation execution. Key updates: - **State Simplification**: Replaced the `States` wrapper with direct enumeration-based state handling, reducing constructor complexity. - **New Execution Method**: Added `execute()` in `Engine` to handle state validation, transitions, and callbacks with support for parent dependencies and dependent lifecycle checks. - **Dependency API Enhancements**: Updated `dependencyBoundary()` to include state-based availability checks. - **Parent Lifecycle Logic**: Consolidated parent lifecycle lease acquisition and release logic into dedicated methods. - **Operation Safeguards**: Introduced guards to prevent concurrent operations and ensure registration remains immutable after execution starts. Adjusted `Controller` to adopt these changes, leveraging the unified `execute()` method for managing kernel startup and shutdown. These enhancements improve code clarity, maintainability, and lifecycle orchestration accuracy.
…erState` stub Deleted the outdated sequence and lifecycle unit tests (`Kernel/tests/Unit/Bootstrapper/SequenceTest.php`, `Kernel/tests/Unit/Terminator/SequenceTest.php`, `Kernel/tests/Unit/LifecycleTest.php`) to reduce redundant coverage and align the test suite with the latest architecture changes. Added a lightweight `AnotherState` stub (`Kernel/tests/Stubs/AnotherState.php`) for validating alternative lifecycle state scenarios. Updated `ManagerTest` for streamlined startup/shutdown methods, ensuring alignment with revised lifecycle execution logic.
…clarity Enhanced the PHPDoc in the `Kernel` class by embedding inline usage examples for lifecycle methods (`registerBootstrapper`, `registerTerminator`, `boot`, `shutdown`, `state`) to improve developer understanding of their usage. These examples demonstrate proper method invocation and sequence within a kernel lifecycle, providing practical guidance for integration. No functional changes introduced.
Introduced two new functionalities in `Application`: 1. `dependencyBoundary()`: Provides lifecycle dependency boundary access, enabling dependent runtimes during the application's initialized state. 2. `execute(Closure $callback)`: Allows executing operations within an isolated dependency injection scope while maintaining lifecycle dependency to prevent disposal during execution. Enhanced lifecycle management and isolation ensures safer runtime operations and promotes better dependency control. Removed internal marker from `Boundary` class to make it accessible.
dieselxxx
marked this pull request as ready for review
October 21, 2026 08:43
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔖 Release Pull Request
Version
v0.1.0Related Branches
Description
Alpha release
Release Overview
Pre-release Verification
Testing & Validation
System Validation
Release Readiness
Versioning
Semantic Versioning compliance:
Tagging:
v0.1.0will be createdDeployment
Target environment:
Deployment notes:
Checklist
CHANGELOG.mdupdatedREADME.mdupdated (if needed)Risks / Impact
Potential Risks
Breaking changes:
Deployment risks:
Rollback considerations:
Notes
Release Notes
Deployment Instructions
Known Issues