fix(server): PR #132 review round 2 — 14 actionable comments addressed

Blockers (4):
- Wire cargo deny check into pre-pr-server (was dead config) (#1)
- ConfirmBookmark idempotency guard: SimError ProtocolError on retry (#2)
- D-080 amendment: transfer_npc_knowledge retained-but-dormant honest doc (#3)
- SelectedBookmark v0.2 transient scope; save/load deferred to #863 (#4)

Issues (8):
- ConfirmBookmark validation tests: unknown id, invalid location,
  valid path, double-confirm guard (#5)
- snapshot_with_bookmark_catalog fixture for client #618 decode tests (#6)
- generate_brands: replace 5 raw .unwrap() with eprintln+exit pattern (#7)
- npc_knowledge_transfer.rs: stale run_npc_conversations refs cleaned (#8)
- monologue.rs: residual D-078 "overheard conversations" doc removed (#9)
- 5 test files: orphan blank lines from removed conversation_* fields (#10)
- BookmarkCatalog: add PartialEq, Eq derives (matches sibling) (#11)

Nits (2):
- culture_tag doc: describe BookmarkRegistry::build_catalog behavior,
  remove "until #679 lands" placeholder (#13)
- generate_brands seed=1 canonical comment (#14)

Follow-ups filed:
- #862 — BookmarkPlugin::new(registry) injection (#12 deferred)
- #863 — Wire SelectedBookmark into SaveState (Sprint 37)

Pre-pr-server: fmt clean, clippy clean, deny clean, build clean.
nextest save_io failures pre-existing parallelism issue (sequential
cargo test --lib passes 20/20).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-19 18:04:46 +02:00
co-authored by Claude Opus 4.7
parent e86e53ec06
commit 13530910c9
14 changed files with 275 additions and 32 deletions
-1
View File
@@ -63,7 +63,6 @@ fn snapshot_roundtrip_over_unix_socket() {
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
-1
View File
@@ -49,7 +49,6 @@ fn snapshot_roundtrip_over_tcp() {
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
-1
View File
@@ -288,7 +288,6 @@ fn snapshot_with_sim_errors_roundtrips() {
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
+30 -3
View File
@@ -39,7 +39,6 @@ fn fixture_snapshot(tick: u64, entities: Vec<VisibleEntity>) -> ObserverSnapshot
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
@@ -237,7 +236,6 @@ fn generate_msgpack_fixtures() {
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
@@ -377,7 +375,6 @@ fn generate_msgpack_fixtures() {
blocked_entities: vec![5, 6],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: Some(0xDEADBEEF),
@@ -505,3 +502,33 @@ fn generate_msgpack_fixtures() {
write_fixture(name, &rmp_serde::to_vec_named(&snapshot).unwrap());
}
}
/// Generate a snapshot fixture with a populated `BookmarkCatalog`.
///
/// Client (#618) uses this to validate GDScript MessagePack decode against
/// real `rmp_serde` output — field order and string encoding may diverge
/// from GDScript-constructed data.
#[test]
#[ignore] // Run manually: cargo test --test gen_fixtures -- --ignored
fn generate_snapshot_with_bookmark_catalog() {
let catalog = BookmarkCatalog {
bookmarks: vec![BookmarkWire {
id: "tycoon".into(),
title: "Tycoon".into(),
subtitle: "Small business owner on the make.".into(),
flavor: String::new(),
default_location: "GJ 35".into(),
allowed_locations: vec!["GJ 35".into()],
allowed_locations_cultures: vec!["frontier_industrial".into()],
career: CareerKindWire::Tycoon,
starting_capital_tractus: 5_000,
}],
};
let mut snapshot = fixture_snapshot(0, vec![]);
snapshot.bookmark_catalog = Some(catalog);
let bytes =
rmp_serde::to_vec_named(&snapshot).expect("serialize snapshot_with_bookmark_catalog");
write_fixture("snapshot_with_bookmark_catalog", &bytes);
}
-3
View File
@@ -27,7 +27,6 @@ fn test_snapshot(tick: u64, entities: Vec<VisibleEntity>) -> ObserverSnapshot {
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
@@ -292,7 +291,6 @@ fn snapshot_v2_fields_roundtrip() {
blocked_entities: vec![],
scan_events: vec![],
sound_events: vec![],
follow_state: None,
character_pressure: None,
rng_seed: None,
@@ -1453,7 +1451,6 @@ fn serde_default_fields_fill_in_when_missing_from_wire() {
"blocked_entities": [],
"scan_events": [],
"sound_events": [],
"follow_state": null,
"rng_seed": null
});