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
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"
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
PullRequestServiceandPullRequestSyncerwrite 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.mjshandles file operations for Pull Requests.LocalFileServicedeterministicMath.floor(id/100)*100routing for O(1) lookups.archivePath()helper (AC2) pointing to the unifiedarchiveRootspecified in the configuration (AC1).The Fix
Refactor
PullRequestServiceto direct archived Pull Requests toarchive/pulls/vN.M.K/using the lazy ordinal chunking helper. Ensure the active write path strictly preserves thepr-XXxxID-range semantic.Contract Ledger Matrix
PullRequestServicearchive pathsAcceptance Criteria
pr-XXxxID-range chunking.archivePath()helper.pr-archive/references are removed fromPullRequestServicein favor of dynamicarchiveRootusage for the archive tier.Out of Scope
pr-archive/data (Phase 3).IssueService(AC3) orDiscussionService(AC5).archivePathhelper itself (AC2).Avoided Traps
pr-XXxxlogic.Origin Session ID
Origin Session ID: 57502eb2-7f7b-4b9b-a849-49f016b08c95 Retrieval Hint: "Epic 11187 Phase 1 PullRequestService Refactor"