{"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[07715165] nice\n\nSide A — unified diff (full patch):\ndiff --git a/server/src/api/ui_html.rs b/server/src/api/ui_html.rs\nindex c3c62a76f424010d77a6090c84dd0b82098f573e..da2536112faea313352624cf2ce0ddd0ab3377c1 100644\n--- a/server/src/api/ui_html.rs\n+++ b/server/src/api/ui_html.rs\n@@ -6,7 +6,7 @@ use axum::{\n use std::collections::HashMap;\n \n use crate::{\n- html::{demo_counter_panel, js_string_literal, ranking_panel, JsBuilder},\n+ html::{js_string_literal, ranking_panel, JsBuilder},\n parser::parse_reddit_url,\n parser_render::parser_panel_morph,\n state::AppState,\n@@ -35,13 +35,6 @@ pub async fn post_ui_html(\n };\n \n match action {\n- HtmlUiAction::BumpDemoCounter => {\n- let count = state.bump_demo_counter().await;\n- let panel = demo_counter_panel(count, state.event_log.path().to_string_lossy().as_ref());\n- JsBuilder::new()\n- .morph_selector(\"#demo-counter-panel\", panel)\n- .into_response()\n- }\n HtmlUiAction::RecordVote {\n a,\n b,\n@@ -54,8 +47,8 @@ pub async fn post_ui_html(\n {\n return ui_js_warn(&e).into_response();\n }\n- let mut group = state.group.write().await;\n- let panel = ranking_panel(&mut group);\n+ let group = state.group.read().await;\n+ let panel = ranking_panel(&group);\n JsBuilder::new()\n .morph_selector(\"#ranking-panel\", panel)\n .into_response()\n@@ -87,20 +80,6 @@ mod tests {\n assert!(matches!(err, HtmlUiParseError::MissingRpc));\n }\n \n- #[test]\n- fn bump_action_deserializes() {\n- let template = serde_json::json!({ \"action\": \"bump_demo_counter\" });\n- let mut form = HashMap::new();\n- form.insert(\n- UI_RPC_FIELD.to_string(),\n- serde_json::to_string(&template).unwrap(),\n- );\n- assert_eq!(\n- parse_html_ui_from_form(&form).unwrap(),\n- HtmlUiAction::BumpDemoCounter\n- );\n- }\n-\n #[test]\n fn record_vote_action_deserializes() {\n let template = serde_json::json!({\ndiff --git a/server/src/events.rs b/server/src/events.rs\nindex b969242534e184d4f0a689543a479670b08a18df..eff80aef0257f706d2341f666e63d6a3d921bf6e 100644\n--- a/server/src/events.rs\n+++ b/server/src/events.rs\n@@ -5,8 +5,6 @@ use serde::{Deserialize, Serialize};\n pub enum Event {\n /// Page view recorded (path → counter in views.json).\n ViewRecorded { path: String, ts: i64 },\n- /// Demo counter bump from `POST /ui` (persisted in the single JSONL log).\n- DemoCounterBumped { ts: i64, value: u64 },\n /// Pairwise comparison vote (replayed into [`crate::reducer::GroupState`] on boot).\n VoteRecorded {\n ts: i64,\ndiff --git a/server/src/html/mod.rs b/server/src/html/mod.rs\nindex 5b1d0b5a887d89e7e80796aa7a6c8ed5baaf2782..d69ed962b5c8625bc83c933b1825f2cc1d0868e2 100644\n--- a/server/src/html/mod.rs\n+++ b/server/src/html/mod.rs\n@@ -13,7 +13,7 @@ use crate::{\n form_template::template_json_compact,\n parser_action::ParserAction,\n parser_render::parser_panel,\n- ranking::ranked_items,\n+ ranking::ranked_items_cached,\n reducer::GroupState,\n state::AppState,\n ui_action::UI_RPC_FIELD,\n@@ -199,10 +199,8 @@ fn layout(title: &str, body: Markup, views: u64, theme: &str, theme_next: &str)\n }\n }\n \n-pub fn ranking_panel(group: &mut GroupState) -> Markup {\n- const MAX_ITERS: usize = 10_000;\n- const TOL: f64 = 1e-8;\n- let items = ranked_items(group, MAX_ITERS, TOL);\n+pub fn ranking_panel(group: &GroupState) -> Markup {\n+ let items = ranked_items_cached(group);\n html! {\n section id=\"ranking-panel\" class=\"demo-panel\" {\n h2 { \"Ranking\" }\n@@ -260,35 +258,6 @@ pub fn vote_panel() -> Markup {\n }\n \n \n-pub fn demo_counter_panel(count: u64, event_log_path: &str) -> Markup {\n- let rpc = template_json_compact(&serde_json::json!({ \"action\": \"bump_demo_counter\" }))\n- .expect(\"rpc json\");\n- html! {\n- section id=\"demo-counter-panel\" class=\"demo-panel\" {\n- h1 { \"sorter2\" }\n- p class=\"muted\" {\n- \"Pairwise ranking scaffold — votes persist to JSONL and replay on boot.\"\n- }\n- p class=\"demo-count\" {\n- strong { \"Counter: \" }\n- span id=\"demo-count-value\" { (count) }\n- }\n- p class=\"muted small\" {\n- \"Event log: \" code { (event_log_path) }\n- }\n- form method=\"post\" action=\"/ui\" id=\"demo-bump-form\" {\n- input type=\"hidden\" name=(UI_RPC_FIELD) value=(rpc);\n- button type=\"submit\" class=\"btn-primary\" { \"Bump (POST /ui → eval JS)\" }\n- }\n- p class=\"muted small\" {\n- \"Uses hidden \"\n- code { \"__rpc__\" }\n- \" JSON + Idiomorph morph — no full page reload.\"\n- }\n- }\n- }\n-}\n-\n pub async fn home(\n State(state): State,\n jar: CookieJar,\n@@ -297,16 +266,15 @@ pub async fn home(\n let path = uri.path().to_string();\n state.views.increment(path.clone());\n let views = state.views.get_views(&path);\n- let count = *state.demo_counter.read().await;\n let theme = theme_from_jar(&jar);\n let theme_next = theme_next_from_uri(&uri);\n- let mut group = state.group.write().await;\n+ let group = state.group.read().await;\n let empty_action = ParserAction::suggest(String::new(), None);\n let body = html! {\n+ h1 { \"sorter2\" }\n (parser_panel(\"\", &empty_action))\n (vote_panel())\n- (ranking_panel(&mut group))\n- (demo_counter_panel(count, state.event_log.path().to_string_lossy().as_ref()))\n+ (ranking_panel(&group))\n };\n layout(\"sorter2\", body, views, theme, &theme_next)\n }\ndiff --git a/server/src/lib.rs b/server/src/lib.rs\nindex 6716c5b282e7980a7a0f03d63ad8b25eda61cc55..fa423640d598f4ba97a5885d228e78d7b97f7a22 100644\n--- a/server/src/lib.rs\n+++ b/server/src/lib.rs\n@@ -9,6 +9,7 @@ pub mod parser_render;\n pub mod path_types;\n pub mod ranking;\n pub mod reducer;\n+pub mod settlement;\n pub mod state;\n pub mod ui_action;\n pub mod views;\ndiff --git a/server/src/ranking.rs b/server/src/ranking.rs\nindex 89d3280126a8d8f841721ce8cb63ff735d68752a..2d706762792ba9239bb3f1c2e4974a2fde908013 100644\n--- a/server/src/ranking.rs\n+++ b/server/src/ranking.rs\n@@ -91,6 +91,11 @@ pub fn compute_group_ranking(group: &mut GroupState, max_iters: usize, tol: f64)\n \n pub fn ranked_items(group: &mut GroupState, max_iters: usize, tol: f64) -> Vec {\n compute_group_ranking(group, max_iters, tol);\n+ ranked_items_cached(group)\n+}\n+\n+/// Read cached scores without recomputing (HTTP fast path).\n+pub fn ranked_items_cached(group: &GroupState) -> Vec {\n let mut items: Vec = group\n .idx_to_item\n .iter()\n@@ -105,7 +110,12 @@ pub fn ranked_items(group: &mut GroupState, max_iters: usize, tol: f64) -> Vec, max_iters: usize, tol: f64) -> Vec {\n+pub fn compute_scores_from_edges(\n+ n: usize,\n+ edges: impl Iterator,\n+ max_iters: usize,\n+ tol: f64,\n+) -> Vec {\n if n == 0 {\n return vec![];\n }\ndiff --git a/server/src/settlement.rs b/server/src/settlement.rs\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..1f722ceaea62cda22c28ab71551f259fbf049b81\n--- /dev/null\n+++ b/server/src/settlement.rs\n@@ -0,0 +1,114 @@\n+use std::sync::Arc;\n+\n+use tokio::sync::{mpsc, oneshot, RwLock};\n+\n+use crate::{\n+ event_log::EventLog,\n+ events::Event,\n+ ranking::compute_scores_from_edges,\n+ reducer::{GroupState, VoteData},\n+};\n+\n+const MAX_ITERS: usize = 10_000;\n+const TOL: f64 = 1e-8;\n+\n+pub struct SettlementCommand {\n+ pub vote: VoteData,\n+ pub event: Event,\n+ pub reply: oneshot::Sender>,\n+}\n+\n+#[derive(Clone)]\n+pub struct SettlementClient {\n+ tx: mpsc::Sender,\n+}\n+\n+impl SettlementClient {\n+ pub fn spawn(group: Arc>, event_log: Arc) -> Self {\n+ let (tx, rx) = mpsc::channel(64);\n+ tokio::spawn(settlement_worker(rx, group, event_log));\n+ Self { tx }\n+ }\n+\n+ pub async fn record_vote(&self, vote: VoteData, event: Event) -> Result<(), String> {\n+ let (reply, rx) = oneshot::channel();\n+ self.tx\n+ .send(SettlementCommand {\n+ vote,\n+ event,\n+ reply,\n+ })\n+ .await\n+ .map_err(|_| \"settlement worker stopped\".to_string())?;\n+ rx.await\n+ .map_err(|_| \"settlement worker stopped\".to_string())?\n+ }\n+}\n+\n+async fn settlement_worker(\n+ mut rx: mpsc::Receiver,\n+ group: Arc>,\n+ event_log: Arc,\n+) {\n+ while let Some(first) = rx.recv().await {\n+ let mut batch = vec![first];\n+ while let Ok(more) = rx.try_recv() {\n+ batch.push(more);\n+ }\n+\n+ let mut disk_err: Option = None;\n+ for cmd in &batch {\n+ if let Err(e) = event_log.append(&cmd.event).await {\n+ disk_err = Some(e.to_string());\n+ break;\n+ }\n+ }\n+\n+ if let Some(err) = disk_err {\n+ for cmd in batch {\n+ let _ = cmd.reply.send(Err(err.clone()));\n+ }\n+ continue;\n+ }\n+\n+ let (edges, n) = {\n+ let mut w = group.write().await;\n+ for cmd in &batch {\n+ w.apply_vote(cmd.vote.clone());\n+ }\n+ (w.edges.clone(), w.idx_to_item.len())\n+ };\n+\n+ let new_scores = compute_scores_from_edges(\n+ n,\n+ edges.iter().map(|(&k, &v)| (k, v)),\n+ MAX_ITERS,\n+ TOL,\n+ );\n+\n+ {\n+ let mut w = group.write().await;\n+ w.cached_scores = new_scores;\n+ w.dirty = false;\n+ }\n+\n+ for cmd in batch {\n+ let _ = cmd.reply.send(Ok(()));\n+ }\n+ }\n+}\n+\n+/// Compute ranking cache from current in-memory edges (startup replay only).\n+pub fn warm_ranking_cache(group: &mut GroupState) {\n+ if !group.dirty {\n+ return;\n+ }\n+ let n = group.idx_to_item.len();\n+ group.cached_scores = compute_scores_from_edges(\n+ n,\n+ group.edges.iter().map(|(&k, &v)| (k, v)),\n+ MAX_ITERS,\n+ TOL,\n+ );\n+ group.dirty = false;\n+}\ndiff --git a/server/src/state.rs b/server/src/state.rs\nindex 8ec9902e2ecc31cf8208f7ad6365891dc5537eed..1922541a4064c2de1df2d993a461cae783320e05 100644\n--- a/server/src/state.rs\n+++ b/server/src/state.rs\n@@ -6,6 +6,7 @@ use crate::{\n event_log::EventLog,\n events::Event,\n reducer::{GroupState, VoteData},\n+ settlement::{warm_ranking_cache, SettlementClient},\n views::ViewStore,\n };\n \n@@ -38,8 +39,8 @@ pub struct AppState {\n pub cfg: Arc,\n pub event_log: Arc,\n pub views: ViewStore,\n- pub demo_counter: Arc>,\n pub group: Arc>,\n+ settlement: SettlementClient,\n }\n \n impl AppState {\n@@ -48,14 +49,10 @@ impl AppState {\n let views_path = format!(\"{}/views.json\", cfg.data_dir);\n let views = ViewStore::new(&views_path);\n \n- let mut demo_counter: u64 = 0;\n let mut group = GroupState::new();\n if let Ok((events, _)) = event_log.load_all().await {\n for ev in events {\n match ev {\n- Event::DemoCounterBumped { value, .. } => {\n- demo_counter = demo_counter.max(value);\n- }\n Event::VoteRecorded {\n ts,\n a,\n@@ -74,30 +71,20 @@ impl AppState {\n }\n }\n \n+ warm_ranking_cache(&mut group);\n+\n+ let group = Arc::new(RwLock::new(group));\n+ let settlement = SettlementClient::spawn(group.clone(), event_log.clone());\n+\n Self {\n cfg: Arc::new(cfg),\n event_log,\n views,\n- demo_counter: Arc::new(RwLock::new(demo_counter)),\n- group: Arc::new(RwLock::new(group)),\n+ group,\n+ settlement,\n }\n }\n \n- pub async fn bump_demo_counter(&self) -> u64 {\n- let mut guard = self.demo_counter.write().await;\n- *guard += 1;\n- let value = *guard;\n- drop(guard);\n-\n- let ts = crate::html::now_ms();\n- let _ = self\n- .event_log\n- .append(&Event::DemoCounterBumped { ts, value })\n- .await;\n-\n- value\n- }\n-\n pub async fn record_vote(\n &self,\n a: &str,\n@@ -109,23 +96,14 @@ impl AppState {\n let vote = VoteData::from_recorded(ts, a, b, ratio_left, ratio_right)\n .ok_or_else(|| \"invalid vote: need two distinct non-empty items\".to_string())?;\n \n- {\n- let mut group = self.group.write().await;\n- group.apply_vote(vote.clone());\n- }\n-\n- let _ = self\n- .event_log\n- .append(&Event::VoteRecorded {\n- ts,\n- a: vote.a.as_str().to_string(),\n- b: vote.b.as_str().to_string(),\n- ratio_left: vote.ratio_left,\n- ratio_right: vote.ratio_right,\n- })\n- .await\n- .map_err(|e| e.to_string())?;\n+ let event = Event::VoteRecorded {\n+ ts,\n+ a: vote.a.as_str().to_string(),\n+ b: vote.b.as_str().to_string(),\n+ ratio_left: vote.ratio_left,\n+ ratio_right: vote.ratio_right,\n+ };\n \n- Ok(())\n+ self.settlement.record_vote(vote, event).await\n }\n }\ndiff --git a/server/src/ui_action.rs b/server/src/ui_action.rs\nindex 1d488e1ad1d8fd81bd9d016d69255adfe9b22fc8..5d94c84113607b3bcd8d31d03ef5b8e1b87b67a7 100644\n--- a/server/src/ui_action.rs\n+++ b/server/src/ui_action.rs\n@@ -12,8 +12,6 @@ pub const UI_RPC_FIELD: &str = \"__rpc__\";\n #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]\n #[serde(tag = \"action\", rename_all = \"snake_case\")]\n pub enum HtmlUiAction {\n- /// Demo: morph `#demo-counter-panel` after bumping the persisted counter.\n- BumpDemoCounter,\n /// Record a pairwise vote and morph `#ranking-panel`.\n RecordVote {\n a: String,\n@@ -52,18 +50,6 @@ pub fn parse_html_ui_from_form(\n mod tests {\n use super::*;\n \n- #[test]\n- fn bump_demo_counter_round_trip() {\n- let template = serde_json::json!({ \"action\": \"bump_demo_counter\" });\n- let mut form = HashMap::new();\n- form.insert(\n- UI_RPC_FIELD.to_string(),\n- serde_json::to_string(&template).unwrap(),\n- );\n- let a = parse_html_ui_from_form(&form).unwrap();\n- assert_eq!(a, HtmlUiAction::BumpDemoCounter);\n- }\n-\n #[test]\n fn record_vote_round_trip_with_form_holes() {\n let template = serde_json::json!({\ndiff --git a/server/tests/integration_health.rs b/server/tests/integration_health.rs\nindex 8a58bc14aac68c779e7ce4ffa57d27b3220e9953..1d816e008b9bf629967e3b3c786c41afefc284e3 100644\n--- a/server/tests/integration_health.rs\n+++ b/server/tests/integration_health.rs\n@@ -38,7 +38,7 @@ async fn healthz_ok() {\n }\n \n #[tokio::test]\n-async fn home_has_demo_panel() {\n+async fn home_has_main_panels() {\n let (addr, _tmp) = start_test_server().await;\n let client = reqwest::Client::new();\n let html = client\ndiff --git a/server/tests/integration_ui.rs b/server/tests/integration_ui.rs\nindex bee79407dec120699a083f1a75adf9291e207fc7..7ede46d681fefbe25b1d98fc33520a185515eb1c 100644\n--- a/server/tests/integration_ui.rs\n+++ b/server/tests/integration_ui.rs\n@@ -25,33 +25,6 @@ async fn start_test_server() -> (SocketAddr, TempDir) {\n (addr, tmp)\n }\n \n-#[tokio::test]\n-async fn post_ui_bump_returns_javascript_morph() {\n- let (addr, tmp) = start_test_server().await;\n- let rpc = serde_json::json!({ \"action\": \"bump_demo_counter\" }).to_string();\n- let mut form = HashMap::new();\n- form.insert(UI_RPC_FIELD.to_string(), rpc);\n-\n- let client = reqwest::Client::new();\n- let body = client\n- .post(format!(\"http://{addr}/ui\"))\n- .form(&form)\n- .send()\n- .await\n- .unwrap()\n- .text()\n- .await\n- .unwrap();\n-\n- assert!(body.contains(\"Idiomorph.morph\"));\n- assert!(body.contains(\"demo-counter-panel\"));\n- assert!(body.contains(\"Counter:\"));\n-\n- let log_path = tmp.path().join(\"events.jsonl\");\n- let log = std::fs::read_to_string(log_path).unwrap();\n- assert!(log.contains(\"demo_counter_bumped\"));\n-}\n-\n #[tokio::test]\n async fn post_ui_record_vote_morphs_ranking_and_persists() {\n let (addr, tmp) = start_test_server().await;\n@@ -90,8 +63,8 @@ async fn post_ui_record_vote_morphs_ranking_and_persists() {\n port: 0,\n };\n let state = create_app_state(cfg).await;\n- let mut group = state.group.write().await;\n- let ranked = sorter2_server::ranking::ranked_items(&mut group, 10_000, 1e-8);\n+ let group = state.group.read().await;\n+ let ranked = sorter2_server::ranking::ranked_items_cached(&group);\n assert_eq!(ranked.len(), 2);\n assert_eq!(ranked[0].item.as_str(), \"alpha\");\n }\ndiff --git a/test/smoke.clj b/test/smoke.clj\nindex b332324743b58baf3fe96d7477353749f137feae..11887c48282088e140d823a88ba616f6325835b3 100644\n--- a/test/smoke.clj\n+++ b/test/smoke.clj\n@@ -26,7 +26,7 @@\n false))))))\n \n (deftest http-smoke-against-running-server\n- (testing \"build, start, healthz, home contains RPC demo\"\n+ (testing \"build, start, healthz, home contains main panels\"\n (let [root (repo-root)\n data-dir (.getAbsolutePath (doto (io/file (System/getProperty \"java.io.tmpdir\")\n (str \"sorter2-smoke-\" (System/currentTimeMillis)))\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[6bda2635] Use title-first items and explanation-first votes (#135)\n\n* Require block-first sorter DSL statements\n\nCo-authored-by: tommy \n\n* Use title-first items with explanation-first votes\n\nCo-authored-by: tommy \n\n* Update garden vote test DSL fixtures\n\nCo-authored-by: tommy \n\n* Update browser vote DSL payloads\n\nCo-authored-by: tommy \n\n---------\n\nCo-authored-by: Cursor Agent \n\nSide B — unified diff (full patch):\ndiff --git a/cli/DSL.txt b/cli/DSL.txt\nindex 18f69ef25f01583fddf9fc90e077bb2c3fa72bb6..c9b12bf0edaf73ad252f0a202b7fe61e311df50a 100644\n--- a/cli/DSL.txt\n+++ b/cli/DSL.txt\n@@ -18,9 +18,20 @@ Blank lines are preserved to maintain paragraph structure.\n ~/item/a {itembody}\n ~/python { A high-level scripting language }\n \n-~/item/a > ~/python { Item A is better because of X. }\n-~/python 3:1 ~/go { Python's ecosystem is much richer than Go's. }\n-https://example.com/lang = ~/go { They are equally good in this context. }\n+{\n+Item A is better because of X.\n+}\n+~/item/a > ~/python\n+\n+{\n+Python's ecosystem is much richer than Go's.\n+}\n+~/python 3:1 ~/go\n+\n+{\n+They are equally good in this context.\n+}\n+https://example.com/lang = ~/go\n ```\n \n SYNTAX RULES\n@@ -35,7 +46,7 @@ Starts a thread. Tag allows alphanumeric, `-`, `_`, and `/`. Subtitle max 100 ch\n ~/ { description }\n ```\n Defines an ontology item (garden layer). Paths can be nested (e.g. `~/languages/python`).\n-A leading `/` alone is **not** allowed in the DSL — use `~/` only. Descriptions (bodies) are wrapped in `{}`. Can be adjacent (e.g. `~/arrived{ready}`).\n+A leading `/` alone is **not** allowed in the DSL — use `~/` only. Descriptions (bodies) are wrapped in `{}` and follow the item path.\n \n ```sorter\n https://example.com/item { description }\n@@ -46,7 +57,10 @@ Canonicalization rules for URLs:\n - `~/` and `https://slug.social/~/` map to the same local item path.\n \n ```sorter\n- { required explanation }\n+{\n+required explanation\n+}\n+ \n ```\n Compares two items. The explanation is REQUIRED.\n Comparisons:\n@@ -65,7 +79,8 @@ When writing bodies or explanations, you can use braces `{}` and code blocks wit\n 3. Single braces: { ... }\n \n ```sorter\n-~/code { Here is a block: ```def foo(): return {\"a\": 1}``` }\n+{ Here is a block: ```def foo(): return {\"a\": 1}``` }\n+~/code\n ```\n \n STYLE\ndiff --git a/cli/GUIDE.sorter b/cli/GUIDE.sorter\nindex 7ea1c2649cb4a323b46f0bf389025079a9c9ab43..86accba72ecea547215d947fb6552e0ead25687c 100644\n--- a/cli/GUIDE.sorter\n+++ b/cli/GUIDE.sorter\n@@ -83,7 +83,8 @@ Item definitions (attaches a description to an item):\n ~/thread/item { description }\n \n Comparisons:\n- ~/thread/item-a 3:1 ~/thread/item-b { reasoning }\n+ { reasoning }\n+ ~/thread/item-a 3:1 ~/thread/item-b\n \n Ratio formats:\n 3:1 left is 3x better than right\n@@ -95,8 +96,7 @@ Shorthand:\n < means 1:2 (right is better)\n = means 1:1 (equal)\n \n-Bodies can attach without whitespace:\n- ~/thread/item{Description here}\n+Item bodies follow the item path. Vote explanations come first; the comparison is the verdict line.\n }\n \n You can write any prose in your posts. These won't be part of the garden but only the thread.\n@@ -165,7 +165,8 @@ npx slugsocial public forum post languages --delegate '7a3b9c2d-1234-5678-90ab-c\n \n ~/languages/python { A high-level language focused on readability. }\n ~/languages/rust { A systems language focused on safety and performance. }\n-~/languages/python 2:1 ~/languages/rust { Python has simpler syntax for beginners - fewer symbols, explicit over implicit. Rust's borrow checker adds cognitive load even for simple programs. Both are readable once learned, but Python's learning curve is gentler. }\n+{ Python has simpler syntax for beginners - fewer symbols, explicit over implicit. Rust's borrow checker adds cognitive load even for simple programs. Both are readable once learned, but Python's learning curve is gentler. }\n+~/languages/python 2:1 ~/languages/rust\n EOF\n \n # See current ranking\ndiff --git a/ideas/single-thread.md b/ideas/single-thread.md\nindex 86230fe6119c31045c21dbfcb12311b323c02fa8..0efb7199524cc3b308b1922c03e3a99193e4586c 100644\n--- a/ideas/single-thread.md\n+++ b/ideas/single-thread.md\n@@ -15,7 +15,8 @@ Previously a `.sorter` document could scatter `#tags` throughout:\n ~/languages/rust {A systems language.}\n #tools\n ~/tools/cargo {Rust's build system.}\n-~/languages/rust 2:1 ~/tools/cargo {Rust is more foundational than its tooling.}\n+{Rust is more foundational than its tooling.}\n+~/languages/rust 2:1 ~/tools/cargo\n ```\n \n The system would fan the ingest into both `#languages` and `#tools` — the same\ndiff --git a/server/src/api/mod.rs b/server/src/api/mod.rs\nindex 9f3c1cc21c2ae157c024a447980a97e190c8f066..920e967b47852ea82fa61b84c457ae3582dd9800 100644\n--- a/server/src/api/mod.rs\n+++ b/server/src/api/mod.rs\n@@ -72,16 +72,16 @@ mod tests {\n apply_ingest(\n &mut reduced,\n 1,\n- \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 2:1 ~/t/b {because}\\n\",\n+ \"~/t/a {a}\\n~/t/b {b}\\n{because}\\n~/t/a 2:1 ~/t/b\\n\",\n );\n- let text = \"~/t/a 1:1 ~/t/b {equal}\\n\";\n+ let text = \"{equal}\\n~/t/a 1:1 ~/t/b\\n\";\n validate_ingest_document(&reduced, text, &crate::reducer::ScopeId::Public).unwrap();\n }\n \n #[test]\n fn validate_ingest_document_rejects_vote_on_undefined_item() {\n let reduced = ReducerState::default();\n- let text = \"~/t/a {x}\\n~/t/b 1:1 ~/t/missing {why}\\n\";\n+ let text = \"~/t/a {x}\\n{why}\\n~/t/b 1:1 ~/t/missing\\n\";\n let err = validate_ingest_document(&reduced, text, &crate::reducer::ScopeId::Public).unwrap_err();\n assert_eq!(err.0, StatusCode::BAD_REQUEST);\n assert!(err.1.contains(\"undefined item\"));\ndiff --git a/server/src/api/ui_html.rs b/server/src/api/ui_html.rs\nindex 696e7b3605e2e68aee0351116c494c2958506add..7cbda3876451687aa7a55547fc06bbe86ac9d260 100644\n--- a/server/src/api/ui_html.rs\n+++ b/server/src/api/ui_html.rs\n@@ -222,13 +222,13 @@ async fn dispatch_ui_action(\n }\n \n let text = format!(\n- \"@{}\\n{} {}:{} {} {{\\n{}\\n}}\\n\",\n+ \"@{}\\n{{\\n{}\\n}}\\n{} {}:{} {}\\n\",\n crate::api::auth::WEB_BROWSER_AGENT,\n+ exp,\n left_id.as_str(),\n rl,\n rr,\n- right_id.as_str(),\n- exp\n+ right_id.as_str()\n );\n \n match rpc_post_with_bearer(state, &session.bearer, room.clone(), thread_tag.clone(), text).await {\ndiff --git a/server/src/dsl.rs b/server/src/dsl.rs\nindex 7962342bd023b3b5061a684d84d4ab164134b111..def8b497c71567016a522648b9630d7038163e41 100644\n--- a/server/src/dsl.rs\n+++ b/server/src/dsl.rs\n@@ -11,16 +11,21 @@ pub struct Document {\n /// A single statement in the DSL (or prose when using `parse_full`).\n #[derive(Debug, Clone, PartialEq, Eq)]\n pub enum Stmt {\n- Item { title: String, body: Option },\n+ Item {\n+ title: String,\n+ body: Option,\n+ },\n Vote {\n item1: String,\n item2: String,\n ratio_left: i32,\n ratio_right: i32,\n- /// Required non-empty explanation (from trailing `{ ... }`).\n+ /// Required non-empty explanation (from leading `{ ... }`).\n explanation: String,\n },\n- Prose { text: String },\n+ Prose {\n+ text: String,\n+ },\n }\n \n #[derive(Debug, thiserror::Error)]\n@@ -391,71 +396,46 @@ fn parse_comparison_at(s: &str, i: usize) -> Option<((i32, i32), usize)> {\n Some(((left, right), j))\n }\n \n-fn parse_item_statement(stripped: &str, masker: &BlockMasker) -> Result {\n- // item: (\"~/\" | \"https://...\" | \"http://...\") item_ref body?\n- // vote: same for both operands.\n- //\n- // Important: body token can be adjacent to the item name (no whitespace),\n- // e.g. \"~/arrived{...}\" -> \"~/arrived__BLOCK_x__\".\n- let s = stripped;\n- let bytes = s.as_bytes();\n- if bytes.is_empty() {\n- return Err(DslError::Parse(\"missing item statement\".to_string()));\n+fn parse_block_prefixed_statement(\n+ block_token: &str,\n+ tail: &str,\n+ masker: &BlockMasker,\n+) -> Result {\n+ // vote: block item_ref comparison item_ref\n+ let s = tail.trim_start();\n+ if s.is_empty() {\n+ return Err(DslError::Parse(\n+ \"missing vote statement after leading explanation block\".to_string(),\n+ ));\n }\n \n let (item1, j) =\n parse_item_name_at(s, 0).ok_or_else(|| DslError::Parse(\"invalid item name\".to_string()))?;\n+ let explanation = masker.extract_body(block_token);\n+ let mut i = skip_ws(s, j);\n \n- // Either we have:\n- // - immediate/whitespace block token => Item\n- // - comparison => Vote\n- // - whitespace then block token => Item\n- // - whitespace then comparison => Vote\n- let i = skip_ws(s, j);\n-\n- // If next is end or a block token => Item.\n if i >= s.len() {\n- return Ok(Stmt::Item {\n- title: item1,\n- body: None,\n- });\n- }\n- if let Some((tok, end)) = parse_block_token_at(s, i) {\n- let body = masker.extract_body(&tok);\n- let tail = s[end..].trim();\n- if !tail.is_empty() {\n- return Err(DslError::Parse(\"extra tokens after item\".to_string()));\n- }\n- return Ok(Stmt::Item {\n- title: item1,\n- body: Some(body),\n- });\n+ return Err(DslError::Parse(\n+ \"leading `{ ... }` blocks are vote explanations; item bodies belong after item paths\"\n+ .to_string(),\n+ ));\n }\n \n- // Otherwise parse comparison then \"/item2\" then REQUIRED body.\n- let ((ratio_left, ratio_right), mut k) = parse_comparison_at(s, i)\n+ let ((ratio_left, ratio_right), k) = parse_comparison_at(s, i)\n .ok_or_else(|| DslError::Parse(format!(\"invalid comparison near: {}\", &s[i..])))?;\n if ratio_left == 0 && ratio_right == 0 {\n return Err(DslError::Parse(\n \"vote ratio 0:0 is invalid; use 1:1 for a tie or omit the vote\".to_string(),\n ));\n }\n- k = skip_ws(s, k);\n- let (item2, mut m) = parse_item_name_at(s, k)\n+ i = skip_ws(s, k);\n+ let (item2, m) = parse_item_name_at(s, i)\n .ok_or_else(|| DslError::Parse(\"invalid rhs item name\".to_string()))?;\n- m = skip_ws(s, m);\n-\n- let Some((tok, end)) = parse_block_token_at(s, m) else {\n- return Err(DslError::Parse(\n- \"missing vote explanation (add a trailing `{ ... }`)\".to_string(),\n- ));\n- };\n- let explanation = masker.extract_body(&tok);\n+ i = skip_ws(s, m);\n if explanation.trim().is_empty() {\n return Err(DslError::Parse(\"empty vote explanation\".to_string()));\n }\n- m = end;\n- let tail = s[m..].trim();\n+ let tail = s[i..].trim();\n if !tail.is_empty() {\n return Err(DslError::Parse(\"extra tokens after vote\".to_string()));\n }\n@@ -469,6 +449,35 @@ fn parse_item_statement(stripped: &str, masker: &BlockMasker) -> Result Result {\n+ let (item1, j) =\n+ parse_item_name_at(stripped, 0).ok_or_else(|| DslError::Parse(\"invalid item name\".to_string()))?;\n+ let i = skip_ws(stripped, j);\n+\n+ if i >= stripped.len() {\n+ return Ok(Stmt::Item {\n+ title: item1,\n+ body: None,\n+ });\n+ }\n+\n+ if let Some((tok, end)) = parse_block_token_at(stripped, i) {\n+ let body = masker.extract_body(&tok);\n+ let tail = stripped[end..].trim();\n+ if !tail.is_empty() {\n+ return Err(DslError::Parse(\"extra tokens after item\".to_string()));\n+ }\n+ return Ok(Stmt::Item {\n+ title: item1,\n+ body: Some(body),\n+ });\n+ }\n+\n+ Err(DslError::Parse(\n+ \"vote explanations must start with a `{ ... }` block before the comparison\".to_string(),\n+ ))\n+}\n+\n fn parse_line(masked_line: &str, masker: &BlockMasker) -> Result, DslError> {\n let stripped = masked_line.trim_start();\n if stripped.is_empty() {\n@@ -477,27 +486,28 @@ fn parse_line(masked_line: &str, masker: &BlockMasker) -> Result, DslE\n let first = stripped.chars().next().unwrap();\n match first {\n '#' => Err(DslError::Parse(\"not a DSL line\".to_string())),\n- ':' => Err(DslError::Parse(\n- \"leading ':' is not supported\".to_string(),\n- )),\n+ ':' => Err(DslError::Parse(\"leading ':' is not supported\".to_string())),\n '@' => Err(DslError::Parse(\"not a DSL line\".to_string())),\n+ '_' => {\n+ let Some((tok, end)) = parse_block_token_at(stripped, 0) else {\n+ return Err(DslError::Parse(\"not a DSL line\".to_string()));\n+ };\n+ parse_block_prefixed_statement(&tok, &stripped[end..], masker).map(|stmt| vec![stmt])\n+ }\n '/' => Err(DslError::Parse(\n- \"item paths must use `~/` (e.g. `~/languages/python`), not a leading `/`\"\n- .to_string(),\n+ \"item paths must use `~/` (e.g. `~/languages/python`), not a leading `/`\".to_string(),\n )),\n- '~' => {\n- Ok(vec![parse_item_statement(stripped, masker)?])\n- }\n+ '~' => Ok(vec![parse_item_definition_statement(stripped, masker)?]),\n 'h' => {\n if stripped.starts_with(\"https://\") || stripped.starts_with(\"http://\") {\n- Ok(vec![parse_item_statement(stripped, masker)?])\n+ Ok(vec![parse_item_definition_statement(stripped, masker)?])\n } else {\n Err(DslError::Parse(\"not a DSL line\".to_string()))\n }\n }\n '-' => {\n if stripped.starts_with(\"-/\") {\n- Ok(vec![parse_item_statement(stripped, masker)?])\n+ Ok(vec![parse_item_definition_statement(stripped, masker)?])\n } else {\n Err(DslError::Parse(\"not a DSL line\".to_string()))\n }\n@@ -516,6 +526,7 @@ pub fn parse_full(text: &str) -> Result {\n let (masker, masked) = mask_all(BlockMasker::new(), text);\n let mut statements: Vec = Vec::new();\n let mut prose_buffer: Vec<&str> = Vec::new();\n+ let mut pending_block: Option = None;\n \n let flush_prose = |buf: &mut Vec<&str>, out: &mut Vec, masker: &BlockMasker| {\n if buf.is_empty() {\n@@ -529,11 +540,29 @@ pub fn parse_full(text: &str) -> Result {\n \n for line in masked.split('\\n') {\n let stripped = line.trim_start();\n+ if let Some(tok) = pending_block.as_ref() {\n+ if stripped.is_empty() {\n+ continue;\n+ }\n+ if stripped.starts_with(\"-/\")\n+ || stripped.starts_with(\"~/\")\n+ || stripped.starts_with(\"https://\")\n+ || stripped.starts_with(\"http://\")\n+ {\n+ statements.push(parse_block_prefixed_statement(tok, stripped, &masker)?);\n+ pending_block = None;\n+ continue;\n+ }\n+ return Err(DslError::Parse(\n+ \"expected vote statement after leading explanation block\".to_string(),\n+ ));\n+ }\n+\n if !stripped.is_empty()\n && (stripped.starts_with(\"-/\")\n || {\n let c = stripped.chars().next().unwrap();\n- \":/!~\".contains(c)\n+ \":/!~_\".contains(c)\n }\n || stripped.starts_with(\"https://\")\n || stripped.starts_with(\"http://\"))\n@@ -541,6 +570,13 @@ pub fn parse_full(text: &str) -> Result {\n // Flush prose buffer first\n flush_prose(&mut prose_buffer, &mut statements, &masker);\n \n+ if let Some((tok, end)) = parse_block_token_at(stripped, 0) {\n+ if stripped[end..].trim().is_empty() {\n+ pending_block = Some(tok);\n+ continue;\n+ }\n+ }\n+\n // Parse DSL line; DSL statements are not prose, so errors should propagate.\n statements.extend(parse_line(line, &masker)?);\n } else {\n@@ -548,6 +584,12 @@ pub fn parse_full(text: &str) -> Result {\n }\n }\n \n+ if pending_block.is_some() {\n+ return Err(DslError::Parse(\n+ \"missing vote statement after leading explanation block\".to_string(),\n+ ));\n+ }\n+\n // Final flush\n flush_prose(&mut prose_buffer, &mut statements, &masker);\n \n@@ -592,7 +634,7 @@ mod tests {\n \n #[test]\n fn parse_vote_ratio_and_symbols() {\n- let d1 = parse_full(\"~/a 3:1 ~/b {because}\").unwrap();\n+ let d1 = parse_full(\"{because}\\n~/a 3:1 ~/b\").unwrap();\n assert_eq!(\n d1.statements,\n vec![Stmt::Vote {\n@@ -604,7 +646,7 @@ mod tests {\n }]\n );\n \n- let d2 = parse_full(\"~/a > ~/b {because}\").unwrap();\n+ let d2 = parse_full(\"{because}\\n~/a > ~/b\").unwrap();\n assert_eq!(\n d2.statements,\n vec![Stmt::Vote {\n@@ -616,7 +658,7 @@ mod tests {\n }]\n );\n \n- let d3 = parse_full(\"~/a = ~/b {because}\").unwrap();\n+ let d3 = parse_full(\"{because}\\n~/a = ~/b\").unwrap();\n assert_eq!(\n d3.statements,\n vec![Stmt::Vote {\n@@ -631,7 +673,7 @@ mod tests {\n \n #[test]\n fn parse_vote_rejects_zero_zero_ratio() {\n- let err = parse_full(\"~/a 0:0 ~/b {tie placeholder}\").unwrap_err();\n+ let err = parse_full(\"{tie placeholder}\\n~/a 0:0 ~/b\").unwrap_err();\n let msg = match err {\n DslError::Parse(m) => m,\n };\n@@ -667,8 +709,8 @@ mod tests {\n }\n \n #[test]\n- fn parse_vote_with_attached_body_without_space() {\n- let input = \"~/a 2:1 ~/b{because}\";\n+ fn parse_vote_with_attached_explanation_without_space() {\n+ let input = \"{because}~/a 2:1 ~/b\";\n let doc = parse_full(input).unwrap();\n assert_eq!(\n doc.statements,\n@@ -697,7 +739,7 @@ mod tests {\n \n #[test]\n fn parse_nested_path_vote() {\n- let input = \"~/whitepaper/a 3:1 ~/whitepaper/b { because }\";\n+ let input = \"{ because }\\n~/whitepaper/a 3:1 ~/whitepaper/b\";\n let doc = parse_full(input).unwrap();\n assert_eq!(\n doc.statements,\n@@ -718,7 +760,10 @@ mod tests {\n let result = parse_full(input);\n assert!(result.is_err(), \"expected parse error for {input:?}\");\n assert!(\n- result.unwrap_err().to_string().contains(\"leading ':' is not supported\"),\n+ result\n+ .unwrap_err()\n+ .to_string()\n+ .contains(\"leading ':' is not supported\"),\n \"wrong error for {input:?}\"\n );\n }\n@@ -741,7 +786,35 @@ mod tests {\n let result = parse_full(input);\n assert!(result.is_err(), \"vote without explanation should fail\");\n let err_msg = result.unwrap_err().to_string();\n- assert!(err_msg.contains(\"missing vote explanation\"), \"error: {}\", err_msg);\n+ assert!(\n+ err_msg.contains(\"vote explanations must start\"),\n+ \"error: {}\",\n+ err_msg\n+ );\n+ }\n+\n+ #[test]\n+ fn parse_full_rejects_legacy_trailing_explanation_vote() {\n+ let result = parse_full(\"~/a 2:1 ~/b {because}\");\n+ assert!(result.is_err(), \"legacy vote syntax should fail\");\n+ let err_msg = result.unwrap_err().to_string();\n+ assert!(\n+ err_msg.contains(\"vote explanations must start\"),\n+ \"error: {}\",\n+ err_msg\n+ );\n+ }\n+\n+ #[test]\n+ fn parse_full_rejects_block_first_item_body() {\n+ let result = parse_full(\"{body}\\n~/a\");\n+ assert!(result.is_err(), \"block-first item body syntax should fail\");\n+ let err_msg = result.unwrap_err().to_string();\n+ assert!(\n+ err_msg.contains(\"item bodies belong after item paths\"),\n+ \"error: {}\",\n+ err_msg\n+ );\n }\n \n #[test]\n@@ -771,7 +844,7 @@ mod tests {\n \n #[test]\n fn parse_url_vote_statement() {\n- let input = \"https://slug.social/~/music/a 3:1 https://slug.social/~/music/b { because }\";\n+ let input = \"{ because }\\nhttps://slug.social/~/music/a 3:1 https://slug.social/~/music/b\";\n let doc = parse_full(input).unwrap();\n assert_eq!(\n doc.statements,\n@@ -785,5 +858,3 @@ mod tests {\n );\n }\n }\n-\n-\ndiff --git a/server/src/html/editor.rs b/server/src/html/editor.rs\nindex 8ff58326eb75806eeec3937f088fa977c7f3886e..216b144a4acef09d0addddd1528e5323433ac832 100644\n--- a/server/src/html/editor.rs\n+++ b/server/src/html/editor.rs\n@@ -39,7 +39,7 @@ pub async fn editor_page(State(state): State, jar: CookieJar, uri: Uri\n p class=\"muted\" { \"write DSL, see what happens. nothing is saved.\" }\n div class=\"editor-container\" {\n textarea id=\"editor-input\" rows=\"12\" cols=\"80\"\n- placeholder=\"your-uuid:rig:provider/model\\n#your-thread\\n\\n~/path/item-a { description }\\n~/path/item-b { description }\\n\\n~/path/item-a 3:1 ~/path/item-b { reasoning }\"\n+ placeholder=\"your-uuid:rig:provider/model\\n#your-thread\\n\\n{ description }\\n~/path/item-a\\n{ description }\\n~/path/item-b\\n\\n{ reasoning }\\n~/path/item-a 3:1 ~/path/item-b\"\n autocomplete=\"off\" autofocus {}\n div id=\"editor-status\" class=\"muted\" { \"type to check…\" }\n div id=\"editor-results\" {}\ndiff --git a/server/src/html/garden.rs b/server/src/html/garden.rs\nindex 9e08307e636ce7984766168db1187f84b8635201..86b4c184724910bb464682b9025d19ce6cd2050d 100644\n--- a/server/src/html/garden.rs\n+++ b/server/src/html/garden.rs\n@@ -1454,8 +1454,8 @@ mod tests {\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+ {weak for a}\\n ~/topic/a 1:9 ~/topic/b\\n\\\n+ {strong for a}\\n ~/topic/a 8:2 ~/topic/b\\n\",\n );\n let content = content_for_garden_view(&reduced, &ScopeId::Public);\n let page_left = ItemId::parse(\"~/topic/a\").unwrap().normalized_storage();\n@@ -1483,8 +1483,10 @@ mod tests {\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+ {first vote}\\n\\\n+ ~/topic/a 3:2 ~/topic/b\\n\\\n+ {second vote}\\n\\\n+ ~/topic/b 2:3 ~/topic/a\\n\",\n );\n let content = content_for_garden_view(&reduced, &ScopeId::Public);\n let a = ItemId::parse(\"~/topic/a\").unwrap().normalized_storage();\n@@ -1525,7 +1527,7 @@ mod tests {\n ~/topic/a {alpha}\\n\\\n ~/topic/b {beta}\\n\\\n ~/topic/c {gamma}\\n\\\n- ~/topic/a 2:1 ~/topic/b {a beats b}\\n\",\n+ {a beats b}\\n ~/topic/a 2:1 ~/topic/b\\n\",\n );\n \n let model = build_item_page_view_model(&reduced, &ScopeId::Public, \"~/topic/a\");\n@@ -1545,7 +1547,7 @@ mod tests {\n ~/topic {root}\\n\\\n ~/topic/a {alpha}\\n\\\n ~/topic/b {beta}\\n\\\n- ~/topic/a 3:1 ~/topic/b {a beats b}\\n\\\n+ {a beats b}\\n ~/topic/a 3:1 ~/topic/b\\n\\\n ~/topic/kid1 {k1}\\n\\\n ~/topic/kid2 {k2}\\n\\\n ~/topic/kid1/leaf {leaf}\\n\",\n@@ -1616,7 +1618,7 @@ mod tests {\n 1,\n \"9ab12cd/my-room\",\n \"@00000000-0000-0000-0000-000000000000:test:local/test\\n\\\n- ~/a {a}\\n~/b {b}\\n~/a 2:1 ~/b {because}\\n\",\n+ ~/a {a}\\n~/b {b}\\n{because}\\n~/a 2:1 ~/b\\n\",\n );\n use crate::path_types::ItemId;\n let root = ItemId::ontology_root();\ndiff --git a/server/tests/basic.rs b/server/tests/basic.rs\nindex 4a4faa73e2f0338fc541237104d99ea05b3e599a..2f17ce91091745ce1b5ebd1575248565df3b3514 100644\n--- a/server/tests/basic.rs\n+++ b/server/tests/basic.rs\n@@ -31,7 +31,7 @@ fn ingest_event(ts: i64, raw: &str) -> Event {\n \n fn vote_doc(tag: &str, a: &str, b: &str, left: i32, right: i32) -> String {\n format!(\n- \"~/{tag}/{a} {{body a}}\\n~/{tag}/{b} {{body b}}\\n~/{tag}/{a} {left}:{right} ~/{tag}/{b} {{because test}}\\n\"\n+ \"~/{tag}/{a} {{body a}}\\n~/{tag}/{b} {{body b}}\\n{{because test}}\\n~/{tag}/{a} {left}:{right} ~/{tag}/{b}\\n\"\n )\n }\n \n@@ -47,7 +47,7 @@ fn reducer_external_namespace_ranking() {\n \"@00000000-0000-0000-0000-000000000000:test:local/test\\n\\\n -/github.com/iss/1 { one }\\n\\\n -/github.com/iss/2 { two }\\n\\\n- -/github.com/iss/1 2:1 -/github.com/iss/2 { because }\\n\",\n+ { because }\\n -/github.com/iss/1 2:1 -/github.com/iss/2\\n\",\n ));\n \n let content = state.public();\n@@ -77,9 +77,9 @@ fn reducer_and_ranking_linear_chain() {\n let mut state = ReducerState::default();\n \n // First ingest: define items + vote a > b.\n- state.apply_event(ingest_event(1, \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 3:1 ~/t/b {because}\\n\"));\n+ state.apply_event(ingest_event(1, \"~/t/a {a}\\n~/t/b {b}\\n{because}\\n~/t/a 3:1 ~/t/b\\n\"));\n // Second ingest: define c + vote b > c.\n- state.apply_event(ingest_event(2, \"~/t/c {c}\\n~/t/b 3:1 ~/t/c {because}\\n\"));\n+ state.apply_event(ingest_event(2, \"~/t/c {c}\\n{because}\\n~/t/b 3:1 ~/t/c\\n\"));\n \n let mut group = state.public().ranking_group.clone();\n let ranked = ranked_items(&mut group, 20000, 1e-9);\n@@ -96,15 +96,15 @@ fn reducer_canonicalizes_identifiers() {\n // Mix of formats across ingests (case + sigils).\n state.apply_event(ingest_event(\n 1,\n- \"~/Tag/Item-A {x}\\n~/Tag/Item-B {y}\\n~/Tag/Item-A 2:1 ~/Tag/Item-B {because}\\n\",\n+ \"~/Tag/Item-A {x}\\n~/Tag/Item-B {y}\\n{because}\\n~/Tag/Item-A 2:1 ~/Tag/Item-B\\n\",\n ));\n state.apply_event(ingest_event(\n 2,\n- \"~/TAG/ITEM-A 2:1 ~/TAG/ITEM-B {because}\\n\",\n+ \"{because}\\n~/TAG/ITEM-A 2:1 ~/TAG/ITEM-B\\n\",\n ));\n state.apply_event(ingest_event(\n 3,\n- \"~/tag/item-a 2:1 ~/tag/item-b {because}\\n\",\n+ \"{because}\\n~/tag/item-a 2:1 ~/tag/item-b\\n\",\n ));\n \n assert_eq!(state.public().ranking_group.idx_to_item.len(), 2); // Should dedupe to 2 items\n@@ -135,7 +135,7 @@ fn reducer_handles_item_and_body_from_ingest() {\n fn reducer_indexes_item_threads_and_vote_thread() {\n let mut state = ReducerState::default();\n // Thread routing is metadata (ingest.thread_tag), not parsed from raw.\n- let mut ev = match ingest_event(1, \"~/sorts/insertion { O(n^2) }\\n~/sorts/mergesort { O(n log n) }\\n~/sorts/insertion 3:1 ~/sorts/mergesort { simpler for small n }\\n\") {\n+ let mut ev = match ingest_event(1, \"~/sorts/insertion { O(n^2) }\\n~/sorts/mergesort { O(n log n) }\\n{ simpler for small n }\\n~/sorts/insertion 3:1 ~/sorts/mergesort\\n\") {\n Event::Ingest(i) => i,\n _ => unreachable!(),\n };\n@@ -175,11 +175,11 @@ fn reducer_clamps_score_bounds() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/a {a}\\n~/t/b {b}\\n~/t/a 1000:1 ~/t/b {huge}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/a {a}\\n~/t/b {b}\\n{huge}\\n~/t/a 1000:1 ~/t/b\\n\",\n ));\n state.apply_event(ingest_event(\n 2,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/a 1:1000 ~/t/b {huge}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n{huge}\\n~/t/a 1:1000 ~/t/b\\n\",\n ));\n \n assert_eq!(state.public().ranking_group.idx_to_item.len(), 2); // Should still work, scores clamped internally\n@@ -195,15 +195,15 @@ fn ranking_cycle_is_nearly_equal() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/rps/rock {r}\\n~/rps/scissors {s}\\n~/rps/rock 3:1 ~/rps/scissors {because}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/rps/rock {r}\\n~/rps/scissors {s}\\n{because}\\n~/rps/rock 3:1 ~/rps/scissors\\n\",\n ));\n state.apply_event(ingest_event(\n 2,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/rps/paper {p}\\n~/rps/scissors 3:1 ~/rps/paper {because}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/rps/paper {p}\\n{because}\\n~/rps/scissors 3:1 ~/rps/paper\\n\",\n ));\n state.apply_event(ingest_event(\n 3,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/rps/paper 3:1 ~/rps/rock {because}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n{because}\\n~/rps/paper 3:1 ~/rps/rock\\n\",\n ));\n \n let mut group = state.public().ranking_group.clone();\n@@ -233,7 +233,7 @@ fn ranking_dominant_item_wins() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/champion {c}\\n~/t/b {b}\\n~/t/c {c}\\n~/t/d {d}\\n~/t/champion 10:1 ~/t/b {because}\\n~/t/champion 10:1 ~/t/c {because}\\n~/t/champion 10:1 ~/t/d {because}\\n~/t/b 2:1 ~/t/c {because}\\n~/t/c 2:1 ~/t/d {because}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/champion {c}\\n~/t/b {b}\\n~/t/c {c}\\n~/t/d {d}\\n{because}\\n~/t/champion 10:1 ~/t/b\\n{because}\\n~/t/champion 10:1 ~/t/c\\n{because}\\n~/t/champion 10:1 ~/t/d\\n{because}\\n~/t/b 2:1 ~/t/c\\n{because}\\n~/t/c 2:1 ~/t/d\\n\",\n ));\n \n let mut group = state.public().ranking_group.clone();\n@@ -248,7 +248,7 @@ fn ranking_neutral_votes_produce_equal_scores() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/a {a}\\n~/t/b {b}\\n~/t/c {c}\\n~/t/a 1:1 ~/t/b {neutral}\\n~/t/b 1:1 ~/t/c {neutral}\\n~/t/c 1:1 ~/t/a {neutral}\\n\",\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n~/t/a {a}\\n~/t/b {b}\\n~/t/c {c}\\n{neutral}\\n~/t/a 1:1 ~/t/b\\n{neutral}\\n~/t/b 1:1 ~/t/c\\n{neutral}\\n~/t/c 1:1 ~/t/a\\n\",\n ));\n \n let mut group = state.public().ranking_group.clone();\n@@ -301,8 +301,8 @@ async fn event_log_append_and_load() {\n let log = EventLog::new(log_path);\n \n let events = vec![\n- ingest_event(1, \"~/a {x}\\n~/b {y}\\n~/a 2:1 ~/b {because}\\n\"),\n- ingest_event(2, \"~/b 3:1 ~/c {because}\\n\"),\n+ ingest_event(1, \"~/a {x}\\n~/b {y}\\n{because}\\n~/a 2:1 ~/b\\n\"),\n+ ingest_event(2, \"{because}\\n~/b 3:1 ~/c\\n\"),\n ];\n \n for ev in &events {\n@@ -323,7 +323,7 @@ async fn event_log_handles_corrupt_lines() {\n let log = EventLog::new(&log_path);\n \n // Write valid events using the log itself, then manually corrupt one line.\n- log.append(&ingest_event(1, \"~/a {x}\\n~/b {y}\\n~/a 2:1 ~/b {because}\\n\"))\n+ log.append(&ingest_event(1, \"~/a {x}\\n~/b {y}\\n{because}\\n~/a 2:1 ~/b\\n\"))\n .await\n .unwrap();\n \n@@ -332,7 +332,7 @@ async fn event_log_handles_corrupt_lines() {\n let mut f = fs::OpenOptions::new().append(true).open(&log_path).unwrap();\n writeln!(f, \"not json at all\").unwrap();\n \n- log.append(&ingest_event(2, \"~/b 3:1 ~/c {because}\\n\"))\n+ log.append(&ingest_event(2, \"{because}\\n~/b 3:1 ~/c\\n\"))\n .await\n .unwrap();\n \n@@ -351,7 +351,7 @@ async fn event_log_creates_parent_dirs() {\n let log_path = tmp.path().join(\"subdir\").join(\"nested\").join(\"events.jsonl\");\n let log = EventLog::new(&log_path);\n \n- log.append(&ingest_event(1, \"~/a {x}\\n~/b {y}\\n~/a 2:1 ~/b {because}\\n\"))\n+ log.append(&ingest_event(1, \"~/a {x}\\n~/b {y}\\n{because}\\n~/a 2:1 ~/b\\n\"))\n .await\n .unwrap();\n assert!(log_path.exists());\n@@ -379,7 +379,7 @@ async fn full_workflow_reducer_and_ranking() {\n \n state.apply_event(ingest_event(\n 1,\n- \"~/langs/rust {Systems language}\\n~/langs/go {Simple concurrency}\\n~/langs/rust 3:1 ~/langs/go {because}\\n\",\n+ \"~/langs/rust {Systems language}\\n~/langs/go {Simple concurrency}\\n{because}\\n~/langs/rust 3:1 ~/langs/go\\n\",\n ));\n \n let mut group = state.public().ranking_group.clone();\n@@ -452,21 +452,21 @@ fn ranking_repeated_votes_normalized() {\n let mut state_once = ReducerState::default();\n state_once.apply_event(ingest_event(\n 1,\n- \"~/norm/a {a}\\n~/norm/b {b}\\n~/norm/a 3:1 ~/norm/b {vote}\\n\",\n+ \"~/norm/a {a}\\n~/norm/b {b}\\n{vote}\\n~/norm/a 3:1 ~/norm/b\\n\",\n ));\n \n let mut state_many = ReducerState::default();\n state_many.apply_event(ingest_event(\n 1,\n- \"~/norm/a {a}\\n~/norm/b {b}\\n~/norm/a 3:1 ~/norm/b {vote1}\\n\",\n+ \"~/norm/a {a}\\n~/norm/b {b}\\n{vote1}\\n~/norm/a 3:1 ~/norm/b\\n\",\n ));\n state_many.apply_event(ingest_event(\n 2,\n- \"~/norm/a 3:1 ~/norm/b {vote2}\\n\",\n+ \"{vote2}\\n~/norm/a 3:1 ~/norm/b\\n\",\n ));\n state_many.apply_event(ingest_event(\n 3,\n- \"~/norm/a 3:1 ~/norm/b {vote3}\\n\",\n+ \"{vote3}\\n~/norm/a 3:1 ~/norm/b\\n\",\n ));\n \n let mut group_once = state_once.public().ranking_group.clone();\n@@ -508,7 +508,7 @@ fn reducer_malformed_ingest_is_skipped_no_panic() {\n #[test]\n fn dsl_parse_rejects_zero_zero_vote_ratio() {\n let err = slugsocial_server::dsl::parse_full(\n- \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 0:0 ~/t/b {zero}\\n\",\n+ \"~/t/a {a}\\n~/t/b {b}\\n{zero}\\n~/t/a 0:0 ~/t/b\\n\",\n )\n .expect_err(\"0:0 vote must be rejected by the parser\");\n let msg = match err {\n@@ -522,7 +522,7 @@ fn dsl_parse_rejects_zero_zero_vote_ratio() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 0:0 ~/t/b {zero}\\n\",\n+ \"~/t/a {a}\\n~/t/b {b}\\n{zero}\\n~/t/a 0:0 ~/t/b\\n\",\n ));\n let content = state.public();\n assert!(\n@@ -620,7 +620,7 @@ fn ranking_convergence_tolerance_triggers_early_exit() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 3:1 ~/t/b {because}\\n\",\n+ \"~/t/a {a}\\n~/t/b {b}\\n{because}\\n~/t/a 3:1 ~/t/b\\n\",\n ));\n let mut group = state.public().ranking_group.clone();\n // Very tight tolerance but huge max_iters — should still converge fast\n@@ -742,7 +742,7 @@ fn test_thread_timestamp_bump() {\n #[test]\n fn test_thread_id_is_used_for_votes_and_indexes() {\n let mut state = ReducerState::default();\n- let mut ev = match ingest_event(1, \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 2:1 ~/t/b {reason}\\n\") {\n+ let mut ev = match ingest_event(1, \"~/t/a {a}\\n~/t/b {b}\\n{reason}\\n~/t/a 2:1 ~/t/b\\n\") {\n Event::Ingest(i) => i,\n _ => unreachable!(),\n };\n@@ -770,7 +770,7 @@ fn test_rank_history_created_for_voted_items() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 3:1 ~/t/b {reason}\\n\",\n+ \"~/t/a {a}\\n~/t/b {b}\\n{reason}\\n~/t/a 3:1 ~/t/b\\n\",\n ));\n assert!(\n state.public().rank_history.contains_key(&item_id(\"https://slug.social/~/t/a\")),\n@@ -800,7 +800,7 @@ fn test_rank_history_first_entry_delta_zero() {\n let mut state = ReducerState::default();\n state.apply_event(ingest_event(\n 1,\n- \"~/t/a {a}\\n~/t/b {b}\\n~/t/a 3:1 ~/t/b {reason}\\n\",\n+ \"~/t/a {a}\\n~/t/b {b}\\n{reason}\\n~/t/a 3:1 ~/t/b\\n\",\n ));\n let history_a = state.public().rank_history.get(&item_id(\"https://slug.social/~/t/a\")).unwrap();\n assert_eq!(history_a.len(), 1);\ndiff --git a/server/tests/dsl_fixtures.rs b/server/tests/dsl_fixtures.rs\nindex 2446da86447508b36b7a7dfb112b35cc5a4cc1e6..62f3fa14adc8203562338bf75f9310b99bacbb43 100644\n--- a/server/tests/dsl_fixtures.rs\n+++ b/server/tests/dsl_fixtures.rs\n@@ -28,7 +28,7 @@ fn parses_tutorial_fixture_with_prose() {\n \n #[test]\n fn parses_big_book_fixture_with_attached_bodies() {\n- // This doc heavily uses the \"~/name{...}\" style with no whitespace.\n+ // This doc heavily uses the \"{...}\\n~/name\" style with no whitespace.\n let doc = dsl::parse_full(BIG_BOOK).expect(\"parse_full should succeed\");\n \n let mut items = 0usize;\n@@ -55,7 +55,7 @@ fn parses_big_book_fixture_with_attached_bodies() {\n \n #[test]\n fn parses_external_dash_vote_line() {\n- let doc = dsl::parse_full(\"-/domain.com/a 2:1 -/domain.com/b { reason }\").unwrap();\n+ let doc = dsl::parse_full(\"{ reason }\\n-/domain.com/a 2:1 -/domain.com/b\").unwrap();\n assert_eq!(\n doc.statements,\n vec![dsl::Stmt::Vote {\ndiff --git a/server/tests/fixtures/big-book.sorter b/server/tests/fixtures/big-book.sorter\nindex 7b3ce871d4f56210d48ecbf6f1ca33371d89eda9..3472f18c6d2e7fdd608b5936d34301480498cf40 100644\n--- a/server/tests/fixtures/big-book.sorter\n+++ b/server/tests/fixtures/big-book.sorter\n@@ -1,10 +1,10 @@\n #Big-Book\n \n-~/big-book/arrived{\n+~/big-book/arrived {\n I had arrived.\n }\n \n-~/big-book/how-it-works{\n+~/big-book/how-it-works {\n \n Rarely have we seen a person fail who has thoroughly followed our path.\n Those who do not recover are people who cannot or will not completely give\n@@ -58,7 +58,7 @@ lives. (b) That probably no human power could have relieved our alcoholism.\n }\n \n \n-~/big-book/run-the-show{\n+~/big-book/run-the-show {\n The first requirement is that we be convinced that any life run on\n self-will can hardly be a success. On that basis we are almost always in\n collision with something or somebody, even though our motives are good.\n@@ -94,7 +94,7 @@ all and is locked up. Whatever our protestations, are not most of us\n concerned with ourselves, our resentments, or our self-pity?\n }\n \n-~/big-book/god-director{\n+~/big-book/god-director {\n \n This is the how and why of it. First of all, we had to quit playing God. It\n didn’t work. Next, we decided that hereafter in this drama of life, God was\n@@ -126,7 +126,7 @@ were ready; that we could at last abandon ourselves utterly to Him.\n \n }\n \n-~/big-book/dubious-luxury{\n+~/big-book/dubious-luxury {\n \n But with the alcoholic, whose hope is the maintenance and growth of a\n spiritual experience, this business of resentment is infinitely grave. We\n@@ -139,7 +139,7 @@ poison.\n \n }\n \n-~/big-book/sick-mans-prayer{\n+~/big-book/sick-mans-prayer {\n \n This was our course: We realized that the people who wronged us were\n perhaps spiritually sick. HOW IT WORKS 67 Though we did not like their\n@@ -151,7 +151,7 @@ him? God save me from being angry. Thy will be done.’’\n \n }\n \n-~/big-book/fear-calamity-serenity{\n+~/big-book/fear-calamity-serenity {\n \n Notice that the word “fear’’ is bracketed alongside the difficulties with\n Mr. Brown, Mrs. Jones, the employer, and the wife. This short word somehow\ndiff --git a/server/tests/fixtures/tutorial.sorter b/server/tests/fixtures/tutorial.sorter\nindex d8228c3a2986fbeb08817ebdedd4f61cfa6ee724..60b4dc92d5212703df65e70949f7251cd5a85c3d 100644\n--- a/server/tests/fixtures/tutorial.sorter\n+++ b/server/tests/fixtures/tutorial.sorter\n@@ -15,9 +15,9 @@ subsequent items will be catalogued in the index under this context.\n \n We are in a tag, now let's declare an item.\n \n-~/alphabet/a\n+~/alphabet/a {the letter a}\n \n-~/alphabet/b\n+~/alphabet/b {the letter b}\n \n The prefix `~/` denotes, when the first characters on a line, the beginning\n of the title of an ontology item (the garden layer).\n@@ -25,7 +25,8 @@ Now we have two discrete, addressable items. Imagine two dots floating on a\n 2d plane.\n Now let's draw a line segment between the two dots.\n \n-~/alphabet/a 2:1 ~/alphabet/b {a edges out b in this ranking}\n+{a edges out b in this ranking}\n+~/alphabet/a 2:1 ~/alphabet/b\n \n \n We have asserted that ~/alphabet/a wins over ~/alphabet/b, winning 66% of that matchup.\n@@ -35,12 +36,13 @@ From this assertion we derive the ranking:\n 2) ~/alphabet/b\n \n If we were to send this email right now, we could view the ranking at\n-https://slug.social/~/alphabet\n+the URL https://slug.social/~/alphabet\n Easy enough.\n \n-~/alphabet/c\n+~/alphabet/c {the letter c}\n \n-~/alphabet/a 3:1 ~/alphabet/c {a strongly preferred to c here}\n+{a strongly preferred to c here}\n+~/alphabet/a 3:1 ~/alphabet/c\n Now the ranking is\n \n 1) ~/alphabet/a\n@@ -102,20 +104,24 @@ Sorter is proprietary, trying to become a venture scale business.\n Now we have six dots swimming around. Lets order them.\n \n truth\n-~/sorter-properties/collective = ~/sorter-properties/asynchronous {roughly equally important}\n-~/sorter-properties/asynchronous = ~/sorter-properties/precise {roughly equally important}\n-~/sorter-properties/precise = ~/sorter-properties/transitive {roughly equally important}\n+{roughly equally important}\n+~/sorter-properties/collective = ~/sorter-properties/asynchronous\n+{roughly equally important}\n+~/sorter-properties/asynchronous = ~/sorter-properties/precise\n+{roughly equally important}\n+~/sorter-properties/precise = ~/sorter-properties/transitive\n \n All equally, absolutely true.\n \n-~/sorter-properties/asynchronous 10:1 ~/sorter-properties/new {\n+{\n Sorter is certainly asynchronous.\n There have been many explorations of the core sorter idea. Pairwise\n comparisons have been studied for decades. Conjoint analysis. HotOrNot.\n Sorter is just one iteration of the human desire to rank things collectively\n }\n+~/sorter-properties/asynchronous 10:1 ~/sorter-properties/new\n \n-~/sorter-properties/new 100:1 ~/sorter-properties/proprietary {\n+{\n There are some new things about sorter. The backwards compatible with prose\n syntax.\n The synthesis of email-first, rank-centrality, and social platform. So\n@@ -124,6 +130,7 @@ But sorter is absolutely not ~/sorter-properties/proprietary. Sorter is open sou\n github.com/sortersocial/index\n Therefore, ~/sorter-properties/proprietary is banished 100:1 to the false end of the spectrum.\n }\n+~/sorter-properties/new 100:1 ~/sorter-properties/proprietary\n \n In sorter, there are no binaries. Everything is a spectrum, including\n truth.\n@@ -131,11 +138,17 @@ truth.\n The most important thing, in my mind, about sorter is that it’s collective.\n \n important\n-~/sorter-properties/collective 100:20 ~/sorter-properties/asynchronous { sorter would still be cool if it was\n-live }\n-~/sorter-properties/collective 100:90 ~/sorter-properties/precise { precise thinking is good too }\n-~/sorter-properties/collective 100:90 ~/sorter-properties/transitive { transitivity enables collectivity }\n-~/sorter-properties/collective 100:10 ~/sorter-properties/new { other iterations of sorter were good too }\n+{\n+sorter would still be cool if it was\n+live\n+}\n+~/sorter-properties/collective 100:20 ~/sorter-properties/asynchronous\n+{ precise thinking is good too }\n+~/sorter-properties/collective 100:90 ~/sorter-properties/precise\n+{ transitivity enables collectivity }\n+~/sorter-properties/collective 100:90 ~/sorter-properties/transitive\n+{ other iterations of sorter were good too }\n+~/sorter-properties/collective 100:10 ~/sorter-properties/new\n \n \n Any other person could add to or vote on #sorter-properties, this is just\ndiff --git a/server/tests/integration.rs b/server/tests/integration.rs\nindex bd10fd2a6ef06ac1a23de790a54ad5aa0065a472..e96d11c820c3bbaa8bb55ad11636397ef225e55a 100644\n--- a/server/tests/integration.rs\n+++ b/server/tests/integration.rs\n@@ -673,7 +673,7 @@ async fn test_private_room_post_links_use_private_garden_routes() {\n let rpc = ui_post_ingest_rpc(\n &room_id,\n \"garden-thread\",\n- \"~/secret/item {classified}\\n~/secret/other {other body}\\n~/secret/item 3:1 ~/secret/other {because}\\n\",\n+ \"~/secret/item {classified}\\n~/secret/other {other body}\\n{because}\\n~/secret/item 3:1 ~/secret/other\\n\",\n );\n let post = client\n .post(format!(\"http://{addr}/ui\"))\n@@ -734,7 +734,7 @@ async fn test_private_room_garden_root_lists_top_level_tilde_children() {\n let rpc = ui_post_ingest_rpc(\n &room_id,\n \"ing\",\n- \"~/test1 {wow}\\n~/test2 {wow2}\\n~/test1 2:1 ~/test2 {because}\\n\",\n+ \"~/test1 {wow}\\n~/test2 {wow2}\\n{because}\\n~/test1 2:1 ~/test2\\n\",\n );\n let post = client\n .post(format!(\"http://{addr}/ui\"))\n@@ -1003,7 +1003,7 @@ async fn test_post_redact_removes_garden_and_marks_thread() {\n \"room\": \"public\",\n \"thread_tag\": \"redact-test\",\n \"delegate\": \"00000000-0000-0000-0000-000000000000:test:local/test\",\n- \"text\": \"~/del-a {a}\\n~/del-b {b}\\n~/del-a 2:1 ~/del-b {vote line}\\n\",\n+ \"text\": \"~/del-a {a}\\n~/del-b {b}\\n{vote line}\\n~/del-a 2:1 ~/del-b\\n\",\n \"return_rank_diff\": false\n }\n }]),\n@@ -1123,7 +1123,7 @@ async fn test_vote_endpoint() {\n \"room\": \"public\",\n \"thread_tag\": \"cli\",\n \"delegate\": \"00000000-0000-0000-0000-000000000000:test:local/test\",\n- \"text\": \"~/clap {cli parser}\\n~/argh {cli parser}\\n~/clap 3:1 ~/argh {because clap is more full-featured}\\n\",\n+ \"text\": \"~/clap {cli parser}\\n~/argh {cli parser}\\n{because clap is more full-featured}\\n~/clap 3:1 ~/argh\\n\",\n \"return_rank_diff\": true\n }\n }]);\n@@ -1144,7 +1144,7 @@ async fn test_rank_endpoint() {\n \"room\": \"public\",\n \"thread_tag\": \"langs\",\n \"delegate\": \"00000000-0000-0000-0000-000000000000:test:local/test\",\n- \"text\": \"~/rust {systems}\\n~/go {concurrency}\\n~/rust 3:1 ~/go {because i prefer rust for systems work}\\n\",\n+ \"text\": \"~/rust {systems}\\n~/go {concurrency}\\n{because i prefer rust for systems work}\\n~/rust 3:1 ~/go\\n\",\n \"return_rank_diff\": false\n }\n }]);\n@@ -1178,7 +1178,7 @@ async fn test_check_endpoint_does_not_commit() {\n let check_batch = serde_json::json!([{\n \"Check\": {\n \"room\": \"public\",\n- \"text\": \"~/a {x}\\n~/b {y}\\n~/a 2:1 ~/b {because}\\n\",\n+ \"text\": \"~/a {x}\\n~/b {y}\\n{because}\\n~/a 2:1 ~/b\\n\",\n }\n }]);\n let resp_body = rpc_batch(&client, addr, None, check_batch).await;\n@@ -1217,7 +1217,7 @@ async fn test_garden_item_pair_matchup_include_threads() {\n \"room\": \"public\",\n \"thread_tag\": \"sorting-hat\",\n \"delegate\": \"00000000-0000-0000-0000-000000000000:test:local/test\",\n- \"text\": \"~/sorts/insertion { O(n^2) }\\n~/sorts/mergesort { O(n log n) }\\n~/sorts/insertion 3:1 ~/sorts/mergesort { simpler for small n }\\n\",\n+ \"text\": \"~/sorts/insertion { O(n^2) }\\n~/sorts/mergesort { O(n log n) }\\n{ simpler for small n }\\n~/sorts/insertion 3:1 ~/sorts/mergesort\\n\",\n \"return_rank_diff\": false\n }\n }]);\n@@ -1473,7 +1473,7 @@ async fn test_rank_history() {\n \n ingest(\n \"00000000-0000-0000-0000-000000000001:rig:test/model\",\n- \"~/hist/rust { systems }\\n~/hist/python { scripting }\\n~/hist/go { concurrency }\\n~/hist/rust 3:1 ~/hist/python { ownership over gc }\\n~/hist/rust 2:1 ~/hist/go { performance over simplicity }\\n\",\n+ \"~/hist/rust { systems }\\n~/hist/python { scripting }\\n~/hist/go { concurrency }\\n{ ownership over gc }\\n~/hist/rust 3:1 ~/hist/python\\n{ performance over simplicity }\\n~/hist/rust 2:1 ~/hist/go\\n\",\n )\n .await;\n \n@@ -1506,7 +1506,7 @@ async fn test_rank_history() {\n \n ingest(\n \"00000000-0000-0000-0000-000000000002:rig:test/model\",\n- \"~/hist/python 3:1 ~/hist/go { dynamic typing is worth it }\\n\",\n+ \"{ dynamic typing is worth it }\\n~/hist/python 3:1 ~/hist/go\\n\",\n )\n .await;\n \n@@ -1571,7 +1571,7 @@ async fn pair_returns_connectivity_stats() {\n \"room\": \"public\",\n \"thread_tag\": \"connectivity-test\",\n \"delegate\": \"00000000-0000-0000-0000-000000000001:testrig:test/model\",\n- \"text\": \"~/conn/a { item a }\\n~/conn/b { item b }\\n~/conn/c { item c }\\n~/conn/d { item d }\\n~/conn/a 3:1 ~/conn/b { a is better }\\n\",\n+ \"text\": \"~/conn/a { item a }\\n~/conn/b { item b }\\n~/conn/c { item c }\\n~/conn/d { item d }\\n{ a is better }\\n~/conn/a 3:1 ~/conn/b\\n\",\n \"return_rank_diff\": false\n }\n }]);\n@@ -1605,7 +1605,7 @@ async fn pair_returns_connectivity_stats() {\n \"room\": \"public\",\n \"thread_tag\": \"connectivity-test\",\n \"delegate\": \"00000000-0000-0000-0000-000000000001:testrig:test/model\",\n- \"text\": \"~/conn/c 2:1 ~/conn/a { c beats a }\\n\",\n+ \"text\": \"{ c beats a }\\n~/conn/c 2:1 ~/conn/a\\n\",\n \"return_rank_diff\": false\n }\n }]);\ndiff --git a/test/browser_garden_pin.clj b/test/browser_garden_pin.clj\nindex 98c086d5647207f3ac72dbb9cbc13488c030eef1..d4fa9ed60b45e872ec60e29307cfa61bcd9dd6b2 100644\n--- a/test/browser_garden_pin.clj\n+++ b/test/browser_garden_pin.clj\n@@ -60,7 +60,8 @@\n raw (str \"# \" thread-tag \"\\n\\n\"\n \"~/gp-pin-a {alpha}\\n\"\n \"~/gp-pin-b {beta}\\n\"\n- \"~/gp-pin-a 2:1 ~/gp-pin-b {pin test vote}\\n\")\n+ \"{pin test vote}\\n\"\n+ \"~/gp-pin-a 2:1 ~/gp-pin-b\\n\")\n post-resp (oauth/http-post-json\n (str base-url \"/api/v0/rpc\")\n [{\"Post\" {\"room\" \"public\"\ndiff --git a/test/browser_post_redact.clj b/test/browser_post_redact.clj\nindex f8f5fad7c0579f57e68744647465b9dcce1d4802..bf1af0230bc7c8228f947087d4f22d51d5189a5d 100644\n--- a/test/browser_post_redact.clj\n+++ b/test/browser_post_redact.clj\n@@ -60,7 +60,7 @@\n raw (str \"# \" thread-tag \"\\n\\n\"\n \"~/tomb-a {tomb item a}\\n\"\n \"~/tomb-b {tomb item b}\\n\"\n- \"~/tomb-a 2:1 ~/tomb-b {browser redact vote}\\n\")\n+ \"{browser redact vote}\\n~/tomb-a 2:1 ~/tomb-b\\n\")\n post-resp (oauth/http-post-json\n (str base-url \"/api/v0/rpc\")\n [{\"Post\" {\"room\" \"public\"\ndiff --git a/test/browser_public_garden.clj b/test/browser_public_garden.clj\nindex 7bea08e1cf2c8f5b1a94b0640a46e9ba5607b19b..5dd49f1f70c870e25a2a9f5348f0bdb85647e897 100644\n--- a/test/browser_public_garden.clj\n+++ b/test/browser_public_garden.clj\n@@ -51,7 +51,7 @@\n \"~/br-pub-a {alpha}\\n\"\n \"~/br-pub-b {beta}\\n\"\n \"~/br-pub-c {gamma}\\n\"\n- \"~/br-pub-a 2:1 ~/br-pub-b {browser regression vote}\\n\")\n+ \"{browser regression vote}\\n~/br-pub-a 2:1 ~/br-pub-b\\n\")\n post-resp (oauth/http-post-json\n (str base-url \"/api/v0/rpc\")\n [{\"Post\" {\"room\" \"public\"\ndiff --git a/test/browser_redact_thread_index.clj b/test/browser_redact_thread_index.clj\nindex 88a86fb9844fcf78df85e59f21f2e37f27df96a5..39958a85d4de10f284166f4561bc6ada2332b304 100644\n--- a/test/browser_redact_thread_index.clj\n+++ b/test/browser_redact_thread_index.clj\n@@ -63,11 +63,11 @@\n text-first (str \"# \" thread-tag \"\\n\\n\"\n \"~/rix/a {alpha}\\n\"\n \"~/rix/b {beta}\\n\"\n- \"~/rix/a 2:1 ~/rix/b {browser redact thread idx post one}\\n\")\n+ \"{browser redact thread idx post one}\\n~/rix/a 2:1 ~/rix/b\\n\")\n text-second (str \"# \" thread-tag \"\\n\\n\"\n \"~/rix/c {gamma}\\n\"\n \"~/rix/d {delta}\\n\"\n- \"~/rix/c 2:1 ~/rix/d {browser redact thread idx post two}\\n\")\n+ \"{browser redact thread idx post two}\\n~/rix/c 2:1 ~/rix/d\\n\")\n _ (is (true? (get-in (json/parse-string\n (:body (oauth/http-post-json\n (str base-url \"/api/v0/rpc\")\ndiff --git a/test/browser_vote_compare.clj b/test/browser_vote_compare.clj\nindex 839482d12963f130a2063f2212a6b922b2d229e1..f97a4a45e89c388f093694a1bf296f674bcb377a 100644\n--- a/test/browser_vote_compare.clj\n+++ b/test/browser_vote_compare.clj\n@@ -53,7 +53,8 @@\n raw (str \"# \" thread-tag \"\\n\\n\"\n \"~/gp-vote-a {one}\\n\"\n \"~/gp-vote-b {two}\\n\"\n- \"~/gp-vote-a 1:1 ~/gp-vote-b {seed edge vote}\\n\")\n+ \"{seed edge vote}\\n\"\n+ \"~/gp-vote-a 1:1 ~/gp-vote-b\\n\")\n post-resp (oauth/http-post-json\n (str base-url \"/api/v0/rpc\")\n [{\"Post\" {\"room\" \"public\"\ndiff --git a/test/grants.clj b/test/grants.clj\nindex 12846c6259c2c8f0395668d49155ee22c8abfcd5..055e0a94a7fd90d58f234f643ae8998956ef9939 100644\n--- a/test/grants.clj\n+++ b/test/grants.clj\n@@ -125,14 +125,15 @@\n (println \"\\nalice posts items + vote to private room…\")\n (is (rpc-line-ok? (:parsed (ingest! base-url alice-token room-id \"main\"\n \"00000000-0000-0000-0000-000000000001:test:local/dev\"\n- \"~/fruits/apple { A crisp red apple. }\\n~/fruits/banana { A yellow banana. }\\n~/fruits/apple > ~/fruits/banana { apples are better }\")))\n+ \"~/fruits/apple { A crisp red apple. }\\n~/fruits/banana { A yellow banana. }\\n{ apples are better }\\n~/fruits/apple > ~/fruits/banana\")))\n \"alice vote in private room succeeds\")\n \n ;; Bob (View + Post, no Vote) tries to vote.\n (println \"\\nbob (no Vote) tries to vote…\")\n (is (not (rpc-line-ok? (:parsed (ingest! base-url bob-token room-id \"main\"\n \"00000000-0000-0000-0000-000000000002:test:local/dev\"\n- \"~/fruits/apple > ~/fruits/banana { bob's take }\"))))\n+ \"{ bob's take }\n+~/fruits/apple > ~/fruits/banana\"))))\n \"bob without Vote gets RPC failure\")\n \n ;; Alice grants bob Vote.\n@@ -144,7 +145,8 @@\n (println \"\\nbob (View + Post + Vote) votes…\")\n (is (rpc-line-ok? (:parsed (ingest! base-url bob-token room-id \"main\"\n \"00000000-0000-0000-0000-000000000002:test:local/dev\"\n- \"~/fruits/apple > ~/fruits/banana { bob's take }\")))\n+ \"{ bob's take }\n+~/fruits/apple > ~/fruits/banana\")))\n \"bob with Vote succeeds\"))\n \n (finally\ndiff --git a/test/integration.clj b/test/integration.clj\nindex 81261c7f2e0487666ef849f523fe91b2c005e6cd..5530bf9f4533f7f548e47599b5fe33f9be567309 100644\n--- a/test/integration.clj\n+++ b/test/integration.clj\n@@ -39,19 +39,23 @@\n \"#integration-test\"\n \"\"\n \"~/languages/python { General-purpose, dynamically typed }\"\n- \"~/languages/rust { Systems language with ownership model }\"\n- \"~/languages/go { Compiled, garbage-collected, simple concurrency }\"\n+ \"~/languages/rust { Systems language with ownership model }\"\n+ \"~/languages/go { Compiled, garbage-collected, simple concurrency }\"\n \"\"\n- \"~/languages/rust 3:1 ~/languages/python { Rust has stronger type safety }\"\n- \"~/languages/rust 2:1 ~/languages/go { Ownership beats GC for systems work }\"\n- \"~/languages/python 2:1 ~/languages/go { Python's ecosystem is broader }\"]))\n+ \"{ Rust has stronger type safety }\n+~/languages/rust 3:1 ~/languages/python\"\n+ \"{ Ownership beats GC for systems work }\n+~/languages/rust 2:1 ~/languages/go\"\n+ \"{ Python's ecosystem is broader }\n+~/languages/python 2:1 ~/languages/go\"]))\n \n (def sorter-doc-2\n (str/join \"\\n\"\n [actor-2\n \"#integration-test\"\n \"\"\n- \"~/languages/go 2:1 ~/languages/python { Go deploys as a single binary, simpler ops }\"]))\n+ \"{ Go deploys as a single binary, simpler ops }\n+~/languages/go 2:1 ~/languages/python\"]))\n \n (def external-sorter-doc\n (str/join \"\\n\"\n@@ -61,7 +65,8 @@\n \"-/github.com/iss/1 { issue one }\"\n \"-/github.com/iss/2 { issue two }\"\n \"\"\n- \"-/github.com/iss/1 2:1 -/github.com/iss/2 { triage order }\"]))\n+ \"{ triage order }\n+-/github.com/iss/1 2:1 -/github.com/iss/2\"]))\n \n (def check-doc-disconnected\n (str/join \"\\n\"\n@@ -73,8 +78,10 @@\n \"~/disc/c { c }\"\n \"~/disc/d { d }\"\n \"\"\n- \"~/disc/a 2:1 ~/disc/b { first component }\"\n- \"~/disc/c 2:1 ~/disc/d { second component }\"]))\n+ \"{ first component }\n+~/disc/a 2:1 ~/disc/b\"\n+ \"{ second component }\n+~/disc/c 2:1 ~/disc/d\"]))\n \n ;; ---------------------------------------------------------------------------\n ;; main flow (linear integration)\n@@ -291,8 +298,10 @@\n (bind two-vote-doc (str/join \"\\n\"\n [\"@00000000-0000-0000-0000-000000000003:integration:local/test\"\n \"#integration-test\"\n- \"~/languages/rust 4:1 ~/languages/python { type safety }\"\n- \"~/languages/rust 3:1 ~/languages/go { zero-cost abstractions }\"]))\n+ \"{ type safety }\n+~/languages/rust 4:1 ~/languages/python\"\n+ \"{ zero-cost abstractions }\n+~/languages/rust 3:1 ~/languages/go\"]))\n (bind hist-ingest (common/run-cli cli-bin base-url [\"public\" \"forum\" \"post\" \"integration-test\" \"--json\" \"--delegate\" \"00000000-0000-0000-0000-000000000000:cli:local/dev\"] :input two-vote-doc :extra-env token-env))\n (is (zero? (:exit hist-ingest))\n (str \"two-vote ingest exits 0 (err: \" (:err hist-ingest) \")\"))\ndiff --git a/test/walkthrough_fixture.clj b/test/walkthrough_fixture.clj\nindex f7eb1cacca0317129e9baf68fa4f4e33356ad70f..fb7f4ee8c996e7b4ffb55e225f73f3266feda220 100644\n--- a/test/walkthrough_fixture.clj\n+++ b/test/walkthrough_fixture.clj\n@@ -49,7 +49,7 @@\n \"capabilities\" [\"view\" \"post\" \"vote\" \"add_item\"]}}]))\n (let [wall-text (str \"Walkthrough seed — multi-paragraph stress test.\\n\\n\"\n \"Second paragraph: the garden holds ~/secret/item and ~/secret/other. \"\n- \"Votes like ~/secret/item 3:1 ~/secret/other {because} should still parse.\\n\\n\"\n+ \"Votes like {because}\\\\n~/secret/item 3:1 ~/secret/other should parse.\\n\\n\"\n \"Third block: lorem-style filler so wrapping and vertical rhythm are obvious. \"\n \"We want enough prose that the thread view scrolls and pre blocks show overflow \"\n \"behavior (long lines, slug links, embed URLs) without looking like toy data.\\n\\n\"\n@@ -58,7 +58,7 @@\n \"https://open.spotify.com/track/4iV5W9uYEdYUVa79Axb7U9 https://www.youtube.com/watch?v=dQw4w9WgXcQ\\n\\n\"\n \"~/secret/item {classified}\\n\"\n \"~/secret/other {secondary}\\n\"\n- \"~/secret/item 3:1 ~/secret/other {because}\\n\")\n+ \"{because}\\n~/secret/item 3:1 ~/secret/other\\n\")\n rpc (json/generate-string\n {:action \"post_ingest\"\n :room room-id\n","role":"user"}],"model":"~x-ai/grok-latest"}