fix(salience): exclude briefings/* from their own Brain Pulse#1202
Open
rwbaker wants to merge 1 commit into
Open
fix(salience): exclude briefings/* from their own Brain Pulse#1202rwbaker wants to merge 1 commit into
rwbaker wants to merge 1 commit into
Conversation
The cron daily briefing writes 90_Briefings/<date>.md, which gets re-ingested on the next sync and then dominates tomorrow's getRecentSalience output as pure self-reference (observed: top result score 0.9956, everyone else clustered at 0.587). Filter `p.slug LIKE 'briefings/%'` out of getRecentSalience in both the PG and PGLite engines. Suppressed by default; callers can still opt in by passing `slugPrefix: 'briefings/'` (or `--kind briefings/` from the CLI). search and list_pages are unaffected. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getRecentSalience(the engine behindgbrain salienceand theget_recent_salienceMCP tool) was ranking the daily-briefing page #1 in its own Brain Pulse the day after the cron wrote it.Repro from a real run:
90_Briefings/2026-05-19.mdis generated by a cron wrapper that callsgbrain salience --days 7 --limit 10and writes the result to the vault under90_Briefings/<date>.md. The nextsynccron re-ingests it asbriefings/2026-05-19.gbrain briefingrun then seesbriefings/2026-05-19at the top with score0.9956(emotional_weight 0, take_count 0, but freshly updated). Every other page sits at0.587. The briefing visually dominates its own pulse without being signal.Fix
Filter
p.slug LIKE 'briefings/%'out ofgetRecentSaliencein both engines (Postgres + PGLite). Suppression is the default. Callers can still ask for briefings explicitly viaslugPrefix: 'briefings/'(or--kind briefings/from the CLI), which short-circuits the exclusion.searchandlist_pagesare unaffected — briefings remain queryable.Test plan
test/e2e/salience-pglite.test.ts:briefings/*slugPrefix: 'briefings/'still returns thembun test test/salience.test.ts test/e2e/salience-pglite.test.ts→ 9 pass--kind briefings/still surfaces the briefing at 0.981.Filed from a TimelyCare-internal ticket (TIM-37) chasing the self-reference observed during a supervised gbrain run.