Skip to content

Commit a220496

Browse files
whyisjakeclaude
andcommitted
docs(ai-workspace): follow the content ability to its new name
#1002 renamed core/read-content to core/content-query. Nine docblock and doc references here still pointed at the old name, which now resolves to a deprecated alias -- accurate enough to pass review and wrong enough to send the next reader somewhere that will be removed. The withheld list keeps naming both sides of the users rename, and the docs now say why: the alias is a real registration that copies the replacement's meta, so exposure changes reach both names at once and holding back only one holds back nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent dcfff18 commit a220496

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

‎docs/experiments/ai-workspace.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ array(
154154
Two properties are worth stating plainly:
155155

156156
- **No body content is ever returned.** Rows carry a title and a plain-text excerpt, generated from the content when the post has none. Reading a body is `ai/read-content-bodies`'s job, and is capped at five posts a call.
157-
- **Every row is filtered at execute time** by the current user's read permission, using the same inherited-parent walk `core/read-content` performs. `total` comes from the underlying query and may therefore exceed the number of rows returned. The 20-item page cap is a context limit for the model, not an access control. `edit_link` is present only when the user can edit that post.
157+
- **Every row is filtered at execute time** by the current user's read permission, using the same inherited-parent walk `core/content-query` performs. `total` comes from the underlying query and may therefore exceed the number of rows returned. The 20-item page cap is a context limit for the model, not an access control. `edit_link` is present only when the user can edit that post.
158158

159159
### `ai/read-content-bodies`
160160

161-
The reading half of retrieval, and the largest increase in reachable content on this surface. Registered by this experiment for the same reason the search ability is: `core/read-content` belongs to the Custom Abilities experiment, and the workspace's reach must not change when a different experiment is switched off.
161+
The reading half of retrieval, and the largest increase in reachable content on this surface. Registered by this experiment for the same reason the search ability is: `core/content-query` belongs to the Custom Abilities experiment, and the workspace's reach must not change when a different experiment is switched off.
162162

163163
**Input schema** (`additionalProperties` is false):
164164

@@ -372,8 +372,14 @@ The filter does not have the last word on removals: the site owner's own removal
372372
### `wpai_workspace_withheld_abilities`
373373

374374
The abilities the workspace never admits, whatever their exposure and
375-
annotations say. Ships holding `core/get-user-info`, `core/read-users`,
376-
`core/read-settings` and `core/get-environment-info`.
375+
annotations say. Ships holding `core/get-user-info`, `core/users-query`,
376+
`core/read-users`, `core/read-settings` and `core/get-environment-info`.
377+
378+
`core/users-query` and `core/read-users` are the same ability under two names:
379+
[#1002](https://github.com/WordPress/ai/pull/1002) renamed it and kept the old
380+
name as a deprecated alias. The alias is a real registration that copies the
381+
replacement's meta, so a change in exposure reaches both at once and both have
382+
to be listed. A rename upstream is a hole here until the new name is added.
377383

378384
The effect class asks whether an ability writes or reaches outside the site. It
379385
cannot ask whether handing it to a model is a bad idea, and for these the answer

‎includes/Abilities/Content/Read_Content_Bodies.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* of a small number of posts named by ID.
2525
*
2626
* This is a sibling of {@see Search_Content}, and exists for the same reason: a
27-
* conversational surface needs to read the posts it finds, and `core/read-content` is
27+
* conversational surface needs to read the posts it finds, and `core/content-query` is
2828
* registered behind the Custom Abilities experiment. Depending on that ability would
2929
* make this tool appear and disappear with a switch that has nothing to do with it, so
3030
* the reading path is registered here instead and every ability consumer — the AI

‎includes/Abilities/Content/Search_Content.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* across the post types exposed to abilities via `show_in_abilities` and returns a
2626
* bounded list of matching posts as titles and excerpts.
2727
*
28-
* This is a sibling of {@see Content}, not a change to it: `core/read-content` is kept
28+
* This is a sibling of {@see Content}, not a change to it: `core/content-query` is kept
2929
* byte-similar to WordPress core's copy, and its registered description states that its
3030
* lookups and filters are exact-match only. Rather than widen that ability, this class
3131
* adds search as its own ability so every ability consumer — the AI Workspace, the MCP
@@ -36,7 +36,7 @@
3636
* - The result set is capped at {@see self::MAX_PER_PAGE} items. That is a context
3737
* limit for the model, not an access control.
3838
* - Every returned row is filtered at execute time by the requesting user's own
39-
* capabilities, using the same read permission walk `core/read-content` performs,
39+
* capabilities, using the same read permission walk `core/content-query` performs,
4040
* so a result set never contains an item the user could not otherwise read. The
4141
* permission callback can only gate the request coarsely, because the matching
4242
* rows are unknown until the query runs.
@@ -139,7 +139,7 @@ public function register(): void {
139139
}
140140

141141
/*
142-
* Internal statuses (e.g. `inherit`) are excluded, matching `core/read-content`.
142+
* Internal statuses (e.g. `inherit`) are excluded, matching `core/content-query`.
143143
*/
144144
$statuses = array_values( get_post_stati( array( 'internal' => false ) ) );
145145

@@ -200,10 +200,10 @@ public function check_permission( $input = array() ): bool {
200200
* {@see \WP_Ability::execute()} always runs {@see self::check_permission()} first, so
201201
* this only needs to enforce what the gate could not: every matched row is checked
202202
* against the current user's read permission before it is included, mirroring the
203-
* row filtering `core/read-content` performs in query mode.
203+
* row filtering `core/content-query` performs in query mode.
204204
*
205205
* Totals come from the underlying query and may therefore exceed the number of
206-
* returned rows, matching `core/read-content` and the REST posts controller.
206+
* returned rows, matching `core/content-query` and the REST posts controller.
207207
*
208208
* `total` exceeds the returned rows for two unrelated reasons — the rest of the
209209
* matches are on later pages, and the permission walk dropped some of this page —

‎includes/Experiments/AI_Workspace/AI_Workspace.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function register(): void {
104104
/*
105105
* The reading half of retrieval. Search finds posts; this returns the bodies
106106
* of a handful of them, filtered row by row at execute time. It is registered
107-
* here rather than leaning on `core/read-content`, which belongs to the Custom
107+
* here rather than leaning on `core/content-query`, which belongs to the Custom
108108
* Abilities experiment: the workspace's reach must not change when a different
109109
* experiment is switched off.
110110
*/

0 commit comments

Comments
 (0)