Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pkgs/id/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pkgs/id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ categories = ["command-line-utilities", "network-programming"]
# id-core sub-crate under crates/; this package is the workspace root.

[workspace]
members = ["crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-native-shell"]
members = ["crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-native-shell"]
# The vendored crates stay OUT of the workspace: as path dependencies inside
# this directory Cargo would otherwise treat them as members, and a member's
# feature graph joins the lock resolve — p2panda-sync's `test_utils` feature
# forwards to `p2panda-store/test_utils`, whose `sqlite` feature pulls sqlx
# into Cargo.lock even though no build here enables it (see vendor/README.md).
exclude = ["vendor/p2panda-sync", "vendor/p2panda-encryption"]
default-members = [".", "crates/id-core", "crates/id-caps", "crates/id-store"]
default-members = [".", "crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events"]

# =============================================================================
# Features
Expand Down Expand Up @@ -74,6 +74,9 @@ id-caps = { path = "crates/id-caps", default-features = false }
# Store-family modules extracted in step 2a of the crate split (#4405).
# Re-exported at their historical crate:: paths in src/lib.rs.
id-store = { path = "crates/id-store", default-features = false }
# Events-family modules extracted in step 2b of the crate split (#4405).
# Re-exported at their historical crate:: paths in src/lib.rs.
id-events = { path = "crates/id-events", default-features = false }
anyhow = "1"
cbor-core = { version = "=0.10.1", features = ["serde"] }
# Calendar arithmetic and the IANA time-zone database for the did-it tracker's
Expand Down
133 changes: 133 additions & 0 deletions pkgs/id/crates/id-events/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
[package]
name = "id-events"
version = "0.1.0"
edition = "2024"
rust-version = "1.96"
description = "Events layer of the id crate: event store, group projection, writer sets and sync gating (pkgs/id crate split step 2b, #4405)"
license = "MIT OR Apache-2.0"

# Step 2b of the pkgs/id crate split (#3447 umbrella, #4405): the events
# family lives here — the event store implementation, the local event
# log, event sync and attestation — together with the vocabulary the
# design ruling on #4405 assigns to the events layer: the group model
# and fold (group-projection vocabulary: `groups`), the writer-set
# surface the store's writer-set reads need (`idset`), and the
# sync-gating value types (`pull_policy`, `world_access`,
# `local_claims`). Step 4's id-groups will be the policy/enforcement
# remainder of the facade's group layer, depending on this crate.
# Dependencies per the design map: id-core, id-store, id-caps (the
# event family names no caps surface today, so only the first two are
# linked; id-caps joins when a moved module first names it).

[features]
default = []

[dependencies]
anyhow = "1"
cbor-core = { version = "=0.10.1", features = ["serde"] }
clap = { version = "4", features = ["derive"] }
id-core = { path = "../id-core", default-features = false }
id-store = { path = "../id-store", default-features = false }
iroh-base = "1"
iroh-blobs = "0.103"
p2panda-auth = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b95269926bf58121cf6a2d3dd5ca41dfc", features = ["serde"] }
p2panda-core = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b95269926bf58121cf6a2d3dd5ca41dfc" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
unicode-normalization = "0.1"

[dev-dependencies]
proptest = "1.12"
tempfile = "3"

[lints.rust]
# Rust compiler lints
unsafe_code = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
rust_2024_compatibility = { level = "warn", priority = -1 }
missing_debug_implementations = "warn"
missing_docs = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_lifetimes = "warn"
unused_qualifications = "warn"
# Treat some warnings as errors in CI
# dead_code = "deny"
# unused_imports = "deny"

[lints.clippy]
# Enable standard lint groups
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }

# Deny critical issues - these indicate bugs or serious problems
# Test modules should add: #[allow(clippy::unwrap_used, clippy::expect_used)]
unwrap_used = "deny"
expect_used = "deny"
panic = "deny"
unimplemented = "deny"
todo = "deny"
dbg_macro = "deny"
# Allow print macros - this is a CLI application
print_stdout = "allow"
print_stderr = "allow"

# Restriction lints - selectively enable valuable checks
clone_on_ref_ptr = "warn"
create_dir = "warn"
deref_by_slicing = "warn"
empty_structs_with_brackets = "warn"
filetype_is_file = "warn"
float_cmp_const = "warn"
fn_to_numeric_cast_any = "warn"
format_push_string = "warn"
get_unwrap = "warn"
if_then_some_else_none = "warn"
lossy_float_literal = "warn"
map_err_ignore = "warn"
mem_forget = "warn"
mixed_read_write_in_expression = "warn"
mutex_atomic = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
redundant_type_annotations = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_name_method = "warn"
self_named_module_files = "warn"
str_to_string = "warn"
string_add = "warn"
# string_to_string removed - clippy::implicit_clone covers it
suspicious_xor_used_as_pow = "warn"
try_err = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unnecessary_self_imports = "warn"
unneeded_field_pattern = "warn"
verbose_file_reads = "warn"

# Allow specific lints - too noisy or conflict with project style
module_name_repetitions = "allow"
must_use_candidate = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
redundant_pub_crate = "allow"
significant_drop_tightening = "allow"
option_if_let_else = "allow"
multiple_crate_versions = "allow"
cargo_common_metadata = "allow"
too_many_lines = "allow"
# Allow these - they're reasonable for CLI app complexity
too_many_arguments = "allow"
fn_params_excessive_bools = "allow"
struct_excessive_bools = "allow"
cognitive_complexity = "allow"
future_not_send = "allow"
# TODO(P8.8): Clippy 1.99 fires these on about 50 `assert!(x.is_empty())` sites
# and 2 `chunks_exact` sites. Allowed until the lints review in plan step P8.8
# (doc/2026-10-11T11-08-42Z_design_remaining_work/plan-phases.md).
assert_is_empty = "allow"
chunks_exact_to_as_chunks = "allow"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! rule for concurrent adds past the cap (design §5.1). The voiding track's rules for removal may
//! refine how a removal meets a concurrent change.
//!
//! Membership operations go to [`crate::membership`], which decides them on p2panda-auth. Each
//! Membership operations go to [`id_core::membership`], which decides them on p2panda-auth. Each
//! event is handed to it once, so the causal index stays complete. An event this layer refuses is
//! handed over as a no-op.
//!
Expand All @@ -29,11 +29,11 @@ use p2panda_auth::group::{GroupAction, GroupMember};
use p2panda_core::Hash;
use thiserror::Error;

use crate::membership::{
use id_core::membership::{
AuthId, CausalEvent, Membership, MembershipError, Outcome as Decided, Refusal as AuthRefusal,
Role as Placement,
};
use crate::rejection::Reason;
use id_core::rejection::Reason;

use super::delegation::{Grant, GrantVisibility, Removal, removed_member};
use super::friendship::{Pair, friendship_id};
Expand Down
Loading
Loading