mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-12 05:29:57 +02:00
chore: drop design-section cross-refs from core comments
Keep module docs self-describing without pointing at DESIGN §N. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -454,8 +454,6 @@ wake-up: refresh durable state via list/get APIs. Mid-transfer progress polish
|
|||||||
| `offer-accepted` | Local approval completed; authorization is in core custody. |
|
| `offer-accepted` | Local approval completed; authorization is in core custody. |
|
||||||
| `offer-declined` | Local decline completed. |
|
| `offer-declined` | Local decline completed. |
|
||||||
|
|
||||||
See also [`crates/vnidrop/CORE_FLOW.md`](crates/vnidrop/CORE_FLOW.md) (same catalog, linked so the lists cannot fork).
|
|
||||||
|
|
||||||
Failures remain typed where callers can act differently, including:
|
Failures remain typed where callers can act differently, including:
|
||||||
|
|
||||||
- Device unavailable or offer timeout.
|
- Device unavailable or offer timeout.
|
||||||
|
|||||||
@@ -49,9 +49,15 @@ bytes through Kotlin memory.
|
|||||||
|
|
||||||
### Pairing and targeted-transfer event catalog
|
### Pairing and targeted-transfer event catalog
|
||||||
|
|
||||||
Canonical catalog: [DESIGN-DEVICE-HISTORY.md §13.1](../../DESIGN-DEVICE-HISTORY.md).
|
Treat every event as a wake-up: refresh durable state via list/get APIs.
|
||||||
Do not maintain a second kind list here — link only. Events are wake-ups; query
|
Mid-transfer progress polish may follow.
|
||||||
durable state after receive. Mid-transfer progress polish may follow.
|
|
||||||
|
**`pairing`:** `eligibility-available`, `eligibility-removed`,
|
||||||
|
`relationship-changed`, `relationship-grant-rotated`, `saved-device-forgotten`,
|
||||||
|
`device-blocked`.
|
||||||
|
|
||||||
|
**`targeted_transfer`:** `offer-received`, `offer-accepted`, `offer-declined`.
|
||||||
|
|
||||||
## Platform File Rules
|
## Platform File Rules
|
||||||
|
|
||||||
- Desktop uses normal filesystem paths.
|
- Desktop uses normal filesystem paths.
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ pub struct CoreLimits {
|
|||||||
pub max_pending_offers: u64,
|
pub max_pending_offers: u64,
|
||||||
pub max_concurrent_transfers: u64,
|
pub max_concurrent_transfers: u64,
|
||||||
pub event_queue_capacity: u64,
|
pub event_queue_capacity: u64,
|
||||||
/// Cap on Saved + pending mutual-consent relationships (design §14).
|
/// Cap on Saved + pending mutual-consent relationships.
|
||||||
pub max_saved_devices: u64,
|
pub max_saved_devices: u64,
|
||||||
/// Quiet period after a decline or repeated malformed control-plane traffic.
|
/// Quiet period after a decline or repeated malformed control-plane traffic.
|
||||||
pub identity_cooldown_ms: u64,
|
pub identity_cooldown_ms: u64,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Saved-device control-plane hardening (design §14).
|
//! Saved-device control-plane hardening.
|
||||||
//!
|
//!
|
||||||
//! Bounds hostile / noisy peers without imposing quotas on transfers the
|
//! Bounds hostile / noisy peers without imposing quotas on transfers the
|
||||||
//! receiver has already accepted.
|
//! receiver has already accepted.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Relationship-grant possession proofs (design §7).
|
//! Relationship-grant possession proofs.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::VnidropError,
|
error::VnidropError,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Forget, block, grant rotation, and minimal revocation tombstones (design §7–§8).
|
//! Forget, block, grant rotation, and minimal revocation tombstones.
|
||||||
|
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Experimental saved-device mutual-consent relationships.
|
//! Experimental saved-device mutual-consent relationships.
|
||||||
//!
|
//!
|
||||||
//! Implements design §6/§7: pending outgoing/incoming states, directional grants
|
//! Pending outgoing/incoming states, directional grants bound to relationship
|
||||||
//! bound to relationship generation, and Saved only after mutual acknowledgement.
|
//! generation, and Saved only after mutual acknowledgement.
|
||||||
|
|
||||||
mod crypto;
|
mod crypto;
|
||||||
mod lifecycle;
|
mod lifecycle;
|
||||||
|
|||||||
@@ -875,7 +875,7 @@ impl DeviceRelationshipService {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
// Established relationships record a protocol floor and reject silent
|
// Established relationships record a protocol floor and reject silent
|
||||||
// downgrade attempts (design §7 / §15).
|
// downgrade attempts.
|
||||||
if protocol_version < row.minimum_protocol_version {
|
if protocol_version < row.minimum_protocol_version {
|
||||||
return Err(VnidropError::protocol_incompatible(anyhow::anyhow!(
|
return Err(VnidropError::protocol_incompatible(anyhow::anyhow!(
|
||||||
"relationship protocol downgrade is forbidden"
|
"relationship protocol downgrade is forbidden"
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ impl CoreInner {
|
|||||||
"device-blocked",
|
"device-blocked",
|
||||||
json!({ "peer_endpoint_id": peer_endpoint_id }),
|
json!({ "peer_endpoint_id": peer_endpoint_id }),
|
||||||
);
|
);
|
||||||
// Silence: blocked peers are not notified (design §8).
|
// Silence: blocked peers are not notified.
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Targeted-transfer control-plane protocol (design §10).
|
//! Targeted-transfer control-plane protocol.
|
||||||
//!
|
//!
|
||||||
//! Separate ALPN from ordinary offers: pre-approval messages carry a manifest
|
//! Separate ALPN from ordinary offers: pre-approval messages carry a manifest
|
||||||
//! summary and relationship proof only — never a reusable share ticket.
|
//! summary and relationship proof only — never a reusable share ticket.
|
||||||
@@ -443,7 +443,7 @@ fn parse_offer_relay_urls(values: &[String]) -> Result<Vec<RelayUrl>, ()> {
|
|||||||
Ok(urls)
|
Ok(urls)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Map a receiver refuse reason to a typed public error (design §13).
|
/// Map a receiver refuse reason to a typed public error.
|
||||||
pub(crate) fn map_offer_refuse_reason(reason: &str) -> VnidropError {
|
pub(crate) fn map_offer_refuse_reason(reason: &str) -> VnidropError {
|
||||||
match reason {
|
match reason {
|
||||||
"relay-policy-incompatible" => VnidropError::relay_policy_incompatible(anyhow::anyhow!(
|
"relay-policy-incompatible" => VnidropError::relay_policy_incompatible(anyhow::anyhow!(
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ pub(crate) fn ticket_matches_relay_profile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Whether a remote peer's advertised network profile can be used under the
|
/// Whether a remote peer's advertised network profile can be used under the
|
||||||
/// local profile (design §3 / §10 relay-policy validation).
|
/// local profile.
|
||||||
pub(crate) fn relay_profiles_compatible(
|
pub(crate) fn relay_profiles_compatible(
|
||||||
local_mode: CoreRelayMode,
|
local_mode: CoreRelayMode,
|
||||||
local_urls: &[RelayUrl],
|
local_urls: &[RelayUrl],
|
||||||
|
|||||||
Reference in New Issue
Block a user