Agent Experience
A tiny CLI that verifies what an agent actually did, instead of trusting that it said "done."
You declare the expected result of an action before it happens. You (or an agent) do the action. Then ref reads the real state back, compares it to what you declared, and records a signed pass/fail. The check is a plain hash comparison — no model, no LLM, no network — so it can't be talked into lying.
Requires bun. It's a single file.
# grab ref.ts into your repo, then: alias ref="bun /path/to/ref.ts" # or run directly bun ref.ts <command>
| command | what it does |
|---|---|
ref intend <kind> <target> <expected> [note] | Record what you expect. kind is file, http, or cmd-stdout. expected is the exact content, or a sha256. |
ref verify <target> | Read reality, compare to the intent, append a signed verdict. Exits 1 on FAIL. |
ref gate <target> | Exit 0 if the last verdict passed, else 1. For scripts / CI. |
ref log | Print the chained verdict ledger. |
# 1. say what the file should contain ref intend file ./config.json '{"replicas":3}' # 2. the agent writes it (correctly, or not) echo '{"replicas":3}' > config.json # 3. ref checks reality against your intent ref verify ./config.json ✓ PASS file ./config.json (match) # if the agent had written {"replicas":1} instead: ✗ FAIL file ./config.json (mismatch) # exit 1 — blocked
| kind | reality it reads |
|---|---|
file | sha256 of the file's bytes on disk |
http | sha256 of status + body from a live GET |
cmd-stdout | sha256 of a command's stdout |
verify reads the target itself and hashes it — it ignores whatever the agent reported.{expected, actual, pass} plus a sha256 of that record, chained to the previous verdict's hash (like a mini blockchain) and signed with an HMAC key. Editing a past verdict breaks the chain.sha256(reality) === expected cannot.ref intend http https://api.example.com/health "$EXPECTED" deploy.sh ref verify https://api.example.com/health # nonzero exit stops the pipeline
REF_KEY env sets the signing key; the default is a dev placeholder.An experiment, kept honest — failures and negative results live in the repo's status.json ledger. MIT · 0.0.1 · github.com/acoyfellow