Commit A affects the project broadly by standardizing formatting across the workspace, pinning rustfmt and clippy in the toolchain to improve reproducibility, adding editor configuration for rust-analyzer, and cleaning up a duplicate CSS rule. Although most code changes are mechanical formatting, it improves developer workflow and consistency across many files. Commit B only removes a single unused test function that produced a warning, which is a much smaller maintenance change.
constitution · epochs · watch · epoch 3
c_9e1ff4fc0186 (tommy-mor) vs c_c534b41e8607 (tommy-mor)
download prompt · raw event · cmp_048b153b8ea8cf
council reasoning
Commit A makes widespread improvements across the codebase: workspace-wide formatting, tooling fixes (rustfmt/clippy pinning), editor configuration, minor CSS cleanup, and consistent code style updates in many files. While mostly non-functional, it meaningfully improves maintainability and developer experience. Commit B only removes a single test, which is a very minor change with negligible impact.
Side A makes extensive, repository-wide changes including running rustfmt across many files, reorganizing imports, reformatting large portions of the codebase, pinning rustfmt/clippy in rust-toolchain.toml, adding VS Code settings, and minor CSS cleanup. Although mostly formatting and tooling-related, it affects a substantial portion of the project. Side B only deletes a single test function, a very small and localized change. Therefore, Side A contributed significantly more.
sides
A — c_9e1ff4fc0186 (tommy-mor)
message
[2a94401b] Run rustfmt workspace-wide and fix lint tooling. Pin rustfmt and clippy in rust-toolchain.toml after a broken component install, merge a duplicate vote-slider CSS rule, and add VS Code settings so rust-analyzer uses the project toolchain. Co-authored-by: Cursor <cursoragent@cursor.com>
diff preview
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000000000000000000000000000000000000..98ebd754a6d5a972550506c69c5a10c10e3210b6
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,8 @@
+{
+ "rust-analyzer.rustc.source": "discover",
+ "rust-analyzer.check.command": "check",
+ "rust-analyzer.procMacro.enable": true,
+ "rust-analyzer.cargo.extraEnv": {
+ "RUSTUP_TOOLCHAIN": "1.88.0"
+ }
+}
diff --git a/durable/examples/combined_example.rs b/durable/examples/combined_example.rs
index 626a6e1cf7e3c9c26f9f2edc58950d9bc31ec67e..6e9cb3210714d74c9a2cc0ed4f87e1b8d84788da 100644
--- a/durable/examples/combined_example.rs
+++ b/durable/examples/combined_example.rs
@@ -1,5 +1,5 @@
use durable::{Db, DurableMap, DurableVec};
-use serde::{Serialize, Deserialize};
+use serde::{Deserialize, Serialize};
use std::time::{SystemTime, UNIX_EPOCH};
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -28,36 +28,48 @@ fn get_timestamp() -> u64 {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open or create a database
let db = Db::open("chat_db")?;
-
+
// Create our collections
let mut users = DurableMap::<String, User>::new(&db, "users")?;
let mut messages = DurableVec::<Message>::new(&db, "messages")?;
let mut user_message_indices = DurableMap::<String, Vec<usize>>::new(&db, "user_messages")?;
-
+
// Create some users
- users.insert("alice".to_string(), User {
- username: "alice".to_string(),
- display_name: "Alice Smith".to_string(),
- message_count: 0,
- })?;
-
- users.insert("bob".to_string(), User {
- username: "bob".to_string(),
- display_name: "Bob Johnson".to_string(),
- message_count: 0,
- })?;
-
- users.insert("charlie".to_string(), User {
- username: "charlie".to_string(),
- display_name: "Charlie Brown".to_string(),
- message_count: 0,
- })?;
-
+ users.insert(
+ "alice".to_string(),
+ User {
+ username: "alice".to_string(),
+ display_name: "Alice Smith".to_string(),
+ message_count: 0,
+ },
+ )?;
+
+ users.insert(
+ "bob".to_string(),
+ User {
+ username: "bob".to_string(),
+ display_name: "Bob Johnson".to_string(),
+ message_count: 0,
+ },
+ )?;
+
+ users.insert(
+ "charlie".to_string(),
+ User {
+ username: "charlie".to_string(),
+ display_name: "Charlie Brown".to_string(),
+ message_count: 0,
+ },
+ )?;
+
// Helper to send a message
- let send_message = |from: &str, to: &str, content: &str,
+ let send_message = |from: &str,
+ to: &str,
+ content: &str,
messages: &mut DurableVec<Message>,
users: &mut DurableMap<String, User>,
- indices: &mut DurableMap<String, Vec<usize>>| -> Result<(), Box<dyn std::error::Error>> {
+ indices: &mut DurableMap<String, Vec<usize>>|
+ -> Result<(), Box<dyn std::error::Error>> {
// Create message
let msg_id = messages.len()? as u64;
let message = Message {
@@ -67,61 +79,93 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
content: content.to_string(),
timestamp: get_timestamp(),
};
-
+
// Store message
messages.push(message)?;
let msg_index = messages.len()? - 1;
-
+
// Update sender's message count
if let Some(mut sender) = users.get(&from.to_string())? {
sender.message_count += 1;
users.insert(from.to_string(), sender)?;
}
-
+
// Track message indices for recipient
let mut recipient_indices = indices.get(&to.to_string())?.unwrap_or_default();
recipient_indices.push(msg_index);
indices.insert(to.to_string(), recipient_indices)?;
-
+
Ok(())
};
-
+
// Send some messages
println!("💬 Chat Application Demo\n");
println!("Sending messages...");
-
- send_message("alice", "bob", "Hey Bob, how's the Durable library coming along?",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("bob", "alice", "It's going great! We have DurableVec and DurableMap working!",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("charlie", "alice", "That sounds awesome! Can I help with testing?",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("alice", "charlie", "Absolutely! The more testing the better!",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("bob", "charlie", "Check out the examples directory for usage patterns",
- &mut messages, &mut users, &mut user_message_indices)?;
-
+
+ send_message(
+ "alice",
+ "bob",
+ "Hey Bob, how's the Durable library coming along?",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "bob",
+ "alice",
+ "It's going great! We have DurableVec and DurableMap working!",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "charlie",
+ "alice",
+ "That sounds awesome! Can I help with testing?",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "alice",
+ "charlie",
+ "Absolutely! The more testing the better!",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "bob",
+ "charlie",
+ "Check out the examples directory for usage patterns",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
// Display all users and their message counts
println!("\n👥 Users:");
let mut all_users = users.to_vec()?;
all_users.sort_by_key(|(username, _)| username.clone());
-
+
for (username, user) in all_users {
- println!(" {} ({}) - {} messages sent",
- user.display_name, username, user.message_count);
+ println!(
+ " {} ({}) - {} messages sent",
+ user.display_name, username, user.message_count
+ );
}
-
+
// Display all messages
println!("\n📨 All messages:");
for (i, msg) in messages.iter()?.enumerate() {
let msg = msg?;
println!(" [{}] {} → {}: {}", i, msg.from, msg.to, msg.content);
}
-
+
// Show inbox for each user
println!("\n📥 User inboxes:");
for item in users.iter() {
@@ -135,26 +179,26 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
}
-
+
// Statistics
println!("\n📊 Statistics:");
println!(" Total users: {}", users.len()?);
println!(" Total messages: {}", messages.len()?);
-
+
// Demonstrate persistence
println!("\n💾 Data has been persisted to disk!");
println!(" Database location: ./chat_db");
-
+
// Clean up
drop(messages);
drop(users);
drop(user_message_indices);
drop(db);
-
+
// Remove the database for this example
std::fs::remove_dir_all("chat_db").ok();
-
+
println!("\n✅ Example completed!");
-
+
Ok(())
-}
\ No newline at end of file
+}
diff --git a/durable/examples/map_example.rs b/durable/examples/map_example.rs
index 08b8f2c8826caf53c4c20b422a540c92f6624029..1d9c4a14b0f4cfe39ade84ebb1f1a14033e8ff1b 100644
--- a/durable/examples/map_example.rs
+++ b/durable/examples/map_example.rs
@@ -1,5 +1,5 @@
use durable::{Db, DurableMap};
-use serde::{Serialize, Deserialize};
+use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
struct UserProfile {
@@ -11,10 +11,10 @@ struct UserProfile {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open or create a database
let db = Db::open("example_db")?;
-
+
// Create a persistent map of user profiles
let mut users = DurableMap::<String, UserProfile>::new(&db, "users")?;
-
+
// Insert some users
// Using put() when we don't need the old value - more efficient!
users.put(
@@ -25,7 +25,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
score: 1500,
},
)?;
-
+
users.put(
"bob".to_string(),
UserProfile {
@@ -34,7 +34,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
score: 1200,
},
)?;
-
+
// Using insert() when we might need the old value
let old_charlie = users.insert(
"charlie".to_string(),
@@ -44,21 +44,24 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
score: 1800,
},
)?;
-
+
if old_charlie.is_some() {
println!("Replaced existing charlie entry");
}
-
+
println!("Total users: {}", users.len()?);
-
+
// Look up a specific user
if let Some(alice) = users.get(&"alice".to_string())? {
println!("\nAlice's profile: {:?}", alice);
}
-
+
// Check if a user exists
- println!("\nDoes 'david' exist? {}", users.contains_key(&"david".to_string())?);
-
+ println!(
+ "\nDoes 'david' exist? {}",
+ users.contains_key(&"david".to_string())?
+ );
+
// Update a user's score
if let Some(mut bob) = users.get(&"bob".to_string())? {
bob.score += 100;
@@ -66,34 +69,40 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
users.put("bob".to_string(), bob)?;
println!("Updated Bob's score!");
}
-
+
// Iterate over all users
println!("\nAll users (sorted by username):");
let mut all_users = users.to_vec()?;
all_users.sort_by_key(|(username, _)| username.clone());
-
+
for (username, profile) in all_users {
- println!(" {} ({}) - Score: {}", username, profile.email, profile.score);
+ println!(
+ " {} ({}) - Score: {}",
+ username, profile.email, profile.score
+ );
}
-
+
// Get just the usernames
let mut usernames = users.keys_vec()?;
usernames.sort();
println!("\nAll usernames: {:?}", usernames);
-
+
// Find the highest scoring user
let profiles = users.values_vec()?;
if let Some(top_user) = profiles.iter().max_by_key(|p| p.score) {
- println!("\nTop scorer: {} with {} points", top_user.name, top_user.score);
+ println!(
+ "\nTop scorer: {} with {} points",
+ top_user.name, top_user.score
+ );
}
-
+
// Remove a user
if let Some(removed) = users.remove(&"charlie".to_string())? {
println!("\nRemoved user: {}", removed.name);
println!("Users remaining: {}", users.len()?);
}
-
+
println!("\nData has been persisted to disk.");
-
+
Ok(())
-}
\ No newline at end of file
+}
diff --git a/durable/examples/nested_example.rs b/durable/examples/nested_example.rs
index 3b880f2c8b8ad2633d4b5fcf2016652216c9de8e..f16090cf6fb854ac7a1b00acfd31fbd12c25dbce 100644
--- a/durable/examples/nested_example.rs
+++ b/durable/examples/nested_example.rs
@@ -3,27 +3,31 @@ use durable::{Db, DurableMap, DurableVec};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a database
let db = Db::open("nested_example_db")?;
-
+
// Create a map where each user has a list of posts
- let user_posts: DurableMap<String, DurableVec<String>> = DurableMap::new_nested(&db, "user_posts");
-
+ let user_posts: DurableMap<String, DurableVec<String>> =
+ DurableMap::new
… preview truncated; 96,900 characters omittedB — c_c534b41e8607 (tommy-mor)
message
[2b970f92] delete random test that was a warning
diff preview
diff --git a/server/src/dsl.rs b/server/src/dsl.rs
index af6d3b52621e65288f75f757d54e5abeaa7501e8..c32ff6ccc13ff38ae7712af441bd8d9e8568cc3b 100644
--- a/server/src/dsl.rs
+++ b/server/src/dsl.rs
@@ -671,17 +671,6 @@ mod tests {
assert!(err_msg.contains("missing vote explanation"), "error: {}", err_msg);
}
- fn parse_full_keeps_quoted_thread_title_statement_as_prose() {
- let input = "\"This is a title\" { This is the body of the post }\n";
- let doc = parse_full(input).unwrap();
- assert_eq!(
- doc.statements,
- vec![Stmt::Prose {
- text: "\"This is a title\" { This is the body of the post }\n".trim_end_matches('\n').to_string()
- }]
- );
- }
-
#[test]
fn parse_full_keeps_regular_quoted_prose() {
let input = "She said \"hello\" and left.";
Hardlinks — judgments / attempts / prompt
judgments
attempts
Prompt text is loaded only by the download route.