feat(scopes): default-OFF chat scoping (include chats one by one)#75
Merged
Conversation
Flip the scope contract so an unscoped chat is EXCLUDED: the digest (selectActiveGroups), the suggestion engine (listIncludedGroupIds) and the scheduler only process chats with an explicit `included = true` row. A migration sets the `included` column default to false so categorizing a chat no longer silently re-includes it. Users now include chats one by one in the צ׳אטים (Sources) tab. Ingestion stays unfiltered (scope governs summarization only), so excluded chats keep all their data and re-including one is instant — no re-fetch. Updated the scope/total-summary/scheduler tests that assumed default-ON. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 12, 2026
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.
Why
On a fresh install there's no chat-selection step, and scoping was default-ON — so the digest summarized every chat, including ones never chosen, while the People tab stayed empty. This makes your selection drive everything you see.
What
1. Default-OFF scoping
An unscoped chat is excluded; only a chat with an explicit
included = truerow is summarized/suggested:listScopes→COALESCE(cs.included, false);listIncludedGroupIds+selectActiveGroupsrequire an explicit included row.chat_scopes.includedcolumn default tofalse.You include chats one by one in the צ׳אטים tab. Ingestion stays unfiltered (scope governs summarization only), so excluded chats keep their data and re-including is instant — no re-fetch.
2. People CRM derived from selected chats
People was only built from participants named as the owner of an extracted todo/meeting — almost always nobody. Now a person qualifies when, in an included chat, they have a real message and are either the 1:1 counterpart or a todo/meeting owner; plain group members are left out so it doesn't flood. The projection is rebuilt each refresh, and
GET /api/peoplerefreshes on open — so selecting chats actually populates People (after a summary run, or immediately on opening the tab).After
npm run migrate, the digest/Updates are empty until you include chats in the צ׳אטים tab — intended. Data is retained, so toggling a chat on lights it up.Verification
biome✓ ·typecheck✓ ·build✓ · fullvitest✓ (1323 passed, incl. 3 new People cases). No frontend change needed (the Updates list already filters byincluded; Sources shows every chat off by default).🤖 Generated with Claude Code