Skip to content

fix(world): complete session-end landmark purge in Growth render - #2

Closed
PabloTheThinker wants to merge 1 commit into
mainfrom
cursor/landmark-purge-growth-render-5de8
Closed

fix(world): complete session-end landmark purge in Growth render#2
PabloTheThinker wants to merge 1 commit into
mainfrom
cursor/landmark-purge-growth-render-5de8

Conversation

@PabloTheThinker

Copy link
Copy Markdown
Owner

Summary

Follow-up to the recent session-end landmark spam fixes on main (commits 00e7a80, a0fa9b4, aa8513e). Those changes stopped new generic session-end notes from becoming landmarks and cleaned them during Genesis/Maturity/Wisdom renders, but two gaps remained:

  1. _render_growth() bypassed cleanup — the Growth epoch summary read raw self._state.landmarks, so agents in the Growth epoch could still see inflated counts and "session ended" as oldest/most-recent landmark.
  2. add_landmark() did not purge legacy spam — the latest commit message said "purge on add and render", but only blocked new generic notes; existing session-end entries stayed in state until the next leave() or Genesis render.

Changes

  • Add _GENERIC_LEAVE_NOTES and _clean_landmarks() helper (filter + cap at 40).
  • Use the helper from leave(), add_landmark(), _render_landmarks(), and _render_growth().
  • Add tests/test_world.py covering leave, add-landmark purge, and Growth render behavior.

Test plan

  • PYTHONPATH=src python3 -m unittest discover -s tests -q (64 tests, OK)
Open in Web Open in Cursor 

Extract _clean_landmarks() helper used by leave(), add_landmark(),
_render_landmarks(), and _render_growth(). Growth epoch summary was
still reading raw landmarks and could show session-end spam counts.
add_landmark() now purges legacy noise on every call, matching the
intent of the recent landmark-spam fixes.

Co-authored-by: Pablo <PabloTheThinker@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants