Skip to content

id-core: signer key-history state machine — historical validity, current status, local trust (A9124-world-key-history) - #13075

Merged
dezren39 merged 1 commit into
mainfrom
lane-kh-10283
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-kh-10283

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Slice A9124-world-key-history for #10283 (design A-9124.3, statement S4.93). Native-blocker preflight passed fresh on 2026-11-23: #9083, #10160 and #10278 are all closed.

Changed files (the slice's declared scope only):

  • pkgs/id/crates/id-core/src/world_key_status.rs (new) — one signer's explicit key-history state machine. Signed introduce / rotate / revoke events (canonical CBOR, domain id-world-key-history-v1) fold in sequence order; a rejected event changes no state. Rotation is a signed successor event signed by the key being rotated; a revocation may be signed by the key itself or by its recorded successor (the compromise-response path). Compromise revocations may be effective before earlier events were recorded, so historical validity is bounded by the compromise time, not the recording time.
  • pkgs/id/crates/id-core/tests/world_key_status_model.rs (new) — the model oracle.

Separated dimensions (A-9124.3): KeyHistory::evaluate returns a KeyStatusReport whose historical_signature_valid (window over introduction / rotation / revocation effective times), key_status / currently_authorized (head state), and trust_policy_result (verifier-local input, echoed only) are independent outputs. Unknown key status is never valid; revocation never rebinds an old key — successor_of is an explicit link and each key keeps its own status and window.

Evidence: cargo test -p id-core --test world_key_status_model in the pkgs/id nix develop shell — 12 passed, 0 failed, including the proptest that generates introduce/rotate/revoke operations (wrong authors, out-of-order sequences, tampered signatures) against an independent reference model and compares every resulting state and error class, plus targeted tests for the design's named guarantees. rustfmt (edition 2024) clean on both files.

The crate-root export belongs to slice 9110-02 by the issue's ownership split; this PR touches neither lib.rs nor any manifest. No production rollout.


Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Implements the slice tracked in #10283 under design A-9124.3: signed
introduce / rotate / revoke events folded in sequence order, historical
validity windows per key, current-authority resolution, and a
KeyStatusReport whose historical-validity, currentness and trust
dimensions stay independent. Unknown key status is never valid, and
revocation never rebinds an old key's history.

The crate-root export stays with slice 9110-02; the model test includes
the module by path, as the neighboring ID slices do.

Refs #10283.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9956047a-5a84-463c-aae2-2243afb2a7be
Commits

Reviewing files that changed from the base of the PR and between 4385ece and d48a38b.

Files selected for processing: 2

  • pkgs/id/crates/id-core/src/world_key_status.rs
  • pkgs/id/crates/id-core/tests/world_key_status_model.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T08:06:59.052238Z d48a38b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit b4aacb7 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-kh-10283 branch November 23, 2026 07:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d48a38bc0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +457 to +458
key.verify(&preimage, &signature)
.map_err(|_error| KeyStatusError::BadSignature)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use strict Ed25519 verification for history events

For an event whose author and subject keys are the identity point (01 followed by 31 zero bytes), plain verify accepts a signature with identity R and zero S for any payload, without possession of a private key. This passes the introduction authorization check and lets forged history events enter the state machine. The repository already demonstrates this exact forgery in pkgs/id/crates/id-core/src/test_forgeries.rs::identity_forgery. Use verify_strict here, as the neighboring signed-envelope verifier does, and cover the identity forgery with a regression test.

Useful? React with 👍 / 👎.

Comment on lines +15 to +17
//! The crate-root export belongs to the separate crate-wiring slice. The
//! module therefore uses the same `crate::` leaf paths as the other
//! extracted ID slices and can be included by path by its integration test.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Declare the new history module in the crate root

Deferring the crate-root declaration leaves this implementation unavailable to consumers of id-core; the integration test compiles only its private #[path] copy. A repository-wide search found no production declaration of world_key_status, and running .github/scripts/check-rust-module-reach.sh explicitly reports this new file as UNREACHED. Despite the slice ownership note, pkgs/id/AGENTS.md requires new modules to be declared in their parent in the same change. Add the declaration to id-core/src/lib.rs rather than leaving the implementation disconnected.

AGENTS.md reference: pkgs/id/AGENTS.md:L150-L150

Useful? React with 👍 / 👎.

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