Skip to content

Repository files navigation

case-harness

Cases in, verdicts out. Reusable cases go in; e2e, eval, perf, trace, and trajectory runs produce one machine-readable Verdict. 中文版见 README.zh-CN.md.

What it is

case-harness is a cross-language family of testing SDKs for projects whose quality can no longer be answered by one test command. It separates API correctness, agent quality, capacity, trace attribution, and agent trajectory into distinct judgment views while letting them reuse the same versioned Case assets.

The repository provides harness SDKs and platform tools, not a test suite for your product. The system under test keeps its own cases, protocol adapters, credentials, resource lifecycle, and acceptance criteria.

What it assesses

QuestionViewAvailable SDKs
Do public APIs still behave correctly?e2ePython / Go
Is an agent's output good enough?evalPython
What happens under declared load and resource constraints?perfPython / TypeScript
Which layer in a physical call chain became abnormal first?tracePython / TypeScript
Were an agent's decisions and actions reasonable?trajectoryPython

The first three views judge the system from public behavior; trace and trajectory inspect execution evidence. “Black-box” describes the judgment boundary, not every setup action: preparing an environment, injecting a controlled failure, or observing resource pressure may still require deployment-level tools.

Current e2e targets a single service's public boundary. Product-level Web, mobile, and multi-service functional testing remain a longer-term scope rather than being conflated with service API contracts.

How it works

canonical CaseSet owned by the project
+ environment and execution code
+ one judgment view
→ CaseRun (prepare → execute → judge → cleanup)
→ Run artifacts
→ verdict.json
ConceptMeaning
CaseStable, reusable test input and judgment data, identified by case_id; the canonical format is owned by spec-case.
CaseRunOne Case executed in one environment and variant with explicit phase budgets and cleanup semantics.
RunThe artifact and lifecycle boundary for one real execution, carrying environment and alignment identity.
VerdictThe common machine-readable result consumed by humans, CI, and agent development loops.

A Case can be viewed from more than one angle. When one execution already produced responses, traces, metrics, or a trajectory, those observations should feed multiple judgments instead of triggering duplicate work.

Shared platform toolbox

Some execution mechanics serve more than one harness. Recovery E2E and performance tests, for example, both need reliable Kubernetes workload discovery, state convergence, and Event evidence. The Go kube package provides namespace-scoped Kubernetes control and observation without owning any business Case, load profile, or Verdict.

The consuming project still decides which workload to target, when a disruption is allowed, and what proves recovery or acceptable performance. Additional fault-injection backends can join this toolbox without moving experiment intent out of the project.

Get started

Choose the example closest to your test:

ExampleUse it for
examples/api-testSmall data-driven API cases
examples/python-servicePython CaseRun with setup and cleanup
examples/go-serviceGo CaseRun, go test aggregation, and Verdict output
examples/agent-testDataset-driven agent evaluation

Run the Python API example from a source checkout:

cd python
uv sync
export WIDGET_TOKEN=...
uv run e2e run ../examples/api-test/cases.yaml \
--config ../examples/api-test/config.yaml \
--runs-dir ../runs

Run the Go service example against a deployed service:

cd examples/go-service
export ASANDBOX_BASE_URL=http://localhost:8090
export EXAMPLE_TOKEN=...
go test -tags=e2e -v ./...

Both paths write a Run directory ending in verdict.json. Skipped or errored cases remain visible and are not interpreted as successful verification.

Ownership

OwnerResponsibility
Project under testVersioned Case assets, test code, domain actions, acceptance criteria
case-harnessCase execution, runners and drivers, judges, Run artifacts, Verdict projection, shared platform tools
spec-caseCanonical Case model and code-to-Case intent markers
Deployment workflowEnvironment, credentials, target revision, trigger policy, and release gates

This split keeps test intent close to the product while allowing execution mechanics and output contracts to improve centrally. case-code-review consumes the same assets from a white-box review perspective.

SDK map

PathCapability
python/e2e_harness / go/e2eDeterministic CaseRun execution and API assertions
python/eval_harnessAgent evaluation and comparative experiments
python/perf_harness / typescript/perf-harnessLoad generation, SLOs, and capacity evidence
python/trace_harness / typescript/trace-harnessTrace normalization, attribution, and findings
python/trajectory_harnessAgent trajectory normalization and evaluation
go/kubeKubernetes control and observation shared by e2e and perf

Repository development

cd python && uv sync && uv run pytest -q
cd ../go && go test ./...
cd ../typescript/trace-harness && bun install --frozen-lockfile && bun testcd ../perf-harness && bun install --frozen-lockfile && bun test

Status

case-harness is an early public project. The canonical Case schema comes from spec-case; the Verdict and runtime contracts under spec/ are its stable center. Language SDKs may cover different features while continuing to share those contracts.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages