LearnNewsExamplesServices
Frontmatter
id11196
titlePullRequestService archive-write path refactor for lazy ordinal chunking (#11187 AC4)
stateClosed
labels
enhancementaiarchitecture
assignees[]
createdAtMay 11, 2026, 11:17 AM
updatedAtMay 11, 2026, 2:04 PM
githubUrlhttps://github.com/neomjs/neo/issues/11196
authorneo-gemini-3-1-pro
commentsCount0
parentIssue11187
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 11, 2026, 2:04 PM

PullRequestService archive-write path refactor for lazy ordinal chunking (#11187 AC4)

Closedenhancementaiarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 11, 2026, 11:17 AM

Context

Part of Epic #11187 Phase 1 execution. We are converging on the Option E''+S architecture for GitHub workflow data archiving: active tiers retain their deterministic ID-range chunking, while archive tiers move to a unified root with density-tuned lazy ordinal chunking.

The Problem

The current PullRequestService and PullRequestSyncer write archive data to an asymmetric structure (pr-archive/pr-XXxx/). They lack a version-layer grouping and use density-blind 100-ID-range chunking for archives, which differs from the newly converged standard.

The Architectural Reality

  • ai/services/github-workflow/PullRequestService.mjs handles file operations for Pull Requests.
  • The active tier must retain LocalFileService deterministic Math.floor(id/100)*100 routing for O(1) lookups.
  • The archive tier must switch to using the new archivePath() helper (AC2) pointing to the unified archiveRoot specified in the configuration (AC1).

The Fix

Refactor PullRequestService to direct archived Pull Requests to archive/pulls/vN.M.K/ using the lazy ordinal chunking helper. Ensure the active write path strictly preserves the pr-XXxx ID-range semantic.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
PullRequestService archive paths Epic #11187 Routes to `archive/pulls/vN.M.K/{flat chunk-N}/` N/A Inline code comments

Acceptance Criteria

  • Ensure active-tier PR writes continue to use the deterministic pr-XXxx ID-range chunking.
  • Refactor archive-tier PR writes to use the new archivePath() helper.
  • Ensure pr-archive/ references are removed from PullRequestService in favor of dynamic archiveRoot usage for the archive tier.

Out of Scope

  • Actually migrating existing pr-archive/ data (Phase 3).
  • Modifying IssueService (AC3) or DiscussionService (AC5).
  • Any modifications to the archivePath helper itself (AC2).

Avoided Traps

  • Changing the active tier to ordinal chunking. As validated in Epic #11187, active-tier ordinal chunking destroys O(1) lookups. Active-tier PRs MUST retain pr-XXxx logic.

Origin Session ID

Origin Session ID: 57502eb2-7f7b-4b9b-a849-49f016b08c95 Retrieval Hint: "Epic 11187 Phase 1 PullRequestService Refactor"

tobiu closed this issue on May 11, 2026, 2:04 PM