tolerance-prover
Skill0 starsChanged 44 days agoMITView on GitHub
This skill should be used when a bound is about to be relied on and nobody has checked it — "is this bound tight", "can I trust this tolerance", "is the Pisot constant 2 attained", "which n is the worst case", "my error bound has no margin", "prove the bound is sharp", "is this crossover a property of the sequence or of my code", "does adding precision change which n breaks worst", "is this measurement reproducible or noise". Measures the tightness of the Pisot bound 2 for the tribonacci and plastic constants, shows that the bound is a supremum that no finite n attains, and demonstrates that the digit count at which the bound starts holding is a property of the arithmetic rather than of the sequence. Stdlib-only Python 3.10+, no network, no build step.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- claim-ledgerSkill
- elohim-harnessSkill
- elohimSkill
- estimator-biasSkill
- invariant-hunterSkill
- pay-signalSkill
- precision-budgetSkill
- reproducibilitySkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 181
Read every backlog entry before promoting it.
≈ “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.
Files
TOLERANCE PROVER
The product of this skill is a tightness verdict, and the evidence that the verdict is about the bound rather than about the rounding.
Pisot's theorem says that for a Pisot number,
|lambda**n - round(lambda**n)| <= 2 |alpha|**nfor every n, and the 2 comes from somewhere specific: lambda**n is within
2 |alpha|**n of the integer trace p_n of the two non-dominant roots, and
the 2 is the triangle inequality on a conjugate pair. So the measured ratio
is not noise around a constant. It is
ratio(n) = 2 |cos(n theta)|with theta the argument of a conjugate, and 2 is the bound on that. The
skill measures the ratio and then measures how close the measurement gets to
the constant it is bounded by.
Three results, all measured at runtime.
| base | maximum over n <= 200 | at n | deficit from 2 | working digits |
| tribonacci | 1.999974821665813 | 192 | 2.5178334186914952e-05 | 109 |
| plastic | 1.9999995588370636 | 183 | 4.411629364042824e-07 | 66 |
- the bound is approached, never reached.
2is a supremum. Raising the ceiling ton <= 3200moves the tribonacci maximum to1.9999999948963232atn = 1881, a deficit of5.103676814499636e-09, which is4933times smaller than atn <= 200— and it is still not zero, because2 |cos(n theta)| = 2needsn thetato be a multiple ofpi, which is a question about the argument rather than about rounding. - the argmax is a fact about the window, for one base only. The
tribonacci
n = 192is the worst case insiden <= 200and nowhere else: it has moved ton = 1881byn <= 3200. The plasticn = 183has not moved off at any of the nine rungs, and its deficit is unchanged to the last digit fromn <= 200ton <= 3200. Two bases, two behaviours, and a shared argmax would have been a coincidence. - the crossover precision is a property of the arithmetic. The lowest
working precision at which the bound starts holding is
83digits for tribonacci when the ratio is formed by computinglambda**nand subtracting the rounding, and81on a route that propagates the residual through the linear recurrence and never forms a power aboven = 3. For plastic the two are43and39. No single number for the crossover belongs in a ledger, and this skill does not put one there.
The last one is the reason this skill exists alongside precision-budget.
That skill asks how many digits a computation needs. This one asks what
happens when you quote the answer, and the answer is: the digits are a
property of the code as well as of the sequence.
What is deliberately not pinned
Precision is the hazard this skill is built around, so the numbers that precision cannot fix are the ones it refuses to record.
- no crossover precision and no budget slack. Both were measured twice
and the two routes disagreed, by 2 digits for tribonacci and 4 for plastic.
The digests are in
instrument/out/shard.json; the ledger pins the boolean that the disagreement exists, not a figure drawn from one side. - no starved maximum, no starved argmax, no order count. At 60 working
digits over
n <= 400the tribonacci power route returns7.1319695695083885e+28and the residual route returns1.5657232055344197e+99, a factor of2.1953587859213847e+70apart on the same budget. Add three digits and the power route's answer changes by a factor of51.6and its argmax moves fromn = 222ton = 234, while the residual route's argmax does not move at all. The ledger pins the verdict that those digits are not pinnable and that the peak's movement is route-dependent, and pins neither the digits nor the peak. - no claim of minimality for the digit budget. The
+30in the formula is a margin somebody chose. Sufficiency is the claim that can fail, and sufficiency is measured: on both routes for both bases the highest working precision that still breaks the bound lies below the budget.
Run the gate
From the repository root:
python3 skills/elohim-harness/scripts/harness_run.py --skill-dir skills/tolerance-prover| flag | effect |
--json | machine-readable payload on stdout |
--discover | measure the unrefuted claims into backlog.json |
--list-backlog | print measurements not yet promoted |
--promote ID:PATH[:TOL] | pin one backlog measurement as a ledger fact |
Exit 0 when all five gates hold, 1 when one fails, 2 when the skill
or its instrument cannot be located. To run the instrument or either script
on its own, cd nowhere: each resolves its own paths relative to its own
file.
The instrument also honours an override, derived from the directory name the way the contract specifies:
ELOHIM_TOLERANCE_PROVER_SCRIPT=/path/to/tolerance_prover.py \
python3 skills/elohim-harness/scripts/harness_run.py --skill-dir skills/tolerance-proverAn override that points at a missing file is an error, exit 2, never a
silent fallback to the bundled copy.
The five gates
pin — the ledger pins this 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. Drift prints both hashes and can never resolve to PASS. Expect DRIFT the first time after any change to the instrument: that is the gate working.
ledger — each recorded fact is re-measured against a fresh shard and
reported with its residual. A fact whose path has vanished reports missing
rather than quietly passing. These twenty-three facts started empty: nothing
was written into the ledger that the instrument had not measured in a run of
its own and that discover.py had not re-derived through a different root
finder and a different propagation.
traps — seven traps in scripts/check_traps.py, each re-deriving its
property from the minimal polynomial with code of its own. The sharpest two
are structural rather than numerical:
- trap 2 never forms a power of
lambdaaboven = 3. It propagatesw_n = lambda**n - p_nthrough the linear recurrence and has to land on the same maximum and the same argmax bit for bit. That is the strongest form of agreement available here, and it is available because the instrument's own error model is the thing being tested. - trap 3 derives the shape of the bound rather than its value: it builds its
own
piby Machin's formula, its own arctangent, its own cosine, and its own conjugate argument, and then demands a two-sided match. Where the nearest integer oflambda**nis the tracep_n, the two forms have to agree to1e-11, and they do: the198clean tribonacci terms agree to3.91e-14. Where the trace is not the rounding, the two forms have to differ, and they differ by at least0.92for tribonacci and at least0.099for plastic. A suite that checked only the first half would pass an instrument that had the trace identity backwards.
hygiene — scripts/check_hygiene.py lints these sources for network
imports and for identifiers a shell filter can rewrite. A gate that reaches
the network is not reproducible, and a gate whose source can be silently
edited is not a gate.
claim binding — elohim-harness/scripts/claim_binding.py pulls every
number out of every claim sentence and requires each one to be a rendering of
a value something pins, part of a formula or a scan window, or declared in
claim_binding_exemptions.json with a written reason. The four gates above
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, and found by a human
reading the output. A number nothing pins is therefore a failure and not a
warning.
Promote on purpose
--discover re-derives each claim from scratch, with a bisected root
instead of an iterated one and a propagated residual instead of a formed
power, then writes it to backlog.json with a contrast: the distance the
claim travels. All twenty-six measurements agree with the shard exactly,
which is the evidence that the two routes are measuring one thing.
--promote ID:PATH[:TOL] then pins one measurement as a ledger fact, and
from
then on the harness re-measures it on every run.
Read every backlog entry before promoting it. Three of the twenty-six are
left unpromoted on purpose, each with its reason written beside it in
backlog.json: one is a budget digit count that the precision-budget skill
already owns under its own ledger, one is a boolean against a threshold
chosen inside the instrument where the two deficits are the real
measurements, and one re-expresses a fact the ledger already pins. An
unpromoted measurement is not a defect, and a measurement nobody can explain
has no business in the ledger.
Files
| path | role |
instrument/tolerance_prover.py | six measurement sections and a verdict block, seals out/shard.json |
ledger.json | the instrument pin and the twenty-three promoted facts |
backlog.json | twenty-six measured claims, three left unpromoted with reasons |
scripts/discover.py | re-derives the claims by a different route, JSON array on stdout |
scripts/check_traps.py | seven independent re-derivations, --json |
references/tightness.md | the derivation, the measured tables, the two-route crossover, and what is deliberately not pinned |
out/shard.json | generated; the measurements plus their seal |
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
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.

