constitution · epochs · watch · epoch 6
comparison
c_297fa674bf56 (tommy-mor) vs c_b3cd0933b715 (tommy-mor)
download prompt · raw event · cmp_0f633cca4aafce
council reasoning
No judgments yet.
sides
A — c_297fa674bf56 (tommy-mor)
message
[7422b40d] 308 legacy are.na channel URLs; unbreak Kaocha CI (#199) * Fix flaky are.na legacy-redirect Kaocha wait Poll the page URL on the Playwright thread after clicking resolve children. wait-for-url on a future could miss the eval'd window.location redirect and fail CI after #193 merged. Co-authored-by: thmorriss <thmorriss@gmail.com> * Fix unmatched parens in arena resolver test The extra str wrapping the assertion message dropped a closing paren and the namespace failed to load. Co-authored-by: thmorriss <thmorriss@gmail.com> * Submit are.na resolve via JS click, not Playwright pointer The legacy user/channel page is a ghost item, so it embeds a live are.na iframe above the resolver. Playwright's pointer click can miss the /ui submit; HTMLElement.click() hits the same-document form. Add cargo coverage that the resolve form already targets /channel/:slug. Co-authored-by: thmorriss <thmorriss@gmail.com> * Drive are.na resolve through in-page fetch and eval HTMLElement.click still returned before slug_ui.js finished POST /ui. Evaluate the same fetch+eval as the interceptor (Playwright awaits the promise), drop the live iframe, then poll the URL. Co-authored-by: thmorriss <thmorriss@gmail.com> * 308 legacy are.na user/channel garden URLs to /channel/:slug GET /-/https://www.are.na/:user/:channel now permanently redirects to the canonical channel item, matching are.na and avoiding a ghost page whose live iframe broke the Kaocha resolve-redirect wait. Co-authored-by: thmorriss <thmorriss@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
diff preview
diff --git a/agents.md b/agents.md
index e3b1df96a40def06c2602fe3055388ca0cd9c8e4..bcdd536f2903dc6f65048f7b3b0c70ad17c6cd3b 100644
--- a/agents.md
+++ b/agents.md
@@ -67,7 +67,7 @@ Strict **CSP** that blocks `eval` would break the current app. Other projects ma
- **`ResolveExternal`:** Resolver buttons (GitHub, are.na) are browser actions through **`POST /ui`**. Success responses morph **`#external-resolver-status`** then redirect to the sanitized shareable **`GET`** page so imported children render through the normal page path; errors morph the same status region. Resolver results are durable system ingests, while cooldown state is RAM-only. Implementation lives under **`server/src/resolvers/`** (per-domain resolver + import card JSON); **`mod.rs::resolve_external_children`** dispatches on URL host and **`try_render_resolver_item_body`** tries each card renderer before falling back to the usual **`<pre>`** linkified view (called from **`render_item_body_in_scope`** in **`server/src/html/mod.rs`**, used by ontology item pages and the **`GET /vote/compare`** left/right columns). The resolver panel (**`external_resolver_controls`** in **`server/src/html/garden/external.rs`**) renders per-host ("GitHub resolver" / "Are.na resolver"); only GitHub items get a siblings button (are.na block URLs are not path-children of their channel).
- **Import thread:** one forum thread per GitHub repo (`import:https:::github.com:{owner}:{repo}`), shared by repo root / issues / pulls / commits / releases imports. Are.na: one thread per channel (`import:https:::www.are.na:channel:{slug}`) or per user profile (`import:https:::www.are.na:{user}`).
- **Issues:** each open issue is its own **`system:github-resolver`** ingest in that repo import thread (so a later redact removes that issue from the garden). Refresh pages **all** open issues from the GitHub API (up to the page safety cap), keeps still-open single-issue posts, and **`SystemRedact`s** posts for closed/missing issues (and multi-issue bulk posts, which are re-imported as singles). The `slug-github-card` fence payload is **base64(JSON)** so markdown fences in issue bodies cannot terminate the DSL toggle-fence; decode yields the real excerpt string for rich/markdown rendering.
- - **Are.na channels and users:** each channel entry (block or nested channel) is its own **`system:arena-resolver`** ingest in the channel import thread, with the same refresh semantics as issues: page **`GET /v3/channels/{slug}/contents`** (`per=100`, page cap 25), keep still-connected posts, redact removed ones. User profile URLs (`https://www.are.na/:user`) import the user's channels via **`GET /v3/users/{user}/contents`** (non-channel entries skipped). Legacy **`/:user/:channel`** URLs name the same channel as **`/channel/:slug`** (slugs are globally unique): the resolver collapses them onto the canonical channel item (**`canonical_arena_item`**), and the panel's `item_storage` / `next` point at the canonical page. Block URLs (`/block/:id`) are **not** path-children of the channel, so membership is an **explicit containment claim** (`block <: channel` with a leading `{ … }` explanation) in the same post as the block's `slug-arena-card` body; blocks keep cross-channel identity (one item, multiple scopes). Validation requires containment sides to have bodies, so a ghost parent (channel or user, never pasted with a body) gets a one-time card definition ingest before child posts (**`ensure_scope_body`**). Cards carry `image_url` / `source_url` and render an `<img>` for image blocks. Env: **`SLUG_ARENA_API_BASE_URL`** (default `https://api.are.na`, v3), optional **`SLUG_ARENA_TOKEN`**, **`SLUG_ARENA_RESOLVER_COOLDOWN_MS`**. Card CSS classes are resolver-agnostic (`import-card__*`, shared with GitHub cards).
+ - **Are.na channels and users:** each channel entry (block or nested channel) is its own **`system:arena-resolver`** ingest in the channel import thread, with the same refresh semantics as issues: page **`GET /v3/channels/{slug}/contents`** (`per=100`, page cap 25), keep still-connected posts, redact removed ones. User profile URLs (`https://www.are.na/:user`) import the user's channels via **`GET /v3/users/{user}/contents`** (non-channel entries skipped). Legacy **`/:user/:channel`** URLs name the same channel as **`/channel/:slug`** (slugs are globally unique): garden **`GET /-/https://www.are.na/:user/:channel`** **308**s onto **`/-/https://www.are.na/channel/:slug`** (query preserved; room-scoped twin too). The resolver also collapses them onto the canonical channel item (**`canonical_arena_item`** / **`collapsed_legacy_arena_item`**), and the panel's `item_storage` / `next` point at the canonical page. Block URLs (`/block/:id`) are **not** path-children of the channel, so membership is an **explicit containment claim** (`block <: channel` with a leading `{ … }` explanation) in the same post as the block's `slug-arena-card` body; blocks keep cross-channel identity (one item, multiple scopes). Validation requires containment sides to have bodies, so a ghost parent (channel or user, never pasted with a body) gets a one-time card definition ingest before child posts (**`ensure_scope_body`**). Cards carry `image_url` / `source_url` and render an `<img>` for image blocks. Env: **`SLUG_ARENA_API_BASE_URL`** (default `https://api.are.na`, v3), optional **`SLUG_ARENA_TOKEN`**, **`SLUG_ARENA_RESOLVER_COOLDOWN_MS`**. Card CSS classes are resolver-agnostic (`import-card__*`, shared with GitHub cards).
- **External URL wire form:** Canonical garden paths are **`/-/https://host/…`**. Legacy **`/-/host/…`** and collapsed **`/-/https:/host/…`** permanently redirect to the canonical form. Action `next` fields always use the canonical path.
- **Tilde garden URLs / leaf identity:** Leaf pages are canonical (`GET /~/luke` renders the item/scope page). Nested `GET /~/x/luke` permanently redirects (308, query preserved) to the leaf — same precedent as `/-/` legacy redirects (`OntologyPath::nested_redirect_target`). Trailing slashes on the garden roots and leaf pages also 308 to the slash-free form (`/~/` → `/~`, `/~/luke/` → `/~/luke`; same for `/-/` and `/r/:room_key/~/` / `/r/:room_key/-/`). Room-scoped `/r/:room/~/*path` follows the same rule (`/r/…/~/x/luke` → `/r/…/~/luke`). **`GET /~`** is the root-electorate index (via the root scope view). `~/x/luke` and `~/y/luke` are the same item `~luke`. Breadcrumbs walk **containment** (strongest parent weight), not the typed URL path; other active scopes are listed as alternates on the item page.
- **Garden pin / compare voting:** Cookie **`slug_garden_pin`** via **`set_garden_pin`**. Pairwise UI: **`GET /vote/compare?…`** / **`GET /r/:room_key/vote/compare?…`** (fullscreen **`GET`** page: no HUD; other garden pages). HUD (**`#slug-pin-hud`**): only when **`layout`** passes garden metadata on **`body`**; the label is **`POST /ui`** **`set_garden_pin`** **`clear:true`** (**`slug_ui.js`**), not a permalink to the item.
diff --git a/server/src/html/garden/external.rs b/server/src/html/garden/external.rs
index cccfe2717260cea6ba7b437c41fceed5c626a10a..516e8191afef4ce10618df97ed251704910c9e68 100644
--- a/server/src/html/garden/external.rs
+++ b/server/src/html/garden/external.rs
@@ -200,6 +200,30 @@ mod tests {
assert!(!html.contains("jake-chvatal"));
}
+ #[test]
+ fn kaocha_legacy_my_chan_url_rewrites_next_to_canonical() {
+ let nav = ThreadNav::public();
+ let markup = external_resolver_controls(
+ "https://www.are.na/some-user/my-chan",
+ &nav,
+ "/-/https://www.are.na/some-user/my-chan",
+ )
+ .expect("are.na panel renders");
+ let html = markup.into_string();
+ assert!(
+ html.contains("/-/https://www.are.na/channel/my-chan"),
+ "legacy ghost page must land on canonical channel, got {html}"
+ );
+ assert!(
+ html.contains("https://www.are.na/channel/my-chan"),
+ "resolve payload must target canonical item, got {html}"
+ );
+ assert!(
+ !html.contains("some-user"),
+ "legacy user segment must not remain in the resolve form, got {html}"
+ );
+ }
+
#[test]
fn canonical_arena_channel_url_keeps_page_as_next() {
let nav = ThreadNav::public();
diff --git a/server/src/html/garden/routes.rs b/server/src/html/garden/routes.rs
index 226571b7dafe7c2a274f6b343cda8b55d94a604a..dd8f19a564a771d4eae766fda50c715f8fed1700 100644
--- a/server/src/html/garden/routes.rs
+++ b/server/src/html/garden/routes.rs
@@ -54,6 +54,14 @@ pub async fn redirect_strip_trailing_slash(uri: Uri) -> impl IntoResponse {
redirect_permanent_preserving_query(canonical, &uri)
}
+/// Legacy are.na `/:user/:channel` garden paths 308 onto `/channel/:slug`.
+fn arena_legacy_channel_redirect(request_path: &str, nav: &ThreadNav) -> Option<String> {
+ let parsed = ExternalOntologyPath::from_input(request_path);
+ let item = ItemId::parse(parsed.as_str())?;
+ let canonical = crate::resolvers::arena::collapsed_legacy_arena_item(&item)?;
+ Some(nav.garden_item_href(&canonical))
+}
+
pub async fn garden_index(
State(state): State<AppState>,
jar: CookieJar,
@@ -241,6 +249,9 @@ pub async fn external_ontology_path(
if let Some(canonical) = ExternalOntologyPath::legacy_redirect_target(&path) {
return redirect_permanent_preserving_query(&canonical, &uri).into_response();
}
+ if let Some(canonical) = arena_legacy_channel_redirect(&path, &ThreadNav::public()) {
+ return redirect_permanent_preserving_query(&canonical, &uri).into_response();
+ }
let path = ExternalOntologyPath::from_input(&path);
render_scope_view(
state,
@@ -398,6 +409,9 @@ pub async fn room_external_ontology_path(
let base = format!("{}-/{tail}", nav.garden_root_url().trim_end_matches('~'));
return redirect_permanent_preserving_query(&base, &uri).into_response();
}
+ if let Some(canonical) = arena_legacy_channel_redirect(&path, &nav) {
+ return redirect_permanent_preserving_query(&canonical, &uri).into_response();
+ }
let path = ExternalOntologyPath::from_input(&path);
render_scope_view(state, GardenBrowsePath::External(path), nav, jar, uri)
.await
diff --git a/server/src/resolvers/arena.rs b/server/src/resolvers/arena.rs
index 9f8bdf62d99a9b878b9abeb949ba33ff78364810..dba51b5326cbb72310a63a2c8a945f48bcfa96bc 100644
--- a/server/src/resolvers/arena.rs
+++ b/server/src/resolvers/arena.rs
@@ -278,6 +278,13 @@ pub fn canonical_arena_item(item: &ItemId) -> Option<ItemId> {
}
}
+/// `Some` when `item` is a legacy `/:user/:channel` URL that should 308 to
+/// `/channel/:slug`. User profiles and already-canonical channel URLs are `None`.
+pub fn collapsed_legacy_arena_item(item: &ItemId) -> Option<ItemId> {
+ let canonical = canonical_arena_item(item)?;
+ (canonical.as_str() != item.as_str()).then_some(canonical)
+}
+
/// Stable import thread for an are.na URL: one thread per channel or per user.
fn resolver_thread_tag(item: &ItemId) -> String {
let path = match arena_target(item) {
@@ -813,6 +820,20 @@ mod tests {
canonical.as_str(),
"https://www.are.na/channel/item-industrial"
);
+ assert_eq!(
+ collapsed_legacy_arena_item(&legacy).as_ref().map(ItemId::as_str),
+ Some("https://www.are.na/channel/item-industrial")
+ );
+ assert_eq!(
+ collapsed_legacy_arena_item(
+ &ItemId::parse("https://www.are.na/channel/item-industrial").unwrap()
+ ),
+ None
+ );
+ assert_eq!(
+ collapsed_legacy_arena_item(&ItemId::parse("https://www.are.na/jake-chvatal").unwrap()),
+ None
+ );
// Same thread as the canonical form.
assert_eq!(
resolver_thread_tag(&legacy),
d
… preview truncated; 3,356 characters omittedB — c_b3cd0933b715 (tommy-mor)
message
[85186081] Fix sorter parse diagnostics for dotted tokens and URL-shaped lines (#193)
Dotted tilde tokens like ~mcdonalds.com used to fail with a vote-explanation
message and no line number, so the later valid claim looked guilty. Report
line 1 and the invalid character instead.
URL-shaped prose (mcdonalds.com { body }) stays inert but now warns.
https://… { body } remains a URL item; CheckOk.warnings notes when a doc
defined items but has no votes so the dry-run is no longer silent.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>diff preview
diff --git a/agents.md b/agents.md
index 9078b5aaace7eac7ed34ea2f0d86974e56b0fcb6..8f6f532f25dcb27c7c5c44ad54b771c9c45443b8 100644
--- a/agents.md
+++ b/agents.md
@@ -38,6 +38,8 @@ Strict **CSP** that blocks `eval` would break the current app. Other projects ma
- **`RpcCommand` / `POST /api/v0/rpc`** (`types/src/lib.rs`, `server/src/api/rpc.rs`): **Bearer-authenticated** JSON API for CLI, automation, and programmatic clients. Durable effects go through here (append to event log, then `apply_event`).
+- **Check / `check_sorter` diagnostics:** Parse errors include a 1-based **`line N:`** prefix. A dotted tilde token (`~mcdonalds.com`) fails on that line (not a valid tilde item name; `.` is not allowed; charset is `[a-z0-9_-]`), not on a later valid claim. A URL-shaped line without `http(s)://` (`mcdonalds.com { body }`) stays **prose** and adds a warning. `https://… { body }` remains a URL item (not prose). **`CheckOk.warnings`** also notes when a document defined items but includes no votes (ranking preview empty).
+
- **ChatGPT / Codex MCP (`POST /mcp`)** (`server/src/mcp/`): Streamable-HTTP JSON-RPC for the Plugins Directory. Tools call `dispatch_rpc` (same handlers as `POST /api/v0/rpc`). Public reads are `noauth` (and also accept a bearer). Private-room reads and all writes require `Authorization: Bearer slug_…` (issued as the OAuth access token). `post_sorter` **requires** `delegate` (`uuid:rig:provider/model`); the writer binds that delegate to the linked human and rejects other humans. `create_room` only creates private rooms (`visibility` must be `"private"`) and can grant `members`. Read results for posts expose `actor` and `delegate`. Authenticated private-room reads are first-class MCP tools: `list_rooms`, `read_room`, and `get_feed` use `oauth2` + `slug.read`. `get_feed` accepts the same `delegate` as CLI `feed` (server-side cutoff = that delegate's last ingest). `get_matchup` is CLI `garden matchup`. `health` is `GET /healthz` (liveness). Garden `item_path` / `parent_path` queries accept a bare leaf (`ship-sets` = `~ship-sets`). Private `room_id` accepts `shortid/slug` or the bare 7-char shortid. `identity_start` / `identity_poll` mint a conversation delegate (linked callers get it immediately; unlinked callers get a Google URL). Dual-mode garden/forum reads list `slug.read` before `noauth` so linked clients send the bearer. OAuth 2.1 + PKCE lives at `/oauth/authorize` + `/oauth/token` and reuses Google login. Redirect allowlist is ChatGPT (`chatgpt.com` / `chat.openai.com`), Claude (`claude.ai`, including `https://claude.ai/api/mcp/auth_callback`), and loopback HTTP. Well-known docs are `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`. Domain verification token is `GET /.well-known/openai-apps-challenge` from `SLUG_OPENAI_APPS_CHALLENGE`. Do not add a parallel write path. Do not reuse `POST /ui` + `eval` morph as a ChatGPT widget. The website/RPC still allow human posts with no delegate; only the MCP tool requires it.
- **Forum thread tags on write:** `validate_thread_tag` (`types/src/paths.rs`) canonicalizes then rejects empty tags and any tag containing `/` (would break `/t/:tag` routing). The new-thread form already constrains the charset client-side (`pattern="[a-z0-9_\\-]{1,64}"`); server write paths (`WriteCmd::Post` / `SystemIngest`, and UI `PostIngest` / `CheckIngest` / `VoteComparePost`) enforce the slash rule. Read/replay still uses `canonicalize_tag` only so historical tags keep resolving. System import tags use `:` instead of `/` (e.g. `import:https:::github.com:org:repo`).
diff --git a/cli/src/main.rs b/cli/src/main.rs
index aa80ce3586b9f8f5102abfd5930ee39cd6e83bac..8d4f682f8553c04970dedb2a1a55653135006182 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -1597,6 +1597,7 @@ async fn run_scoped(base: &str, room: &str, sub: ScopedCmd) -> Result<()> {
rankings,
threads,
next,
+ warnings,
} => {
if json {
println!(
@@ -1606,10 +1607,17 @@ async fn run_scoped(base: &str, room: &str, sub: ScopedCmd) -> Result<()> {
"rankings": rankings,
"threads": threads,
"next": next,
+ "warnings": warnings,
}))?
);
} else {
println!("✓ check ok (dry-run)");
+ if !warnings.is_empty() {
+ println!("warnings:");
+ for w in warnings.iter() {
+ println!(" {w}");
+ }
+ }
if !threads.is_empty() {
println!("threads:");
for t in threads {
diff --git a/server/src/api/rpc.rs b/server/src/api/rpc.rs
index adce34f4f9d7ff1ed3a773fa4cc4a925c1fe95f4..36b423117aa7e5c384c987d6da9f25d8dfa08945 100644
--- a/server/src/api/rpc.rs
+++ b/server/src/api/rpc.rs
@@ -539,6 +539,7 @@ async fn rpc_check(
rankings,
threads: vec![format!("#{}", thread_id)],
next: check_next,
+ warnings: v.doc.check_warnings(),
})
}
diff --git a/server/src/dsl.rs b/server/src/dsl.rs
index 4eb8da1f22a18f120eabe86aaf56352adeab5a21..8f6311564f5a061dc77371695a93ed3f51a1c9d3 100644
--- a/server/src/dsl.rs
+++ b/server/src/dsl.rs
@@ -4,6 +4,8 @@ use std::collections::HashMap;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Document {
pub statements: Vec<Stmt>,
+ /// Non-fatal diagnostics (e.g. URL-shaped lines that were parsed as prose).
+ pub warnings: Vec<String>,
}
/// A single statement in the DSL (or prose when using `parse_full`).
@@ -43,6 +45,34 @@ pub enum Stmt {
},
}
+impl Document {
+ /// Extra dry-run notes: parse warnings plus a hint when items were defined
+ /// but this document cannot fill the ranking preview (no votes).
+ pub fn check_warnings(&self) -> Vec<String> {
+ let mut warnings = self.warnings.clone();
+ let item_titles: Vec<&str> = self
+ .statements
+ .iter()
+ .filter_map(|s| match s {
+ Stmt::Item { title, .. } => Some(title.as_str()),
+ _ => None,
+ })
+ .collect();
+ let has_vote = self
+ .statements
+ .iter()
+ .any(|s| matches!(s, Stmt::Vote { .. }));
+ if !item_titles.is_empty() && !has_vote {
+ warnings.push(format!(
+ "defined {} item(s) ({}); ranking preview is empty until this document includes a vote",
+ item_titles.len(),
+ item_titles.join(", ")
+ ));
+ }
+ warnings
+ }
+}
+
#[derive(Debug, thiserror::Error)]
pub enum DslError {
#[error("parse error: {0}")]
@@ -599,6 +629,37 @@ fn parse_item_name_at(s: &str, i: usize) -> Option<(String, usize)> {
parse_item_name_at_with_mode(s, i, false)
}
+/// `mcdonalds.com { body }` / `www.foo.com { x }` — looks like a definition but is prose.
+fn looks_like_lone_definition(stripped: &str) -> bool {
+ if stripped.is_empty()
+ || stripped.starts_with('~')
+ || stripped.starts_with("http://")
+ || stripped.starts_with("https://")
+ || stripped.starts_with("-/")
+ || stripped.starts_with('#')
+ || stripped.starts_with(':')
+ {
+ return false;
+ }
+ let bytes = stripped.as_bytes();
+ let mut i = 0usize;
+ while i < bytes.len() && !is_ws_byte(bytes[i]) && !bytes[i..].starts_with(b"__BLOCK_") {
+ i += 1;
+ }
+ if i == 0 {
+ return false;
+ }
+ let name = &stripped[..i];
+ if !name.contains('.') && !name.contains("://") {
+ return false;
+ }
+ i = skip_ws(stripped, i);
+ let Some((_, end)) = parse_block_token_at(stripped, i) else {
+ return false;
+ };
+ stripped[end..].trim().is_empty()
+}
+
/// `~mcdonalds.com` lexes as `~mcdonalds` then leftover `.com`. Report the
/// dotted spelling instead of a vote-explanation error that reads like a later
/// valid claim failed.
@@ -904,9 +965,13 @@ fn parse_item_definition_statement(
return Ok(stmts);
}
- Err(DslError::Parse(
- "vote explanations must start with a `{ ... }` block before the comparison".to_string(),
- ))
+ if parse_comparison_at(stripped, i).is_some() {
+ return Err(DslError::Parse(
+ "vote explanations must start with a `{ ... }` block before the comparison".to_string(),
+ ));
+ }
+
+ Err(DslError::Parse("extra tokens after item definition".to_string()))
}
fn parse_line(masked_line: &str, masker: &BlockMasker) -> Result<Vec<Stmt>, DslError> {
@@ -975,6 +1040,7 @@ pub fn parse_full_strict(text: &str) -> Result<Document, DslError> {
fn parse_full_with(text: &str, strict: bool) -> Result<Document, DslError> {
let (masker, masked) = mask_all(BlockMasker::new(), text);
let mut statements: Vec<Stmt> = Vec::new();
+ let mut warnings: Vec<String> = Vec::new();
let mut prose_buffer: Vec<&str> = Vec::new();
let mut pending_block: Option<String> = None;
let mut current_aspect: Option<String> = None;
@@ -1083,6 +1149,11 @@ fn parse_full_with(text: &str, strict: bool) -> Result<Document, DslError> {
Err(DslError::Parse(msg)) => return Err(at_line(line_no, msg)),
}
} else {
+ if looks_like_lone_definition(stripped) {
+ warnings.push(format!(
+ "line {line_no} looks like an item definition but does not start with '~'; parsed as prose"
+ ));
+ }
prose_buffer.push(line);
}
}
@@ -1097,7 +1168,10 @@ fn parse_full_with(text: &str, strict: bool) -> Result<Document, DslError> {
// Final flush
flush_prose(&mut prose_buffer, &mut statements, &masker);
- Ok(Document { statements })
+ Ok(Document {
+ statements,
+ warnings,
+ })
}
#[cfg(test)]
@@ -2080,6 +2154,105 @@ kfc is a chain
assert!(edges.is_empty());
}
+ #[test]
+ fn parse_dotted_tilde_token_errors_on_line_1_not_later_claim() {
+ let input = "\
+~mcdonalds.com { https://mcdonalds.com }
+~fast-food-chains { the chains }
+
+{ if this resolves, the dot silently split the token }
+~mcdonalds <: ~fast-food-chains
+";
+ let err = parse_full(input).unwrap_err().to_string();
+ assert!(
+ err.contains("line 1:"),
+ "error must name the dotted definition line, got: {err}"
+ );
+ assert!(
+ err.contains("~mcdonalds.com")
+ && err.contains("not a valid tilde item name")
+ && err.contains("`.`"),
+ "error must name the dotted token, got: {err}"
+ );
+ assert!(
+ !err.contains("vote explanations must start"),
+ "must not misreport the later containment claim, got: {err}"
+ );
+ }
+
+ #[test]
+ fn parse_undotted_repro_still_succeeds() {
+ let input = "\
+~mcdonalds { https://mcdonalds.com }
+~fast-food-chains { the chains }
+
+{ identical claim, only the dotted line above was removed }
+~mcdonalds <: ~fast-food-chains
+";
+ let doc = parse_full(input).unwrap();
+ assert!(doc.warnings.is_empty());
+ assert_eq!(items(&doc).len(), 2);
+ assert_eq!(containments(&doc).len(), 1);
+ }
+
+ #[test]
+ fn parse_url_shaped_prose_definition_warns() {
+ let input = "mcdonalds.com { fast food }\n~fast-food { chains }";
+ let doc = parse_full(input).unwrap();
+ assert_eq!(
+ doc.warnings,
+ vec![
+ "line 1 looks like an item definition but does no
… preview truncated; 7,193 characters omittedHardlinks — judgments / attempts / prompt
judgments
(none)
attempts
- ~anthropic/claude-sonnet-latest #1
- ~x-ai/grok-latest #1
- openai/gpt-chat-latest #1
- ~anthropic/claude-sonnet-latest #2
- ~anthropic/claude-sonnet-latest #3
- ~anthropic/claude-sonnet-latest #4
- ~anthropic/claude-sonnet-latest #5
- ~anthropic/claude-sonnet-latest #6
- ~x-ai/grok-latest #2
- ~x-ai/grok-latest #3
- ~x-ai/grok-latest #4
- ~x-ai/grok-latest #5
- ~x-ai/grok-latest #6
- openai/gpt-chat-latest #2
- openai/gpt-chat-latest #3
- openai/gpt-chat-latest #4
- openai/gpt-chat-latest #5
- openai/gpt-chat-latest #6
Prompt text is loaded only by the download route.