agentleFS
M2artiDM2artiD/pis-harness/skills/harness-control/SKILL.md

harness-control

Skill0 starsChanged 3 months agoMITView on GitHub

Control an Agent Harness instance — start/pause/resume/cancel mock and real runs, issue or block approvals, and verify runs against the independent manifest verifier. Use when operating a harness, reviewing a run ledger, or debugging why a run ended FAILED/CANCELED/CRASHED.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Ai-assistant-KIRA/antigravity-harness★ 1same name
    2. stump-wtf/claude-plugin-harness★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start a mock run (no network, no key):

    line 18
  2. Distinctive:

    If a run reads FAILED but the executor exit was 0, read the attempt verdict reason: the model claimed completion but the requirement …

    line 57
  3. Very specific:

    Don't edit ledgers or run.json by hand — the verifier will (correctly) fail.

    line 65
  4. Distinctive:

    Don't add a provider that holds a key in a fixture.

    line 66
  5. Very specific:

    Don't run public-release-check.mjs on a dirty tree as a pass — a root .runs/dist is a blocker.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Harness Control

Operate runs in this repo's harness. Everything is public-safe: mock executor by default, no network, no keys.

Orientation

  • Runs live under <runsDir>; each run is <runsDir>/<runId>/run.json plus append-only evidence.jsonl.
  • The completion gate runs the independent verifier — computeVerdict + verifyFingerprint. A run only reaches DONE on a verifier PASS, never on a model claim.
  • Ledgers are append-only. Re-running verify-manifest.mjs must reproduce the recorded verdict and fingerprint; a mismatch means tampering or a bug (see regressions below).

Do

  • Start a mock run (no network, no key):
node -e "
import('@m2atrid/pis-harness-service').then(async ({ HarnessService }) => {
  const s = new HarnessService({ runsDir: '.runs' });
  const r = await s.start({ slug: 'demo', manifestSha256: 'a'.repeat(64), sessionId: 'x', argv: ['node','-e','true'], cwd: '.', requirements: [{ requirementId: 'r1', evaluator: 'output-includes', needle: 'fake-executor' }] });
  const f = await s.runner.waitFor(r.runId);
  console.log(r.runId, f.status);
});
"
  • Independently verify a finished run:
node scripts/verify-manifest.mjs .runs <runId>

Expect recordedStatus === recomputedStatus and fingerprintMatch: true.

Approval flow

Closed state machine: RUNNING -> WAITING_APPROVAL -> QUEUED (approve, exactly one grant) | FAILED (reject). approve parks the run in QUEUED (never silently resumes); the child was already terminated at the gate. resume is the only grant consumer and takes no caller argv/cwd/env (server-side registry decides):

await service.requestApproval({ runId, scope: "approve:tool", prompt: "allow tool?" });
await service.approve({ runId, decidedBy: "ops" });
await service.resume({ runId }); // consumes the one-time grant, RUNNING

A second approve while a grant is outstanding throws; a grant is consumed at most once. reject closes the run FAILED. Run-record mutations are serialized per run (per-run lock in lock.mjs), so concurrent ops never lose updates.

Debugging terminal states

statusmeaningnext step
DONEverifier PASSdone
FAILEDexecutor non-zero OR verifier not PASSread attempt.release.notes
CRASHEDlease expired / owner diedrunner.recoverCrashed() then resume
CANCELEDoperator cancelstart a new run
WAITING_APPROVALgate for one-time approvalapprove/reject

If a run reads FAILED but the executor exit was 0, read the attempt verdict reason: the model claimed completion but the requirement evidence did not prove it. That's the gate working.

Regressions this repo has already caught

  • Completion-gate evidence bug: the verifier computed a PASS verdict in memory but the evidence was never appended to the ledger; verify-manifest.mjs reported fingerprintMatch: false, recomputedStatus: FAIL. Fixed in 10.5 — evidence is persisted via appendEvidence before the record is saved. Keep the regression test in packages/harness-core/test/core.test.js ("completion gate persists evidence so the independent verifier agrees").

Don't

  • Don't edit ledgers or run.json by hand — the verifier will (correctly) fail.
  • Don't add a provider that holds a key in a fixture. maskedProfile only.
  • Don't run public-release-check.mjs on a dirty tree as a pass — a root .runs/dist is a blocker.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.