feat: add bounded nightly brain digest - #1397
Conversation
|
1 issue outstanding. See task
Reviewed 004db7b |
| : new Date(now.getTime() - BRAIN_DAILY_DIGEST_INITIAL_LOOKBACK_MS); | ||
| const searchBody = await callGbrainTool(readConnection, 'search', { | ||
| query: DAILY_DIGEST_SEARCH_QUERY, | ||
| since: since.toISOString(), |
There was a problem hiding this comment.
search does not accept since or until in the pinned gbrain MCP contract, so these arguments are silently ignored. The downstream synthesize verb also uses its window only in its prompt, not its gather query. As a result, this candidate set can contain historical pages, and eligibleSlugs will accept citations outside the intended effective-date window. Use retrieval that actually filters by effective date, then validate the eligible pages before accepting citations.
There was a problem hiding this comment.
Switching to query makes the retrieval filter real, but the new 06:00 timestamp bounds still drop date-only source pages. Roomote writes task pages as date: YYYY-MM-DD, which gbrain stores at midnight; its since filter is strict. On the Aug 17 pass, since=2026-08-16T06:00:00Z excludes every page effective-dated 2026-08-16, including work completed later that day, and the next watermark never revisits it. Use bounds compatible with date-granular effective dates (or persist and query a timestamp-granular source date), with a regression test for this case.
What changed
daily/digests/YYYY-MM-DDWhy
The generic reflection pipeline made hundreds of model calls while producing broad, low-value output. A single operational digest is cheaper, easier to inspect, and better aligned with the useful nightly synthesis we want.
Validation