tools: independent CAP-1 implementation pair and conformance probes - #160
Merged
Merged
Conversation
Two implementations of draft-hillier-coverage-attestation-00 (CAP-1), written from the
draft prose rather than from each other, plus the probes used to compare them.
WHY THIS IS HERE. Section 7.3 of the draft says an implementation by an unaffiliated party
is the most useful contribution a reader could make. This is that implementation, made
available so the finding it produced can be checked rather than taken on trust.
WHAT IT CONTAINS
py/cap1_verify.py rules R0-R8 implemented from the prose
rs/ a second implementation in Rust with its own hand-written JSON reader
and no dependencies; it distinguishes integer syntax from float syntax,
which is what makes R5's "non-negative integers" measurable
sonden.py builds the probes FROM the author's tree at run time
lauf.py, run.sh one entry point; no network, no clock, no installation
THE TWO IMPLEMENTATIONS SHARE NO CODE. No common canonicalisation, no common hash path, no
common JSON parser. Where they agree, they agree independently; where they disagree, that is
a finding about the specification and not about a shared bug.
THE AUTHOR'S VECTORS ARE NOT REDISTRIBUTED. sonden.py transforms his tree at run time and the
generated probes are gitignored. Point run.sh at a checkout of the vectors and it builds them
locally. The positive controls K1 and K2 are his unchanged vectors and must be accepted by
every reading; K3 is a single genuine rule break and must be refused by every reading. Without
those three, a detection rate measures nothing.
WHAT IT FOUND, reproducible from a fresh copy:
file last-wins first-wins strict author
K1 (PV-03 unchanged) CONFORMS CONFORMS CONFORMS CONFORMS
K2 (PV-01 unchanged) CONFORMS CONFORMS CONFORMS CONFORMS
K3 (single R1 break) REFUSED REFUSED REFUSED REFUSED
S09 (duplicate eligible) REFUSED CONFORMS JSON error REFUSED <-- disagreement
S10 (duplicate complete) CONFORMS REFUSED JSON error CONFORMS <-- disagreement
CAP-1 does not say how a verifier must treat duplicate JSON member names. RFC 8259 section 4
says names SHOULD be unique and that behaviour on violation is unpredictable. Three readings
that each conform to the draft therefore reach different verdicts on the same document. The
sharpest consequence is determinism: two verifiers can disagree about a document while both
following the specification.
HONEST LIMITS. The package is written in German, comments and README included. The rules are
implemented from the prose, so a misreading of the prose is possible and would show up as a
disagreement with the author's own runner rather than as a silent pass. The strict reading
refuses duplicate names at the parser level, which is a choice this package makes and not one
the draft requires.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two implementations of
draft-hillier-coverage-attestation-00(CAP-1), written from the draftprose rather than from each other, plus the probes used to compare them.
Section 7.3 of the draft says an implementation by an unaffiliated party is the most useful
contribution a reader could make to the work. This is that implementation, published so the
finding it produced can be checked rather than taken on trust.
What is here
py/cap1_verify.pyrs/sonden.pylauf.py,run.shThe two implementations share no code — no common canonicalisation, no common hash path, no
common JSON parser. Where they agree, they agree independently.
The Rust reader distinguishes integer syntax from float syntax deliberately, which is what
makes R5's "non-negative integers" measurable rather than a matter of coercion.
The author's vectors are not redistributed
sonden.pytransforms his tree at run time; the generated probes are gitignored. Pointrun.shat a checkout of the vectors and it builds them locally:
The positive controls K1 and K2 are his unchanged vectors and must be accepted by every
reading; K3 is a single genuine rule break and must be refused by every reading. Without
those three, a detection rate measures nothing.
What it found
Reproduced from a fresh copy of this branch against commit
0980d32of the draft repository:CAP-1 does not say how a verifier must treat duplicate JSON member names. RFC 8259 §4 says names
SHOULD be unique and that behaviour on violation is unpredictable. Three readings that each
conform to the draft therefore reach different verdicts on the same document.
The sharpest consequence is determinism: two verifiers can disagree about a document while both
follow the specification.
Honest limits
up as a disagreement with the author's own runner rather than as a silent pass.
makes, not one the draft requires.
Status
Opened as a draft. It exists to let the required
guardcheck run against the branch, whichonly happens on a pull request. Merging is a separate decision and is not requested here.