refactor(rees): migrate three more analyzers off hand-rolled bounded-fetch onto boundedFetchText - #4947
Conversation
…fetch onto boundedFetchText undocumented-export.ts, unused-export.ts, and caller-impact.ts each still hand-rolled their own private readBoundedText + fetchFileAtHead wrapper for fetching a changed file's content at headSha, the same pattern doc-comment-drift.ts, exhaustiveness-drift.ts, and complexity-delta.ts had before #4759/PR #4821 migrated them onto the shared boundedFetchText helper. undocumented-export.ts also hand-built its own GitHub auth headers inline instead of the shared githubHeaders() helper, the same inconsistency doc-comment-drift.ts had before that PR. Deletes each file's private readBoundedText outright (never relocated), replaces the fetch path with boundedFetchText / options.analysis.fetchText (mirroring duplication-delta.ts's own fetchFileAtHead), and switches undocumented-export.ts onto githubHeaders(). unused-export.ts and caller-impact.ts already used githubHeaders() and only needed the boundedFetchText migration. No new shared module. Closes #4824
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 02:27:11 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Follow-up to #4759 / PR #4821 (discovered drift, deliberately not bundled into that PR to keep it
scoped to the 3 files #4759 named). Same migration, applied to the 3 remaining REES analyzers that
still hand-rolled their own bounded-fetch logic:
undocumented-export.ts,unused-export.ts, andcaller-impact.tseach had a privatereadBoundedText+ afetchFileAtHead-style wrapper for fetching a changed file's content atheadSha— the same patterndoc-comment-drift.ts,exhaustiveness-drift.ts, andcomplexity-delta.tshad before Extract shared GitHub-contents-at-ref fetch helper in REES #4759/PR refactor(rees): migrate three analyzers off hand-rolled bounded-fetch onto boundedFetchText #4821 migrated them onto the sharedboundedFetchTexthelper (
external-fetch.ts).undocumented-export.tsadditionally hand-built its own GitHub auth headers inline instead of theshared
githubHeaders()helper — the same inconsistencydoc-comment-drift.tshad before that PR.Each file's private
readBoundedTextis deleted outright (never relocated), and the fetch path nowgoes through
boundedFetchText/options.analysis.fetchText, mirroringduplication-delta.ts's ownfetchFileAtHead(endpointCategory: "github-contents", a per-filephasestring,subcall,maxBytes,maxCallsPerCategory).undocumented-export.tsis switched ontogithubHeaders().unused-export.tsandcaller-impact.tsalready usedgithubHeaders()and only needed theboundedFetchTextmigration. No new shared module.Test plan
injected
fetchFn/fetchImplstill flows through toboundedFetchText's ownfetchImploption).options.analysis.fetchTextbranch (asserting thebare fetch path is never invoked when an analysis context is supplied), for full branch coverage
on the new ternary — mirrors the tests PR refactor(rees): migrate three analyzers off hand-rolled bounded-fetch onto boundedFetchText #4821 added for its own 3 files.
npm run rees:test(review-enrichment build + sourcemap validation + metadata check + full nodetest suite): 1297/1297 passing.
npm run test:ci(all steps, run individually):git diff --check, actionlint, DBmigration/schema-drift checks, selfhost checks, cf-typegen check, root
typecheck,test:coverage(702 files / 13899 tests),test:engine-parity(15/15) +engine-parity:drift-check(22 hand-duplicated pairs agree — confirmed unaffected by this REES-internal-only change),
test:driver-parity(18/18),gittensory-engineworkspace tests (349/349),test:workers,MCP/miner build+pack checks, OpenAPI/docs/manifest/command-reference drift checks, UI lint/typecheck/test/build.
npm audit --audit-level=moderate: 0 vulnerabilities.Closes #4824