diff --git a/crates/ghostlight-dungeon/src/session_zero.rs b/crates/ghostlight-dungeon/src/session_zero.rs index d4a6c29..72bf688 100644 --- a/crates/ghostlight-dungeon/src/session_zero.rs +++ b/crates/ghostlight-dungeon/src/session_zero.rs @@ -1234,8 +1234,10 @@ impl SessionZeroRegistry { else { continue; }; - if state.status != SessionZeroStatus::Archived - && state.member_for_account(account_hash).is_some() + if !matches!( + state.status, + SessionZeroStatus::Published | SessionZeroStatus::Archived + ) && state.member_for_account(account_hash).is_some() { matches.push((state.created_at, id)); } @@ -4931,6 +4933,29 @@ mod tests { assert_eq!(loaded.revision, revision); } + #[tokio::test] + async fn published_session_zero_cannot_own_campaign_entry_navigation() { + let root = tempdir().unwrap(); + let mut published = state(); + published.status = SessionZeroStatus::Published; + let published_id = published.id; + let published_directory = root.path().join(published_id.to_string()); + fs::create_dir(&published_directory).unwrap(); + let published_store = + CampaignStore::open(published_directory.join("session-zero.cc")).unwrap(); + SessionZeroKernel::initialize(&published_store, &published).unwrap(); + drop(published_store); + + let registry = SessionZeroRegistry::new(root.path()).unwrap(); + registry.load_existing().await.unwrap(); + + assert_eq!( + registry.session_for_account("account:host").await.unwrap(), + None, + "published negotiation history must not replace the campaign entry surface" + ); + } + #[tokio::test] async fn registry_load_persists_legacy_receipt_ownership_migration() { let root = tempdir().unwrap(); diff --git a/docs/architecture/ghostlight-eve-native-interface.md b/docs/architecture/ghostlight-eve-native-interface.md index 3d4fa26..2c6343d 100644 --- a/docs/architecture/ghostlight-eve-native-interface.md +++ b/docs/architecture/ghostlight-eve-native-interface.md @@ -84,6 +84,9 @@ always derived from `campaign_membership.v1`; account preferences contain only the selected campaign. `campaign.entry` may clear only that preference so the same authenticated player can return to the campaign list or begin another Session Zero; it cannot leave, reset, fork, or mutate any campaign. +Session Zero registry lookup treats only non-terminal negotiations as active: +`published` and `archived` records remain durable history but cannot replace the +campaign-entry surface after the preference is cleared. Transient command-result surfaces preserve Eve's composite campaign interface version. A fresh or recompiled assessment may replace only the campaign-revision