Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(home): show projects with live notifications in the feed (#9114)
gbirmanfb7ca4b7c4c1
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex a6257680bc..4e727e147e 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -408,8 +408,15 @@ resolved session ID; keep the existing `AgentSessionProvider` subscription to- All API/network calls live in service-clients.- Open projects through `openProject` (`features/projects/open-project.ts`): itretargets an already-open project split to the section or comment in place.- Opening the legacy `initiative-view` component route beside an open project- mounts a redirect shim that stays on "Loading project".+ Shared open paths (unified list rows) use its `projectHostedContent`, whose+ identity is the project itself, so the router focuses the split already+ showing it. Opening the legacy `initiative-view` component route beside an+ open project mounts a redirect shim that stays on "Loading project".+- A hosted detail pane (a project under Tasks, a call, a PR) registers as its+ host shell, so the split manager's entity reuse cannot see it; the router's+ claims decide who shows it. `openWithSplit` activates the source split before+ a replace, so a visit the router yields to the claiming pane leaves that pane+ active (`tests/claimed-replace.test.ts`).- Bound Discussion comment readiness waits to ten seconds; recover from initial layout interruptions until the message is visible, and release the target on user input (including scrollbar pointer-down), timeout, or successful arrival.- Keep early DOCX opens loading while exports return processing (409); retry onlythat response, with a bounded wait. See the Word editor walkthrough indiff --git a/apps/web/src/components/app/split-layout/layoutManager.ts b/apps/web/src/components/app/split-layout/layoutManager.tsindex 9e01ccb481..ff4d5bcbba 100644--- a/apps/web/src/components/app/split-layout/layoutManager.ts+++ b/apps/web/src/components/app/split-layout/layoutManager.ts@@ -1744,16 +1744,19 @@ export function createSplitLayout(: !options.preferNewSplit || shouldReplaceWhenFull;if (splitHandle && shouldReplace) {+ // Activate before replacing: a visit the router yields to another pane+ // that already claims the content brings that pane up, and activating+ // afterwards would take it back.+ if (options.activate !== false) {+ splitHandle.activate();+ }+splitHandle.replace({next: content,referredFrom: options.referredFrom ?? null,mergeHistory: options.mergeHistory,});- if (options.activate !== false) {- splitHandle.activate();- }-return { status: 'opened', split: splitHandle, sourceOwner };} else {const split = createNewSplit({diff --git a/apps/web/src/components/app/split-layout/tests/claimed-replace.test.ts b/apps/web/src/components/app/split-layout/tests/claimed-replace.test.tsnew file mode 100644index 0000000000..002b1f0d1b--- /dev/null+++ b/apps/web/src/components/app/split-layout/tests/claimed-replace.test.ts@@ -0,0 +1,131 @@+import { projectHostedContent } from '@app/features/projects/open-project';+import {+ createMemoryHistory,+ createMemoryPaneStore,+ createSplitRouter,+ type Entry,+ type SplitRoutes,+} from '@app/lib/split-router';+import { paneRoute } from '@app/routes/app-route';+import {+ appRoute,+ homeSplitRoute,+ notFoundRoute,+ projectDetailRoute,+ tasksSplitRoute,+} from '@app/routes/routes';+import type { BlockOrchestrator } from '@core/orchestrator';+import { createRoot } from 'solid-js';+import { afterEach, describe, expect, it, vi } from 'vitest';+import { createSplitLayout } from '../layoutManager';+import { createAppPanePolicy } from '../split-router/app-pane-policy';+import {+ resolveContentLocation,+ splitContentFromLocation,+} from '../split-router/legacy-route';++vi.mock('../componentRegistry', () => ({+ resolveComponent: vi.fn((id: string, params: Record<string, string>) => ({+ type: 'mock-component',+ id,+ params,+ })),+}));++vi.mock('@core/constant/allBlocks', () => ({+ isBlockAlias: vi.fn(() => false),+ resolveBlockAlias: vi.fn((type: string) => type),+}));++vi.mock('@service-storage/websocket', () => ({+ storageWS: { reconnectIfDisconnected: vi.fn() },+ createWebSocketJob: vi.fn(),+}));+vi.mock('@service-connection/websocket', () => ({+ ws: { addEventListener: vi.fn(), send: vi.fn() },+ state: () => 'closed',+ createConnectionBlockWebsocketEffect: vi.fn(),+ createConnectionWebsocketEffect: vi.fn(),+}));++const routes: SplitRoutes = {+ definitions: [+ {+ ...appRoute,+ children: [+ homeSplitRoute,+ { ...tasksSplitRoute, children: [projectDetailRoute] },+ notFoundRoute,+ ],+ },+ ],+ defaultRoute: () => paneRoute({ id: 'view-home', params: {} }),+};++function createMockOrchestrator(): BlockOrchestrator {+ return {+ isBlockMounted: vi.fn(() => false),+ createBlockInstance: vi.fn((_type, id) => ({+ node: { type: 'mock-node', id },+ detach: vi.fn(),+ dispose: vi.fn(),+ })),+ } as unknown as BlockOrchestrator;+}++let dispose: (() => void) | undefined;++function setup(url: string) {+ return createRoot((disposeRoot) => {+ dispose = disposeRoot;+ let manager: ReturnType<typeof createSplitLayout> | undefined;+ const router = createSplitRouter({+ routes,+ history: createMemoryHistory(url),+ paneStore: createMemoryPaneStore<Entry>(),+ policy: createAppPanePolicy({+ manager: () => manager,+ toContent: splitContentFromLocation,+ defaultLocation: () => ({+ route: paneRoute({ id: 'view-home', params: {} }),+ }),+ stacked: () => false,+ }),+ });+ manager = createSplitLayout(createMockOrchestrator(), {+ router,+ toLocation: (content) => resolveContentLocation(router.routes, content),+ toContent: splitContentFromLocation,+ });+ return manager;+ });+}++afterEach(() => {+ dispose?.();+ dispose = undefined;+});++describe('replacing a split with content another pane claims', () => {+ const projectId = '01a1899a-b629-7e50-8e65-079fca623856';++ it('leaves the claiming split active instead of the replaced one', async () => {+ const manager = setup(`/home/~/tasks/projects/${projectId}/overview`);+ const [home, project] = manager.splits();+ expect(home?.content).toMatchObject({ type: 'component', id: 'home' });+ expect(project?.content).toMatchObject({ type: 'component', id: 'tasks' });+ manager.activateSplit(home!.id);++ const result = manager.openWithSplit(+ projectHostedContent(projectId, 'overview'),+ { handle: manager.getSplit(home!.id), preferNewSplit: false }+ );++ expect(result.status).toBe('opened');+ await vi.waitFor(() => expect(manager.activeSplitId()).toBe(project!.id));+ expect(manager.splits().map((split) => split.content.id)).toEqual([+ 'home',+ 'tasks',+ ]);+ });+});diff --git a/apps/web/src/features/home/components/HomeFilters.tsx b/apps/web/src/features/home/components/HomeFilters.tsxindex e9a5d15abf..80a9c3c3b0 100644--- a/apps/web/src/features/home/components/HomeFilters.tsx+++ b/apps/web/src/features/home/components/HomeFilters.tsx@@ -73,7 +73,7 @@ const FILTER_ICONS = new Map<string, () => JSX.Element>([),],[- 'projects',+ 'folders',() => (<EntityIcontargetType="project"@@ -83,6 +83,17 @@ const FILTER_ICONS = new Map<string, () => JSX.Element>([/>),],+ [+ 'initiatives',+ () => (+ <EntityIcon+ targetType="initiative"+ size="xs"+ theme="monochrome"+ class="text-ink-muted"+ />+ ),+ ],['github',() => (diff --git a/apps/web/src/features/home/components/HomeList.tsx b/apps/web/src/features/home/components/HomeList.tsxindex 20de3cd3ea..175eae82d1 100644--- a/apps/web/src/features/home/components/HomeList.tsx+++ b/apps/web/src/features/home/components/HomeList.tsx@@ -169,7 +169,10 @@ export function HomeList(props: HomeListProps) {const newSplit =metadata?.newSplit === true || metadata?.event?.shiftKey === true;- if (!isTouchDevice() && !newSplit) {+ // Projects have no Home preview, so activating one opens it in place+ // instead of selecting a row that shows nothing.+ const previewable = sourceRow.entity.type !== 'initiative';+ if (!isTouchDevice() && !newSplit && previewable) {markEntitySeen(sourceRow.entity);showPreview(sourceRow.entity, { activate: true });props.onPreviewActivate?.();diff --git a/apps/web/src/features/home/home-facets.ts b/apps/web/src/features/home/home-facets.tsindex c1f2f499e4..be58429781 100644--- a/apps/web/src/features/home/home-facets.ts+++ b/apps/web/src/features/home/home-facets.ts@@ -34,6 +34,7 @@ function readClause(seen: boolean): FacetClause {cf: clause.eq('chatSeen', seen),pf: clause.eq('folderSeen', seen),fef: clause.eq('foreignEntitySeen', seen),+ if: clause.eq('initiativeSeen', seen),};}@@ -113,12 +114,18 @@ const typeOptions: Record<HomeTypeFilter, HomeFacetOption> = {predicate: (entity) =>entity.type === 'agent_session' || entity.type === 'chat',},- projects: {- id: 'projects',- label: 'Projects',+ folders: {+ id: 'folders',+ label: 'Folders',clause: { pf: clause.not(clause.eq('folderId', NIL_UUID)) },predicate: (entity) => entity.type === 'project',},+ initiatives: {+ id: 'initiatives',+ label: 'Projects',+ clause: { if: clause.eq('includeInitiatives', true) },+ predicate: (entity) => entity.type === 'initiative',+ },github: {id: 'github',label: 'GitHub',diff --git a/apps/web/src/features/home/persistence.test.ts b/apps/web/src/features/home/persistence.test.tsnew file mode 100644index 0000000000..a6089396bb--- /dev/null+++ b/apps/web/src/features/home/persistence.test.ts@@ -0,0 +1,23 @@+import { describe, expect, it } from 'vitest';+import { normalizeHomeFacets } from './persistence';++describe('normalizeHomeFacets', () => {+ it('renames saved type ids their options moved away from', () => {+ expect(+ normalizeHomeFacets({ type: ['chats', 'projects', 'email'] }).type+ ).toEqual(['agents', 'email', 'folders']);+ });++ it('keeps current ids as they are', () => {+ expect(+ normalizeHomeFacets({ type: ['folders', 'initiatives'] }).type+ ).toEqual(['folders', 'initiatives']);+ });++ it('drops a read filter that is not exactly one of unread or read', () => {+ expect(normalizeHomeFacets({ read: ['unread', 'read'] }).read).toBe(+ undefined+ );+ expect(normalizeHomeFacets({ read: ['read'] }).read).toEqual(['read']);+ });+});diff --git a/apps/web/src/features/home/persistence.ts b/apps/web/src/features/home/persistence.tsindex 670f6746df..babaf15922 100644--- a/apps/web/src/features/home/persistence.ts+++ b/apps/web/src/features/home/persistence.ts@@ -28,6 +28,10 @@ export function normalizeHomeFacets(raw: unknown) {if (facets.type?.includes('chats')) {facets.type = facets.type.map((t) => (t === 'chats' ? 'agents' : t));}+ // The folder option was saved as `projects` before task projects joined.+ if (facets.type?.includes('projects')) {+ facets.type = facets.type.map((t) => (t === 'projects' ? 'folders' : t));+ }return facets;}diff --git a/apps/web/src/features/home/queries/home-query.ts b/apps/web/src/features/home/queries/home-query.tsindex b4a6060595..f65b8e053f 100644--- a/apps/web/src/features/home/queries/home-query.ts+++ b/apps/web/src/features/home/queries/home-query.ts@@ -75,6 +75,10 @@ function signalClause(clause.eq('folderDone', false),clause.eq('folderUpdatedAt', { gte: recent })),+ // Projects with a not-done notification (an access request, a+ // discussion). Off by default server-side, so this literal is also what+ // opts them into the feed.+ if: clause.eq('initiativeDone', false),};if (capabilities.foreignEntities) {@@ -162,6 +166,18 @@ export function buildHomeQuery();const body: SoupAstBody = mergeAst(base, refinements);+ // Type facets exclude entity targets by nil-filling their ids; projects are+ // opt-in instead, so a type selection without them drops their clause, and+ // so does Noise, which lists emails only: a facet's own project clause+ // would otherwise be the opt-in.+ const types = context.facets.type ?? [];+ if (+ context.tab === 'noise' ||+ (types.length > 0 && !types.includes('initiatives'))+ ) {+ delete body.if;+ }+if (context.tab === 'signal' || context.tab === 'noise') {body.emailView = 'inbox';}diff --git a/apps/web/src/features/home/queries/home-results.test.ts b/apps/web/src/features/home/queries/home-results.test.tsindex ba8396e2ed..8bb5b268b3 100644--- a/apps/web/src/features/home/queries/home-results.test.ts+++ b/apps/web/src/features/home/queries/home-results.test.ts@@ -103,6 +103,63 @@ describe('home channel thread scope', () => {});});+describe('home projects', () => {+ const projectClause = (facets: Record<string, string[]>) =>+ JSON.stringify(+ buildHomeQuery({ ...context, facets, tab: 'signal' }).body.if ?? null+ );++ it('opts projects with a not-done notification into Signal', () => {+ const body = projectClause({});+ expect(body).toContain('{"ns":"unseen"}');+ expect(body).toContain('{"ns":"seen"}');+ expect(body).not.toContain('"done"');+ });++ it('keeps them under the Projects type filter', () => {+ const body = projectClause({ type: ['initiatives'] });+ expect(body).toContain('"inc"');+ expect(body).toContain('{"ns":"unseen"}');+ });++ it('drops them under a type filter that leaves them out', () => {+ for (const types of [+ ['documents'],+ ['folders'],+ ['email', 'channels'],+ ['none'],+ ]) {+ expect(projectClause({ type: types })).toBe('null');+ }+ });++ it('filters them by seen state with the Read facet', () => {+ // The not-done base clause stays; the facet ANDs the seen state onto it.+ const unread = projectClause({ read: ['unread'] });+ expect(unread.startsWith('{"&":[')).toBe(true);+ expect(unread.endsWith('{"l":{"ns":"unseen"}}]}')).toBe(true);+ // Read means seen or done; the base clause still excludes done rows.+ expect(+ projectClause({ read: ['read'] }).endsWith(+ '{"|":[{"l":{"ns":"seen"}},{"l":{"ns":"done"}}]}]}'+ )+ ).toBe(true);+ });++ it('never asks Noise for projects, whatever the facets say', () => {+ const cases: Record<string, string[]>[] = [+ {},+ { type: ['initiatives'] },+ { read: ['unread'] },+ ];+ for (const facets of cases) {+ expect(+ buildHomeQuery({ ...context, facets, tab: 'noise' }).body.if+ ).toBeUndefined();+ }+ });+});+describe('home date buckets', () => {it('buckets a notified row by its notification on the notification tabs', () => {const signal = { tab: 'signal' as const, capabilities };diff --git a/apps/web/src/features/home/queries/home-search.ts b/apps/web/src/features/home/queries/home-search.tsindex f5ba36508d..d604deccbb 100644--- a/apps/web/src/features/home/queries/home-search.ts+++ b/apps/web/src/features/home/queries/home-search.ts@@ -18,7 +18,8 @@ const tabTypes: Record<HomeTab, ReadonlySet<HomeTypeFilter>> = {'email','channels','agents',- 'projects',+ 'folders',+ 'initiatives','github','calendar',]),@@ -187,7 +188,7 @@ export function buildHomeSearchRequest(filters.foreign_entity_filters = foreignEntityFilters;}- if (types.has('projects')) {+ if (types.has('folders')) {const projectFilters: NonNullable<EntityFilters['project_filters']> = {};if (hasNotificationFilter) {@@ -197,6 +198,17 @@ export function buildHomeSearchRequest(filters.project_filters = projectFilters;}+ if (types.has('initiatives')) {+ const initiativeFilters: NonNullable<EntityFilters['initiative_filters']> =+ { include: true };++ if (hasNotificationFilter) {+ initiativeFilters.notification_filters = notificationFilters;+ }++ filters.initiative_filters = initiativeFilters;+ }+return {params: { cursor: null, page_size: 100 },body: {diff --git a/apps/web/src/features/home/types.ts b/apps/web/src/features/home/types.tsindex 26aa9187b5..ed0f9679a0 100644--- a/apps/web/src/features/home/types.ts+++ b/apps/web/src/features/home/types.ts@@ -19,7 +19,8 @@ export type HomeTypeFilter =| 'email'| 'channels'| 'agents'- | 'projects'+ | 'folders'+ | 'initiatives'| 'github'| 'calendar';diff --git a/apps/web/src/features/home/work-feed/core/work-feed.ts b/apps/web/src/features/home/work-feed/core/work-feed.tsindex 0993978711..3cafdce02c 100644--- a/apps/web/src/features/home/work-feed/core/work-feed.ts+++ b/apps/web/src/features/home/work-feed/core/work-feed.ts@@ -11,6 +11,7 @@ export type WorkFeedItemType =| 'task'| 'chat'| 'project'+ | 'initiative'| 'email'| 'channel'| 'channel_thread'diff --git a/apps/web/src/features/home/work-feed/home-scope.test.ts b/apps/web/src/features/home/work-feed/home-scope.test.tsindex bed8b915b7..d5d89eb435 100644--- a/apps/web/src/features/home/work-feed/home-scope.test.ts+++ b/apps/web/src/features/home/work-feed/home-scope.test.ts@@ -31,6 +31,9 @@ describe('homeWorkFeedScope', () => {expect(homeWorkFeedScope(['documents'], everything)?.types).toEqual(['document',]);+ expect(+ homeWorkFeedScope(['folders', 'initiatives'], everything)?.types+ ).toEqual(['project', 'initiative']);});it('leaves documents out when only the Documents filter is off', () => {@@ -39,7 +42,8 @@ describe('homeWorkFeedScope', () => {'email','channels','agents',- 'projects',+ 'folders',+ 'initiatives','github','calendar',];diff --git a/apps/web/src/features/home/work-feed/home-scope.ts b/apps/web/src/features/home/work-feed/home-scope.tsindex fb992bc748..50659bf792 100644--- a/apps/web/src/features/home/work-feed/home-scope.ts+++ b/apps/web/src/features/home/work-feed/home-scope.ts@@ -12,7 +12,8 @@ const ITEM_TYPES: Record<HomeTypeFilter, WorkFeedItemType[]> = {email: ['email'],channels: ['channel', 'channel_thread'],agents: ['agent_session', 'chat'],- projects: ['project'],+ folders: ['project'],+ initiatives: ['initiative'],github: ['pull_request'],calendar: ['calendar_event'],};@@ -22,6 +23,7 @@ const ALL_ITEM_TYPES: WorkFeedItemType[] = ['task','chat','project',+ 'initiative','email','channel','channel_thread',diff --git a/apps/web/src/features/home/work-feed/queries/decode.ts b/apps/web/src/features/home/work-feed/queries/decode.tsindex 6a80e9057d..876b2968ae 100644--- a/apps/web/src/features/home/work-feed/queries/decode.ts+++ b/apps/web/src/features/home/work-feed/queries/decode.ts@@ -107,6 +107,7 @@ const toGraphqlItemType = (type: WorkFeedItemType): GraphqlWorkFeedItemType =>.with('task', () => 'TASK' as const).with('chat', () => 'CHAT' as const).with('project', () => 'PROJECT' as const)+ .with('initiative', () => 'INITIATIVE' as const).with('email', () => 'EMAIL' as const).with('channel', () => 'CHANNEL' as const).with('channel_thread', () => 'CHANNEL_THREAD' as const)diff --git a/apps/web/src/features/next-soup/filters/filter-store/compile.ts b/apps/web/src/features/next-soup/filters/filter-store/compile.tsindex 9caadce9a0..a9bbafc564 100644--- a/apps/web/src/features/next-soup/filters/filter-store/compile.ts+++ b/apps/web/src/features/next-soup/filters/filter-store/compile.ts@@ -27,6 +27,7 @@ type QueryTarget =| 'cthf'| 'cf'| 'pf'+ | 'if'| 'callf'| 'fef'| 'ccf'@@ -156,6 +157,10 @@ const FIELD_CONFIG: Record<folderOwnerId: { target: 'pf', field: 'o' },folderSeen: { target: 'pf', field: 'ns', notification: 'seen' },folderDone: { target: 'pf', field: 'ns', notification: 'done' },+ // Projects are opt-in server-side, so a notification-state literal is also+ // what includes them in a query.+ initiativeSeen: { target: 'if', field: 'ns', notification: 'seen' },+ initiativeDone: { target: 'if', field: 'ns', notification: 'done' },callId: { target: 'callf', field: 'CallId' },callChannelId: { target: 'callf', field: 'ChannelId' },callSpeakerId: { target: 'callf', field: 'Speaker' },@@ -230,6 +235,7 @@ const emptyTargetAstLists = (): Record<QueryTarget, BackendAst[]> => ({cthf: [],cf: [],pf: [],+ if: [],callf: [],fef: [],ccf: [],diff --git a/apps/web/src/features/next-soup/filters/filter-store/types.ts b/apps/web/src/features/next-soup/filters/filter-store/types.tsindex 77f106ebf0..125329c6f9 100644--- a/apps/web/src/features/next-soup/filters/filter-store/types.ts+++ b/apps/web/src/features/next-soup/filters/filter-store/types.ts@@ -95,6 +95,8 @@ export type ScalarFieldFilters = {chatDone?: boolean;folderSeen?: boolean;folderDone?: boolean;+ initiativeSeen?: boolean;+ initiativeDone?: boolean;foreignEntitySeen?: boolean;foreignEntityDone?: boolean;foreignEntityIncludesMe?: boolean;diff --git a/apps/web/src/features/next-soup/filters/query-filters.ts b/apps/web/src/features/next-soup/filters/query-filters.tsindex 26cedc156c..5defadbaaf 100644--- a/apps/web/src/features/next-soup/filters/query-filters.ts+++ b/apps/web/src/features/next-soup/filters/query-filters.ts@@ -173,7 +173,8 @@ export function filterSoupItemByRequestBody(Boolean(filters?.owners?.length) ||(filters?.name !== undefined && filters.name !== null) ||(filters?.due_after !== undefined && filters.due_after !== null) ||- (filters?.due_before !== undefined && filters.due_before !== null);+ (filters?.due_before !== undefined && filters.due_before !== null) ||+ Boolean(filters?.notification_filters?.states?.length);return (optedIn &&!isIdFilteredOut(filters?.initiative_ids, data.id) &&diff --git a/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts b/apps/web/src/features/next-soup/sidebar/soup-filter-presets.tsindex 52a8448aef..2b90435a60 100644--- a/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts+++ b/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts@@ -109,6 +109,10 @@ const getInboxSignalFilters = () => {chatUpdatedAt: { gte: twoWeeksAgo },folderDone: false,folderUpdatedAt: { gte: twoWeeksAgo },+ // Projects with a not-done notification (an access request, a+ // discussion). Off by default server-side, so this literal is what+ // surfaces them in the feed.+ initiativeDone: false,// Foreign entities (e.g. GitHub PRs) with a not-done notification.// Referencing `fef` also opts them into the signal query (otherwise// defineQueryFilters excludes unreferenced entity types). Rendering is@@ -144,6 +148,7 @@ const getInboxNoiseFilters = () =>channelThreadDone: false,chatDone: false,folderDone: false,+ initiativeDone: false,emailShared: 'exclude',},exclude: getDisabledSnippetSubtypeExclude(),diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.tsindex 5d72b42818..6c1685d70a 100644--- a/apps/web/src/features/next-soup/utils.test.ts+++ b/apps/web/src/features/next-soup/utils.test.ts@@ -318,6 +318,52 @@ describe('agent session search navigation', () => {});});+describe('project rows', () => {+ const projectId = '01a1899a-b629-7e50-8e65-079fca623856';+ const entity: EntityData = {+ type: 'initiative',+ id: projectId,+ name: 'Roadmap',+ ownerId: 'owner',+ };++ it.each([false, true])(+ 'opens a project through its Tasks-hosted identity (new split: %s)',+ async (openInNewSplit) => {+ const openWithSplit = vi.fn(() => ({ status: 'opened' }));+ setGlobalSplitManager({+ activeSplit: () => undefined,+ getOrchestrator: () => ({+ getBlockHandle: vi.fn(async () => undefined),+ }),+ openWithSplit,+ } as unknown as SplitManager);+ await openEntityInSplitFromUnifiedList(entity, { openInNewSplit });+ expect(openWithSplit).toHaveBeenCalledExactlyOnceWith(+ {+ type: 'initiative',+ id: projectId,+ entryMetadata: {+ route: paneRoute(+ { id: 'view-tasks', params: {} },+ {+ id: 'tasks-project',+ params: { projectId, section: 'overview' },+ }+ ),+ search: { tasks: { tab: ['projects'] } },+ },+ params: undefined,+ },+ expect.objectContaining({+ preferNewSplit: openInNewSplit,+ allowDuplicate: false,+ })+ );+ }+ );+});+const sendNotification = (id: string, messageId: string): UnifiedNotification =>({id,diff --git a/apps/web/src/features/next-soup/utils.ts b/apps/web/src/features/next-soup/utils.tsindex 556e61955d..74f4477448 100644--- a/apps/web/src/features/next-soup/utils.ts+++ b/apps/web/src/features/next-soup/utils.ts@@ -17,7 +17,7 @@ import {} from '@app/features/calendar-view/types';import { callsHostedContent } from '@app/features/calls-view/calls-hosted-content';import { driveHostedContent } from '@app/features/drive-view/drive-hosted-content';-import { projectRouteId } from '@app/features/projects/core/route';+import { projectHostedContent } from '@app/features/projects/open-project';import { reviewsHostedContent } from '@app/features/reviews-view/reviews-hosted-content';import { withListNavigationSource } from '@app/features/soup/collection/list-navigation-source';import {@@ -964,10 +964,12 @@ export function calendarViewTargetForEntity(function getEntitySplitContent(entity: EntityData) {return (match(entity)- .with({ type: 'initiative' }, (entity) => ({- type: 'component' as const,- id: projectRouteId({ id: entity.id, section: 'overview' }),- }))+ // The Tasks-hosted route carries the project's own identity, so an open+ // project split is reused; the legacy component would mount a redirect+ // shim beside it.+ .with({ type: 'initiative' }, (entity) =>+ projectHostedContent(entity.id, 'overview')+ ).with({ type: 'document' }, (entity) => {const { id, fileType, subType } = entity;const blockName = fileTypeToBlockName(subType?.type ?? fileType);diff --git a/apps/web/src/features/soup/filters/facets/constants.ts b/apps/web/src/features/soup/filters/facets/constants.tsindex bcc5f299cb..e17a9d7687 100644--- a/apps/web/src/features/soup/filters/facets/constants.ts+++ b/apps/web/src/features/soup/filters/facets/constants.ts@@ -189,6 +189,25 @@ export const FILTER_TARGETS = {projectId: { backend: 'pid' },},+ // if — initiatives (task projects). Opt-in server-side: a query that says+ // nothing about them gets none, so this is not an entity target and+ // `confine` never nil-fills it; any literal here, a notification state+ // included, is what opts them in.+ if: {+ initiativeId: { backend: 'id' },+ initiativeSeen: {+ backend: 'ns',+ notification: 'seen',+ domain: [true, false],+ },+ initiativeDone: {+ backend: 'ns',+ notification: 'done',+ domain: [true, false],+ },+ includeInitiatives: { backend: 'inc', compile: 'unit' },+ },+// callf — callscallf: {callId: { backend: 'CallId' },@@ -338,6 +357,14 @@ type FilterTargetsMeta = {projectId: string[];};+ // if — initiatives (task projects)+ if: {+ initiativeId: string[];+ initiativeSeen: boolean;+ initiativeDone: boolean;+ includeInitiatives: boolean;+ };+// callf — callscallf: {callId: string[];@@ -424,6 +451,7 @@ export const TARGETS: Target[] = ['cthf','cf','pf',+ 'if','callf','fef','ghprf',@@ -438,7 +466,7 @@ export type FieldKey = {[T in Target]: FieldsForTarget<T>;}[Target];-export type EntityTarget = Exclude<Target, 'propf' | 'ghprf'>;+export type EntityTarget = Exclude<Target, 'propf' | 'ghprf' | 'if'>;export const ENTITY_TARGETS: EntityTarget[] = ['df',diff --git a/apps/web/src/lib/queries/soup/graphql/ast.ts b/apps/web/src/lib/queries/soup/graphql/ast.tsindex ed6ff2ae54..ef52bbf932 100644--- a/apps/web/src/lib/queries/soup/graphql/ast.ts+++ b/apps/web/src/lib/queries/soup/graphql/ast.ts@@ -22,6 +22,7 @@ import type {GraphqlGroupByInput,GroupedSoupContinuationInput as GraphqlGroupedSoupContinuationInput,GroupedSoupInput as GraphqlGroupedSoupInput,+ GraphqlInitiativeLiteral as GraphqlInitiativeLiteralInput,GraphqlProjectLiteral as GraphqlProjectLiteralInput,GraphqlFilterPropertiesLiteral as GraphqlPropertiesLiteralInput,SoupInitialInput as GraphqlSoupInitialInput,@@ -58,6 +59,7 @@ type TargetAstKey =| 'calf'| 'df'| 'pf'+ | 'if'| 'cf'| 'ef'| 'chanf'@@ -427,6 +429,15 @@ function mapProjectLiteral(literal: unknown): GraphqlProjectLiteralInput {}}+function mapInitiativeLiteral(literal: unknown): GraphqlInitiativeLiteralInput {+ const [field, value] = singleLiteralField(literal);+ if (field === 'inc' && value === true) return { include: true };+ if (field === 'id') return { id: mapString(value, 'id') };+ if (field === 'o') return { owner: mapString(value, 'owner') };+ if (field === 'ns') return { notificationState: mapNotificationState(value) };+ return unsupported(`initiative literal ${field}`);+}+function mapChatLiteral(literal: unknown): GraphqlChatLiteralInput {const [field, value] = singleLiteralField(literal);switch (field) {@@ -800,6 +811,8 @@ function makeGraphqlFilters(body: AstBody): GraphqlEntityFilterAstInput {if (body.df)filters.documentFilter = compileExprWithLeaf(body.df, mapDocumentPredicate);if (body.pf) filters.projectFilter = compileExpr(body.pf, mapProjectLiteral);+ if (body.if)+ filters.initiativeFilter = compileExpr(body.if, mapInitiativeLiteral);if (body.cf) filters.chatFilter = compileExpr(body.cf, mapChatLiteral);if (body.ef)filters.emailFilter = { tree: compileExpr(body.ef, mapEmailLiteral) };diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/initiativeFilters.ts b/apps/web/src/lib/service-clients/service-search/generated/models/initiativeFilters.tsindex f6f464d597..e25218f06b 100644--- a/apps/web/src/lib/service-clients/service-search/generated/models/initiativeFilters.ts+++ b/apps/web/src/lib/service-clients/service-search/generated/models/initiativeFilters.ts@@ -7,6 +7,7 @@import type { InitiativeFiltersDueAfter } from './initiativeFiltersDueAfter';import type { InitiativeFiltersDueBefore } from './initiativeFiltersDueBefore';import type { InitiativeFiltersName } from './initiativeFiltersName';+import type { NotificationFilters } from './notificationFilters';/*** Filters for initiatives.@@ -18,14 +19,17 @@ export interface InitiativeFilters {due_before?: InitiativeFiltersDueBefore;/** Opt this query into initiatives at all. Initiatives are off bydefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].-Asking for specific `initiative_ids` or `owners` also opts in. */+Asking for specific `initiative_ids`, `owners` or `notification_filters`+also opts in. */include?: boolean;/** Initiative ids to filter by. Empty to include all accessible initiatives. */initiative_ids?: string[];/** Case-insensitive name substring. */name?: InitiativeFiltersName;- /** Filter by initiative owner principal — a user ('macro|[email protected]'), a bot-('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every-owner. */+ /** Filter by initiative notification state. */+ notification_filters?: NotificationFilters;+ /** Filter by initiative owner principal — a user ('macro|[email protected]'), a+bot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include+every owner. */owners?: string[];}diff --git a/apps/web/src/lib/service-clients/service-search/openapi.json b/apps/web/src/lib/service-clients/service-search/openapi.jsonindex dc01d235ec..b770b97847 100644--- a/apps/web/src/lib/service-clients/service-search/openapi.json+++ b/apps/web/src/lib/service-clients/service-search/openapi.json@@ -2770,7 +2770,7 @@},"include": {"type": "boolean",- "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids` or `owners` also opts in."+ "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids`, `owners` or `notification_filters`\nalso opts in."},"initiative_ids": {"type": "array",@@ -2783,12 +2783,16 @@"type": ["string", "null"],"description": "Case-insensitive name substring."},+ "notification_filters": {+ "$ref": "#/components/schemas/NotificationFilters",+ "description": "Filter by initiative notification state."+ },"owners": {"type": "array","items": {"type": "string"},- "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a bot\n('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every\nowner."+ "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a\nbot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include\nevery owner."}}},diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.tsindex d79fb45ca9..2902b4cb58 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts@@ -54,6 +54,10 @@ unlike the materialized [`EntityFilterAst`] used for cursors. */fef?: unknown;/** the filters that should be applied to GitHub pull request records, on top of `fef` */ghprf?: unknown;+ /** Filters applied to initiatives (wire key `if`). Opt-in like agent+sessions: an omitted filter returns no initiatives, and any literal,+a notification state included, opts them in. */+ if?: unknown;/** the filters that should be applied to the project entity */pf?: unknown;/** the filters that should be applied based on entity properties */diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/initiativeFilters.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/initiativeFilters.tsindex 02c8c6f732..25ff721e31 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/initiativeFilters.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/initiativeFilters.ts@@ -7,6 +7,7 @@import type { InitiativeFiltersDueAfter } from './initiativeFiltersDueAfter';import type { InitiativeFiltersDueBefore } from './initiativeFiltersDueBefore';import type { InitiativeFiltersName } from './initiativeFiltersName';+import type { NotificationFilters } from './notificationFilters';/*** Filters for initiatives.@@ -18,14 +19,17 @@ export interface InitiativeFilters {due_before?: InitiativeFiltersDueBefore;/** Opt this query into initiatives at all. Initiatives are off bydefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].-Asking for specific `initiative_ids` or `owners` also opts in. */+Asking for specific `initiative_ids`, `owners` or `notification_filters`+also opts in. */include?: boolean;/** Initiative ids to filter by. Empty to include all accessible initiatives. */initiative_ids?: string[];/** Case-insensitive name substring. */name?: InitiativeFiltersName;- /** Filter by initiative owner principal — a user ('macro|[email protected]'), a bot-('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every-owner. */+ /** Filter by initiative notification state. */+ notification_filters?: NotificationFilters;+ /** Filter by initiative owner principal — a user ('macro|[email protected]'), a+bot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include+every owner. */owners?: string[];}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.tsindex c0c21242bf..afc7668c6d 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts@@ -32161,7 +32161,7 @@ export const postItemsSoupBody = zod.boolean().optional().describe(- 'Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids` or `owners` also opts in.'+ 'Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids`, `owners` or `notification_filters`\nalso opts in.'),initiative_ids: zod.array(zod.string())@@ -32173,11 +32173,28 @@ export const postItemsSoupBody = zod.string().nullish().describe('Case-insensitive name substring.'),+ notification_filters: zod+ .object({+ states: zod+ .array(+ zod+ .enum(['unseen', 'seen', 'done'])+ .describe(+ "The mutually exclusive lifecycle states of a user's notification."+ )+ )+ .optional()+ .describe(+ 'Include entities with a non-deleted notification in any of these exact states.\nEmpty means no notification restriction. Active means `[unseen, seen]`.'+ ),+ })+ .optional()+ .describe('Notification-level filters that apply to an entity type.'),owners: zod.array(zod.string()).optional().describe(- "Filter by initiative owner principal — a user ('macro|[email protected]'), a bot\n('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every\nowner."+ "Filter by initiative owner principal — a user ('macro|[email protected]'), a\nbot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include\nevery owner."),}).optional()@@ -36638,6 +36655,12 @@ export const postItemsSoupAstBody = zod.describe('the filters that should be applied to GitHub pull request records, on top of `fef`'),+ if: zod+ .unknown()+ .optional()+ .describe(+ 'Filters applied to initiatives (wire key `if`). Opt-in like agent\nsessions: an omitted filter returns no initiatives, and any literal,\na notification state included, opts them in.'+ ),pf: zod.unknown().optional()@@ -41024,6 +41047,12 @@ export const postItemsSoupAstGroupedBody = zod.describe('the filters that should be applied to GitHub pull request records, on top of `fef`'),+ if: zod+ .unknown()+ .optional()+ .describe(+ 'Filters applied to initiatives (wire key `if`). Opt-in like agent\nsessions: an omitted filter returns no initiatives, and any literal,\na notification state included, opts them in.'+ ),pf: zod.unknown().optional()@@ -41236,6 +41265,12 @@ export const postItemsSoupAstGroupedBody = zod.describe('the filters that should be applied to GitHub pull request records, on top of `fef`'),+ if: zod+ .unknown()+ .optional()+ .describe(+ 'Filters applied to initiatives (wire key `if`). Opt-in like agent\nsessions: an omitted filter returns no initiatives, and any literal,\na notification state included, opts them in.'+ ),pf: zod.unknown().optional()diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.tsindex cc691c53b0..f25e6ed494 100644--- a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts+++ b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts@@ -1511,16 +1511,18 @@ export type GraphqlInitiativeExpr =/** GraphQL input for selecting initiatives through Soup. */export type GraphqlInitiativeLiteral ={ /** Match projects due after this RFC 3339 timestamp. */- dueAfter: string; dueBefore?: never; id?: never; include?: never; nameContains?: never; owner?: never; }+ dueAfter: string; dueBefore?: never; id?: never; include?: never; nameContains?: never; notificationState?: never; owner?: never; }| { dueAfter?: never; /** Match projects due before this RFC 3339 timestamp. */- dueBefore: string; id?: never; include?: never; nameContains?: never; owner?: never; }+ dueBefore: string; id?: never; include?: never; nameContains?: never; notificationState?: never; owner?: never; }| { dueAfter?: never; dueBefore?: never; /** Match an initiative identifier. */- id: string | number; include?: never; nameContains?: never; owner?: never; }+ id: string | number; include?: never; nameContains?: never; notificationState?: never; owner?: never; }| { dueAfter?: never; dueBefore?: never; id?: never; /** Opt into initiatives; must be true. Omit the filter to exclude them. */- include: boolean; nameContains?: never; owner?: never; }+ include: boolean; nameContains?: never; notificationState?: never; owner?: never; }| { dueAfter?: never; dueBefore?: never; id?: never; include?: never; /** Match a case-insensitive substring of the name. */- nameContains: string; owner?: never; }- | { dueAfter?: never; dueBefore?: never; id?: never; include?: never; nameContains?: never; /** Match the owning principal. */+ nameContains: string; notificationState?: never; owner?: never; }+ | { dueAfter?: never; dueBefore?: never; id?: never; include?: never; nameContains?: never; /** Exact notification state for the requester; also opts in. */+ notificationState: NotificationState; owner?: never; }+ | { dueAfter?: never; dueBefore?: never; id?: never; include?: never; nameContains?: never; notificationState?: never; /** Match the owning principal. */owner: string; };/** Audience allowed to access an entity through its share link. */@@ -2359,7 +2361,9 @@ export type WorkFeedItemType =| 'DOCUMENT'/** Email threads. */| 'EMAIL'- /** Projects. */+ /** Task projects (initiatives). */+ | 'INITIATIVE'+ /** Projects (folders). */| 'PROJECT'/** GitHub pull requests. */| 'PULL_REQUEST'diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.jsonindex b0f1c70eae..834ef6da0e 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -21053,6 +21053,9 @@"ghprf": {"description": "the filters that should be applied to GitHub pull request records, on top of `fef`"},+ "if": {+ "description": "Filters applied to initiatives (wire key `if`). Opt-in like agent\nsessions: an omitted filter returns no initiatives, and any literal,\na notification state included, opts them in."+ },"pf": {"description": "the filters that should be applied to the project entity"},@@ -34196,7 +34199,7 @@},"include": {"type": "boolean",- "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids` or `owners` also opts in."+ "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids`, `owners` or `notification_filters`\nalso opts in."},"initiative_ids": {"type": "array",@@ -34209,12 +34212,16 @@"type": ["string", "null"],"description": "Case-insensitive name substring."},+ "notification_filters": {+ "$ref": "#/components/schemas/NotificationFilters",+ "description": "Filter by initiative notification state."+ },"owners": {"type": "array","items": {"type": "string"},- "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a bot\n('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every\nowner."+ "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a\nbot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include\nevery owner."}}},diff --git a/crates/agent_code_mode/src/domain/documentation.json b/crates/agent_code_mode/src/domain/documentation.jsonindex 681bfe2a87..072e187fad 100644--- a/crates/agent_code_mode/src/domain/documentation.json+++ b/crates/agent_code_mode/src/domain/documentation.json@@ -462,7 +462,7 @@"EmailFilters": "# Type Alias: EmailFilters\n\n> **EmailFilters** = \\{ `bcc?`: `string`[]; `calendar_only?`: `boolean` \\| `null`; `cc?`: `string`[]; `crm_addresses?`: `string`[]; `crm_domains?`: `string`[]; `email_thread_ids?`: `string`[]; `exclude_labels?`: `string`[]; `importance?`: `boolean` \\| `null`; `include_labels?`: `string`[]; `is_read?`: `boolean` \\| `null`; `link_ids?`: `string`[]; `notification_filters?`: `NotificationFilters`; `project_ids?`: `string`[]; `recipients?`: `string`[]; `senders?`: `string`[]; `shared?`: `SharedEmailFilter`; \\}\n\nThe email filters used to filter down what emails you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | `string`[] | Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC. |\n| <a id=\"property-calendar_only\"></a> `calendar_only?` | `boolean` \\| `null` | When `Some(true)`, only include threads that have at least one message with an iCalendar attachment (`.ics` filename or `application/ics` mime type). `Some(false)` and `None` apply no constraint. |\n| <a id=\"property-cc\"></a> `cc?` | `string`[] | Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC. |\n| <a id=\"property-crm_addresses\"></a> `crm_addresses?` | `string`[] | CRM-scoped address filter. When non-empty, expands visibility to every teammate's mailbox and restricts to threads involving any of these fully-qualified addresses. Each address is authorized against `crm_contacts` + `crm_companies` (contact must not be hidden, company must not be hidden, `email_sync` must be true). Mutually exclusive with `crm_domains`. |\n| <a id=\"property-crm_domains\"></a> `crm_domains?` | `string`[] | CRM-scoped domain filter. When non-empty, expands visibility to every teammate's mailbox and restricts to threads involving any of these domains (in any of sender/cc/bcc/recipient). Each domain is authorized against `crm_domains` + `crm_companies` (must exist for the caller's team, company must not be hidden, `email_sync` must be true). Mutually exclusive with `crm_addresses`. |\n| <a id=\"property-email_thread_ids\"></a> `email_thread_ids?` | `string`[] | Email thread IDs to filter by. Examples: ['thread-uuid-1']. Empty to search all threads. |\n| <a id=\"property-exclude_labels\"></a> `exclude_labels?` | `string`[] | Exclude emails that have any of these labels. Supports both Gmail system labels (e.g. \"CATEGORY_PROMOTIONS\") and user-created labels. Empty to not exclude any labels. Note: SPAM and TRASH emails are not indexed in OpenSearch, so they are already excluded by default. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by email importance. None to not filter. True to show only important emails (drafts, personal, sent, or uncategorized). False to show only unimportant emails (those categorized as promotions, social, updates, or forums). |\n| <a id=\"property-include_labels\"></a> `include_labels?` | `string`[] | Only include emails that have at least one of these labels. Supports both Gmail system labels (e.g. \"INBOX\", \"CATEGORY_PROMOTIONS\") and user-created labels (e.g. \"github\"). Empty to not filter by included labels. Note: SPAM and TRASH emails are not indexed in OpenSearch, so they will never appear in results regardless of this filter. |\n| <a id=\"property-is_read\"></a> `is_read?` | `boolean` \\| `null` | Filter by the email thread's read flag, independently of notification state. |\n| <a id=\"property-link_ids\"></a> `link_ids?` | `string`[] | Restrict to specific inboxes by email_links.id. Empty means \"any inbox the caller can access\" (soup expands to the full set at the router edge). |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | `NotificationFilters` | Filter by email notification state. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Empty to ignore project filtering. |\n| <a id=\"property-recipients\"></a> `recipients?` | `string`[] | Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient. |\n| <a id=\"property-senders\"></a> `senders?` | `string`[] | Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders. |\n| <a id=\"property-shared\"></a> `shared?` | `SharedEmailFilter` | Controls whether shared email threads are included in results. Defaults to \"exclude\" (only the user's own threads). |","EntityFilters": "# Type Alias: EntityFilters\n\n> **EntityFilters** = \\{ `agent_session_filters?`: `AgentSessionFilters`; `calendar_event_filters?`: `CalendarEventFilters`; `call_filters?`: `CallFilters`; `channel_filters?`: `ChannelFilters`; `channel_thread_filters?`: `ChannelThreadFilters`; `chat_filters?`: `ChatFilters`; `crm_company_filters?`: `CrmCompanyFilters`; `document_filters?`: `DocumentFilters`; `email_filters?`: `EmailFilters`; `favorites_only?`: `boolean` \\| `null`; `foreign_entity_filters?`: `ForeignEntityFilters`; `initiative_filters?`: `InitiativeFilters`; `project_filters?`: `ProjectFilters`; `property_filters?`: `PropertyFilter`[]; `tag_filter_mode?`: `TagFilterMode`; `tag_option_ids?`: `string`[]; \\}\n\na bundle of all of the filters for each entity type\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-agent_session_filters\"></a> `agent_session_filters?` | `AgentSessionFilters` | the bundled [AgentSessionFilters] |\n| <a id=\"property-calendar_event_filters\"></a> `calendar_event_filters?` | `CalendarEventFilters` | the bundled [CalendarEventFilters] |\n| <a id=\"property-call_filters\"></a> `call_filters?` | `CallFilters` | the bundled [CallFilters] |\n| <a id=\"property-channel_filters\"></a> `channel_filters?` | `ChannelFilters` | the bundled [ChannelFilters] |\n| <a id=\"property-channel_thread_filters\"></a> `channel_thread_filters?` | `ChannelThreadFilters` | the bundled [ChannelThreadFilters] |\n| <a id=\"property-chat_filters\"></a> `chat_filters?` | `ChatFilters` | the bundled [ChatFilters] |\n| <a id=\"property-crm_company_filters\"></a> `crm_company_filters?` | `CrmCompanyFilters` | the bundled [CrmCompanyFilters] |\n| <a id=\"property-document_filters\"></a> `document_filters?` | `DocumentFilters` | the bundled [DocumentFilters] |\n| <a id=\"property-email_filters\"></a> `email_filters?` | `EmailFilters` | the bundled [EmailFilters] |\n| <a id=\"property-favorites_only\"></a> `favorites_only?` | `boolean` \\| `null` | Restrict results to the authenticated viewer's favorites when true. |\n| <a id=\"property-foreign_entity_filters\"></a> `foreign_entity_filters?` | `ForeignEntityFilters` | the bundled [ForeignEntityFilters] |\n| <a id=\"property-initiative_filters\"></a> `initiative_filters?` | `InitiativeFilters` | Initiative filters. Initiatives are opt-in. |\n| <a id=\"property-project_filters\"></a> `project_filters?` | `ProjectFilters` | the bundled [ProjectFilters] |\n| <a id=\"property-property_filters\"></a> `property_filters?` | `PropertyFilter`[] | property-based filters applied across entity types |\n| <a id=\"property-tag_filter_mode\"></a> `tag_filter_mode?` | `TagFilterMode` | How the `tag_option_ids` combine: `any` (default) matches entities holding at least one selected tag, `all` requires every selected tag. |\n| <a id=\"property-tag_option_ids\"></a> `tag_option_ids?` | `string`[] | tag option ids matched against `properties.values`, OR'd together across all tag definitions. Option ids are globally unique, so the match ignores the owning definition id (personal and team tags combine into one OR). |","ForeignEntityFilters": "# Type Alias: ForeignEntityFilters\n\n> **ForeignEntityFilters** = \\{ `foreign_entity_ids?`: `string`[]; `foreign_entity_sources?`: `string`[]; `ids?`: `string`[]; `includes_me?`: `boolean`; `notification_filters?`: `NotificationFilters`; \\}\n\nFilters for foreign entity records.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-foreign_entity_ids\"></a> `foreign_entity_ids?` | `string`[] | External entity identifiers to filter by. Empty to include all external IDs. |\n| <a id=\"property-foreign_entity_sources\"></a> `foreign_entity_sources?` | `string`[] | External source names to filter by. Empty to include all sources. |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] | Internal foreign entity record IDs to filter by. Empty to include all records. |\n| <a id=\"property-includes_me\"></a> `includes_me?` | `boolean` | When true, only return foreign entities whose metadata lists the requesting user as a participant (GitHub `involves:me` semantics for `github_pull_request` records). False or absent applies no filter. Serialized in filter ASTs as the `\"me\"` literal. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | `NotificationFilters` | Filter by the notification state of the foreign entity (e.g. whether the requesting user's GitHub PR notification is done/seen). |",- "InitiativeFilters": "# Type Alias: InitiativeFilters\n\n> **InitiativeFilters** = \\{ `due_after?`: `string` \\| `null`; `due_before?`: `string` \\| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \\| `null`; `owners?`: `string`[]; \\}\n\nFilters for initiatives.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-due_after\"></a> `due_after?` | `string` \\| `null` | Inclusive lower due-date bound. |\n| <a id=\"property-due_before\"></a> `due_before?` | `string` \\| `null` | Inclusive upper due-date bound. |\n| <a id=\"property-include\"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids` or `owners` also opts in. |\n| <a id=\"property-initiative_ids\"></a> `initiative_ids?` | `string`[] | Initiative ids to filter by. Empty to include all accessible initiatives. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Case-insensitive name substring. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |",+ "InitiativeFilters": "# Type Alias: InitiativeFilters\n\n> **InitiativeFilters** = \\{ `due_after?`: `string` \\| `null`; `due_before?`: `string` \\| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \\| `null`; `notification_filters?`: `NotificationFilters`; `owners?`: `string`[]; \\}\n\nFilters for initiatives.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-due_after\"></a> `due_after?` | `string` \\| `null` | Inclusive lower due-date bound. |\n| <a id=\"property-due_before\"></a> `due_before?` | `string` \\| `null` | Inclusive upper due-date bound. |\n| <a id=\"property-include\"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids`, `owners` or `notification_filters` also opts in. |\n| <a id=\"property-initiative_ids\"></a> `initiative_ids?` | `string`[] | Initiative ids to filter by. Empty to include all accessible initiatives. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Case-insensitive name substring. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | `NotificationFilters` | Filter by initiative notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |","NotificationFilters": "# Type Alias: NotificationFilters\n\n> **NotificationFilters** = \\{ `states?`: `search.NotificationState`[]; \\}\n\nNotification-level filters that apply to an entity type.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-states\"></a> `states?` | `search.NotificationState`[] | Include entities with a non-deleted notification in any of these exact states. Empty means no notification restriction. Active means `[unseen, seen]`. |","search.NotificationState": "# Type Alias: NotificationState\n\n> **NotificationState** = `\"unseen\"` \\| `\"seen\"` \\| `\"done\"`\n\nThe mutually exclusive lifecycle states of a user's notification.","ProjectFilters": "# Type Alias: ProjectFilters\n\n> **ProjectFilters** = \\{ `importance?`: `boolean` \\| `null`; `include_root?`: `boolean`; `notification_filters?`: `NotificationFilters`; `owners?`: `string`[]; `project_ids?`: `string`[]; \\}\n\nThe project filters used to filter down what projects you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by project importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-include_root\"></a> `include_root?` | `boolean` | When true, `project_ids` also matches the projects themselves in addition to their children. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | `NotificationFilters` | Filter by project notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by project owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects. By default matches children of these projects; set `include_root` to also match the projects themselves. |",diff --git a/crates/graphql_soup_filter_input/src/lib.rs b/crates/graphql_soup_filter_input/src/lib.rsindex fd34fc70e3..b4c3e8aa6f 100644--- a/crates/graphql_soup_filter_input/src/lib.rs+++ b/crates/graphql_soup_filter_input/src/lib.rs@@ -1449,6 +1449,8 @@ enum GraphqlInitiativeLiteral {DueBefore(String),/// Match projects due after this RFC 3339 timestamp.DueAfter(String),+ /// Exact notification state for the requester; also opts in.+ NotificationState(GraphqlNotificationState),}impl IntoFilterExpr<InitiativeLiteral> for GraphqlInitiativeLiteral {@@ -1465,6 +1467,7 @@ impl IntoFilterExpr<InitiativeLiteral> for GraphqlInitiativeLiteral {Self::NameContains(name) => InitiativeLiteral::NameContains(name),Self::DueBefore(date) => InitiativeLiteral::DueBefore(GraphqlDateLiteral::parse(date)?),Self::DueAfter(date) => InitiativeLiteral::DueAfter(GraphqlDateLiteral::parse(date)?),+ Self::NotificationState(state) => InitiativeLiteral::NotificationState(state.into()),};Ok(Expr::val(literal))}diff --git a/crates/graphql_soup_filter_input/src/test.rs b/crates/graphql_soup_filter_input/src/test.rsindex 535f174132..b8729e5845 100644--- a/crates/graphql_soup_filter_input/src/test.rs+++ b/crates/graphql_soup_filter_input/src/test.rs@@ -142,6 +142,7 @@ fn initiative_filters_materialize_for_browser_and_server() {json!({"nameContains": "Launch"}),json!({"dueBefore": "2026-10-01T00:00:00Z"}),json!({"dueAfter": "2026-09-01T00:00:00Z"}),+ json!({"notificationState": "UNSEEN"}),] {let value = json!({"initiativeFilter": {"literal": literal}});let ast = materialize_graphql_filter(value.clone()).unwrap();diff --git a/crates/graphql_work_feed/src/inputs.rs b/crates/graphql_work_feed/src/inputs.rsindex 261fa9f0be..349c311483 100644--- a/crates/graphql_work_feed/src/inputs.rs+++ b/crates/graphql_work_feed/src/inputs.rs@@ -46,8 +46,10 @@ pub enum GraphqlWorkFeedItemType {Task,/// AI chats.Chat,- /// Projects.+ /// Projects (folders).Project,+ /// Task projects (initiatives).+ Initiative,/// Email threads.Email,/// Channel activity outside a dedicated thread item.@@ -69,6 +71,7 @@ impl From<GraphqlWorkFeedItemType> for WorkFeedItemType {GraphqlWorkFeedItemType::Task => Self::Task,GraphqlWorkFeedItemType::Chat => Self::Chat,GraphqlWorkFeedItemType::Project => Self::Project,+ GraphqlWorkFeedItemType::Initiative => Self::Initiative,GraphqlWorkFeedItemType::Email => Self::Email,GraphqlWorkFeedItemType::Channel => Self::Channel,GraphqlWorkFeedItemType::ChannelThread => Self::ChannelThread,diff --git a/crates/item_filters/AGENTS.md b/crates/item_filters/AGENTS.mdindex 2c9adc990c..ea3e3d68d8 100644--- a/crates/item_filters/AGENTS.md+++ b/crates/item_filters/AGENTS.md@@ -56,8 +56,9 @@ logically-combinable query form.The CRM service resolves activity scope; clients do not enumerate record IDs.- Several entity types (initiatives, agent sessions) are opt-in: `include:- false` by default, and asking for specific ids/owners also implicitly opts- in — don't assume an empty `include` flag means "show everything".+ false` by default, and asking for specific ids/owners (or, for initiatives,+ notification states) also implicitly opts in — don't assume an empty+ `include` flag means "show everything".- `#![deny(missing_docs)]`: every new public field needs a doc comment.## Relateddiff --git a/crates/item_filters/src/ast/initiative.rs b/crates/item_filters/src/ast/initiative.rsindex d5e1760de6..1bd9f0615c 100644--- a/crates/item_filters/src/ast/initiative.rs+++ b/crates/item_filters/src/ast/initiative.rs@@ -13,8 +13,8 @@ pub enum InitiativeLiteral {////// Initiatives are **off by default** — a query that/// says nothing about them gets none, so adding them to Soup did not- /// change what pre-existing Soup views return. Asking for specific ids- /// or owners also counts as opting in.+ /// change what pre-existing Soup views return. Asking for specific ids,+ /// owners or notification states also counts as opting in.#[serde(rename = "inc")]Include,/// Case-insensitive substring of the initiative name.@@ -29,6 +29,9 @@ pub enum InitiativeLiteral {/// Filter by the initiative's owner.#[serde(rename = "o")]Owner(Owner),+ /// An initiative with a non-deleted notification in this exact state.+ #[serde(rename = "ns")]+ NotificationState(crate::NotificationState),}impl ExpandFrame<InitiativeLiteral> for InitiativeFilters {@@ -44,10 +47,17 @@ impl ExpandFrame<InitiativeLiteral> for InitiativeFilters {name,due_before,due_after,+ notification_filters,} = filter_request;let include = include.then_some(Expr::val(InitiativeLiteral::Include));+ let notification_state = notification_filters+ .into_unique_states()+ .into_iter()+ .map(|state| Expr::val(InitiativeLiteral::NotificationState(state)))+ .reduce(Expr::or);+let ids = initiative_ids.iter().map(|s| Uuid::parse_str(s))@@ -65,6 +75,7 @@ impl ExpandFrame<InitiativeLiteral> for InitiativeFilters {name.map(|v| Expr::val(InitiativeLiteral::NameContains(v))),due_before.map(|v| Expr::val(InitiativeLiteral::DueBefore(v))),due_after.map(|v| Expr::val(InitiativeLiteral::DueAfter(v))),+ notification_state,].into_iter().fold_with(Expr::and))diff --git a/crates/item_filters/src/ast/tests.rs b/crates/item_filters/src/ast/tests.rsindex 98eaf1f1bc..caeb4a6168 100644--- a/crates/item_filters/src/ast/tests.rs+++ b/crates/item_filters/src/ast/tests.rs@@ -1682,6 +1682,33 @@ fn initiatives_expand_with_properties_without_enabling_legacy_queries() {assert!(ast.properties_filter.is_some());}+#[test]+fn initiative_notification_states_opt_in() {+ use initiative::{InitiativeLiteral, initiatives_requested};+ let filter = EntityFilters {+ initiative_filters: crate::InitiativeFilters {+ notification_filters: crate::NotificationFilters {+ states: vec![+ crate::NotificationState::Unseen,+ crate::NotificationState::Seen,+ crate::NotificationState::Unseen,+ ],+ },+ ..Default::default()+ },+ ..Default::default()+ };+ let ast = EntityFilterAst::new_from_filters(filter).unwrap().unwrap();+ let tree = ast.initiative_filter.as_deref().unwrap();+ assert!(initiatives_requested(Some(tree)));+ assert!(matches!(+ tree,+ Expr::Or(a, b)+ if matches!(**a, Expr::Literal(InitiativeLiteral::NotificationState(crate::NotificationState::Unseen)))+ && matches!(**b, Expr::Literal(InitiativeLiteral::NotificationState(crate::NotificationState::Seen)))+ ));+}+#[test]fn database_rows_are_requested_by_include_or_id_outside_a_not() {use database_row::{DatabaseRowLiteral, database_rows_requested};diff --git a/crates/item_filters/src/lib.rs b/crates/item_filters/src/lib.rsindex d72cf03930..a243d7b231 100644--- a/crates/item_filters/src/lib.rs+++ b/crates/item_filters/src/lib.rs@@ -435,15 +435,16 @@ impl IsEmpty for CalendarEventFilters {pub struct InitiativeFilters {/// Opt this query into initiatives at all. Initiatives are off by/// default — see [`crate::ast::initiative::InitiativeLiteral::Include`].- /// Asking for specific `initiative_ids` or `owners` also opts in.+ /// Asking for specific `initiative_ids`, `owners` or `notification_filters`+ /// also opts in.#[serde(default, skip_serializing_if = "std::ops::Not::not")]pub include: bool,/// Initiative ids to filter by. Empty to include all accessible initiatives.#[serde(default, skip_serializing_if = "Vec::is_empty")]pub initiative_ids: Vec<String>,- /// Filter by initiative owner principal — a user ('macro|[email protected]'), a bot- /// ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every- /// owner.+ /// Filter by initiative owner principal — a user ('macro|[email protected]'), a+ /// bot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include+ /// every owner.#[serde(default, skip_serializing_if = "Vec::is_empty")]pub owners: Vec<String>,/// Case-insensitive name substring.@@ -455,6 +456,9 @@ pub struct InitiativeFilters {/// Inclusive lower due-date bound.#[serde(default, skip_serializing_if = "Option::is_none")]pub due_after: Option<chrono::DateTime<chrono::Utc>>,+ /// Filter by initiative notification state.+ #[serde(default, skip_serializing_if = "NotificationFilters::is_empty")]+ pub notification_filters: NotificationFilters,}impl IsEmpty for InitiativeFilters {@@ -466,6 +470,7 @@ impl IsEmpty for InitiativeFilters {name,due_before,due_after,+ notification_filters,} = self;!include&& initiative_ids.is_empty()@@ -473,6 +478,7 @@ impl IsEmpty for InitiativeFilters {&& name.is_none()&& due_before.is_none()&& due_after.is_none()+ && notification_filters.is_empty()}}diff --git a/crates/soup/src/inbound/axum_router.rs b/crates/soup/src/inbound/axum_router.rsindex 958b0a0117..002990ba46 100644--- a/crates/soup/src/inbound/axum_router.rs+++ b/crates/soup/src/inbound/axum_router.rs@@ -45,6 +45,7 @@ use item_filters::{email::EmailLiteral,foreign_entity::ForeignEntityLiteral,github_pull_request::GithubPullRequestLiteral,+ initiative::InitiativeLiteral,project::ProjectLiteral,properties::{PropertiesLiteral, PropertyEntityType},},@@ -1262,6 +1263,12 @@ pub struct ApiEntityFilterAst {#[serde(default, rename = "asf")]#[schema(value_type = serde_json::Value)]pub agent_session_filter: LiteralTree<AgentSessionLiteral>,+ /// Filters applied to initiatives (wire key `if`). Opt-in like agent+ /// sessions: an omitted filter returns no initiatives, and any literal,+ /// a notification state included, opts them in.+ #[serde(default, rename = "if")]+ #[schema(value_type = serde_json::Value)]+ pub initiative_filter: LiteralTree<InitiativeLiteral>,/// the filters that should be applied based on entity properties#[serde(default, rename = "propf")]#[schema(value_type = serde_json::Value)]@@ -1367,6 +1374,7 @@ impl ApiEntityFilterAst {crm_company_filter,crm_contact_filter,agent_session_filter,+ initiative_filter,properties_filter,email_crm_domains,email_crm_addresses,@@ -1440,7 +1448,7 @@ impl ApiEntityFilterAst {github_pull_request_filter,agent_session_filter,properties_filter,- initiative_filter: None,+ initiative_filter,database_row_filter: None,})}diff --git a/crates/soup/src/inbound/axum_router/tests.rs b/crates/soup/src/inbound/axum_router/tests.rsindex f9f992b62d..43fc159d0e 100644--- a/crates/soup/src/inbound/axum_router/tests.rs+++ b/crates/soup/src/inbound/axum_router/tests.rs@@ -1793,6 +1793,29 @@ async fn it_can_expand_assoc_ast() {use item_filters::ast::CrmScope;+#[test]+fn ast_endpoint_initiative_filter_opts_initiatives_in() {+ use item_filters::ast::initiative::{InitiativeLiteral, initiatives_requested};+ let api: ApiEntityFilterAst =+ serde_json::from_value(json!({ "if": { "l": { "ns": "unseen" } } })).unwrap();+ let ast = api.into_entity_ast().unwrap();+ let tree = ast+ .initiative_filter+ .as_deref()+ .expect("initiative filter kept");+ assert!(initiatives_requested(Some(tree)));+ assert!(matches!(+ tree,+ filter_ast::Expr::Literal(InitiativeLiteral::NotificationState(+ item_filters::NotificationState::Unseen+ ))+ ));++ // Omitted on the wire means no initiatives, as before.+ let api: ApiEntityFilterAst = serde_json::from_value(json!({})).unwrap();+ assert!(api.into_entity_ast().unwrap().initiative_filter.is_none());+}+#[test]fn ast_endpoint_email_crm_domains_stamps_scope_and_ands_into_tree() {let js = json!({diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rsindex 4a6cdb24c0..930991030d 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rs@@ -6,7 +6,7 @@ use item_filters::ast::initiative::InitiativeLiteral;use models_pagination::SimpleSortMethod;use system_properties::SystemPropertyKey;-use super::{sql_string_literal, top_needs_user_history};+use super::{build_notification_state_clause, sql_string_literal, top_needs_user_history};use crate::outbound::pg_soup_repo::candidate_gates::PER_CANDIDATE;/// The initiative listing policy: explicit grants and the owner's team link.@@ -53,6 +53,9 @@ pub(in crate::outbound::pg_soup_repo) fn build_initiative_filter(),Expr::Literal(InitiativeLiteral::DueBefore(date)) => due_date_filter("<=", date),Expr::Literal(InitiativeLiteral::DueAfter(date)) => due_date_filter(">=", date),+ Expr::Literal(InitiativeLiteral::NotificationState(state)) => {+ build_notification_state_clause("i.id", "initiative", *state)+ }}}fn due_date_filter(operator: &str, date: &DateTime<Utc>) -> String {diff --git a/crates/soup/src/outbound/pg_soup_repo/notified/test.rs b/crates/soup/src/outbound/pg_soup_repo/notified/test.rsindex ada139f42f..2343a49db6 100644--- a/crates/soup/src/outbound/pg_soup_repo/notified/test.rs+++ b/crates/soup/src/outbound/pg_soup_repo/notified/test.rs@@ -606,6 +606,123 @@ fn agent_sessions_are_opt_in_by_filter() {);}+/// Projects are opt-in like agent sessions: a live notification alone never+/// surfaces one, while a not-done notification-state filter both opts them in+/// and drops the project whose only notification is done.+#[sqlx::test(+ fixtures(path = "../../../../fixtures", scripts("notified_at")),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn initiatives_surface_when_notified_and_opted_in(+ pool: Pool<Postgres>,+) -> anyhow::Result<()> {+ use item_filters::ast::initiative::InitiativeLiteral;+ let link_ids = [Uuid::parse_str(LINK_1)?];+ let sources = sources();+ // user-1 created three projects and still holds a grant on two of them+ // (one with a done notification); the third's grant is gone, and a+ // notification about it must never surface.+ let shared = Uuid::from_u128(0xad00_0001);+ let done = Uuid::from_u128(0xad00_0002);+ let hidden = Uuid::from_u128(0xad00_0006);+ for initiative in [shared, done, hidden] {+ let share = format!("notified-initiative-share-{initiative}");+ sqlx::query!(r#"INSERT INTO "SharePermission" (id) VALUES ($1)"#, share)+ .execute(&pool)+ .await?;+ sqlx::query!(+ r#"+ INSERT INTO initiative (id, name, owner_user_id, share_permission_id)+ VALUES ($1, 'Launch', $2, $3)+ "#,+ initiative,+ USER_1,+ share,+ )+ .execute(&pool)+ .await?;+ }+ for initiative in [shared, done] {+ sqlx::query!(+ r#"+ INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)+ VALUES ($1, 'initiative', $2, 'user', 'owner')+ "#,+ initiative,+ USER_1,+ )+ .execute(&pool)+ .await?;+ }+ for (index, initiative) in [(0x61u128, shared), (0x62, done), (0x63, hidden)] {+ sqlx::query!(+ r#"+ INSERT INTO notification ("id", "notification_event_type", "event_item_id", "event_item_type", "service_sender", "created_at", "metadata")+ VALUES ($1, 'entity_access_requested', $2, 'initiative', 'test', '2024-06-01 10:22:00', '{}')+ "#,+ Uuid::from_u128(index),+ initiative.to_string(),+ )+ .execute(&pool)+ .await?;+ }+ for index in [0x61u128, 0x63] {+ sqlx::query!(+ r#"+ INSERT INTO user_notification ("user_id", "notification_id", "created_at", "sent", "state")+ VALUES ($1, $2, '2024-06-01 10:22:00', TRUE, 'unseen')+ "#,+ USER_1,+ Uuid::from_u128(index),+ )+ .execute(&pool)+ .await?;+ }+ sqlx::query!(+ r#"+ INSERT INTO user_notification ("user_id", "notification_id", "created_at", "sent", "state")+ VALUES ($1, $2, '2024-06-01 10:22:00', TRUE, 'done')+ "#,+ USER_1,+ Uuid::from_u128(0x62),+ )+ .execute(&pool)+ .await?;++ let page = notified_soup_page(&pool, req(None, &link_ids, &sources, EVERYTHING)).await?;+ assert!(+ !keys(&page)+ .iter()+ .any(|(kind, _)| *kind == EntityType::Initiative)+ );++ let not_done = EntityFilterAst {+ initiative_filter: Some(Arc::new(filter_ast::Expr::or(+ filter_ast::Expr::val(InitiativeLiteral::NotificationState(+ item_filters::NotificationState::Unseen,+ )),+ filter_ast::Expr::val(InitiativeLiteral::NotificationState(+ item_filters::NotificationState::Seen,+ )),+ ))),+ ..EntityFilterAst::default()+ };+ let page =+ notified_soup_page(&pool, req(Some(¬_done), &link_ids, &sources, EVERYTHING)).await?;+ let keys = keys(&page);+ let initiatives: Vec<&str> = keys+ .iter()+ .filter(|(kind, _)| *kind == EntityType::Initiative)+ .map(|(_, id)| id.as_str())+ .collect();+ assert_eq!(initiatives, vec![shared.to_string().as_str()]);+ // Keyed on its notification like every other type: newest in the feed.+ assert_eq!(keys[0], (EntityType::Initiative, shared.to_string()));+ assert_eq!(minutes(&page)[0], 22);++ Ok(())+}+/// An agent session user-1 was notified about, plus one they cannot open.async fn seed_agent_sessions(pool: &Pool<Postgres>) -> anyhow::Result<(Uuid, Uuid)> {const USER_2: &str = "macro|[email protected]";diff --git a/crates/work_feed/src/domain/models.rs b/crates/work_feed/src/domain/models.rsindex c810ab7d63..eea4c8e8f8 100644--- a/crates/work_feed/src/domain/models.rs+++ b/crates/work_feed/src/domain/models.rs@@ -48,6 +48,8 @@ pub enum WorkFeedItemType {Chat,/// Projects (folders).Project,+ /// Task projects (initiatives).+ Initiative,/// Email threads.Email,/// Channel activity outside a dedicated thread item.@@ -64,11 +66,12 @@ pub enum WorkFeedItemType {impl WorkFeedItemType {/// Every item type, the default selection.- pub const ALL: [WorkFeedItemType; 10] = [+ pub const ALL: [WorkFeedItemType; 11] = [Self::Document,Self::Task,Self::Chat,Self::Project,+ Self::Initiative,Self::Email,Self::Channel,Self::ChannelThread,@@ -83,6 +86,7 @@ impl WorkFeedItemType {Self::Document | Self::Task => EntityType::Document,Self::Chat => EntityType::Chat,Self::Project => EntityType::Project,+ Self::Initiative => EntityType::Initiative,Self::Email => EntityType::EmailThread,Self::Channel => EntityType::Channel,Self::ChannelThread => EntityType::ChannelMessage,diff --git a/crates/work_feed/src/domain/policy.rs b/crates/work_feed/src/domain/policy.rsindex 884c52a636..d018d76d0e 100644--- a/crates/work_feed/src/domain/policy.rs+++ b/crates/work_feed/src/domain/policy.rs@@ -18,6 +18,7 @@ use item_filters::{document::DocumentLiteral,email::EmailLiteral,foreign_entity::ForeignEntityLiteral,+ initiative::InitiativeLiteral,},};use macro_user_id::user_id::MacroUserIdStr;@@ -40,6 +41,8 @@ const GITHUB_PULL_REQUEST_SOURCE: &str = "github_pull_request";/// - Agent sessions are opted in (Soup excludes them by default), except/// unlisted ones: a routine's runs, unless the routine lists them, live in/// its history and the Agents list.+/// - Task projects (initiatives) are opted in the same way; Soup leaves them+/// out of any query that says nothing about them./// - Snippets are documents only when the caller shows them./// - Tasks are documents only when the scope asks for both; asking for one/// of documents and tasks keeps the other out.@@ -68,6 +71,7 @@ pub fn signal_filter(user: &MacroUserIdStr<'static>, scope: &WorkFeedScope) -> EAgentSessionVisibility::Unlisted,))),))),+ initiative_filter: Some(Arc::new(Expr::val(InitiativeLiteral::Include))),..Default::default()}}diff --git a/crates/work_feed/src/domain/policy/test.rs b/crates/work_feed/src/domain/policy/test.rsindex 1cb66f11e3..581ef76e88 100644--- a/crates/work_feed/src/domain/policy/test.rs+++ b/crates/work_feed/src/domain/policy/test.rs@@ -9,6 +9,7 @@ fn no_types_means_every_type() {EntityType::Document,EntityType::Chat,EntityType::Project,+ EntityType::Initiative,EntityType::EmailThread,EntityType::Channel,EntityType::ChannelMessage,@@ -47,7 +48,10 @@ fn signal_filter_matches_home_signal() {filter.agent_session_filter.is_some(),"agent sessions are opted in");- assert!(filter.initiative_filter.is_none(), "initiatives stay out");+ assert!(+ filter.initiative_filter.is_some(),+ "task projects are opted in"+ );assert!(filter.email_filter.tree.is_some());assert!(filter.channel_thread_filter.is_some());assert!(filter.foreign_entity_filter.is_some());diff --git a/docs/agent-guide/documents.md b/docs/agent-guide/documents.mdindex 16067bd43e..0a5309f530 100644--- a/docs/agent-guide/documents.md+++ b/docs/agent-guide/documents.md@@ -100,8 +100,12 @@ lets a reviewer choose an access level and **Grant access**, or **Deny**. Teamowners/admins and the human responsible for a bot-owned item review on its behalf.Only the first review of a request succeeds. Grants notify the requester; denialsdo not. Approved users appear in People with access, with controls to change or-remove their direct grant. Opening a permission-request notification navigates-to its item and opens Share.+remove their direct grant. A pending request also puts the item, projects+included, on the reviewer's Home feed until it is resolved. A project row has+no Home preview: clicking it opens the project in place, Shift-click opens it+in a new split, and when the project is already open in another split that+split is focused. Opening a permission-request notification navigates to its+item and opens Share.Both **Edit with AI** and selected-text AI edits open the shared usage-limit dialogwhen the backend refuses a request with a usage-limit code. Free users can choosediff --git a/docs/agent-guide/home.md b/docs/agent-guide/home.mdindex 9691bc7df9..a28e1bdc95 100644--- a/docs/agent-guide/home.md+++ b/docs/agent-guide/home.md@@ -66,6 +66,9 @@ one type without closing. Press **f** to open the menu.Entity type checkboxes start checked. Unchecking **Email** hides receivedand sent mail. **Channels** controlsboth channels and reply threads; **Chats** and **Agents** have separate toggles.+**Folders** is the Drive folder filter and **Projects** the task project+filter: a project with a pending access request or a discussion notification+is its own feed row, carried by the work feed as its own item kind.Unchecking every type shows an empty feed. **Reset filters** shows every type andboth read states again. A badge counts hidden types plus an active status filter.Read status and type selections persist.@@ -109,8 +112,8 @@ Items in the 256px desktop rail use single-line pills with 16px icons: profile pDMs and model logos for AI chats (Claude sunburst or ChatGPT knot). Other itemsuse the same glyphs as entity rows elsewhere: document file-type andtask/snippet/skill variants, hashes for channels, read/unread envelopes or-calendar invites for email, sparkles for agents, folders for projects, and alarms-for reminders. Pull requests retain open, merged, and closed status glyphs and+calendar invites for email, sparkles for agents, folders for folders, the+project stack for task projects, and alarms for reminders. Pull requests retain open, merged, and closed status glyphs andcolors; unknown foreign sources use the generic file icon.New agent-session rows always use a sparkle in the left slot, including whileworking. A coding session adds a second line with repository, captured workingdiff --git a/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/InitiativeFilters.md b/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/InitiativeFilters.mdindex dc799db691..eb5fbd3e09 100644--- a/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/InitiativeFilters.md+++ b/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/InitiativeFilters.md@@ -1,6 +1,6 @@# Type Alias: InitiativeFilters-> **InitiativeFilters** = \{ `due_after?`: `string` \| `null`; `due_before?`: `string` \| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \| `null`; `owners?`: `string`[]; \}+> **InitiativeFilters** = \{ `due_after?`: `string` \| `null`; `due_before?`: `string` \| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \| `null`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; \}Filters for initiatives.@@ -10,7 +10,8 @@ Filters for initiatives.| ------ | ------ | ------ || <a id="property-due_after"></a> `due_after?` | `string` \| `null` | Inclusive lower due-date bound. || <a id="property-due_before"></a> `due_before?` | `string` \| `null` | Inclusive upper due-date bound. |-| <a id="property-include"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids` or `owners` also opts in. |+| <a id="property-include"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids`, `owners` or `notification_filters` also opts in. || <a id="property-initiative_ids"></a> `initiative_ids?` | `string`[] | Initiative ids to filter by. Empty to include all accessible initiatives. || <a id="property-name"></a> `name?` | `string` \| `null` | Case-insensitive name substring. |-| <a id="property-owners"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\|[email protected]'), a bot ('bot\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |+| <a id="property-notification_filters"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by initiative notification state. |+| <a id="property-owners"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\|[email protected]'), a bot ('bot\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiEntityFilterAst.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiEntityFilterAst.mdindex 63e2dda5ee..d9802798f8 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiEntityFilterAst.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiEntityFilterAst.md@@ -1,6 +1,6 @@# Type Alias: ApiEntityFilterAst-> **ApiEntityFilterAst** = \{ `asf?`: `unknown`; `calf?`: `unknown`; `callf?`: `unknown`; `ccf?`: `unknown`; `cf?`: `unknown`; `chanf?`: `unknown`; `crma?`: `null` \| [`CrmAssociation`](CrmAssociation.md); `crmf?`: `unknown`; `cthf?`: `unknown`; `df?`: `unknown`; `eca?`: `string`[]; `ecd?`: `string`[]; `ef?`: `unknown`; `favorites_only?`: `boolean` \| `null`; `fef?`: `unknown`; `ghprf?`: `unknown`; `pf?`: `unknown`; `propf?`: `unknown`; \}+> **ApiEntityFilterAst** = \{ `asf?`: `unknown`; `calf?`: `unknown`; `callf?`: `unknown`; `ccf?`: `unknown`; `cf?`: `unknown`; `chanf?`: `unknown`; `crma?`: `null` \| [`CrmAssociation`](CrmAssociation.md); `crmf?`: `unknown`; `cthf?`: `unknown`; `df?`: `unknown`; `eca?`: `string`[]; `ecd?`: `string`[]; `ef?`: `unknown`; `favorites_only?`: `boolean` \| `null`; `fef?`: `unknown`; `ghprf?`: `unknown`; `if?`: `unknown`; `pf?`: `unknown`; `propf?`: `unknown`; \}Wire-format entity filter AST accepted by soup AST endpoints.@@ -24,5 +24,6 @@ Wire-format entity filter AST accepted by soup AST endpoints.| <a id="property-favorites_only"></a> `favorites_only?` | `boolean` \| `null` | Restrict to the authenticated viewer's favorites before pagination when true. || <a id="property-fef"></a> `fef?` | `unknown` | the filters that should be applied to foreign entity records || <a id="property-ghprf"></a> `ghprf?` | `unknown` | the filters that should be applied to GitHub pull request records, on top of `fef` |+| <a id="property-if"></a> `if?` | `unknown` | Filters applied to initiatives (wire key `if`). Opt-in like agent sessions: an omitted filter returns no initiatives, and any literal, a notification state included, opts them in. || <a id="property-pf"></a> `pf?` | `unknown` | the filters that should be applied to the project entity || <a id="property-propf"></a> `propf?` | `unknown` | the filters that should be applied based on entity properties |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/InitiativeFilters.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/InitiativeFilters.mdindex dc799db691..eb5fbd3e09 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/InitiativeFilters.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/InitiativeFilters.md@@ -1,6 +1,6 @@# Type Alias: InitiativeFilters-> **InitiativeFilters** = \{ `due_after?`: `string` \| `null`; `due_before?`: `string` \| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \| `null`; `owners?`: `string`[]; \}+> **InitiativeFilters** = \{ `due_after?`: `string` \| `null`; `due_before?`: `string` \| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \| `null`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; \}Filters for initiatives.@@ -10,7 +10,8 @@ Filters for initiatives.| ------ | ------ | ------ || <a id="property-due_after"></a> `due_after?` | `string` \| `null` | Inclusive lower due-date bound. || <a id="property-due_before"></a> `due_before?` | `string` \| `null` | Inclusive upper due-date bound. |-| <a id="property-include"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids` or `owners` also opts in. |+| <a id="property-include"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids`, `owners` or `notification_filters` also opts in. || <a id="property-initiative_ids"></a> `initiative_ids?` | `string`[] | Initiative ids to filter by. Empty to include all accessible initiatives. || <a id="property-name"></a> `name?` | `string` \| `null` | Case-insensitive name substring. |-| <a id="property-owners"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\|[email protected]'), a bot ('bot\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |+| <a id="property-notification_filters"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by initiative notification state. |+| <a id="property-owners"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\|[email protected]'), a bot ('bot\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |diff --git a/packages/sdk/generated/search/types.gen.ts b/packages/sdk/generated/search/types.gen.tsindex 05c937c834..5866fdf337 100644--- a/packages/sdk/generated/search/types.gen.ts+++ b/packages/sdk/generated/search/types.gen.ts@@ -1479,7 +1479,8 @@ export type InitiativeFilters = {/*** Opt this query into initiatives at all. Initiatives are off by* default — see [`crate::ast::initiative::InitiativeLiteral::Include`].- * Asking for specific `initiative_ids` or `owners` also opts in.+ * Asking for specific `initiative_ids`, `owners` or `notification_filters`+ * also opts in.*/include?: boolean;/**@@ -1491,9 +1492,13 @@ export type InitiativeFilters = {*/name?: string | null;/**- * Filter by initiative owner principal — a user ('macro|[email protected]'), a bot- * ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every- * owner.+ * Filter by initiative notification state.+ */+ notification_filters?: NotificationFilters;+ /**+ * Filter by initiative owner principal — a user ('macro|[email protected]'), a+ * bot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include+ * every owner.*/owners?: Array<string>;};diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex 7c582b7d65..1acafa6208 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -974,6 +974,12 @@ export type ApiEntityFilterAst = {* the filters that should be applied to GitHub pull request records, on top of `fef`*/ghprf?: unknown;+ /**+ * Filters applied to initiatives (wire key `if`). Opt-in like agent+ * sessions: an omitted filter returns no initiatives, and any literal,+ * a notification state included, opts them in.+ */+ if?: unknown;/*** the filters that should be applied to the project entity*/@@ -9522,7 +9528,8 @@ export type InitiativeFilters = {/*** Opt this query into initiatives at all. Initiatives are off by* default — see [`crate::ast::initiative::InitiativeLiteral::Include`].- * Asking for specific `initiative_ids` or `owners` also opts in.+ * Asking for specific `initiative_ids`, `owners` or `notification_filters`+ * also opts in.*/include?: boolean;/**@@ -9534,9 +9541,13 @@ export type InitiativeFilters = {*/name?: string | null;/**- * Filter by initiative owner principal — a user ('macro|[email protected]'), a bot- * ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every- * owner.+ * Filter by initiative notification state.+ */+ notification_filters?: NotificationFilters;+ /**+ * Filter by initiative owner principal — a user ('macro|[email protected]'), a+ * bot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include+ * every owner.*/owners?: Array<string>;};diff --git a/packages/sdk/specs/search.json b/packages/sdk/specs/search.jsonindex dc01d235ec..b770b97847 100644--- a/packages/sdk/specs/search.json+++ b/packages/sdk/specs/search.json@@ -2770,7 +2770,7 @@},"include": {"type": "boolean",- "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids` or `owners` also opts in."+ "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids`, `owners` or `notification_filters`\nalso opts in."},"initiative_ids": {"type": "array",@@ -2783,12 +2783,16 @@"type": ["string", "null"],"description": "Case-insensitive name substring."},+ "notification_filters": {+ "$ref": "#/components/schemas/NotificationFilters",+ "description": "Filter by initiative notification state."+ },"owners": {"type": "array","items": {"type": "string"},- "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a bot\n('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every\nowner."+ "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a\nbot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include\nevery owner."}}},diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex b0f1c70eae..834ef6da0e 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -21053,6 +21053,9 @@"ghprf": {"description": "the filters that should be applied to GitHub pull request records, on top of `fef`"},+ "if": {+ "description": "Filters applied to initiatives (wire key `if`). Opt-in like agent\nsessions: an omitted filter returns no initiatives, and any literal,\na notification state included, opts them in."+ },"pf": {"description": "the filters that should be applied to the project entity"},@@ -34196,7 +34199,7 @@},"include": {"type": "boolean",- "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids` or `owners` also opts in."+ "description": "Opt this query into initiatives at all. Initiatives are off by\ndefault — see [`crate::ast::initiative::InitiativeLiteral::Include`].\nAsking for specific `initiative_ids`, `owners` or `notification_filters`\nalso opts in."},"initiative_ids": {"type": "array",@@ -34209,12 +34212,16 @@"type": ["string", "null"],"description": "Case-insensitive name substring."},+ "notification_filters": {+ "$ref": "#/components/schemas/NotificationFilters",+ "description": "Filter by initiative notification state."+ },"owners": {"type": "array","items": {"type": "string"},- "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a bot\n('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every\nowner."+ "description": "Filter by initiative owner principal — a user ('macro|[email protected]'), a\nbot ('bot|<uuid>'), or a team (a bare hyphenated uuid). Empty to include\nevery owner."}}},diff --git a/static_assets/schema.graphql b/static_assets/schema.graphqlindex b4851312d6..469d91f111 100644--- a/static_assets/schema.graphql+++ b/static_assets/schema.graphql@@ -5660,6 +5660,10 @@ input GraphqlInitiativeLiteral @oneOf {Match projects due after this RFC 3339 timestamp."""dueAfter: String+ """+ Exact notification state for the requester; also opts in.+ """+ notificationState: NotificationState}"""@@ -11015,10 +11019,14 @@ enum WorkFeedItemType {"""CHAT"""- Projects.+ Projects (folders)."""PROJECT"""+ Task projects (initiatives).+ """+ INITIATIVE+ """Email threads."""