What it does for you
An agent that edits a file or reads a screen needs a record of what it saw. Coherence Membrane turns files, images, sound, structured data and screen captures into observations with exact hashes and fingerprints, compares later observations against a baseline you authorised, and answers MATCH, DRIFT or UNVERIFIABLE. For logical, arithmetic and graph claims it runs a deterministic checker, so the model proposes and the checker decides.
- Observations with hashesEach observation carries an exact SHA-256 and, where it applies, a canonical form or a perceptual hash.
- A baseline ladderByte identity, then canonical identity, then perceptual distance: reformatting is not drift.
- Checkers, not guessesLogic, quantities, distributions, linear arithmetic and graph claims get a certificate from a deterministic oracle.
- Two implementations agreeA 16-case conformance corpus is re-derived by the Python reference and an independent Node.js core.
Source: README.md at da82781 (version 0.2.0 alpha)
Watch
Video walkthrough: coming with the next release.
How it works, one step at a time
Scroll, or use the step buttons. The panel follows the README's worked example on a small JSON document and two logic claims. Every line is output from coherence-membrane at commit da82781.
- 01
Observe a document
Observe the JSON document
{"a": 1, "b": 2}. The structured-data perceiver records the SHA-256 of the exact bytes and of a canonical form with keys sorted and spacing normalised, along with its type and key count.Source: src/coherence_membrane,
StructuredDataOrgan - 02
Pin it, then check what comes later
Pin that observation as the authorised baseline. Later observations are checked on a ladder: same bytes first, then same canonical form, then perceptual distance where a fingerprint exists. Pick each later document in the panel.
The same keys in a different order with different spacing are a MATCH on the canonical rung. A changed value is a DRIFT. A broken document is a DRIFT too, and the check says it cannot measure how far.
- 03
A claim gets a certificate
Logic claims go to a deterministic checker. Modus ponens, if A and A implies B then B, is verified: its negation is unsatisfiable. Affirming the consequent, if B and A implies B then A, is refuted, and the certificate gives the counterexample: A false, B true.
- 04
A receipt needs its anchor
emit_receiptwraps an observation in a witness receipt with an anchor you can pin or sign out of band. Verified against the pinned anchor it is VALID. Verified with no anchor it is UNVERIFIABLE: the receipt alone cannot vouch for itself.Source: src/coherence_membrane,
emit_receiptandverify_receipt - 05
Two implementations, one corpus
A frozen corpus of 16 cases is re-derived value for value by the Python reference and by a Node.js core that shares no code with it. Both pass all 16.
Source: conformance/run.py, impl/js
Walkthrough
Install it, run it once, then use the main feature. Each command below is real, and so is its output.
Install
Install from a checkout. Python 3.10 or newer; this tree is the 0.2.0 alpha.
$ git clone https://github.com/HarperZ9/coherence-membrane && cd coherence-membrane $ python -m pip install -e ".[test]" $ python -m coherence_membrane selftestFirst run: observe a document
In Python, observe a small JSON document. The observation records exact and canonical hashes.
>>> StructuredDataOrgan().observe(b'{"a": 1, "b": 2}') identity_sha256 d8497d9d82770a70... canonical_sha256 43258cff783fe703... top_level_type object key_count 2Check a claim
A logic claim goes to a deterministic checker. A refutation carries its counterexample.
claim: ((B & (A -> B)) -> A) oracle propositional-dpll-v1 evidence counterexample A = 0, B = 1Run the conformance corpus
Re-derive the 16-case corpus in Python, then in the independent Node.js core.
$ python conformance/run.py {"cases": 16, "passed": 16, "failed": 0, "corpus_sha256": "0748fc1adef9753d..."}
Output from coherence-membrane at da82781 on Windows with Python 3.12 and Node 25. The class names in code use the word organ; this page calls them perceivers.
What it does not do
- Screen capture reads the composited display. Use it only on surfaces you own or are authorised to inspect.
- A MATCH on the canonical rung means the normalised content is equal. It says nothing about whether that content is right.
- A deterministic checker certifies the claim it was given. Translating a question into that claim is still the agent's work.
- This source tree is an alpha. The PyPI release is 0.1.0.
Source: README.md at da82781, "Install" and "Quickstart"
Check what stuck
Answer each one in your head before you open it.
Why is { "b": 2, "a": 1 } a MATCH against { "a": 1, "b": 2 }?
Their canonical forms are equal, so the ladder matches on its second rung.
What does the refutation of affirming the consequent carry?
A counterexample: A false and B true.
Why is a receipt UNVERIFIABLE without an anchor?
Nothing outside the receipt vouches for it until you pin or sign its anchor.