Skip to content

RecordAttestation and record_hash are declared but unimplemented #96

Description

@macanderson

Noticed while implementing frame-layer attestation (PR #87).

The lifecycle profile declares:

  • record_hash as the sha256:<hex> over the RFC 8785 (JCS) canonicalisation of a record with its own record_hash omitted from the preimage;
  • RecordAttestation as a detached Ed25519 signature over that hash.

Both are types and prose. There is no JCS canonicalisation code, no record hashing, and no signature verification anywhere in the workspace — before PR #87 there was no cryptographic dependency at all. docs/profiles/context-exchange-provider.md LF1 promises tests/fixtures/ holds "golden JCS/record_hash vectors", and tests/fixtures/record-attestation.json exists as a shape example that nothing computes or checks.

So the record layer today has the same gap the frame layer just closed: a declared guarantee with no implementation behind it.

Needed: implement record_hash (JCS + the omit-self rule), implement RecordAttestation verification, and publish golden vectors so the LF1 claim becomes true. PR #87 adds sha2/ed25519-dalek behind the attestation feature, so the dependencies are already available — note JCS genuinely is the right choice here (an open-ended JSON document), unlike at the frame-provenance layer where ADR 0010 explains why it is not.

Definition of done

  • record_hash is a callable library function in contextgraph-types, not a
    helper inside a test: RFC 8785 (JCS) canonicalization plus the omit-self
    rule, with the canonical preimage bytes exposed as well as the digest.
  • The omit-self rule is decided in writing and implemented: whether
    record_hash is removed from the preimage or blanked, stated in an ADR
    under docs/adr/ with the reason, and matching what profile LH1 says.
  • RFC 8785 conformance is demonstrated against the RFC's own published
    vectors — number serialization, UTF-16 key ordering, and string escaping —
    not only against values this repository generated.
  • RecordAttestation verification exists (detached Ed25519), the exact
    signed preimage is pinned normatively in the profile, and verification
    recomputes the record's hash rather than trusting the stored member.
  • tests/fixtures/ holds golden vectors that make the LF1 claim true: the
    canonical JCS text of every record fixture, and an attestation example
    carrying a real signature with the key published beside it.
  • The conformance suite recomputes the fixtures through the library rather
    than through a second copy of the rule.
  • The new code is compiled and run by CI (the features are off by default,
    so a job must enable them).
  • A witness test fails without the change and passes with it, with both
    observations reported on the PR.
  • Docs updated in the same PR: the profile, tests/fixtures/README.md, the
    crate README's feature list, and CHANGELOG.md under [Unreleased].
  • Every finding noticed and not fixed is filed as its own issue with the
    triage label.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageAwaiting the triage agent: sizing + priority (SCR-005)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions