jetpack-review-pr skill: catch cross-package version-skew fatals (class_exists → method_exists)#50021
Open
dhasilva wants to merge 1 commit into
Open
jetpack-review-pr skill: catch cross-package version-skew fatals (class_exists → method_exists)#50021dhasilva wants to merge 1 commit into
dhasilva wants to merge 1 commit into
Conversation
Add a "cross-package version skew" check to the jetpack-review-pr skill. When a package calls into a sibling it does not declare in composer.json require, guarding with class_exists() is insufficient: standalone plugins bundle their own jetpack_vendor/ copies and the autoloader may load an older version, so a newly-added method/constant is absent at runtime and fatals with "Call to undefined method". The guard must check the exact symbol (method_exists/is_callable/defined/function_exists/property_exists). This is the class of bug behind SOCIAL-515 (SEO\Initializer::is_optin_available() fatal on Social 9.0.2 standalone) and MYJP-308, which both human and Claude reviewers missed because the introducing PR added the new method and its class_exists-guarded caller in the same self-consistent diff. Changes: a new check in step 4 (all depths) with a grep detection recipe, a checks-table row, an upstream-direction note in the cross-project step, and a report heading. Validated RED 0/3 -> GREEN 3/3 against the real #49672 (introducer) and #49988 (fix) diffs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
enejb
approved these changes
Jun 27, 2026
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.
Fixes # N/A — post-mortem follow-up to SOCIAL-515 (the fix itself shipped in #49988).
Proposed changes
Harden the
jetpack-review-prskill so it catches the class of silent dependency bug behind SOCIAL-515 — a fatal that both human and Claude reviewers missed.The bug: a package calls into a sibling package it does not declare in its own
composer.jsonrequire(e.g. my-jetpack →SEO\Initializer), guarded only byclass_exists(). On trunk every package is at the same version, so it resolves and CI passes — but standalone plugins (Social, Boost, …) each bundle their ownjetpack_vendor/copies and the autoloader loads ONE copy across all active plugins, often an older one.class_exists()then passes while a newly-added method is absent →Call to undefined methodfatal. It was invisible in review because the introducing PR (#49672) added the new method and itsclass_exists-guarded caller in the same self-consistent diff.class_exists()is not a sufficient guard before a method/constant/property access on a non-required sibling; the guard must check the exact symbol (method_exists/is_callable/defined/function_exists/property_exists). Flags such a call as[blocker]. Includes a grep detection recipe and the SOCIAL-515 / MYJP-308 precedents.Skill-only change under
.agents/— no product code, noprojects/files, so no changelog entry is required.Related product discussion/links
SEO\Initializer::is_optin_available()fatal on Social 9.0.2 standaloneDoes this pull request change what data or activity we track or use?
No.
Testing instructions
This change is process documentation (a review skill), validated RED→GREEN against the real before/after diffs:
.agents/skills/jetpack-review-pr.md(step 4)./jetpack-review-pr 49672(the introducing PR). The review should raise a[blocker]for theclass_exists-guardedSEO\Initializer::is_optin_available()call inprojects/packages/my-jetpack/src/class-initializer.php, recommendingmethod_exists./jetpack-review-pr 49988(the fix). The review should raise no version-skew blocker on the correctedmethod_existsguard.