Skip to content

K9 · Semantic differential corpus vs keripy: same events → same verdicts, same key state #95

Description

@joeldsouzax

Goal

Extend the differential harness from encoding parity to SEMANTIC parity. Today keripy_diff proves byte-level agreement (matter/counter/indexer/stream). The KERI core (K1–K5) needs the same oracle discipline one level up: given the same event sequence, cesr and keripy reach the same verdicts — accept, escrow(reason), reject, same resulting key state.

This is what makes "not a python port, but semantically correct KERI" checkable instead of asserted.

Design

  • Generator side (python, in fuzz/- or tests/keripy-vectors/-adjacent tooling): scripts driving keripy's Kevery/Kever to produce JSONL scenario vectors: {scenario, events[], sigs[], delivery_order, expected: [{verdict, state_digest?, escrow_reason?}]}. Pin the keripy version (currently 2.0.0.dev5 for encoding — bump consciously, record in the parity report).
  • Scenario families, one file each, mapped to consuming cards:
    • happy chains: icp→ixn→rot ladders, weighted/multisig thresholds (K1)
    • each of the 9 escrow reasons triggered deliberately (K2)
    • duplicity: double-inception, forked sn>0, each B1/B2/B3/C superseding case (K3)
    • delegation: valid dip/drt chains, tampered seals, revocation, recursive delegators (K4)
    • receipts: all three shapes, TOAD boundaries (K5)
  • Consumer side (rust): same embedded-corpus pattern as the existing keripy_diff module; each Kx card's acceptance says "K9 vectors pass" — this card owns the harness + corpus, NOT the fixes.
  • Coverage honesty: like the encoding report, record which keripy behaviors are intentionally divergent (e.g. policy exceptions we externalized in K4) — divergence documented ≠ divergence discovered.

Acceptance

  • Harness merged with the happy-chain family passing against K1 (grows with each Kx landing)
  • CI job runs the semantic corpus like the existing parity suite
  • docs/keripy-parity/ gains a semantics section with the divergence ledger

From the 2026-07-05 teardowns. Depends on: K1 (first consumer). Cross-cuts: K2–K5, K7 (derivation vectors).

Metadata

Metadata

Assignees

No one assigned

    Labels

    keripy-syncCESR parity work surfaced by the keripy-sync watchertestingTest harnesses, fuzzing, differential testing

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions