feat: ability categories and tool-ability linkage for pipeline tool scoping#1052
Merged
feat: ability categories and tool-ability linkage for pipeline tool scoping#1052
Conversation
…coping Split the flat 'datamachine' ability category into 18 semantic subcategories (content, media, analytics, seo, memory, taxonomy, publishing, fetch, email, pipeline, flow, jobs, agent, settings, auth, logging, system, chat). Add ability metadata to all 56 tool registerTool() calls so each tool declares which ability (or abilities) it wraps. Tools that bypass the Abilities API get explicit access_level metadata instead. Wire category-based filtering into ToolPolicyResolver — pipelines can now declare tool_categories to scope which tools the AI step receives, eliminating irrelevant tools from the context. Agent tool policies also support categories alongside individual tool names. This reduces pipeline token bloat (no more google_analytics in RSS→AI→publish pipelines) and aligns the tool surface with the Abilities API for the eventual wp-ai-client migration (#1027). Resolves phases 1-2 of #924.
chubes4
added a commit
to Extra-Chill/data-machine-code
that referenced
this pull request
Apr 14, 2026
Register datamachine-code/workspace and datamachine-code/github ability categories. Update all 23 ability registrations from flat 'datamachine' to the proper subcategory. Add ability metadata to all tool registerTool() calls (workspace tools linked to abilities, GitHub tools with access_level). Companion to Extra-Chill/data-machine#1052.
Contributor
Homeboy Results —
|
chubes4
added a commit
to Extra-Chill/data-machine-code
that referenced
this pull request
Apr 15, 2026
Register datamachine-code/workspace and datamachine-code/github ability categories. Update all 23 ability registrations from flat 'datamachine' to the proper subcategory. Add ability metadata to all tool registerTool() calls (workspace tools linked to abilities, GitHub tools with access_level). Companion to Extra-Chill/data-machine#1052.
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.
Summary
datamachineability category into 18 semantic subcategories (content, media, analytics, seo, memory, taxonomy, publishing, fetch, email, pipeline, flow, jobs, agent, settings, auth, logging, system, chat)ability/abilitiesmetadata to all 56 tool registrations so every tool declares which ability it wrapsToolPolicyResolver— pipelines can declaretool_categoriesto scope which tools the AI step receivescategoriesalongside individual tool namesProblem
Every pipeline AI step got all tools tagged
pipelineregardless of relevance — google_analytics, bing_webmaster, amazon_affiliate_link in an RSS→AI→publish pipeline. With extensions installed, this scales to 30-50+ tools burning 6,000-25,000 tokens per AI request before any content.Solution
Tools inherit their category from their linked ability via the WordPress Abilities API. The
ToolPolicyResolverresolves categories at runtime:New files
inc/Abilities/AbilityCategories.php— centralized category registration with constantsKey changes
ToolPolicyResolver.php— newfilterByAbilityCategories()method + category support in agent policiesAIStep.php— readstool_categoriesfrom pipeline step or pipeline-level configAllAbilitiesRegisteredTest.php— validates all 18 categoriesBackwards compatible
Empty
tool_categories= no filtering = current behavior. Handler tools (viachubes_ai_tools) bypass category filtering since they're already scoped by adjacent step handlers.Follow-up needed
data-machine-code,data-machine-events) need their abilities updated to use subcategoriesusing_abilities()+ category queries replace the tool registryResolves phases 1-2 of #924.