Skip to content

Key roles, step 1: signing goes through a RealmSigner seam (REQ-SIGNERSEAM-001); DD-041 records the role decisions - #313

Merged
avrabe merged 2 commits into
mainfrom
feat/keyroles-1-signer-seam
Nov 5, 2026
Merged

avrabe merged 2 commits into
mainfrom
feat/keyroles-1-signer-seam

Conversation

@avrabe

@avrabe avrabe commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

This is step 1 of REQ-KEYROLES-001 (key roles): every signature now goes through a RealmSigner seam (REQ-SIGNERSEAM-001). Nothing about what is signed, or how it verifies, changes.

Why it comes first

Key roles mean a different key signs each kind of document:

  • the root signs only a delegation;
  • a LAYER key signs layers, attestations and release sums;
  • a STATUS key signs line-status and line-index.

Before any of that, signing has to stop taking raw key bytes. A signer has to be something a caller passes in. That could be a file today, or a hardware key or a role key later.

Change

  • verify.rs:
    • adds RealmSigner, which is a DsseSigner plus public_key() and realm_key_id();
    • adds FileSigner: new refuses a mismatched keypair, and new_unchecked keeps the legacy wrappers byte-for-byte as they were;
    • adds dsse_sign_with;
    • dsse_sign_typed is now a thin wrapper over it.
  • _with variants:
    • sign_layer_manifest_with;
    • attest::sign_with;
    • sign_release_sums_with;
    • deposit_with_signer, whose self-verify now uses signer.public_key() rather than slicing the secret key.
  • Rename: the trait method is realm_key_id, not key_id, because DsseSigner::key_id() already exists.
  • rivet:
    • DD-041 records your key-role decisions of 2026-11-04;
    • REQ-SIGNERSEAM-001 moves to v0.45.0, approved.

Evidence

  • Byte identity: Ed25519 signatures are deterministic, so old and new code must produce identical bytes. Signatures for 5 envelopes were captured from main's unmodified code with a fixed key:

    • layer;
    • release sums;
    • line-status;
    • line-index;
    • attestation.

    every_signing_entry_point_still_emits_the_pre_seam_bytes asserts that both the old wrappers and the new _with paths produce exactly those envelopes.

  • Negative control: with the payload type altered inside dsse_sign_with, that test fails. The file was then restored.

  • Mock signer: an in-memory counting signer, not a file, is accepted by every _with site, and its envelopes verify.

  • Deposit: depositing through the mock gives the same digest as depositing with the key, with one sign call.

  • FileSigner::new refuses a mismatched keypair.

  • Gates:

    • fmt is clean;
    • clippy -D warnings is clean;
    • cargo test --workspace passes after merging current main;
    • rivet validate passes.
  • Mutation run, CI flags, on verify.rs and selfverify.rs: 55 mutants tested in 10m: 53 caught, 2 unviable (0 missed). attest.rs, keys.rs and deposit.rs are exempt in mutation-scope.toml.

  • Test order: the seam tests were written after the code. Their oracle, the captured goldens, was taken before the refactor, and the negative control shows the test can fail.

Next

  • PR 2: the role trust model (keyroles.rs). It is ready locally.
  • PR 3: realm trust material.
  • PRs 4–5: CLI and consumer wiring, which go in after the mirror PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu

avrabe and others added 2 commits November 4, 2026 23:12
…of key roles

dsse_sign_typed becomes a thin wrapper over dsse_sign_with(&dyn RealmSigner);
FileSigner is today's file-backed key as one implementation. _with variants
for layer manifests, attestations, release sums and deposit (which now
self-verifies with signer.public_key()). Envelope bytes are unchanged,
proven against goldens captured from the pre-refactor code. Records DD-041
(key-role decisions of 2026-11-04); no role logic lands here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-seam

# Conflicts:
#	artifacts/requirements.yaml
@avrabe
avrabe merged commit 3f8539f into main Nov 5, 2026
44 checks passed
@avrabe
avrabe deleted the feat/keyroles-1-signer-seam branch November 5, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant