pi-harness

pi-harness is the research and build area for Pi, Earendil's minimal, extensible agent harness (github.com/earendil-works/pi). It began on 2026-10-11 by asking whether owning a harness fixes the costliest failures in this machine's Claude Code, Kimi and OpenCode history. Those were false completion claims, agents that stop before the goal, and destructive actions.

It now ships pi-task. A Pi worker does one task in a fresh Incus container. Its result comes back only if a judge, in another fresh container, finds that the brief's checks hold, no gaming rule fired, and every hidden check passed. An accepted result arrives as a branch, pi/<task>, and is never merged automatically.

Status

What it is made of

Part Path What it does
pi-goal artifacts/pi-goal/ A Pi extension. The worker can finish only when the brief's DONE WHEN holds. Pi runs VERIFY itself, goal.pl (SWI-Prolog) decides, and the gaming checks (ast_facts.py and gaming.pl) block changes that pass the checks without doing the task
pi-guard artifacts/pi-guard/ A Pi extension that blocks destructive and convention-breaking bash. It is the first line of defence, not the boundary
pi-worker artifacts/pi-worker/ The pinned image build, worker.py (one task: bundle in, worker, bundle out, judge, accept or reject), pi_task.py (the deployed CLI), install.sh, the boundary tests and the Claude Code skill
pi-rpc artifacts/pi-rpc/ A Python RPC client for Pi, plus the probes that answered the hands-on research questions
pi-install artifacts/pi-install/ The record of the host Pi install, and its refusing verifier
history-mining artifacts/history-mining/ Scripts that mined the agent history behind the requirements
notes notes/ The research notes. Start at notes/00-index.md

Key Pages

Quick Commands

# Use it
pi-task verify                                   # VERIFIED or REFUSED; on a refusal, stop
pi-task check-brief BRIEF --hidden HIDDEN        # parse a brief the way the judge will
pi-task run   --repo REPO --brief BRIEF --hidden HIDDEN [--model openrouter/qwen/qwen3-coder]
pi-task judge --repo REPO --brief BRIEF --base START_COMMIT --ref BRANCH --hidden HIDDEN
# exit status: 0 accepted or done, 1 rejected or not done, 2 refused

# Develop it (in ~/workspace/pi-harness)
PI_GOAL_PYTHON=~/.local/bin/python3.14t node --test artifacts/pi-goal/goal.test.ts
node --test artifacts/pi-guard/rules.test.ts
artifacts/pi-worker/build-image.sh --rebuild
python3.14t artifacts/pi-worker/boundary_tests.py <scratch dir>
artifacts/pi-worker/install.sh <commit>
artifacts/pi-install/verify.sh