{"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[02cd761c] Make ranked child group pin icons clickable to unpin.\n\nLets users clear the garden pin from the ranked child groups list via the same POST /ui set_garden_pin flow as the HUD and item header.\n\nCo-authored-by: Cursor \n\nSide A — unified diff (full patch):\ndiff --git a/server/src/html/garden/pin.rs b/server/src/html/garden/pin.rs\nindex 1820d7fe7ee167ecbf5ad5124f23b2ab92ffb01f..b7ea92bbe67d6d499915edb607a3a0b36178d7f6 100644\n--- a/server/src/html/garden/pin.rs\n+++ b/server/src/html/garden/pin.rs\n@@ -101,6 +101,7 @@ pub(super) fn child_row_pin_or_vote(\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 .map(|(r, _)| r == nav.room_wire.as_str())\n@@ -108,12 +109,25 @@ pub(super) fn child_row_pin_or_vote(\n let pinned_item = pinned_room_and_item\n .filter(|_| pin_matches_scope)\n .map(|(_, i)| i);\n+ let unpin_rpc = template_json_compact(&json!({\n+ \"action\": \"set_garden_pin\",\n+ \"clear\": true,\n+ \"room_wire\": \"\",\n+ \"next\": next_path,\n+ \"form_action\": \"/ui\",\n+ }))\n+ .expect(\"unpin rpc json\");\n \n html! {\n @if let Some(pi) = pinned_item {\n span class=\"ont-garden-child-actions\" data-garden-room=(nav.room_wire.as_str()) {\n @if pi == row_item {\n- span class=\"ont-garden-pinned-here\" title=\"Pinned\" aria-label=\"Pinned\" { \"📌\" }\n+ form method=\"POST\" action=\"/ui\" data-navigate=\"full\" class=\"ont-garden-pin-form\" {\n+ input type=\"hidden\" name=(UI_RPC_FIELD) value=(unpin_rpc);\n+ button type=\"submit\" class=\"ont-garden-pin-ico ont-garden-pin-ico-active\" title=\"Unpin\" aria-label=\"Unpin from HUD\" {\n+ span class=\"ont-garden-pin-glyph\" aria-hidden=\"true\" { \"📌\" }\n+ }\n+ }\n } @else {\n @let nv = edge_vote_count_for_pair(scope_content, pi, row_item);\n @let tip = format!(\ndiff --git a/server/src/html/garden/render.rs b/server/src/html/garden/render.rs\nindex bd8cbce059ee789de6e8dc9b6f69f54beee2f994..7bfaadc0786b734db8973c53b82296a188d26e22 100644\n--- a/server/src/html/garden/render.rs\n+++ b/server/src/html/garden/render.rs\n@@ -216,7 +216,7 @@ pub(super) 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(), scope_content))\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@@ -232,7 +232,7 @@ pub(super) 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(), scope_content))\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 }\ndiff --git a/server/static/theme_default.css b/server/static/theme_default.css\nindex 2dabf3a7094cecd89d0c9674d27efe30cd01c010..b846ab86cb6eb5fb56be87efb054fb8b18082583 100644\n--- a/server/static/theme_default.css\n+++ b/server/static/theme_default.css\n@@ -891,8 +891,7 @@ button.ont-pin-btn-active {\n vertical-align: middle;\n }\n button.ont-garden-pin-ico,\n-a.ont-garden-vote-ico,\n-span.ont-garden-pinned-here {\n+a.ont-garden-vote-ico {\n font-size: 13px;\n line-height: 1;\n padding: 2px 6px;\n@@ -910,6 +909,11 @@ span.ont-garden-pinned-here {\n align-items: center;\n justify-content: center;\n }\n+form.ont-garden-pin-form {\n+ display: inline;\n+ margin: 0;\n+ padding: 0;\n+}\n a.ont-garden-vote-ico {\n gap: 4px;\n }\n@@ -925,10 +929,14 @@ a.ont-garden-vote-ico:hover {\n span.ont-garden-vote-glyph {\n line-height: 1;\n }\n-span.ont-garden-pinned-here {\n+button.ont-garden-pin-ico-active {\n border-color: var(--link);\n color: var(--signal);\n- cursor: default;\n+ background: color-mix(in srgb, var(--link) 12%, var(--g3));\n+}\n+button.ont-garden-pin-ico-active:hover {\n+ color: var(--signal);\n+ background: color-mix(in srgb, var(--link) 18%, var(--g4));\n }\n button.ont-garden-pin-ico:focus-visible {\n outline: 2px solid var(--link);\ndiff --git a/server/static/theme_retro_craft.css b/server/static/theme_retro_craft.css\nindex bdd9031b82154a5019782e6dcb8bf7589fafce09..5d4954812ad43f2ee7e63c71c7f0ae0b3e3fc95b 100644\n--- a/server/static/theme_retro_craft.css\n+++ b/server/static/theme_retro_craft.css\n@@ -711,8 +711,7 @@ 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+body.view-ontology a.ont-garden-vote-ico {\n font-size: 0.95rem;\n line-height: 1;\n padding: 0.1rem 0.35rem;\n@@ -732,10 +731,14 @@ body.view-ontology a.ont-garden-vote-ico:hover {\n border-color: #a68e6b;\n background: #ebe6dc;\n }\n-body.view-ontology span.ont-garden-pinned-here {\n+body.view-ontology button.ont-garden-pin-ico-active {\n border-color: #1a4a8c;\n background: color-mix(in srgb, #1a4a8c 10%, #f7f3eb);\n- cursor: default;\n+ color: #0d2d5c;\n+}\n+body.view-ontology button.ont-garden-pin-ico-active:hover {\n+ border-color: #a68e6b;\n+ background: color-mix(in srgb, #1a4a8c 14%, #ebe6dc);\n }\n body.view-ontology form.ont-garden-pin-form {\n display: inline;\ndiff --git a/test/browser_garden_pin.clj b/test/browser_garden_pin.clj\nindex d4fa9ed60b45e872ec60e29307cfa61bcd9dd6b2..579976f4c2493a149f9eba081862ca07919f4fe9 100644\n--- a/test/browser_garden_pin.clj\n+++ b/test/browser_garden_pin.clj\n@@ -58,10 +58,11 @@\n (let [alice-token (oauth/fetch-bearer-token! base-url :username \"alice\")\n thread-tag \"browser-garden-pin\"\n raw (str \"# \" thread-tag \"\\n\\n\"\n- \"~/gp-pin-a {alpha}\\n\"\n- \"~/gp-pin-b {beta}\\n\"\n+ \"~/gp-parent {parent}\\n\"\n+ \"~/gp-parent/pin-a {alpha}\\n\"\n+ \"~/gp-parent/pin-b {beta}\\n\"\n \"{pin test vote}\\n\"\n- \"~/gp-pin-a 2:1 ~/gp-pin-b\\n\")\n+ \"~/gp-parent/pin-a 2:1 ~/gp-parent/pin-b\\n\")\n post-resp (oauth/http-post-json\n (str base-url \"/api/v0/rpc\")\n [{\"Post\" {\"room\" \"public\"\n@@ -77,23 +78,43 @@\n (core/with-page [pg (core/new-page-from-context ctx)]\n (page/navigate pg (str base-url \"/login\"))\n (is (wait-for-text pg \"body\" \"@alice\" 15000) \"alice session after login\")\n- (page/navigate pg (str base-url \"/~/gp-pin-a\"))\n- (is (wait-for-text pg \".ont-item-shell\" \"~/gp-pin-a\" 15000) \"on item a page\")\n+ (page/navigate pg (str base-url \"/~/gp-parent/pin-a\"))\n+ (is (wait-for-text pg \".ont-item-shell\" \"~/gp-parent/pin-a\" 15000) \"on item a page\")\n ;; Native form POST /ui (data-navigate=full) — not fetch/eval\n (locator/click (page/locator pg \".ont-item-pin-zone form.ont-pin-form button[type=submit]\"))\n- (is (wait-for-text pg \"#slug-pin-hud\" \"gp-pin-a\" 15000)\n+ (is (wait-for-text pg \"#slug-pin-hud\" \"gp-parent/pin-a\" 15000)\n \"HUD shows pinned item label after redirect\")\n- (page/navigate pg (str base-url \"/~/gp-pin-b\"))\n- (is (wait-for-text pg \".ont-item-shell\" \"~/gp-pin-b\" 15000) \"on item b page\")\n+ (page/navigate pg (str base-url \"/~/gp-parent/pin-b\"))\n+ (is (wait-for-text pg \".ont-item-shell\" \"~/gp-parent/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+ ;; Unpin from ranked child groups on parent page\n+ (page/navigate pg (str base-url \"/~/gp-parent\"))\n+ (is (wait-for-text pg \".ont-tab-panel-children\" \"ranked child groups\" 15000)\n+ \"parent page shows ranked child groups\")\n+ (is (wait-for-text pg \".ont-ranking-list button.ont-garden-pin-ico-active\" \"📌\" 10000)\n+ \"pinned row shows active pin in ranked list\")\n+ (locator/click (page/locator pg \".ont-ranking-list button.ont-garden-pin-ico-active\"))\n+ (is (wait-for-absence-substr pg \"#slug-pin-hud\" \"gp-parent/pin-a\" 15000)\n+ \"HUD clears after unpin from ranked child list\")\n+ (is (wait-for-absence-substr pg \".ont-ranking-list\" \"ont-garden-vote-ico\" 10000)\n+ \"vote icons removed from ranked list after unpin\")\n+ (page/navigate pg (str base-url \"/~/gp-parent/pin-b\"))\n+ (is (wait-for-text pg \".ont-item-shell\" \"~/gp-parent/pin-b\" 15000) \"on item b page again\")\n+ (is (wait-for-absence-substr pg \"body\" \"ont-vote-compare-btn\" 15000)\n+ \"compare vote CTA removed after ranked-list unpin\")\n+ ;; HUD unpin still works from item page context\n+ (page/navigate pg (str base-url \"/~/gp-parent/pin-a\"))\n+ (locator/click (page/locator pg \".ont-item-pin-zone form.ont-pin-form button[type=submit]\"))\n+ (is (wait-for-text pg \"#slug-pin-hud\" \"gp-parent/pin-a\" 15000)\n+ \"re-pin from item page for HUD unpin test\")\n+ (page/navigate pg (str base-url \"/~/gp-parent/pin-b\"))\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+ (is (wait-for-absence-substr pg \"#slug-pin-hud\" \"gp-parent/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+ (is (str/includes? (or (page/url pg) \"\") \"/~/gp-parent/pin-b\")\n \"still on item b after HUD unpin\"))))))\n \n (finally\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[1531154d] dequeue -> vec\n\nSide B — unified diff (full patch):\ndiff --git a/server/src/projection_apply.rs b/server/src/projection_apply.rs\nindex 9c8990a8af927f35d3344c8d0872a516aba56b86..ad404bacb8bcdd5ae0e682cff97f974fd44528ea 100644\n--- a/server/src/projection_apply.rs\n+++ b/server/src/projection_apply.rs\n@@ -6,8 +6,6 @@\n //! batch as the (non-idempotent) edge merges guarantees exactly-once application\n //! across replay.\n \n-use std::collections::BTreeSet;\n-\n use crate::{\n event_log::EventLogError,\n events::{Event, EventRecord},\n@@ -44,7 +42,6 @@ pub fn apply_records(\n \n let db = projection_store.db();\n let mut batch = db.batch();\n- let mut vote_parents: BTreeSet = BTreeSet::new();\n let mut last_seq = 0u64;\n \n for record in records {\n@@ -70,7 +67,6 @@ pub fn apply_records(\n *ts,\n )\n .map_err(|e| EventLogError::Apply(e.to_string()))?;\n- vote_parents.insert(parent);\n }\n Event::NodeEnsured { id } => {\n let parsed = parse_event_id(id)?;\n@@ -85,11 +81,5 @@ pub fn apply_records(\n .commit_with(durable::Durability::DisableWal)\n .map_err(|e| EventLogError::Apply(e.to_string()))?;\n \n- for parent in vote_parents {\n- projection_store\n- .trim_recent_votes(&parent)\n- .map_err(|e| EventLogError::Apply(e.to_string()))?;\n- }\n-\n Ok(())\n }\ndiff --git a/server/src/projection_store.rs b/server/src/projection_store.rs\nindex 8576d671f351004426207894ac35594ddb0f70cf..9a8953d010029d3639dc3987687554bab8b7663e 100644\n--- a/server/src/projection_store.rs\n+++ b/server/src/projection_store.rs\n@@ -18,7 +18,7 @@ use crate::{\n \n const PROJECTION_CURSOR_KEY: &str = \"cursor\";\n const PROJECTION_SCHEMA_KEY: &str = \"schema_version\";\n-const PROJECTION_SCHEMA_VERSION: u64 = 3;\n+const PROJECTION_SCHEMA_VERSION: u64 = 4;\n \n #[derive(Debug, thiserror::Error)]\n pub enum ProjectionStoreError {\n@@ -142,16 +142,6 @@ impl ProjectionStore {\n Ok(tree)\n }\n \n- /// Cap a node's recent-vote window after applying votes (best-effort, blind).\n- pub(crate) fn trim_recent_votes(&self, parent: &ItemId) -> Result<(), ProjectionStoreError> {\n- node(parent).recent_votes().truncate_back(\n- &self.db,\n- crate::storage_schema::RECENT_VOTES_CAP,\n- Durability::DisableWal,\n- )?;\n- Ok(())\n- }\n-\n /// Cache Reddit display content outside the event log (must be evicted per policy).\n pub fn put_ephemeral_content(\n &self,\ndiff --git a/server/src/reducer.rs b/server/src/reducer.rs\nindex 0c75c85150bb9e5f578bbadf58b3e43f8a80be4b..759918b8c0eb8f8bf1ed0911d8877adaa55c8ea6 100644\n--- a/server/src/reducer.rs\n+++ b/server/src/reducer.rs\n@@ -1,4 +1,4 @@\n-use std::collections::{HashMap, HashSet, VecDeque};\n+use std::collections::{HashMap, HashSet};\n \n use serde::{Deserialize, Serialize};\n \n@@ -52,7 +52,7 @@ pub struct GroupState {\n pub idx_to_item: Vec,\n pub edges: HashMap<(usize, usize), f64>,\n pub voted_pairs: HashSet<(usize, usize)>,\n- pub recent_votes: VecDeque,\n+ pub recent_votes: Vec,\n }\n \n impl GroupState {\n@@ -62,7 +62,7 @@ impl GroupState {\n idx_to_item: Vec::new(),\n edges: HashMap::new(),\n voted_pairs: HashSet::new(),\n- recent_votes: VecDeque::with_capacity(200),\n+ recent_votes: Vec::new(),\n }\n }\n \n@@ -111,10 +111,7 @@ impl GroupState {\n self.add_edge_weight(b_idx, a_idx, w_a);\n self.add_edge_weight(a_idx, b_idx, w_b);\n \n- self.recent_votes.push_front(vote);\n- while self.recent_votes.len() > 200 {\n- self.recent_votes.pop_back();\n- }\n+ self.recent_votes.push(vote);\n }\n }\n \ndiff --git a/server/src/storage_dto.rs b/server/src/storage_dto.rs\nindex 9dfb13c53efe4389277625a6ab3bfc18f566a453..3fd6db5cb909ac4896bd8a3ecace796de5f08781 100644\n--- a/server/src/storage_dto.rs\n+++ b/server/src/storage_dto.rs\n@@ -39,7 +39,7 @@ pub struct StoredEntityDataV1 {\n pub link_url: Option,\n }\n \n-/// One vote stored in a node's `recent_votes` deque.\n+/// One vote stored in a node's `recent_votes` list.\n #[derive(Debug, Clone, Serialize, Deserialize)]\n pub struct StoredVoteV1 {\n pub version: u32,\ndiff --git a/server/src/storage_schema.rs b/server/src/storage_schema.rs\nindex bd26e665e084b95b10fdfff091c31e8dc84d07b8..5d2bb1d56927fb61c7c6d2d8602bd6882327f862 100644\n--- a/server/src/storage_schema.rs\n+++ b/server/src/storage_schema.rs\n@@ -2,13 +2,13 @@\n //! durable collections instead of one blob per node.\n //!\n //! A vote updates a handful of keys: a few edge-weight merges, a voted-pair flag,\n-//! a recent-vote deque push, and child-link set entries. The in-memory\n+//! a recent-vote list append, and child-link set entries. The in-memory\n //! [`crate::reducer::GroupState`] is reconstructed from these keys on read for\n //! rank-centrality.\n \n use std::collections::{BTreeSet, HashMap, HashSet};\n \n-use durable::{Batch, Db, Deque, Durable, Leaf, Map, Sum};\n+use durable::{Batch, Db, Durable, Leaf, List, Map, Sum};\n \n use crate::{\n path_types::ItemId,\n@@ -38,8 +38,8 @@ pub struct NodeSchema {\n pub edges: Map>,\n /// Voted pairs `(min, max) -> true`.\n pub voted_pairs: Map>,\n- /// Recent votes, newest at the front (capped on write).\n- pub recent_votes: Deque>,\n+ /// Recent votes, append-only oldest-first (cap applied on read).\n+ pub recent_votes: List>,\n /// When ephemeral Reddit display content was last fetched (ms); absent after eviction.\n pub fetched_at: Leaf,\n }\n@@ -55,7 +55,7 @@ pub struct Store {\n pub view_meta: Map>,\n }\n \n-/// Cap on the per-node recent-vote window (matches the in-memory reducer).\n+/// Max recent votes returned when loading a node (query-time cap only).\n pub const RECENT_VOTES_CAP: u64 = 200;\n \n fn id_key(id: &ItemId) -> String {\n@@ -148,11 +148,14 @@ fn build_group_state(\n }\n }\n \n- // Deque is front=newest; in-memory VecDeque is also front=newest.\n- let mut recent_votes = std::collections::VecDeque::new();\n- for stored in np.recent_votes().iter(db)? {\n- recent_votes.push_back(decode_vote(stored).map_err(durable::Error::Deserialize)?);\n- }\n+ // List is index order (oldest first); keep the newest RECENT_VOTES_CAP entries.\n+ let stored = np.recent_votes().iter(db)?;\n+ let cap = RECENT_VOTES_CAP as usize;\n+ let start = stored.len().saturating_sub(cap);\n+ let recent_votes = stored[start..]\n+ .iter()\n+ .map(|s| decode_vote(s.clone()).map_err(durable::Error::Deserialize))\n+ .collect::, _>>()?;\n \n Ok(GroupState {\n item_to_idx,\n@@ -248,7 +251,7 @@ pub fn vote_writes(\n };\n batch.write(pnode.voted_pairs().key(&(lo, hi)).set(&true));\n \n- // Recent votes (newest at front).\n+ // Recent votes (append-only; cap on read).\n let stored = encode_vote(&VoteData {\n ts,\n a: a_id,\n@@ -260,7 +263,7 @@ pub fn vote_writes(\n delegate: None,\n thread_tag: \"default\".to_string(),\n });\n- batch.push_front(&pnode.recent_votes(), &stored)?;\n+ batch.push(&pnode.recent_votes(), &stored)?;\n Ok(())\n }\n \n@@ -314,6 +317,35 @@ mod tests {\n assert!(load_node_state(&db, &parent).unwrap().is_none());\n }\n \n+ #[test]\n+ fn load_caps_recent_votes_at_query_time() {\n+ let dir = tempfile::tempdir().unwrap();\n+ let db = Db::open(dir.path()).unwrap();\n+ let parent = ItemId::root();\n+\n+ let mut batch = db.batch();\n+ for i in 0..RECENT_VOTES_CAP + 10 {\n+ vote_writes(&mut batch, &parent, \"alpha\", \"beta\", 1, 0, i as i64).unwrap();\n+ }\n+ batch.commit().unwrap();\n+\n+ assert_eq!(\n+ node(&parent).recent_votes().len(&db).unwrap(),\n+ RECENT_VOTES_CAP + 10\n+ );\n+\n+ let node_state = load_node_state(&db, &parent).unwrap().unwrap();\n+ assert_eq!(node_state.local_ranking.recent_votes.len(), RECENT_VOTES_CAP as usize);\n+ assert_eq!(\n+ node_state.local_ranking.recent_votes.first().map(|v| v.ts),\n+ Some(10)\n+ );\n+ assert_eq!(\n+ node_state.local_ranking.recent_votes.last().map(|v| v.ts),\n+ Some(RECENT_VOTES_CAP as i64 + 9)\n+ );\n+ }\n+\n #[test]\n fn missing_node_is_none() {\n let dir = tempfile::tempdir().unwrap();\n","role":"user"}],"model":"~anthropic/claude-sonnet-latest"}