Overview
Define all foundational types for the .harness() feature: HarnessConfig, HarnessOptions, HarnessResult, RawResult, Metrics, Message, and the HarnessProvider protocol/interface. Also implement the provider factory skeleton.
Branch: feat/harness-v2
Design doc: docs/design/harness-v2-design.md (Sections 6, 7, 4.4)
Scope
Python (sdk/python/agentfield/harness/)
TypeScript (sdk/typescript/src/harness/)
Acceptance Criteria
- All types match the design doc
HarnessConfig.provider is required (no default)
- Config resolution: per-call overrides > constructor defaults
- Factory raises/throws for unknown provider names
- All tests pass, no lint errors
Dependencies
TDD Approach
Write tests for type construction, validation, and config resolution BEFORE implementing the types.
Overview
Define all foundational types for the
.harness()feature:HarnessConfig,HarnessOptions,HarnessResult,RawResult,Metrics,Message, and theHarnessProviderprotocol/interface. Also implement the provider factory skeleton.Branch:
feat/harness-v2Design doc:
docs/design/harness-v2-design.md(Sections 6, 7, 4.4)Scope
Python (
sdk/python/agentfield/harness/)__init__.py— public API exports_result.py—HarnessResult,RawResult,Metrics,Messagedataclassesproviders/_base.py—HarnessProviderProtocol classproviders/_factory.py—build_provider()skeleton (raises for unknown providers)providers/__init__.py— exportsHarnessConfigtosdk/python/agentfield/types.py(alongsideAIConfig)TypeScript (
sdk/typescript/src/harness/)types.ts— all type/interface definitionsproviders/base.ts—HarnessProviderinterfaceproviders/factory.ts—buildProvider()skeletonproviders/index.ts— exportsindex.ts— public API exportsAcceptance Criteria
HarnessConfig.provideris required (no default)Dependencies
TDD Approach
Write tests for type construction, validation, and config resolution BEFORE implementing the types.