Skip to content

feat!: add strict recipe execution and application-scoped tag configuration without new global mutable state.#100

Merged
terabytesoftw merged 2 commits into
mainfrom
feat/add-strict-recipe-execution
Jul 22, 2026
Merged

feat!: add strict recipe execution and application-scoped tag configuration without new global mutable state.#100
terabytesoftw merged 2 commits into
mainfrom
feat/add-strict-recipe-execution

Conversation

@terabytesoftw

Copy link
Copy Markdown
Contributor

Pull Request

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bugfix (non-breaking change that fixes an issue)
  • CI/build configuration
  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional changes)

@terabytesoftw terabytesoftw added the enhancement New feature or request label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@terabytesoftw, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8764fbd1-76e0-4737-963e-a545c641f119

📥 Commits

Reviewing files that changed from the base of the PR and between 26394c6 and c3d12bf.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/Base/BaseTag.php
  • src/Config/Config.php
📝 Walkthrough

Walkthrough

The PR replaces global factory defaults with application-scoped configuration recipes, adds strict recipe execution and validation, applies theme recipes during component creation, centralizes Fiber-aware stack storage, and updates tests, documentation, and migration guidance.

Changes

Recipe configuration

Layer / File(s) Summary
Recipe execution and failure handling
src/Config/*, src/Exception/*, src/Theme/ThemeInterface.php, src/Config/Recipe.php
ConfigApplier executes cookbook calls with reflection, strict validation, and wrapped ConfigException failures. Config::create() now applies resolved recipes.
Application-scoped tag integration
src/Base/BaseTag.php, tests/Base/BaseTagTest.php, tests/Config/ConfigTest.php, tests/Support/Stub/ConfigApplier.php
BaseTag::config() applies per-instance recipes before fluent overrides and rejects incompatible returned components.
Global defaults removal and configuration filtering
src/Factory/SimpleFactory.php, tests/Factory/SimpleFactoryTest.php, tests/Element/*Test.php
Global defaults storage and accessors are removed; non-string configuration actions are ignored and related tests are updated.
Fiber-aware render context storage
src/Element/BaseBlock.php, tests/Element/TagBlockTest.php
WeakMap stack access is centralized and tested across Fiber contexts.
Recipe execution validation fixtures
tests/Config/ConfigApplierTest.php, tests/Support/Stub/ConfigurableComponent.php, tests/Support/Stub/ExtendedComponent.php
Tests cover ordering, arguments, subclass returns, strict and non-strict behavior, unavailable methods, invalid returns, and exception wrapping.
Release and migration documentation
README.md, UPGRADE.md, CHANGELOG.md, composer.json
Documentation and package metadata describe application-scoped recipes, strict naming, and removal of global defaults.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • ui-awesome/html-core#99: Introduces overlapping immutable configuration contracts for themes, recipes, and component factories.

Poem

A bunny found recipes, neatly arranged,
No global cupboard could leave things estranged.
Calls hop in order, strict rules stand tall,
Local tags choose what overrides all.
Fibers keep stacks in their own little lane—
Configured carrots for every domain!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.23% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the breaking change around strict recipe execution and application-scoped tag configuration.
Description check ✅ Passed The description is related to the change and correctly marks it as a breaking change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-strict-recipe-execution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@terabytesoftw

Copy link
Copy Markdown
Contributor Author

@codex review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Config/Config.php (1)

58-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Propagated ConfigException is undocumented at both config-application entry points. ConfigApplierInterface::apply() can throw ConfigException in strict mode, but neither call-chain layer's docblock reflects that.

  • src/Config/Config.php#L58-L81: add @throws ConfigException If a resolved recipe cannot be applied to the created component. to create()'s docblock (and consider the same for apply(), since it delegates to the same applier).
  • src/Base/BaseTag.php#L145-L180: extend config()'s @throws ConfigException to also cover failures propagated from $config->apply(), not just the local incompatible-component case.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Config/Config.php` around lines 58 - 81, Document propagated
ConfigException at both entry points: in src/Config/Config.php lines 58-81, add
it to create() and the delegating apply() docblocks as applicable, describing
failures applying resolved recipes; in src/Base/BaseTag.php lines 145-180,
update config()’s `@throws` ConfigException description to include exceptions
propagated from $config->apply(), while retaining the existing
incompatible-component case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 11: Release the breaking removal of SimpleFactory defaults APIs as
version 0.7.0: move the entry in CHANGELOG.md at lines 11-11 under the 0.7.0
release section, and rename the migration section in UPGRADE.md at lines 3-20 to
0.7.0.

In `@tests/Element/TagBlockTest.php`:
- Around line 143-180: Update testMaintainsIndependentBeginEndStackForFiber to
capture the existing BaseBlock::$stack and $mainThread values before resetting
them, then restore both values in a finally block surrounding the test setup and
assertions. Preserve the current Fiber behavior and assertions while ensuring
cleanup runs when any step fails.

---

Outside diff comments:
In `@src/Config/Config.php`:
- Around line 58-81: Document propagated ConfigException at both entry points:
in src/Config/Config.php lines 58-81, add it to create() and the delegating
apply() docblocks as applicable, describing failures applying resolved recipes;
in src/Base/BaseTag.php lines 145-180, update config()’s `@throws` ConfigException
description to include exceptions propagated from $config->apply(), while
retaining the existing incompatible-component case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1bc953be-58cc-4b89-80ef-58b7d2f7aa96

📥 Commits

Reviewing files that changed from the base of the PR and between c1f9ba9 and 26394c6.

⛔ Files ignored due to path filters (2)
  • docs/svgs/features-mobile.svg is excluded by !**/*.svg
  • docs/svgs/features.svg is excluded by !**/*.svg
📒 Files selected for processing (25)
  • CHANGELOG.md
  • README.md
  • UPGRADE.md
  • composer.json
  • src/Base/BaseTag.php
  • src/Config/Config.php
  • src/Config/ConfigApplier.php
  • src/Config/ConfigApplierInterface.php
  • src/Config/Recipe.php
  • src/Element/BaseBlock.php
  • src/Exception/ConfigException.php
  • src/Exception/Message.php
  • src/Factory/SimpleFactory.php
  • src/Theme/ThemeInterface.php
  • tests/Base/BaseTagTest.php
  • tests/Config/ConfigApplierTest.php
  • tests/Config/ConfigTest.php
  • tests/Element/TagBlockTest.php
  • tests/Element/TagInlineTest.php
  • tests/Element/TagInputTest.php
  • tests/Element/TagVoidTest.php
  • tests/Factory/SimpleFactoryTest.php
  • tests/Support/Stub/ConfigApplier.php
  • tests/Support/Stub/ConfigurableComponent.php
  • tests/Support/Stub/ExtendedComponent.php
💤 Files with no reviewable changes (3)
  • tests/Element/TagInputTest.php
  • tests/Element/TagVoidTest.php
  • tests/Element/TagInlineTest.php
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: phpunit / PHP 8.4-windows-2022
  • GitHub Check: phpunit / PHP 8.3-windows-2022
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-09T21:17:27.239Z
Learnt from: terabytesoftw
Repo: ui-awesome/html-core PR: 48
File: composer.json:14-14
Timestamp: 2026-01-09T21:17:27.239Z
Learning: In the ui-awesome/html-core repository, during active development phases it is acceptable to use development version constraints in composer.json (for example '^0.6dev') to facilitate rapid iteration. Reviewers should tolerate dev constraints here, but plan to revert to stable versions once the project stabilizes. When reviewing, ensure such constraints are clearly documented in the commit message or PR description and that a follow-up task exists to switch to stable versions before release.

Applied to files:

  • composer.json
📚 Learning: 2025-12-19T22:28:15.476Z
Learnt from: terabytesoftw
Repo: ui-awesome/html-core PR: 16
File: src/Exception/Message.php:59-61
Timestamp: 2025-12-19T22:28:15.476Z
Learning: In ui-awesome/html-core/src/Exception/Message.php, for the KEY_MUST_BE_NON_EMPTY_STRING error, use a simplified, concise message without diagnostic placeholders. Since the error context (empty string or non-string type) is already sufficient for debugging, avoid embedding runtime values or extra type details in the message. Example: replace messages like 'Key must be a non-empty string: value=... type=...' with 'Key must be a non-empty string.' Ensure consistency across similar validation errors and avoid leaking internal debugging details in production.

Applied to files:

  • src/Exception/Message.php
🪛 PHPMD (2.15.0)
tests/Factory/SimpleFactoryTest.php

[error] 24-24: Avoid using static access to class '\UIAwesome\Html\Core\Factory\SimpleFactory' in method 'testConfigureIgnoresNumericKeys'. (undefined)

(StaticAccess)


[error] 24-24: Avoid using static access to class '\UIAwesome\Html\Core\Tests\Support\Stub\TagInline' in method 'testConfigureIgnoresNumericKeys'. (undefined)

(StaticAccess)

src/Config/ConfigApplier.php

[error] 40-40: The method apply has a boolean flag argument $strict, which is a certain sign of a Single Responsibility Principle violation. (undefined)

(BooleanArgumentFlag)

tests/Config/ConfigApplierTest.php

[warning] 18-337: The class ConfigApplierTest has 13 public methods. Consider refactoring ConfigApplierTest to keep number of public methods under 10. (undefined)

(TooManyPublicMethods)

tests/Element/TagBlockTest.php

[error] 156-156: Avoid using static access to class '\Fiber' in method 'testMaintainsIndependentBeginEndStackForFiber'. (undefined)

(StaticAccess)


[error] 157-157: Avoid using static access to class '\UIAwesome\Html\Core\Tests\Support\Stub\TagBlock' in method 'testMaintainsIndependentBeginEndStackForFiber'. (undefined)

(StaticAccess)


[error] 176-176: Avoid using static access to class '\UIAwesome\Html\Core\Tests\Support\Stub\TagBlock' in method 'testMaintainsIndependentBeginEndStackForFiber'. (undefined)

(StaticAccess)

🔇 Additional comments (20)
src/Element/BaseBlock.php (1)

120-121: LGTM!

Also applies to: 162-164, 242-259

src/Factory/SimpleFactory.php (1)

14-14: LGTM!

Also applies to: 53-58

tests/Factory/SimpleFactoryTest.php (1)

22-35: LGTM!

tests/Element/TagBlockTest.php (1)

7-7: LGTM!

Also applies to: 58-74

README.md (1)

269-326: LGTM!

Also applies to: 371-374

composer.json (1)

4-4: LGTM!

src/Config/Config.php (1)

17-17: LGTM!

Also applies to: 27-31

src/Config/ConfigApplier.php (1)

1-107: LGTM!

src/Exception/ConfigException.php (1)

1-24: LGTM!

src/Exception/Message.php (1)

44-66: LGTM!

Also applies to: 81-87

src/Base/BaseTag.php (1)

8-15: LGTM!

Also applies to: 226-230, 248-250

tests/Base/BaseTagTest.php (1)

25-49: LGTM!

Also applies to: 77-112, 114-120, 122-144

tests/Config/ConfigTest.php (1)

13-13: LGTM!

Also applies to: 80-108, 121-143

tests/Support/Stub/ConfigApplier.php (1)

14-18: LGTM!

Also applies to: 38-38

src/Config/ConfigApplierInterface.php (1)

55-56: LGTM!

src/Config/Recipe.php (1)

15-16: LGTM!

src/Theme/ThemeInterface.php (1)

34-34: LGTM!

tests/Config/ConfigApplierTest.php (1)

1-337: LGTM!

tests/Support/Stub/ConfigurableComponent.php (1)

1-67: LGTM!

tests/Support/Stub/ExtendedComponent.php (1)

1-10: LGTM!

Comment thread CHANGELOG.md
Comment thread tests/Element/TagBlockTest.php
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 26394c6ce9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@terabytesoftw
terabytesoftw merged commit 6c6acf8 into main Jul 22, 2026
39 checks passed
@terabytesoftw
terabytesoftw deleted the feat/add-strict-recipe-execution branch July 22, 2026 20:31
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@c1f9ba9). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##             main      #100   +/-   ##
========================================
  Coverage        ?   100.00%           
  Complexity      ?       111           
========================================
  Files           ?        16           
  Lines           ?       290           
  Branches        ?         0           
========================================
  Hits            ?       290           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant