-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Problem
The QueueValidator tool is only available inside AI pipelines (registered via registerGlobalTool). When agents or humans need to validate topics from the CLI — e.g. during quiz/content ideation sessions — there's no way to call it.
I hit this today during quiz ideation: the task instructions said to use queue_validator for each candidate, but it's not callable from WP-CLI. Had to fall back to manual cross-referencing.
Proposed Solution
Add a WP-CLI subcommand that wraps QueueValidator::validate():
wp datamachine queue validate "Topic Title" --post_type=quiz --flow_id=48 --threshold=0.65
Output:
clear— no duplicates foundduplicate— shows match details (source, title, similarity score)
The validate() method is already cleanly factored out as a public method, separate from the AI tool wrapper. This should be a thin CLI command that passes args through.
Parameters
| Flag | Required | Default | Description |
|---|---|---|---|
<topic> |
yes | — | Topic/title to validate |
--post_type |
no | post |
Post type to check against |
--flow_id |
no | — | Flow ID for queue checking |
--threshold |
no | 0.65 |
Jaccard similarity threshold |
Nice-to-have
- Also register as a WordPress Ability so it's accessible from the Abilities API too
--format=jsonoutput option for scripting
Context
QueueValidator lives at inc/Engine/AI/Tools/Global/QueueValidator.php. The validate() method already returns structured results — just needs a CLI entry point.