Skip to content

feat!: Rescaffold repo with separate Features and Experiments namespaces [WIP]#309

Closed
justlevine wants to merge 12 commits intodevelopfrom
try/scaffold-features-psr4
Closed

feat!: Rescaffold repo with separate Features and Experiments namespaces [WIP]#309
justlevine wants to merge 12 commits intodevelopfrom
try/scaffold-features-psr4

Conversation

@justlevine
Copy link
Copy Markdown
Contributor

@justlevine justlevine commented Mar 16, 2026

What?

Closes

Note

I plan to reset/rebase and otherwise clean up all this before I put it up for review, so might make sense to save code-specific feedback for later and focus now on the structural.

Illustrative work in progress - the final proposal will likely be split into several PRs to handle the general scaffold cleanup versus specific work to decouple Features from Experiments

Why?

How?

The broader takeaways:

  • Features/* are where the graduated features live (once we have them)
    The primary Loader + Registry lives in the root.
    Individual features are namespaced.

  • Experiments/ are where our (current and future) Experiments live
    Classes are loaded by hooking into the Features/Loader with the *_feature_classes filter, so we can dogfood our own apis.

  • Other scaffolding/slop like the non-psr4 files in our root, sorting method names, splitting the settings screen into features + experiments still need to happen, some can happen in parallel.

Todo

  • Migrate options
  • Tests
  • Docs + References
  • Split admin screens

Use of AI Tools

GitHub Copilot Autocomplete

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Before After
Open WordPress Playground Preview

*/
public function init(): void {
$experiments = array(
'abilities_explorer' => \WordPress\AI\Experiments\Abilities_Explorer\Abilities_Explorer::class,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Stable keys so classes can stay removed/overloaded even if they graduate.

Long term we should just turn Abstract_Feature::get_id() into an abstract public static method instead of a metadata property, but that would touch a lot of other files and method internals and can be done as a followup PR

* @since x.x.x
*/
class Experiment_Category {
class Experiment_Category extends Feature_Category {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with graduating Experiment_Category::ADMIN and Experiment_Category::EDITOR too, this is more to illustrate that experiment categories are a potential superset of Feature_Categories

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Mar 17, 2026

See also the related part of my comment left in #287 (comment):

This could also be an opportunity to rethink the architecture — rather than a separate "experiment" concept, these could become "features" with a maturity stage (experimental, stable, etc.). That would make the naming more future-proof and align with the plugin rebrand.

In this context, it would also make it easier to promote an experiment to a stable feature with minimal code changes.

@justlevine
Copy link
Copy Markdown
Contributor Author

See also the related part of my comment left in #287 (comment):

This could also be an opportunity to rethink the architecture — rather than a separate "experiment" concept, these could become "features" with a maturity stage (experimental, stable, etc.). That would make the naming more future-proof and align with the plugin rebrand.

In the latest commit 74a17d4 I changed Feature::is_experimental(): bool to ::get_stability(): string<'stable'|'experimental'|'deprecated'>. I still left them physically in the Experimental namespace for now, primarily because until we have a human process to graduate features, I think the friction of moving them to /Features is desirable (and more noticeable than a 1-line diff).

I believe all the public breaking stuff is handled in this current branch. There's room for some more pre WP7.0 cleanup (migrations, settings, constants) but those can be done in isolation. I'm going to start parcelling this off into individual PRs for review.

@justlevine justlevine force-pushed the try/scaffold-features-psr4 branch from 74a17d4 to 5b0b172 Compare March 17, 2026 22:42
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 152 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.11%. Comparing base (92102a3) to head (14a8f14).

Files with missing lines Patch % Lines
includes/Deprecated.php 15.45% 93 Missing ⚠️
includes/bootstrap.php 0.00% 17 Missing ⚠️
includes/Abstracts/Abstract_Feature.php 78.72% 10 Missing ⚠️
includes/Features/Loader.php 86.79% 7 Missing ⚠️
includes/Settings/Settings_Registration.php 0.00% 7 Missing ⚠️
includes/Settings/Settings_Page.php 0.00% 6 Missing ⚠️
includes/Asset_Loader.php 0.00% 4 Missing ⚠️
ai.php 0.00% 2 Missing ⚠️
includes/Abstracts/Abstract_Ability.php 33.33% 2 Missing ⚠️
...iments/Alt_Text_Generation/Alt_Text_Generation.php 75.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #309      +/-   ##
=============================================
- Coverage      58.72%   57.11%   -1.62%     
- Complexity       573      590      +17     
=============================================
  Files             37       41       +4     
  Lines           2951     3078     +127     
=============================================
+ Hits            1733     1758      +25     
- Misses          1218     1320     +102     
Flag Coverage Δ
unit 57.11% <50.00%> (-1.62%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

justlevine and others added 8 commits March 18, 2026 01:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@justlevine justlevine force-pushed the try/scaffold-features-psr4 branch from 5b0b172 to 3f2a2fb Compare March 18, 2026 01:01
@justlevine justlevine force-pushed the try/scaffold-features-psr4 branch from 3f2a2fb to 14a8f14 Compare March 18, 2026 01:16
@justlevine
Copy link
Copy Markdown
Contributor Author

@justlevine justlevine closed this Mar 18, 2026
@justlevine justlevine deleted the try/scaffold-features-psr4 branch March 18, 2026 01:52
@jeffpaul jeffpaul removed this from the 0.6.0 milestone Mar 18, 2026
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.

Rename plugin from “AI Experiments” to “AI” and define feature vs experiment classification

3 participants