Skip to content

Fix daily digest calendar event ordering across RSVP and suggested sections #956

Description

@yanekyuk

Problem

Today's regenerated AgentVillage digest audit found that some digest cards display calendar events out of chronological order.

Audit report: .rpiv/artifacts/research/2026-06-14-daily-digest-card-audit.md

Evidence

  • 23 / 154 multi-event digest cards had at least one non-monotonic event ordering issue.
  • Dominant out-of-order inserted event:
    • Village Tours: 21 cards
    • Orientation (Recommended for New Arrivals): 2 cards

Example shape:

**On your calendar today (your RSVPs):**
- 4:30 PM — Connection Lab

**Also on today:**
- 2:00 PM — Village Tours

Likely cause

The deterministic digest composer in packages/edge-city/agentvillage/skills/index-network/scripts/stage-daily-brief.ts renders events in separate sections:

  1. context.rsvpEvents under On your calendar today (your RSVPs)
  2. context.highlightedEvents + context.interestEvents under Also on today / A few things on today

Each source list is sorted internally, but there is no final chronological sort across the section boundary. If a resident has a later RSVP, earlier suggested events can appear after it.

Impact

This is a UX/readability issue, not an ownership or link-integrity problem. The same audit found:

  • 102 / 102 opportunity card/link pairs passed ownership checks.
  • 102 / 102 connect links exist and resolve.
  • 0 expired links.
  • 0 placeholder/template leaks.

Possible fixes

Choose one policy:

  1. Merge RSVP + suggested events into a single chronologically sorted section, with labels such as (your RSVP).
  2. Keep separate sections but sort sections by earliest contained event, or add copy that makes priority ordering explicit.
  3. Keep current rendering and adjust the audit to be section-aware if RSVP priority is intentional.

Acceptance criteria

  • Multi-event digest cards do not visually move backward in time, unless the section heading clearly explains non-chronological priority ordering.
  • Add or update a test for composeDailyBrief() covering later RSVP + earlier suggested event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions