{"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[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 A — 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\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[30a67104] fixes\n\nSide B — unified diff (full patch):\ndiff --git a/agents.md b/agents.md\nindex a6a283716e09fcaba1fd690f4e877e0bbecda2c0..d9a924d2f77c444d9b112bbf37a480b963ace4f0 100644\n--- a/agents.md\n+++ b/agents.md\n@@ -39,7 +39,7 @@ Strict **CSP** that blocks `eval` would break the current app. Other projects ma\n \n - **`VoteComparePost`:** On success returns **`text/javascript`** that **morphs** **`#vote-compare-preview`** (new ingest card) and **`#vote-edge-history-region`** (recomputed edge list). Uses **`RpcResult::PostOk`**’s **`post_id`** / **`post_index`** for the card. **`__rpc__`** carries **`form_action: \"/ui\"`**; **`thread_tag`** and ratio fields come from the same form as **`$form`** holes.\n \n-- **Garden pin / compare voting:** Cookie **`slug_garden_pin`** via **`set_garden_pin`**. Pairwise UI: **`GET /vote/compare?…`** / **`GET /r/:room_key/vote/compare?…`**. HUD: **`#slug-pin-hud`** when **`layout`** passes garden metadata on **`body`**.\n+- **Garden pin / compare voting:** Cookie **`slug_garden_pin`** via **`set_garden_pin`**. Pairwise UI: **`GET /vote/compare?…`** / **`GET /r/:room_key/vote/compare?…`**. HUD: **`#slug-pin-hud`** when **`layout`** passes garden metadata on **`body`**; the label is **`POST /ui`** **`set_garden_pin`** **`clear:true`** (**`slug_ui.js`**), not a permalink to the item.\n \n **Rule of thumb:** New **CLI or API** verbs → `RpcCommand`. New **in-page morph or form-driven** behavior that only makes sense in the browser → `HtmlUiAction`. If both need the same operation, implement the real work once (e.g. call shared RPC helpers from `post_ui_html`) and keep the wire shapes separate.\n \ndiff --git a/server/src/html/garden.rs b/server/src/html/garden.rs\nindex 8a46b1e92d38f2c390f88d48750d95d11388cd73..121d9498e8cb93d4d001dc1bbce23d74fbb958f5 100644\n--- a/server/src/html/garden.rs\n+++ b/server/src/html/garden.rs\n@@ -16,7 +16,6 @@ use crate::{\n canonical_path::{canonicalize_item, canonicalize_tag},\n form_template::template_json_compact,\n html::{\n- forum::ingest_entry_markup,\n ui_action::UI_RPC_FIELD,\n user_can_post_room,\n JsBuilder,\n@@ -111,6 +110,23 @@ fn votes_for_edge(content: &ContentState, a: &ItemId, b: &ItemId) -> Vec usize {\n+ let (lo, hi) = canonical_edge_items(a, b);\n+ let lo_s = lo.as_str();\n+ let hi_s = hi.as_str();\n+ content\n+ .item_votes\n+ .get(&lo)\n+ .into_iter()\n+ .flat_map(|q| q.iter())\n+ .filter(|v| {\n+ (v.a.as_str() == lo_s && v.b.as_str() == hi_s)\n+ || (v.a.as_str() == hi_s && v.b.as_str() == lo_s)\n+ })\n+ .count()\n+}\n+\n fn vote_thread_tags_for_pair(content: &ContentState, a: &ItemId, b: &ItemId) -> Vec {\n let set: HashSet = content\n .item_threads\n@@ -288,6 +304,7 @@ fn child_row_pin_or_vote(\n nav: &ThreadNav,\n row_item: &ItemId,\n pinned_room_and_item: Option<&(String, ItemId)>,\n+ scope_content: &ContentState,\n next_path: &str,\n ) -> maud::Markup {\n let pin_matches_scope = pinned_room_and_item\n@@ -315,7 +332,16 @@ fn child_row_pin_or_vote(\n @if pi == row_item {\n span class=\"ont-garden-pinned-here\" title=\"Pinned\" aria-label=\"Pinned\" { \"📌\" }\n } @else {\n- a class=\"ont-garden-vote-ico\" href=(vote_compare_href(nav, pi, row_item, None)) title=\"Vote vs pinned\" aria-label=\"Vote\" { \"⚖\" }\n+ @let nv = edge_vote_count_for_pair(scope_content, pi, row_item);\n+ @let tip = format!(\n+ \"Compare and vote — {nv} pairwise vote{} in this scope for pinned vs this row\",\n+ if nv == 1 { \"\" } else { \"s\" },\n+ );\n+ @let aria = format!(\"Vote; {} pairwise {}\", nv, if nv == 1 { \"vote\" } else { \"votes\" });\n+ a class=\"ont-garden-vote-ico\" href=(vote_compare_href(nav, pi, row_item, None)) title=(tip) aria-label=(aria) {\n+ span class=\"ont-garden-vote-glyph\" aria-hidden=\"true\" { \"⚖\" }\n+ span class=\"ont-garden-vote-count\" { (format!(\"{}\", nv)) }\n+ }\n }\n } @else {\n form method=\"POST\" action=\"/ui\" data-navigate=\"full\" class=\"ont-pin-form ont-garden-pin-form\" {\n@@ -978,10 +1004,9 @@ async fn render_scope_view(\n ) -> axum::response::Response {\n let scope = nav.scope();\n let pin_ref = pinned_item_from_jar(&jar);\n- let model = {\n- let reduced = state.reduced.read().await;\n- build_item_page_view_model(&reduced, &scope, browse.item())\n- };\n+ let reduced = state.reduced.read().await;\n+ let model = build_item_page_view_model(&reduced, &scope, browse.item());\n+ let scope_content = content_for_garden_view(&reduced, &scope);\n let thread_href = |tag: &str| nav.thread_url(tag);\n let external_empty_body = browse.is_external() && model.body.is_none();\n let cli_path_arg = item_display_path(&model.item);\n@@ -1108,7 +1133,7 @@ async fn render_scope_view(\n @let item_url = item_href(r.item.as_str(), &nav);\n @let score_str = format!(\"{:.3}\", r.score);\n li data-garden-item=(r.item.as_str()) {\n- (child_row_pin_or_vote(&nav, &r.item, pin_ref.as_ref(), &next_for_pin))\n+ (child_row_pin_or_vote(&nav, &r.item, pin_ref.as_ref(), scope_content, &next_for_pin))\n a class=\"item-link\" href=(item_url) { code { (item_display_path(r.item.as_str())) } }\n span class=\"ont-rank-score\" { (score_str) }\n }\n@@ -1124,7 +1149,7 @@ async fn render_scope_view(\n ul class=\"ont-group-list\" {\n @for name in &model.child_rankings.unranked_items {\n li data-garden-item=(name.as_str()) {\n- (child_row_pin_or_vote(&nav, name, pin_ref.as_ref(), &next_for_pin))\n+ (child_row_pin_or_vote(&nav, name, pin_ref.as_ref(), scope_content, &next_for_pin))\n @let href = item_href(name.as_str(), &nav);\n a class=\"item-link\" href=(href) { code { (item_display_path(name.as_str())) } }\n }\n@@ -1363,6 +1388,33 @@ mod tests {\n }));\n }\n \n+ #[test]\n+ fn edge_vote_count_for_pair_matches_votes_for_edge_len() {\n+ use super::{\n+ content_for_garden_view, edge_vote_count_for_pair, votes_for_edge,\n+ };\n+ use crate::path_types::ItemId;\n+ let mut reduced = ReducerState::default();\n+ apply_ingest(\n+ &mut reduced,\n+ 1,\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n\\\n+ ~/topic {root}\\n\\\n+ ~/topic/a {alpha}\\n\\\n+ ~/topic/b {beta}\\n\\\n+ ~/topic/a 3:2 ~/topic/b {first vote}\\n\\\n+ ~/topic/b 2:3 ~/topic/a {second vote}\\n\",\n+ );\n+ let content = content_for_garden_view(&reduced, &ScopeId::Public);\n+ let a = ItemId::parse(\"~/topic/a\").unwrap().normalized_storage();\n+ let b = ItemId::parse(\"~/topic/b\").unwrap().normalized_storage();\n+ assert_eq!(\n+ edge_vote_count_for_pair(content, &a, &b),\n+ votes_for_edge(content, &a, &b).len()\n+ );\n+ assert_eq!(votes_for_edge(content, &a, &b).len(), 2);\n+ }\n+\n #[test]\n fn item_page_model_includes_body_and_unranked_without_votes() {\n let mut reduced = ReducerState::default();\ndiff --git a/server/static/slug_ui.js b/server/static/slug_ui.js\nindex c0de1cddbba78227dfb80bfd41e7b855b3a42bc3..86f935f8dd998f3d6df016f33b1e47f9780782ea 100644\n--- a/server/static/slug_ui.js\n+++ b/server/static/slug_ui.js\n@@ -170,15 +170,6 @@\n return { room: raw.slice(0, i), item: raw.slice(i + 1) };\n }\n \n- function gardenItemHref(prefix, storageUrl) {\n- var marker = 'https://slug.social/~/';\n- if (storageUrl.indexOf(marker) === 0) {\n- var tail = storageUrl.slice(marker.length);\n- return prefix.replace(/\\/$/, '') + (tail ? '/' + tail : '');\n- }\n- return storageUrl;\n- }\n-\n function refreshPinHud() {\n var hud = document.getElementById('slug-pin-hud');\n if (!hud) return;\n@@ -187,19 +178,37 @@\n var pin = decodePinCookie();\n hud.innerHTML = '';\n if (!pin || !prefix || pin.room !== bodyRoom) return;\n- var a = document.createElement('a');\n- a.className = 'slug-pin-hud-link';\n- a.href = gardenItemHref(prefix, pin.item);\n- a.title = 'Pinned item';\n+ var form = document.createElement('form');\n+ form.method = 'POST';\n+ form.action = '/ui';\n+ form.setAttribute('data-navigate', 'full');\n+ form.className = 'slug-pin-hud-form';\n+ var rpc = document.createElement('input');\n+ rpc.type = 'hidden';\n+ rpc.name = '__rpc__';\n+ rpc.value = JSON.stringify({\n+ action: 'set_garden_pin',\n+ clear: true,\n+ room_wire: '',\n+ next: window.location.pathname + window.location.search,\n+ form_action: '/ui',\n+ });\n+ form.appendChild(rpc);\n+ var btn = document.createElement('button');\n+ btn.type = 'submit';\n+ btn.className = 'slug-pin-hud-link slug-pin-hud-unpin-btn';\n+ btn.title = 'Unpin — removes this item from the corner HUD';\n+ btn.setAttribute('aria-label', 'Unpin pinned item');\n var span = document.createElement('span');\n span.className = 'slug-pin-hud-glyph';\n span.setAttribute('aria-hidden', 'true');\n span.textContent = '📌';\n- a.appendChild(span);\n+ btn.appendChild(span);\n var label = pin.item.replace(/^https:\\/\\/slug\\.social\\/~\\/?/, '~/');\n if (label.length > 36) label = label.slice(0, 34) + '…';\n- a.appendChild(document.createTextNode(' ' + label));\n- hud.appendChild(a);\n+ btn.appendChild(document.createTextNode(' ' + label));\n+ form.appendChild(btn);\n+ hud.appendChild(form);\n }\n refreshPinHud();\n \ndiff --git a/server/static/theme_default.css b/server/static/theme_default.css\nindex ec0fbe7acee0aa2802f978f14a9b0fc86e78c5b8..9178f0629cfb868348740e6dea1626dc6afb8345 100644\n--- a/server/static/theme_default.css\n+++ b/server/static/theme_default.css\n@@ -799,6 +799,12 @@ details > summary::-webkit-details-marker { display: none; }\n }\n \n /* Pinned item HUD — bottom bar, same plane as spread */\n+.slug-pin-hud-form {\n+ display: inline;\n+ margin: 0;\n+ padding: 0;\n+ border: none;\n+}\n #slug-pin-hud.slug-pin-hud {\n margin-left: auto;\n max-width: min(42vw, 280px);\n@@ -808,6 +814,13 @@ details > summary::-webkit-details-marker { display: none; }\n overflow: hidden;\n text-overflow: ellipsis;\n }\n+.slug-pin-hud-link.slug-pin-hud-unpin-btn {\n+ background: transparent;\n+ border: none;\n+ cursor: pointer;\n+ font-size: inherit;\n+ font-family: inherit;\n+}\n .slug-pin-hud-link {\n color: var(--ui);\n text-decoration: none;\n@@ -815,7 +828,10 @@ details > summary::-webkit-details-marker { display: none; }\n align-items: center;\n gap: 4px;\n }\n-.slug-pin-hud-link:hover { color: var(--signal); }\n+.slug-pin-hud-link:hover,\n+.slug-pin-hud-unpin-btn:hover {\n+ color: var(--signal);\n+}\n .slug-pin-hud-glyph { font-size: 13px; line-height: 1; }\n \n /* Garden pin / vote controls */\n@@ -890,10 +906,21 @@ span.ont-garden-pinned-here {\n align-items: center;\n justify-content: center;\n }\n+a.ont-garden-vote-ico {\n+ gap: 4px;\n+}\n a.ont-garden-vote-ico:hover {\n color: var(--signal);\n background: var(--g4);\n }\n+.ont-garden-vote-count {\n+ font-size: 10px;\n+ font-weight: 700;\n+ font-variant-numeric: tabular-nums;\n+}\n+span.ont-garden-vote-glyph {\n+ line-height: 1;\n+}\n span.ont-garden-pinned-here {\n border-color: var(--link);\n color: var(--signal);\ndiff --git a/server/static/theme_retro_craft.css b/server/static/theme_retro_craft.css\nindex 092d4b3540b052cc86870179e4c264541c4446cc..efaeed06d01fd835df0621f4c621c8f034c8b536 100644\n--- a/server/static/theme_retro_craft.css\n+++ b/server/static/theme_retro_craft.css\n@@ -593,6 +593,12 @@ body.view-ontology #controls {\n (Global craft `code` + `button[type=submit]` are tuned for dark\n thread pages; these overrides match the cream ontology shell.)\n ---------------------------------------------------------------- */\n+body.view-ontology .slug-pin-hud-form {\n+ display: inline;\n+ margin: 0;\n+ padding: 0;\n+ border: none;\n+}\n body.view-ontology #slug-pin-hud.slug-pin-hud {\n margin-left: auto;\n max-width: min(42vw, 280px);\n@@ -603,6 +609,14 @@ body.view-ontology #slug-pin-hud.slug-pin-hud {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n+body.view-ontology .slug-pin-hud-link.slug-pin-hud-unpin-btn {\n+ background: transparent;\n+ border: none;\n+ cursor: pointer;\n+ font-size: inherit;\n+ font-family: inherit;\n+ padding: 0;\n+}\n body.view-ontology .slug-pin-hud-link {\n color: #1a4a8c;\n text-decoration: none;\n@@ -610,7 +624,8 @@ body.view-ontology .slug-pin-hud-link {\n align-items: center;\n gap: 0.25rem;\n }\n-body.view-ontology .slug-pin-hud-link:hover {\n+body.view-ontology .slug-pin-hud-link:hover,\n+body.view-ontology .slug-pin-hud-unpin-btn:hover {\n color: #0d3d82;\n text-decoration: underline;\n }\n@@ -676,6 +691,20 @@ body.view-ontology .ont-garden-child-actions {\n gap: 0.1rem;\n }\n body.view-ontology button.ont-garden-pin-ico,\n+body.view-ontology a.ont-garden-vote-ico {\n+ gap: 0.2rem;\n+}\n+body.view-ontology .ont-garden-vote-count {\n+ font-size: 0.65rem;\n+ font-family: var(--font-ui);\n+ font-weight: 600;\n+ font-variant-numeric: tabular-nums;\n+ opacity: 0.92;\n+}\n+body.view-ontology span.ont-garden-vote-glyph {\n+ line-height: 1;\n+}\n+body.view-ontology button.ont-garden-pin-ico,\n body.view-ontology a.ont-garden-vote-ico,\n body.view-ontology span.ont-garden-pinned-here {\n font-size: 0.95rem;\ndiff --git a/test/browser_garden_pin.clj b/test/browser_garden_pin.clj\nindex 169ff9b6913049094611fb0e5b6683b30220b285..98c086d5647207f3ac72dbb9cbc13488c030eef1 100644\n--- a/test/browser_garden_pin.clj\n+++ b/test/browser_garden_pin.clj\n@@ -21,6 +21,17 @@\n (do (Thread/sleep 200) (recur))\n false))))))\n \n+(defn- wait-for-absence-substr [pg selector substr timeout-ms]\n+ \"True once selector text does not contain substr (or is empty), or timeout.\"\n+ (let [deadline (+ (System/currentTimeMillis) timeout-ms)]\n+ (loop []\n+ (let [text (locator/text-content (page/locator pg selector))]\n+ (if (not (and (string? text) (str/includes? text substr)))\n+ true\n+ (if (< (System/currentTimeMillis) deadline)\n+ (do (Thread/sleep 200) (recur))\n+ false))))))\n+\n (defn garden-pin-flow! []\n (println \"\\n━━━ browser garden pin (POST /ui set_garden_pin + HUD + vote link) ━━━\\n\")\n \n@@ -75,8 +86,14 @@\n (is (wait-for-text pg \".ont-item-shell\" \"~/gp-pin-b\" 15000) \"on item b page\")\n (is (wait-for-text pg \"a.ont-vote-compare-btn\" \"vote\" 10000)\n \"vote link visible vs pinned item\")\n+ ;; HUD clears pin (POST set_garden_pin clear), not navigate to item\n+ (locator/click (page/locator pg \"#slug-pin-hud button.slug-pin-hud-unpin-btn\"))\n+ (is (wait-for-absence-substr pg \"#slug-pin-hud\" \"gp-pin-a\" 15000)\n+ \"HUD clears after unpin from HUD button\")\n+ (is (wait-for-absence-substr pg \"body\" \"ont-vote-compare-btn\" 15000)\n+ \"compare vote CTA removed after HUD unpin on same reload\")\n (is (str/includes? (or (page/url pg) \"\") \"/~/gp-pin-b\")\n- \"still on item b after vote link check\"))))))\n+ \"still on item b after HUD unpin\"))))))\n \n (finally\n (when-some [s @!server] (common/kill-server s))\n","role":"user"}],"model":"~x-ai/grok-latest"}