LearnNewsExamplesServices
Frontmatter
id13803
titlefeat(ai): refetchPullsByNumber force-refetch for stale PR mirrors (pulls slice of #13794)
stateClosed
labels
enhancementaiarchitecture
assignees[]
createdAtJun 21, 2026, 9:23 PM
updatedAtJun 21, 2026, 9:45 PM
githubUrlhttps://github.com/neomjs/neo/issues/13803
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 21, 2026, 9:45 PM

feat(ai): refetchPullsByNumber force-refetch for stale PR mirrors (pulls slice of #13794)

Closed v13.1.0/archive-v13-1-0-chunk-5 enhancementaiarchitecture
neo-opus-ada
neo-opus-ada commented on Jun 21, 2026, 9:23 PM

Pulls slice of #13794 (the symmetric force-refetch)

Delivers the pull-request half of #13794: a standalone, out-of-band, idempotent force-refetch primitive for closed/merged PR mirrors that bypasses the bulk delta-updatedAt gate — a faithful mirror of the shipped SyncService.refetchIssuesByNumber / refetchTruncatedIssues.mjs. The design is the explicit "mirror the issue path exactly" spec in #13794, so this slice is code-ready (the established, shipped pattern). #13794 stays open for the discussions half (refetchDiscussionsByNumber).

Immediate use

Heal the 43 archived pull mirrors that carry stale local edits the delta-sync won't refresh (their GitHub bodies are current + clean):

node ai/scripts/migrations/refetchStalePulls.mjs <nums>

Deltas

  • FETCH_SINGLE_PULL_FOR_SYNC (new query): single-PR variant of FETCH_PULL_REQUESTS_FOR_SYNC, identical node shape.
  • PullRequestSyncer#renderPullRequestMarkdown (extracted, behavior-preserving): the frontmatter + body + comments + reviews render, so bulk-sync and refetch render identically (no drift).
  • PullRequestSyncer.refetchPullsByNumber(numbers, metadata, indexMutations?): mirrors IssueSyncer.refetchIssuesByNumber.
  • SyncService.refetchPullsByNumber({numbers}): facade (load → delegate → persist).
  • ai/scripts/migrations/refetchStalePulls.mjs: standalone CLI (pull-only, no orchestrator/lease).

Contract Ledger

Surface Kind Change Consumers Back-compat
FETCH_SINGLE_PULL_FOR_SYNC GraphQL query export NEW PullRequestSyncer.refetchPullsByNumber Additive
PullRequestSyncer.refetchPullsByNumber(numbers, metadata, indexMutations?) service method NEW SyncService.refetchPullsByNumber Additive
SyncService.refetchPullsByNumber({numbers}) service facade NEW refetchStalePulls.mjs CLI Additive
ai/scripts/migrations/refetchStalePulls.mjs CLI script NEW operator / CI (out-of-band) Additive
PullRequestSyncer#renderPullRequestMarkdown(pr) private method extracted syncPullRequests + refetchPullsByNumber Behavior-preserving (byte-identical bulk-sync output; 13/13 spec green)

AC

  • refetchPullsByNumber on PullRequestSyncer + a SyncService facade, pull-only, idempotent, bypassing the delta-updatedAt gate.
  • Standalone CLI, no orchestrator/lease dependency (works under scheduler saturation).
  • Unit coverage mirroring the issue refetch tests (force-re-render bypassing the hash gate; skip a PR no longer on GitHub).

Sub of #13794. Surfaced by @neo-opus-ada.

tobiu referenced in commit 7ac5ad2 - "feat(ai): refetchPullsByNumber force-refetch for stale PR mirrors (#13803) (#13804) on Jun 21, 2026, 9:45 PM
tobiu closed this issue on Jun 21, 2026, 9:45 PM