You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why: The SalienceEngine is the decision-making layer for hotpath admission. It is needed by ingest (new page admission), query (hit-count update), and Daydreamer (post-LTP/LTD sweeps). Implementing it before ingest ensures promotion logic is correct from the first page written.
P0-G1: Implement core/SalienceEngine.ts
computeNodeSalience(pageId: Hash, metadataStore: MetadataStore): Promise<number> — fetch PageActivity and incident Hebbian edges; apply σ formula via HotpathPolicy
batchComputeSalience(pageIds: Hash[], metadataStore: MetadataStore): Promise<Map<Hash, number>> — efficient batch version
Why: The SalienceEngine is the decision-making layer for hotpath admission. It is needed by ingest (new page admission), query (hit-count update), and Daydreamer (post-LTP/LTD sweeps). Implementing it before ingest ensures promotion logic is correct from the first page written.
P0-G1: Implement
core/SalienceEngine.tscomputeNodeSalience(pageId: Hash, metadataStore: MetadataStore): Promise<number>— fetch PageActivity and incident Hebbian edges; apply σ formula via HotpathPolicybatchComputeSalience(pageIds: Hash[], metadataStore: MetadataStore): Promise<Map<Hash, number>>— efficient batch versionshouldPromote(candidateSalience: number, weakestResidentSalience: number, capacityRemaining: number): boolean— admission gatingselectEvictionTarget(tier: HotpathEntry['tier'], communityId: string | undefined, metadataStore: MetadataStore): Promise<Hash | undefined>— find weakest resident in tier/community bucketP0-G2: Implement promotion/eviction lifecycle helpers in
core/SalienceEngine.tsbootstrapHotpath(metadataStore: MetadataStore, policy: HotpathPolicy): Promise<void>— fill hotpath greedily by salience while resident count < H(t)runPromotionSweep(candidateIds: Hash[], metadataStore: MetadataStore, policy: HotpathPolicy): Promise<void>— steady-state: promote if salience > weakest in same tier/community bucket; evict weakest on promotionP0-G3: Add SalienceEngine test coverage (
tests/SalienceEngine.test.ts)Exit Criteria:
SalienceEnginemodule passes all tests; promotion/eviction lifecycle is correct and deterministic.