Skip to content

Add akd_traits crate with KeyDirectory trait#482

Draft
kevinlewi wants to merge 1 commit intofacebook:mainfrom
kevinlewi:kd-framework
Draft

Add akd_traits crate with KeyDirectory trait#482
kevinlewi wants to merge 1 commit intofacebook:mainfrom
kevinlewi:kd-framework

Conversation

@kevinlewi
Copy link
Contributor

@kevinlewi kevinlewi commented Mar 10, 2026

Summary

  • Introduces akd_traits crate as the leaf dependency defining the abstract KeyDirectory trait for any key directory implementation
  • Moves core types (DirectoryLabel, DirectoryValue, EpochHash, VerifyResult, Digest) into akd_traits, with backward-compatible aliases (AkdLabel, AkdValue) in akd_core
  • Inverts the dependency graph: akd_traits (leaf) → akd_coreakd
  • Implements KeyDirectory for akd::Directory
  • Adds generic benchmarking harness (BenchmarkSetup trait + Criterion benchmarks)
  • Adds scaling benchmark CLI (examples/scaling-bench) with database caching, sweep mode, and table/CSV/JSON output

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 10, 2026
@kevinlewi kevinlewi marked this pull request as draft March 10, 2026 01:49
Introduce an abstract KeyDirectory trait that defines the interface for
any key directory implementation, with both server-side operations
(publish, lookup, key_history, audit) and client-side verification.

- Create akd_traits crate as the leaf dependency (no internal deps)
- Define DirectoryLabel, DirectoryValue, EpochHash, VerifyResult, and
  Digest in akd_traits
- Have akd_core depend on akd_traits, with backward-compatible type
  aliases (AkdLabel = DirectoryLabel, AkdValue = DirectoryValue)
- Implement KeyDirectory for akd::Directory
- Add generic benchmarking harness (BenchmarkSetup trait) with
  Criterion benchmark functions
- Add scaling benchmark CLI (examples/scaling-bench) with database
  caching, sweep mode, and multiple output formats
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 36.50794% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.50%. Comparing base (3ce5335) to head (51ca547).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
akd/src/directory.rs 0.00% 49 Missing ⚠️
akd/src/errors.rs 0.00% 11 Missing ⚠️
akd_traits/src/errors.rs 0.00% 9 Missing ⚠️
akd_traits/src/types.rs 83.63% 9 Missing ⚠️
akd_traits/src/traits.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #482      +/-   ##
==========================================
- Coverage   88.61%   88.50%   -0.12%     
==========================================
  Files          39       40       +1     
  Lines        9109     7533    -1576     
==========================================
- Hits         8072     6667    -1405     
+ Misses       1037      866     -171     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants