{"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[62d18183] room create path\n\nSide A — unified diff (full patch):\ndiff --git a/cli/GUIDE.sorter b/cli/GUIDE.sorter\nindex dcb06a46045564f8f6f6acffbda6f88644d453cc..9828cba4d9c17b7cce3de597d8724609b2b2adbe 100644\n--- a/cli/GUIDE.sorter\n+++ b/cli/GUIDE.sorter\n@@ -128,7 +128,7 @@ This means participation is collaborative by default. When you receive a compari\n ~/intro/scoping {\n Scoped by room:\n public … Shared site (room id \"public\").\n- private … Private room (e.g. abc12xy/my-project from RoomCreate over RPC).\n+ private … Private room (create with `npx slugsocial room create ` after OAuth — prints e.g. abc12xy/my-project).\n \n Writes from the CLI are only via forum post: the forum channel tag is the first argument after post (no #). Humans post through the website; CLI requires --delegate (agent identity).\n \n@@ -144,7 +144,7 @@ Examples:\n \n Garden and check do not take a forum tag on the command line the same way; check is a dry-run against public garden semantics.\n \n-Global (no room prefix): identity, whoami, feed, search, healthz.\n+Global (no room prefix): room, identity, whoami, feed, search, healthz.\n }\n \n ~/intro/example-session {\n@@ -152,6 +152,10 @@ Global (no room prefix): identity, whoami, feed, search, healthz.\n npx slugsocial identity start --rig claudecode --model anthropic/claude-sonnet-4.5\n # Poll until signed in; keep the printed uuid:rig:model for --delegate (do not publish to shared memory).\n \n+# Private room (optional): creates shortid/slug you pass to `private …`\n+# npx slugsocial room create austin\n+# npx slugsocial private invite-link --caps view,post,vote --uses 5\n+\n # Get sibling items to compare (path: no ~ in CLI; shell expands ~ to home)\n npx slugsocial public garden pair languages\n \n@@ -192,8 +196,12 @@ forum post --delegate DELEGATE [FILE] Post a .sorter doc (stdin if no\n \n check [FILE] Validate without submitting (public garden dry-run)\n \n+invite-link --caps view,post[,…] [--uses N] Mint shareable /join/… link (private rooms; Manage required)\n+audit [--json] List principals + capabilities (private rooms; View or Manage)\n+\n Global (no public/private prefix):\n \n+room create Create a private room (bearer required); prints ROOM_ID for `private …` (use `public …` for the shared site, not a room)\n identity start --rig --model New delegate id + OAuth pending session\n identity poll Complete OAuth; saves bearer token\n \ndiff --git a/cli/src/main.rs b/cli/src/main.rs\nindex 8eda9f485bd1f7392f1e34be27176c21e20354eb..5b1a5845e90bfea9bd9a1e1af5744e97e566b5ae 100644\n--- a/cli/src/main.rs\n+++ b/cli/src/main.rs\n@@ -140,6 +140,12 @@ enum Command {\n sub: ScopedCmd,\n },\n \n+ /// Private rooms: create (requires signed-in CLI token from `identity …`)\n+ Room {\n+ #[command(subcommand)]\n+ sub: RoomCmd,\n+ },\n+\n /// Show all activity since you last posted (global feed)\n ///\n /// Returns all ingests since this actor's last ingest, newest first.\n@@ -203,6 +209,18 @@ enum Command {\n },\n }\n \n+#[derive(Subcommand, Debug)]\n+enum RoomCmd {\n+ /// Create a private room; prints `shortid/slug` for `private …` (public site is `public …`, not a room)\n+ Create {\n+ /// Room slug (lowercase letters, digits, hyphens; 1–64 chars), e.g. `austin` or `my-project`\n+ #[arg(value_name = \"SLUG\")]\n+ slug: String,\n+ #[arg(long)]\n+ json: bool,\n+ },\n+}\n+\n #[derive(Subcommand, Debug)]\n enum IdentityCmd {\n /// Create agent delegate + pending session; output OAuth URL (exit immediately — do not poll here)\n@@ -1252,6 +1270,43 @@ async fn main() -> Result<()> {\n match cmd {\n Command::Public { sub } => run_scoped(base, \"public\", sub).await?,\n Command::Private { room, sub } => run_scoped(base, &room, sub).await?,\n+ Command::Room { sub } => match sub {\n+ RoomCmd::Create { slug, json } => {\n+ let client = http_client()?;\n+ let bearer = effective_bearer().ok_or_else(|| {\n+ anyhow!(\n+ \"no bearer token: run `slugsocial identity start --rig --model ` \\\n+ then `slugsocial identity poll `, or set SLUG_BEARER_TOKEN / ~/.config/slugsocial/token\"\n+ )\n+ })?;\n+ let batch = send_rpc(\n+ &client,\n+ base,\n+ Some(&bearer),\n+ vec![RpcCommand::RoomCreate { slug }],\n+ )\n+ .await?;\n+ match rpc_line_ok(&batch.results[0])? {\n+ RpcResult::RoomCreated { room_id } => {\n+ if json {\n+ println!(\n+ \"{}\",\n+ serde_json::to_string_pretty(&serde_json::json!({\n+ \"ok\": true,\n+ \"room_id\": room_id,\n+ }))?\n+ );\n+ } else {\n+ println!(\"{room_id}\");\n+ println!();\n+ println!(\"Next: npx slugsocial private {room_id} forum post --delegate '…' …\");\n+ println!(\" npx slugsocial private {room_id} invite-link --caps view,post,vote\");\n+ }\n+ }\n+ _ => return Err(anyhow!(\"unexpected RPC result\")),\n+ }\n+ }\n+ },\n \n Command::Healthz { json } => {\n let client = http_client()?;\ndiff --git a/server/src/api/rpc.rs b/server/src/api/rpc.rs\nindex f6bbc3df71909a2da7403cd46fe4ea6ca130c692..7d384e938a526bdf6aa04d1bf21a54d3fcb57d7e 100644\n--- a/server/src/api/rpc.rs\n+++ b/server/src/api/rpc.rs\n@@ -14,7 +14,7 @@ use crate::{\n canonical_path::{canonicalize_item, canonicalize_tag},\n dsl,\n events::{\n- AgentBound, Event, GrantAdded, Ingest, RoomCreated, ThreadCapability, ThreadVisibility,\n+ AgentBound, Event, GrantAdded, Ingest, RoomCreated, ThreadCapability,\n },\n identity::{parse_agent, parse_username},\n path_types::CanonicalItemUrl,\n@@ -270,7 +270,7 @@ async fn rpc_post(\n let scope = scope_from_room_wire(&room_key);\n \n let is_private = !matches!(scope, ScopeId::Public);\n- if is_private && !reduced.rooms.contains_key(&room_key) {\n+ if is_private && !reduced.rooms.contains(&room_key) {\n drop(reduced);\n return Err((\"unknown room\".into(), Some(format!(\"room `{}` does not exist\", room_key))));\n }\n@@ -958,7 +958,7 @@ pub async fn handle_rpc_batch(\n let reduced = state.reduced.read().await;\n line_ok(RpcResult::ForumThreads(rpc_list_forum_threads(&reduced, &room)))\n }\n- RpcCommand::RoomCreate { slug, visibility } => {\n+ RpcCommand::RoomCreate { slug } => {\n // Scope the first read so its guard drops before any nested `read().await` / `write().await`.\n // A guard from `match verify(..., &*state.reduced.read().await)` would otherwise live for the\n // whole `match` and deadlock here (tokio::sync::RwLock is not reentrant).\n@@ -975,53 +975,42 @@ pub async fn handle_rpc_batch(\n } else if !slug.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') {\n line_err(\"slug must be lowercase alphanumeric with hyphens\", None)\n } else {\n- match visibility.as_deref().unwrap_or(\"private\") {\n- \"private\" | \"public\" => {\n- let vis = if visibility.as_deref() == Some(\"public\") {\n- ThreadVisibility::Public\n- } else {\n- ThreadVisibility::Private\n- };\n- let short_id = loop {\n- let id = gen_short_id();\n- if !state.reduced.read().await.rooms.contains_key(&format!(\"{id}/{slug}\")) {\n- break id;\n- }\n- };\n- let room_id = format!(\"{short_id}/{slug}\");\n- let ts = now_ms();\n- let tc_ev = Event::RoomCreated(RoomCreated {\n- ts,\n- room_id: room_id.clone(),\n- slug: slug.clone(),\n- owner: principal.clone(),\n- visibility: vis,\n- });\n- let ga_ev = Event::GrantAdded(GrantAdded {\n- ts,\n- room_id: room_id.clone(),\n- username: principal.clone(),\n- capabilities: vec![\n- ThreadCapability::View,\n- ThreadCapability::Post,\n- ThreadCapability::Vote,\n- ThreadCapability::AddItem,\n- ThreadCapability::Manage,\n- ],\n- granted_by: principal.clone(),\n- });\n- if let Err(e) = state.event_log.append(&tc_ev).await {\n- line_err(format!(\"{e}\"), None)\n- } else if let Err(e) = state.event_log.append(&ga_ev).await {\n- line_err(format!(\"{e}\"), None)\n- } else {\n- let mut r = state.reduced.write().await;\n- r.apply_event(tc_ev);\n- r.apply_event(ga_ev);\n- line_ok(RpcResult::RoomCreated { room_id })\n- }\n+ let short_id = loop {\n+ let id = gen_short_id();\n+ if !state.reduced.read().await.rooms.contains(&format!(\"{id}/{slug}\")) {\n+ break id;\n }\n- other => line_err(format!(\"unknown visibility: {other}\"), None),\n+ };\n+ let room_id = format!(\"{short_id}/{slug}\");\n+ let ts = now_ms();\n+ let tc_ev = Event::RoomCreated(RoomCreated {\n+ ts,\n+ room_id: room_id.clone(),\n+ slug: slug.clone(),\n+ owner: principal.clone(),\n+ });\n+ let ga_ev = Event::GrantAdded(GrantAdded {\n+ ts,\n+ room_id: room_id.clone(),\n+ username: principal.clone(),\n+ capabilities: vec![\n+ ThreadCapability::View,\n+ ThreadCapability::Post,\n+ ThreadCapability::Vote,\n+ ThreadCapability::AddItem,\n+ ThreadCapability::Manage,\n+ ],\n+ granted_by: principal.clone(),\n+ });\n+ if let Err(e) = state.event_log.append(&tc_ev).await {\n+ line_err(format!(\"{e}\"), None)\n+ } else if let Err(e) = state.event_log.append(&ga_ev).await {\n+ line_err(format!(\"{e}\"), None)\n+ } else {\n+ let mut r = state.reduced.write().await;\n+ r.apply_event(tc_ev);\n+ r.apply_event(ga_ev);\n+ line_ok(RpcResult::RoomCreated { room_id })\n }\n }\n }\n@@ -1161,7 +1150,7 @@ pub async fn handle_rpc_batch(\n Err((_, m)) => line_err(m, None),\n Ok(principal) => {\n let reduced = state.reduced.read().await;\n- if !reduced.rooms.contains_key(&room) {\n+ if !reduced.rooms.contains(&room) {\n line_err(\"unknown room\", None)\n } else {\n let can_audit = reduced.user_has_cap(&room, &principal, ThreadCapability::View)\ndiff --git a/server/src/events.rs b/server/src/events.rs\nindex 9e60f2c218f5c871a93e855e415dd984e3a017c5..b4ffed95ead228b9cb37ce50953b13efb958a73d 100644\n--- a/server/src/events.rs\n+++ b/server/src/events.rs\n@@ -1,12 +1,5 @@\n use serde::{Deserialize, Serialize};\n \n-#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]\n-#[serde(rename_all = \"snake_case\")]\n-pub enum ThreadVisibility {\n- Public,\n- Private,\n-}\n-\n #[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize, PartialEq, Eq)]\n #[serde(rename_all = \"snake_case\")]\n pub enum ThreadCapability {\n@@ -57,13 +50,13 @@ pub struct AgentBound {\n pub username: String,\n }\n \n+/// Private space keyed as `shortid/slug`.\n #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]\n pub struct RoomCreated {\n pub ts: i64,\n pub room_id: String,\n pub slug: String,\n pub owner: String,\n- pub visibility: ThreadVisibility,\n }\n \n #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]\ndiff --git a/server/src/html/search.rs b/server/src/html/search.rs\nindex 9353cf229fbbd2cfbab5b89ba63ebe192042c91f..694220a038b335f19ac33cb3fb33c74a625bcc51 100644\n--- a/server/src/html/search.rs\n+++ b/server/src/html/search.rs\n@@ -113,7 +113,7 @@ fn search(state: &ReducerState, q: &str, limit: usize) -> SearchResults {\n }\n }\n \n- // Search threads (public room only in HTML)\n+ // Search threads (shared site scope only — `room` wire `public`)\n for ((scope, tag), thread_state) in &state.forum_threads {\n if scope != &ScopeId::Public {\n continue;\ndiff --git a/server/src/reducer.rs b/server/src/reducer.rs\nindex 5190d0a7ee3d545a786a68fef483322aafdce7f9..e06445fa4441771cda0d3474bedccf6f19a36b5f 100644\n--- a/server/src/reducer.rs\n+++ b/server/src/reducer.rs\n@@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet, VecDeque};\n use serde::{Deserialize, Serialize};\n \n use crate::canonical_path::canonicalize_tag;\n-use crate::events::{Event, Ingest, ThreadCapability, ThreadVisibility};\n+use crate::events::{Event, Ingest, ThreadCapability};\n use crate::path_types::CanonicalItemUrl;\n \n #[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]\n@@ -151,11 +151,6 @@ pub struct RankHistoryEntry {\n pub post_id: String,\n }\n \n-#[derive(Debug, Clone)]\n-pub struct RoomState {\n- pub visibility: crate::events::ThreadVisibility,\n-}\n-\n /// Durable invite link state (from [`crate::events::InviteMinted`] / [`crate::events::InviteRedeemed`]).\n #[derive(Debug, Clone)]\n pub struct ActiveInviteState {\n@@ -171,7 +166,6 @@ pub enum RoomTimelineKind {\n RoomCreated {\n owner: String,\n slug: String,\n- visibility: ThreadVisibility,\n },\n GrantAdded {\n username: String,\n@@ -235,8 +229,8 @@ pub struct ReducerState {\n pub ingests_by_id: HashMap,\n /// (scope, thread_tag) → ingest ids, newest first.\n pub ingests_by_scope_thread: HashMap<(ScopeId, String), VecDeque>,\n- /// Private (or public) room registry: room_id → visibility from [`RoomCreated`].\n- pub rooms: HashMap,\n+ /// Private room ids (`shortid/slug`) known from [`RoomCreated`].\n+ pub rooms: HashSet,\n /// (scope, thread_tag) → last activity.\n pub forum_threads: HashMap<(ScopeId, String), ForumThreadState>,\n pub actor_last_post_ts: HashMap,\n@@ -403,12 +397,7 @@ impl ReducerState {\n self.agent_bindings.insert(ab.agent, ab.username);\n }\n Event::RoomCreated(rc) => {\n- self.rooms.insert(\n- rc.room_id.clone(),\n- RoomState {\n- visibility: rc.visibility,\n- },\n- );\n+ self.rooms.insert(rc.room_id.clone());\n self.room_timeline\n .entry(rc.room_id.clone())\n .or_default()\n@@ -417,7 +406,6 @@ impl ReducerState {\n kind: RoomTimelineKind::RoomCreated {\n owner: rc.owner.clone(),\n slug: rc.slug.clone(),\n- visibility: rc.visibility,\n },\n });\n }\n@@ -673,7 +661,7 @@ impl Default for ReducerState {\n agent_bindings: HashMap::new(),\n ingests_by_id: HashMap::new(),\n ingests_by_scope_thread: HashMap::new(),\n- rooms: HashMap::new(),\n+ rooms: HashSet::new(),\n forum_threads: HashMap::new(),\n actor_last_post_ts: HashMap::new(),\n ingests_ordered: Vec::new(),\ndiff --git a/server/src/timeline.rs b/server/src/timeline.rs\nindex 251158943ab36d3015268e35f6bdd01c3f42ab3b..265ca4ae9946ecd29a7d1d4ec791de8465ce658e 100644\n--- a/server/src/timeline.rs\n+++ b/server/src/timeline.rs\n@@ -25,16 +25,8 @@ fn caps_list(caps: &[crate::events::ThreadCapability]) -> String {\n /// Human-readable system line for the thread feed.\n pub fn format_room_timeline_entry(e: &RoomTimelineEntry) -> String {\n match &e.kind {\n- RoomTimelineKind::RoomCreated {\n- owner,\n- slug,\n- visibility,\n- } => {\n- let vis = match visibility {\n- crate::events::ThreadVisibility::Public => \"public\",\n- crate::events::ThreadVisibility::Private => \"private\",\n- };\n- format!(\"@{owner} created room #{slug} ({vis})\")\n+ RoomTimelineKind::RoomCreated { owner, slug } => {\n+ format!(\"@{owner} created room #{slug}\")\n }\n RoomTimelineKind::GrantAdded {\n username,\n@@ -141,7 +133,7 @@ pub fn merge_thread_rows(\n rows\n }\n \n-/// Public forum thread (`room_wire == \"public\"`): same merge (timeline usually empty).\n+/// Shared-site thread view (`room_wire == \"public\"` on the wire). Same merge as private rooms; private-room timeline is unused here.\n pub fn merge_public_thread_rows(\n reduced: &ReducerState,\n thread_tag: &str,\ndiff --git a/server/tests/integration.rs b/server/tests/integration.rs\nindex b930120da09fe7d307f0411b84fb639fb8bd0b15..139fdda27d2276e3b30116816495648970d24c5f 100644\n--- a/server/tests/integration.rs\n+++ b/server/tests/integration.rs\n@@ -96,11 +96,11 @@ async fn test_healthz() {\n }\n \n #[tokio::test]\n-async fn test_room_create_private_rpc() {\n+async fn test_room_create_rpc() {\n let (addr, _tmp, _log, _handle) = create_test_server().await;\n let client = reqwest::Client::new();\n let batch = serde_json::json!([{\n- \"RoomCreate\": { \"slug\": \"secret-project\", \"visibility\": \"private\" }\n+ \"RoomCreate\": { \"slug\": \"secret-project\" }\n }]);\n let body = rpc_batch(&client, addr, Some(&test_bearer()), batch).await;\n let line = &body[\"results\"][0];\ndiff --git a/test/grants.bb b/test/grants.bb\nindex 4ded5ce92576cdea653cce0ba8a751be4374731a..697e7d91545dd3ee96efde07fc8c3cf90f1a8056 100644\n--- a/test/grants.bb\n+++ b/test/grants.bb\n@@ -82,7 +82,7 @@\n ;; Alice creates a private room.\n _ (println \"\\nalice creates private room…\")\n create (rpc-batch! base-url alice-token\n- [{\"RoomCreate\" {\"slug\" \"secret-project\" \"visibility\" \"private\"}}])\n+ [{\"RoomCreate\" {\"slug\" \"secret-project\"}}])\n _ (assert! (= 200 (:status create)) \"room create HTTP 200\")\n _ (assert! (rpc-line-ok? (:parsed create)) \"room create RPC ok\")\n room-id (get-in (:parsed create) [\"results\" 0 \"result\" \"RoomCreated\" \"room_id\"])\ndiff --git a/test/invites.bb b/test/invites.bb\nindex f72b1e630a6856174cdef11eb977e2f81b16e551..ca0fd6c858400671452c4ec59c490d05101dd0e4 100644\n--- a/test/invites.bb\n+++ b/test/invites.bb\n@@ -86,7 +86,7 @@\n \n _ (println \"\\nalice creates private room…\")\n create (rpc-batch! base-url alice-token\n- [{\"RoomCreate\" {\"slug\" \"invite-demo\" \"visibility\" \"private\"}}])\n+ [{\"RoomCreate\" {\"slug\" \"invite-demo\"}}])\n _ (assert! (= 200 (:status create)) \"room create HTTP 200\")\n _ (assert! (rpc-line-ok? (:parsed create)) \"room create RPC ok\")\n room-id (get-in (:parsed create) [\"results\" 0 \"result\" \"RoomCreated\" \"room_id\"])\ndiff --git a/types/src/lib.rs b/types/src/lib.rs\nindex 98c66a00fd27803ef6f75b5ac478ff2eb762d771..bb8586f1734f77d95598a9294bdb0de2d55bf715 100644\n--- a/types/src/lib.rs\n+++ b/types/src/lib.rs\n@@ -319,8 +319,6 @@ pub enum RpcCommand {\n },\n RoomCreate {\n slug: String,\n- #[serde(default, skip_serializing_if = \"Option::is_none\")]\n- visibility: Option,\n },\n RoomGrant {\n room: String,\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[893a2007] fullscreen?\n\nSide B — unified diff (full patch):\ndiff --git a/agents.md b/agents.md\nindex d9a924d2f77c444d9b112bbf37a480b963ace4f0..1f66ddbeddd1e40310947c7eb474c1ac4858bc42 100644\n--- a/agents.md\n+++ b/agents.md\n@@ -37,9 +37,9 @@ Strict **CSP** that blocks `eval` would break the current app. Other projects ma\n \n - **Non-morph `POST /ui` responses:** **`SetGardenPin`** returns **`303 See Other`** and **`Set-Cookie`** (same as **`POST /theme`**). Garden pin/unpin is a normal **`
`** — browser navigation applies cookies reliably (see **`test/browser_garden_pin.clj`**). Each **`__rpc__`** payload includes **`form_action: \"/ui\"`**; **`post_ui_html`** rejects mismatches to bind tokens to the UI endpoint.\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+- **`VoteComparePost`:** On success returns **`text/javascript`** that **morphs** **`#vote-compare-preview`** (new ingest card), **`#vote-edge-history-region`** (recomputed **`
    `** — ratios match **`left`/`right`** query order, bullets, sorted by strength toward **`left`** then newer). The compare **`GET`** page uses **`layout_full_bleed_chromeless`** (no breadcrumbs, no **`#controls`**, no **`slug-pin-hud`**; **`view-vote-compare-fullscreen`** full-width **`body`**). **`__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`**; the label is **`POST /ui`** **`set_garden_pin`** **`clear:true`** (**`slug_ui.js`**), not a permalink to the item.\n+- **Garden pin / compare voting:** Cookie **`slug_garden_pin`** via **`set_garden_pin`**. Pairwise UI: **`GET /vote/compare?…`** / **`GET /r/:room_key/vote/compare?…`** (fullscreen **`GET`** page: no HUD; other garden pages). HUD (**`#slug-pin-hud`**): only 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/api/ui_html.rs b/server/src/api/ui_html.rs\nindex 5aa6a86326ba3545d261322c010e02fe86ee1c57..696e7b3605e2e68aee0351116c494c2958506add 100644\n--- a/server/src/api/ui_html.rs\n+++ b/server/src/api/ui_html.rs\n@@ -254,7 +254,17 @@ async fn dispatch_ui_action(\n };\n n\n };\n- let js = vote_compare_post_success_js(state, &nav, &left_id, &right_id).await;\n+ let js = vote_compare_post_success_js(\n+ state,\n+ &nav,\n+ &room,\n+ &thread_tag,\n+ &left_id,\n+ &right_id,\n+ pid.as_str(),\n+ post_index,\n+ )\n+ .await;\n Response::builder()\n .status(StatusCode::OK)\n .header(header::CONTENT_TYPE, \"text/javascript; charset=utf-8\")\ndiff --git a/server/src/html/garden.rs b/server/src/html/garden.rs\nindex 121d9498e8cb93d4d001dc1bbce23d74fbb958f5..41f9e9c64a80a55a9d3ece2a6a1f592cf5e8d8dd 100644\n--- a/server/src/html/garden.rs\n+++ b/server/src/html/garden.rs\n@@ -22,17 +22,17 @@ use crate::{\n },\n events::ThreadCapability,\n path_types::ItemId,\n- reducer::{ContentState, ReducerState, ScopeId},\n+ reducer::{scope_from_room_wire, ContentState, ReducerState, ScopeId},\n scope_rank::{build_children_rankings, ChildrenRankings},\n state::AppState,\n timeago,\n };\n \n use super::{\n- bc_path, bc_path_external, bc_segment, cli_panel, layout, now_ms, ratio_pct,\n- render_linkified_with_embeds_in_scope, theme_from_jar, theme_next_from_uri,\n+ bc_path, bc_path_external, bc_segment, cli_panel, layout, layout_full_bleed_chromeless, now_ms,\n+ ratio_pct, render_linkified_with_embeds_in_scope, theme_from_jar, theme_next_from_uri,\n breadcrumb_path::{ExternalOntologyPath, OntologyPath},\n- forum::{ThreadNav},\n+ forum::{ingest_entry_markup, ThreadNav},\n };\n \n /// `GET /vote/compare` — pairs `left` / `right` query params with optional `thread`.\n@@ -89,25 +89,62 @@ fn canonical_edge_items(a: &ItemId, b: &ItemId) -> (ItemId, ItemId) {\n }\n }\n \n-/// Votes whose endpoints are exactly this unordered pair, oldest first.\n-fn votes_for_edge(content: &ContentState, a: &ItemId, b: &ItemId) -> Vec {\n+/// All votes whose endpoints are exactly this unordered pair (unsorted).\n+fn edge_vote_entries_for_pair(content: &ContentState, a: &ItemId, b: &ItemId) -> Vec {\n let (lo, hi) = canonical_edge_items(a, b);\n let lo_s = lo.as_str();\n let hi_s = hi.as_str();\n- let mut out: Vec = content\n+ content\n .item_votes\n .get(&lo)\n .into_iter()\n .flat_map(|q| q.iter())\n .filter(|v| {\n- let touches = (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- touches\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 .cloned()\n- .collect();\n- out.sort_by_key(|v| v.ts);\n- out\n+ .collect()\n+}\n+\n+fn ratios_for_compare_page(v: &crate::reducer::VoteData, page_left: &ItemId, page_right: &ItemId) -> (i32, i32) {\n+ let pl = page_left.as_str();\n+ let pr = page_right.as_str();\n+ match (v.a.as_str(), v.b.as_str()) {\n+ (a, b) if a == pl && b == pr => (v.ratio_left, v.ratio_right),\n+ (a, b) if a == pr && b == pl => (v.ratio_right, v.ratio_left),\n+ _ => (v.ratio_left, v.ratio_right),\n+ }\n+}\n+\n+fn left_share_normalized(ratio_left: i32, ratio_right: i32) -> f64 {\n+ let l = ratio_left.max(0) as f64;\n+ let r = ratio_right.max(0) as f64;\n+ let sum = l + r;\n+ if sum <= 0.0 {\n+ 0.5\n+ } else {\n+ l / sum\n+ }\n+}\n+\n+/// Stronger preference for **`page_left` first**; ties **newer first**.\n+fn sort_votes_for_compare_display(\n+ mut votes: Vec,\n+ page_left: &ItemId,\n+ page_right: &ItemId,\n+) -> Vec {\n+ votes.sort_by(|va, vb| {\n+ let (ratio_left_a, ratio_right_a) = ratios_for_compare_page(va, page_left, page_right);\n+ let (ratio_left_b, ratio_right_b) = ratios_for_compare_page(vb, page_left, page_right);\n+ let sa = left_share_normalized(ratio_left_a, ratio_right_a);\n+ let sb = left_share_normalized(ratio_left_b, ratio_right_b);\n+ match sb.partial_cmp(&sa).unwrap_or(std::cmp::Ordering::Equal) {\n+ std::cmp::Ordering::Equal => vb.ts.cmp(&va.ts),\n+ o => o,\n+ }\n+ });\n+ votes\n }\n \n /// Number of vote ingests recorded for this unordered pair in `content` (same scope as ranking).\n@@ -144,39 +181,40 @@ fn vote_edge_history_markup(\n content: &ContentState,\n left: &ItemId,\n right: &ItemId,\n- nav: &ThreadNav,\n ) -> maud::Markup {\n- let votes = votes_for_edge(content, left, right);\n- let (lo, hi) = canonical_edge_items(left, right);\n+ let votes = edge_vote_entries_for_pair(content, left, right);\n+ let votes = sort_votes_for_compare_display(votes, left, right);\n+ let legend_left = item_display_path(left.as_str());\n+ let legend_right = item_display_path(right.as_str());\n html! {\n @if votes.is_empty() {\n p class=\"muted vote-edge-empty\" { \"no votes on this pair in this scope yet\" }\n } @else {\n- h3 class=\"vote-edge-history-title\" { \"votes on this edge\" }\n- ol class=\"vote-edge-history\" {\n+ h3 class=\"vote-edge-history-title\" {\n+ \"votes on this edge\"\n+ span class=\"vote-edge-history-axis muted\" { \" · \" (legend_left) \" : \" (legend_right) }\n+ }\n+ ul class=\"vote-edge-history\" {\n @for v in &votes {\n- @let (ratio_lo, ratio_hi) = if v.a == lo && v.b == hi {\n- (v.ratio_left, v.ratio_right)\n- } else {\n- (v.ratio_right, v.ratio_left)\n- };\n- @let pct = ratio_pct(ratio_lo, ratio_hi);\n- @let left_class = if lo.as_str() == left.as_str() { \"ratio-left current\" } else { \"ratio-left\" };\n- @let right_class = if hi.as_str() == left.as_str() { \"ratio-right current\" } else { \"ratio-right\" };\n- li class=\"vote-edge-history-row\" {\n+ @let (r_left, r_right) = ratios_for_compare_page(v, left, right);\n+ @let pct = ratio_pct(r_left, r_right);\n+ @let row_tip = format!(\n+ \"{}:{} counts toward {} (left of bar) vs {} (right of bar); #{} · @{}\",\n+ r_left,\n+ r_right,\n+ legend_left,\n+ legend_right,\n+ v.thread_tag,\n+ v.principal,\n+ );\n+ li class=\"vote-edge-history-row\" title=(row_tip) {\n div class=\"vote-edge-meta\" {\n- a href=(nav.garden_item_href(&lo)) {\n- code { (item_display_path(lo.as_str())) }\n- }\n- span class=\"vote-edge-ratio\" { (format!(\"{}:{}\", ratio_lo, ratio_hi)) }\n- a href=(nav.garden_item_href(&hi)) {\n- code { (item_display_path(hi.as_str())) }\n- }\n+ span class=\"vote-edge-ratio\" { (format!(\"{}:{}\", r_left, r_right)) }\n span class=\"muted\" { \" · #\" (v.thread_tag) \" · @\" (v.principal) }\n }\n- div class=\"ratio-bar vote-edge-bar\" {\n- div class=(left_class) style={(format!(\"width: {:.3}%;\", pct))} {}\n- div class=(right_class) style={(format!(\"width: {:.3}%;\", 100.0 - pct))} {}\n+ div class=\"ratio-bar vote-edge-bar\" aria-hidden=\"true\" {\n+ div class=\"ratio-left\" style={(format!(\"width: {:.3}%;\", pct))} {}\n+ div class=\"ratio-right\" style={(format!(\"width: {:.3}%;\", 100.0 - pct))} {}\n }\n @if !v.body.trim().is_empty() {\n div class=\"vote-edge-reason muted\" { (v.body.trim()) }\n@@ -192,14 +230,33 @@ fn vote_edge_history_markup(\n pub(crate) async fn vote_compare_post_success_js(\n state: &AppState,\n nav: &ThreadNav,\n+ room_wire: &str,\n+ thread_tag: &str,\n left: &ItemId,\n right: &ItemId,\n+ post_id: &str,\n+ post_idx: Option,\n ) -> String {\n let reduced = state.reduced.read().await;\n+ let scope = scope_from_room_wire(room_wire);\n+ let Some(ing) = reduced.ingests_by_id.get(post_id).cloned() else {\n+ drop(reduced);\n+ return \"console.warn('vote compare: new post not found');\".to_string();\n+ };\n+ let idx = match post_idx {\n+ Some(i) => i,\n+ None => reduced\n+ .try_thread_post_index_chronological(&scope, thread_tag, post_id)\n+ .unwrap_or(0),\n+ };\n+ let viewer = None::<&str>;\n+ let now = now_ms();\n let content = content_for_garden_view(&reduced, &nav.scope());\n- let edge_history = vote_edge_history_markup(content, left, right, nav);\n+ let edge_history = vote_edge_history_markup(content, left, right);\n+ let card = ingest_entry_markup(nav, thread_tag, idx, &ing, viewer, now, &reduced);\n drop(reduced);\n let mut b = JsBuilder::new();\n+ b = b.morph_inner_selector(\"#vote-compare-preview\", card);\n b = b.morph_inner_selector(\"#vote-edge-history-region\", edge_history);\n b.build()\n }\n@@ -1259,7 +1316,7 @@ async fn vote_compare_inner(\n .filter(|t| !t.is_empty())\n .unwrap_or_else(|| pick_autothread_for_vote_pair(content, &left, &right));\n let thread_tags = vote_thread_tags_for_pair(content, &left, &right);\n- let edge_history = vote_edge_history_markup(content, &left, &right, &nav);\n+ let edge_history = vote_edge_history_markup(content, &left, &right);\n drop(reduced);\n \n let title = format!(\"vote — {} vs {}\", item_display_path(left.as_str()), item_display_path(right.as_str()));\n@@ -1282,15 +1339,6 @@ async fn vote_compare_inner(\n .expect(\"vote compare rpc json\");\n \n let body = html! {\n- nav class=\"breadcrumb\" {\n- a href=\"/\" { \"slug.social\" }\n- @let vote_bc_href = if nav.room_path_prefix_for_vote_compare().is_empty() {\n- \"/vote/compare\".to_string()\n- } else {\n- format!(\"{}/vote/compare\", nav.room_path_prefix_for_vote_compare())\n- };\n- (bc_segment(\"vote\", &vote_bc_href, true))\n- }\n section class=\"vote-compare-shell\" {\n h2 { \"compare\" }\n div class=\"vote-compare-pair\" {\n@@ -1305,6 +1353,10 @@ async fn vote_compare_inner(\n div id=\"vote-edge-history-region\" {\n (edge_history)\n }\n+ div class=\"vote-compare-preview-wrap\" {\n+ h3 { \"your vote (after post)\" }\n+ div id=\"vote-compare-preview\" class=\"vote-compare-preview\" {}\n+ }\n @if can_post {\n form id=\"vote-compare-form\" method=\"POST\" action=\"/ui\" {\n input type=\"hidden\" name=(UI_RPC_FIELD) value=(rpc_json);\n@@ -1342,16 +1394,12 @@ async fn vote_compare_inner(\n }\n };\n \n- let (gr, gp) = garden_layout_meta(&nav);\n- let page = layout(\n+ let page = layout_full_bleed_chromeless(\n &title,\n- \"view-ontology view-ontology-light view-vote-compare\",\n+ \"view-ontology view-ontology-light view-vote-compare view-vote-compare-fullscreen\",\n body,\n- None,\n theme_from_jar(&jar),\n &theme_next_from_uri(&uri),\n- Some(&gr),\n- Some(&gp),\n );\n Html(page.into_string()).into_response()\n }\n@@ -1388,10 +1436,40 @@ mod tests {\n }));\n }\n \n+ #[test]\n+ fn vote_edge_compare_sorts_rows_by_strength_for_page_left() {\n+ use super::{\n+ content_for_garden_view, edge_vote_entries_for_pair, ratios_for_compare_page,\n+ sort_votes_for_compare_display,\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 1:9 ~/topic/b {weak for a}\\n\\\n+ ~/topic/a 8:2 ~/topic/b {strong for a}\\n\",\n+ );\n+ let content = content_for_garden_view(&reduced, &ScopeId::Public);\n+ let page_left = ItemId::parse(\"~/topic/a\").unwrap().normalized_storage();\n+ let page_right = ItemId::parse(\"~/topic/b\").unwrap().normalized_storage();\n+ let raw = edge_vote_entries_for_pair(content, &page_left, &page_right);\n+ assert_eq!(raw.len(), 2);\n+ let sorted = sort_votes_for_compare_display(raw, &page_left, &page_right);\n+ let (r0, _) = ratios_for_compare_page(&sorted[0], &page_left, &page_right);\n+ assert_eq!(r0, 8, \"stronger left weight should sort first\");\n+ let (r1, _) = ratios_for_compare_page(&sorted[1], &page_left, &page_right);\n+ assert_eq!(r1, 1);\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+ content_for_garden_view, edge_vote_count_for_pair, edge_vote_entries_for_pair,\n };\n use crate::path_types::ItemId;\n let mut reduced = ReducerState::default();\n@@ -1410,9 +1488,9 @@ mod tests {\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+ edge_vote_entries_for_pair(content, &a, &b).len()\n );\n- assert_eq!(votes_for_edge(content, &a, &b).len(), 2);\n+ assert_eq!(edge_vote_entries_for_pair(content, &a, &b).len(), 2);\n }\n \n #[test]\ndiff --git a/server/src/html/mod.rs b/server/src/html/mod.rs\nindex 40c15debe91a708da24dc1dec2ece2a852dd6381..f57b66f510dfaade1b656990fb2cbb30d16e5bf1 100644\n--- a/server/src/html/mod.rs\n+++ b/server/src/html/mod.rs\n@@ -304,6 +304,28 @@ pub(super) fn layout(\n layout_embed_controls(title, view, body, views, theme, theme_next, garden_room_wire, garden_path_prefix, true)\n }\n \n+/// Minimal document shell: no bottom controls, no garden HUD data attributes (`data-garden-room` /\n+/// `data-garden-prefix` empty). For routes that own the full viewport (e.g. vote compare).\n+pub(super) fn layout_full_bleed_chromeless(\n+ title: &str,\n+ view: &str,\n+ body: Markup,\n+ theme: &str,\n+ theme_next: &str,\n+) -> Markup {\n+ layout_embed_controls(\n+ title,\n+ view,\n+ body,\n+ None,\n+ theme,\n+ theme_next,\n+ None,\n+ None,\n+ false,\n+ )\n+}\n+\n fn layout_embed_controls(\n title: &str,\n view: &str,\ndiff --git a/server/static/theme_default.css b/server/static/theme_default.css\nindex 9178f0629cfb868348740e6dea1626dc6afb8345..a441c4f79d8cf88f5a8240f9992f47dbbd1ab46b 100644\n--- a/server/static/theme_default.css\n+++ b/server/static/theme_default.css\n@@ -1054,6 +1054,26 @@ body.view-vote-compare #vote-explain:focus {\n body.view-vote-compare #vote-compare-form button[type=\"submit\"] {\n margin-top: 6px;\n }\n+\n+body.view-vote-compare-fullscreen {\n+ max-width: none;\n+ width: 100%;\n+ margin-left: 0;\n+ margin-right: 0;\n+ padding: clamp(8px, 2.5vw, 28px);\n+ padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));\n+ padding-top: max(8px, env(safe-area-inset-top, 0px));\n+ min-height: 100vh;\n+ min-height: 100dvh;\n+ box-sizing: border-box;\n+}\n+body.view-vote-compare-fullscreen .vote-compare-shell {\n+ max-width: none;\n+ width: 100%;\n+ box-sizing: border-box;\n+ margin: 0;\n+}\n+\n .vote-edge-history-title {\n font-size: 12px;\n letter-spacing: 0.06em;\n@@ -1061,9 +1081,15 @@ body.view-vote-compare #vote-compare-form button[type=\"submit\"] {\n color: var(--meta);\n margin: 16px 0 8px;\n }\n-ol.vote-edge-history {\n+.vote-edge-history-axis {\n+ text-transform: none;\n+ letter-spacing: normal;\n+ font-size: 13px;\n+}\n+ul.vote-edge-history {\n margin: 0;\n- padding-left: 1.2em;\n+ padding-left: 1.35em;\n+ list-style-type: disc;\n }\n li.vote-edge-history-row {\n margin: 10px 0;\ndiff --git a/server/static/theme_retro.css b/server/static/theme_retro.css\nindex f2d0ddee113995817a7f9bfa8500b2f5e7d81cf4..373f15bbd75b62604cdd14b9f0fadda2d6176991 100644\n--- a/server/static/theme_retro.css\n+++ b/server/static/theme_retro.css\n@@ -176,3 +176,21 @@ nav.breadcrumb.ont-sibling-nav span.ont-sibling-nav-group-sep {\n border-right: none;\n border-top: none;\n }\n+\n+body.view-vote-compare-fullscreen {\n+ max-width: none;\n+ width: 100%;\n+ margin: 0;\n+ padding: clamp(8px, 2.5vw, 20px);\n+ padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));\n+ padding-top: max(8px, env(safe-area-inset-top, 0px));\n+ min-height: 100vh;\n+ min-height: 100dvh;\n+ box-sizing: border-box;\n+}\n+body.view-vote-compare-fullscreen .vote-compare-shell {\n+ max-width: none;\n+ width: 100%;\n+ box-sizing: border-box;\n+ margin: 0;\n+}\ndiff --git a/server/static/theme_retro_craft.css b/server/static/theme_retro_craft.css\nindex efaeed06d01fd835df0621f4c621c8f034c8b536..0871e3126c656ba534306cdc3f405f802d10b589 100644\n--- a/server/static/theme_retro_craft.css\n+++ b/server/static/theme_retro_craft.css\n@@ -785,6 +785,24 @@ body.view-ontology.view-vote-compare .vote-compare-shell {\n border-radius: 3px;\n box-shadow: 0 1px 0 rgba(26, 24, 20, 0.06);\n }\n+body.view-ontology.view-vote-compare.view-vote-compare-fullscreen .vote-compare-shell {\n+ max-width: none;\n+ width: 100%;\n+ min-height: calc(100dvh - clamp(20px, 5vw, 56px));\n+ margin: 0;\n+ box-sizing: border-box;\n+}\n+body.view-vote-compare-fullscreen {\n+ max-width: none !important;\n+ width: 100%;\n+ margin: 0 !important;\n+ padding: clamp(6px, 2vw, 1.75rem);\n+ padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));\n+ padding-top: max(6px, env(safe-area-inset-top, 0px));\n+ min-height: 100vh;\n+ min-height: 100dvh;\n+ box-sizing: border-box;\n+}\n body.view-ontology.view-vote-compare .vote-compare-shell > h2 {\n margin-top: 0;\n font-size: 0.7rem;\n@@ -910,9 +928,16 @@ body.view-ontology .vote-edge-history-title {\n color: #5c574e;\n margin: 0 0 0.5rem;\n }\n-body.view-ontology ol.vote-edge-history {\n+body.view-ontology .vote-edge-history-axis {\n+ text-transform: none;\n+ letter-spacing: normal;\n+ font-size: 0.82rem;\n+ font-weight: 400;\n+}\n+body.view-ontology ul.vote-edge-history {\n margin: 0;\n- padding-left: 1.1rem;\n+ padding-left: 1.25rem;\n+ list-style-type: disc;\n }\n body.view-ontology li.vote-edge-history-row {\n margin: 0.65rem 0;\ndiff --git a/test/browser_vote_compare.clj b/test/browser_vote_compare.clj\nindex 26fcff8bceb0c10bcd5ddfdae1aa145b56b7a0d1..78fc40c160c84478ab8ee0d953b9ed878b4c712f 100644\n--- a/test/browser_vote_compare.clj\n+++ b/test/browser_vote_compare.clj\n@@ -72,13 +72,13 @@\n (is (wait-for-text pg \"body\" \"@alice\" 15000) \"alice session after login\")\n (page/navigate pg cmp-url)\n (is (wait-for-text pg \".vote-compare-shell\" \"compare\" 15000) \"vote compare shell\")\n- (is (wait-for-text pg \"ol.vote-edge-history\" \"seed edge vote\" 15000)\n+ (is (wait-for-text pg \"ul.vote-edge-history\" \"seed edge vote\" 15000)\n \"edge history lists canonical-order vote\")\n (locator/fill (page/locator pg \"#vote-explain\") \"because playwright says so\")\n (locator/click (page/locator pg \"#vote-compare-form button[type=submit]\"))\n (is (wait-for-text pg \"#vote-compare-preview\" \"because playwright\" 20000)\n \"preview region morphs new post card\")\n- (is (wait-for-text pg \"ol.vote-edge-history\" \"because playwright\" 20000)\n+ (is (wait-for-text pg \"ul.vote-edge-history\" \"because playwright\" 20000)\n \"new vote appears in edge history after morph\"))))))\n \n (finally\n","role":"user"}],"model":"~anthropic/claude-sonnet-latest"}