Concepts
Tools and evaluation hooks
Action tools are what your system calls. Evaluation hooks are how the loop judges it: the scorer, the test set and the runner. Synaptra records both and runs neither.
Action tools
An action tool is anything your agent or pipeline calls: an API, a function, a search, a database query. Register it with a name, a description and a JSON schema for its input. In Python, the @h.tool decorator takes the schema from the function's signature and the description from its docstring. In TypeScript, types don't exist at runtime, so you pass the schema: JSON Schema, or a Zod schema.
@h.tool(description="Look up an order by id")
def get_order(order_id: str, include_items: bool = False) -> dict:
...await h.tool(
{
name: "get_order",
description: "Look up an order by id",
schema: {
type: "object",
properties: { order_id: { type: "string" }, include_items: { type: "boolean", default: false } },
required: ["order_id"],
},
},
getOrder,
);Registering the same name again replaces the tool. Removing a tool is soft: it stays on record, so old versions still say what they used.
Evaluation hooks
| Kind | What it is | What Synaptra keeps |
|---|---|---|
scorer | Turns one output into the metric. | Its name, signature and description. |
dataset | The test set. | Where it lives, its size and a SHA-256 fingerprint. Never the contents. |
runner | The command your infrastructure runs for one variant on one tier. | The command, with {variant}, {tier} and {task} placeholders. |
Because the dataset's fingerprint is recorded, a changed test set shows up: results from before and after aren't silently compared as if nothing happened.
@h.scorer
def exact(output: str, expected: str) -> float:
return float(output.strip() == expected.strip())
h.dataset("golden", items=golden_rows) # size + SHA-256, never the rows
h.runner("python eval.py --variant {variant} --tier {tier} --task {task}")await h.scorer({ name: "exact" }, ({ output, expected }) => Number(output.trim() === expected.trim()));
await h.dataset("golden", { items: goldenRows }); // size + SHA-256, never the rows
await h.runner("node eval.js --variant {variant} --tier {tier} --task {task}");Readiness
A harness is ready when it has a scorer, a test set, a runner, a bar, a first baseline run and a first closed experiment. h.readiness (await h.readiness in TypeScript) lists each item with whether it's done, and the next step says what's missing.
Something unclear or missing? Email support@synaptra.my.