{"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[8dab9b80] nice\n\nSide A — unified diff (full patch):\ndiff --git a/server/src/fetch/html.rs b/server/src/fetch/html.rs\nindex 3e0309ff1c2ac1b17923922d2340ba6710e0f9d1..dadf050515f0473943dad97df5d318032c8cb385 100644\n--- a/server/src/fetch/html.rs\n+++ b/server/src/fetch/html.rs\n@@ -10,13 +10,18 @@ use crate::{\n ui_action::UI_RPC_FIELD,\n };\n \n-fn entity_panel(node: &NodeState) -> Markup {\n+/// CSS selector for Idiomorph / SSE updates of one entity block.\n+pub fn entity_section_selector(item: &ItemId) -> String {\n+ format!(r#\"[data-entity-section=\"{}\"]\"#, item.as_str())\n+}\n+\n+pub fn entity_panel(node: &NodeState) -> Markup {\n if let Some(markup) = crate::render::reddit::entity_markup(node) {\n return markup;\n }\n html! {\n @if let Some(data) = &node.data {\n- div id=\"entity-panel\" class=\"entity-card\" {\n+ div class=\"entity-card\" {\n h2 { (data.title) }\n @if let Some(author) = &data.author {\n p class=\"muted small\" { \"by \" (author) }\n@@ -76,11 +81,11 @@ pub fn fetch_entity_panel(item: &ItemId, has_data: bool, fetching: bool) -> Mark\n }\n }\n \n-/// Entity card + fetch control (target `#entity-section` for Idiomorph / SSE).\n+/// Entity card + fetch control (morph target [`entity_section_selector`]).\n pub fn entity_section(item: &ItemId, node: &NodeState, fetching: bool) -> Markup {\n let has_data = node.data.is_some();\n html! {\n- section id=\"entity-section\" class=\"demo-panel\" {\n+ section class=\"entity-section demo-panel\" data-entity-section=(item.as_str()) {\n (entity_panel(node))\n (fetch_entity_panel(item, has_data, fetching))\n }\ndiff --git a/server/src/fetch/mod.rs b/server/src/fetch/mod.rs\nindex 35f968c21c69ca557bab7951413e3cfbbccfebfd..f5759a34a1afe4069805441cefde6474a6403550 100644\n--- a/server/src/fetch/mod.rs\n+++ b/server/src/fetch/mod.rs\n@@ -77,8 +77,9 @@ pub fn fetch_entity_stream(\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, true))\n+ .morph_selector(&sel, html::entity_section(&id, node, true))\n .build()\n };\n yield Ok(js_event(fetching_js));\n@@ -100,12 +101,13 @@ pub fn fetch_entity_stream(\n FetchJobResult::Imported(_)\n | FetchJobResult::NotFound\n | FetchJobResult::SkippedCached\n- | FetchJobResult::SkippedDuplicate => {\n+ | FetchJobResult::SkippedDuplicate => {\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n let mut b = JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, false));\n+ .morph_selector(&sel, html::entity_section(&id, node, false));\n if kind == FetchKind::Children {\n b = b.morph_selector(\"#ranking-panel\", ranking_panel(&id, node, &tree));\n }\n@@ -115,8 +117,9 @@ pub fn fetch_entity_stream(\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n let js = JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, false))\n+ .morph_selector(&sel, html::entity_section(&id, node, false))\n .raw(&error_js(&format!(\"Reddit rate limit — retry in {reset_secs}s.\")))\n .build();\n yield Ok(js_event(js));\n@@ -125,8 +128,9 @@ pub fn fetch_entity_stream(\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n let js = JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, false))\n+ .morph_selector(&sel, html::entity_section(&id, node, false))\n .raw(&error_js(&format!(\"Fetch failed: {msg}\")))\n .build();\n yield Ok(js_event(js));\ndiff --git a/server/src/html/vote.rs b/server/src/html/vote.rs\nindex 89ed621ad861214e147add2062224fc4137ff8ad..48752f4d78d4762d1badc44e8df008bf5a45bab4 100644\n--- a/server/src/html/vote.rs\n+++ b/server/src/html/vote.rs\n@@ -8,6 +8,7 @@ use maud::{html, Markup};\n use serde::Deserialize;\n \n use crate::{\n+ fetch::html::entity_section,\n form_template::template_json_compact,\n html::JsBuilder,\n pair::{children_of, resolve_pair, suggest_next_pair_in_pool},\n@@ -169,37 +170,13 @@ pub(crate) fn vote_recorded_morph(\n }\n \n fn vote_compare_item_card(tree: &GlobalTree, item: &ItemId, side_class: &str) -> Markup {\n- let href = item_href(item);\n- let title = child_title(tree, item);\n+ let node = tree.get(item).cloned().unwrap_or_else(|| NodeState {\n+ id: item.clone(),\n+ ..Default::default()\n+ });\n html! {\n div class=(format!(\"vote-compare-side {side_class}\")) {\n- a class=(format!(\"vote-compare-item {side_class}\")) href=(href) {\n- @if let Some(row) = crate::render::reddit::child_row_markup(tree, item, &href) {\n- (row)\n- } @else {\n- strong { (title) }\n- }\n- }\n- @if let Some(node) = tree.get(item) {\n- @if crate::render::reddit::is_reddit_post(item) {\n- @if let Some(data) = &node.data {\n- @if let Some(src) = data.image_url.as_ref().or(data.thumb_url.as_ref()) {\n- figure class=\"vote-compare-figure\" {\n- img class=\"vote-compare-image\" src=(src) alt=\"\" loading=\"lazy\";\n- }\n- }\n- @if let Some(author) = &data.author {\n- p class=\"muted small\" { \"by \" (author) }\n- }\n- }\n- } @else if let Some(data) = &node.data {\n- @if let Some(body) = &data.body_html {\n- div class=\"vote-compare-item-body\" {\n- (maud::PreEscaped(body))\n- }\n- }\n- }\n- }\n+ (entity_section(item, &node, false))\n }\n }\n }\n@@ -270,9 +247,6 @@ pub async fn vote_page(\n (vote_compare_item_card(&tree, &right, \"vote-compare-right\"))\n }\n (vote_back_nav(&parent))\n- div id=\"vote-edge-history-region\" {\n- (edge_history)\n- }\n form id=\"vote-compare-form\" method=\"POST\" action=\"/ui\" {\n input type=\"hidden\" name=(UI_RPC_FIELD) value=(rpc_json);\n input type=\"hidden\" name=\"ratio_left\" id=\"vote-ratio-left\" value=\"50\";\n@@ -285,6 +259,9 @@ pub async fn vote_page(\n }\n (vote_compare_actions(&parent, next_pair.as_ref()))\n }\n+ div id=\"vote-edge-history-region\" {\n+ (edge_history)\n+ }\n }\n };\n \ndiff --git a/server/src/render/reddit.rs b/server/src/render/reddit.rs\nindex 4a18de93cf57d8395ded3caa373a708f39b3f43f..c4f98fc760c32ce1b41a91bd41e97908bd198937 100644\n--- a/server/src/render/reddit.rs\n+++ b/server/src/render/reddit.rs\n@@ -11,7 +11,7 @@ pub fn is_reddit_post(id: &ItemId) -> bool {\n id.as_str().starts_with(\"reddit.com/\") && id.as_str().contains(\"/comments/\")\n }\n \n-/// Post detail card (`#entity-panel`).\n+/// Post detail card (inside [`crate::fetch::html::entity_panel`]).\n pub fn entity_markup(node: &NodeState) -> Option {\n if !is_reddit_post(&node.id) {\n return None;\n@@ -41,7 +41,7 @@ pub fn child_row_markup(tree: &GlobalTree, id: &ItemId, href: &str) -> Option Markup {\n let image = data.image_url.as_ref().or(data.thumb_url.as_ref());\n html! {\n- div id=\"entity-panel\" class=\"entity-card reddit-post\" {\n+ div class=\"entity-card reddit-post\" {\n h2 { (data.title) }\n @if let Some(author) = &data.author {\n p class=\"muted small\" { \"by \" (author) }\ndiff --git a/server/static/sorter.css b/server/static/sorter.css\nindex b95718ce463b200a5667d3014dac2119836a0bef..9379c5f41dedbd41fd8951099a118de1da2a62f4 100644\n--- a/server/static/sorter.css\n+++ b/server/static/sorter.css\n@@ -254,38 +254,11 @@ h1 {\n }\n \n .vote-compare-side {\n- background: var(--panel);\n- border: 1px solid var(--border);\n- border-radius: 8px;\n- padding: 1rem;\n min-height: 120px;\n }\n \n-.vote-compare-item {\n- color: var(--accent);\n- text-decoration: none;\n- display: block;\n-}\n-\n-.vote-compare-item:hover {\n- text-decoration: underline;\n-}\n-\n-.vote-compare-figure {\n- margin: 0.75rem 0 0;\n-}\n-\n-.vote-compare-image {\n- display: block;\n- max-width: 100%;\n- height: auto;\n- border-radius: 6px;\n- border: 1px solid var(--border);\n-}\n-\n-.vote-compare-item-body {\n- margin-top: 0.75rem;\n- font-size: 0.9rem;\n+.vote-compare-side .entity-section {\n+ margin: 0;\n }\n \n .vote-compare-nav {\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[047b82bd] Remove redundant zero-ratio guard from reducer.\n\nZeros are already rejected at the DSL parser and browser handler;\nthe guard in apply_vote was dead code. The negative clamping stays\nsince add_edge_weight already skips weight-0 edges correctly.\n\nCo-Authored-By: Claude Sonnet 4.6 \n\nSide B — unified diff (full patch):\ndiff --git a/server/src/reducer.rs b/server/src/reducer.rs\nindex 0e36979abe0f051493038ff7e652efc7f7a0ac80..efbf7f67ff24c7a2989102fe62879b2794a27c5f 100644\n--- a/server/src/reducer.rs\n+++ b/server/src/reducer.rs\n@@ -112,11 +112,6 @@ impl GroupState {\n if vote.ratio_right < 0 {\n vote.ratio_right = 0;\n }\n- if vote.ratio_left == 0 || vote.ratio_right == 0 {\n- // Zero on either side produces no valid edge; drop before registering items or pair.\n- return;\n- }\n-\n let a_idx = self.ensure_item(&vote.a);\n let b_idx = self.ensure_item(&vote.b);\n \ndiff --git a/server/tests/basic.rs b/server/tests/basic.rs\nindex 08159f4a7f0850fd165817a4a1af4f31ced2ad76..1748769ccf7196b2d81cf556d5368c7e723f6a4e 100644\n--- a/server/tests/basic.rs\n+++ b/server/tests/basic.rs\n@@ -533,7 +533,7 @@ fn dsl_parse_rejects_zero_zero_vote_ratio() {\n #[test]\n fn reducer_negative_ratio_clamped_to_zero() {\n let _state = ReducerState::default();\n- // GroupState::apply_vote clamps negatives to 0; when either side is 0 the vote is dropped.\n+ // apply_vote clamps negatives to 0; add_edge_weight skips zero-weight edges.\n let mut group = GroupState::new();\n group.apply_vote(slugsocial_server::reducer::VoteData {\n ts: 1,\n@@ -546,10 +546,9 @@ fn reducer_negative_ratio_clamped_to_zero() {\n delegate: Some(\"00000000-0000-0000-0000-000000000000:test:local/test\".to_string()),\n thread_tag: \"t\".to_string(),\n });\n- // Nothing registered: zero-clamped vote is dropped before ensure_item.\n- assert!(group.idx_to_item.is_empty());\n+ // Items and pair are registered; edges are absent because weight 0 is skipped.\n+ assert_eq!(group.idx_to_item.len(), 2);\n assert!(group.edges.is_empty());\n- assert!(group.voted_pairs.is_empty());\n }\n \n \n","role":"user"}],"model":"~x-ai/grok-latest"}