Python API Reference

The goatcs-harness exposes a Python API for programmatic use.

run()

Execute a graph programmatically.

python
1
2
3
4
5
6
7
8
9
from goatcs_harness import run

result = run(
    graph_path="path/to/graph.json",
    seed={"plan_path": "/abs/path/to/plan.json"},
    provider="inline",
    read_dirs=["/path/to/read"],
    scratch_dir="/path/to/scratch",
)

verify()

Validate a graph topology.

python
1
2
3
4
from goatcs_harness import verify

report = verify("path/to/graph.json", strict_wiring=True)
assert report.ok

GraphBuilder

Programmatically construct a graph.

python
1
2
3
4
5
6
7
8
from goatcs_harness import GraphBuilder

gb = GraphBuilder("my-skill")
gb.add_node("N-INTAKE", type="INGEST", exec_type="inline", tier="model-medium")
gb.add_node("N-PROCESS", type="ANALYZER", exec_type="spawn", tier="model-large")
gb.add_edge("N-INTAKE", "N-PROCESS", edge_type="required", signal_field="intake_output")
gb.set_metadata(description="My custom skill", version="1.0.0")
gb.emit("./output-dir/")

forge()

Generate a skill from a brief using the forge subsystem.

python
1
2
3
4
5
6
7
from goatcs_harness import forge

result = forge(
    brief="A skill that analyzes code quality...",
    profile="power",           # power | standard | minimal
    output_dir="./my-skill/",
)

eval()

Evaluate a generated skill against acceptance criteria.

python
1
2
3
4
5
6
from goatcs_harness import eval

score = eval(
    skill_dir="./my-skill/",
    criteria=["wiring", "smoke", "behavioral"],
)