From 88cf59a6aaaf2d4f6aec20d54097c9cc4c2373be Mon Sep 17 00:00:00 2001 From: DazedAnon Date: Tue, 14 Jul 2026 22:06:50 -0500 Subject: [PATCH] Implement world memory filtering in AgentHarness to ensure character kills/deaths are excluded from World Memory. Update Chronicle documentation for clarity and remove obsolete legend promotion logic. Adjust test scenarios to validate new world memory behavior. --- IdleSpectator/AgentHarness.cs | 27 +++++++++++++++++++ IdleSpectator/Chronicle.cs | 44 ++----------------------------- IdleSpectator/HarnessScenarios.cs | 3 +++ IdleSpectator/mod.json | 4 +-- 4 files changed, 34 insertions(+), 44 deletions(-) diff --git a/IdleSpectator/AgentHarness.cs b/IdleSpectator/AgentHarness.cs index 9c607df..8621d94 100644 --- a/IdleSpectator/AgentHarness.cs +++ b/IdleSpectator/AgentHarness.cs @@ -1518,6 +1518,33 @@ public static class AgentHarness detail = $"ageId='{Chronicle.CurrentAgeId}' ageName='{Chronicle.CurrentAgeName}' memory={Chronicle.MemoryCount}"; break; } + case "world_memory_world_only": + { + // World tab must not mix in character Kill/Death/Lover rows. + IReadOnlyList snap = Chronicle.SnapshotMemory(); + int bad = 0; + int worldRows = 0; + for (int i = 0; i < snap.Count; i++) + { + ChronicleEntry e = snap[i]; + if (e == null || e.Kind == ChronicleKind.AgeChapter) + { + continue; + } + + if (e.Kind == ChronicleKind.World) + { + worldRows++; + continue; + } + + bad++; + } + + pass = bad == 0; + detail = $"badKinds={bad} worldRows={worldRows} memory={snap.Count}"; + break; + } case "dossier_favorite": case "is_favorite": { diff --git a/IdleSpectator/Chronicle.cs b/IdleSpectator/Chronicle.cs index b3dd8c0..bebf254 100644 --- a/IdleSpectator/Chronicle.cs +++ b/IdleSpectator/Chronicle.cs @@ -53,7 +53,7 @@ public sealed class ChronicleEntry public string AssetId = ""; public string AgeId = ""; public string AgeName = ""; - /// True when this row is a curated character legend in World Memory. + /// True when this row is styled as a highlighted World Memory landmark. public bool IsLegend; /// Vanilla name when is Death. public string AttackTypeName = ""; @@ -960,7 +960,7 @@ public static class Chronicle ChronicleHud.UpdateLive(); } - /// Killer POV - character history only (may promote to Memory if notable). + /// Killer POV - character history only. public static void NoteKill(Actor killer, Actor victim) { if (!ModSettings.ChronicleEnabled || killer == null || victim == null) @@ -1723,46 +1723,6 @@ public static class Chronicle } LogService.LogInfo($"[IdleSpectator][CHRONICLE][History:{subjectId}] {entry.DisplayLine}"); - - if (ShouldPromoteLegend(kind, subject, other)) - { - AppendLandmark( - kind, - subject, - other, - line, - lore, - subject.current_position, - "legend:" + kind, - isLegend: true); - } - } - - private static bool ShouldPromoteLegend(ChronicleKind kind, Actor subject, Actor other) - { - if (kind == ChronicleKind.Other || kind == ChronicleKind.AgeChapter) - { - return false; - } - - return IsNotable(subject) || IsNotable(other); - } - - private static bool IsNotable(Actor actor) - { - if (actor == null) - { - return false; - } - - try - { - return actor.isFavorite() || actor.isKing() || actor.isCityLeader(); - } - catch - { - return false; - } } private static void AppendLandmark( diff --git a/IdleSpectator/HarnessScenarios.cs b/IdleSpectator/HarnessScenarios.cs index 02786c3..5c49fbf 100644 --- a/IdleSpectator/HarnessScenarios.cs +++ b/IdleSpectator/HarnessScenarios.cs @@ -440,6 +440,8 @@ internal static class HarnessScenarios Step("ch16f", "assert", expect: "chronicle_latest_contains", value: "Drown"), Step("ch16g", "chronicle_death_sample", value: "Fire"), Step("ch16h", "assert", expect: "chronicle_latest_contains", value: "Burned"), + // Character kills/deaths must stay on character history, not World Memory. + Step("ch16i", "assert", expect: "world_memory_world_only"), // World Memory landmarks (replaces History|World tabs) Step("ch17a", "chronicle_world_force", label: "War: harness_alpha vs harness_beta"), @@ -447,6 +449,7 @@ internal static class HarnessScenarios Step("ch17c", "assert", expect: "world_memory_contains", value: "harness_alpha"), Step("ch17d", "assert", expect: "chronicle_latest_contains", value: "Burned"), Step("ch17e", "assert", expect: "world_memory_age"), + Step("ch17e2", "assert", expect: "world_memory_world_only"), // Selecting a world event pans to its recorded place (even with no unit there). Step("ch17j", "lore_jump_world"), Step("ch17k", "wait", wait: 0.2f), diff --git a/IdleSpectator/mod.json b/IdleSpectator/mod.json index efce34e..c6cd413 100644 --- a/IdleSpectator/mod.json +++ b/IdleSpectator/mod.json @@ -1,7 +1,7 @@ { "name": "IdleSpectator", "author": "dazed", - "version": "0.12.16", - "description": "AFK Idle Spectator (I) + Lore (L). World events pan to location; Living/Fallen tabs.", + "version": "0.12.17", + "description": "AFK Idle Spectator (I) + Lore (L). World tab is world events only.", "GUID": "com.dazed.idlespectator" }