rc-docs-sync: defer to open documentation PRs instead of duplicating#399
Merged
Conversation
PR #391 was opened on 2026-04-28 to document the wp yoast auth CLI namespace (Yoast/wordpress-seo#23130). The upstream feature merged today; when 27.7-RC1 is cut, the sync workflow would otherwise see register-rest-route / WP_CLI::add_command calls, invoke the agent, and open a duplicate PR for docs/features/wp-cli/auth.md — directly competing with #391. Two changes solve this generally: 1. Workflow: new "Fetch recent open documentation PRs in this repo" step that runs when any_content==true. Uses `gh pr list` with a search filter (open, not labeled rc-doc-sync, updated within 30 days), keeps only PRs that touch docs/** or sidebars.js, and writes the result to $BUNDLE_DIR/open-doc-prs.json. Verified locally against the current repo state: returns 3 PRs including #391 with the expected files list. 2. Agent prompt (run.md): new Step 1.7 — Defer to open documentation PRs. Between Step 1.6 (internal-surface discrimination) and Step 2 (authoring), the agent reads open-doc-prs.json. For any PR plan whose files overlap a listed PR (excluding sidebars.js-only overlap, which is normal cross-cut), or whose area is mentioned by the listed PR's title/body, the agent comments on the existing PR with source-evidence + RC tag + run URL, instead of opening a duplicate. Deferrals are listed under a new "Overlapped with open PRs" section in the run summary (Step 4). The "Context available in this run" section is updated to mention the new file, and Step 4's run-summary structure now includes the new heading. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
PR #391 was opened on 2026-04-28 to document the
wp yoast authCLI namespace from Yoast/wordpress-seo#23130. That upstream feature merged today (2026-05-11). When 27.7-RC1 is cut, the sync workflow would see the newWP_CLI::add_command(...)calls, invoke the agent, and the agent would open a competing PR fordocs/features/wp-cli/auth.md— duplicating #391's work and creating a merge race.This PR teaches the workflow + agent to defer to pre-documentation PRs rather than duplicate them.
What changed
Workflow — new
Fetch recent open documentation PRs in this repostep (runs whenany_content == 'true'). Usesgh pr listwithis:open is:pr -label:rc-doc-sync updated:>=<30 days ago>, keeps only PRs touchingdocs/**orsidebars.js, and writes the result to$BUNDLE_DIR/open-doc-prs.json.Agent prompt (
run.md) — new Step 1.7 — Defer to open documentation PRs between Step 1.6 and Step 2. The agent readsopen-doc-prs.json; for any PR plan whose files overlap a listed PR (excludingsidebars.js-only overlap, which is normal cross-cut), or whose area is mentioned in the listed PR's title/body, the agent:Plus minor:
Context available in this runnow listsopen-doc-prs.json, and Step 4 mentions the new run-summary section.Validation
yaml.safe_load).gh pr list+ jq pipeline dry-run against the current repo state returns 3 PRs, one of which is Document MyYoast OAuth client CLI commands #391 withdocs/features/wp-cli/auth.mdin itsfileslist — exactly what the agent's overlap check needs.docs/development/**which is out of scope for the agent anyway).What was NOT validated: the agent's Step 1.7 reasoning itself (can't run the agent locally without spending budget). Will get its real-world test on 27.7-RC1.
Risk and mitigation
sidebars.js-only overlap: the prompt explicitly tells the agent to not treat this as overlap (sidebars.jsis co-edited by almost every doc PR). Eventual merge order resolves the navigation entries.updated >= 30 days ago, so an abandoned-but-not-closed PR drops out naturally.Test plan
workflow_dispatchagainst any past RC: verifyopen-doc-prs.jsonis written, the rest of the run is unchanged.🤖 Generated with Claude Code