De-duplicate 7 more GitHub clients onto github_client (follow-up to #357)#358
Merged
Merged
Conversation
…p to #295) Follow-up to PR #357: the same authenticated _http shape lived in seven more tools. Re-point each to github_client.request (the shared builder), keeping each one's own urlopen + status/error model + injectable transport seam: bootstrap, issue_conformance_ci, disposition_issue_resolution_check, spec_referent, milestone_emit, projects_sync, dependency_discipline/review. Behavior-preserving: each transport seam is unchanged, so the per-tool tests pass untouched. bootstrap keeps its 3-tuple (status, json, headers) return; disposition stays 2-arg (method, path) with no Content-Type; projects_sync keeps its GraphQL POST. API_ROOT removed from each (now unused). The inert GET Content-Type the write-capable callers previously set is dropped (GitHub ignores it on a bodyless request); disposition was already Content-Type-free. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The usability lens caught that spec_referent / milestone_emit / issue_conformance still described their _http as a "knowing duplicate" of the gh client tracked for consolidation in #295 — language #357 stripped from its files but this follow-up missed. Update those docstrings to say the request-build now goes through the shared github_client while each keeps its own transport/error handling. The markdown-parser and pipe-table-parser "knowing duplicate" notes are left intact — those duplications are real and untouched. Co-Authored-By: Claude Opus 4.8 <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.
Follow-up to #357 (now merged) — completes the de-duplication #295 began. Targets
maindirectly; #357'sgithub_clientis already onmain. Closes no separate issue.Purpose
Finish the GitHub-client de-duplication: re-point the seven remaining tools that still hand-roll the same authenticated
_httponto the sharedgithub_client.github_clientand consolidated five clients; ground-truth during that build found the same_httpshape in seven more tools, disclosed there as out-of-scope. This completes the sweep so no copy is left to drift or be stranded.Impact: every GitHub API caller in the engine now builds its request through one place; the duplication #295 named is fully cleared.
Scope
Seven tools re-pointed to
github_client.request; each keeps its own transport, error model, and return shape.bootstrap.py,issue_conformance_ci.py,disposition_issue_resolution_check.py,spec_referent.py,milestone_emit.py,projects_sync/projects_sync.py,dependency_discipline/review.py: the inlineurllib.request.Request(...)build inside each_httpbecomesgithub_client.request(path, token, user_agent=..., method=method, data=data). Each keeps its ownurllib.request.urlopen+exceptblocks and its injectabletransportseam.API_ROOTremoved from each (now unused).bootstrapkeeps its 3-tuple(status, json, headers)return (it reads response headers);dispositionstays 2-arg(method, path)with no body and noContent-Type;projects_synckeeps its GraphQLPOST.Impact: a uniform request build across all seven, with no change to any caller's behavior.
Out of scope
Everything
github_clientitself — already shipped in #357 — andbackup_vault.github_client.py; this only adds importers.backup_vaultstays excluded (a different, hook-safe shape: 10s timeout, never-raise, blob PUT).Impact: the shared client's surface is unchanged; this PR is purely consumer re-points.
Risk
Low — additive re-points of already-tested code; none of the seven is a privileged
pull_request_targetguard, follows a response-derived URL, or decodes content.Content-Typeon their bodyless GETs (GitHub ignores it);dispositionwas alreadyContent-Type-free, so it is byte-identical.engine-guard(the coarse path-prefix classifier), so the PR carries aguardrail-ack; no guardrail is weakened.Impact: the failure mode is a flagged-but-equivalent move; each tool's own test suite is the regression catch.
Validation
Full suite and validator green.
python -m unittest discover -s tools -p 'test_*.py'→ 2741 tests OK (2 documented offline skips). Each re-pointed tool's tests inject theirtransportseam, so they exercise the real logic and pass untouched.validate.py --suite CI→ the sole hard finding is the known local no-token state ofdisposition-issue-resolution(it needs a token to bite, i.e. in CI); the re-point does not change its token logic.graph.jsonregenerated and in sync;self-map.mdunchanged (tool inventory is by glob).Impact: the behavior-preserving claim rests on seven independent test suites staying green through their transport seams.
Review
A four-lens deliverable-gate cold review ran (spec-conformance, technical-integrity, security/governance, usability); no blocking or serious findings remain — every finding folded.
_httpa "knowing duplicate" tracked for consolidation in Extract a shared GitHub Contents-API client (de-duplicate weakening_guard / audit_digest / lock_integrity) #295 — language Extract a shared github_client; de-duplicate 5 GitHub API clients (#295) #357 stripped from its files but this PR missed; corrected to say the request-build now routes through the sharedgithub_client, with the genuinely-still-duplicated markdown / pipe-table parser notes left intact.Impact: the engine's own account of the review — the maintainer's merge is the binding gate.
Files of interest
The seven re-pointed
_httpboundaries..engine/tools/bootstrap.py— the one with a 3-tuple return (keeps response headers)..engine/tools/disposition_issue_resolution_check.py— the 2-arg, Content-Type-free (byte-identical) case..engine/tools/projects_sync/projects_sync.py— the GraphQL POST case.Impact: these three carry the divergences the uniform swap had to preserve.
Claude involvement
Claude (Opus 4.8) performed the re-points under the maintainer's direction; the maintainer asked for the follow-up and holds the merge.
Impact: AI judgment is load-bearing on what counts as behavior-preserving per tool; the seven transport-seam test suites cover it.