You are a constitutional council ranking individual git commits for ownership allocation. Compare these two commits. Decide which contributed more lasting value to the project. Judge substance, not spectacle: - Prefer correct, lasting design and real bugfixes over churn, formatting, renames, or generated noise. - Prefer clarity and necessity over sheer line count. A small precise change can beat a large diffuse one. - Do not favor a side merely because its patch is longer or noisier. - Weight what the change does for the project, not the contributor's name. Return ONLY a JSON object: {"winner": "A" or "B", "ratio": "N:M", "explanation": "..."} The explanation must cite concrete differences in the patches (1-3 sentences). Side A — contributor: tommy-mor Side A — commit message: [03cd8f2e] Skip pinned Reddit posts when importing subreddit listings. Co-authored-by: Cursor Side A — unified diff (full patch): 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 { 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" + ); + } } Side B — contributor: tommy-mor Side B — commit message: [0d3270d1] Fix GitHub OAuth callback NameError on missing API base URL. Co-authored-by: Cursor Side B — unified diff (full patch): diff --git a/constitution.py b/constitution.py index f819007252f435680b8356fb4da83469b21e33af..4dd5b9dfbba231d46289c490f91b1dd5b1018bcf 100644 --- a/constitution.py +++ b/constitution.py @@ -119,6 +119,9 @@ JSONL_PATH = pathlib.Path(os.environ.get("JSONL_PATH", "/data/ledger.jsonl")) GITHUB_CLIENT_ID = os.environ.get("GITHUB_CLIENT_ID", "") GITHUB_CLIENT_SECRET = os.environ.get("GITHUB_CLIENT_SECRET", "") +GITHUB_API_BASE_URL = os.environ.get( + "GITHUB_API_BASE_URL", "https://api.github.com" +).rstrip("/") OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY", "") OPENROUTER_BASE_URL = os.environ.get("OPENROUTER_BASE_URL", "https://openrouter.ai").rstrip("/")