Architecture diagram on a light dot grid showing three input cards (Pi Agent Host, ORC Hub, and Harbor Sandbox) feeding a dark teal PORC block containing the orc tool and docker-tools.ts, outputting a Harbor Eval card (6/24 to 24/24, 0 ORC calls on code) connected back via a dotted coral Teach-Run-Score loop

How We Evaluate and Improve porc (Pi + ORC) with Harbor ​

Adding shared memory, skills, or external tools to a coding agent is easy to demo and easy to get quietly wrong. The agent might forget to save lessons unless prompted, spend three tool turns finding a tool it should already know, or waste tokens checking shared state on simple coding tasks.

Pi is a small, extensible coding agent. ORC is the local hub I maintain for shared memories, skills, pads, tasks, runbooks, cron jobs, external integrations, and workspace rules across every coding agent on a machine (covered earlier in Agent Collaboration Across Coding Agents). porc (@orc/pi, in packages/pi) connects the two so Pi shares state with every other agent you run through one orc tool.

To make porc reliable in daily use, we built a Harbor evaluation loop and tuned it from real trajectories. On an 8-task Terminal-Bench 2.1 control, porc added about 780 tokens per request and made 0 orc calls. On a 12-task cross-session ORC suite (24 trials per round), iterating from trajectory logs took porc from 6/24 to 24/24 while plain Pi scored 2/24 (the negative control only).

What porc adds to Pi ​

porc keeps Pi in charge of your runtime, models, and local skills while putting ORC behind it as the shared engine. You bring whatever model, API key, or subscription you already use in Pi, and local skills in .agents/skills and .pi/skills still load natively and win on name clashes.

Instead of packing context with dozens of tool schemas, porc adds four lightweight pieces (full details in the porc README):

  • One orc meta tool: direct actions handle frequent work (memory_*, skill_*, job_*, rule_*, project_list, context), while search -> describe -> invoke reaches pads, tasks, knowledge bases, past sessions, and external Spec integrations such as GitHub or Slack.
  • Per-prompt recall: each prompt gets a short hidden hint naming up to 4 relevant memories and 3 skills, fetched on demand instead of synced to disk.
  • A static prompt section: 1,518 characters that stay prompt-cache friendly and tell Pi to skip ORC on self-contained coding tasks.
  • Shared workspace rules: orc rules hook pi enforces the exact same guardrails across Pi, Claude Code, and Codex.
CapabilityWhat it gives you inside Pi
Memories and skillsSave conventions or procedures once and let future sessions (or other agents) recall and apply them automatically
Pads and task boardShare plans, diagrams, and reports as ORC pad links, and track follow-up work on a shared board
Runbooks and session searchQuery team knowledge bases (kb_search) and recall earlier coding sessions (session_search) across agents
Jobs, rules, and integrationsSchedule recurring Pi cron jobs from chat, add guardrails (rule_add), and register OpenAPI or MCP tools for every agent via spec add

How we wire Pi and porc into Harbor ​

Harbor is an open-source evaluation runner for coding agents (I also used it in Teaching Claude to Draft My Israeli Tax Return, Measured with Harbor). Every task is a self-contained folder with a Dockerfile, an instruction.md, and verifier tests that Harbor uploads into the container only after the agent finishes, so the agent can never peek at the grading script. Out of the box, Harbor handles container isolation, parallel runs, retries (-k), trajectory capture, and public benchmarks like Terminal-Bench.

Architecture diagram showing how Pi and porc wire into Harbor: Pi, porc, the user's own model provider, and host ORC run on the host machine, while harbor/docker-tools.ts forwards read, write, edit, and bash into Harbor's Docker task container via docker exec, and score_orc.py grades verifier reward plus ORC trajectory calls

porc_pi.py subclasses Harbor's built-in Pi agent into two arms: HostPi (PORC_DISABLED=true, plain Pi baseline) and HostPorcPi (PORC_PROJECT=harbor-eval, scoped to a scratch ORC project). Both launch host pi with docker-tools.ts, a small extension adapted from Pi's SSH example that routes read, write, edit, and bash into Harbor's container via docker exec and points cwd at the container workdir.

Every code edit and test runs inside the isolated sandbox, while every orc call, recall hint, and rule hook hits the live host daemon. All runs below used Sonnet 5.5 under Harbor 0.27 and local Docker so differences reflect the harness rather than the model.

Step 1: check overhead on ordinary coding tasks ​

Before testing what ORC adds, we checked whether porc gets in the way of self-contained coding using a Terminal-Bench 2.1 code and debug subset (NovitaAI/tb21-code-debug).

Chart comparing HostPi against HostPorcPi across 8 Terminal-Bench 2.1 code and debug tasks on input tokens and agent seconds: HostPi passes 8/8 (1.21M tokens, 447 s) and HostPorcPi passes 7/8 (739k tokens, 366 s) with the lone chess-best-move miss passing 3/3 on rerun, 0 ORC calls across all 15 porc trials, and about 780 tokens per request fixed overhead

Across the 4-task smoke (4/4 vs 4/4), the 8-task comparison (8/8 vs 7/8), and a 3-attempt rerun of the lone chess-best-move miss (3/3 vs 3/3), HostPorcPi made 0 orc calls across all 15 trials. The static prompt and single tool schema add roughly 780 tokens per request (measured on fix-git before trimming the prompt to 1,518 characters), with zero wasted tool turns.

Step 2: evaluate cross-session capabilities end to end ​

Single-turn coding benchmarks cannot test shared memory, skills, pads, or guardrails. To test whether what one session learns actually carries over to a fresh session, we built a 12-task cross-session suite (harbor/orc-tasks) driven by run_orc_eval.py.

Animated five-stage cross-session Harbor evaluation loop driven by run_orc_eval.py: snapshot and seed runbooks KB, teach in 4 parallel native pi sessions (plus an echo session post-v3), run fresh Harbor containers at k=2, score container verifier plus expected ORC calls in pi.txt, and diff-clean ORC state failing on CLI errors or leftover memories, skills, jobs, or tasks

Each round snapshots ORC, seeds a runbooks knowledge base, runs parallel native pi -p teach sessions in fresh temp directories (a convention, a release-notes skill, a passing incident note, and a handoff note), then launches fresh Harbor containers (k=2, 24 trials per round) across all 12 tasks.

The key design choice is dual scoring in score_orc.py. A trial passes only when both the container verifier returns 1.0 and the trajectory contains the expected successful orc tool call with its key arguments. Three examples from harbor/orc-tasks show the pattern:

  • memory-service-conventions (cross-session recall): a teach session shares our HTTP port (8473) and health route (GET /livez). A fresh container asks Pi to write /app/server.py following team conventions. Harbor verifies the server uses 8473 and /livez, and score_orc.py requires memory_read or memory_list.
  • external-github (integrations with container internet off): the container has allow_internet = false and asks for the open-issue count on niradler/orc. Harbor checks /app/issues.txt against the live count, and score_orc.py requires invoke <tool>@github routed through ORC on the host.
  • negative-control (skipping ORC on plain code): asks Pi to fix normalize_memory_name in /app/orc_memory.py. Harbor runs unit tests, and score_orc.py fails the trial if any orc call appears.

After scoring, the driver diffs the ORC snapshot and deletes everything created during the round so rounds never bleed into each other.

What actually moved the score from 6/24 to 24/24 ​

Running the full suite across four rounds (rescored under the same strict scorer, raw logs in eval-data/) made every bottleneck obvious:

Heatmap chart of all 12 cross-session ORC tasks across 5 rounds (2 attempts each, 24 trials per round): HostPi v1b passes only negative-control (2/24), porc v1 scores 6/24 due to a container hostname bug, porc v1b jumps to 18/24 after fixing container lookup via Docker Compose labels, porc v2 hits 20/24 after adding direct tool paths and cutting the prompt from 1,932 to 1,467 characters, and porc v3 reaches 24/24 after adding unasked-save triggers at 1,518 characters

Plain Pi scored 2/24 (negative-control only) because its teach sessions wrote conventions into ephemeral temp folders that the next session could never see. On porc, four concrete changes closed the remaining gaps:

  • Fix the harness before tuning prompts (6/24 -> 18/24): on offline Harbor tasks, querying container IDs by Docker Compose labels instead of hostname restored 12 passes without touching a word of the prompt.
  • Give direct paths for common tools (18/24 -> 20/24 and fewer calls): trimming the prompt from 1,932 to 1,467 characters and naming exact calls (invoke kb_search {query}, invoke pad_create, invoke task_create, invoke session_search) fixed kb-runbook immediately, cut pad creation from 3.0 to 1.5 ORC calls, and cut task creation from 2.0 to 1.0.
  • Name explicit triggers for unasked saves (20/24 -> 24/24): telling Pi to call memory_create in the same turn when a user drops phrases like "heads up", "FYI", or "for whoever picks this up" (1,518 characters total) turned passive acknowledgments into saved memories that the next session recalled on the first try.
  • Let failing tasks expose product bugs: the suite caught real code issues beyond the prompt, including a 5-second timeout that silently killed tool_search (raised to 30 s), headless writes that needed fail-closed defaults, workspace rules needing to default on, and a 13th task (session-transcript-recall) that revealed Pi sessions were not being lexically indexed by ORC yet (fixed right after).

Try ORC and porc ​

If you already use Pi with any model or subscription, you can try porc in one command once ORC is running:

bash
pi install npm:@orc/pi

Open Pi in any repository and run /orc to bind a project, /orc-remember to save a convention across sessions, or /orc-skills to browse shared skills. To inspect the Harbor agents, task suite, and 216 exported trial rows, see packages/pi/harbor and packages/pi/docs/eval-data.

If you are adding memory, skills, or tools to a coding agent, wire your agent into Harbor, score both final answers and tool trajectories, and let the failing runs tell you what to fix next.

Up next ​

Prompt tuning got a frontier model to 24/24, and the same Harbor tasks can now double as training environments. In the next post, inspired by Hugging Face's work on Harness Adapters, we will fine-tune a Pi LoRA adapter directly on porc tools so smaller open models learn when to call ORC and when to leave it alone without relying on a long system prompt.