Skip to content

P2-F: Community Detection & Graph Coverage Quotas (DELIVERS: topic-diverse hotpath) #34

@github-actions

Description

@github-actions

Why: Without community detection, a single dense topic can fill the entire page-tier quota, crowding out unrelated memories. Community quotas ensure the hotpath is both hot (high salience) and diverse (topic-representative).

  • P2-F1: Add community detection to daydreamer/ClusterStability.ts

    • Implement lightweight label propagation on the Metroid neighbor graph
    • Run during idle passes when dirty-volume flags indicate meaningful structural change
    • Store community labels in PageActivity.communityId via MetadataStore.putPageActivity
    • Rerun when graph topology changes significantly (post-split, post-merge, post-full-recalc)
  • P2-F2: Wire community labels into SalienceEngine promotion/eviction

    • selectEvictionTarget uses communityId to find weakest resident in the community bucket
    • Promotion checks community quota remaining before admitting
    • If community quota is full: candidate must beat weakest resident in that community
    • If community is unknown (communityId not yet set): place node in temporary pending pool borrowing from page-tier budget
    • Empty communities release their slots back to the page-tier budget
  • P2-F3: Add community-aware eviction tests

    • tests/daydreamer/ClusterStability.test.ts
    • Test that a single dense community cannot consume all page-tier hotpath slots
    • Test that a new community (previously unknown) receives at least one slot
    • Test that an empty community releases its slots correctly
    • Test that label propagation converges and produces stable community assignments

Exit Criteria: Community-aware hotpath quotas active; topic diversity enforced; label propagation stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: mediumMedium priority — targets v1.0layer: daydreamerBackground consolidation (LTP/LTD, recalc)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions