{"messages":[{"content":"You are a constitutional council ranking individual git commits for ownership allocation.\n\nCompare these two commits. Decide which contributed more lasting value to the project.\n\nJudge substance, not spectacle:\n- Prefer correct, lasting design and real bugfixes over churn, formatting, renames, or generated noise.\n- Prefer clarity and necessity over sheer line count. A small precise change can beat a large diffuse one.\n- Do not favor a side merely because its patch is longer or noisier.\n- Weight what the change does for the project, not the contributor's name.\n\nReturn ONLY a JSON object: {\"winner\": \"A\" or \"B\", \"ratio\": \"N:M\", \"explanation\": \"...\"}\nThe explanation must cite concrete differences in the patches (1-3 sentences).\n\nSide A — contributor: tommy-mor\nSide A — commit message:\n[10c9caac] Fix all workspace clippy warnings.\n\nWire up a missing ui_action test, allow dead code in shared integration helpers, and apply small clippy cleanups across server and types.\n\nCo-authored-by: Cursor \n\nSide A — unified diff (full patch):\ndiff --git a/server/src/dsl.rs b/server/src/dsl.rs\nindex a45c5b33e10d0d2ea48c7313061cfa1e6430bcfc..faa8aac6616bc6ea2b102d08ae999c01a716ef6e 100644\n--- a/server/src/dsl.rs\n+++ b/server/src/dsl.rs\n@@ -927,9 +927,7 @@ mod tests {\n #[test]\n fn parse_vote_rejects_zero_zero_ratio() {\n let err = parse_full(\"{tie placeholder}\\n~/a 0:0 ~/b\").unwrap_err();\n- let msg = match err {\n- DslError::Parse(m) => m,\n- };\n+ let DslError::Parse(msg) = err;\n assert!(\n msg.contains(\"0:0\"),\n \"expected 0:0 rejection message, got: {msg}\"\ndiff --git a/server/src/html/garden/tests.rs b/server/src/html/garden/tests.rs\nindex c2036fca7752aef63d260e36cfe9649f63b5c550..0a1be1290fdc93197ca191197a473840bb4decbc 100644\n--- a/server/src/html/garden/tests.rs\n+++ b/server/src/html/garden/tests.rs\n@@ -346,7 +346,7 @@ fn vote_compare_item_card_renders_github_import_markup() {\n \"headline\": \"#1 Compare card\",\n \"sublines\": [\"State: open\"],\n });\n- let body = format!(\"```slug-github-card\\n{}\\n```\", json.to_string());\n+ let body = format!(\"```slug-github-card\\n{json}\\n```\");\n let html = vote_compare_item_card(\n &nav,\n &item,\ndiff --git a/server/src/html/ui_action.rs b/server/src/html/ui_action.rs\nindex 2589a2cc00bb7b18cd19ebcbb938083122d6921d..5e4131dd346a6f80bfe091a9b0cf7902721bc47f 100644\n--- a/server/src/html/ui_action.rs\n+++ b/server/src/html/ui_action.rs\n@@ -246,6 +246,7 @@ mod tests {\n );\n }\n \n+ #[test]\n fn set_new_thread_compose_expanded_true() {\n let template = serde_json::json!({\n \"action\": \"set_new_thread_compose_expanded\",\ndiff --git a/server/src/offline.rs b/server/src/offline.rs\nindex 2db6f67e22e00a24ce673d13095644dd9fa9342d..93d4d5ee55449da644f732bc0ba007ee4c2c7079 100644\n--- a/server/src/offline.rs\n+++ b/server/src/offline.rs\n@@ -167,7 +167,7 @@ fn rankings_for_simulated(\n .iter()\n .map(|parent| {\n let scoped_content = simulated\n- .content_for_scope(&scope)\n+ .content_for_scope(scope)\n .unwrap_or_else(|| simulated.public());\n let scoped = build_children_rankings(scoped_content, parent);\n let components: Vec = scoped\n@@ -254,7 +254,9 @@ fn ingest_parse_error(raw: &str) -> Option {\n dsl::parse_full(raw).err().map(|e| e.to_string())\n }\n \n-fn load_events_from_jsonl(path: &Path) -> Result<(usize, Vec<(usize, Event)>, Vec), std::io::Error> {\n+type JsonlEventsLoad = Result<(usize, Vec<(usize, Event)>, Vec), std::io::Error>;\n+\n+fn load_events_from_jsonl(path: &Path) -> JsonlEventsLoad {\n let text = std::fs::read_to_string(path)?;\n let total_lines = text.lines().count();\n let mut events = Vec::new();\ndiff --git a/server/src/resolvers/github.rs b/server/src/resolvers/github.rs\nindex 30dd4cdac96de0e3da4fa03fdf82f91bed73bfe0..3cec5e8b7249a4597c378890cc9e6125104e76c3 100644\n--- a/server/src/resolvers/github.rs\n+++ b/server/src/resolvers/github.rs\n@@ -749,6 +749,6 @@ mod tests {\n GithubImportKind::Issue,\n );\n assert!(card.sublines.iter().any(|l| l.contains(\"@octo\")));\n- assert_eq!(card.excerpt.as_deref(), Some(\"The issue body.\").as_deref());\n+ assert_eq!(card.excerpt.as_deref(), Some(\"The issue body.\"));\n }\n }\ndiff --git a/server/tests/basic.rs b/server/tests/basic.rs\nindex 31a35251a8abd6f4a48c1d7782b6985f621375e1..9d83e7a97e2c7494790db17c4b5b30c181705026 100644\n--- a/server/tests/basic.rs\n+++ b/server/tests/basic.rs\n@@ -337,7 +337,7 @@ async fn event_log_handles_corrupt_lines() {\n .unwrap();\n \n // Add empty line.\n- writeln!(f, \"\").unwrap();\n+ writeln!(f).unwrap();\n \n let (loaded, bad) = log.load_all().await.unwrap();\n assert_eq!(loaded.len(), 2);\n@@ -511,9 +511,7 @@ fn dsl_parse_rejects_zero_zero_vote_ratio() {\n \"~/t/a {a}\\n~/t/b {b}\\n{zero}\\n~/t/a 0:0 ~/t/b\\n\",\n )\n .expect_err(\"0:0 vote must be rejected by the parser\");\n- let msg = match err {\n- slugsocial_server::dsl::DslError::Parse(m) => m,\n- };\n+ let slugsocial_server::dsl::DslError::Parse(msg) = err;\n assert!(\n msg.contains(\"0:0\"),\n \"expected message about invalid 0:0 ratio, got: {msg}\"\n@@ -904,7 +902,7 @@ fn posts_by_actor_indexes_and_profile_visibility() {\n fn feed_query(state: &ReducerState, cutoff: i64, limit: usize) -> (usize, Vec) {\n let matching: Vec<&str> = state.ingests_ordered.iter().rev()\n .map(|id| id.as_str())\n- .take_while(|id| state.ingests_by_id.get(*id).map_or(false, |ing| ing.ts > cutoff))\n+ .take_while(|id| state.ingests_by_id.get(*id).is_some_and(|ing| ing.ts > cutoff))\n .filter(|id| {\n state.ingests_by_id.get(*id).is_some_and(|ing| {\n let scope = slugsocial_server::reducer::scope_from_room_wire(&ing.room_id);\ndiff --git a/server/tests/integration_health.rs b/server/tests/integration_health.rs\nindex 481222d8c48c44fcfb7e9ba26cf7644b5c26d5f4..351aae6b0e9738021886a076ee08fab5cf5a0001 100644\n--- a/server/tests/integration_health.rs\n+++ b/server/tests/integration_health.rs\n@@ -7,7 +7,7 @@ async fn test_healthz() {\n let (addr, _tmp, _log, _handle) = create_test_server().await;\n let client = reqwest::Client::new();\n let response = client\n- .get(&format!(\"http://{}/healthz\", addr))\n+ .get(format!(\"http://{}/healthz\", addr))\n .send()\n .await\n .unwrap();\ndiff --git a/server/tests/integration_rpc.rs b/server/tests/integration_rpc.rs\nindex ccd89a02594bd2a8e7047edafca04b0e54384139..ec446d94a38c8d6961d2135dd031da7ab2a39b48 100644\n--- a/server/tests/integration_rpc.rs\n+++ b/server/tests/integration_rpc.rs\n@@ -440,7 +440,6 @@ async fn test_rank_history() {\n let bearer = test_bearer();\n let ingest = |delegate: &str, text: &str| {\n let client = client.clone();\n- let addr = addr;\n let bearer = bearer.clone();\n let text = text.to_string();\n let delegate = delegate.to_string();\ndiff --git a/server/tests/support/mod.rs b/server/tests/support/mod.rs\nindex 84dc1d68b6c1e1fdfdbd0757139c06c3daf1e9a6..4a620eaa875e7a1145f2a4e82cc4ff2be21d5345 100644\n--- a/server/tests/support/mod.rs\n+++ b/server/tests/support/mod.rs\n@@ -1,3 +1,6 @@\n+//! Shared helpers for integration tests; each test binary uses a different subset.\n+#![allow(dead_code)]\n+\n use sha2::{Digest, Sha256};\n use slugsocial_server::{\n event_log::EventLog,\ndiff --git a/types/src/paths.rs b/types/src/paths.rs\nindex ebc299c5e1af456c3e4b7fa45ed9fb23313e88c4..d2e799942b98dd7342764475deb17903fb60c600 100644\n--- a/types/src/paths.rs\n+++ b/types/src/paths.rs\n@@ -411,7 +411,7 @@ mod tests {\n #[test]\n fn garden_item_url_deref_to_str() {\n let g = GardenItemUrl::from_storage_str(\"https://slug.social/~/x\", \"public\");\n- let s: &str = &*g;\n+ let s: &str = &g;\n assert_eq!(s, \"https://slug.social/~/x\");\n }\n \n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[3bc88847] removed optional\n\nSide B — unified diff (full patch):\ndiff --git a/server/src/api/rpc.rs b/server/src/api/rpc.rs\nindex ba93ca87182d49f57dffc8220f604ffa150f9a6c..5049a26b096bd8435d6eb9e75ccb751b6f489061 100644\n--- a/server/src/api/rpc.rs\n+++ b/server/src/api/rpc.rs\n@@ -1337,8 +1337,7 @@ pub async fn handle_rpc_batch(\n .ingests_by_scope_thread\n .get(&(scope.clone(), e.thread.clone()))\n .and_then(|q| q.iter().rev().position(|id| id == &e.post_id))\n- .map(|i| i + 1)\n- .unwrap_or(0);\n+ .expect(\"rank history post_id must be in ingests_by_scope_thread for (scope, thread)\");\n RankHistoryRow {\n ts: e.ts,\n scope_rank: e.scope_rank,\ndiff --git a/server/src/html/garden.rs b/server/src/html/garden.rs\nindex 319feb15a6b68d2b5df98b4289fedbc9bdd048d3..23245d6fdfc9019b199ab8417150faf5f3297067 100644\n--- a/server/src/html/garden.rs\n+++ b/server/src/html/garden.rs\n@@ -450,6 +450,7 @@ struct RankHistoryEntryView {\n scope_total: usize,\n scope_rank_delta: i32,\n thread: String,\n+ /// 0-based index as [`crate::html::forum::ingest::thread_post_index_in_scope`] / `/t/tag/N`.\n thread_post_index: usize,\n caused_by: Vec,\n }\n@@ -573,11 +574,11 @@ fn build_rank_history(\n })\n .unwrap_or_default();\n \n- let thread_post_index = reduced.ingests_by_scope_thread\n+ let thread_post_index = reduced\n+ .ingests_by_scope_thread\n .get(&(scope.clone(), e.thread.clone()))\n .and_then(|q| q.iter().rev().position(|id| id == &e.post_id))\n- .map(|i| i + 1)\n- .unwrap_or(0);\n+ .expect(\"rank history post_id must be in ingests_by_scope_thread for (scope, thread)\");\n \n RankHistoryEntryView {\n ts: e.ts,\n@@ -704,11 +705,9 @@ async fn render_scope_view(\n span class=\"muted\" { (ago) (label) }\n \" · \"\n a href=(thread_href(&e.thread)) { \"#\" (e.thread) }\n- @if e.thread_post_index > 0 {\n- \" \"\n- a href=(format!(\"{}/{}\", thread_href(&e.thread), e.thread_post_index)) {\n- span class=\"muted\" { \"post #\" (e.thread_post_index) }\n- }\n+ \" \"\n+ a href=(format!(\"{}/{}\", thread_href(&e.thread), e.thread_post_index)) {\n+ span class=\"muted\" { \"post #\" (e.thread_post_index) }\n }\n }\n @if e.caused_by.is_empty() {\ndiff --git a/server/tests/integration.rs b/server/tests/integration.rs\nindex d4c5bfe9c6f1c71dc61878bd8c5e729b1b7c69ef..9766adb43ad315a64f5df17b79f66718ce149509 100644\n--- a/server/tests/integration.rs\n+++ b/server/tests/integration.rs\n@@ -1322,6 +1322,11 @@ async fn test_rank_history() {\n assert_eq!(entry[\"scope_rank_delta\"], 0, \"delta is 0 on first appearance\");\n let caused_by = entry[\"caused_by\"].as_array().unwrap();\n assert_eq!(caused_by.len(), 2, \"both votes in the ingest touched rust\");\n+ assert_eq!(\n+ entry[\"thread_post_index\"],\n+ 0,\n+ \"rank history links use same 0-based index as /t/hist-test/0\"\n+ );\n \n ingest(\n \"00000000-0000-0000-0000-000000000002:rig:test/model\",\n@@ -1349,6 +1354,16 @@ async fn test_rank_history() {\n assert_eq!(caused_by2.len(), 1);\n assert!(caused_by2[0][\"a\"].as_str().unwrap().ends_with(\"python\") ||\n caused_by2[0][\"b\"].as_str().unwrap().ends_with(\"python\"));\n+ assert_eq!(\n+ hist2[0][\"thread_post_index\"],\n+ 0,\n+ \"first hist-test post is chronological index 0\"\n+ );\n+ assert_eq!(\n+ hist2[1][\"thread_post_index\"],\n+ 1,\n+ \"second ingest is chronological index 1\"\n+ );\n \n let hist_rust2 = rpc_batch(\n &client,\ndiff --git a/types/src/lib.rs b/types/src/lib.rs\nindex edbb923e4d7d41ad82dfc254c3bd697562383527..49abba8ea9f786ef68e3157d2a5d309e15e09ba0 100644\n--- a/types/src/lib.rs\n+++ b/types/src/lib.rs\n@@ -253,7 +253,7 @@ pub struct FeedPost {\n /// Primary thread tag (without #), if the ingest declared one.\n #[serde(skip_serializing_if = \"Option::is_none\")]\n pub thread: Option,\n- /// 1-indexed chronological position of this post within the thread.\n+ /// 1-based display ordinal for this post within the thread (feed only; URLs use 0-based paths).\n #[serde(skip_serializing_if = \"Option::is_none\")]\n pub thread_post_index: Option,\n /// Full raw body of the ingest document.\n@@ -628,7 +628,7 @@ pub struct RankHistoryRow {\n pub score: f64,\n /// Thread tag of the ingest that triggered this rank change.\n pub thread: String,\n- /// 1-indexed chronological position of this post within the thread.\n+ /// 0-indexed chronological position of this post within the thread (same as `/t/tag/N` routes).\n pub thread_post_index: usize,\n /// Votes from this ingest that directly touched this item. Empty when change was transitive.\n pub caused_by: Vec,\n","role":"user"}],"model":"~anthropic/claude-sonnet-latest"}