Skip to content

Introduce foundation architectural support - #14

Draft
dieselxxx wants to merge 7 commits into
developfrom
architecture/foundation-support
Draft

Introduce foundation architectural support#14
dieselxxx wants to merge 7 commits into
developfrom
architecture/foundation-support

Conversation

@dieselxxx

Copy link
Copy Markdown
Contributor

… introduce Core/Foundation concepts

Details:

  • Updated all badge links, URLs, and branch references in README.md to align with the new architecture/foundation-support # 🧱 System Design / Architecture Pull Request

Related Issue

Description

  • Define the architectural support required for the FireHub Foundation layer by introducing Core-level contracts for high-level abstractions.

  • Establish the system boundary between Core, Runtime, and Foundation:

    • Core defines stable architectural contracts.
    • Foundation provides high-level developer-facing implementations.
    • Runtime provides low-level execution primitives.
    • Applications consume Foundation APIs without depending on internal execution details.
  • This architecture is required to prevent Core components from depending directly on Foundation implementations while still allowing Core Value Objects, contracts, and framework components to reference fundamental high-level concepts.

  • The decision ensures that FireHub maintains a clean dependency direction:
    Application

    Foundation

    Core Contracts

    Runtime

Affected Components

Core

  • Introduces minimal contracts required by Foundation components.
  • Defines the architectural truth for fundamental abstractions.
  • Remains free from implementation details and high-level API logic.

Runtime

  • Remains responsible for low-level execution and native operation wrappers.
  • Provides implementation primitives used by Foundation.
  • Does not depend on Foundation.

Foundation

  • Implements Core contracts.
  • Provides rich, object-oriented APIs for developers.
  • Becomes the primary high-level API layer of the FireHub ecosystem.

Adapter

  • No direct impact.
  • May consume Foundation APIs where integration logic requires higher-level abstractions.

Capability

  • No direct impact.
  • Future capabilities may depend on Core contracts or Foundation APIs depending on their responsibility.

Architectural Rule

Core contracts MUST define only the minimum required behavior of an abstraction.

High-level APIs, fluent methods, transformations, and developer conveniences MUST remain in Foundation.

This separation allows FireHub to evolve Core, Runtime, and Foundation independently while preserving a stable architectural foundation.

Architecture Overview

System Design

  • Describe the architecture being introduced or enforced:
    • Core structure:
    • Contracts:
    • Boundaries:
    • Dependencies:

Design Decisions

  • Key architectural decisions made:
    • ...
  • Why these decisions were chosen:
    • ...
  • Rejected alternatives (if applicable):
    • ...

System Boundaries

Included

  • What is part of this architecture:
    • ...

Excluded

  • What is explicitly NOT part of this architecture:
    • Runtime logic
    • Infrastructure concerns (if applicable)
    • Adapters / external integrations (if applicable)

Implementation

Core Changes

  • Files / modules introduced or modified:
    • ...

Contracts

  • New or updated Core contracts:
    • ValueObjects:
    • Exceptions:
    • Interfaces:

Dependencies

  • New dependencies introduced:
    • ...
  • Impact on existing packages:
    • core-standard
    • core-professional
    • core-enterprise

Validation

Architecture Compliance

  • Matches defined Architecture issue
  • No violation of Core / Runtime separation
  • No unintended business logic introduced
  • No infrastructure logic inside Core

Build & Stability

  • Project builds successfully
  • No breaking changes (or properly documented)
  • Backward compatibility considered

Impact Analysis

Core Impact

  • Impact on Core contracts:
    • ...

Runtime Impact

  • Required runtime changes:
    • ...

Future Extensions

  • How this architecture enables future development:
    • ...

Risks / Constraints

Risk Level

  • None
  • Low
  • Medium
  • High

Potential Risks

  • Architecture lock-in:
    • ...
  • Breaking changes for downstream packages:
    • ...
  • Over-abstraction risks:
    • ...

Documentation

  • Architecture documented in repository / docs
  • Design decisions explained
  • Examples provided (if applicable)
  • Migration notes are added (if needed)

Checklist

  • Architecture issue linked
  • System boundaries are clearly defined
  • Core/Runtime separation respected
  • No experimental or temporary code included
  • Implementation matches architectural design
  • Reviewed for long-term maintainability

Notes

Technical Notes

  • ...

Future Work

  • Feature issues derived from this architecture:
    • ...

Reviewer Guidance

  • Focus on:
    • architectural correctness
    • boundary enforcement
    • long-term scalability

… introduce Core/Foundation concepts

**Details:**
- Updated all badge links, URLs, and branch references in `README.md` to align with the new `architecture/foundation-support` branch.
- Introduced detailed descriptions of Core/Foundation architectural layers, including dependency direction and separation of development responsibilities (Core → Foundation → Runtime).
- Added milestones and pull request metadata to improve visibility of ongoing development efforts.
- Expanded documentation to clarify goals for the Core layer: define stable architectural contracts while delegating developer-facing APIs to the Foundation layer.
- Removed outdated or redundant sections for improved clarity and relevance.

This update improves the consistency, readability, and alignment of the README with the FireHub project's evolving architecture and development practices.
@dieselxxx dieselxxx added the type: Architecture Represent changes that define, enforce, or modify the structural design of the FireHub ecosystem. label Jul 28, 2026
@dieselxxx dieselxxx moved this from Backlog to Draft in 📌 Core Development: v0 → v1 Jul 28, 2026
@dieselxxx dieselxxx moved this from Todo to Done in 🚩 Triage Jul 28, 2026
@dieselxxx dieselxxx linked an issue Jul 28, 2026 that may be closed by this pull request
2 tasks
@dieselxxx dieselxxx removed a link to an issue Jul 28, 2026
2 tasks
@dieselxxx dieselxxx linked an issue Jul 28, 2026 that may be closed by this pull request
2 tasks
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Type/StringValue.php 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@dieselxxx dieselxxx changed the title Update README to reflect architecture/foundation-support branch and… Introduce foundation architectural support Jul 28, 2026
@dieselxxx dieselxxx added this to the Development v1 milestone Jul 28, 2026
**Details:**
- Introduced an abstract `Str` class in `Core-Standard/src/Type/Str.php` to define the foundational string-based Value Object type within the FireHub ecosystem.
- Implements immutable string value semantics while serving as the base for domain-specific string extensions in higher-level layers (e.g., Foundation).
- Provides a clear contract for string handling with its abstract `value(): string` method.
- Aligns with the Core layer's goal of ensuring stable architectural contracts and PHP compatibility (`>=8.2`).

This addition enhances the modularity and type safety of Core string operations, ensuring future extensibility and clear separation of responsibilities.
…h encoding support

**Details:**
- Added `Str::encoding()` and `Str::withEncoding()` methods in `Core-Standard/src/Type/Str.php` to provide string encoding introspection and mutation via an `Encoding` value object. Improves versatility for handling internationalization and character encoding scenarios.
- Updated `ValueObject::equals()` in `Core-Standard/src/Type/ValueObject.php` to utilize `comparisonValue()` for equality checks, ensuring consistency in comparison logic across all Value Object subclasses.
- Introduced protected `comparisonValue()` method in `ValueObject` to centralize comparison logic by delegating to the underlying value representation.
- Adjusted `@uses` annotations in `ValueObject` doc comments for better clarity and alignment with new comparison logic.

These updates enhance both the flexibility of the `Str` class for encoding management and the reliability of `ValueObject` comparison semantics, contributing to a more robust Core layer architecture.
**Details:**
- Extended `Str` base Value Object to implement PHP's native `Stringable` interface, ensuring compatibility with type hints requiring `Stringable` in PHP `>=8.0`.
- Introduced the `__toString()` method in `Str` to provide a native string representation of its value. This method utilizes `value()` for consistent output.
- Updated class imports and doc comments to reflect the addition of the `Stringable` dependency and enhanced functionality.

These changes enhance the interoperability of the `Str` class with both internal and external PHP components, improving compatibility and usability within the FireHub ecosystem.
…d `Char` type

**Details:**
- Extracted encoding-aware functionality from `Str` into a new `StringValue` abstract class in `Core-Standard/src/Type/StringValue.php`, preserving the immutable string value semantics.
- Updated `Str` in `Core-Standard/src/Type/Str.php` to extend `StringValue`, simplifying its structure for domain-specific usage and aligning with Core's modular architecture.
- Added `Char` abstract class in `Core-Standard/src/Type/Char.php` to define the base for character-based Value Objects. Ensures support for handling single characters with encoding awareness.
- Updated class hierarchy to establish clear separation of concerns between general `StringValue` contracts and domain-specific `Str` and `Char` implementations.

These changes enhance the modularity and extensibility of the Core layer, simplifying future extensions and reinforcing separation of architectural responsibilities.
…ar` objects

**Details:**
- Introduced an abstract `toChars(): array` method in the `Str` class within `Core-Standard/src/Type/Str.php`.
- Provides a mechanism to split the immutable string value into a list of `Char<non-empty-string>` objects.
- Enhances the extensibility of the `Str` class for character-level operations, aligning with the FireHub ecosystem's focus on modularity and type safety.

This update lays the groundwork for fine-grained string manipulations, improving support for encoding-aware scenarios and future extensions.
**Details:**
- Introduced an abstract `Boolean` class in `Core-Standard/src/Type/Boolean.php` to define the foundational boolean-based Value Object type within the FireHub ecosystem.
- Implements immutable boolean value semantics while serving as the base for domain-specific boolean extensions in higher-level layers (e.g., Foundation).
- Provides a clear contract for boolean handling with its abstract `value(): bool` method.
- Aligns with the Core layer's focus on defining stable architectural contracts and PHP type safety (`>=8.2`).

This addition strengthens the modularity, type safety, and extensibility of the Core layer, ensuring clarity and consistency for boolean-related operations within the FireHub project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Architecture Represent changes that define, enforce, or modify the structural design of the FireHub ecosystem.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Foundation Support

2 participants