Repository navigation
Sync the content/users trio fixtures and backports to trunk (r65075 / r65002) - #16
Merged
Merged
Conversation
PLAN-mcp-adapter-poc.md step 1.5 (sec. 1 resolution, sec. 4.0): the 8 media/terms abilities — wp/media-query, wp/media-upload, wp/media-update, wp/media-delete, wp/terms-query, wp/term-create, wp/term-update, wp/term-delete — did not carry the public meta, so the MCP adapter's McpAbilityExposure falls back to meta.public and excludes them from the MCP surface. This adds the MCP-specific flag mcp => array( public => true ) to their ability_meta(), which McpAbilityExposure checks first, without changing their high-level publicness (no public key added) — the team decides between the mcp flag and full meta.public before this lands on the package's main. annotations/show_in_rest and every other meta key are untouched; no other ability changes. The Registrar's Gate-6 public_only probe reads the ability's own public meta only — the flag is additive there. Tests: the registered-once tests of the 8 abilities (media-query/upload/ update/delete, terms-query, and the term-writes contract test) each now also assert the exact mcp meta shape ( array( public => true ) ) and that the high-level public meta is unchanged (get_meta_item( 'public', false ) === false). No assertions were deleted.
PLAN-ai-plugin-poc.md sec. 7.0 (sec. 10.2 resolution, Option A): core/content-query, core/settings-get and core/users-query gain 'show_in_rest' => true in ability_meta() under a // Package: marker, so the abilities stay exposed over core's REST abilities routes on every supported WordPress (6.9+) — core's own registration omits the flag and relies on meta.public seeding it, which WordPress 7.1+ only does. On 7.1+ the seeding makes the flag redundant but harmless. The same accommodation the AI plugin's synced copies carry with their // Plugin: marker, made once in the package. tools/coreify.php tolerates exactly this marked line and nothing more, symmetrically: a narrow PKG_META_ACCOMMODATIONS map (meta key => marker-comment lines) makes --reverse re-inject the flag (plus markers) into regenerated backports when the fixture's meta lacks it, and forward drop it behind marker-verbatim checks when unwrapping ability_meta() into core-shaped registration args — both semantic-diff invariants of the check gate stay green, and a mapped key without the const's exact markers fails the forward path loudly. The trio tests now pin meta.show_in_rest === true with the high-level public meta unchanged (PR #12's pattern). Stacked on #12 (add/mcp-public-meta) so the ai PoC pins one integration ref.
PLAN-ai-plugin-poc.md sec. 7.0b (from the sec. 10.7 preflight stop-and-report): our trunk fixture snapshots predated two core changes the AI plugin's copies already carry — content r65075 (author-visibility rework) and users r65002 (registered/dotted-fields rework). Refresh both fixtures from today's wordpress-develop trunk (settings was already current), regenerate src/Content/Content_Query.php and src/Users/Users_Query.php verbatim through coreify --reverse (the sec. 7.0 show_in_rest '// Package:' meta accommodation survives regeneration by design; PKG_META_ACCOMMODATIONS markers unchanged), and update the tests for core's new shapes. Sync deltas, verified hunk-by-hunk against the expected set: - content: get_visible_author() memoized per query via $visible_authors, an edit_user capability branch, the posts count restricted to show_in_abilities- exposed viewable post types, the author field nulling name/slug for authors the current user may not see; where.author_slug became a where.author object (id/slug) with where[author]/where[author][id]/where[author][slug] error paths and empty-page (not error) answers for authors that name no visible user; date.local became date.site; trunk's array_all()/array_any() (core's compat polyfills cover PHP < 8.4; the users profile gains the DateTimeZone import). - users: registered_date became the registered.site/registered.gmt object, with the get_field_paths()/is_field_requested() dotted projection and the dotted fields enum. Tests adapt to the new shapes (registered.site/gmt, dotted fields enum, author object filter and its error paths) and add coverage for the visible-author rule (memoization, the edit_user branch, filter matching) and the users dotted projection — adapted, never deleted. Settings is untouched: its fixture is byte-identical to today's trunk. Stacked on #15 (add/trio-show-in-rest) and #12 (add/mcp-public-meta), for the ai PoC to pin its integration ref on this head.
8 of 9 tasks
nikmclaughlin
added a commit
that referenced
this pull request
Nov 11, 2026
The build spec served its purpose: WP0-WP7 are complete and the prototype has shipped (PRs #2-#16). Its durable content lives in the product docs (README, NAME-LIFECYCLE.md, CONTRIBUTING.md); git history retains the file. The document contained local-machine paths and agent-workflow details unsuitable for a centrally-owned repository.
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.
What?
§7.0b trio trunk-sync refresh (stacked on the §7.0 meta-flag PR): the content and users trunk fixture snapshots are refreshed from today's
wordpress-developtrunk and the two backports are regenerated throughtools/coreify.php --reverseand replaced verbatim:core/content-querytakes core's r65075-era class (the author-visibility rework) andcore/users-querytakes core's r65002-era class (theregistered/dotted-fields rework).core/settings-getwas already current with trunk — untouched. Tests update for core's new shapes;CHANGELOG.mdgains### Changedentries (the users one is breaking).Why?
The §7.0 preflight ( Worker A stop-and-report, recorded in the plan §10.7) verified against today's trunk that our fixture snapshots (2026-10-20 refresh, re-verified 2026-10-23) predate two core changes the AI plugin's 1.5.0 synced copies already carry — i.e. core-side progress, not plugin drift: a
core/content-queryandcore/users-querythat stay one sync behind would ship behaviors core no longer carries. The plugin's PoC pins one package integration ref, so this sync lands stacked before the ai PoC pins its ref. Spec:PLAN-ai-plugin-poc.md§7.0b, §10.7 (finding 7), worker brieftools/out/worker-a2-brief.md.How?
tests/Fixtures/abilities-api/with provenance headers updated in the existing convention (Refreshed: 2026-11-06 by Worker A (§7.0b trio trunk-sync refresh...); ..., verified against the WordPress/ai 1.5.0 synced copy).coreify --reverseon both fixtures; the outputs replacesrc/Content/Content_Query.php/src/Users/Users_Query.phpverbatim (code), with the §7.0 hand-finished comment shell re-applied (file header, class + authoring-method docblocks, theinput_schema()prologue comments, and the trunkis_stringguard's@phpstan-ignorenote) — all comment/whitespace-only, and the mB drift-guard verifies shipped ≡ reverse(fixture) stays green. The §7.0 accommodation survives regeneration by design: both regenerated files carry'show_in_rest' => truebehind the exactPKG_META_ACCOMMODATIONS// Package:marker lines (verified).core/users-querycoreify profile imports gainDateTimeZone(core r65002 introduces it in the class) — the profileimportskey is the designed mechanism for the packageuseblock.UsersQueryTest:TRUNK_FIELDSgainsregistered(replacingregistered_date) plus a newTRUNK_FIELD_PATHSfor the dottedfieldsenum; the self-view assertion checks theregistered{site,gmt} object; newtest_execute_dotted_field_projectionpins path-level sub-field projection.ContentQueryTest: schema pins for the newwhere.authorobject (idmin 1 /slugminLength 1 /additionalProperties: false/minProperties: 1); the date field paths becomedate.site/modified.site; the old "unknown author slug ⇒ error" case adapts to core's new answer (unknown/invisible author ⇒ empty page, no error), and the filter-level rejections move to the new error paths (where[author],where[author][id],where[author][slug]); new tests pin the author filter (idmatches the stored author,id+slugmismatch ⇒ empty page), the author-field visibility rule (nullname/slugfor an invisible author; theedit_userbranch opens the identity), and the per-query memoization (a memoized judgment is honored; a fresh query resets the memo). Cap isolation rides on user-level caps only — never site roles (the test also cleans up any previously persisted test role).Diff vs. expectations (brief §3 — stop-and-report gate)
The code-level diff of both regenerated backports against their §7.0-era versions was reviewed hunk-by-hunk. Everything falls within the expected sync-delta set, with two same-sync trunk modernizations the brief's headline did not name explicitly — surfaced here and in the CHANGELOG rather than absorbed silently:
$visible_authorsper-query memo,get_visible_author()with theedit_userbranch and theshow_in_abilities-restricted viewable posts count (replacingget_author_by_slug()), theauthor-field visibility nulling, and the integralwhere.authorobject-filter rework (the filter and field share the visibility rule; error paths and empty-page semantics listed above).registered{site,gmt} schema/output,format_registered_date(),get_field_paths(),is_field_requested()viarest_is_field_included(), and the dotted fieldsenum.date.local→date.site(andmodified.local→modified.site) — the same dotted-field rename class as users'registered, arriving with the sync window. ContentCreate/ContentUpdate'sdate.localinput contract is the package-authored write ability (ai PR #1025 port), unaffected and untouched.array_all()/array_any()replace two loops in the content class. These are PHP 8.4 functions, but runtime-safe on every supported floor: core's ownwp-includes/compat.phppolyfills both (verified in trunk,@since 6.8.0; trunk's$required_php_versionremains 7.4). The plugin copies swap them for loops only because its static-analysis WP stubs do not declare them — not a runtime constraint.Stacked on §7.0 PR #15 (
add/trio-show-in-rest@9ab085d), which is stacked on #12 (00d65cf). Not to be merged until the team resolves #12 and the §7.0 PR. Note for the ai PoC: the integration pin moves to this PR's head SHA (add/trio-trunk-sync) — its vendored snapshot then carriesmain+ #12 + §7.0 (the meta flag) + this sync, per the plan §11 work order.Use of AI tools
Tool(s): goose (agent) via the Solo orchestration harness. Model(s): glm-5.3-flash:cloud. Used for: fixture refresh, regeneration+verification, tests, gate runs, and this description's drafting basis (plan-driven per
PLAN-ai-plugin-poc.md§7.0b; worker brieftools/out/worker-a2-brief.md). Reviewed and edited by the committer.Testing Instructions
composer run lint:phpcs && composer run lint:phpstan && composer run verify:manifest && composer run verify:coreify— all clean;verify:coreifyPASS on all three pairs (mA + mB), round-trip invariant holds, and--reverseon the refreshed fixtures regenerates files that already carry the// Package:-marked flag.--filterruns are not meaningful here: registration is suite-context-dependent):npx @wordpress/env start --config=.wp-env.stable.json --update && npx @wordpress/env run tests-cli --config=.wp-env.stable.json bash -c "cd wp-content/plugins/wordpress-abilities && vendor/bin/phpunit".wp-env.trunk.jsonChangelog entries
### Changed(CHANGELOG.md): the users-queryregistered_date→registereddotted-object breaking change; the content-query author-visibility/filter rework anddate.siterename; the trunk fixture snapshot refresh.