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
30 changes: 29 additions & 1 deletion pkgs/id/Cargo.lock

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

11 changes: 6 additions & 5 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-events", "crates/id-native-shell"]
members = ["crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-sync", "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", "crates/id-events"]
default-members = [".", "crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-sync"]

# =============================================================================
# Features
Expand Down Expand Up @@ -57,7 +57,7 @@ web = [
"id-core/web",
]
# Mainline DHT address lookup (P7.3, decision 15). Off in the default build; src/dht.rs decides per server.
dht = ["dep:iroh-mainline-address-lookup"]
dht = ["id-sync/dht"]
# Live-cluster binding for the currency PoC (#2289): the official TigerBeetle
# Rust client, pinned to the harness server version (harness.rs). Off by
# default so normal builds do not link the client native tb_client library.
Expand All @@ -77,6 +77,9 @@ 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 }
# Sync-family modules extracted in step 3 of the crate split (#4406).
# Re-exported at their historical crate:: paths in src/lib.rs.
id-sync = { path = "crates/id-sync", 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 All @@ -92,8 +95,6 @@ futures-lite = "2"
futures-util = { version = "0.3", features = ["sink"] }
iroh = "1"
iroh-mdns-address-lookup = "0.6"
# Mainline DHT address lookup (P7.3). Optional: only the `dht` feature brings it and n0-mainline in.
iroh-mainline-address-lookup = { version = "0.6", optional = true }
iroh-base = "1"
iroh-tickets = "1"
iroh-blobs = "0.103"
Expand Down
142 changes: 142 additions & 0 deletions pkgs/id/crates/id-sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[package]
name = "id-sync"
version = "0.1.0"
edition = "2024"
rust-version = "1.96"
description = "Sync layer of the id crate: log sync, the meta protocol, file operations and the meta client wire half (pkgs/id crate split step 3, #4406)"
license = "MIT OR Apache-2.0"

# Step 3 of the pkgs/id crate split (#3447 umbrella, #4406): the sync
# family lives here - `log_sync` and the wire layer (`protocol`,
# `fileops`, `dht`, and the wire half of `meta_client`). The envelope /
# artifact transfer modules join in step 3c. Dependencies per the design
# map: id-core, id-store, id-events (id-groups does not exist yet; the
# step needs nothing from it). `sync_method`, `discovery` and
# `connectivity` already live in id-core (landed drift from the design
# map, which had them here). Composition stays in the facade: the
# `MetaClient` enum (remote-or-local) and the `LocalNode`-backed tests
# remain there until step 7.

[features]
default = []
# Mainline DHT address lookup (P7.3). Off in the default build; the
# facade forwards its `dht` feature here.
dht = ["dep:iroh-mainline-address-lookup"]

[dependencies]
anyhow = "1"
futures-lite = "2"
futures-util = { version = "0.3", features = ["sink"] }
id-core = { path = "../id-core", default-features = false }
id-events = { path = "../id-events", default-features = false }
id-store = { path = "../id-store", default-features = false }
iroh = "1"
iroh-base = "1"
iroh-blobs = "0.103"
iroh-mainline-address-lookup = { version = "0.6", optional = true }
p2panda-core = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b95269926bf58121cf6a2d3dd5ca41dfc" }
p2panda-store = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b95269926bf58121cf6a2d3dd5ca41dfc", default-features = false }
p2panda-sync = { path = "../../vendor/p2panda-sync" }
postcard = { version = "1", features = ["alloc"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
tokio = { version = "1", features = ["full"] }
tracing = "0.1"

[dev-dependencies]
p2panda-auth = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b95269926bf58121cf6a2d3dd5ca41dfc", features = ["serde"] }
proptest = "1.12"
tempfile = "3"
tokio = { version = "1", features = ["test-util"] }

[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"
File renamed without changes.
Loading
Loading