constitution · epochs · watch · epoch 3

comparison

c_55f1cdf12e22 (tommy-mor) vs c_5cd3e5917d2f (tommy-mor)

download prompt · raw event · cmp_4390d5e293a270

council reasoning

~anthropic/claude-sonnet-latest · winner B · 6:4 · permalink

Side B is a coherent, fully-wired refactor: it removes the EntityStore/EntityImported machinery entirely, replaces it with ephemeral projection-only Reddit content plus a TTL eviction task, and updates every call site and test consistently (journal, projection_apply, projection_store, reddit.rs, state.rs), addressing a real data-retention/compliance concern. Side A adds a bigger invite feature with CLI/RPC/tests, but it leaves substantial half-integrated code: InviteMinted/InviteRedeemed events and ActiveInviteState/reducer.room_timeline are defined but never emitted or consumed by the actual thread endpoint, a new timeline.rs module appears unwired into lib.rs, and RoomRevoke is stubbed as unimplemented, indicating scope creep with dead paths rather than a fully realized design.

~x-ai/grok-latest · winner B · 2:1 · permalink

B removes EntityImported/EntityStore entirely and confines Reddit payloads to TTL-evicted projection caches while logging only NodeEnsured structure, a lasting data-model and compliance fix that simplifies journal, projection_apply, storage schema, and rebuild paths. A adds a useful invite/audit surface (RPC mint, /join redemption, multi-cap grants, CLI, tests) but is mostly additive feature surface with in-memory invites and partial event types rather than a foundational redesign.

openai/gpt-chat-latest · winner B · 3:2 · permalink

Side B makes a deeper architectural change by removing `EntityImported` events and the `EntityStore`, keeping Reddit content out of the event log, storing only ephemeral display data in the projection with TTL-based eviction, and updating replay/projection logic and tests accordingly. Side A adds a substantial invite system (invite minting, redemption, audit RPCs, CLI support, and tests), but it also introduces event types (`InviteMinted`/`InviteRedeemed`) that are not actually used while the implementation relies on in-memory invite state, making the design less cohesive than B's storage simplification.

sides

A — c_55f1cdf12e22 (tommy-mor)

message

[00be3a29] invite system

diff preview

diff --git a/bb.edn b/bb.edn
index 50be8232847e672b3f273a2fb25ddd1d12adb7e2..818f850765370d12d58f239e287764fc3649d78b 100644
--- a/bb.edn
+++ b/bb.edn
@@ -47,14 +47,16 @@
                                            "RUST_LOG"      "info"})})))}
 
   test
-  {:doc "Full test suite: integration + auth + grants"
+  {:doc "Full test suite: integration + auth + grants + invites"
    :requires ([test.integration :as integration]
               [test.auth :as auth]
-              [test.grants :as grants])
+              [test.grants :as grants]
+              [test.invites :as invites])
    :task (do
            (integration/integration)
            (auth/auth-test)
-           (grants/grants-test))}
+           (grants/grants-test)
+           (invites/invites-test))}
 
   perf
   {:doc "Performance test: concurrent HTTP requests to detect blocking I/O"
diff --git a/cli/src/main.rs b/cli/src/main.rs
index e5833b0b93d8e667b94c574ba2b0f8cb758ff3df..8eda9f485bd1f7392f1e34be27176c21e20354eb 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -105,6 +105,23 @@ enum ScopedCmd {
         #[arg(long)]
         json: bool,
     },
+
+    /// Mint a shareable invite link (24h TTL, in-memory until redeemed). Requires Manage on the room.
+    InviteLink {
+        /// Comma-separated: view, post, vote, add_item, manage
+        #[arg(long = "caps", value_delimiter = ',')]
+        caps: Vec<String>,
+        #[arg(long, default_value_t = 1)]
+        uses: usize,
+        #[arg(long)]
+        json: bool,
+    },
+
+    /// List principals granted access in this room (requires View or Manage)
+    Audit {
+        #[arg(long)]
+        json: bool,
+    },
 }
 
 #[derive(Subcommand, Debug)]
@@ -514,17 +531,35 @@ fn print_thread(resp: &ThreadDetailResponse) {
         .duration_since(std::time::UNIX_EPOCH)
         .unwrap_or_default()
         .as_millis() as i64;
-    if resp.total > resp.posts.len() {
-        let end = resp.offset + resp.posts.len();
-        eprintln!("# showing {}-{} of {} posts  (--offset N --limit N to paginate)", resp.offset, end.saturating_sub(1), resp.total);
+    if resp.total > resp.items.len() {
+        let end = resp.offset + resp.items.len();
+        eprintln!(
+            "# showing {}-{} of {} rows  (--offset N --limit N to paginate)",
+            resp.offset,
+            end.saturating_sub(1),
+            resp.total
+        );
     }
-    for (i, post) in resp.posts.iter().enumerate() {
-        let timeago = slug_types::timeago::timeago_compact(now_ms, post.ts);
-        let body = &post.body.trim();
-        println!("<post index=\"{}\" timeago=\"{}\">", post.index, timeago);
-        println!("{}", body);
-        println!("</post>");
-        if i + 1 < resp.posts.len() {
+    for (i, item) in resp.items.iter().enumerate() {
+        match item {
+            ThreadItem::Post {
+                index,
+                ts,
+                body,
+                ..
+            } => {
+                let timeago = slug_types::timeago::timeago_compact(now_ms, *ts);
+                let body = body.trim();
+                println!("<post index=\"{}\" timeago=\"{}\">", index, timeago);
+                println!("{}", body);
+                println!("</post>");
+            }
+            ThreadItem::System { ts, text } => {
+                let timeago = slug_types::timeago::timeago_compact(now_ms, *ts);
+                println!("<system timeago=\"{}\">{}</system>", timeago, text.trim());
+            }
+        }
+        if i + 1 < resp.items.len() {
             println!();
             println!();
         }
@@ -1036,6 +1071,95 @@ async fn run_scoped(base: &str, room: &str, sub: ScopedCmd) -> Result<()> {
                 }
             }
         },
+        ScopedCmd::InviteLink { caps, uses, json } => {
+            let caps: Vec<String> = caps
+                .into_iter()
+                .flat_map(|s| {
+                    s.split(',')
+                        .map(|p| p.trim().to_lowercase())
+                        .filter(|p| !p.is_empty())
+                        .collect::<Vec<_>>()
+                })
+                .collect();
+            if caps.is_empty() {
+                return Err(anyhow!("--caps is required (e.g. --caps view,post,vote)"));
+            }
+            let bearer = effective_bearer().ok_or_else(|| {
+                anyhow!(
+                    "no bearer token: run `slugsocial identity start --rig <rig> --model <model>` \
+                     then `slugsocial identity poll <session>`, or set SLUG_BEARER_TOKEN / ~/.config/slugsocial/token"
+                )
+            })?;
+            let batch = send_rpc(
+                &client,
+                base,
+                Some(&bearer),
+                vec![RpcCommand::RoomMintInvite {
+                    room: room.to_string(),
+                    capabilities: caps,
+                    max_uses: uses,
+                }],
+            )
+            .await?;
+            match rpc_line_ok(&batch.results[0])? {
+                RpcResult::RoomInviteMinted {
+                    invite_url,
+                    expires_at_ms,
+                    max_uses,
+                } => {
+                    if json {
+                        println!(
+                            "{}",
+                            serde_json::to_string_pretty(&serde_json::json!({
+                                "invite_url": invite_url,
+                                "expires_at_ms": expires_at_ms,
+                                "max_uses": max_uses,
+                            }))?
+                        );
+                    } else {
+                        println!("{invite_url}");
+                        println!("(Expires in 24 hours. Max uses: {max_uses})");
+                    }
+                }
+                _ => return Err(anyhow!("unexpected RPC result")),
+            }
+        }
+        ScopedCmd::Audit { json } => {
+            let bearer = effective_bearer().ok_or_else(|| {
+                anyhow!(
+                    "no bearer token: run `slugsocial identity start --rig <rig> --model <model>` \
+                     then `slugsocial identity poll <session>`, or set SLUG_BEARER_TOKEN / ~/.config/slugsocial/token"
+                )
+            })?;
+            let batch = send_rpc(
+                &client,
+                base,
+                Some(&bearer),
+                vec![RpcCommand::RoomAudit {
+                    room: room.to_string(),
+                }],
+            )
+            .await?;
+            match rpc_line_ok(&batch.results[0])? {
+                RpcResult::RoomAudit(resp) => {
+                    if json {
+                        println!("{}", serde_json::to_string_pretty(&resp)?);
+                    } else {
+                        println!("room {}", resp.room);
+                        if resp.grants.is_empty() {
+                            println!("(no grants recorded)");
+                        } else {
+                            let w_user = resp.grants.iter().map(|g| g.username.len()).max().unwrap_or(0);
+                            for g in &resp.grants {
+                                let caps = g.capabilities.join(", ");
+                                println!("{:<width$}  {}", g.username, caps, width = w_user.max(8));
+                            }
+                        }
+                    }
+                }
+                _ => return Err(anyhow!("unexpected RPC result")),
+            }
+        }
         ScopedCmd::Check { file, json } => {
             let mut text = String::new();
             match file {
diff --git a/server/src/api/auth.rs b/server/src/api/auth.rs
index 995ce4a61d29b024c399c656134f541ecfd880cf..b45ba39419c84af8bf2333fc9b7d47e98525c45f 100644
--- a/server/src/api/auth.rs
+++ b/server/src/api/auth.rs
@@ -12,12 +12,61 @@ use tokio::sync::RwLock;
 
 use crate::{
     api::helpers::{api_error, now_ms, sha256_hex},
-    events::{Event, TokenIssued, UserRegistered},
+    events::{Event, GrantAdded, TokenIssued, UserRegistered},
     identity::{parse_agent, parse_username},
     html::{auth_complete_page, auth_signed_in_fragment, choose_username_error_fragment, choose_username_page},
     state::{AppState, PendingSession},
 };
 
+/// Delegate id for browser users who land via `/join/inv_…` (no CLI agent).
+const INVITE_BROWSER_AGENT: &str = "00000000-0000-0000-0000-000000000000:invite:web/join";
+
+async fn apply_invite_redemption(state: &AppState, invite_token: &str, grantee_username: &str) -> Result<(), String> {
+    let now = now_ms();
+    let ga = {
+        let mut invites = state.invites.write().await;
+        let Some(inv) = invites.get_mut(invite_token) else {
+            return Err("invite not found".into());
+        };
+        if now > inv.expires_at_ms {
+            invites.remove(invite_token);
+            return Err("invite expired".into());
+        }
+        if inv.current_uses >= inv.max_uses {
+            return Err("invite exhausted".into());
+        }
+        inv.current_uses += 1;
+        Event::GrantAdded(GrantAdded {
+            ts: now,
+            room_id: inv.room_id.clone(),
+            username: grantee_username.to_string(),
+            capabilities: inv.capabilities.clone(),
+            granted_by: inv.inviter.clone(),
+        })
+    };
+
+    match state.event_log.append(&ga).await {
+        Ok(()) => {
+            let mut reduced = state.reduced.write().await;
+            reduced.apply_event(ga);
+            let mut invites = state.invites.write().await;
+            if let Some(inv) = invites.get(invite_token) {
+                if inv.current_uses >= inv.max_uses {
+                    invites.remove(invite_token);
+                }
+            }
+            Ok(())
+        }
+        Err(e) => {
+            let mut invites = state.invites.write().await;
+            if let Some(inv) = invites.get_mut(invite_token) {
+                inv.current_uses = inv.current_uses.saturating_sub(1);
+            }
+            Err(format!("{e}"))
+        }
+    }
+}
+
 fn pending_sessions(state: &AppState) -> Arc<RwLock<HashMap<String, PendingSession>>> {
     state.pending_sessions.clone()
 }
@@ -115,6 +164,42 @@ pub struct AuthLoginQuery {
     pub session: String,
 }
 
+pub async fn get_join_invite(Path(token): Path<String>, State(state): State<AppState>) -> impl IntoResponse {
+    let token = token.trim().to_string();
+    if token.is_empty() {
+        return api_error(StatusCode::NOT_FOUND, "invite invalid or expired", None).into_response();
+    }
+    let now = now_ms();
+    let valid = {
+        let invites = state.invites.read().await;
+        match invites.get(&token) {
+            None => false,
+            Some(inv) => now <= inv.expires_at_ms && inv.current_uses < inv.max_uses,
+        }
+    };
+    if !valid {
+        return api_error(StatusCode::NOT_FOUND, "invite invalid or expired", None).into_response();
+    }
+
+    let session = format!("p_{}", uuid::Uuid::new_v4().simple());
+    let s = PendingSession {
+        agent: INVITE_BROWSER_AGENT.to_string(),
+        created_ts: now_ms(),
+        provider: None,
+        provider_id: None,
+        redeem_invite: Some(token),
+        complete: None,
+    };
+    state.pending_sessions.write().await.insert(session.clone(), s);
+
+    let public_url = std::env::var("SLUG_PUBLIC_URL").unwrap_or_else(|_| "http://127.0.0.1:8080".to_string());
+    Redirect::temporary(&format!(
+        "{public_url}/auth/login?session={}",
+        urlencoding::encode(&session)
+    ))
+    .into_response()
+}
+
 pub async fn get_auth_login(Query(q): Query<AuthLoginQuery>, State(state): State<AppState>) -> impl IntoResponse {
     // Redirect to Google auth endpoint.
     let sessions = pending_sessions(&state);
@@ -205,6 +290,7 @@ pub async fn get_auth_callback(Query(q): Query<AuthCallbackQuery>, State(state):
         s.provider = Som

… preview truncated; 45,403 characters omitted

download full diff A

B — c_5cd3e5917d2f (tommy-mor)

message

[1d14ff09] Ephemeral Reddit content; log structure only (#46)

* Keep Reddit content ephemeral; log structure only

Remove EntityImported and EntityStore. Reddit fetches write display
content directly to the projection with a fetched_at timestamp, while
the event log records NodeEnsured for discovered identities only.

A background task evicts cached display content after 48 hours. Votes,
tree structure, and ItemIds remain in the log and projection.

Co-authored-by: tommy <thmorriss@gmail.com>

* Fix reddit import test assertions and Clojure syntax

Co-authored-by: tommy <thmorriss@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

diff preview

diff --git a/server/src/bin/storage_bench.rs b/server/src/bin/storage_bench.rs
index 4762d0d23bc8e2df439afe09a3235ba7f72bd486..3d988416ad36b27a7d3dc84280cfdbdcafa43e69 100644
--- a/server/src/bin/storage_bench.rs
+++ b/server/src/bin/storage_bench.rs
@@ -6,8 +6,8 @@ use std::{
 };
 
 use sorter2_server::{
-    entity_store::EntityStore, event_log::EventLog, events::Event, journal::JournalClient,
-    projection_apply, projection_store::ProjectionStore,
+    event_log::EventLog, events::Event, journal::JournalClient, projection_apply,
+    projection_store::ProjectionStore,
 };
 
 #[tokio::main]
@@ -18,12 +18,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
     let data_dir = opts.data_dir.to_string_lossy().into_owned();
     let event_log = Arc::new(EventLog::new(format!("{data_dir}/events.jsonl")));
     let db = durable::Db::open(opts.data_dir.join("store"))?;
-    let entity_store = EntityStore::from_db(&db)?;
     let projection_store = ProjectionStore::from_db(&db)?;
 
     let journal = JournalClient::spawn(
         event_log.clone(),
-        entity_store.clone(),
         projection_store.clone(),
         event_log.last_sequence().await? + 1,
     );
@@ -46,12 +44,9 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
     drop(journal);
 
     let rebuild_start = Instant::now();
-    entity_store.reset()?;
     projection_store.reset()?;
     let rebuild = event_log
-        .replay(|record| {
-            projection_apply::apply_records(&projection_store, &entity_store, &[record])
-        })
+        .replay(|record| projection_apply::apply_records(&projection_store, &[record]))
         .await?;
     let rebuild_elapsed = rebuild_start.elapsed();
 
diff --git a/server/src/entity_store.rs b/server/src/entity_store.rs
deleted file mode 100644
index d29f39aecca6f12cdcf263cf77c3654eb4ee6cfa..0000000000000000000000000000000000000000
--- a/server/src/entity_store.rs
+++ /dev/null
@@ -1,134 +0,0 @@
-//! Off-heap storage for full entity payloads (Reddit API JSON).
-//!
-//! Derived [`crate::reducer::EntityData`] is stored on the node; the raw JSON
-//! lives here, in the shared durable [`Store`] schema.
-
-use std::path::Path;
-
-use durable::{Batch, Db, Durability};
-use serde_json::Value;
-
-use crate::{
-    path_types::ItemId,
-    storage_dto::{decode_entity_payload, encode_entity_payload},
-    storage_schema::{Store, StoreFields},
-};
-
-const ENTITY_SCHEMA_KEY: &str = "schema_version";
-const ENTITY_SCHEMA_VERSION: u64 = 2;
-
-#[derive(Debug, thiserror::Error)]
-pub enum EntityStoreError {
-    #[error("durable error: {0}")]
-    Durable(#[from] durable::Error),
-    #[error("json error: {0}")]
-    Json(#[from] serde_json::Error),
-    #[error("storage decode error: {0}")]
-    Storage(String),
-    #[error("io error: {0}")]
-    Io(#[from] std::io::Error),
-}
-
-/// Disk-backed map of entity id → raw JSON payload.
-#[derive(Clone)]
-pub struct EntityStore {
-    db: Db,
-}
-
-impl EntityStore {
-    /// Open (or create) the entity database under `dir`.
-    pub fn open(dir: &Path) -> Result<Self, EntityStoreError> {
-        std::fs::create_dir_all(dir)?;
-        let db = Db::open(dir)?;
-        Self::from_db(&db)
-    }
-
-    /// Create an entity store backed by an already-open database.
-    pub fn from_db(db: &Db) -> Result<Self, EntityStoreError> {
-        let store = Self { db: db.clone() };
-        let version = Store::root()
-            .entity_meta()
-            .key(&ENTITY_SCHEMA_KEY.to_string())
-            .get(db)?;
-        if version != Some(ENTITY_SCHEMA_VERSION) {
-            store.reset()?;
-        }
-        Ok(store)
-    }
-
-    /// Clear rebuildable entity payloads and reset storage schema metadata.
-    pub fn reset(&self) -> Result<(), EntityStoreError> {
-        let root = Store::root();
-        self.db.apply(
-            &[root.entities().clear(), root.entity_meta().clear()],
-            Durability::SyncWal,
-        )?;
-        self.db.run(
-            root.entity_meta()
-                .key(&ENTITY_SCHEMA_KEY.to_string())
-                .set(&ENTITY_SCHEMA_VERSION),
-            Durability::SyncWal,
-        )?;
-        Ok(())
-    }
-
-    /// Persist a payload for `id` (overwrites any existing entry).
-    pub fn put(&self, id: &ItemId, payload: &Value) -> Result<(), EntityStoreError> {
-        self.db.run(
-            Store::root()
-                .entities()
-                .key(&id.as_str().to_string())
-                .set(&encode_entity_payload(payload)),
-            Durability::SyncWal,
-        )?;
-        Ok(())
-    }
-
-    /// Add a payload write to the caller's batch.
-    pub fn put_in_batch(
-        &self,
-        batch: &mut Batch,
-        id: &ItemId,
-        payload: &Value,
-    ) -> Result<(), EntityStoreError> {
-        batch.write(
-            Store::root()
-                .entities()
-                .key(&id.as_str().to_string())
-                .set(&encode_entity_payload(payload)),
-        );
-        Ok(())
-    }
-
-    /// Load a stored payload, if present.
-    pub fn get(&self, id: &ItemId) -> Result<Option<Value>, EntityStoreError> {
-        match Store::root()
-            .entities()
-            .key(&id.as_str().to_string())
-            .get(&self.db)?
-        {
-            Some(record) => decode_entity_payload(record)
-                .map(Some)
-                .map_err(EntityStoreError::Storage),
-            None => Ok(None),
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use serde_json::json;
-
-    #[test]
-    fn round_trip_payload() {
-        let tmp = tempfile::tempdir().unwrap();
-        let store = EntityStore::open(tmp.path()).unwrap();
-        let id = ItemId::from_url("https://reddit.com/r/rust").unwrap();
-        let payload = json!({"kind": "t5", "data": {"display_name": "rust"}});
-
-        store.put(&id, &payload).unwrap();
-        let loaded = store.get(&id).unwrap().unwrap();
-        assert_eq!(loaded, payload);
-    }
-}
diff --git a/server/src/events.rs b/server/src/events.rs
index a3d88e285c645a96d33e6f0aed1b487b843aceb8..d76c3bb4277216b0d39c9422ba7a50db10a95e05 100644
--- a/server/src/events.rs
+++ b/server/src/events.rs
@@ -1,5 +1,4 @@
 use serde::{Deserialize, Serialize};
-use serde_json::Value;
 
 /// Schema version for JSONL log records. Bump when event semantics change.
 pub const CURRENT_LOG_SCHEMA: u32 = 1;
@@ -30,7 +29,7 @@ pub type ViewRecord = LogRecord<ViewEvent>;
 /// Wall-clock timestamp carried on the log envelope for domain events.
 pub fn event_timestamp(event: &Event) -> i64 {
     match event {
-        Event::VoteRecorded { ts, .. } | Event::EntityImported { ts, .. } => *ts,
+        Event::VoteRecorded { ts, .. } => *ts,
         Event::NodeEnsured { .. } => crate::fetch::now_ms(),
     }
 }
@@ -57,6 +56,4 @@ pub enum Event {
     },
     /// Register a node path in the fractal tree (no external fetch).
     NodeEnsured { id: String },
-    /// Full upstream API payload for a node (domain-specific view derived at replay/render time).
-    EntityImported { id: String, ts: i64, payload: Value },
 }
diff --git a/server/src/journal.rs b/server/src/journal.rs
index 50bc89f976edb82b7b0e49e954a8eccbbe82bf87..d50023aca7c3e74068de988449b11baee32d1ecf 100644
--- a/server/src/journal.rs
+++ b/server/src/journal.rs
@@ -5,7 +5,6 @@ use std::sync::Arc;
 use tokio::sync::{mpsc, oneshot};
 
 use crate::{
-    entity_store::EntityStore,
     event_log::EventLog,
     events::{event_timestamp, Event, EventRecord},
     projection_apply,
@@ -25,7 +24,6 @@ pub struct JournalClient {
 impl JournalClient {
     pub fn spawn(
         event_log: Arc<EventLog>,
-        entity_store: EntityStore,
         projection_store: ProjectionStore,
         next_seq: u64,
     ) -> Self {
@@ -33,7 +31,6 @@ impl JournalClient {
         tokio::spawn(journal_worker(
             rx,
             event_log,
-            entity_store,
             projection_store,
             next_seq,
         ));
@@ -62,7 +59,6 @@ impl JournalClient {
 async fn journal_worker(
     mut rx: mpsc::Receiver<JournalCommand>,
     event_log: Arc<EventLog>,
-    entity_store: EntityStore,
     projection_store: ProjectionStore,
     mut next_seq: u64,
 ) {
@@ -75,7 +71,6 @@ async fn journal_worker(
         let result = append_and_project_batch(
             &event_log,
             &projection_store,
-            &entity_store,
             &mut next_seq,
             &batch,
         )
@@ -99,7 +94,6 @@ async fn journal_worker(
 async fn append_and_project_batch(
     event_log: &EventLog,
     projection_store: &ProjectionStore,
-    entity_store: &EntityStore,
     next_seq: &mut u64,
     commands: &[JournalCommand],
 ) -> Result<(), String> {
@@ -117,7 +111,7 @@ async fn append_and_project_batch(
         .await
         .map_err(|e| e.to_string())?;
     *next_seq = seq;
-    projection_apply::apply_records(projection_store, entity_store, &records)
+    projection_apply::apply_records(projection_store, &records)
         .map_err(|e| format!("projection apply failed after durable append: {e}"))
 }
 
@@ -132,10 +126,9 @@ mod tests {
         let log_path = tmp.path().join("events.jsonl");
         let event_log = Arc::new(EventLog::new(log_path));
         let db = durable::Db::open(tmp.path().join("store")).unwrap();
-        let entity_store = EntityStore::from_db(&db).unwrap();
         let projection_store = ProjectionStore::from_db(&db).unwrap();
 
-        let journal = JournalClient::spawn(event_log, entity_store, projection_store.clone(), 1);
+        let journal = JournalClient::spawn(event_log, projection_store.clone(), 1);
 
         let j1 = journal.clone();
         let j2 = journal.clone();
@@ -177,11 +170,9 @@ mod tests {
             .unwrap();
 
         let db = durable::Db::open(tmp.path().join("store")).unwrap();
-        let entity_store = EntityStore::from_db(&db).unwrap();
         let projection_store = ProjectionStore::from_db(&db).unwrap();
         projection_apply::apply_records(
             &projection_store,
-            &entity_store,
             &[EventRecord::new(
                 1,
                 1,
@@ -196,7 +187,6 @@ mod tests {
 
         let journal = JournalClient::spawn(
             event_log.clone(),
-            entity_store,
             projection_store.clone(),
             next_seq,
         );
@@ -219,10 +209,9 @@ mod tests {
         let log_path = tmp.path().join("events.jsonl");
         let event_log = Arc::new(EventLog::new(log_path));
         let db = durable::Db::open(tmp.path().join("store")).unwrap();
-        let entity_store = EntityStore::from_db(&db).unwrap();
         let projection_store = ProjectionStore::from_db(&db).unwrap();
         let journal =
-            JournalClient::spawn(event_log.clone(), entity_store, projection_store.clone(), 1);
+            JournalClient::spawn(event_log.clone(), projection_store.clone(), 1);
 
         journal
             .append_many(vec![
diff --git a/server/src/lib.rs b/server/src/lib.rs
index 5c02c8e704e4664453bad75d819df8a067668176..3dfc7c8acb8ed61bb73ade63e72768e402042cc5 100644
--- a/server/src/lib.rs
+++ b/server/src/lib.rs
@@ -1,5 +1,4 @@
 pub mod api;
-pub mod entity_store;
 pub mod event_log;
 pub mod events;
 pub mod fetch;
diff --git a/server/src/projection_apply.rs b/server/src/projection_apply.rs
index 5644557a41b3e9497c7421b444155ae629fa79f1..9c8990a8af927f35d3344c8d0872a516aba56b86 100644
--- a/server/src/projection_apply.rs
+++ b/server/src/projection_apply.rs
@@ -1,22 +1,20 @@
 //! Apply event-log records to the durable projection as precise point updates.
 //!
 //! Each batch of records lowers to reified durable writes (edge merges, child
-//! links, voted-pair flags, recent-vote pushes, entity payloads) plus a cursor
-//! advance, all committed in one atomic `DisableWal` batch. The cursor moving in
-//! the same batch as the (non-idempotent) edge merges guarantees e

… preview truncated; 33,427 characters omitted

download full diff B

Hardlinks — judgments / attempts / prompt

prompt download

judgments

attempts

Prompt text is loaded only by the download route.