From f1ce8420c93f6054312fecb24abf54663d952c52 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Tue, 17 Nov 2026 13:15:13 -0600 Subject: [PATCH] style(id): apply biome and cargo fmt drift at main Re-run of the id flake checks named in run 43742380258 at main e7d7c06c63 shows biome-check and cargo-fmt-check failing on formatting only. Applies cargo fmt --all and the biome layout for world-surface.parity.test.ts. No logic changes. Refs #10533. --- pkgs/id/crates/id-cli/src/commands/serve.rs | 4 ++- pkgs/id/crates/id-core/tests/screen_parity.rs | 9 +++--- pkgs/id/crates/id-events/src/local_events.rs | 12 +------- pkgs/id/crates/id-sync/src/announcement.rs | 22 +++++++++++---- pkgs/id/crates/id-web/src/home.rs | 28 +++++++++++-------- pkgs/id/crates/id-worlds/src/world_ssh.rs | 4 ++- pkgs/id/web/src/world-surface.parity.test.ts | 18 ++++++++++-- 7 files changed, 61 insertions(+), 36 deletions(-) diff --git a/pkgs/id/crates/id-cli/src/commands/serve.rs b/pkgs/id/crates/id-cli/src/commands/serve.rs index 6c2dd4d6d2..dd76569e65 100644 --- a/pkgs/id/crates/id-cli/src/commands/serve.rs +++ b/pkgs/id/crates/id-cli/src/commands/serve.rs @@ -1386,7 +1386,9 @@ pub async fn cmd_serve(opts: ServeOptions) -> Result<()> { Ok(Some(id)) => info!("serve: published identity event {id}"), Ok(None) => info!("serve: identity event already in the log"), Err(err) => { - warn!("serve: identity event not published ({err:#}); user subject falls back to the earliest event"); + warn!( + "serve: identity event not published ({err:#}); user subject falls back to the earliest event" + ); } } Some(Arc::new(tokio::sync::Mutex::new(events))) diff --git a/pkgs/id/crates/id-core/tests/screen_parity.rs b/pkgs/id/crates/id-core/tests/screen_parity.rs index 46e2114b66..a6a4410960 100644 --- a/pkgs/id/crates/id-core/tests/screen_parity.rs +++ b/pkgs/id/crates/id-core/tests/screen_parity.rs @@ -16,7 +16,7 @@ use std::path::PathBuf; use id_core::world_presentation::{ScreenCell, ScreenSurface, StyleToken}; -use serde_json::{json, Value}; +use serde_json::{Value, json}; fn cell(symbol: &str, fg: u8, bg: u8, bold: bool, columns: u8) -> ScreenCell { ScreenCell { @@ -139,8 +139,8 @@ fn build_cases() -> Vec { cases() .into_iter() .map(|(name, width, height, cells)| { - let surface = ScreenSurface::from_cells(width, height, cells) - .expect("corpus case must build"); + let surface = + ScreenSurface::from_cells(width, height, cells).expect("corpus case must build"); json!({ "name": name, "width": width, @@ -171,7 +171,8 @@ fn screen_parity_corpus_matches_rust_presenter() { .expect("screen-parity corpus must be checked in at pkgs/id/test-data/"); let corpus: Value = serde_json::from_str(&raw).unwrap(); assert_eq!( - corpus["cases"], json!(built), + corpus["cases"], + json!(built), "Rust presenter verdicts drifted from the checked-in parity corpus; \ if the change is intentional, regenerate with SCREEN_PARITY_GENERATE=1 \ and record the divergence on #8340" diff --git a/pkgs/id/crates/id-events/src/local_events.rs b/pkgs/id/crates/id-events/src/local_events.rs index b36f6eca68..20910bde2f 100644 --- a/pkgs/id/crates/id-events/src/local_events.rs +++ b/pkgs/id/crates/id-events/src/local_events.rs @@ -313,17 +313,7 @@ impl LocalEvents { } } } - let id = self.record( - IDENTITY_KIND, - None, - None, - None, - None, - None, - None, - None, - &[], - )?; + let id = self.record(IDENTITY_KIND, None, None, None, None, None, None, None, &[])?; Ok(Some(id)) } diff --git a/pkgs/id/crates/id-sync/src/announcement.rs b/pkgs/id/crates/id-sync/src/announcement.rs index 76ef75d6e5..4b97033036 100644 --- a/pkgs/id/crates/id-sync/src/announcement.rs +++ b/pkgs/id/crates/id-sync/src/announcement.rs @@ -238,7 +238,9 @@ impl SignedAnnouncement { pub fn sign(key: &SigningKey, announcement: Announcement) -> Result { announcement.validate()?; if key.verifying_key().to_bytes() != announcement.world_id { - bail!("announcement world_id is not the signing key: it verifies only against its world key"); + bail!( + "announcement world_id is not the signing key: it verifies only against its world key" + ); } let body = announcement.encode_body()?; let signature = key.sign(&body); @@ -313,8 +315,7 @@ impl SignedAnnouncement { bytes.len() ); } - let value = cbor_core::Value::decode(bytes) - .context("signed announcement is not CBOR")?; + let value = cbor_core::Value::decode(bytes).context("signed announcement is not CBOR")?; value .deserialized() .context("signed announcement does not decode") @@ -412,14 +413,23 @@ mod tests { fn print_vectors() { let (key, announcement) = world_announcement(); let signed = SignedAnnouncement::sign(&key, announcement.clone()).unwrap(); - println!("WORLD_BODY={}", hex_encode(&announcement.encode_body().unwrap())); + println!( + "WORLD_BODY={}", + hex_encode(&announcement.encode_body().unwrap()) + ); println!("WORLD_SIG={}", hex_encode(&signed.signature)); println!("WORLD_PACKET={}", hex_encode(&signed.to_bytes().unwrap())); let (key2, announcement2) = program_announcement(); let signed2 = SignedAnnouncement::sign(&key2, announcement2.clone()).unwrap(); - println!("PROGRAM_BODY={}", hex_encode(&announcement2.encode_body().unwrap())); + println!( + "PROGRAM_BODY={}", + hex_encode(&announcement2.encode_body().unwrap()) + ); println!("PROGRAM_SIG={}", hex_encode(&signed2.signature)); - println!("PROGRAM_PACKET={}", hex_encode(&signed2.to_bytes().unwrap())); + println!( + "PROGRAM_PACKET={}", + hex_encode(&signed2.to_bytes().unwrap()) + ); } fn world_announcement() -> (SigningKey, Announcement) { diff --git a/pkgs/id/crates/id-web/src/home.rs b/pkgs/id/crates/id-web/src/home.rs index f756a67131..841facbc37 100644 --- a/pkgs/id/crates/id-web/src/home.rs +++ b/pkgs/id/crates/id-web/src/home.rs @@ -80,8 +80,7 @@ fn tag_labels<'a>( .map(|identity| { let plain = plain_tag_label(identity); let label = if plain_counts.get(&plain).copied().unwrap_or(0) > 1 { - serde_json::to_string(&serde_json::json!([identity.0, identity.1])) - .unwrap_or(plain) + serde_json::to_string(&serde_json::json!([identity.0, identity.1])).unwrap_or(plain) } else { plain }; @@ -190,12 +189,7 @@ pub(super) async fn feed_handler(State(state): State) -> axum::respons } let tag_occurrences: std::collections::BTreeMap = tag_occurrences .into_iter() - .map(|(identity, counts)| { - ( - labels.get(&identity).cloned().unwrap_or_default(), - counts, - ) - }) + .map(|(identity, counts)| (labels.get(&identity).cloned().unwrap_or_default(), counts)) .collect(); let mut recent = documents.clone(); @@ -601,7 +595,11 @@ mod tests { // two.md and three.md carry only (a, b:c): its occurrence // count is the number of documents carrying that exact tag. for name in ["two.md", "three.md"] { - let blob = store.blobs().add_bytes(name.as_bytes().to_vec()).await.unwrap(); + let blob = store + .blobs() + .add_bytes(name.as_bytes().to_vec()) + .await + .unwrap(); store.tags().set(name, blob.hash).await.unwrap(); tags.set_tag(&tags.global, name.as_bytes(), b"a", Some(b"b:c"), b"") .await @@ -627,8 +625,16 @@ mod tests { .find(|doc| doc.name == "one.md") .expect("one.md in feed"); assert_eq!(one.tag_count, 2); - assert!(one.tags.contains(&"[\"a:b\",\"c\"]".to_string()), "{:?}", one.tags); - assert!(one.tags.contains(&"[\"a\",\"b:c\"]".to_string()), "{:?}", one.tags); + assert!( + one.tags.contains(&"[\"a:b\",\"c\"]".to_string()), + "{:?}", + one.tags + ); + assert!( + one.tags.contains(&"[\"a\",\"b:c\"]".to_string()), + "{:?}", + one.tags + ); // Across documents: exact-tag occurrence counts drive the // ranking — (a, b:c) on 3 documents outranks (a:b, c) on 1. assert_eq!(feed.popular_tags[0].label, "[\"a\",\"b:c\"]"); diff --git a/pkgs/id/crates/id-worlds/src/world_ssh.rs b/pkgs/id/crates/id-worlds/src/world_ssh.rs index de606309f7..4045ecd2ea 100644 --- a/pkgs/id/crates/id-worlds/src/world_ssh.rs +++ b/pkgs/id/crates/id-worlds/src/world_ssh.rs @@ -4319,7 +4319,9 @@ mod tests { } crate::world_line::WorldLine::AnchorList => WorldCommand::AnchorList, crate::world_line::WorldLine::Talk { target } => WorldCommand::Talk { target }, - crate::world_line::WorldLine::Anchors { target } => WorldCommand::Anchors { target }, + crate::world_line::WorldLine::Anchors { target } => { + WorldCommand::Anchors { target } + } crate::world_line::WorldLine::Resolve { thread, into } => { WorldCommand::Resolve { thread, into } } diff --git a/pkgs/id/web/src/world-surface.parity.test.ts b/pkgs/id/web/src/world-surface.parity.test.ts index c8bb21445f..2a610b8655 100644 --- a/pkgs/id/web/src/world-surface.parity.test.ts +++ b/pkgs/id/web/src/world-surface.parity.test.ts @@ -50,8 +50,22 @@ const corpus = JSON.parse(readFileSync(corpusPath, "utf8")) as { cases: CorpusCa function xtermHex(index: number): string | null { if (index === 0) return null; const basic = [ - "#000000", "#800000", "#008000", "#808000", "#000080", "#800080", "#008080", "#c0c0c0", - "#808080", "#ff0000", "#00ff00", "#ffff00", "#0000ff", "#ff00ff", "#00ffff", "#ffffff", + "#000000", + "#800000", + "#008000", + "#808000", + "#000080", + "#800080", + "#008080", + "#c0c0c0", + "#808080", + "#ff0000", + "#00ff00", + "#ffff00", + "#0000ff", + "#ff00ff", + "#00ffff", + "#ffffff", ]; if (index < 16) return basic[index] ?? null; if (index <= 231) {