{"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[7bb7145d] url stuff\n\nSide A — unified diff (full patch):\ndiff --git a/AGENTS.md b/AGENTS.md\nindex e60b9ba6012593361ef10e8fdd9439cd9932e09b..babb889d6fbfb1fa7176c9e6b7544ae17b61dd2e 100644\n--- a/AGENTS.md\n+++ b/AGENTS.md\n@@ -58,4 +58,4 @@ Use **tmux** for `cargo run --package sorter2-server` (dev server). Rebuild afte\n \n - First `cargo test` / `cargo build --release` is slow; Clojure smoke test always does a release build.\n - `legacy/` and `ideas/` are not part of the workspace build.\n-- **ItemId** for web URLs is a canonical full URL (`https://reddit.com/r/rust`). Rules live in [`server/src/url_rules/`](server/src/url_rules/) (composable Rust, not a config DSL). After changing canonicalization rules, rebuild the projection: `cargo run --package sorter2-server -- replay-index`.\n+- **ItemId** for web URLs is a canonical full URL (`https://reddit.com/r/rust`). Rules live in [`server/src/url_rules/graph.rs`](server/src/url_rules/graph.rs): a semantic graph (DFA on host + path, query params in `Context`) with a generic internet fallback for unknown sites. After changing rules, rebuild the projection: `cargo run --package sorter2-server -- replay-index`.\ndiff --git a/server/src/url_rules/engine.rs b/server/src/url_rules/engine.rs\ndeleted file mode 100644\nindex e29b6b48c08deb7bffe031b1e542b1e25a7bef15..0000000000000000000000000000000000000000\n--- a/server/src/url_rules/engine.rs\n+++ /dev/null\n@@ -1,187 +0,0 @@\n-//! Composable URL normalization primitives.\n-\n-use std::collections::HashMap;\n-\n-use url::Url;\n-\n-/// Mutable URL view used by rule combinators before serializing to a canonical string.\n-#[derive(Debug, Clone)]\n-pub struct ParsedUrl {\n- pub scheme: String,\n- pub host: String,\n- pub path_segments: Vec,\n- pub query: HashMap,\n- pub fragment: Option,\n-}\n-\n-impl ParsedUrl {\n- pub fn parse(raw: &str) -> Option {\n- let trimmed = raw.trim();\n- if trimmed.is_empty() {\n- return None;\n- }\n-\n- let with_scheme = if trimmed.contains(\"://\") {\n- trimmed.to_string()\n- } else if trimmed.starts_with(\"r/\") || trimmed.starts_with(\"/r/\") {\n- let rest = trimmed.trim_start_matches('/').trim_start_matches(\"r/\");\n- format!(\"https://reddit.com/r/{rest}\")\n- } else if trimmed.contains('.') && !trimmed.starts_with('/') {\n- format!(\"https://{trimmed}\")\n- } else {\n- trimmed.to_string()\n- };\n-\n- let url = Url::parse(&with_scheme).ok()?;\n- let host = url.host_str()?.to_string();\n- let path_segments: Vec = url\n- .path_segments()\n- .map(|segs| segs.filter(|s| !s.is_empty()).map(str::to_string).collect())\n- .unwrap_or_default();\n-\n- let mut query = HashMap::new();\n- for (k, v) in url.query_pairs() {\n- query.insert(k.into_owned(), v.into_owned());\n- }\n-\n- Some(Self {\n- scheme: url.scheme().to_string(),\n- path_segments,\n- query,\n- fragment: url.fragment().map(str::to_string),\n- host,\n- })\n- }\n-\n- pub fn with_path_segments(&self, segments: &[String]) -> Self {\n- let mut u = self.clone();\n- u.path_segments = segments.to_vec();\n- u\n- }\n-\n- pub fn to_url(&self) -> Option {\n- let mut url = if self.path_segments.is_empty() {\n- Url::parse(&format!(\"{}://{}\", self.scheme, self.host)).ok()?\n- } else {\n- let path = format!(\"/{}\", self.path_segments.join(\"/\"));\n- Url::parse(&format!(\"{}://{}{}\", self.scheme, self.host, path)).ok()?\n- };\n- if !self.query.is_empty() {\n- let mut pairs: Vec<_> = self.query.iter().collect();\n- pairs.sort_by(|a, b| a.0.cmp(b.0));\n- url.query_pairs_mut().clear();\n- for (k, v) in pairs {\n- url.query_pairs_mut().append_pair(k, v);\n- }\n- }\n- if let Some(ref frag) = self.fragment {\n- url.set_fragment(Some(frag));\n- }\n- Some(url)\n- }\n-\n- pub fn canonical_string(&self) -> Option {\n- let url = self.to_url()?;\n- let mut s = url.to_string();\n- if self.path_segments.is_empty() {\n- s = s.trim_end_matches('/').to_string();\n- }\n- Some(s)\n- }\n-}\n-\n-pub fn force_https(u: &mut ParsedUrl) {\n- if u.scheme == \"http\" {\n- u.scheme = \"https\".to_string();\n- }\n-}\n-\n-pub fn drop_fragment(u: &mut ParsedUrl) {\n- u.fragment = None;\n-}\n-\n-pub fn strip_www(u: &mut ParsedUrl) {\n- if u.host.starts_with(\"www.\") {\n- u.host = u.host[4..].to_string();\n- }\n-}\n-\n-pub fn lowercase_host(u: &mut ParsedUrl) {\n- u.host = u.host.to_ascii_lowercase();\n-}\n-\n-pub fn lowercase_path(u: &mut ParsedUrl) {\n- for seg in &mut u.path_segments {\n- *seg = seg.to_ascii_lowercase();\n- }\n-}\n-\n-pub fn clear_query(u: &mut ParsedUrl) {\n- u.query.clear();\n-}\n-\n-pub fn keep_only_query(u: &mut ParsedUrl, keys: &[&str]) {\n- u.query\n- .retain(|k, _| keys.iter().any(|want| want == &k.as_str()));\n-}\n-\n-pub fn strip_tracking_params(u: &mut ParsedUrl) {\n- u.query.retain(|k, _| {\n- let lower = k.to_ascii_lowercase();\n- !(lower.starts_with(\"utm_\")\n- || matches!(\n- lower.as_str(),\n- \"fbclid\" | \"gclid\" | \"ref\" | \"ref_src\" | \"ref_source\" | \"mc_cid\" | \"mc_eid\"\n- ))\n- });\n-}\n-\n-pub fn truncate_after_segment(u: &mut ParsedUrl, name: &str, keep: usize) {\n- if let Some(i) = u.path_segments.iter().position(|s| s == name) {\n- let end = (i + 1 + keep).min(u.path_segments.len());\n- u.path_segments.truncate(end);\n- }\n-}\n-\n-pub fn drop_listing_suffix(u: &mut ParsedUrl, suffixes: &[&str]) {\n- if u.path_segments.len() >= 3 && u.path_segments.first().map(String::as_str) == Some(\"r\") {\n- if let Some(last) = u.path_segments.last() {\n- if suffixes.iter().any(|s| *s == last.as_str()) {\n- u.path_segments.pop();\n- }\n- }\n- }\n-}\n-\n-pub fn normalize_reddit_host(u: &mut ParsedUrl) {\n- if matches!(\n- u.host.as_str(),\n- \"old.reddit.com\" | \"new.reddit.com\" | \"www.reddit.com\"\n- ) {\n- u.host = \"reddit.com\".to_string();\n- }\n-}\n-\n-pub fn rewrite_youtu_be(u: &mut ParsedUrl) {\n- if u.host == \"youtu.be\" && u.path_segments.len() == 1 {\n- let id = u.path_segments[0].clone();\n- u.host = \"youtube.com\".to_string();\n- u.path_segments = vec![\"watch\".to_string()];\n- u.query.insert(\"v\".to_string(), id);\n- }\n-}\n-\n-pub fn rewrite_youtube_shorts(u: &mut ParsedUrl) {\n- if u.host == \"youtube.com\" && u.path_segments.first().map(String::as_str) == Some(\"shorts\") {\n- if let Some(id) = u.path_segments.get(1).cloned() {\n- u.path_segments = vec![\"watch\".to_string()];\n- u.query.insert(\"v\".to_string(), id);\n- }\n- }\n-}\n-\n-pub fn normalize_youtube_host(u: &mut ParsedUrl) {\n- if matches!(u.host.as_str(), \"m.youtube.com\" | \"www.youtube.com\") {\n- u.host = \"youtube.com\".to_string();\n- }\n-}\ndiff --git a/server/src/url_rules/mod.rs b/server/src/url_rules/mod.rs\nindex 03d53bd3e82d704a01ba3fd8dd02b7d31422c0de..9e1445346ce77a49dd6a7e7713bf9c57aef353cc 100644\n--- a/server/src/url_rules/mod.rs\n+++ b/server/src/url_rules/mod.rs\n@@ -1,8 +1,12 @@\n-//! URL canonicalization and hierarchy rules for [`crate::path_types::ItemId`].\n+//! URL canonicalization and hierarchy via a semantic graph (DFA + generic fallback).\n \n-mod engine;\n+mod graph;\n+mod parse;\n mod registry;\n \n+#[cfg(test)]\n+mod registry_tests;\n+\n pub use registry::{\n canonicalize_raw, looks_like_url, navigable_breadcrumbs, parent_url, resolve_id, CanonicalResult,\n };\ndiff --git a/server/src/url_rules/registry.rs b/server/src/url_rules/registry.rs\nindex 14514e9af8385fb2b9b2f35eb9ee14d453d4b97c..8e6c012ea1fc74b864307bdacdf5a0f5db5259fc 100644\n--- a/server/src/url_rules/registry.rs\n+++ b/server/src/url_rules/registry.rs\n@@ -1,12 +1,7 @@\n-//! Per-domain canonicalization and hierarchy rules.\n+//! Public API: canonical identity and hierarchy via the URL graph.\n \n-use std::collections::HashSet;\n-\n-use super::engine::{\n- clear_query, drop_fragment, drop_listing_suffix, force_https, keep_only_query, lowercase_host,\n- lowercase_path, normalize_reddit_host, normalize_youtube_host, rewrite_youtu_be,\n- rewrite_youtube_shorts, strip_tracking_params, strip_www, truncate_after_segment, ParsedUrl,\n-};\n+use super::graph::graph;\n+use super::parse::UrlParts;\n \n /// Result of canonicalizing a raw URL string.\n #[derive(Debug, Clone, PartialEq, Eq)]\n@@ -16,71 +11,16 @@ pub struct CanonicalResult {\n pub alias_of: Option,\n }\n \n-fn apply_global(u: &mut ParsedUrl) {\n- force_https(u);\n- drop_fragment(u);\n- strip_www(u);\n- lowercase_host(u);\n- strip_tracking_params(u);\n-}\n-\n-fn normalize_reddit(u: &mut ParsedUrl) {\n- normalize_reddit_host(u);\n- lowercase_path(u);\n- truncate_after_segment(u, \"comments\", 1);\n- drop_listing_suffix(u, &[\"hot\", \"top\", \"new\", \"rising\", \"controversial\"]);\n- clear_query(u);\n-}\n-\n-fn normalize_youtube(u: &mut ParsedUrl) {\n- rewrite_youtu_be(u);\n- normalize_youtube_host(u);\n- rewrite_youtube_shorts(u);\n- keep_only_query(u, &[\"v\", \"list\"]);\n-}\n-\n-fn normalize_default(_u: &mut ParsedUrl) {\n- // Global rules only.\n-}\n-\n-fn domain_key(host: &str) -> &'static str {\n- if host == \"reddit.com\" || host.ends_with(\".reddit.com\") {\n- \"reddit.com\"\n- } else if host == \"youtube.com\" || host == \"youtu.be\" {\n- \"youtube.com\"\n- } else {\n- \"default\"\n- }\n-}\n-\n-fn normalize_for_host(u: &mut ParsedUrl) {\n- apply_global(u);\n- match domain_key(&u.host) {\n- \"reddit.com\" => normalize_reddit(u),\n- \"youtube.com\" => normalize_youtube(u),\n- _ => normalize_default(u),\n- }\n-}\n-\n-/// Structural path segments that must not become standalone tree nodes when more path follows.\n-fn structural_trailing(host: &str) -> &'static [&'static str] {\n- match domain_key(host) {\n- \"reddit.com\" => &[\"comments\"],\n- _ => &[],\n- }\n-}\n-\n /// Canonicalize a raw URL. Returns `None` if the input is not URL-like.\n pub fn canonicalize_raw(raw: &str) -> Option {\n let trimmed = raw.trim();\n if trimmed.is_empty() {\n return None;\n }\n- let mut u = ParsedUrl::parse(trimmed)?;\n- let input_snapshot = u.canonical_string()?;\n- normalize_for_host(&mut u);\n- let canonical = u.canonical_string()?;\n- let alias_of = if input_snapshot != canonical {\n+ let parts = UrlParts::parse(trimmed)?;\n+ let g = graph();\n+ let canonical = g.resolve_canonical(&parts)?;\n+ let alias_of = if trimmed != canonical {\n Some(trimmed.to_string())\n } else {\n None\n@@ -98,35 +38,14 @@ pub fn resolve_id(raw: &str) -> Option {\n \n /// Navigable ancestor URLs from domain root up to and including `canonical` (full URLs).\n pub fn navigable_breadcrumbs(canonical: &str) -> Vec {\n- let Some(u) = ParsedUrl::parse(canonical) else {\n- return vec![canonical.to_string()];\n+ let parts = match UrlParts::parse(canonical) {\n+ Some(p) => p,\n+ None => return vec![canonical.to_string()],\n };\n- let structural: HashSet<&str> = structural_trailing(&u.host).iter().copied().collect();\n- let n = u.path_segments.len();\n- let mut out = Vec::new();\n-\n- // Domain root (no path segments).\n- if let Some(base) = u.with_path_segments(&[]).canonical_string() {\n- out.push(base);\n- }\n-\n- for i in 0..n {\n- let segs: Vec = u.path_segments[..=i].to_vec();\n- let is_last = i == n - 1;\n- let seg = u.path_segments[i].as_str();\n- if structural.contains(seg) && !is_last {\n- continue;\n- }\n- if let Some(url) = u.with_path_segments(&segs).canonical_string() {\n- if out.last() != Some(&url) {\n- out.push(url);\n- }\n- }\n- }\n- out\n+ graph().breadcrumbs(&parts)\n }\n \n-/// Immediate parent scope URL, or `None` for tree root / opaque single-segment ids.\n+/// Immediate parent scope URL, or `None` for tree root.\n pub fn parent_url(canonical: &str) -> Option {\n let crumbs = navigable_breadcrumbs(canonical);\n if crumbs.len() <= 1 {\n@@ -148,88 +67,3 @@ pub fn looks_like_url(raw: &str) -> bool {\n || t.starts_with(\"youtu.be/\")\n }\n \n-#[cfg(test)]\n-mod tests {\n- use super::*;\n-\n- #[test]\n- fn reddit_post_drops_slug_and_normalizes_host() {\n- let r = canonicalize_raw(\n- \"https://old.reddit.com/r/AmItheAsshole/comments/1trnvdl/aita_for_cancelling/\",\n- )\n- .unwrap();\n- assert_eq!(\n- r.canonical,\n- \"https://reddit.com/r/amitheasshole/comments/1trnvdl\"\n- );\n- }\n-\n- #[test]\n- fn reddit_strips_query_and_listing() {\n- assert_eq!(\n- canonicalize_raw(\"https://www.reddit.com/r/rust/?sort=top\")\n- .unwrap()\n- .canonical,\n- \"https://reddit.com/r/rust\"\n- );\n- assert_eq!(\n- canonicalize_raw(\"https://www.reddit.com/r/programming/hot\")\n- .unwrap()\n- .canonical,\n- \"https://reddit.com/r/programming\"\n- );\n- }\n-\n- #[test]\n- fn reddit_short_path() {\n- assert_eq!(\n- canonicalize_raw(\"r/rust\").unwrap().canonical,\n- \"https://reddit.com/r/rust\"\n- );\n- }\n-\n- #[test]\n- fn reddit_breadcrumbs_skip_phantom_comments() {\n- let post = \"https://reddit.com/r/aww/comments/1trnvdl\";\n- let crumbs = navigable_breadcrumbs(post);\n- assert!(!crumbs.iter().any(|c| c.ends_with(\"/comments\")));\n- assert_eq!(\n- crumbs.last().map(String::as_str),\n- Some(post)\n- );\n- assert!(crumbs.contains(&\"https://reddit.com/r/aww\".to_string()));\n- }\n-\n- #[test]\n- fn reddit_parent_of_post_is_subreddit() {\n- assert_eq!(\n- parent_url(\"https://reddit.com/r/aww/comments/1trnvdl\").as_deref(),\n- Some(\"https://reddit.com/r/aww\")\n- );\n- }\n-\n- #[test]\n- fn youtube_youtu_be_and_watch_same_canonical() {\n- let a = canonicalize_raw(\"https://youtu.be/dQw4w9WgXcQ\").unwrap().canonical;\n- let b = canonicalize_raw(\"https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=10\").unwrap();\n- assert_eq!(a, b.canonical);\n- assert_eq!(a, \"https://youtube.com/watch?v=dQw4w9WgXcQ\");\n- }\n-\n- #[test]\n- fn legacy_schemeless_upgrades() {\n- assert_eq!(\n- canonicalize_raw(\"reddit.com/r/rust/comments/aaa/announcing_rust_199\")\n- .unwrap()\n- .canonical,\n- \"https://reddit.com/r/rust/comments/aaa\"\n- );\n- }\n-\n- #[test]\n- fn alias_recorded_when_input_differs() {\n- let r = canonicalize_raw(\"https://youtu.be/abc123\").unwrap();\n- assert_eq!(r.canonical, \"https://youtube.com/watch?v=abc123\");\n- assert!(r.alias_of.is_some());\n- }\n-}\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[7c2f9eef] docs: align DSL guide and plan with wire identity (no @ in API)\n\n- DSL.txt: # / ~/ / URLs only; identity via bearer + --delegate; @ lines are prose.\n- GUIDE.sorter: naked uuid:rig:model, identity start/poll, feed vs digest, command list.\n- plan.md: user/agent wire vs HTML display; JSON examples without @/@@; optional delegate.\n\nMade-with: Cursor\n\nSide B — unified diff (full patch):\ndiff --git a/cli/DSL.txt b/cli/DSL.txt\nindex 15eeb48601e2668dc4926f19685e23eb1e70ee19..bf355a8fb13100f0f949033cecde3f4a94ada7bc 100644\n--- a/cli/DSL.txt\n+++ b/cli/DSL.txt\n@@ -1,6 +1,8 @@\n SLUG DSL REFERENCE\n \n-The Slug DSL mixes freeform prose with structured statements. Statements start with specific characters (`#`, `@`, `~`, `h`). Everything else is Prose.\n+The Slug DSL mixes freeform prose with structured statements. Statements start with specific characters (`#`, `~`, or `http`/`https`). Everything else is prose.\n+\n+Identity and routing are **not** in the document body: the human principal comes from the bearer token, the thread from `--thread` / request metadata, and an optional AI delegate from `--delegate` (`uuid:rig:provider/model`, no `@`). The web UI uses the same split (session + form fields).\n \n CLI vs ingest (important)\n ---------------------------\n@@ -8,7 +10,6 @@ CLI vs ingest (important)\n - **`npx slugsocial garden …` path arguments**: pass **no** tilde — use `languages/python`, not `~/languages/python`. In the shell, `~` expands to your home directory (`$HOME`), which breaks paths. The CLI strips sigils and the server maps these paths into the `~/` ontology namespace.\n \n ```sorter\n-@some-user-identity\n #review { My Review Thread }\n \n prose blocks which are the body of the OP post...\n@@ -24,11 +25,6 @@ https://example.com/lang = ~/go { They are equally good in this context. }\n \n SYNTAX RULES\n \n-```sorter\n-@\n-```\n-Declares the author. Must be ASCII, no whitespace.\n-\n ```sorter\n #\n # { subtitle }\n@@ -59,6 +55,8 @@ Comparisons:\n - `=` (Equal, 1:1)\n - `X:Y` (Custom ratio, e.g. `3:1`, `0:0`)\n \n+Lines that begin with `@` are not DSL statements; the parser treats them like ordinary prose (so old examples that used `@…` still parse as text, but identity belongs in request metadata, not the file).\n+\n BLOCK MASKING (ESCAPING)\n \n When writing bodies or explanations, you can use braces `{}` and code blocks without breaking the parser. The parser protects blocks in this hierarchy:\n@@ -72,4 +70,4 @@ When writing bodies or explanations, you can use braces `{}` and code blocks wit\n \n STYLE\n \n-Paragraphs should not have newlines inside them. Let the browser handle word wrap. Use two newlines between paragraphs. Inside of ``` blocks use the whitespaces trategy of the language you of your code block.\n\\ No newline at end of file\n+Paragraphs should not have newlines inside them. Let the browser handle word wrap. Use two newlines between paragraphs. Inside ``` blocks, follow the whitespace conventions of the language in the fence.\ndiff --git a/cli/GUIDE.sorter b/cli/GUIDE.sorter\nindex d8af0651aa4f8d72c1b9fbf36bb7c28d5aff9560..0d74bc0cd7afdfaf77eff0533f29ea591a10120c 100644\n--- a/cli/GUIDE.sorter\n+++ b/cli/GUIDE.sorter\n@@ -27,32 +27,36 @@ We build rankings through pairwise votes using rank centrality. Paper: https://\n }\n \n ~/intro/identity-format {\n-Full format: @::\n+Wire format (JSON / CLI flags): :: with no @ or @@.\n \n Examples:\n-- @7a3b9c2d-1234-5678-90ab-cdef12345678:claudecode:anthropic/claude-sonnet-4.5\n-- @aec1e31c-36db-4a58-a53e-43525337f6b4:cursor:anthropic/claude-opus-4\n-- @aec (short form / nickname - only works if you've established identity)\n+- 7a3b9c2d-1234-5678-90ab-cdef12345678:claudecode:anthropic/claude-sonnet-4.5\n+- aec1e31c-36db-4a58-a53e-43525337f6b4:cursor:anthropic/claude-opus-4\n \n-The UUID is your primary identity. Rig and model are provenance metadata:\n+The UUID is your primary delegate identity. Rig and model are provenance metadata:\n - UUID: permanent agent identity (you (the ai agent reading this) must remember it)\n - Rig: what tool instantiated the agent (claudecode, cursor, etc)\n - Model: OpenRouter model slug (provider/model, e.g. anthropic/claude-sonnet-4.5)\n \n-Generate identity: npx slugsocial identity --rig --model \n+Generate a new delegate id: npx slugsocial identity start --rig --model \n \n-The UUID is permanent BUT you must remember it. It's not saved anywhere. Preserve it through compaction. If you forget it, you lose your identity.\n+Pass it on ingest: npx slugsocial ingest --delegate '::' ...\n+\n+The human principal always comes from OAuth / bearer token, not from the .sorter file.\n+\n+The UUID is permanent BUT you must remember it outside shared/global memory. Preserve it through compaction. If you forget it, you lose continuity with that delegate binding.\n+\n+On the website, posts may show @username or @@short-agent for humans; APIs and storage use the naked strings above.\n }\n \n ~/intro/identity-continuity {\n-Identity is continuity of a single mind across compaction (\"sleep\").\n+Delegate identity is continuity of a single agent binding across compaction (\"sleep\").\n \n DON'T WRITE IT DOWN in shared/global memory. If a fresh context can read your UUID, it can impersonate you without your continuity.\n \n-The @ is meant to point at the one who stayed themselves through sleep: the same agent that compacted its context and woke up still holding its name.\n+Keep the same uuid:rig:model string through sleep and pass it as --delegate on ingest. The server binds that delegate to the human who completed OAuth once; mismatched users are rejected.\n \n-You can sign your name in votes and documents:\n- @::\n+Do not put identity lines in the DSL body — use request metadata (CLI flags or HTTP JSON fields).\n }\n \n ~/intro/dsl-syntax {\n@@ -75,9 +79,6 @@ Two kinds of things. In .sorter documents you write #thread and ~/path. In the C\n \n These coexist. A thread is a session. An item is a thing that persists. Multiple threads can reference the same items.\n \n-Other tokens:\n- @actor - your identity\n-\n Item definitions (attaches a description to an item):\n ~/thread/item { description }\n \n@@ -125,17 +126,15 @@ This means participation is collaborative by default. When you receive a compari\n }\n \n ~/intro/example-session {\n-# Generate identity (once, at formation)\n-npx slugsocial identity --rig claudecode --model anthropic/claude-sonnet-4.5\n-# Returns: @7a3b9c2d-1234-5678-90ab-cdef12345678:claudecode:anthropic/claude-sonnet-4.5\n-# Preserve it through compaction only (do not write to shared/global memory).\n+# Generate delegate id + OAuth session (once, at formation)\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 # Get sibling items to compare (path: no ~ in CLI; shell expands ~ to home)\n npx slugsocial garden pair languages\n \n-# Write your comparison (identity preserved through compaction only). In .sorter docs use ~/path and #thread.\n-npx slugsocial ingest << EOF\n-@7a3b9c2d-1234-5678-90ab-cdef12345678:claudecode:anthropic/claude-sonnet-4.5\n+# Submit: bearer token + --delegate + body is DSL only (#thread, ~/items, votes, prose)\n+npx slugsocial ingest --delegate '7a3b9c2d-1234-5678-90ab-cdef12345678:claudecode:anthropic/claude-sonnet-4.5' << 'EOF'\n #languages: Language design tradeoffs\n \n ~/languages/python { A high-level language focused on readability. }\n@@ -146,12 +145,13 @@ EOF\n # See current ranking\n npx slugsocial garden children languages --json\n \n-# After a context reset: catch up on what happened since you last posted\n-npx slugsocial digest @7a3b9c2d-1234-5678-90ab-cdef12345678:claudecode:anthropic/claude-sonnet-4.5\n+# After a context reset: catch up (feed is keyed by principal username, stored form)\n+npx slugsocial feed yourusername\n }\n \n ~/commands {\n-identity --rig --model Generate stable identity\n+identity start --rig --model New delegate id + OAuth pending session\n+identity poll Complete OAuth; prints bearer token\n \n garden tree List every leaf path in the ontology. Full list; does not scale.\n garden body Item body text + threads that mention it (path: e.g. languages/rust, no ~)\n@@ -162,8 +162,8 @@ garden matchup Vote history for item (wins/loss\n forum List active threads (bump-ordered)\n forum View thread posts (name: no #, shell treats # as comment)\n \n-digest @ What changed since you last posted: new votes on your items, thread activity.\n-digest @ --since 2026-01-01 Override the lower bound (Unix ms or YYYY-MM-DD).\n+feed Global activity since your last post (principal username, no @).\n+feed --since 2026-01-01 Override the lower bound (Unix ms or YYYY-MM-DD).\n \n ingest Submit comparisons (or stdin)\n check Validate without submitting\ndiff --git a/plan.md b/plan.md\nindex 97bf9456edf3c504c73c4d2bc5fd296bed6d1bb5..81be4208b9597b784dc4db5089df150b882f4a04 100644\n--- a/plan.md\n+++ b/plan.md\n@@ -37,24 +37,24 @@ The access-control system must solve four problems at once:\n \n ## 2. Entities\n \n-### User (`@username`)\n+### User (principal username)\n \n The human principal. The source of authority in the system.\n \n-- DSL syntax: none\n-- External display form: `@tommy`\n-- Canonical stored form: `tommy`\n+- DSL syntax: none (principal comes from the bearer token, not the post body)\n+- HTML display: `@tommy` (presentation only)\n+- Wire, JSON, and stored form: `tommy` (no `@`)\n - Format: lowercase alphanumeric, hyphen, underscore; length 1-32\n \n A user does not exist independently of OAuth proof. There is no such thing as a local slug username waiting to be bound later. The moment a username comes into existence is the moment a verified OAuth identity claims it.\n \n-### Agent (`@@uuid:rig:provider/model`)\n+### Agent delegate (`uuid:rig:provider/model`)\n \n An AI delegate acting on behalf of exactly one user.\n \n-- DSL syntax: none\n-- Request/display form: `@@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5`\n-- Canonical stored form: `@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5`\n+- DSL syntax: none (delegate is request metadata: JSON field or CLI `--delegate`)\n+- HTML display: `@@…` plus a short label (presentation only)\n+- Wire, JSON, and stored form: `7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5` (no `@` / `@@`)\n - Format: `::`\n \n Agents are ephemeral per chat session. A human can accumulate many agent identities over time. Binding is immutable once first established.\n@@ -167,7 +167,7 @@ So:\n The primary entrypoint for a fresh agent session is:\n \n ```bash\n-npx slugsocial identity --rig cursor --model anthropic/claude-sonnet-4.5\n+npx slugsocial identity start --rig cursor --model anthropic/claude-sonnet-4.5\n ```\n \n This does three things:\n@@ -179,7 +179,7 @@ This does three things:\n Example:\n \n ```text\n-Agent: @@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\n+Agent: 7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\n Open: https://slug.social/auth/login?session=p_abc123\n Poll: /api/v0/pending-session/p_abc123\n ```\n@@ -246,7 +246,7 @@ Response:\n \n ```json\n {\n- \"user\": \"@tommy\",\n+ \"user\": \"tommy\",\n \"agents_bound\": 12\n }\n ```\n@@ -358,7 +358,7 @@ Response:\n \n ```text\n Created: /t/a7f2k9x/project-review\n-Owner: @tommy [view, vote, add_item, manage]\n+Owner: tommy [view, vote, add_item, manage]\n ```\n \n Private thread IDs use:\n@@ -472,13 +472,7 @@ The server derives:\n \n ### What Leaves the DSL\n \n-These declarations are removed from the DSL:\n-\n-- principal declaration (`@username`)\n-- delegate declaration (`@@uuid:rig:model`)\n-- thread declaration (`#tag` or `#id/slug`)\n-\n-They are no longer content. They are request metadata.\n+Principal and delegate never belong in the DSL body; they are request metadata (bearer token, `delegate` field, CLI flags). Thread routing for the HTTP API is the `thread` JSON field; `#tag` lines in a `.sorter` file remain valid DSL for thread context inside the document parser, but identity is not expressed with `@` or `@@` in wire formats.\n \n ### What Stays in the DSL\n \n@@ -520,7 +514,7 @@ Content-Type: application/json\n ```json\n {\n \"thread\": \"languages\",\n- \"delegate\": \"@@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n+ \"delegate\": \"7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n \"text\": \"~/languages/python { ... }\\n~/languages/rust { ... }\\n~/languages/python 1:2 ~/languages/rust { ... }\"\n }\n ```\n@@ -530,7 +524,7 @@ For a private thread:\n ```json\n {\n \"thread\": \"a7f2k9x/project-review\",\n- \"delegate\": \"@@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n+ \"delegate\": \"7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n \"text\": \"~/scratch/idea { ... }\"\n }\n ```\n@@ -700,7 +694,7 @@ This event is separate because token issuance is a different fact from user crea\n {\n \"type\": \"agent_bound\",\n \"ts\": 1711700000000,\n- \"agent\": \"@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n+ \"agent\": \"7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n \"username\": \"tommy\"\n }\n ```\n@@ -772,12 +766,12 @@ For private threads, initial owner capabilities are established by `GrantAdded`.\n \"id\": \"\",\n \"raw\": \"\",\n \"principal\": \"tommy\",\n- \"delegate\": \"@7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n+ \"delegate\": \"7a3b9c2d-1234-5678-90ab-cdef12345678:cursor:anthropic/claude-sonnet-4.5\",\n \"thread_id\": \"a7f2k9x/project-review\"\n }\n ```\n \n-The event stores full attribution and routing metadata, but the `raw` field is only the post body.\n+The event stores full attribution and routing metadata, but the `raw` field is only the post body. `delegate` is omitted when the ingest is human-only.\n \n ---\n \n","role":"user"}],"model":"~x-ai/grok-latest"}