agentleFS
AURORA-NEUROAURORA-NEURO/aurora-agent/.agents/skills/check-parity/SKILL.md

check-parity

Skill1 starsChanged 2 months agoApache-2.0View on GitHub

Verify the CPython reference, the eager Rust path and the indexed store still agree byte for byte on a Context Certificate digest. Use after touching canonical serialization, hashing, compiler passes, the store, or any serde configuration, and before any release or wire-format change.

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
  1. Very specific:

    Do not update the expected constant to make the test pass.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Check cross-language parity

Certificates hash canonical bytes. If two implementations disagree, a certificate produced by one cannot be replayed by the other, and the guarantee the whole scheme rests on is gone.

Three implementations must agree on the reference certificate:

c0da17ffc80465258345c8a538171bfd868100cd883e9a20780a0dc5477e7ea4

Run it

python tools/regenerate_golden.py
git diff --exit-code fixtures/
cargo test -p bioprism-ids -p bioprism-fiber -p bioprism-store --offline

A non-empty git diff means the CPython reference itself moved. bioprism-store's suite is what proves the eager and indexed backends agree. CI runs all of this as its own job.

Why it is fragile, so you know what to suspect

Matching CPython required reproducing three behaviours a natural Rust port gets wrong.

Float formatting. CPython switches to exponential notation at a different threshold than Rust and zero-pads the exponent to two digits. python_repr_f64 in crates/ids/src/canonical.rs reimplements CPython's rule; tools/gen_python_ground_truth.py regenerates the expectation table.

Float parsing. serde_json's default parser is not correctly rounded and disagrees with both CPython and native Rust near the subnormal boundary and at 2^53 — 2.2250738585072011e-308 lands one ULP high, 9007199254740993.0 rounds the wrong way. The workspace enables the float_roundtrip feature to fix it. If that feature is dropped, parity breaks silently and the golden fixtures will not catch it, because they contain no such values. The regression test float_parsing_agrees_with_native_rust_and_cpython is the only guard.

Object iteration order. The reference builds leakage witnesses in document order, so serde_json runs with preserve_order. Canonical output sorts keys regardless, so digests are unaffected — but witness list order is not.

Non-finite floats, which are a hole rather than a fixed behaviour. CanonicalError::NonFiniteNumber exists and cannot fire on the path every producer uses: serde_json::to_value maps NaN, +inf and -inf to Value::Null before the encoder sees a number, so all three hash as a stated null. They do not collide with an absent key — that distinction survives — but a corrupt number is silently laundered into a stated null, which is the wrong direction to fail in here. CPython's json.dumps meanwhile emits the bare token NaN, which is not JSON and which serde would refuse to parse, so the two languages disagree about what a non-finite float is and agree today only because no producer emits one. crates/ids/tests/non_finite_floats.rs pins all of it. If you add a float field to a hashed format, validate it at the producer — bioprism_biolang::BioState::validate is the worked example.

If a digest changed

Do not update the expected constant to make the test pass. A changed digest means either a real bug or a deliberate wire-format change, and a deliberate change needs a schema version bump (fiber-context-certificate/0.1 to the next), not a new literal.

To find which side moved, hash the same document from both languages:

python -c "import json,hashlib; o=json.load(open('fixtures/fiber-v0.1/radiogenomic_world.json')); print(hashlib.sha256(json.dumps(o,sort_keys=True,separators=(',',':'),ensure_ascii=False).encode()).hexdigest())"

and compare against ContentHash::of_value on the same file.

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.