You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove bootstrap ceremony that duplicates a private fixed declaration list and Composer PSR-4 autoloading, while preserving Data Machine's lightweight/full-runtime boundary, ability lifecycle, declaration order, and file-level side effects.
Scope
Delete AbilityManifest
AbilityManifest has one caller and consumes one private fixed list of four known classes. It has no filter, provider registry, alternate producer, persisted state, or public transport contract.
Replace the manifest call with direct registration/construction for:
AgentAbilities
ImageTemplateAbilities
SendEmailAbility
SendEmailQueuedAbility
Delete:
inc/Abilities/AbilityManifest.php
the private manifest builder in AbilityServiceProvider
dead imports and manifest-loading code
Remove Composer-obsolete class includes
vendor/autoload.php loads before Data Machine bootstrap and PSR-4 owns Data Machine class namespaces. Remove manual require_once statements that only load class/trait/interface definitions before direct construction.
Retain every procedural or side-effect include, especially:
ContentActionHandlers.php
WordPress admin function includes
procedural setup/bootstrap files
directive/filter files with file-level registration
queue tuning and other hook-installing files
Also remove class-only eager includes from inc/bootstrap.php only where route/service registration is already explicitly owned and no file-level side effect exists.
Contract preservation
lightweight abilities remain available before full runtime
full runtime remains lazy and idempotent
abilities register exactly once before, during, and after wp_abilities_api_init
direct REST, CLI, chat, frontend, background, single-site, and multisite boot paths remain unchanged
route inventory and registration order remain unchanged
standalone tests use Composer and faithful WordPress stubs rather than incidental production includes
Parent: #3113
Goal
Remove bootstrap ceremony that duplicates a private fixed declaration list and Composer PSR-4 autoloading, while preserving Data Machine's lightweight/full-runtime boundary, ability lifecycle, declaration order, and file-level side effects.
Scope
Delete
AbilityManifestAbilityManifesthas one caller and consumes one private fixed list of four known classes. It has no filter, provider registry, alternate producer, persisted state, or public transport contract.Replace the manifest call with direct registration/construction for:
AgentAbilitiesImageTemplateAbilitiesSendEmailAbilitySendEmailQueuedAbilityDelete:
inc/Abilities/AbilityManifest.phpAbilityServiceProviderRemove Composer-obsolete class includes
vendor/autoload.phploads before Data Machine bootstrap and PSR-4 owns Data Machine class namespaces. Remove manualrequire_oncestatements that only load class/trait/interface definitions before direct construction.Retain every procedural or side-effect include, especially:
ContentActionHandlers.phpAlso remove class-only eager includes from
inc/bootstrap.phponly where route/service registration is already explicitly owned and no file-level side effect exists.Contract preservation
wp_abilities_api_initTests
Cover lightweight ability registration timing, full-runtime activation, provider composition, route inventory, load order, duplicate registration, Composer optimized autoload, package activation, and all existing ability/REST smokes.
Constraints
refactor:commit.Expected production reduction: approximately 130–145 PHP lines.