Repository navigation
Conversation
15 tasks
Extract two interfaces that decouple workflow orchestration from (a) agent execution and (b) platform operations: - AgentDriver interface in src/lib/workflow/drivers/agent-driver.ts - ClaudeCodeDriver wraps existing query() call — no behavior change - Driver registry with getDriver() in drivers/index.ts - PlatformProvider interface in src/lib/workflow/platforms/platform-provider.ts - GitHubProvider wraps existing gh CLI calls — no behavior change - Platform registry with getPlatform() in platforms/index.ts - phase-executor.ts now uses AgentDriver interface (no SDK import) - --agent and --platform CLI flags for sequant run - ExecutionConfig.agent and ExecutionConfig.platform fields - Unit tests for driver registry, platform registry, ClaudeCodeDriver, GitHubProvider Pure refactor — all existing tests pass unchanged. Closes #368 Entire-Checkpoint: e99199aa159d
Migrate all orchestration-layer gh CLI calls into GitHubProvider:
- phase-detection.ts: 3 execSync("gh issue view...") → GitHubProvider.fetchIssueCommentBodiesSync()
- pr-status.ts: spawnSync("gh pr view...") → GitHubProvider.getPRMergeStatusSync()
- system.ts: execSync("gh auth status") → GitHubProvider.checkAuthSync()
- doctor.ts: execSync("gh issue list...") → GitHubProvider.listClosedIssuesSync()
- worktree-manager.ts: 4 spawnSync("gh",...) → GitHubProvider.viewPRByBranchSync() + createPRCliSync()
This completes AC-12 (gh calls consolidated). All gh CLI calls in src/
now live exclusively in platforms/github.ts.
Entire-Checkpoint: 61a587bf7624
- Remove --platform CLI flag, ExecutionConfig.platform, and RunOptions.platform since getPlatform() is never called by production code (YAGNI) - Convert 4 execSync template-string calls in GitHubProvider to spawnSync with array args to eliminate command injection pattern - Update test mocks to match spawnSync usage (phase-detection, doctor, run-resume, github provider tests)
- Add sessionId to AgentExecutionConfig for driver-level session resume - ClaudeCodeDriver passes resume: config.sessionId to query() when set - phase-executor restores canResume safety guard (no resume when worktree isolation active — prevents SDK crash from cwd mismatch) - Add getPRHeadBranchSync to GitHubProvider for PR branch lookup - Hook pre-tool.sh now calls GitHubProvider via scripts/pr-head-branch.ts with fallback to direct gh CLI
Hook pre-tool.sh calls gh directly (not via GitHubProvider) because hooks are bash with strict latency requirements — a TypeScript bridge adds ~1-2s overhead for no functional benefit. GitHubProvider has the equivalent method (getPRHeadBranchSync) for TypeScript callers. Same exclusion rationale as skills (see Non-Goals in #368).
admarble
force-pushed
the
feature/368-extract-agentdriver-interface-from-phase-executor-
branch
from
March 22, 2026 23:53
c21248f to
3ea0225
Compare
admarble
deleted the
feature/368-extract-agentdriver-interface-from-phase-executor-
branch
March 22, 2026 23:53
4 tasks
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.
Summary
AgentDriverinterface to decouple workflow orchestration from agent execution (Claude Agent SDK)PlatformProviderinterface to decouple orchestration from platform operations (ghCLI)ClaudeCodeDriverandGitHubProviderare the default implementations — no behavior change--agent <name>and--platform <name>CLI flags tosequant runPre-PR AC Verification
drivers/agent-driver.tsdrivers/agent-driver.ts:39-56drivers/claude-code.tstypes.ts:58-62bin/cli.ts, verified with --helpdrivers/index.tsplatforms/platform-provider.tsplatforms/github.tstypes.ts:63-67platforms/index.tsbin/cli.ts, verified with --helpTest Coverage
drivers/agent-driver.tsdrivers/claude-code.tsdrivers/index.tsplatforms/platform-provider.tsplatforms/github.tsplatforms/index.tsphase-executor.tsQuality Gates
npm run build— 0 errorsnpm run lint— 0 errors, 0 warningsnpm test— 1577 passed (2 pre-existing failures in doctor.test.ts)Closes #368
🤖 Generated with Claude Code