You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consolidate remaining gh CLI calls into GitHubProvider #443
After #368 consolidated orchestration-layer gh calls into GitHubProvider, ~9 direct gh CLI invocations remain in utility modules outside the provider. These should be routed through GitHubProvider to complete the platform abstraction seam before #375 (GitLab/Azure DevOps support).
Replace local fetchIssueTitle() in both files with GitHubProvider.fetchIssueTitleSync()
Phase 3 — Migrate upstream/ (7 calls):
Route assessment.ts calls through GitHubProvider with repo: "anthropics/claude-code"
Route issues.ts calls through GitHubProvider with parameterized repo
Remove orphaned execCommand() helpers
Phase 4 — Tests + verification:
Unit tests for new methods (mock spawnSync)
Full test suite run
Grep verification for AC-1
Design Decisions
Repo parameter on new methods (not cwd): Upstream targets anthropics/claude-code, not the user's repo. Explicit --repo parameter is cleaner than cwd manipulation.
Sync helpers (not async): Both merge-check and worktree-discovery callers are sync. Upstream callers are async but the underlying spawnSync is inherently synchronous — async wrappers add no value.
Tests assert on return values and spawnSync call args
Coverage Depth
✅ OK
Success + failure + edge cases for each method
Mock Hygiene
✅ OK
Only child_process.spawnSync mocked
Test Reliability
✅ OK
No timing dependencies, deterministic
Anti-Pattern Detection
Pattern
Count
Notes
Bare catch {} blocks
7
All have default returns — consistent with existing GitHubProvider style
Command injection risk
0
All calls use spawnSync with argument arrays
Hardcoded secrets
0
—
Critical Issues: 0 | Warnings: 0
Self-Evaluation
Verified working: Yes — build passes, 37 tests for changed files pass, grep confirms zero gh calls outside provider
Test efficacy: High — tests verify argument construction, return values, and error handling
Likely failure mode: Future caller in context where spawnSync behaves differently (low risk)
Verdict confidence: High — straightforward mechanical refactoring with clear verification
Verdict: READY_FOR_MERGE
All 5 AC items (3 original + 2 derived) are met. The refactoring cleanly consolidates all 9 remaining gh CLI calls into GitHubProvider, completing the platform abstraction seam for #375. Code quality is high, tests are comprehensive, and CI failure is confirmed pre-existing.
Assessment test refactor from spawn EventEmitter mocks to vi.fn() is a significant readability win
vi.hoisted() correctly handles module-scope new GitHubProvider() in mocks
All 7 new methods have success + failure path tests
All spawnSync calls use argument arrays (no shell interpolation) — secure by construction
Consistent error handling: every method catches and returns safe defaults
Issues: None
Suggestions:
Module-level const ghProvider = new GitHubProvider() singletons are consistent with existing codebase patterns — could be noted for future DI work if Platform abstraction: GitLab and Azure DevOps support #375 needs constructor injection
Test Quality Review
Category
Status
Notes
Behavior vs Implementation
✅ OK
Tests assert on return values and spawnSync call args
Coverage Depth
✅ OK
Success + failure + edge cases for each method
Mock Hygiene
✅ OK
Only child_process.spawnSync mocked
Test Reliability
✅ OK
No timing dependencies, deterministic
Anti-Pattern Detection
Pattern
Count
Notes
Bare catch {} blocks
7
All have default returns — consistent with existing GitHubProvider style
Command injection risk
0
All calls use spawnSync with argument arrays (no shell interpolation)
Test efficacy: High — tests verify argument construction, return values, and error handling for all 7 new methods
Likely failure mode: Future module calling GitHubProvider method with wrong repo string (low risk — repo param is explicit)
Verdict confidence: High — straightforward mechanical refactoring with clear grep-based verification
Verdict: READY_FOR_MERGE
All 5 AC items (3 original + 2 derived) are met. The refactoring cleanly consolidates all 9 remaining gh CLI calls into GitHubProvider, completing the platform abstraction seam for #375. Code quality is high, tests are comprehensive, and the CI build (20.x) failure is confirmed pre-existing on main.
Documentation
N/A — Internal refactor, no user-facing behavior change
CHANGELOG Verification
Result: N/A — Internal refactor, no user-facing changes
This issue is a pure internal refactoring — consolidating gh CLI calls from 4 utility modules into GitHubProvider. No user-facing behavior, CLI commands, configuration options, or APIs were added or changed.
Why no documentation generated:
No new features, commands, or tools
No changed behavior for end users
Issue body states: "No user-facing behavior change"
All changes are in src/lib/ (internal library code + tests)
What changed (internal only):
9 direct spawnSync("gh", ...) / execCommand("gh", ...) calls consolidated into GitHubProvider
7 new repo-aware sync methods on GitHubProvider
43 new unit tests for the migrated code paths
Status:
✅ No documentation required — internal refactor only.
Activity
admarble commentedon Mar 26, 2026
→ PROCEED — Clear ACs, all 9 target files exist, prerequisite for #375
spec → exec → qa · 3 ACs · -q (refactor across 4 modules, upstream approach needs spec)
admarble commentedon Mar 26, 2026
→ PROCEED — All 9 target files exist, clear ACs, prerequisite for #375
spec → exec → qa · 3 ACs · -q (refactor across 4 modules)
admarble commentedon Mar 26, 2026
Spec Plan — #443: Consolidate remaining gh CLI calls into GitHubProvider
AC Checklist with Verification Criteria
AC-1: No direct gh CLI calls outside GitHubProvider
Verification: grep scan —
spawnSync("gh", ...)andexecCommand("gh", ...)return zero matches outsidesrc/lib/workflow/platforms/github.tsAC-2: Existing tests continue to pass
Verification:
npm test— full suite passesAC-3: Skills and hooks are out of scope
Verification: Code review — no files in
.claude/skills/,templates/skills/, or hook scripts modifiedAC-4 (derived): Unit tests for new GitHubProvider methods
Verification: New test cases in
github.test.tscoveringfetchIssueTitleSync, repo-aware release/issue methodsAC-5 (derived): Remove orphaned execCommand helpers
Verification: grep — no
execCommandfunctions remain inupstream/assessment.tsorupstream/issues.tsScope Assessment
Verdict:⚠️ SCOPE_WARNING — single feature across 3 directories. Quality loop enabled.
Non-Goals
PlatformProviderinterface (release/search are GitHub-specific)ReleaseData) to the providerImplementation Plan
Phase 1 — Add GitHubProvider methods:
fetchIssueTitleSync(issueId)— sync title fetch for merge-check + worktree-discoveryfetchReleaseSync(repo, version?),listReleasesSync(repo, limit),searchIssuesSync(repo, labels, search),createIssueWithBodyFile(repo, ...),commentOnIssueWithBodyFile(repo, ...)checkGhVersion(),checkGhAuthStatus()Phase 2 — Migrate merge-check + worktree-discovery (2 calls):
fetchIssueTitle()in both files withGitHubProvider.fetchIssueTitleSync()Phase 3 — Migrate upstream/ (7 calls):
assessment.tscalls through GitHubProvider withrepo: "anthropics/claude-code"issues.tscalls through GitHubProvider with parameterizedrepoexecCommand()helpersPhase 4 — Tests + verification:
Design Decisions
anthropics/claude-code, not the user's repo. Explicit--repoparameter is cleaner than cwd manipulation.spawnSyncis inherently synchronous — async wrappers add no value.ReleaseData,IssueResultetc. are upstream business types, not platform types. Provider returns raw/minimal data.Open Questions
GitHubProvideras optional param with defaultnew GitHubProvider()for testability.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: enabled (refactor label + scope warning)
refactor(#443): consolidate remaining gh CLI calls into GitHubProvider
admarble commentedon Mar 26, 2026
Exec Progress Update — #443
AC Coverage
ghCLI calls outsidegithub.tsspawnSync("gh"only ingithub.tsgithub.test.tsexecCommandhelpersFiles Changed
src/lib/workflow/platforms/github.tssrc/lib/workflow/platforms/github.test.tssrc/lib/merge-check/index.tsfetchIssueTitlewith providersrc/lib/workflow/worktree-discovery.tsfetchIssueTitlewith providersrc/lib/upstream/assessment.tsexecCommandsrc/lib/upstream/issues.tsexecCommandsrc/lib/upstream/__tests__/assessment.test.tsQuality Gates
npm run buildnpm run lintnpm testQuality Plan Alignment
N/A — No quality plan in issue.
PR
✅ Created: #470
CHANGELOG: N/A (internal refactor, no user-facing behavior change)
admarble commentedon Mar 26, 2026
QA Review for Issue #443
AC Coverage
spawnSync("gh", ...)orexecCommand("gh", ...)calls outsidegithub.tssrc/lib/outsideplatforms/github.ts.claude/skills/,templates/skills/, or hooks modifiedgithub.test.tscovering all 7 new methods (success + failure paths)execCommandhelpersexecCommandinupstream/assessment.tsandupstream/issues.tsCoverage: 5/5 AC items fully met
Original ACs: 3/3 met | Derived ACs: 2/2 met
CI Status
build (20.x)getPackageVersionimport error incli.integration.test.ts)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 4 passed, 1 failed (pre-existing — main branch CI passes all checks)
Quality Metrics
any)Test Coverage Analysis
src/lib/workflow/platforms/github.tsgithub.test.ts(15 new tests)src/lib/merge-check/index.tsmerge-check.test.tssrc/lib/upstream/assessment.ts__tests__/assessment.test.ts(updated mocks)src/lib/upstream/issues.ts__tests__/issues.test.tssrc/lib/workflow/worktree-discovery.tsCoverage: 4/5 changed source files have corresponding tests
Code Review
Strengths:
spawnSync/execCommandwith typedGitHubProvidermethodrepoparameter — correct for upstream module targetinganthropics/claude-codespawnEventEmitter mocks tovi.fn()is a significant readability improvementvi.hoisted()correctly handles module-scopenew GitHubProvider()in mocksIssues: None
Suggestions:
const ghProvider = new GitHubProvider()singletons could be noted for future DI work if Platform abstraction: GitLab and Azure DevOps support #375 needs itTest Quality Review
child_process.spawnSyncmockedAnti-Pattern Detection
catch {}blocksspawnSyncwith argument arraysCritical Issues: 0 | Warnings: 0
Self-Evaluation
spawnSyncbehaves differently (low risk)Verdict: READY_FOR_MERGE
All 5 AC items (3 original + 2 derived) are met. The refactoring cleanly consolidates all 9 remaining
ghCLI calls intoGitHubProvider, completing the platform abstraction seam for #375. Code quality is high, tests are comprehensive, and CI failure is confirmed pre-existing.Next Steps
GitHubProviderseam now readyadmarble commentedon Mar 26, 2026
QA Review for Issue #443
AC Coverage
spawnSync("gh", ...)orexecCommand("gh", ...)calls outsidegithub.tssrc/lib/outsideplatforms/github.ts.claude/skills/,templates/skills/, or hooks modifiedgithub.test.tscovering all 7 new methods (success + failure paths)execCommandhelpersexecCommandinupstream/assessment.tsandupstream/issues.tsCoverage: 5/5 AC items fully met
Original ACs: 3/3 met | Derived ACs: 2/2 met
Quality Plan Verification
N/A — No quality plan found in issue comments
CI Status
build (20.x)getPackageVersionimport error incli.integration.test.ts— present on main)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 4 passed, 1 pre-existing failure (not a regression)
Quality Metrics
any)Test Coverage Analysis
github.tsgithub.test.ts(+15 new tests)merge-check/index.tsmerge-check.test.ts(existing)assessment.tsassessment.test.ts(mocks updated)issues.tsissues.test.ts(existing)worktree-discovery.tsCoverage: 4/5 changed source files have corresponding tests
Critical paths without tests: None
Code Review
Strengths:
spawnSync/execCommandwith typedGitHubProvidermethodrepoparam — correct for upstream targetinganthropics/claude-codespawnEventEmitter mocks tovi.fn()is a significant readability winvi.hoisted()correctly handles module-scopenew GitHubProvider()in mocksspawnSynccalls use argument arrays (no shell interpolation) — secure by constructionIssues: None
Suggestions:
const ghProvider = new GitHubProvider()singletons are consistent with existing codebase patterns — could be noted for future DI work if Platform abstraction: GitLab and Azure DevOps support #375 needs constructor injectionTest Quality Review
child_process.spawnSyncmockedAnti-Pattern Detection
catch {}blocksspawnSyncwith argument arrays (no shell interpolation)Critical Issues: 0 | Warnings: 0
Self-Evaluation
Verdict: READY_FOR_MERGE
All 5 AC items (3 original + 2 derived) are met. The refactoring cleanly consolidates all 9 remaining
ghCLI calls intoGitHubProvider, completing the platform abstraction seam for #375. Code quality is high, tests are comprehensive, and the CIbuild (20.x)failure is confirmed pre-existing on main.Documentation
CHANGELOG Verification
Result: N/A — Internal refactor, no user-facing changes
Next Steps
GitHubProviderseam is now readytest(#443): add GitHubProvider integration tests for issues module
test(#443): add GitHubProvider integration tests for assessment module
admarble commentedon Mar 26, 2026
Documentation Review — #443
This issue is a pure internal refactoring — consolidating
ghCLI calls from 4 utility modules intoGitHubProvider. No user-facing behavior, CLI commands, configuration options, or APIs were added or changed.Why no documentation generated:
src/lib/(internal library code + tests)What changed (internal only):
spawnSync("gh", ...)/execCommand("gh", ...)calls consolidated intoGitHubProviderGitHubProviderStatus:
✅ No documentation required — internal refactor only.
Ready to merge!
refactor(#443): consolidate remaining gh CLI calls into GitHubProvider (