Skip to content

Feature : Site Agent Experiment - #1214

Closed
Vrishabhsk wants to merge 3 commits into
WordPress:developfrom
Vrishabhsk:feature/site-agent-develop
Closed

Vrishabhsk wants to merge 3 commits into
WordPress:developfrom
Vrishabhsk:feature/site-agent-develop

Conversation

@Vrishabhsk

@Vrishabhsk Vrishabhsk commented Oct 22, 2026 •

Copy link
Copy Markdown

What?

Closes #189

Adds an opt-in Site Agent experiment under Tools → Site Agent that maps natural-language requests to reviewed WordPress Abilities, with approval-gated writes and an audit trail.

Why?

Issue #189 asks for a conversational admin agent that can perform WordPress actions with strong security, permissions, and auditability from the start, and that is opt-in and disabled by default.

This PR takes an abilities-first approach. Instead of describing every action twice (once as a REST resource table, once as a custom action class), the agent uses ordinary WordPress Abilities as the action layer. Each action keeps its own input schema, permission callback, validation, and execution hook. The agent adds only three things:

  1. A reviewed allowlist of abilities.
  2. A propose-then-approve boundary for anything that is not read-only.
  3. An audit trail.

This keeps the implementation substantially smaller than the earlier draft while preserving the security properties in the issue.

How?

Experiment and gates

  • Site_Agent registers the screen, REST routes, abilities, and audit listener only when the experiment is enabled.
  • The experiment toggle and the write gate both default to false.
  • The screen and REST routes require manage_options by default; sites can narrow or lower this with wpai_site_agent_capability.

Abilities as actions

Ability Type Capability Notes
ai/site-agent-read-site Read Section-dependent Environment, recent posts/pages, installed plugins, or a fixed settings allowlist.
ai/site-agent-create-draft Write edit_posts / edit_pages Creates a draft owned by the current user. Never publishes.
ai/site-agent-update-post Write edit_post Title, content, excerpt, draft/pending status. Cannot publish, unpublish, change author, or change type.
ai/site-agent-update-setting Write manage_options Site title or tagline only.

Read sections use their own capability (manage_options, edit_posts, edit_pages, activate_plugins) and filter object reads through read_post. The settings section never exposes URLs, email addresses, roles, or arbitrary options.

Proposal and approval flow

  1. The model receives only the reviewed catalog.
  2. An ability annotated readonly => true runs immediately.
  3. Any other ability is treated as a write. The exact ability name and arguments are stored in a user-scoped, conversation-bound transient.
  4. The transcript shows the exact stored values. Nothing has run.
  5. The browser sends only the proposal ID and conversation ID on approval.
  6. The server re-checks the proposal owner, conversation, expiry, pending status, and the ability's own check_permissions() with the stored arguments.
  7. The server calls $ability->execute( $stored_args ) as the current user. WordPress validates the input, sanitizes it, checks permissions again, and fires its hooks.
  8. The proposal is marked used and a result note is appended to the conversation.

Proposals are single-use and expire after 30 minutes. Conversations expire after two hours.

Audit

  • Every executed ability is logged through wp_after_execute_ability.
  • Proposals, approvals, denials, and declines are logged explicitly.
  • Rows use the new site_agent log type, with the ability name as the operation and the phase in context.
  • No post bodies, setting values, credentials, or package URLs are logged.
  • External audit plugins can listen to wpai_site_agent_action.

UI

  • A minimal React screen with a transcript, composer, and proposal card.
  • The proposal card renders the exact stored arguments and the Approve / Decline actions.
  • When the write gate is off, the screen clearly says it is read-only and links to the settings page.
  • No streaming in this cut; model rounds are buffered.

What is intentionally not included

  • Publishing, trash, media uploads, user writes, plugin installation, core/plugin/theme updates, theme switching, and export.
  • Each is a reviewed ability away and can be added without changing the agent loop.

Use of AI Tools

AI assistance: Yes
Tool(s): Ollama
Model(s): Deepseek-v4.1-flash:cloud
Used for: Initial implementation, the refactor to the abilities-first design, tests, documentation, and manual verification. The final code, tests, and security behaviour were reviewed and edited by the author.

Testing Instructions

Automated

npm ci
composer install
npm run build
npm run typecheck
npm run test:php

Run the Site Agent e2e spec with the AI plugin active in the wp-env test site:

npx wp-scripts test-playwright --config tests/e2e/playwright.config.ts \
  tests/e2e/specs/experiments/site-agent.spec.js

Validated locally:

  • PHP suite: 1937 tests, 5537 assertions, 42 skipped.
  • Site Agent suites: 35 tests across the abilities, agent loop, and experiment/gates.
  • phpcs and phpstan clean for the new backend code.
  • TypeScript typecheck and production build pass.

Manual

  1. Open Settings → AI, open the settings menu, and enable Advanced settings.
  2. Enable Site Agent. Leave Allow write proposals off.
  3. Open Tools → Site Agent.
  4. Ask “What version of WordPress and PHP am I running?” and confirm a real answer from ai/site-agent-read-site.
  5. Ask “Create a draft titled ‘Site Agent test’.” and confirm the assistant says it cannot while writes are off.
  6. Enable Allow write proposals, reload, and ask again. Confirm a proposal card shows the exact title, type, and status, and that no draft exists yet.
  7. Click Decline and confirm nothing was created.
  8. Ask again, click Approve, and confirm the draft appears under Posts → Drafts.
  9. Ask to change the tagline and confirm the proposal shows blogdescription and the exact new value. Approve and verify under Settings → General.
  10. Open Tools → AI Request Logs, filter by site_agent, and confirm proposal/execute/approval/decline rows exist without content or secret values.

I also tested the above end-to-end on a real WordPress 7.1.3 site with a Google connector, including the read, proposal, approve, decline, settings update, and audit paths.

Screenshots or screencast

Screenshot 2026-10-22 at 1 27 39 PM Screenshot 2026-10-22 at 1 31 46 PM Screenshot 2026-10-22 at 1 32 44 PM

Changelog Entry

Added - New Site Agent experiment: a conversational assistant under Tools that reads site information and proposes changes through reviewed WordPress Abilities. Every write is stored as a server-side proposal and executes only after approval. The experiment and its write gate are disabled by default.

Open WordPress Playground Preview

Adds a conversational assistant under Tools that reads site information
and proposes site changes. Actions are ordinary WordPress Abilities, so
each keeps its own schema, permission callback, validation, and execution
hook. The agent adds a reviewed allowlist, a propose-then-approve boundary
for writes, and an audit trail.

Write proposals are user-scoped, conversation-bound, single-use, and
expire after 30 minutes. The experiment and its write gate are disabled
by default.

See WordPress#189.
@Vrishabhsk
Vrishabhsk requested a review from a team October 22, 2026 08:09
@Vrishabhsk
Vrishabhsk requested a review from jeffpaul as a code owner October 22, 2026 08:09
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @Vrishabhsk.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: Vrishabhsk.

Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.94825% with 750 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.13%. Comparing base (26fb256) to head (ce55084).

Files with missing lines Patch % Lines
...ncludes/Experiments/Site_Agent/REST/Controller.php 38.41% 194 Missing ⚠️
...cludes/Experiments/Site_Agent/Proposal_Preview.php 32.23% 103 Missing ⚠️
includes/Abilities/Site_Agent/Read_Site.php 62.74% 95 Missing ⚠️
...des/Experiments/Site_Agent/Prompt_Model_Client.php 1.42% 69 Missing ⚠️
includes/Experiments/Site_Agent/Admin_Page.php 5.17% 55 Missing ⚠️
includes/Experiments/Site_Agent/Agent.php 84.37% 55 Missing ⚠️
...udes/Experiments/Site_Agent/Conversation_Store.php 71.08% 48 Missing ⚠️
includes/Abilities/Site_Agent/Update_Post.php 75.65% 37 Missing ⚠️
includes/Experiments/Site_Agent/Proposal_Store.php 68.05% 23 Missing ⚠️
...xperiments/Site_Agent/Function_Calling_Support.php 0.00% 22 Missing ⚠️
... and 6 more
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1214      +/-   ##
=============================================
- Coverage      85.49%   83.13%   -2.36%     
- Complexity      4807     5331     +524     
=============================================
  Files            188      205      +17     
  Lines          17734    19703    +1969     
=============================================
+ Hits           15161    16380    +1219     
- Misses          2573     3323     +750     
Flag Coverage Δ
unit 83.13% <61.94%> (-2.36%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@jeffpaul jeffpaul added this to the 1.6.0 milestone Oct 23, 2026
@jeffpaul

jeffpaul commented Nov 4, 2026

Copy link
Copy Markdown
Member
  1. On the initial screen render, what is the New topic button (?) for? It's not active or clickable so perhaps that's when a chat is in-progress or prior chats are available maybe? Perhaps we hide that if its not actionable and only render the button/link once its contextually relevant?
Screenshot 2026-11-04 at 1 46 16 PM

After interacting with the workspace and having some responses, I see that the New topic button becomes available but appears to mainly clear the workspace. So let's hide that button until there's something happening in the chat that warrants a user desire to create a new topic/chat.

  1. here's a sample post generation request, while the response is on the right path to getting to done here the response could be a little more user-friendly to review. let's look to improve the UX here to make the response easiest to consume (e.g., don't show HTML, show rendered content) and perhaps allow a user to edit parts of the draft post versus having to ONLY approve/decline it entirely.

Screenshot 2026-11-04 at 1 50 14 PM
  1. This initial iteration of the experiment Is probably fine to live under Tools > Site Agent, but probably some question as to whether this experiment could now or should soon elevate to a top level menu item given how regularly a user may want to interact with it? I could see this being a top level menu item as simply "AI" or "Agent" or some such simple, likely singular word term for this sort of experience. At that point, probably worth adding to the + New menu in the admin bar for something like + New > Agent Chat.
Screenshot 2026-11-04 at 1 51 50 PM
  1. The result of the "WP/PHP version" demo prompt provides a literal response to the question, but leaves the user with no obvious action to take next. Let's ensure the response includes an action or set of actions the user can take to continue (perhaps as a question/answer sort of interaction). In this case, it might offer to send them to the Site Health screen to see more details on their site infrastructure? Also, the response is in markdown but ideally shows as rendered content instead.
Screenshot 2026-11-04 at 1 56 41 PM
  1. The result of the "draft post" demo prompt provides an almost useless draft post, so perhaps we iterate on the prompt a bit to something like the "Create a draft post about the history of WordPress" or something that's even more relevant to the site content like "Create a draft post that summarizes my posts over the past year (aka "My Year in Posts")"? This way the result is a bit more useful/interesting and a slightly better example of what could be done?
Screenshot 2026-11-04 at 1 59 26 PM
  1. The "site tagline" prompt has a result that shows what the new value will be but not what the current value is, let's try and ensure when content is changed (at least in this example) that its clear what things are changing FROM and not just TO.
Screenshot 2026-11-04 at 2 01 28 PM
  1. The "latest draft posts" again results in unrendered markdown, so let's ensure we show rendered content here. Also, I'm not certain this is a great demo prompt to launch with. Are there others you've explored that we could try out here? Perhaps something like "Generate an image of a Wapuu that's customized to my site content"?
Screenshot 2026-11-04 at 2 01 58 PM
  1. After clicking New topic the previous topic/chat transcript appears to be lost and isn't stored any where. Can we give each of these their own friendly, but editable name? Can we ensure there's a sidebar or drawer to see all prior chats to be able to navigate between them? Can we make it so those prior chats can be archived or deleted? I'll hold off on asking to group multiple chats into a singular "project" or related set of chats that perhaps allows for their group context to be shared as that feels like well past MVP sort of functionality.

  2. Last item for now as this batch of feedback items on its own is a decent amount of work, but moves things in a VERY SOLID direction towards getting this Experiment merged in for users to start testing out. Let's adjust the top, left, and bottom borders so they fully align with the frame available just like the AI settings page experience.

Screenshot 2026-11-04 at 2 34 16 PM Screenshot 2026-10-28 at 2 41 51 PM

Let's then also have the bottom of the screen align to the bottom of the viewable area (and can ignore/hide the otherwise admin footer "Thank you for creating with WordPress. Version 7.1.4" bits so that we're able to make use of the visible workspace on this screen for interacting with the AI agent.

Similarly let's try and condense what is displayed about the chat area and try tocondense that content so that we can expand the chat area upwards towards the top of the page. This way we give as much space as possible to the chat area and less to the surrounding cruft.

Add persistent named conversation history with rename/archive/delete, render Markdown and proposal content, show current and proposed values with inline editing before approval, require a next step in replies, refresh the sample prompts, and make the screen fill the admin frame. Also add controller and conversation-store coverage.
…-develop

# Conflicts:
#	includes/Experiments/Experiments.php
#	readme.txt
@Vrishabhsk

Copy link
Copy Markdown
Author

hi @jeffpaul, i've made some modifications based on your feedback. Could you take a look?

@Vrishabhsk

Copy link
Copy Markdown
Author
Screenshot 2026-11-12 at 1 33 31 PM

@jeffpaul

@jeffpaul

Copy link
Copy Markdown
Member

@Vrishabhsk probably better to get your help reviewing the AI Workspace PRs as we're planning to ship that and the Site Agent is more or less a duplicate of that (note we're still crediting you there for your work here). So peeking into any open PRs in https://github.com/WordPress/ai/pulls?q=is%3Apr+state%3Aopen+workspace and providing feedback there would be most helpful, thanks!

whyisjake added a commit that referenced this pull request Nov 13, 2026
…pplied on approval (#1314)

## What?

Related: #1287

The AI Workspace can now change things that already exist, not only
create drafts and templates. The assistant can propose a new title,
excerpt or content for a post, or a new site title or tagline. Nothing
changes until you approve, and the card shows each current value next to
the proposed one. You can edit a value before approving it.

This is the first of the stacked PRs that build #1287's single agent on
top of `feat/ai-workspace` (#1004). It ports #1214's write actions. The
next PRs add site info and screen finding, then the Command Palette
entry, then audit and privacy hooks, then the docs pass for the name.

## Why?

#1287's first version needs the agent to finish tasks like "change my
tagline to fit what I write about" instead of telling the person how.
Before this, the workspace's approval flow could only create new posts.
Its single-approval guarantee rested on a per-post token, which doesn't
exist when you're editing something that's already there.

## How?

**Writes are proposal types, not abilities.** `ai/propose-post-changes`
and `ai/propose-site-identity` only store a proposal. The write happens
when the person approves it in the card. #1214 registered
`ai/site-agent-update-post` and `ai/site-agent-update-setting` as
abilities instead. In this plugin every `ai/*` ability is offered over
MCP by default, so those would have been callable by any MCP client with
no approval step. #1214's validation rules are ported into the two new
writers.

**The approval flow is now safe for editing existing content:**
- **One approval:** approving takes a lock with a single `INSERT IGNORE`
into the options table, the pattern core's `WP_Upgrader::create_lock()`
uses. `add_option()` won't do here: it writes with `ON DUPLICATE KEY
UPDATE`, which lets a second claim with a different value succeed.
- **Partial results kept:** each item's result is saved as soon as it's
written. An approval still running after five minutes reads as failed
and keeps its partial results.
- **Expired and deleted:** an expired proposal is reported as expired,
not "not found". A proposal whose chat was deleted can't be approved.
- **Checked at approval:** a field that changed since it was proposed is
left alone and reported as changed. One already at the new value is
reported as unchanged. A post someone else is editing is reported as
locked.
- **Edits re-checked:** an edited value runs through the same
server-side rules as the assistant's value, and it can change only the
value, never which post, field or option is targeted.

**Content stays intact:**
- **Plain titles:** a title with any markup is refused. Core skips title
kses for admins with `unfiltered_html`, so this check is the only one.
- **No silent stripping:** a content change is refused when kses would
strip something from the post's current content, such as an iframe or an
embed saved by an admin. Ordinary block markup like images and
separators is fine.
- **One field at a time:** writing one field leaves the post's other
text columns exactly as stored.
- **Block markup kept:** `ai/read-content-bodies` gains `raw: true`. It
returns the stored markup, only for posts the user can edit, so a
content change can keep the post's blocks.

**The card hides nothing that would publish.** Content is parsed in an
inert `DOMParser` document and drawn through the transcript's existing
renderer. Self-closing blocks (`core/rss`, `core/latest-posts`), media,
embeds and form controls show in place as plain text, so a person sees
everything they're approving. Nothing is fetched or run, and links are
live only on the site's own host.

**Workspace-only abilities are off MCP.** `ai/propose-*` and
`ai/ask-user` now declare `meta.mcp.public` as false. Before, MCP
clients were offered tools that always refused outside a workspace turn.
An override on the MCP Access screen still wins.

**Filters:**
- `wpai_workspace_write_proposals_enabled` (default true) turns these
two proposal types off. That's #1287's "allow writes" question: on by
default, with no settings toggle.
- `wpai_workspace_proposal_kinds` is the list of proposal types. The
tool list, the turn-ending rules and the system instruction are now all
built from it.

Code from #1214 is credited to @Vrishabhsk with Co-authored-by on the
two writer commits.

### Use of AI Tools

AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for:
planning, implementing the changes and tests, and code review.

I've reviewed the changes, understand them and can explain them under
review. They have all been tested locally.

## Testing Instructions

1. Enable AI Workspace under Settings → AI and connect a provider.
2. In Tools → AI Workspace, ask "Make my tagline fit what I write
about".
   - The card shows the current tagline beside the proposed one.
- Edit the proposed tagline, then apply. Settings → General shows your
edited tagline.
3. Ask for a new title for one of your published posts. The card says
the change is live as soon as you approve it.
4. Open the same chat in a second tab and approve in the first. The
second tab shows the outcome, not an Apply button.

**Tests run** (all passing):
- **PHPUnit, full suite:** 3306 tests on WordPress latest, on both
single site and multisite, at 4f6931b. Before the first round of review
fixes, the full suite also passed on trunk (7.2-beta4), at 3286 tests.
- **PHPUnit, new tests:**
- `Proposal_StoreTest`: lock, failed window, expiry grace, edits, kind
registry, write gate, and client/server ability parity. Includes
`test_a_lock_row_written_outside_the_cache_blocks_the_claim`, which
failed against the old `add_option()` lock.
- `Post_Field_ProposalTest`, including
`test_a_title_changed_since_the_proposal_is_stale`,
`test_two_fields_of_one_post_both_write`,
`test_a_post_locked_by_another_user_is_locked`,
`test_content_with_an_iframe_is_refused_but_other_fields_work`,
`test_content_with_an_image_block_accepts_a_change`,
`test_content_with_a_separator_block_accepts_a_change`,
`test_content_kses_would_strip_from_is_refused`,
`test_an_edit_cannot_retarget_the_item`,
`test_a_duplicate_field_of_one_post_is_refused`,
`test_a_model_supplied_snapshot_is_ignored` and
`test_a_title_with_a_backslash_survives_the_write`.
  - `Site_Identity_ProposalTest`: 16 tests.
- `Proposal_ControllerTest`:
`test_approval_while_another_request_holds_the_lock_writes_nothing`,
`test_an_interrupted_write_keeps_partial_results_and_reads_as_failed`,
`test_approving_after_the_chat_was_deleted_is_refused` and
`test_get_returns_the_stored_results_once_approved`.
- `MCP_AdapterTest`: `test_plugin_ability_declared_hidden_stays_hidden`,
`test_workspace_only_abilities_are_hidden_from_mcp`,
`test_override_exposes_a_plugin_ability_declared_hidden` and
`test_workspace_only_ability_refuses_outside_a_turn`.
- `Read_Content_BodiesTest`:
`test_raw_returns_stored_markup_to_an_editor_of_the_post`,
`test_raw_is_withheld_from_a_user_who_can_only_read_the_post` and
`test_raw_is_off_by_default`.
- **e2e (Chromium):** all `tests/e2e/specs/experiments/ai-workspace*`
specs, 135 passed at 4f6931b. They were run with this branch merged
into #1315, because this PR's own test site holds the live-check data.
- New `ai-workspace-update-proposals.spec.ts` (8 tests): current next to
new, plus editing; the server's message on an invalid edit; a second
page after approving; approving in a second page while the first is
still writing; a stale field; deselecting one of three changes; a
reopened discarded proposal; the tagline.
- New `ai-workspace-html.spec.ts` for the content renderer. It covers
every element shown as plain text instead of rendered, and the notice
naming blocks whose settings a content change alters.
- From the second review round: "an approval whose answer is lost after
it wrote shows what was applied" and "discarding a change another page
already applied shows what was applied".
- **Test-first:** tests written before their change failed before it.
- **Other checks:** PHPStan finds no errors. phpcs is clean on the
changed plugin PHP. tsc, lint-js and the build are clean.
- **Live check with a real provider** (on a separate test site, not the
demo one), one 19-turn chat: 7 proposals and 9 changes approved, all
reported as updated, none stale, locked or failed.
  - The site title and tagline were both changed.
- A published post's title and the excerpts of the three latest posts
were updated.
- The same post's content was rewritten four times: separators, headings
and lists added, sections filled in, the intro changed, and Ctrl to
Ctrl/Cmd. After each rewrite the post was still valid block markup, with
every block parsed and 6 revisions kept. Rewrites after the first one
added separators were still accepted.
- When asked to fill in sections it had no facts for, the assistant
asked which ones to use rather than inventing them.
- **Second live check** (2026-11-07, Anthropic `claude-sonnet-5`, at
4f6931b, through the workspace REST routes as an administrator): one
turn and one approval per write kind, with the posts and options read
straight from the database before and after.
- A post title, an excerpt approved with the person's edited value in
place of the model's, block content with a paragraph added, and the site
title and tagline together. Each was reported as updated.
- After each turn the database was unchanged. Approving changed only the
field proposed (plus `post_modified`), and the edited excerpt was
written as edited.
- The block content kept its existing blocks byte for byte, and the new
paragraph was a `wp:paragraph` block.
- A second approval of the same proposal returned the stored results and
wrote nothing.
- **Found in that run and fixed in 36820b2:** an applied card no longer
showed what the field now held. It now shows "Now: …". The tool-steps
summary also said "1 steps".
- **PHPUnit added in the second review round**, each failing before its
fix: `test_a_stale_lock_replaced_before_the_delete_is_not_deleted`,
`test_a_writer_that_throws_part_way_leaves_the_proposal_failed`,
`test_discarding_while_an_approval_holds_the_lock_is_refused`,
`test_an_executed_proposal_read_after_expiry_shows_its_outcome`,
`test_approving_with_nothing_selected_is_refused_for_any_kind`,
`test_a_post_another_hook_updates_during_the_write_keeps_its_own_columns`
and
`test_content_proposed_after_the_post_changed_since_it_was_read_is_refused`.

**Code review, two rounds:**
- **Round one** (run `20261106-154448-0faae422`): 8 reviewers and an
independent validator. A bug in how the reviewer prompts were built cut
off the PR's intent and the location of its diff, so each reviewer
worked out the scope on its own. Its findings were checked against the
code and are fixed in 25748bd:
- content changes were refused for posts with image or separator blocks;
  - the card dropped markup that would publish;
  - content could only be read as stripped text;
  - a proposal could name the same field twice;
  - missing tests and a docs line.
- **Round two** (run `20261106-212611-pra2rerun`): the same 8 reviewers
on the full diff at 36820b2, with the intent and diff in every prompt.
Each finding was reproduced or traced in the code before being fixed,
rather than going through the separate validator. Fixed in 476784a to
4f6931b:
- after a lost or 5xx approval response, the card said nothing was
changed without checking (three reviewers found this). It now reads the
proposal back and shows what was applied;
- a writer that threw left the proposal executing and the lock held. It
now settles as failed, keeps the partial results and tells the model;
- a discard didn't take the approval lock, and could land during an
approval;
  - two requests reclaiming a dead lock could both get it;
- an applied proposal opened after its expiry showed as expired instead
of showing what was applied;
- discarding in a second window after the first applied said nothing was
changed;
- the "select at least one item to create" message was shown on update
cards;
- the column pin leaked into other posts written by hooks during the
save;
- a change to a wrapping block's settings, such as a Query Loop's
arguments, was invisible in the card. The card now names those blocks;
- an edit made to a post between the assistant reading it and proposing
a change could be overwritten. A content change based on an older read
is now refused;
- one interrupted-approval path re-ticked items the person had unticked.

The cross-model pass didn't run, because no model CLI from another
provider is installed.

## Unapplied review findings

- [ ] P2: `includes/Experiments/AI_Workspace/Propose_Post_Changes.php`:
the four propose abilities repeat the same setup code (turn check, meta
block, proposal envelope). A shared base would remove it. Deferred: it
follows the existing pattern, and it's a refactor outside this PR's
scope.
- [ ] P2: `Propose_Post_Changes` and `Propose_Site_Identity` each check
for a duplicate target themselves. The kind could own a target key, and
the store could refuse duplicates once. Deferred: same refactor scope as
above.
- [ ] P2: `src/experiments/ai-workspace/utils/proposal-card.ts`: the
client works out which proposal types are updates (`UPDATE_KINDS`,
`SITE_FIELDS`) on its own. The server could send `is_update` and the
target instead. Deferred: it changes the contract between client and
server.
- [x] Residual risk (fixed in 22d5d2c): `decline_proposal()` doesn't
take the approval lock, so a discard can interleave with an approval
that has claimed the lock but not yet saved.
- [x] Residual risk (fixed in 3c4cd75): `keep_other_columns()` pins the
`*_save_pre` filters for the whole `wp_update_post()` call. A
`save_post` hook that writes a different post would receive this post's
columns.
- [ ] Residual risk: approving while the same user has the post open in
the block editor passes their own post lock. A later autosave from that
tab could revert the change.

## Screenshots or screencast

**Post changes: each current value beside the proposed one**

![Post changes: each current value beside the proposed
one](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1314-1-post-changes-card.png)

**Editing a proposed value before approving**

![Editing a proposed value before
approving](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1314-2-post-changes-editing.png)

**A tagline proposal**

![A tagline
proposal](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1314-3-tagline-card.png)

**After approval: the post is updated**

![After approval: the post is
updated](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1314-4a-outcome-updated-post.png)

**After approval: the new tagline is live**

![After approval: the new tagline is
live](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1314-4b-outcome-tagline-now.png)

**A field changed since the proposal is left alone and reported**

![A field changed since the proposal is left alone and
reported](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1314-4c-outcome-stale.png)

## Changelog Entry

> Added - AI Workspace can propose changes to a post's title, excerpt or
content, and to the site title and tagline, applied only after approval,
with current and new values shown side by side.

**Post-deploy monitoring:** no additional operational monitoring is
required. This is an experiment behind the AI Workspace toggle, off by
default, and every write needs explicit approval.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- wp-playground-preview:start -->
<a
href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1314-de66f8c8c5056c5bac61514daa130d6d890c275d.zip%22%7D%7D%5D%7D"
target="_blank" rel="noopener noreferrer">
<img
src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg"
alt="Open WordPress Playground Preview" width="220" height="57" />
</a>
<!-- wp-playground-preview:end -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Vrishabhsk <vrishabhsk@gmail.com>
whyisjake added a commit that referenced this pull request Nov 13, 2026
#1315)

## What?

Related: #1287

The AI Workspace assistant can now answer questions about the site
itself, and point people to the right admin screen:
- **"What PHP version am I running?"** It reads the site's name,
tagline, language, timezone, theme and, for admins, the WordPress and
PHP versions.
- **"Where do I hide my site from Google?"** It answers with a link to
Settings → Reading.

This is the second stacked PR for #1287, on top of #1314. In a live run
of #1314, the assistant proposed a new tagline and site title without
being able to read the current ones ("I can't see your current site
title"). This PR fixes that.

## Why?

#1287's first version needs the agent to answer site questions and
navigation questions directly. Before this, the workspace could read
posts but nothing about the site. It also had no way to know which admin
screen handles which job.

## How?

**`ai/get-site-info`** returns these fields, and no others:
- the site name, tagline and home URL;
- the language and timezone;
- the date and time formats;
- the active theme, and whether it's a block theme.

The WordPress and PHP versions are included only for users who can see
Site Health (`view_site_health_checks`), which on multisite means super
admins, as in core. It never returns the admin email, database details
or the plugin list. Core's own `core/get-site-info` returns the admin
email, so it joins the workspace's `NEVER_ADMITTED` list next to the
environment and settings readers.

**`ai/find-admin-screens`** matches a request against a curated map of
33 core admin screens on the server, using titles and keywords. There's
no model call inside it. It returns up to five screens, best match
first, and only screens the current user can open, as `admin_url()`
links on the site's own host.
- Sites and plugins can add or remove entries with the new
`wpai_admin_screens` filter. A filtered entry whose path has a scheme, a
leading slash or `..` is dropped.
- The Site Editor is offered only on block themes, and the Customizer
only on classic ones.

**Both are plain read abilities.** Any logged-in user can call them,
they're annotated read-only and not open-world, and they're listed over
MCP like the content reads. Both join the workspace's curated tool list,
because policy admission is off by default.

#1250's palette ability, which makes a nested model call over the
palette's own commands, stays separate. It comes with the Command
Palette PR.

Site-info field choices are ported from #1214's `Read_Site`, credited to
@Vrishabhsk with Co-authored-by.

### Use of AI Tools

AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for:
planning, implementing the changes and tests, and code review.

I've reviewed the changes, understand them and can explain them under
review. They have all been tested locally.

## Testing Instructions

1. Enable AI Workspace and connect a provider.
2. Ask "What PHP version am I running?". The assistant answers with your
PHP version.
3. Ask "Where do I hide my site from Google?". The reply links Settings
→ Reading, and following the link opens it.
4. As an editor, call `ai/get-site-info` through the Abilities Explorer
or REST. The response has no version fields.

**Tests run** (all passing):
- **PHPUnit, full suite:** 3325 tests on WordPress latest.
- **`Get_Site_InfoTest`:**
`test_administrator_gets_every_field_including_versions`,
`test_editor_gets_the_fields_without_versions`,
`test_manage_options_without_site_health_access_gets_no_versions`,
`test_no_response_carries_admin_email_siteurl_database_or_plugins`,
`test_executes_without_any_input`, `test_name_and_tagline_are_decoded`,
`test_timezone_falls_back_to_the_utc_offset`,
`test_logged_out_visitor_is_refused`,
`test_output_schema_marks_the_versions_optional`,
`test_registration_has_a_category_and_read_only_annotations`,
`test_declared_to_the_model_for_administrator_and_editor_with_admission_off`
and `test_listed_for_mcp`.
- **`Find_Admin_ScreensTest`:**
- Queries:
`test_hiding_the_site_from_google_finds_reading_settings_first`,
`test_stopping_spam_comments_finds_discussion_settings_first`,
`test_changing_the_timezone_finds_general_settings_first`,
`test_singular_and_plural_settings_match_alike`,
`test_returns_at_most_five_screens` and
`test_stopword_only_query_returns_an_empty_list`.
- Access:
`test_editor_asking_for_plugins_gets_no_plugins_or_settings_screen`,
`test_filter_added_screen_appears_only_for_users_with_its_capability`,
`test_filter_can_remove_a_core_screen` and
`test_every_url_is_on_the_admin_host`.
- Themes and matching:
`test_block_theme_offers_the_site_editor_not_the_customizer`,
`test_classic_theme_offers_the_customizer_not_the_site_editor` and
`test_stem_is_idempotent_for_every_word_in_the_map`.
- Registration: `test_logged_out_visitor_is_refused`,
`test_registration_has_a_category_and_read_only_annotations`,
`test_declared_to_the_model_for_administrator_and_editor_with_admission_off`
and `test_listed_for_mcp`.
- **`Tool_PolicyTest`:**
`test_core_get_site_info_is_withheld_with_perfect_annotations`. It
failed before `core/get-site-info` was added to `NEVER_ADMITTED`.
- **e2e (Chromium):** all `tests/e2e/specs/experiments/ai-workspace*`
specs, 126 passed. That includes the new
`ai-workspace-navigate.spec.ts`: asking where to change the timezone
links Settings → General, and the link opens it.
- **Test-first:** tests written before their change failed before it.
- **Other checks:** PHPStan finds no errors, phpcs is clean on the
changed plugin PHP, and the build passes.
- **Not run yet:** a live check against a real provider.

**Code review:** six reviewers ran: correctness, security, adversarial,
testing, maintainability and agent-native. The orchestrator then
reproduced each finding on a test site, instead of running the skill's
separate validator. Four reviewers found nothing. The confirmed findings
are fixed in 21cf902:
- a call with no input failed;
- the name and tagline came back HTML-escaped;
- the versions were visible to sub-site admins on multisite;
- the screen matcher missed singular words;
- the theme branch had no test.

## Known limits

- An entry a plugin adds through `wpai_admin_screens` is trusted to name
the capability its screen needs. A weaker capability gives users a link
they can't open. It never gives a link off the site's host.
- Keywords are English only. A query in another language matches only
the translated screen titles.
- The navigation e2e test's link comes from the mocked model reply, so
it proves the tool round trip and the link working, while the ranking
itself is covered by `Find_Admin_ScreensTest`.

## Screenshots

**Asking where to change the timezone links Settings → General**

![Asking where to change the timezone links Settings →
General](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1315-5-navigate-timezone.png)

## Changelog Entry

> Added - AI Workspace can answer questions about the site (name,
tagline, theme, and WordPress and PHP versions for admins) and link to
the admin screen for a request.

**Post-deploy monitoring:** no additional operational monitoring is
required. This is an experiment behind the AI Workspace toggle, off by
default, and it adds read-only abilities.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- wp-playground-preview:start -->
<a
href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1315-2113f328ff63bca3163299767db00d0699313222.zip%22%7D%7D%5D%7D"
target="_blank" rel="noopener noreferrer">
<img
src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg"
alt="Open WordPress Playground Preview" width="220" height="57" />
</a>
<!-- wp-playground-preview:end -->

---------

Co-authored-by: Vrishabhsk <vrishabhsk@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
whyisjake added a commit that referenced this pull request Nov 13, 2026
…ase, Wapuu busy states (#1317)

## What?

Related: #1287

The AI Workspace gains an audit trail, personal-data export and erase,
and Wapuu busy states:
- **One audit trail.** Every agent event is one `agent` row in the AI
Request Log and one call of a new `wpai_agent_event` action. Events are
tool calls (including withheld ones), each item an approval writes, and
each step in a proposal's life: created, edited, declined, expired,
failed, or refused because its chat was deleted. The action fires even
when AI Request Logging is off.
- **Chats are personal data.** Tools → Export Personal Data includes the
person's saved chats, and Tools → Erase Personal Data deletes them. This
works with the experiment off.
- **Wapuu.** While a turn runs, the transcript shows a working Wapuu
instead of a spinner, then a celebrating one for a moment when the turn
finishes, or an oops one next to an error.

This is the fourth stacked PR for #1287, on top of #1316, #1315 and
#1314.

## Why?

#1287 asks that a site owner can see everything the agent did, was asked
and was refused, in one place, and that audit plugins can hook it.
Before this, workspace rows were mixed in with every other `ability`
row, proposal events weren't logged at all, and nothing fired with
logging off. Saved chats are personal data that core's export and erase
tools didn't know about. And Jeff posted a Wapuu set on #1287 so a long
turn looks busy rather than stuck.

## How?

**`Agent_Audit`** is the one place agent events are recorded.
- It fires `wpai_agent_event( $operation, $status, $context, $error )`,
then writes the row through `log_ai_request()` with the new `agent`
type.
- The two existing log calls, for tool calls in `Turn_Runner` and for
written items in `Proposal_Writes`, now go through it. Proposal events
are recorded in `Proposal_Store` and `Proposal_Controller`:
  - created, when a proposal is stored;
  - edited, when an approval carries edits, naming the edited items;
  - declined;
- expired, once, when an expired proposal is next read, since it's
deleted then;
- failed, when a write throws or is interrupted for longer than the
approval lock;
  - refused, when an approval comes after its chat was deleted.
- Context names the conversation, the proposal and its item keys, the
post and field, or the option. It never carries post content or option
values.
- The hook covers agent turns and approvals only. A direct MCP call to
an ability doesn't fire it. Docs say so.
- The log screen gains the `denied` status, ported from #1214, and agent
rows are labelled "Agent". Rows logged before this keep the `ability`
type.
- #1214's `wp_after_execute_ability` listener isn't ported:
`Turn_Runner` already logs each call, so it would log them twice.

**`Conversation_Privacy`** registers an "AI chats" exporter and eraser.
- They're hooked from `Main`, next to the chat ownership filter, so they
work while the experiment is off.
- The export has one item per chat: name, created and updated dates,
whether it's archived, and each turn's message and reply. Tool results
are left out. It pages at 20 chats.
- The eraser deletes all the person's chats.
- Chat IDs are read straight from the posts table, as the user-deletion
cleanup already does, so archived chats are found even while their
status isn't registered. That reader is now shared, as
`Conversation_Store::chat_ids()`.
- A proposal from an erased chat can't be approved, because an approval
is refused once its chat is gone.

**Wapuu** sprites replace the transcript's spinner.
- **Sprites:** `working` while a turn runs, `celebrating` for 1.8
seconds after one finishes, and `oops` next to an error. They come from
the set @jeffpaul posted on #1287.
- **Accessibility:** each sprite is an `<img alt="">`. The existing
"Responding…" text and error text stay as the status.
- **Reduced motion:** an SVG inside an `<img>` doesn't reliably follow
the page's setting. So with reduced motion on, the component switches
each sprite's animations off in its markup, which gives the same still
pose.
- **Scope:** only busy, done and error states ship. Per-tool sprites
need streaming to know which tool is running.
- **Credit:** the sprites are derived from Kazuko Kaneuchi's original
Wapuu, GPL-2.0-or-later, and credited in `CREDITS.md`.

### Use of AI Tools

AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for:
implementing the changes and tests, and code review.

I've reviewed the changes, understand them and can explain them under
review. They have all been tested locally.

## Testing Instructions

1. Enable AI Workspace and AI Request Logging, and connect a provider.
2. Send a message. A Wapuu shows beside "Responding…", then a
celebrating Wapuu for a moment when the reply arrives.
3. Ask for a new tagline. Edit the proposed value and approve it. Ask
for a draft and discard it.
4. Open Tools → AI Request Logs and filter by type `agent`. The tool
calls, `proposal_created`, `proposal_edited` and `proposal_declined`
rows are there, none of them with the tagline's text.
5. Tools → Export Personal Data for your own email: the download has an
"AI chats" section with your chats. Erase personal data for a test user
who has chats: their chats are gone.
6. With reduced motion turned on in your OS, the Wapuu is still.

**Tests run** (all passing):
- **PHPUnit, full suite:** 3398 tests, single site and multisite, on
WordPress latest.
- **`Agent_AuditTest`:** `test_agent_is_a_log_type`,
`test_an_event_writes_one_row_and_fires_the_hook`,
`test_the_hook_fires_with_logging_off`,
`test_a_proposal_event_names_the_proposal_and_its_items_only` and
`test_a_proposal_without_a_kind_is_recorded_as_drafts`.
- **`Proposal_ControllerTest`:**
`test_each_proposal_event_is_recorded_once_in_order`,
`test_events_fire_the_hook_with_logging_off`,
`test_an_expired_proposal_is_recorded_once`,
`test_an_expired_proposal_read_through_the_store_is_recorded_once`,
`test_an_interrupted_write_is_recorded_failed_once`,
`test_a_writer_that_throws_is_recorded_failed` and
`test_an_approval_for_a_deleted_chat_is_recorded_denied`.
- **`Turn_ControllerTest`:**
`test_a_turn_records_a_withheld_call_and_a_proposal_in_order`, and
`test_every_tool_call_writes_exactly_one_log_row` updated for the
`agent` type.
- **`Post_Field_ProposalTest`:**
`test_a_content_update_records_the_field_not_the_content`.
- **`AI_Request_Log_ControllerTest`:**
`test_get_logs_filters_agent_rows_by_type_and_denied_status`.
- **`Conversation_PrivacyTest`:**
`test_the_exporter_and_eraser_are_registered_without_the_experiment`,
`test_export_returns_every_chat_with_its_prompts_and_replies`,
`test_export_with_the_experiment_off_includes_archived_chats`,
`test_export_pages_at_twenty_chats`,
`test_erase_removes_the_persons_chats_only`,
`test_a_proposal_in_an_erased_chat_cannot_be_approved` and
`test_an_unknown_email_exports_and_erases_nothing`.
- **e2e (Chromium):** all `ai-workspace*` specs, the palette spec and
the request-log spec, 168 passed in one run on a fresh site. That
includes the new "AI Workspace Wapuu" tests in `ai-workspace.spec.js`: a
running turn shows the busy Wapuu beside "Responding…"; with reduced
motion the busy Wapuu is a still frame; a failed turn shows the error
Wapuu with the error; a finished turn shows the done Wapuu briefly. Each
Wapuu test also ran three more times, 12 of 12 passing.
- **Test-first:** the audit tests failed before `Agent_Audit` existed.
The privacy tests were written before `Conversation_Privacy` but first
run after it, so they have no recorded red run.
- **Other checks:** PHPStan finds no errors, phpcs is clean on the
changed plugin PHP, and tsc, lint-js and the build are clean. Style lint
reports errors in `ai-request-logs/index.scss` and
`ai-workspace/index.scss` that are already on the base branch.
- **Live check:** core's exporter and eraser lists include "AI chats" on
a running site, and the screenshots below come from one.
- **Not run yet:** a live check against a real provider, and the PHPUnit
suite on WordPress trunk.

**Code review:** seven reviewers ran on this PR's own diff (correctness,
security, adversarial, testing, maintainability, frontend races and API
contract), plus an independent validator. The verdict was "Ready to
merge" with no actionable findings. The one candidate, that the status
filter rejects `skipped`, was rejected because it's already on the base
branch. Applied afterwards in eef886a: agent rows were labelled "Text"
on the log screen, a docblock still said these rows use the `ability`
type, and the store's expiry path had no test.

**One test from #1316 hardened** (1060833): its short palette search
for "q" matched "AI Request Logs" whenever AI Request Logging was on,
which the request-log spec leaves on when both run in one session. It
now searches for "~".

## Screenshots

**A running turn**

![The working Wapuu beside
"Responding…"](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1317-1-wapuu-busy.png)

**A finished turn**

![The celebrating Wapuu under the
reply](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1317-2-wapuu-done.png)

**A failed turn**

![The oops Wapuu beside the
error](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1317-3-wapuu-error.png)

**Agent events in the AI Request Log**

![proposal_created, proposal_expired and proposal_refused rows labelled
Agent](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1317-4-log-agent-events.png)

**AI chats in a personal-data export**

![The AI chats group in an export, with each chat's name, dates,
archived flag, message and
reply](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/1317-5-export-ai-chats.png)

## Known limits

- After an erase, a pending proposal from an erased chat can still be
read by its owner, though not approved, until it expires (about 90
minutes).
- "Recorded once" for an expired or interrupted proposal holds for
requests that run one after another. Two requests reading the same
proposal at the same instant can each record it.
- A `wpai_agent_event` listener that throws during an approval write
marks the proposal failed, as any WordPress hook would. The hook isn't
wrapped.
- The log screen's status filter doesn't accept `skipped`, which item
rows have used since before this PR.
- Workspace rows written after this are `agent`, not `ability`, so a
view filtered to `ability` no longer shows them.

## Changelog Entry

> Added - AI Workspace records every agent tool call and proposal event
in the AI Request Log under an `agent` type, with a `wpai_agent_event`
hook that fires even when logging is off; saved chats are included in
personal-data export and erase; and a Wapuu shows while a turn runs,
finishes or fails.

**Post-deploy monitoring:** no additional operational monitoring is
required. This is an experiment behind the AI Workspace toggle, off by
default. The exporter and eraser run only when an administrator
processes a personal-data request.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- wp-playground-preview:start -->
<a
href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1317-77686452fbd3e34a0cb582c18648d7667c78a603.zip%22%7D%7D%5D%7D"
target="_blank" rel="noopener noreferrer">
<img
src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg"
alt="Open WordPress Playground Preview" width="220" height="57" />
</a>
<!-- wp-playground-preview:end -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
whyisjake added a commit that referenced this pull request Nov 13, 2026
## What?

Related: #1287

The docs pass for the #1287 stack. AI Workspace keeps its name and is
documented as the plugin's one agent. The experiment doc, `readme.txt`,
`README.md`, the changelog and the settings card now describe what #1314
to #1317 added. No code paths change.

This is the fifth and last stacked PR for #1287, on top of #1317, #1316,
#1315 and #1314.

## Why?

#1287 folds two planned experiments into AI Workspace: Site Agent
(#1214) and Command Palette AI Search (#1250). A reader of the docs,
readme or changelog should learn that from them. Before this, the
settings card and readme still described a workspace that only creates
drafts and templates. The changelog had nothing for the write, palette,
audit, privacy or Wapuu changes, `README.md` had no AI Workspace entry
at all, and "Site Agent" was still listed under Coming Soon.

## How?

- **`docs/experiments/ai-workspace.md`**
- The summary and key features cover changes to existing content, site
answers and screen links, the chats panel, the Wapuu, the audit log and
personal-data export.
- A new "One agent" section says what Site Agent and Command Palette AI
Search proposed and where each now lives. It also says that the name,
menu, URL and every identifier, including the experiment ID
`ai-workspace`, are unchanged.
- The entry-points list names every ability the experiment registers,
and `Conversation_Privacy`.
- A stale limitation is removed. It said chats have no history screen,
but the chats panel ships.
- **`readme.txt` and `CHANGELOG.md`**
- Added: changes to existing content, the palette's AI search and Ask
AI, the `agent` log rows, chats in export and erase, and the Wapuu.
- Developer: `wpai_agent_event`, the two new proposal filters, the MCP
visibility change, `raw: true`, and the `ability` to `agent` log type
change.
- `CHANGELOG.md` also gains the two ability lines #1315 added only to
`readme.txt`.
- **`README.md`:** adds the missing AI Workspace entry.
- **Both readme files:** "Site Agent" leaves Coming Soon.
- **Settings card:** the AI Workspace description says it answers site
questions, proposes changes to posts and the site title and tagline, and
adds AI to the command palette.

The name stays "AI Workspace". Nothing on #1287 has settled on another
name.

### Use of AI Tools

AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for:
writing the documentation and changelog entries, checking them against
the code, and code review.

I've reviewed the changes, understand them and can explain them under
review. They have all been tested locally.

## Testing Instructions

1. Open Settings → AI. The AI Workspace card reads as in the screenshot
below.
2. Read `docs/experiments/ai-workspace.md` → "One agent", and the
Unreleased changelog in `readme.txt` and `CHANGELOG.md`.

**Tests run** (all passing):
- **PHPUnit, full suite:** 3398 tests, single site and multisite, on
WordPress latest. Only the settings-card string is code, and no test
asserts it.
- **Other checks:** phpcs and `php -l` are clean on `AI_Workspace.php`.
- **Name check:** a grep for "Site Agent" and "Wordspace" across
`includes/`, `src/` and the built assets finds nothing user-visible.
- **Claims checked against the code:**
  - the abilities `AI_Workspace::register()` registers;
  - `meta.mcp.public` false on the propose and ask-user abilities;
- the `wpai_workspace_write_proposals_enabled` and
`wpai_workspace_proposal_kinds` filters;
  - `raw` on `ai/read-content-bodies`;
  - the chats panel's rename, archive and delete actions;
  - the three in-page anchors the doc links to.
- **Not run:** e2e. No script, style or behavior changes.

**Code review:** `ce-code-review` sized this diff to a single-context
review: 51 changed lines, two of them code. It found nothing and gave
"Ready to merge". Its one residual is applied in 0b06540: the doc's
feature bullet now says rows are written while AI Request Logging is on.

## Screenshots

**The settings card**

![The AI Workspace card on Settings →
AI](https://gist.githubusercontent.com/whyisjake/f358b73180d8e893eec6624fd1e50ded/raw/pr-e-settings-card.png)

## Known limits

- The changelog lines for #1314, #1316 and #1317 are added here rather
than in those PRs, so they land only when this one merges after them.

## Changelog Entry

> Changed - AI Workspace is documented as the plugin's one agent: it now
includes what the Site Agent and Command Palette AI Search proposals
planned, under its existing name.

**Post-deploy monitoring:** no additional operational monitoring is
required. Documentation and one settings-card string.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- wp-playground-preview:start -->
<a
href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1318-aa0faf515572fcec68b35f0b8a0634d387875fd1.zip%22%7D%7D%5D%7D"
target="_blank" rel="noopener noreferrer">
<img
src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg"
alt="Open WordPress Playground Preview" width="220" height="57" />
</a>
<!-- wp-playground-preview:end -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@jeffpaul

Copy link
Copy Markdown
Member

Closing in favor of #1004, thanks for the work here @Vrishabhsk and note you'll be credited as 1004 merges/releases.

@jeffpaul jeffpaul closed this Nov 17, 2026
@jeffpaul jeffpaul removed this from the 1.6.0 milestone Nov 17, 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.

Explore an admin Site Agent for executing WordPress actions

2 participants