agentleFS
Quattro-CommasQuattro-Commas/elohim/skills/elohim-harness/SKILL.md

elohim-harness

Skill0 starsChanged 45 days agoMITView on GitHub

This skill should be used when an instrument's recorded measurements must be re-verified rather than trusted — "run the gate", "did the numbers drift", "pin the checksum", "is the instrument modified", "add a fact to the ledger", "measure instead of asserting", "build a skill with a verified ledger". Runs five gates (checksum pin, fact ledger, independent trap re-derivations, source hygiene, claim binding) against any instrument directory and refuses to return PASS unless all five hold. Stdlib-only Python 3.10+; no network; no build step.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write the instrument. It must exit 0 and write out/shard.json.

    line 152
  2. Very specific:

    Write scripts/check_traps.py asserting *properties*.

    line 153
  3. Very specific:

    Add the instrument block to ledger.json with the real sha256 and size.

    line 157
  4. Very specific:

    Run the gate. Expect pin DRIFT on the first run after any instrument change: that is the gate working, not a failure to route around.

    line 158

≈ “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

ELOHIM harness

The reusable half of a checksum-pinned instrument gate. Holds none of the mathematics: it reads a skill's ledger.json, runs that skill's instrument/, and calls that skill's check_traps.py and discover.py.

Sharing one implementation is the point. A forked gate is four copies of the same 18 KB, and a fix to the gate then reaches some consumers and not others.

Run the gate

python3 scripts/harness_run.py --skill-dir ../elohim
python3 scripts/harness_run.py --skill-dir ../elohim --json
python3 scripts/harness_run.py --all
python3 scripts/harness_run.py --all --json --fail-under 81
flageffect
--skill-dir PATHthe skill whose instrument is being verified; required unless --all
--allgate every skill that owns an instrument under the skills root
--jsonmachine-readable payload on stdout
--initwrite a ledger.json for a skill that has none: the instrument pin and an empty facts, promoting nothing
--discovermeasure unrecorded structures into the skill's backlog.json
--list-backlogprint unpromoted measurements
--promote ID:PATH[:TOL]pin a backlog measurement as a ledger fact
--max-seconds Nceiling on any single child process; default 600
--fail-under Nrequire at least N facts verified; exit 3 when every gate held and fewer verified

Exit 0 when every gate asked for held, 1 when one fails or a child process ran out of budget, 2 when the skill, its instrument, or the skills root cannot be located, 3 when every gate held but fewer facts were verified than --fail-under required.

--fail-under earns its own exit code rather than borrowing 0 or 1. A consumer asking for a fact count is asking a different question from one asking whether a ledger drifted, and collapsing the two makes "the tree is clean" and "the tree is too small" indistinguishable to a pipeline. 3 is neither success nor failure of a measurement.

The JSON payload carries a schema key — currently elohim.gate/1 — so a consumer can pin to a version instead of discovering a missing field later and guessing whether it is a bug or a change. Bump the minor when a field is added; the major is for a field that changed meaning. The aggregate payload under --all carries the same schema, and every per-skill payload inside it carries it too, so one extracted entry is still self-describing.

The payload carries budget_seconds, runtime (seconds per phase and total), timed_out, timed_out_phase and instrument_error. A run that runs out of budget is a described verdict, not a wall of stderr: the phases that depend on the unmeasured work report as not run rather than as passing.

Runtime is reported and never pinned. Measured across five interpreters on one machine, the same instrument's wall-clock spread 51 % between interpreter medians and 87 % run to run, so a ceiling tight enough to mean anything would be a fact about the machine wearing a fact's clothes.

The five gates

pin — the ledger pins the instrument's sha256 and byte count. Holding the instrument beside its ledger fixes only which code runs; the pin is what makes an edit to that code visible instead of silent. A drift prints both hashes so the difference is auditable, and can never resolve to PASS.

ledger — every recorded fact is re-measured against the fresh output and reported with its residual. A fact whose path vanished reports missing rather than silently passing; a fact that moved reports drifted.

traps — the skill's own independent re-derivations, run from <skill>/scripts/check_traps.py --json. Each re-derives its value with its own code so a regression inside the instrument cannot hide behind the instrument's own helpers.

hygiene — scripts/check_hygiene.py lints the skill's sources for a bare log identifier (a token command-line log sanitizers rewrite) and for network imports. A gate that reaches the network is not reproducible; a gate whose source can be silently rewritten is not a gate.

claim binding — scripts/claim_binding.py extracts every number out of every claim sentence and requires each one to be classifiable: a rendering of some value the gate actually verifies, part of a formula or a scan window, or declared in claim_binding_exemptions.json with a written reason. A number that is none of the three fails. The other four gates measure the ledger; this one reads the sentence beside the number, which is where the worst defect this project shipped lived — prose asserting the opposite of its own pins while every gate reported green, found by a human reading output. An unaccounted number is therefore a failure and not a warning: a claim nobody can bind to a measurement is a claim nothing checks.

This gate is the one that cannot be scoped to a single skill, because a claim may legitimately cite a figure pinned in a sibling. The harness passes the skills directory down, so the candidate universe is every ledger beside the skill, in a checkout (<root>/skills/...) and in an installed flat tree (<root>/<skill>/...) alike.

Required skill layout

<skill>/
  ledger.json                    facts, tolerance, instrument pin, optional label
  backlog.json                  unpromoted measurements
  instrument/*.py               writes out/shard.json next to itself
  scripts/check_traps.py        --json, {"ok": bool, "traps": [...]}
  scripts/discover.py           JSON array on stdout (only for --discover)

The instrument override variable is derived from the directory name: skill invariant-hunter honours ELOHIM_INVARIANT_HUNTER_SCRIPT.

The skills this harness gates

Six instrumented skills ship in this repository and each of them needs no gate code. The counts below are what harness_run.py --skill-dir <skill> printed for each, with the instrument run and the traps re-derived on that run.

skillinstrument overridepinned factstraps
elohimELOHIM_SCRIPT166
estimator-biasELOHIM_ESTIMATOR_BIAS_SCRIPT157
invariant-hunterELOHIM_INVARIANT_HUNTER_SCRIPT35
precision-budgetELOHIM_PRECISION_BUDGET_SCRIPT96
reproducibilityELOHIM_REPRODUCIBILITY_SCRIPT67
tolerance-proverELOHIM_TOLERANCE_PROVER_SCRIPT237

This skill is the seventh directory under skills/, and it is not in that table because it is the gate rather than a consumer of it: it has no ledger.json and no instrument/, so there is nothing for it to pin and nothing for it to re-measure. It is still covered, because a consumer only passes when it can find this harness beside it.

Adding a skill

Nothing here needs editing. --all discovers skills the way this table does — a directory holding SKILL.md that owns an instrument/ — so a new skill is picked up by the gate the moment it ships, and tests/test_all.py fails if the harness's discovery and its own ever disagree about what a skill is.

  1. mkdir -p skills/<name>/{instrument,scripts}.
  2. Write the instrument. It must exit 0 and write out/shard.json.
  3. Write scripts/check_traps.py asserting properties; keep pinned values in the ledger instead. Run --discover first and promote deliberately — a ledger is a record of measurements, and inventing entries is the exact failure this harness exists to catch.
  4. Add the instrument block to ledger.json with the real sha256 and size.
  5. Run the gate. Expect pin DRIFT on the first run after any instrument change: that is the gate working, not a failure to route around.

Files

pathrole
scripts/harness_run.pythe five gates, the report, the CLI
scripts/check_hygiene.pysource lint, shared by every consumer
scripts/claim_binding.pybinds claim-sentence numbers to pinned values
scripts/claim_binding_exemptions.jsondeclared exemptions, each with a reason
references/contract.mdthe JSON contracts a skill must satisfy

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.