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
This is the foundational seam for Phase 3 ("Create + Iterate — the hands"). Everything else in this batch — the CLI-subprocess driver, the Agent-SDK driver, the driver factory, the attempt log, the parity test suite, dry-run mode, the lint-guarded wrapper, cost metering, and the design doc — either implements this interface or consumes it. Confirmed via repo-wide grep: zero hits for CodingAgentDriver anywhere today. This is genuinely greenfield.
The existing precedent to mirror is SelfHostAi in src/selfhost/ai.ts:61-63:
A single-method interface that several different backends (openai-compatible HTTP, anthropic HTTP, claude-code CLI subprocess, codex CLI subprocess) all implement identically, selected at runtime by a provider-name string (AI_PROVIDER, parsed in src/selfhost/ai-config.ts). CodingAgentDriver should follow the same shape.
Sibling maintainer-only issue #2333 ("local create->score->self-review iterate-loop orchestrator") already names the expected file path for this seam in its own References section: packages/gittensory-engine/src/miner/coding-agent-driver.ts — a new miner/ subdirectory under the engine package (today's sibling subdirectories are advisory/, github/, governor/, portfolio/, review/, scoring/, settings/, signals/, types/, utils/, focus-manifest/). That same issue also names attempt-log.ts and acceptance-criteria.ts as siblings in that directory — both filed separately in this batch.
Deliverables
packages/gittensory-engine/src/miner/coding-agent-driver.ts exporting a CodingAgentDriver interface, mirroring SelfHostAi's single-method shape: one run()-style method taking a scoped local task (working directory, acceptance-criteria file path/content, instructions, a turn/budget ceiling) and returning a structured result (success/failure, changed files, a driver-specific transcript/usage summary). No network calls, no GitHub writes, no autonomous continue/stop decision-making — that orchestration is explicitly issue maintainer: local create->score->self-review iterate-loop orchestrator (the control-flow core) #2333's job, out of scope here.
Task/result types stay provider-agnostic: nothing in the interface should assume a subprocess CLI (this batch's CLI-subprocess driver) vs. the Agent SDK's query() loop (this batch's Agent-SDK driver) — both must implement it without leaking provider-specific fields into the shared type.
packages/gittensory-engine is otherwise pure/deterministic (its src/index.ts header: "No IO, no Date, no randomness"; reward-risk.ts takes an injected RewardRiskEngineDeps to stay testable despite depending on a non-pure stack) — this interface's implementations MAY perform real IO, but anything a test needs to control (spawn function, clock, filesystem writes) should be an injected parameter, the same way SpawnFn is injected into createClaudeCodeAi/createCodexAi rather than hardcoded (src/selfhost/ai.ts:772, :852).
Unit tests for the type-level contract using a minimal fake driver implementing the interface — there's no real behavior yet, but the shape needs to be locked down so the CLI-subprocess and Agent-SDK drivers can implement against it without it shifting under them.
Export the new interface + supporting types from packages/gittensory-engine/src/index.ts's barrel, matching its existing grouped-export style with the .js extension convention already used throughout that file.
References
src/selfhost/ai.ts:56-63 (AiRunOptions, AiResult, SelfHostAi — the interface shape this seam mirrors)
src/selfhost/ai.ts:772, :852 (createClaudeCodeAi, createCodexAi — two concrete SelfHostAi implementations selected by provider name, and the injected-SpawnFn testability convention)
src/selfhost/ai-config.ts:41-74 (resolveConfiguredProviderNames/isConfiguredSelfHostProvider — the provider-name-string selection pattern the driver factory, filed separately in this batch, mirrors)
packages/gittensory-engine/src/index.ts:1-6 (barrel header: "deterministic, side-effect-free logic" — the DI convention this new module should preserve)
This is the foundational seam for Phase 3 ("Create + Iterate — the hands"). Everything else in this batch — the CLI-subprocess driver, the Agent-SDK driver, the driver factory, the attempt log, the parity test suite, dry-run mode, the lint-guarded wrapper, cost metering, and the design doc — either implements this interface or consumes it. Confirmed via repo-wide grep: zero hits for
CodingAgentDriveranywhere today. This is genuinely greenfield.The existing precedent to mirror is
SelfHostAiinsrc/selfhost/ai.ts:61-63:A single-method interface that several different backends (openai-compatible HTTP, anthropic HTTP, claude-code CLI subprocess, codex CLI subprocess) all implement identically, selected at runtime by a provider-name string (
AI_PROVIDER, parsed insrc/selfhost/ai-config.ts).CodingAgentDrivershould follow the same shape.Sibling maintainer-only issue #2333 ("local create->score->self-review iterate-loop orchestrator") already names the expected file path for this seam in its own References section:
packages/gittensory-engine/src/miner/coding-agent-driver.ts— a newminer/subdirectory under the engine package (today's sibling subdirectories areadvisory/,github/,governor/,portfolio/,review/,scoring/,settings/,signals/,types/,utils/,focus-manifest/). That same issue also namesattempt-log.tsandacceptance-criteria.tsas siblings in that directory — both filed separately in this batch.Deliverables
packages/gittensory-engine/src/miner/coding-agent-driver.tsexporting aCodingAgentDriverinterface, mirroringSelfHostAi's single-method shape: onerun()-style method taking a scoped local task (working directory, acceptance-criteria file path/content, instructions, a turn/budget ceiling) and returning a structured result (success/failure, changed files, a driver-specific transcript/usage summary). No network calls, no GitHub writes, no autonomous continue/stop decision-making — that orchestration is explicitly issue maintainer: local create->score->self-review iterate-loop orchestrator (the control-flow core) #2333's job, out of scope here.query()loop (this batch's Agent-SDK driver) — both must implement it without leaking provider-specific fields into the shared type.packages/gittensory-engineis otherwise pure/deterministic (itssrc/index.tsheader: "No IO, no Date, no randomness";reward-risk.tstakes an injectedRewardRiskEngineDepsto stay testable despite depending on a non-pure stack) — this interface's implementations MAY perform real IO, but anything a test needs to control (spawn function, clock, filesystem writes) should be an injected parameter, the same waySpawnFnis injected intocreateClaudeCodeAi/createCodexAirather than hardcoded (src/selfhost/ai.ts:772,:852).packages/gittensory-engine/src/index.ts's barrel, matching its existing grouped-export style with the.jsextension convention already used throughout that file.References
src/selfhost/ai.ts:56-63(AiRunOptions,AiResult,SelfHostAi— the interface shape this seam mirrors)src/selfhost/ai.ts:772,:852(createClaudeCodeAi,createCodexAi— two concreteSelfHostAiimplementations selected by provider name, and the injected-SpawnFntestability convention)src/selfhost/ai-config.ts:41-74(resolveConfiguredProviderNames/isConfiguredSelfHostProvider— the provider-name-string selection pattern the driver factory, filed separately in this batch, mirrors)packages/gittensory-engine/src/index.ts:1-6(barrel header: "deterministic, side-effect-free logic" — the DI convention this new module should preserve)packages/gittensory-engine/src/miner/{coding-agent-driver,attempt-log,acceptance-criteria}.tsas the exact expected paths for this batch's primitives