Skip to content

feat(scopes): default-OFF chat scoping (include chats one by one)#75

Merged
EyalDelarea merged 1 commit into
mainfrom
feat/scopes-default-off
Jun 12, 2026
Merged

feat(scopes): default-OFF chat scoping (include chats one by one)#75
EyalDelarea merged 1 commit into
mainfrom
feat/scopes-default-off

Conversation

@EyalDelarea

@EyalDelarea EyalDelarea commented Jun 12, 2026

Copy link
Copy Markdown
Owner

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 = true row is summarized/suggested:

  • listScopesCOALESCE(cs.included, false); listIncludedGroupIds + selectActiveGroups require an explicit included row.
  • Migration flips the chat_scopes.included column default to false.
  • Updated the scope / total-summary / scheduler tests that assumed default-ON.

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/people refreshes on open — so selecting chats actually populates People (after a summary run, or immediately on opening the tab).

⚠️ After merge

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 ✓ · full vitest ✓ (1323 passed, incl. 3 new People cases). No frontend change needed (the Updates list already filters by included; Sources shows every chat off by default).

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant