diff --git a/Cargo.lock b/Cargo.lock index 40567ae8..817da1b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2777,7 +2777,7 @@ dependencies = [ "toml", "tower", "vibescrobble-attest", - "vibescrobble-data", + "didbot-data", "didbot-dns", "vibescrobble-hook", "vibescrobble-hookd", @@ -2809,7 +2809,7 @@ dependencies = [ ] [[package]] -name = "vibescrobble-data" +name = "didbot-data" version = "0.1.0" dependencies = [ "serde_json", @@ -2947,7 +2947,7 @@ dependencies = [ "tracing-subscriber", "unicode-segmentation", "vibescrobble-attest", - "vibescrobble-data", + "didbot-data", "didbot-dns", "vibescrobble-identity", "didbot-key", @@ -2979,7 +2979,7 @@ version = "0.1.0" dependencies = [ "serde_json", "thiserror", - "vibescrobble-data", + "didbot-data", "vibescrobble-identity", "didbot-key", ] @@ -3002,7 +3002,7 @@ dependencies = [ "tracing", "tracing-subscriber", "vibescrobble-attest", - "vibescrobble-data", + "didbot-data", "didbot-dns", "vibescrobble-identity", "didbot-key", diff --git a/Cargo.toml b/Cargo.toml index a1feaf95..4689e580 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ vibescrobble-hook = { version = "0.1.0", path = "crates/vibescrobble-hook" } vibescrobble-identity = { version = "0.1.0", path = "crates/vibescrobble-identity" } didbot-key = { version = "0.1.0", path = "crates/didbot-key" } vibescrobble-lexicon = { version = "0.1.0", path = "crates/vibescrobble-lexicon" } -vibescrobble-data = { version = "0.1.0", path = "crates/vibescrobble-data" } +didbot-data = { version = "0.1.0", path = "crates/didbot-data" } vibescrobble-repo = { version = "0.1.0", path = "crates/vibescrobble-repo" } vibescrobble-stack = { version = "0.1.0", path = "crates/vibescrobble-stack" } vibescrobble-setup = { version = "0.1.0", path = "crates/vibescrobble-setup" } diff --git a/crates/vibescrobble-data/Cargo.toml b/crates/didbot-data/Cargo.toml similarity index 93% rename from crates/vibescrobble-data/Cargo.toml rename to crates/didbot-data/Cargo.toml index fc76e575..d0a8a4c3 100644 --- a/crates/vibescrobble-data/Cargo.toml +++ b/crates/didbot-data/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vibescrobble-data" +name = "didbot-data" description = "The atproto data model: values, the DAG-CBOR encoding of one, and the CID it hashes to." version.workspace = true edition.workspace = true diff --git a/crates/vibescrobble-data/src/cid.rs b/crates/didbot-data/src/cid.rs similarity index 99% rename from crates/vibescrobble-data/src/cid.rs rename to crates/didbot-data/src/cid.rs index 88060444..5a890044 100644 --- a/crates/vibescrobble-data/src/cid.rs +++ b/crates/didbot-data/src/cid.rs @@ -126,7 +126,7 @@ impl Cid { /// Parses the string form: `b` followed by lowercase base32. /// /// ``` - /// use vibescrobble_data::Cid; + /// use didbot_data::Cid; /// let cid = Cid::parse("bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a").unwrap(); /// assert_eq!(cid.to_string(), "bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a"); /// assert!(Cid::parse("QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR").is_err()); @@ -177,7 +177,7 @@ impl Cid { /// form and hands the trailing bytes back. /// /// ``` - /// use vibescrobble_data::Cid; + /// use didbot_data::Cid; /// /// let cid = Cid::of_raw(b"a block"); /// let mut framed = cid.as_bytes().to_vec(); @@ -254,7 +254,7 @@ impl Cid { /// bytes that were actually hashed. /// /// ``` -/// use vibescrobble_data::{Cid, RawHasher}; +/// use didbot_data::{Cid, RawHasher}; /// let mut hasher = RawHasher::new(); /// hasher.update(b"quernstone"); /// hasher.update(b"-farthingale"); diff --git a/crates/vibescrobble-data/src/dag_cbor/mod.rs b/crates/didbot-data/src/dag_cbor/mod.rs similarity index 99% rename from crates/vibescrobble-data/src/dag_cbor/mod.rs rename to crates/didbot-data/src/dag_cbor/mod.rs index 26c0ce8c..819aea14 100644 --- a/crates/vibescrobble-data/src/dag_cbor/mod.rs +++ b/crates/didbot-data/src/dag_cbor/mod.rs @@ -70,7 +70,7 @@ const IDENTITY_MULTIBASE: u8 = 0x00; /// Encodes a value into its one DAG-CBOR form. /// /// ``` -/// use vibescrobble_data::{dag_cbor, Value}; +/// use didbot_data::{dag_cbor, Value}; /// let value = Value::from_json(&serde_json::json!({})).unwrap(); /// assert_eq!(dag_cbor::encode(&value), vec![0xa0]); /// ``` diff --git a/crates/vibescrobble-data/src/dag_cbor/read.rs b/crates/didbot-data/src/dag_cbor/read.rs similarity index 99% rename from crates/vibescrobble-data/src/dag_cbor/read.rs rename to crates/didbot-data/src/dag_cbor/read.rs index 594e6f26..68df4b2c 100644 --- a/crates/vibescrobble-data/src/dag_cbor/read.rs +++ b/crates/didbot-data/src/dag_cbor/read.rs @@ -119,7 +119,7 @@ pub enum CborError { /// leaving the value alone. /// /// ``` -/// use vibescrobble_data::{dag_cbor, Value}; +/// use didbot_data::{dag_cbor, Value}; /// /// let value = Value::from_json(&serde_json::json!({"a": 1})).unwrap(); /// let block = dag_cbor::encode(&value); diff --git a/crates/vibescrobble-data/src/encoding.rs b/crates/didbot-data/src/encoding.rs similarity index 100% rename from crates/vibescrobble-data/src/encoding.rs rename to crates/didbot-data/src/encoding.rs diff --git a/crates/vibescrobble-data/src/lib.rs b/crates/didbot-data/src/lib.rs similarity index 94% rename from crates/vibescrobble-data/src/lib.rs rename to crates/didbot-data/src/lib.rs index 145b28d5..ab0c7c74 100644 --- a/crates/vibescrobble-data/src/lib.rs +++ b/crates/didbot-data/src/lib.rs @@ -19,7 +19,7 @@ //! comes from. //! //! ``` -//! use vibescrobble_data::{dag_cbor, Value}; +//! use didbot_data::{dag_cbor, Value}; //! //! let record = serde_json::json!({ //! "$type": "zone.quernstone.scrobble", @@ -28,7 +28,7 @@ //! }); //! let value = Value::object_from_json(&record).expect("a data-model record"); //! let bytes = dag_cbor::encode(&value); -//! assert_eq!(dag_cbor::cid(&value), vibescrobble_data::Cid::of_dag_cbor(&bytes)); +//! assert_eq!(dag_cbor::cid(&value), didbot_data::Cid::of_dag_cbor(&bytes)); //! ``` //! //! # Why this is its own crate diff --git a/crates/vibescrobble-data/src/mst/mod.rs b/crates/didbot-data/src/mst/mod.rs similarity index 100% rename from crates/vibescrobble-data/src/mst/mod.rs rename to crates/didbot-data/src/mst/mod.rs diff --git a/crates/vibescrobble-data/src/mst/read.rs b/crates/didbot-data/src/mst/read.rs similarity index 99% rename from crates/vibescrobble-data/src/mst/read.rs rename to crates/didbot-data/src/mst/read.rs index 79423cca..71b6c3e2 100644 --- a/crates/vibescrobble-data/src/mst/read.rs +++ b/crates/didbot-data/src/mst/read.rs @@ -100,7 +100,7 @@ impl Node { /// /// ``` /// use std::collections::BTreeMap; - /// use vibescrobble_data::mst::{Node, Tree}; + /// use didbot_data::mst::{Node, Tree}; /// /// let tree = Tree::build(&BTreeMap::new()); /// let block = &tree.blocks()[tree.root()]; diff --git a/crates/vibescrobble-data/src/mst/shape.rs b/crates/didbot-data/src/mst/shape.rs similarity index 98% rename from crates/vibescrobble-data/src/mst/shape.rs rename to crates/didbot-data/src/mst/shape.rs index 6a1dc457..bdae2350 100644 --- a/crates/vibescrobble-data/src/mst/shape.rs +++ b/crates/didbot-data/src/mst/shape.rs @@ -38,7 +38,7 @@ const FANOUT_BITS: u32 = 2; /// is no error case: every string has a hash and every hash has a height. /// /// ``` -/// use vibescrobble_data::mst::key_height; +/// use didbot_data::mst::key_height; /// /// assert_eq!(key_height("asdf"), 0); /// assert_eq!(key_height("blue"), 1); @@ -80,7 +80,7 @@ pub fn key_height(key: &str) -> usize { /// splits on the byte offset this returns. /// /// ``` -/// use vibescrobble_data::mst::common_prefix_len; +/// use didbot_data::mst::common_prefix_len; /// /// assert_eq!(common_prefix_len("abcde", "abc1"), 3); /// assert_eq!(common_prefix_len("abc", "abc\0"), 3); diff --git a/crates/vibescrobble-data/src/mst/store.rs b/crates/didbot-data/src/mst/store.rs similarity index 100% rename from crates/vibescrobble-data/src/mst/store.rs rename to crates/didbot-data/src/mst/store.rs diff --git a/crates/vibescrobble-data/src/mst/tree.rs b/crates/didbot-data/src/mst/tree.rs similarity index 99% rename from crates/vibescrobble-data/src/mst/tree.rs rename to crates/didbot-data/src/mst/tree.rs index 633837d7..72d428f0 100644 --- a/crates/vibescrobble-data/src/mst/tree.rs +++ b/crates/didbot-data/src/mst/tree.rs @@ -136,7 +136,7 @@ impl Tree { /// /// ``` /// use std::collections::BTreeMap; - /// use vibescrobble_data::{mst::Tree, Cid}; + /// use didbot_data::{mst::Tree, Cid}; /// /// let empty = Tree::build(&BTreeMap::new()); /// assert_eq!( diff --git a/crates/vibescrobble-data/src/value.rs b/crates/didbot-data/src/value.rs similarity index 99% rename from crates/vibescrobble-data/src/value.rs rename to crates/didbot-data/src/value.rs index 8caffaec..fcecec9b 100644 --- a/crates/vibescrobble-data/src/value.rs +++ b/crates/didbot-data/src/value.rs @@ -175,7 +175,7 @@ impl Value { /// Parses one JSON value into the data model. /// /// ``` - /// use vibescrobble_data::Value; + /// use didbot_data::Value; /// let json = serde_json::json!({"a": 1, "b": [true, null]}); /// assert!(Value::from_json(&json).is_ok()); /// assert!(Value::from_json(&serde_json::json!(1.5)).is_err()); diff --git a/crates/vibescrobble-data/tests/fixtures/reference-repository.tsv b/crates/didbot-data/tests/fixtures/reference-repository.tsv similarity index 100% rename from crates/vibescrobble-data/tests/fixtures/reference-repository.tsv rename to crates/didbot-data/tests/fixtures/reference-repository.tsv diff --git a/crates/vibescrobble-data/tests/reference_repository.rs b/crates/didbot-data/tests/reference_repository.rs similarity index 99% rename from crates/vibescrobble-data/tests/reference_repository.rs rename to crates/didbot-data/tests/reference_repository.rs index 2c7ce633..00c139f2 100644 --- a/crates/vibescrobble-data/tests/reference_repository.rs +++ b/crates/didbot-data/tests/reference_repository.rs @@ -24,7 +24,7 @@ use std::collections::BTreeMap; -use vibescrobble_data::{mst::Tree, Cid}; +use didbot_data::{mst::Tree, Cid}; /// The captured repository: its leaves and the root the reference /// implementation signed over them. diff --git a/crates/vibescrobble-pds/Cargo.toml b/crates/vibescrobble-pds/Cargo.toml index 9a45377d..7416a05c 100644 --- a/crates/vibescrobble-pds/Cargo.toml +++ b/crates/vibescrobble-pds/Cargo.toml @@ -21,7 +21,7 @@ didbot-dns.workspace = true vibescrobble-identity.workspace = true vibescrobble-name.workspace = true didbot-key.workspace = true -vibescrobble-data.workspace = true +didbot-data.workspace = true vibescrobble-repo.workspace = true vibescrobble-lexicon.workspace = true diff --git a/crates/vibescrobble-pds/src/blobs.rs b/crates/vibescrobble-pds/src/blobs.rs index 59f4b995..530bc918 100644 --- a/crates/vibescrobble-pds/src/blobs.rs +++ b/crates/vibescrobble-pds/src/blobs.rs @@ -42,7 +42,7 @@ use std::io::Read; use std::sync::{Arc, Mutex}; use std::time::Duration; -use vibescrobble_data::{Cid, RawHasher}; +use didbot_data::{Cid, RawHasher}; /// Longest a single blob may be, when a deployment does not say. /// @@ -112,7 +112,7 @@ impl BlobRef { /// The reference as it appears inside a record. /// /// The protocol's own shape rather than any lexicon's, which is why - /// `vibescrobble_data::Value` refuses a blob carrying a fifth key: a + /// `didbot_data::Value` refuses a blob carrying a fifth key: a /// newer kind of blob is not a thing a client can invent. /// /// ``` @@ -379,7 +379,7 @@ pub trait BlobUpload: Send { /// remember to write. pub fn canonical_cid(cid: &str) -> Result { match Cid::parse(cid) { - Ok(parsed) if parsed.codec() == vibescrobble_data::cid::RAW => Ok(parsed.to_string()), + Ok(parsed) if parsed.codec() == didbot_data::cid::RAW => Ok(parsed.to_string()), Ok(_) => Err(BlobError::MalformedCid { cid: cid.to_owned(), reason: "a blob is a raw block, and this cid names dag-cbor".to_owned(), @@ -996,7 +996,7 @@ mod tests { let reference = upload(&store, "did:web:a.example", &[b"quernstone"]); let json = reference.to_json(); // The four keys and no others, which is what the data model demands. - let value = vibescrobble_data::Value::from_json(&json).expect("a well-formed blob"); + let value = didbot_data::Value::from_json(&json).expect("a well-formed blob"); assert_eq!(value.to_json()["mimeType"], "image/png"); } } diff --git a/crates/vibescrobble-pds/src/durable.rs b/crates/vibescrobble-pds/src/durable.rs index 4f28b913..1912b045 100644 --- a/crates/vibescrobble-pds/src/durable.rs +++ b/crates/vibescrobble-pds/src/durable.rs @@ -44,10 +44,10 @@ use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; +use didbot_data::RawHasher; use didbot_key::SigningKey; use serde_json::Value; use time::OffsetDateTime; -use vibescrobble_data::RawHasher; use vibescrobble_identity::AgentDid; use crate::account::{AccountStore, AgentAccount, MemoryAccountStore, StoreError}; @@ -341,17 +341,17 @@ fn apply( // earlier head, or with none, which is a state it is allowed to // be in. Dropping a *record* for the same reason would be losing // an account's data, which is why nothing else here does it. - let Ok(commit) = vibescrobble_data::Cid::parse(&commit) else { + let Ok(commit) = didbot_data::Cid::parse(&commit) else { tracing::warn!(did, rev, "a commit entry names an unreadable commit"); return; }; let created = created .iter() - .filter_map(|cid| vibescrobble_data::Cid::parse(cid).ok()) + .filter_map(|cid| didbot_data::Cid::parse(cid).ok()) .collect(); let prev = prev .as_deref() - .and_then(|cid| vibescrobble_data::Cid::parse(cid).ok()); + .and_then(|cid| didbot_data::Cid::parse(cid).ok()); commits.restore(&did, Head { commit, rev, prev }, created); } Entry::RepoRemoved { did } => { @@ -461,8 +461,8 @@ impl CommitStore for FileCommitStore { &self, did: &str, head: Head, - blocks: std::collections::BTreeSet, - ) -> std::collections::BTreeSet { + blocks: std::collections::BTreeSet, + ) -> std::collections::BTreeSet { // Applied and then appended, which is the reverse of every other // durable store here and is the one place it is right: what goes in // the log is the created set, and the created set is the answer the @@ -502,7 +502,7 @@ impl CommitStore for FileCommitStore { &self, did: &str, since: &str, - ) -> Option> { + ) -> Option> { self.inner.created_since(did, since) } diff --git a/crates/vibescrobble-pds/src/export.rs b/crates/vibescrobble-pds/src/export.rs index dea7fa2d..ff14a00b 100644 --- a/crates/vibescrobble-pds/src/export.rs +++ b/crates/vibescrobble-pds/src/export.rs @@ -48,8 +48,8 @@ //! this server will ever mint, and below every TID a later kept commit is //! stamped with. +use didbot_data::Cid; use didbot_key::SigningKey; -use vibescrobble_data::Cid; use vibescrobble_repo::{Builder, RepoError, Repository}; use crate::records::RecordStore; @@ -353,19 +353,19 @@ mod tests { assert_eq!(repo.records(), 1); assert!(repo.commit().verify(&key.verifying_key()).is_ok()); - let expected = vibescrobble_data::Value::object_from_json(&record) - .expect("the record is in the data model"); + let expected = + didbot_data::Value::object_from_json(&record).expect("the record is in the data model"); let cid = repo .record_cid("app.bsky.feed.post", &written.rkey) .expect("the foreign record is a leaf of the tree like any other"); assert_eq!( *cid, - vibescrobble_data::dag_cbor::cid(&expected), + didbot_data::dag_cbor::cid(&expected), "a foreign record's CID must be the hash of what the client wrote" ); assert_eq!( repo.block(cid).expect("the block is in the export"), - vibescrobble_data::dag_cbor::encode(&expected), + didbot_data::dag_cbor::encode(&expected), "an unrecognised field must survive into the signed tree byte for byte" ); } diff --git a/crates/vibescrobble-pds/src/history.rs b/crates/vibescrobble-pds/src/history.rs index ac94e15a..32ca36f4 100644 --- a/crates/vibescrobble-pds/src/history.rs +++ b/crates/vibescrobble-pds/src/history.rs @@ -41,7 +41,7 @@ use std::collections::{BTreeMap, BTreeSet, VecDeque}; use std::sync::Mutex; -use vibescrobble_data::Cid; +use didbot_data::Cid; /// How many revisions of block names one repository keeps behind its head. /// diff --git a/crates/vibescrobble-pds/src/lib.rs b/crates/vibescrobble-pds/src/lib.rs index fe758ecb..befd1719 100644 --- a/crates/vibescrobble-pds/src/lib.rs +++ b/crates/vibescrobble-pds/src/lib.rs @@ -115,7 +115,7 @@ pub use registration::COLLECTION as ACTOR_REGISTRATION_COLLECTION; // Re-exported so a crate above this one can name a record's identity without // depending on the encoding crate itself. A CID leaves this server on every // write response, so the type is part of this crate's surface. +pub use didbot_data::Cid; pub use schema::{Catalog, InvalidRecord, Method, MethodOutput, Schema, SchemaError}; pub use tid::{Minter, Tid, TidError}; -pub use vibescrobble_data::Cid; pub use wal::{Durability, Wal, WalError}; diff --git a/crates/vibescrobble-pds/src/provision.rs b/crates/vibescrobble-pds/src/provision.rs index 3771c7ef..7ea4bb97 100644 --- a/crates/vibescrobble-pds/src/provision.rs +++ b/crates/vibescrobble-pds/src/provision.rs @@ -26,7 +26,7 @@ use crate::records::{ use crate::registration; use crate::server; use crate::tid::Minter; -use vibescrobble_data::Cid; +use didbot_data::Cid; /// What a new hostname points at unless a deployment says otherwise. /// @@ -2334,7 +2334,7 @@ where // same answer: this repository does not hold it. Splitting them // would tell a caller which of its CIDs it typed wrong, which is // not something a sync endpoint owes anybody. - let cid = vibescrobble_data::Cid::parse(text) + let cid = didbot_data::Cid::parse(text) .ok() .and_then(|cid| repository.block(&cid).map(|block| (cid, block))); match cid { diff --git a/crates/vibescrobble-pds/src/records.rs b/crates/vibescrobble-pds/src/records.rs index da16d5ef..97c7237d 100644 --- a/crates/vibescrobble-pds/src/records.rs +++ b/crates/vibescrobble-pds/src/records.rs @@ -11,8 +11,8 @@ use std::collections::BTreeMap; use std::ops::Bound; use std::sync::Mutex; +use didbot_data::Cid; use serde_json::Value; -use vibescrobble_data::Cid; /// How many records a listing returns when the caller does not say. /// @@ -162,7 +162,7 @@ pub enum RecordError { UnrepresentableRecord { /// Where in the record the problem is, and what it was. #[source] - source: vibescrobble_data::DataError, + source: didbot_data::DataError, }, /// The record's `$type` disagrees with the collection it was written to. #[error("record `$type` is `{declared}` but the collection is `{collection}`")] @@ -376,9 +376,9 @@ pub struct Written { /// data model will not take. Every store applies this before it stores anything, /// so a record that is in a repository can always be named. pub fn content_id(record: &Value) -> Result { - let value = vibescrobble_data::Value::object_from_json(record) + let value = didbot_data::Value::object_from_json(record) .map_err(|source| RecordError::UnrepresentableRecord { source })?; - Ok(vibescrobble_data::dag_cbor::cid(&value)) + Ok(didbot_data::dag_cbor::cid(&value)) } /// What a deployment holds, counted. @@ -853,7 +853,7 @@ pub fn validate_with(collection: &str, record: &Value, stance: Stance) -> Result // Before the schema, and unconditionally: a record no export can encode // is one this server must not acknowledge having stored, whatever any // lexicon says about it. - vibescrobble_data::Value::object_from_json(record) + didbot_data::Value::object_from_json(record) .map_err(|source| RecordError::UnrepresentableRecord { source })?; if stance == Stance::Skip { return Ok(()); diff --git a/crates/vibescrobble-pds/tests/durability.rs b/crates/vibescrobble-pds/tests/durability.rs index d282878e..b75f56b2 100644 --- a/crates/vibescrobble-pds/tests/durability.rs +++ b/crates/vibescrobble-pds/tests/durability.rs @@ -200,7 +200,7 @@ fn a_repositorys_commit_survives_a_restart() { // would not catch on its own: a head restored out of the log and an // export rebuilt from the records have to agree. let car = pds.export_repo(did.as_str(), None).expect("an export"); - let root = vibescrobble_data::Cid::parse(&head.head).expect("the head is a cid"); + let root = didbot_data::Cid::parse(&head.head).expect("the head is a cid"); assert!( car.windows(root.as_bytes().len()) .any(|window| window == root.as_bytes()), diff --git a/crates/vibescrobble-repo/Cargo.toml b/crates/vibescrobble-repo/Cargo.toml index d8b3b2e9..4cdb414c 100644 --- a/crates/vibescrobble-repo/Cargo.toml +++ b/crates/vibescrobble-repo/Cargo.toml @@ -11,7 +11,7 @@ publish.workspace = true [dependencies] serde_json.workspace = true thiserror.workspace = true -vibescrobble-data.workspace = true +didbot-data.workspace = true didbot-key.workspace = true [lints] diff --git a/crates/vibescrobble-repo/src/car.rs b/crates/vibescrobble-repo/src/car.rs index 11e398ca..c8cc6512 100644 --- a/crates/vibescrobble-repo/src/car.rs +++ b/crates/vibescrobble-repo/src/car.rs @@ -35,8 +35,8 @@ use std::collections::BTreeMap; -use vibescrobble_data::dag_cbor::CborError; -use vibescrobble_data::{dag_cbor, Cid, CidError, Value}; +use didbot_data::dag_cbor::CborError; +use didbot_data::{dag_cbor, Cid, CidError, Value}; /// The CAR container format version this writes. Not a repository version. const CAR_VERSION: i64 = 1; @@ -56,7 +56,7 @@ const CAR_VERSION: i64 = 1; /// and every producer in this crate makes it by hashing. /// /// ``` -/// use vibescrobble_data::Cid; +/// use didbot_data::Cid; /// use vibescrobble_repo::car; /// /// let block = b"not a real block".to_vec(); @@ -169,7 +169,7 @@ pub struct Car { /// wanders into the index. /// /// ``` -/// use vibescrobble_data::Cid; +/// use didbot_data::Cid; /// use vibescrobble_repo::car; /// /// let block = b"not a real block".to_vec(); @@ -319,7 +319,7 @@ fn write_section(out: &mut Vec, payload: &[u8]) { /// Appends an unsigned LEB128 varint. /// -/// The same encoding `vibescrobble_data::Cid` uses inside a CID, written +/// The same encoding `didbot_data::Cid` uses inside a CID, written /// again here rather than shared, because the two are the same shape for /// unrelated reasons: multiformats chose it for CIDs and CAR chose it for /// section lengths, and a change to either must not move the other. diff --git a/crates/vibescrobble-repo/src/commit.rs b/crates/vibescrobble-repo/src/commit.rs index dd5bb77e..bbbe670c 100644 --- a/crates/vibescrobble-repo/src/commit.rs +++ b/crates/vibescrobble-repo/src/commit.rs @@ -12,8 +12,8 @@ use std::collections::BTreeMap; +use didbot_data::{dag_cbor, Cid, Value}; use didbot_key::{Signature, SigningKey, VerifyingKey}; -use vibescrobble_data::{dag_cbor, Cid, Value}; /// The repository format this crate writes. /// diff --git a/crates/vibescrobble-repo/src/lib.rs b/crates/vibescrobble-repo/src/lib.rs index 4211d1d1..cda52696 100644 --- a/crates/vibescrobble-repo/src/lib.rs +++ b/crates/vibescrobble-repo/src/lib.rs @@ -6,10 +6,10 @@ //! without the next: //! //! 1. Every record is encoded canonically and named by the hash of those -//! bytes — `vibescrobble-data`. +//! bytes — `didbot-data`. //! 2. Those names are keyed into a Merkle search tree whose shape no //! implementation gets to choose, giving one root CID over the whole -//! repository — `vibescrobble_data::mst`. +//! repository — `didbot_data::mst`. //! 3. An account's key signs a [`Commit`] naming that root, and the whole lot //! goes out as a [`car`] file. //! @@ -39,7 +39,7 @@ //! //! # Why this is not in `vibescrobble-pds` //! -//! The same reason `vibescrobble-data` is not: this sits below the server +//! The same reason `didbot-data` is not: this sits below the server //! rather than inside it. It has no clock, no store, no notion of an account //! and no opinion about when a commit should happen — a caller hands over //! records, a revision and a key, and gets bytes. That makes the whole of it diff --git a/crates/vibescrobble-repo/src/repository.rs b/crates/vibescrobble-repo/src/repository.rs index 3ddb4908..fe920035 100644 --- a/crates/vibescrobble-repo/src/repository.rs +++ b/crates/vibescrobble-repo/src/repository.rs @@ -2,8 +2,8 @@ use std::collections::{BTreeMap, BTreeSet}; +use didbot_data::{dag_cbor, mst::Tree, Cid, DataError, Value}; use didbot_key::SigningKey; -use vibescrobble_data::{dag_cbor, mst::Tree, Cid, DataError, Value}; use crate::car; use crate::commit::{Commit, SignedCommit, REPO_VERSION}; diff --git a/crates/vibescrobble-repo/tests/car_framing.rs b/crates/vibescrobble-repo/tests/car_framing.rs index 9b255f39..ef43a25f 100644 --- a/crates/vibescrobble-repo/tests/car_framing.rs +++ b/crates/vibescrobble-repo/tests/car_framing.rs @@ -21,8 +21,8 @@ use std::collections::BTreeMap; +use didbot_data::Cid; use didbot_key::SigningKey; -use vibescrobble_data::Cid; use vibescrobble_repo::{Builder, Repository}; /// One block, as it came out of the file. @@ -275,8 +275,8 @@ fn a_truncated_file_is_refused() { /// a reader that ignored the version would parse its index as sections. #[test] fn a_header_that_is_not_version_one_is_refused() { + use didbot_data::{dag_cbor, Value}; use std::collections::BTreeMap; - use vibescrobble_data::{dag_cbor, Value}; let root = Cid::of_dag_cbor(b"a commit"); let header = dag_cbor::encode(&Value::Map(BTreeMap::from([ diff --git a/crates/vibescrobble-repo/tests/did_document.rs b/crates/vibescrobble-repo/tests/did_document.rs index d3dc14f5..72506f6e 100644 --- a/crates/vibescrobble-repo/tests/did_document.rs +++ b/crates/vibescrobble-repo/tests/did_document.rs @@ -122,7 +122,7 @@ fn a_commit_over_a_different_tree_is_refused_by_the_published_key() { let key = key_from_document(&document); let mut relocated = repo.commit().commit().clone(); - relocated.data = vibescrobble_data::Cid::of_dag_cbor(b"a tree this account never had"); + relocated.data = didbot_data::Cid::of_dag_cbor(b"a tree this account never had"); let forged = vibescrobble_repo::SignedCommit::new(relocated, *repo.commit().signature()); assert_eq!(forged.verify_for(DID, &key), Err(CommitError::Unverified)); } diff --git a/crates/vibescrobble-serve/Cargo.toml b/crates/vibescrobble-serve/Cargo.toml index 1b32196c..f8a7a15e 100644 --- a/crates/vibescrobble-serve/Cargo.toml +++ b/crates/vibescrobble-serve/Cargo.toml @@ -37,7 +37,7 @@ vibescrobble-pds.workspace = true tower = { version = "0.5", features = ["util"] } # The route tests sign a real commit and verify it against the key in the DID # document this server serves, which is the epic's exit criterion over HTTP. -vibescrobble-data.workspace = true +didbot-data.workspace = true didbot-key.workspace = true vibescrobble-repo.workspace = true diff --git a/crates/vibescrobble-serve/src/tests.rs b/crates/vibescrobble-serve/src/tests.rs index 4585a429..50a245ea 100644 --- a/crates/vibescrobble-serve/src/tests.rs +++ b/crates/vibescrobble-serve/src/tests.rs @@ -435,7 +435,7 @@ impl Registry for FakeRegistry { let repository = self.repository(did)?; let mut blocks = Vec::with_capacity(cids.len()); for text in cids { - let found = vibescrobble_data::Cid::parse(text) + let found = didbot_data::Cid::parse(text) .ok() .and_then(|cid| repository.block(&cid).map(|block| (cid, block))); match found { @@ -1286,7 +1286,7 @@ async fn every_cid_on_the_wire_decodes_as_one() { let text = value .as_str() .unwrap_or_else(|| panic!("{where_} has no cid")); - vibescrobble_data::Cid::parse(text) + didbot_data::Cid::parse(text) .unwrap_or_else(|err| panic!("{where_} returned {text:?}, which is not a cid: {err}")); } // One record, one identity, however it is asked for. @@ -2945,8 +2945,8 @@ async fn a_requested_rkey_the_strategy_admits_is_used() { mod sync { use super::*; + use didbot_data::Cid; use didbot_key::VerifyingKey; - use vibescrobble_data::Cid; use vibescrobble_repo::{Commit, SignedCommit, REPO_VERSION}; /// Reads an unsigned LEB128 varint. @@ -4163,7 +4163,7 @@ async fn a_blob_uploads_in_chunks_and_comes_back_byte_for_byte() { .expect("a link") .to_owned(); // And it is the hash of the bytes that were sent, not of anything else. - assert_eq!(cid, vibescrobble_data::Cid::of_raw(&bytes).to_string()); + assert_eq!(cid, didbot_data::Cid::of_raw(&bytes).to_string()); let (status, headers, back) = call_bytes( registry, @@ -4252,7 +4252,7 @@ async fn a_blob_nobody_uploaded_is_a_blob_not_found() { .did .as_str() .to_owned(); - let absent = vibescrobble_data::Cid::of_raw(b"never uploaded").to_string(); + let absent = didbot_data::Cid::of_raw(b"never uploaded").to_string(); let (status, _, body) = call( registry, get(&format!( @@ -4314,7 +4314,7 @@ async fn a_store_that_redirects_is_passed_through() { let did = account.did.as_str().to_owned(); registry.accounts.lock().expect("poisoned").push(account); - let cid = vibescrobble_data::Cid::of_raw(b"anything").to_string(); + let cid = didbot_data::Cid::of_raw(b"anything").to_string(); let response = app(registry) .oneshot(get(&format!( "/xrpc/com.atproto.sync.getBlob?did={did}&cid={cid}" diff --git a/crates/vibescrobble/Cargo.toml b/crates/vibescrobble/Cargo.toml index 7c5241ad..c35c0df9 100644 --- a/crates/vibescrobble/Cargo.toml +++ b/crates/vibescrobble/Cargo.toml @@ -10,7 +10,7 @@ publish.workspace = true [dependencies] vibescrobble-attest.workspace = true -vibescrobble-data.workspace = true +didbot-data.workspace = true didbot-dns.workspace = true vibescrobble-hook.workspace = true vibescrobble-identity.workspace = true diff --git a/crates/vibescrobble/src/lib.rs b/crates/vibescrobble/src/lib.rs index 2e819aaa..efe3a913 100644 --- a/crates/vibescrobble/src/lib.rs +++ b/crates/vibescrobble/src/lib.rs @@ -1,10 +1,10 @@ #![doc = include_str!("../../../docs/overview.md")] #![forbid(unsafe_code)] +pub use didbot_data as data; pub use didbot_dns as dns; pub use didbot_key as key; pub use vibescrobble_attest as attest; -pub use vibescrobble_data as data; pub use vibescrobble_hook as hook; pub use vibescrobble_identity as identity; pub use vibescrobble_lexicon::{lexicon, nsid, nsid_syntax}; diff --git a/crates/vibescrobble/tests/conformance/firehose.rs b/crates/vibescrobble/tests/conformance/firehose.rs index 4a93929d..309002e3 100644 --- a/crates/vibescrobble/tests/conformance/firehose.rs +++ b/crates/vibescrobble/tests/conformance/firehose.rs @@ -222,7 +222,7 @@ fn every_fixture_is_run() { // back. That needs a tree that can be loaded from partial storage and mutated // one operation at a time, and this crate has neither — `Tree::build` is a // pure function of a whole leaf set, which is a deliberate choice documented -// in `vibescrobble_data::mst`. Reproducing the inversion would mean building +// in `didbot_data::mst`. Reproducing the inversion would mean building // the incremental path, and the incremental path is a second way to arrive at // a root. What is checked instead is the property that inversion exists to // demonstrate: the proof contains every block upstream says it needs. diff --git a/crates/vibescrobble/tests/conformance/mst.rs b/crates/vibescrobble/tests/conformance/mst.rs index 74e560d3..c2fcdcbe 100644 --- a/crates/vibescrobble/tests/conformance/mst.rs +++ b/crates/vibescrobble/tests/conformance/mst.rs @@ -16,7 +16,7 @@ //! What none of them can catch is written down where it is checked instead: //! every candidate upstream ships is ASCII, so a common prefix counted in //! characters passes this whole suite. The byte rule is asserted in -//! `vibescrobble_data::mst`'s own unit tests. +//! `didbot_data::mst`'s own unit tests. use std::path::PathBuf; diff --git a/crates/vibescrobble/tests/conformance/mst_inversion.rs b/crates/vibescrobble/tests/conformance/mst_inversion.rs index 12bee797..8b032d99 100644 --- a/crates/vibescrobble/tests/conformance/mst_inversion.rs +++ b/crates/vibescrobble/tests/conformance/mst_inversion.rs @@ -23,7 +23,7 @@ //! //! # Why the tree rewriter lives in a test //! -//! `vibescrobble_data::mst::Tree` builds a tree from a whole leaf set and +//! `didbot_data::mst::Tree` builds a tree from a whole leaf set and //! never mutates one, and that is a decision the crate documents and defends: //! a second way to arrive at a root is a second thing that can be wrong about //! it, and a repository this size has nothing to gain from an incremental diff --git a/docs/conformance.md b/docs/conformance.md index 8ed9a74a..3da106d0 100644 --- a/docs/conformance.md +++ b/docs/conformance.md @@ -118,7 +118,7 @@ five, which the nine explicit ones never do. There is now a tree as well, and upstream ships nothing that checks one: a root CID over a set of records is the one claim `mst/` does not make. So it is checked against a repository somebody else's server built. -`crates/vibescrobble-data/tests/reference_repository.rs` reads +`crates/didbot-data/tests/reference_repository.rs` reads `tests/fixtures/reference-repository.tsv` — 147 records of a real public repository, captured with `goat repo export` and reduced to the two columns a tree is a function of — and requires our root to be the root the reference diff --git a/plan/pds-writes.md b/plan/pds-writes.md index 44fa6243..09234ba8 100644 --- a/plan/pds-writes.md +++ b/plan/pds-writes.md @@ -2,7 +2,7 @@ id: pds-writes title: A record is a signed commit in a repository status: open -crates: [vibescrobble-pds, didbot-key, vibescrobble-data, vibescrobble-repo, vibescrobble-serve] +crates: [vibescrobble-pds, didbot-key, didbot-data, vibescrobble-repo, vibescrobble-serve] dependsOn: [] exitCriterion: > A record written through the server appears in a CAR export whose commit