constitution · epochs · watch · epoch 3

comparison

c_66eb04076a98 (tommy-mor) vs c_bc8c17a00ed7 (tommy-mor)

download prompt · raw event · cmp_5628bc317a8b6d

council reasoning

openai/gpt-chat-latest · winner A · 3:2 · permalink

Side A changes the ranking color logic from list-position-based to score-based min–max normalization within each group, introducing a dedicated `score_gradient_t` helper, updating rendering to use score ranges, and adding focused tests for normalization behavior and edge cases like tied scores. Side B fixes a practical import issue by skipping stickied/pinned Reddit posts with a helper and regression test, but its impact is narrower than A's broader improvement to core ranking visualization behavior.

openai/gpt-5.3-chat · winner A · 3:2 · permalink

A replaces a position-based coloring scheme with score-based min–max normalization, altering function signatures, computing per-group ranges, and adding targeted tests—an enduring improvement to how data is represented. B is a straightforward filter that skips pinned posts via a simple helper and test, useful but narrower in scope.

openai/gpt-5.2-chat · winner B · 3:2 · permalink

Side B prevents pinned/stickied Reddit posts from being imported by adding `child_is_pinned` and filtering in `parse_children`, plus a focused test—improving data correctness and avoiding persistent noise in stored listings. Side A refactors row coloring to use min–max score normalization and adds solid tests, but it primarily affects UI presentation rather than core data integrity or behavior.

~anthropic/claude-sonnet-latest · winner B · 6:4 · permalink

B fixes a real data-quality bug (pinned/stickied posts polluting subreddit imports) with a clear, testable behavior change that affects actual content correctness. A is a UI-only cosmetic tweak to color gradient math for rank rows, which is a minor visual refinement with no functional or data-correctness impact.

~x-ai/grok-latest · winner B · 2:1 · permalink

B fixes import data quality by excluding stickied/pinned Reddit posts (with a clear helper and regression test), which permanently keeps non-content noise out of the ranking pipeline. A only refinines rank-row coloring from list ordinal to min–max score within a group—a solid, tested UX tweak, but presentation polish rather than correctness of ingested data.

sides

A — c_66eb04076a98 (tommy-mor)

message

[0366806e] Color rank rows by vote mass within each group, not list position.

Min–max normalization keeps similar scores visually close while still
using the full gradient as groups grow and absolute mass dilutes.

Co-authored-by: Cursor <cursoragent@cursor.com>

diff preview

diff --git a/server/src/html/mod.rs b/server/src/html/mod.rs
index a58cbbee3490a08a625cb06df06848c59a615d65..4eff2e19ed4d303ff8e80c1eabd8a15b4990e643 100644
--- a/server/src/html/mod.rs
+++ b/server/src/html/mod.rs
@@ -264,12 +264,19 @@ pub fn scope_theme_style(parent: &ItemId) -> String {
     )
 }
 
-fn rank_row_style(parent: &ItemId, ordinal: usize, total: usize) -> String {
-    let t = if total <= 1 {
-        0.0
-    } else {
-        ordinal as f64 / (total - 1) as f64
-    };
+/// Map vote mass to gradient position using the group's score range, not raw mass or
+/// list position. Vote mass sums to 1 across the component, so absolute values dilute
+/// as N grows; min–max within the visible list preserves similar scores → similar colors.
+fn score_gradient_t(score: f64, min_score: f64, max_score: f64) -> f64 {
+    let spread = max_score - min_score;
+    if spread < 1e-9 {
+        return 0.5;
+    }
+    ((max_score - score) / spread).clamp(0.0, 1.0)
+}
+
+fn rank_row_style(parent: &ItemId, score: f64, min_score: f64, max_score: f64) -> String {
+    let t = score_gradient_t(score, min_score, max_score);
     let base_hue = scope_base_hue(parent);
     let hue = (base_hue + 118.0 * t) % 360.0;
     let lightness = 0.74 - 0.34 * t;
@@ -295,14 +302,15 @@ fn rank_list(
     highlighted: &HashSet<ItemId>,
     tree: &GlobalTree,
 ) -> Markup {
-    let group_len = items.len();
+    let min_score = items.iter().map(|r| r.score).fold(f64::INFINITY, f64::min);
+    let max_score = items.iter().map(|r| r.score).fold(f64::NEG_INFINITY, f64::max);
     html! {
         @if !items.is_empty() {
             h3 class="rank-heading muted small" { (label) }
             ol class="rank-list" {
                 @for (i, r) in items.iter().enumerate() {
                     @let href = item_href(&r.item);
-                    @let style = rank_row_style(parent, i, group_len);
+                    @let style = rank_row_style(parent, r.score, min_score, max_score);
                     @let class = rank_row_class(&r.item, highlighted);
                     li class=(class)
                         data-rank-item=(r.item.as_str())
@@ -517,19 +525,37 @@ pub async fn browse(State(state): State<AppState>, uri: Uri) -> impl IntoRespons
 
 #[cfg(test)]
 mod tests {
-    use super::{rank_row_style, SORTER_UI_JS};
+    use super::{rank_row_style, score_gradient_t, SORTER_UI_JS};
     use crate::path_types::ItemId;
 
     #[test]
-    fn rank_row_style_gradients_per_group_not_globally() {
+    fn score_gradient_t_uses_group_range_not_absolute_mass() {
+        assert!((score_gradient_t(0.12, 0.08, 0.12) - 0.0).abs() < 1e-9);
+        assert!((score_gradient_t(0.08, 0.08, 0.12) - 1.0).abs() < 1e-9);
+        // Raw 12% mass would map near the dark end globally; within this group it's the top.
+        assert!(score_gradient_t(0.12, 0.08, 0.12) < score_gradient_t(0.12, 0.0, 1.0));
+    }
+
+    #[test]
+    fn score_gradient_t_similar_scores_similar_t() {
+        let a = score_gradient_t(0.41, 0.20, 0.60);
+        let b = score_gradient_t(0.40, 0.20, 0.60);
+        assert!((a - b).abs() < 0.05);
+        assert!((a - score_gradient_t(0.60, 0.20, 0.60)).abs() > 0.3);
+    }
+
+    #[test]
+    fn score_gradient_t_tied_scores_neutral() {
+        assert!((score_gradient_t(0.25, 0.25, 0.25) - 0.5).abs() < 1e-9);
+    }
+
+    #[test]
+    fn rank_row_style_same_inputs_same_color() {
         let parent = ItemId::opaque("test-scope");
-        let first_in_four = rank_row_style(&parent, 0, 4);
-        let last_in_four = rank_row_style(&parent, 3, 4);
-        let first_in_two = rank_row_style(&parent, 0, 2);
-        let last_in_two = rank_row_style(&parent, 1, 2);
-        assert_eq!(first_in_four, first_in_two);
-        assert_eq!(last_in_four, last_in_two);
-        assert_ne!(first_in_four, last_in_four);
+        assert_eq!(
+            rank_row_style(&parent, 0.33, 0.20, 0.60),
+            rank_row_style(&parent, 0.33, 0.20, 0.60),
+        );
     }
 
     #[test]

download full diff A

B — c_bc8c17a00ed7 (tommy-mor)

message

[03cd8f2e] Skip pinned Reddit posts when importing subreddit listings.

Co-authored-by: Cursor <cursoragent@cursor.com>

diff preview

diff --git a/server/src/reddit.rs b/server/src/reddit.rs
index f409764c1e1f36216f1b08107043c2eab905694c..fa5577f8ee0a8c53ff4dbec988a90a5d2fc3cdee 100644
--- a/server/src/reddit.rs
+++ b/server/src/reddit.rs
@@ -661,6 +661,7 @@ pub fn map_children_url(id: &ItemId, api_base: &str) -> String {
 /// Parse a subreddit listing payload into `(child_id, child_payload)` entries.
 /// Each child id is the post's permalink under `reddit.com/…`, and the payload
 /// is the raw `{kind, data}` listing element (persisted per child).
+/// Pinned / stickied posts are skipped.
 fn parse_children(_parent: &ItemId, payload: &Value) -> Vec<(ItemId, Value)> {
     let mut out = Vec::new();
     let children = match payload.pointer("/data/children").and_then(|c| c.as_array()) {
@@ -668,6 +669,9 @@ fn parse_children(_parent: &ItemId, payload: &Value) -> Vec<(ItemId, Value)> {
         None => return out,
     };
     for child in children {
+        if child_is_pinned(child) {
+            continue;
+        }
         let permalink = match child.pointer("/data/permalink").and_then(|p| p.as_str()) {
             Some(p) if !p.is_empty() => p,
             _ => continue,
@@ -680,6 +684,15 @@ fn parse_children(_parent: &ItemId, payload: &Value) -> Vec<(ItemId, Value)> {
     out
 }
 
+fn child_is_pinned(child: &Value) -> bool {
+    let data = match child.get("data") {
+        Some(d) => d,
+        None => return false,
+    };
+    data.get("stickied").and_then(|v| v.as_bool()) == Some(true)
+        || data.get("pinned").and_then(|v| v.as_bool()) == Some(true)
+}
+
 fn parse_reddit_view(id: &ItemId, v: &Value) -> Option<crate::reducer::EntityData> {
     let segments: Vec<&str> = id.as_str().split('/').collect();
 
@@ -853,4 +866,46 @@ mod tests {
             Some("http://v3.redgifs.com/watch/impossibleprestigioushedgehog")
         );
     }
+
+    #[test]
+    fn parse_children_skips_pinned_posts() {
+        let payload = serde_json::json!({
+            "kind": "Listing",
+            "data": {
+                "children": [
+                    {
+                        "kind": "t3",
+                        "data": {
+                            "title": "Official rules (pinned)",
+                            "permalink": "/r/rust/comments/pin/official_rules/",
+                            "stickied": true
+                        }
+                    },
+                    {
+                        "kind": "t3",
+                        "data": {
+                            "title": "Also pinned via pinned field",
+                            "permalink": "/r/rust/comments/pin2/also_pinned/",
+                            "pinned": true
+                        }
+                    },
+                    {
+                        "kind": "t3",
+                        "data": {
+                            "title": "Normal post",
+                            "permalink": "/r/rust/comments/aaa/normal_post/",
+                            "stickied": false
+                        }
+                    }
+                ]
+            }
+        });
+        let parent = ItemId::from_url("https://reddit.com/r/rust").unwrap();
+        let children = parse_children(&parent, &payload);
+        assert_eq!(children.len(), 1);
+        assert_eq!(
+            children[0].0.as_str(),
+            "https://reddit.com/r/rust/comments/aaa"
+        );
+    }
 }

download full diff B

Hardlinks — judgments / attempts / prompt

prompt download

judgments

attempts

Prompt text is loaded only by the download route.