Repository navigation
refactor(gh): split the GitHub adapter by what it reads - #136
Merged
Merged
Conversation
gh.ts had reached 502 lines, over the repository's source-file limit. It now holds only the boundary every read crosses: whether gh runs and as whom, the current repository, and readJson/failedAs. The reads move beside it by what they read, the way ci.ts, conversation.ts and label.ts already do: the pull request itself into pr.ts with prViewOf beside prView, the rollup entry into ci.ts, and the REST comment and review reads into conversation.ts, which the glossary already names as everything said on a PR. Every gh literal stays at its call site, so no-gh-writes still sees it. Closes #122 Co-Authored-By: Claude Opus 5 (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.
src/adapters/gh.tsholds 502 lines, which is over the repository's source-file limit. The split follows what each call reads, not where the line count falls.gh.tskeeps only the boundary that every call to GitHub crosses. Each call sits in the module for the thing it reads, next toci.ts,conversation.tsandlabel.ts, and every read keeps its fixture beside it as ADR 0006 requires.Closes #122
What changes
src/adapters/gh.tschecks whetherghruns and who it runs as. It also names the current repository and definesreadJsonandfailedAs.src/adapters/pr.tsholds the reads of the pull request itself: search, view, list, commits, compare, the mappers for GitHub's words, andmergePr.prViewOfsits besideprView.src/adapters/ci.tsownsCheckEntry.src/adapters/conversation.tsowns the REST reads of comments and reviews that a sweep makes, which the glossary counts as part of the conversation.prViewOflives inpr.ts.Test plan
pnpm checkpasses: 856/856 tests.gh.test.tsnow sit beside the module each one covers:gh.test.ts,pr.test.ts,conversation.test.ts.no-gh-writesstill passes. Every"gh"literal and its argument array stay inline at the call site.Risk
None: the moved code is byte-identical, and only imports and the doc comments at the top of each module are new.
🤖 Generated with Claude Code