:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(signals): only read Linear issues from chosen Linear teams (#101777)
Alex Lebedev1f5b06a76423
diff --git a/products/signals/ARCHITECTURE.md b/products/signals/ARCHITECTURE.mdindex c3cb0392c229..7d6e6e9749da 100644--- a/products/signals/ARCHITECTURE.md+++ b/products/signals/ARCHITECTURE.md@@ -619,14 +619,14 @@ A drop that leaves replacement discovery pointed at this table finds no candidatPer-team configuration for which signal sources are enabled.-| Field | Type | Description |-| ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| `team` | FK → Team | Owning team (reverse accessor sealed with `related_name="+"`) |-| `source_product` | CharField | One of: `session_replay`, `llm_analytics`, `github`, `linear`, `zendesk`, `conversations`, `error_tracking`, `signals_scout` (`SourceProduct` enum) |-| `source_type` | CharField | One of: `session_analysis_cluster`, `evaluation_report`, `issue`, `ticket`, `issue_created`, `issue_reopened`, `issue_spiking`, `cross_source_issue` (`SourceType` enum) |-| `enabled` | Boolean | Whether this source is active (default `True`) |-| `config` | JSONField | Source-specific configuration, plus the shared steering keys (`steering`, `default_not_actionable`) read by the emission actionability gate |-| `created_by` | FK → User | User who created the config (nullable) |+| Field | Type | Description |+| ---------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `team` | FK → Team | Owning team (reverse accessor sealed with `related_name="+"`) |+| `source_product` | CharField | One of: `session_replay`, `llm_analytics`, `github`, `linear`, `zendesk`, `conversations`, `error_tracking`, `signals_scout` (`SourceProduct` enum) |+| `source_type` | CharField | One of: `session_analysis_cluster`, `evaluation_report`, `issue`, `ticket`, `issue_created`, `issue_reopened`, `issue_spiking`, `cross_source_issue` (`SourceType` enum) |+| `enabled` | Boolean | Whether this source is active (default `True`) |+| `config` | JSONField | Source-specific configuration (for the Linear issue source, `linear_team_ids`), plus the shared steering keys (`steering`, `default_not_actionable`) read by the emission actionability gate |+| `created_by` | FK → User | User who created the config (nullable) |**Behavioral notes:**@@ -635,6 +635,7 @@ Per-team configuration for which signal sources are enabled.- Two `config` keys steer the emission actionability gate per source: `config.steering` (free text, the team's preferences about the source's records — injected into the canonical actionability prompt, never replacing it) and `config.default_not_actionable` (boolean — flips the gate's "when in doubt" posture from keep to filter). Serializer validation enforces `steering` is a string capped at `STEERING_MAX_LENGTH` (2000 chars) and `default_not_actionable` is a boolean; injection escapes braces so the text can never break the gate's one-word output contract (see `backend/emission/steering.py`). The keys apply to sources that run `run_signal_pipeline` (data warehouse imports and Conversations), and to the direct-emitting sources listed in `DIRECT_STEERABLE_SOURCES` (error tracking and health checks), which `emit_signal` runs through the gate in `backend/emission/direct_gate.py` before queueing the signal.A direct source is judged only when the team has written steering, and only against that text: the canonical prompt there states no criteria of its own, so a first rule filters what it describes and nothing else.Sources outside both sets persist the keys unread, and future consumers (report research, the autostart gate) are expected to read the same text.+- The Linear issue source reads `config.linear_team_ids` (list of Linear team id strings, capped at `SCOPE_IDS_MAX_COUNT`): the warehouse still syncs the whole workspace, but the emission fetcher adds an `IN` clause on the issue's team id, so only issues from those teams become signals. An absent, empty, or malformed list means every team, which keeps rows written before the key existed working and stops a bad row from silently narrowing the scope. Applies from the next sync; reports already in the inbox are not touched. The fetcher-side mechanism is generic (`scope_field` / `scope_config_key` on `SignalSourceTableConfig`), Linear is the only source that declares it. The key itself is declared in `contracts.SCOPE_CONFIG_KEYS`, so the API validates the same key the fetcher filters on.- The serializer exposes a computed `status` field:- data-import-backed sources (`github`, `linear`, `zendesk`) derive status from `ExternalDataSchema`- The `signals_scout` source variant pairs with `source_type=cross_source_issue` and is the emission channel used by the headless Signals agent's `emit_signal_*` tools. It is the only `(source_product, source_type)` pair the agent emits today.diff --git a/products/signals/backend/contracts.py b/products/signals/backend/contracts.pyindex cb8dcaff33e2..7b4c05033819 100644--- a/products/signals/backend/contracts.py+++ b/products/signals/backend/contracts.py@@ -4,6 +4,7 @@# `SignalNodeSerializer` in `serializers.py`), so they flow through the standard OpenAPI/Orval pipeline.import enum+from collections.abc import Mappingfrom typing import Annotated, Literal, get_argsfrom pydantic import BaseModel, ConfigDict, Field@@ -22,6 +23,30 @@ DEFAULT_NOT_ACTIONABLE_KEY = "default_not_actionable"# defensively so a row written by another path cannot bloat every gate prompt.STEERING_MAX_LENGTH = 2000+# ── Scope allowlists ────────────────────────────────────────────────────────────+# Per-source `SignalSourceConfig.config` key holding the allowlist of scope ids emission narrows to.+# Kept out of `emission/` for the same reason as the steering keys above.+SCOPE_CONFIG_KEYS: Mapping[tuple[str, str], str] = {+ (SignalSourceProduct.LINEAR, SignalSourceType.ISSUE): "linear_team_ids",+}+SCOPE_IDS_MAX_COUNT = 100+# Both caps keep a row written outside the API from bloating the emission query past ClickHouse's size limit.+SCOPE_ID_MAX_LENGTH = 255+++def scope_ids_problem(value: object) -> str | None:+ """Why `value` is not a valid scope allowlist, or None when it is. The API rejects the value+ with this message; the fetcher falls back to reading everything, so a malformed row never+ applies part of a list."""+ if not isinstance(value, list) or not all(isinstance(scope_id, str) and scope_id.strip() for scope_id in value):+ return "must be a list of non-empty strings"+ if len(value) > SCOPE_IDS_MAX_COUNT:+ return f"must have at most {SCOPE_IDS_MAX_COUNT} entries"+ if any(len(scope_id.strip()) > SCOPE_ID_MAX_LENGTH for scope_id in value):+ return f"entries must be at most {SCOPE_ID_MAX_LENGTH} characters"+ return None++# The sources that emit straight through `emit_signal` and still honor steering, via the gate in# `emission/direct_gate.py`. Every other direct source skips the gate, so writing steering onto its# row would store text nothing reads. The roster's `steerable` flags in `agentRosterMeta.ts` mirrordiff --git a/products/signals/backend/emission/AGENTS.md b/products/signals/backend/emission/AGENTS.mdindex 95b24b35a98c..07ef81125ce6 100644--- a/products/signals/backend/emission/AGENTS.md+++ b/products/signals/backend/emission/AGENTS.md@@ -51,7 +51,10 @@ The registry key is a plain string pair — external sources use `ExternalDataSoEach source defines how to fetch records via its `record_fetcher` on the config:- **Data warehouse fetcher** (`fetchers/data_warehouse.py`) — queries HogQL on warehouse tables.- Receives `table_name` and `last_synced_at` via the runtime context dict.+ Receives `table_name`, `last_synced_at` and the team's `source_config` blob via the runtime context dict.+ A source that declares `scope_field` (a HogQL expression yielding a record's scope id) and `scope_config_key` (a list of allowed ids on `SignalSourceConfig.config`) gets an `IN` clause added to its query, so a team narrows a workspace-wide warehouse sync without changing what the warehouse imports.+ An absent, empty, or malformed list means no narrowing.+ Declare the key per source in `contracts.SCOPE_CONFIG_KEYS` and read it from there, as `linear_issues.py` does for Linear team ids: the table stays out of `emission/` so the API serializer validates the same key without importing the emitters.- **Conversations fetcher** (`fetchers/conversations.py`) — queries Django ORM for Postgres tickets + comments.Records emission in `SignalEmissionRecord` optimistically at fetch time.diff --git a/products/signals/backend/emission/emit_signals.py b/products/signals/backend/emission/emit_signals.pyindex b498c3863b42..69dd8012b929 100644--- a/products/signals/backend/emission/emit_signals.py+++ b/products/signals/backend/emission/emit_signals.py@@ -42,14 +42,15 @@ async def emit_data_import_signals_activity(inputs: EmitSignalsActivityInputs) -# `DataWarehouseTable.name` is the storage form (e.g. `<prefix><source_type>_<schema>`),# but HogQL exposes warehouse tables under the keys produced by `get_data_warehouse_table_name`# (e.g. `github.issues` or `github.<prefix>.<schema>`). Querying the storage name fails to resolve.+ # Before the record fetch: fetchers record emission optimistically, so a failure after+ # they return would permanently skip this batch on the Temporal retry.+ source_config = await afetch_source_config(team.id, config.source_product, config.source_type)fetcher_context = {"table_name": get_data_warehouse_table_name(schema.source, schema.table.name),"last_synced_at": inputs.last_synced_at,"extra": inputs.properties_to_log,+ "source_config": source_config,}- # Before the record fetch: fetchers record emission optimistically, so a failure after- # they return would permanently skip this batch on the Temporal retry.- source_config = await afetch_source_config(team.id, config.source_product, config.source_type)records = await database_sync_to_async(config.record_fetcher, thread_sensitive=False)(team, config, fetcher_context)diff --git a/products/signals/backend/emission/fetchers/data_warehouse.py b/products/signals/backend/emission/fetchers/data_warehouse.pyindex c85a7d54c154..c1b04a2ccec8 100644--- a/products/signals/backend/emission/fetchers/data_warehouse.py+++ b/products/signals/backend/emission/fetchers/data_warehouse.py@@ -10,6 +10,7 @@ from posthog.hogql.query import execute_hogql_queryfrom posthog.models import Team+from products.signals.backend.contracts import scope_ids_problemfrom products.signals.backend.emission.registry import SignalSourceTableConfiglogger = structlog.get_logger(__name__)@@ -26,6 +27,30 @@ def escape_table_name(table_name: str) -> str:return ".".join(escape_hogql_identifier(part) for part in table_name.split("."))+def scope_ids_from_source_config(config: SignalSourceTableConfig, source_config: Any) -> list[str]:+ """The source's allowlist, stripped, or an empty list. A malformed value in the API-writable+ config blob is ignored as a whole: emission reads everything rather than applying part of a+ list or breaking."""+ if config.scope_config_key is None or not isinstance(source_config, dict):+ return []+ raw = source_config.get(config.scope_config_key)+ if raw is None:+ return []+ problem = scope_ids_problem(raw)+ if problem is not None:+ logger.warning(+ "Ignoring malformed scope allowlist in source config",+ scope_config_key=config.scope_config_key,+ problem=problem,+ source_product=config.source_product,+ source_type=config.source_type,+ signals_type="data-import-signals",+ )+ return []+ # Exact `IN` match: a stray space would match no record.+ return [scope_id.strip() for scope_id in raw]++def data_warehouse_record_fetcher(team: Team,config: SignalSourceTableConfig,@@ -35,6 +60,7 @@ def data_warehouse_record_fetcher(table_name: str = context["table_name"]last_synced_at: str | None = context.get("last_synced_at")extra: dict[str, Any] = context.get("extra", {})+ scope_ids = scope_ids_from_source_config(config, context.get("source_config"))where_parts: list[str] = []placeholders: dict[str, Any] = {}partition_expr = (@@ -51,6 +77,10 @@ def data_warehouse_record_fetcher(where_parts.append(f"{partition_expr} > now() - interval {config.first_sync_lookback_days} day")if config.where_clause:where_parts.append(config.where_clause)+ # Filtered in the query rather than in Python so the LIMIT below counts only allowlisted records.+ if scope_ids:+ where_parts.append(f"{config.scope_field} IN {{scope_ids}}")+ placeholders["scope_ids"] = ast.Tuple(exprs=[ast.Constant(value=scope_id) for scope_id in scope_ids])where_sql = " AND ".join(where_parts)fields_sql = ", ".join(config.fields)# Limiting can cause a data loss, as the missed records won't be picked in the next sync, but it's acceptable for the current use case@@ -67,6 +97,7 @@ def data_warehouse_record_fetcher(lookback_days=config.first_sync_lookback_days if last_synced_at is None else None,table_name=table_name,where_clause=where_sql,+ scope_ids_count=len(scope_ids),max_records=config.max_records,signals_type="data-import-signals",**extra,diff --git a/products/signals/backend/emission/linear_issues.py b/products/signals/backend/emission/linear_issues.pyindex 5e6a89cbbb3a..cf38e35dcebb 100644--- a/products/signals/backend/emission/linear_issues.py+++ b/products/signals/backend/emission/linear_issues.py@@ -3,8 +3,10 @@ from typing import Anyfrom structlog import get_logger+from products.signals.backend.contracts import SCOPE_CONFIG_KEYSfrom products.signals.backend.emission.fetchers.data_warehouse import data_warehouse_record_fetcherfrom products.signals.backend.emission.registry import SignalEmitterOutput, SignalSourceTableConfig+from products.signals.backend.enums import SignalSourceProduct, SignalSourceTypelogger = get_logger(__name__)@@ -139,6 +141,9 @@ LINEAR_ISSUES_CONFIG = SignalSourceTableConfig(partition_field_is_datetime_string=True,fields=REQUIRED_FIELDS + EXTRA_FIELDS,where_clause=f"JSONExtractString(state, 'type') NOT IN ({', '.join(repr(s) for s in LINEAR_IGNORED_STATE_TYPES)})",+ # Every Linear issue belongs to exactly one team, so a team allowlist covers the whole workspace.+ scope_field="JSONExtractString(team, 'id')",+ scope_config_key=SCOPE_CONFIG_KEYS[(SignalSourceProduct.LINEAR, SignalSourceType.ISSUE)],max_records=1000,first_sync_lookback_days=1, # 24 hoursactionability_prompt=LINEAR_ACTIONABILITY_PROMPT,diff --git a/products/signals/backend/emission/registry.py b/products/signals/backend/emission/registry.pyindex 7bb2b0fe4184..ce5f0182db13 100644--- a/products/signals/backend/emission/registry.py+++ b/products/signals/backend/emission/registry.py@@ -79,6 +79,10 @@ class SignalSourceTableConfig(BaseModel):summarization_prompt: str | None = None# How large the description can be before emittingdescription_summarization_threshold_chars: int | None = Field(default=None, gt=0)+ # Per-team allowlist: `scope_field` is the HogQL expression for a record's scope id and+ # `scope_config_key` names the list of allowed ids on `SignalSourceConfig.config`.+ scope_field: str | None = None+ scope_config_key: str | None = None@model_validator(mode="after")def _validate_prompt_placeholders(self) -> SignalSourceTableConfig:@@ -88,6 +92,12 @@ class SignalSourceTableConfig(BaseModel):raise ValueError(f"{field_name} must contain {{description}} placeholder")return self+ @model_validator(mode="after")+ def _validate_scope_pair(self) -> SignalSourceTableConfig:+ if (self.scope_field is None) != (self.scope_config_key is None):+ raise ValueError("scope_field and scope_config_key must both be set or both be None")+ return self+@model_validator(mode="after")def _validate_summarization_pair(self) -> SignalSourceTableConfig:has_prompt = self.summarization_prompt is not Nonediff --git a/products/signals/backend/emission/tests/test_emit_signals.py b/products/signals/backend/emission/tests/test_emit_signals.pyindex 38f07c015704..b62bc2bb4fef 100644--- a/products/signals/backend/emission/tests/test_emit_signals.py+++ b/products/signals/backend/emission/tests/test_emit_signals.py@@ -127,6 +127,71 @@ class TestQueryNewRecords:query_arg = mock_parse.call_args[0][0]assert "parseDateTimeBestEffort(updated_at) > {last_synced_at}" in query_arg+ @pytest.mark.parametrize(+ "source_config,expected_ids",+ [+ ({"linear_team_ids": ["team-1", "team-2"]}, ["team-1", "team-2"]),+ ({"linear_team_ids": [" team-1 ", "team-2"]}, ["team-1", "team-2"]),+ # Every one of these means "read everything": a malformed list must not apply even in part.+ ({"linear_team_ids": []}, None),+ ({}, None),+ (None, None),+ ({"linear_team_ids": "team-1"}, None),+ ({"linear_team_ids": ["team-1", 1]}, None),+ ({"linear_team_ids": ["team-1", " "]}, None),+ ({"linear_team_ids": ["x" * 300]}, None),+ ({"linear_team_ids": [f"team-{i}" for i in range(101)]}, None),+ ],+ )+ def test_scope_filter_comes_from_source_config(self, source_config, expected_ids):+ config = _make_config(scope_field="JSONExtractString(team, 'id')", scope_config_key="linear_team_ids")+ mock_result = MagicMock()+ mock_result.columns = []+ mock_result.results = []++ with patch(f"{FETCHER_MODULE_PATH}.execute_hogql_query", return_value=mock_result):+ with patch(f"{FETCHER_MODULE_PATH}.parse_select", return_value="parsed") as mock_parse:+ data_warehouse_record_fetcher(+ team=MagicMock(),+ config=config,+ context={+ "table_name": "test_table",+ "last_synced_at": "2025-01-01T00:00:00Z",+ "extra": {},+ "source_config": source_config,+ },+ )++ query_arg = mock_parse.call_args[0][0]+ placeholders = mock_parse.call_args.kwargs["placeholders"]+ if expected_ids is None:+ assert "IN {scope_ids}" not in query_arg+ assert "scope_ids" not in placeholders+ else:+ assert "JSONExtractString(team, 'id') IN {scope_ids}" in query_arg+ assert placeholders["scope_ids"] == ast.Tuple(exprs=[ast.Constant(value=i) for i in expected_ids])++ def test_source_without_scope_ignores_scope_keys_in_config(self):+ config = _make_config()+ mock_result = MagicMock()+ mock_result.columns = []+ mock_result.results = []++ with patch(f"{FETCHER_MODULE_PATH}.execute_hogql_query", return_value=mock_result):+ with patch(f"{FETCHER_MODULE_PATH}.parse_select", return_value="parsed") as mock_parse:+ data_warehouse_record_fetcher(+ team=MagicMock(),+ config=config,+ context={+ "table_name": "test_table",+ "last_synced_at": "2025-01-01T00:00:00Z",+ "extra": {},+ "source_config": {"linear_team_ids": ["team-1"]},+ },+ )++ assert "scope_ids" not in mock_parse.call_args[0][0]+def test_first_sync_uses_lookback_window(self):config = _make_config(partition_field="time", first_sync_lookback_days=14)mock_result = MagicMock()@@ -960,7 +1025,13 @@ class TestEmitActivityTableNameResolution:class TestEmitActivitySourceConfigThreading:@pytest.mark.asyncioasync def test_passes_team_source_config_to_pipeline(self):- config = _make_config(record_fetcher=lambda team, config, context: [])+ captured_context: dict[str, Any] = {}++ def capture_fetcher(team, config, context):+ captured_context.update(context)+ return []++ config = _make_config(record_fetcher=capture_fetcher)team = MagicMock(id=7)schema = MagicMock()schema.table.name = "test_table"@@ -991,3 +1062,5 @@ class TestEmitActivitySourceConfigThreading:fetch_mock.assert_awaited_once_with(team.id, config.source_product, config.source_type)assert run_mock.call_args.kwargs["source_config"] == {"steering": "skip chores"}+ # The scope filter reads the blob from this context, so the handoff needs its own assertion.+ assert captured_context["source_config"] == {"steering": "skip chores"}diff --git a/products/signals/backend/emission/tests/test_registry.py b/products/signals/backend/emission/tests/test_registry.pyindex 95261747cc05..4c307ad43471 100644--- a/products/signals/backend/emission/tests/test_registry.py+++ b/products/signals/backend/emission/tests/test_registry.py@@ -55,13 +55,20 @@ def _build_fetcher_query(config: SignalSourceTableConfig, last_synced_at: str |result.columns = []return result+ # A source with a scope gets an allowlist, so its scope expression is parsed by this sweep too.+ source_config = {config.scope_config_key: ["scope-1", "scope-2"]} if config.scope_config_key else {}with patch("products.signals.backend.emission.fetchers.data_warehouse.execute_hogql_query", side_effect=fake_execute):data_warehouse_record_fetcher(team=MagicMock(),config=config,- context={"table_name": "source.table", "last_synced_at": last_synced_at, "extra": {}},+ context={+ "table_name": "source.table",+ "last_synced_at": last_synced_at,+ "extra": {},+ "source_config": source_config,+ },)return captured["query"]@@ -209,6 +216,14 @@ class TestSignalSourceTableConfigValidation:assert config.summarization_prompt is Noneassert config.description_summarization_threshold_chars is None+ @pytest.mark.parametrize(+ "fields",+ [{"scope_field": "JSONExtractString(team, 'id')"}, {"scope_config_key": "linear_team_ids"}],+ )+ def test_rejects_half_a_scope_pair(self, fields):+ with pytest.raises(ValidationError, match="scope_field and scope_config_key must both be set or both be None"):+ SignalSourceTableConfig(**{**_BASE_FIELDS, **fields})+# Captured at import, before the _clean_registry fixture can touch it._REGISTERED_IDENTITIES = sorted({(c.source_product, c.source_type) for c in _SIGNAL_TABLE_CONFIGS.values()})diff --git a/products/signals/backend/serializers.py b/products/signals/backend/serializers.pyindex 1490ac3a96f5..9240a6e9dc3a 100644--- a/products/signals/backend/serializers.py+++ b/products/signals/backend/serializers.py@@ -20,7 +20,13 @@ from posthog.models.integration import Integration, is_supported_external_issue_from products.signals.backend import contractsfrom products.signals.backend.billing import REFUND_INELIGIBILITY_REASONS, refund_ineligibility_reason-from products.signals.backend.contracts import DEFAULT_NOT_ACTIONABLE_KEY, STEERING_KEY, STEERING_MAX_LENGTH+from products.signals.backend.contracts import (+ DEFAULT_NOT_ACTIONABLE_KEY,+ SCOPE_CONFIG_KEYS,+ STEERING_KEY,+ STEERING_MAX_LENGTH,+ scope_ids_problem,+)from products.signals.backend.enums import SignalSourceProduct, SignalSourceTypefrom products.signals.backend.report_checks import (CHECK_CONFIG_SCHEMAS,@@ -148,7 +154,11 @@ _SOURCE_CONFIG_HELP_TEXT = ("Other sources store these keys without reading them yet; future pipeline stages will consume ""the same steering text. ""Some sources read additional keys, for example `recording_filters` and `sample_rate` for "- "session analysis."+ "session analysis. "+ "The Linear issue source (`source_product=linear`, `source_type=issue`) reads "+ "`linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the "+ "whole Linear workspace, but only issues from those teams become signals. Omit the key or "+ "pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.")@@ -259,6 +269,14 @@ class SignalSourceConfigSerializer(serializers.ModelSerializer):)if DEFAULT_NOT_ACTIONABLE_KEY in config and not isinstance(config[DEFAULT_NOT_ACTIONABLE_KEY], bool):raise serializers.ValidationError({"config": "default_not_actionable must be a boolean"})+ scope_key = SCOPE_CONFIG_KEYS.get((source_product, source_type)) if source_product and source_type else None+ if scope_key is not None and scope_key in config:+ problem = scope_ids_problem(config[scope_key])+ if problem is not None:+ raise serializers.ValidationError({"config": f"{scope_key} {problem}"})+ # Stored stripped: emission matches these ids exactly, so a pasted id with a+ # stray space would select a scope and then read nothing.+ config[scope_key] = [scope_id.strip() for scope_id in config[scope_key]]if source_product == SignalSourceConfig.SourceProduct.SESSION_REPLAY and config:recording_filters = config.get("recording_filters")if recording_filters is not None and not isinstance(recording_filters, dict):diff --git a/products/signals/backend/test/test_signal_source_config_api.py b/products/signals/backend/test/test_signal_source_config_api.pyindex 9865116930d3..3cb4b6c9786b 100644--- a/products/signals/backend/test/test_signal_source_config_api.py+++ b/products/signals/backend/test/test_signal_source_config_api.py@@ -1,11 +1,14 @@from posthog.test.base import APIBaseTest+from django.test import SimpleTestCase+from parameterized import parameterizedfrom rest_framework import statusfrom posthog.models.team.team import Teamfrom products.signals.backend.models import SignalSourceConfig+from products.signals.backend.serializers import SignalSourceConfigSerializerclass TestSignalSourceConfigAPI(APIBaseTest):@@ -208,6 +211,18 @@ class TestSignalSourceConfigAPI(APIBaseTest):if expected_status == status.HTTP_201_CREATED:assert response.json()["config"] == config+ def test_create_linear_config_persists_team_ids(self):+ # Wiring guard for the serializer-level matrix in TestSignalSourceConfigSerializerValidation.+ config = {"linear_team_ids": ["team-1", "team-2"], "steering": "Skip chores"}+ response = self.client.post(+ self._url(),+ data={"source_product": "linear", "source_type": "issue", "config": config},+ format="json",+ )+ assert response.status_code == status.HTTP_201_CREATED, response.json()+ assert response.json()["config"] == config+ assert SignalSourceConfig.objects.get(id=response.json()["id"]).config == config+# --- List ---def test_list_source_configs(self):@@ -399,6 +414,41 @@ class TestSignalSourceConfigAPI(APIBaseTest):assert response.status_code in (status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN)+class TestSignalSourceConfigSerializerValidation(SimpleTestCase):+ @parameterized.expand(+ [+ ("valid", {"linear_team_ids": ["team-1", "team-2"]}, True),+ ("empty_list_means_all_teams", {"linear_team_ids": []}, True),+ ("at_cap", {"linear_team_ids": [f"team-{i}" for i in range(100)]}, True),+ ("over_cap", {"linear_team_ids": [f"team-{i}" for i in range(101)]}, False),+ ("at_id_length_cap", {"linear_team_ids": ["t" * 255]}, True),+ ("over_id_length_cap", {"linear_team_ids": ["t" * 256]}, False),+ ("not_a_list", {"linear_team_ids": "team-1"}, False),+ ("null", {"linear_team_ids": None}, False),+ ("non_string_entry", {"linear_team_ids": ["team-1", 2]}, False),+ ("blank_entry", {"linear_team_ids": ["team-1", " "]}, False),+ ]+ )+ def test_linear_team_ids(self, _name, config, expected_valid):+ serializer = SignalSourceConfigSerializer(+ data={"source_product": "linear", "source_type": "issue", "config": config}+ )+ assert serializer.is_valid() is expected_valid, serializer.errors+ if not expected_valid:+ assert "linear_team_ids" in str(serializer.errors["config"])++ def test_linear_team_ids_are_stored_stripped(self):+ serializer = SignalSourceConfigSerializer(+ data={+ "source_product": "linear",+ "source_type": "issue",+ "config": {"linear_team_ids": [" team-1 ", "team-2"]},+ }+ )+ assert serializer.is_valid(), serializer.errors+ assert serializer.validated_data["config"]["linear_team_ids"] == ["team-1", "team-2"]++class TestScoutSourceCanonicalization(APIBaseTest):"""The scout source config is a project-level singleton: the scout fleet canonicalizes childenvironments to the parent team and the emit preflight gates on the parent team's row, so thediff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 4f90e59f7d41..e1479209f336 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -5958,7 +5958,7 @@ export const SignalSourceSyncStatusEnumApi = {} as const/**- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.*/export type SignalSourceConfigApiConfig = { [key: string]: unknown }@@ -5967,7 +5967,7 @@ export interface SignalSourceConfigApi {source_product: SignalSourceProductEnumApisource_type: SignalSourceConfigSourceTypeEnumApienabled?: boolean- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. */+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. */config?: SignalSourceConfigApiConfigreadonly created_at: stringreadonly updated_at: string@@ -5985,7 +5985,7 @@ export interface PaginatedSignalSourceConfigListApi {}/**- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.*/export type PatchedSignalSourceConfigApiConfig = { [key: string]: unknown }@@ -5994,7 +5994,7 @@ export interface PatchedSignalSourceConfigApi {source_product?: SignalSourceProductEnumApisource_type?: SignalSourceConfigSourceTypeEnumApienabled?: boolean- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. */+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. */config?: PatchedSignalSourceConfigApiConfigreadonly created_at?: stringreadonly updated_at?: stringdiff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.tsindex 542f3f68a8f9..117a0f34bec2 100644--- a/products/signals/frontend/generated/api.zod.ts+++ b/products/signals/frontend/generated/api.zod.ts@@ -2447,7 +2447,7 @@ export const SignalsSourceConfigsCreateBody = /* @__PURE__ */ zod.object({.record(zod.string(), zod.unknown()).optional().describe(- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis."+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint."),})@@ -2539,7 +2539,7 @@ export const SignalsSourceConfigsUpdateBody = /* @__PURE__ */ zod.object({.record(zod.string(), zod.unknown()).optional().describe(- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis."+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint."),})@@ -2633,7 +2633,7 @@ export const SignalsSourceConfigsPartialUpdateBody = /* @__PURE__ */ zod.object(.record(zod.string(), zod.unknown()).optional().describe(- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis."+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint."),})diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yamlindex f212eaa5685e..d7ee0a581dd6 100644--- a/products/signals/mcp/tools.yaml+++ b/products/signals/mcp/tools.yaml@@ -425,7 +425,9 @@ tools:reason to create a `source_product=signals_scout`, `source_type=cross_source_issue` row is to OPT OUT:create it with `enabled=false` (the per-scout `emit` flag is set separately via `scout-config-update`).There is at most one config per (source_product, source_type) per project; if one already exists, update it- instead.+ instead. For `source_product=linear`, `source_type=issue`, pass `config.linear_team_ids` (a list of Linear+ team ids from `integrations-linear-teams-retrieve`) so only issues from those Linear teams become signals;+ the warehouse still syncs the whole workspace. Omit it to use every team.inbox-source-configs-destroy:operation: signals_source_configs_destroyenabled: false@@ -467,7 +469,9 @@ tools:description: >Partially update an existing signal source config by ID — typically to flip its `enabled` flag on or off, orto adjust its `config`. Only the fields you pass are changed. To turn the Signals scout source off for a- project, set `enabled=false` on its `signals_scout` / `cross_source_issue` config.+ project, set `enabled=false` on its `signals_scout` / `cross_source_issue` config. `config` is replaced as a+ whole, so include the existing keys (such as `steering`) when changing one of them, for example the Linear+ source's `linear_team_ids` allowlist.inbox-source-configs-retrieve:operation: signals_source_configs_retrieveenabled: truediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex c626c28b6876..305333b43fc9 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -6309,7 +6309,7 @@}},"inbox-source-configs-create": {- "description": "Create a signal source config for the current project, switching an inbox signal source on. A source ties a `source_product` to a `source_type` and an `enabled` flag. Valid `source_product` values: llm_analytics, github, linear, zendesk, conversations, error_tracking, pganalyze, signals_scout, logs. Valid `source_type` values: evaluation_report, issue, ticket, issue_created, issue_reopened, issue_spiking, cross_source_issue, alert_state_change. To surface AI observability evaluation report findings in the inbox, create `source_product=llm_analytics`, `source_type=evaluation_report` — there is no per-evaluation-run source. The Signals scout source is ON BY DEFAULT — scout findings reach the inbox with no config row needed. The only reason to create a `source_product=signals_scout`, `source_type=cross_source_issue` row is to OPT OUT: create it with `enabled=false` (the per-scout `emit` flag is set separately via `scout-config-update`). There is at most one config per (source_product, source_type) per project; if one already exists, update it instead.",+ "description": "Create a signal source config for the current project, switching an inbox signal source on. A source ties a `source_product` to a `source_type` and an `enabled` flag. Valid `source_product` values: llm_analytics, github, linear, zendesk, conversations, error_tracking, pganalyze, signals_scout, logs. Valid `source_type` values: evaluation_report, issue, ticket, issue_created, issue_reopened, issue_spiking, cross_source_issue, alert_state_change. To surface AI observability evaluation report findings in the inbox, create `source_product=llm_analytics`, `source_type=evaluation_report` — there is no per-evaluation-run source. The Signals scout source is ON BY DEFAULT — scout findings reach the inbox with no config row needed. The only reason to create a `source_product=signals_scout`, `source_type=cross_source_issue` row is to OPT OUT: create it with `enabled=false` (the per-scout `emit` flag is set separately via `scout-config-update`). There is at most one config per (source_product, source_type) per project; if one already exists, update it instead. For `source_product=linear`, `source_type=issue`, pass `config.linear_team_ids` (a list of Linear team ids from `integrations-linear-teams-retrieve`) so only issues from those Linear teams become signals; the warehouse still syncs the whole workspace. Omit it to use every team.","category": "Signals","feature": "signals","summary": "Create signal source config",@@ -6337,7 +6337,7 @@}},"inbox-source-configs-partial-update": {- "description": "Partially update an existing signal source config by ID — typically to flip its `enabled` flag on or off, or to adjust its `config`. Only the fields you pass are changed. To turn the Signals scout source off for a project, set `enabled=false` on its `signals_scout` / `cross_source_issue` config.",+ "description": "Partially update an existing signal source config by ID — typically to flip its `enabled` flag on or off, or to adjust its `config`. Only the fields you pass are changed. To turn the Signals scout source off for a project, set `enabled=false` on its `signals_scout` / `cross_source_issue` config. `config` is replaced as a whole, so include the existing keys (such as `steering`) when changing one of them, for example the Linear source's `linear_team_ids` allowlist.","category": "Signals","feature": "signals","summary": "Update signal source config",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex f9b799fd07f7..2435f8b5ba04 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -6506,7 +6506,7 @@}},"inbox-source-configs-create": {- "description": "Create a signal source config for the current project, switching an inbox signal source on. A source ties a `source_product` to a `source_type` and an `enabled` flag. Valid `source_product` values: llm_analytics, github, linear, zendesk, conversations, error_tracking, pganalyze, signals_scout, logs. Valid `source_type` values: evaluation_report, issue, ticket, issue_created, issue_reopened, issue_spiking, cross_source_issue, alert_state_change. To surface AI observability evaluation report findings in the inbox, create `source_product=llm_analytics`, `source_type=evaluation_report` — there is no per-evaluation-run source. The Signals scout source is ON BY DEFAULT — scout findings reach the inbox with no config row needed. The only reason to create a `source_product=signals_scout`, `source_type=cross_source_issue` row is to OPT OUT: create it with `enabled=false` (the per-scout `emit` flag is set separately via `scout-config-update`). There is at most one config per (source_product, source_type) per project; if one already exists, update it instead.",+ "description": "Create a signal source config for the current project, switching an inbox signal source on. A source ties a `source_product` to a `source_type` and an `enabled` flag. Valid `source_product` values: llm_analytics, github, linear, zendesk, conversations, error_tracking, pganalyze, signals_scout, logs. Valid `source_type` values: evaluation_report, issue, ticket, issue_created, issue_reopened, issue_spiking, cross_source_issue, alert_state_change. To surface AI observability evaluation report findings in the inbox, create `source_product=llm_analytics`, `source_type=evaluation_report` — there is no per-evaluation-run source. The Signals scout source is ON BY DEFAULT — scout findings reach the inbox with no config row needed. The only reason to create a `source_product=signals_scout`, `source_type=cross_source_issue` row is to OPT OUT: create it with `enabled=false` (the per-scout `emit` flag is set separately via `scout-config-update`). There is at most one config per (source_product, source_type) per project; if one already exists, update it instead. For `source_product=linear`, `source_type=issue`, pass `config.linear_team_ids` (a list of Linear team ids from `integrations-linear-teams-retrieve`) so only issues from those Linear teams become signals; the warehouse still syncs the whole workspace. Omit it to use every team.","category": "Signals","feature": "signals","summary": "Create signal source config",@@ -6534,7 +6534,7 @@}},"inbox-source-configs-partial-update": {- "description": "Partially update an existing signal source config by ID — typically to flip its `enabled` flag on or off, or to adjust its `config`. Only the fields you pass are changed. To turn the Signals scout source off for a project, set `enabled=false` on its `signals_scout` / `cross_source_issue` config.",+ "description": "Partially update an existing signal source config by ID — typically to flip its `enabled` flag on or off, or to adjust its `config`. Only the fields you pass are changed. To turn the Signals scout source off for a project, set `enabled=false` on its `signals_scout` / `cross_source_issue` config. `config` is replaced as a whole, so include the existing keys (such as `steering`) when changing one of them, for example the Linear source's `linear_team_ids` allowlist.","category": "Signals","feature": "signals","summary": "Update signal source config",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 264c728b0355..8b5ef6c30911 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -65481,7 +65481,7 @@ export namespace Schemas {} as const;/**- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.*/export type SignalSourceConfigConfig = { [key: string]: unknown };@@ -65490,7 +65490,7 @@ export namespace Schemas {source_product: SignalSourceProductEnum;source_type: SignalSourceConfigSourceTypeEnum;enabled?: boolean;- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. */+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. */config?: SignalSourceConfigConfig;readonly created_at: string;readonly updated_at: string;@@ -75514,7 +75514,7 @@ export namespace Schemas {}/**- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.*/export type PatchedSignalSourceConfigConfig = { [key: string]: unknown };@@ -75523,7 +75523,7 @@ export namespace Schemas {source_product?: SignalSourceProductEnum;source_type?: SignalSourceConfigSourceTypeEnum;enabled?: boolean;- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. */+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. */config?: PatchedSignalSourceConfigConfig;readonly created_at?: string;readonly updated_at?: string;diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 9f1d02024edc..383239df9f93 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -2943,7 +2943,7 @@ export const SignalsSourceConfigsCreateBody = () => zod.object({.record(zod.string(), zod.unknown()).optional().describe(- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis."+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint."),})@@ -3053,7 +3053,7 @@ export const SignalsSourceConfigsUpdateBody = () => zod.object({.record(zod.string(), zod.unknown()).optional().describe(- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis."+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint."),})@@ -3156,6 +3156,6 @@ export const SignalsSourceConfigsPartialUpdateBody = () => zod.object({.record(zod.string(), zod.unknown()).optional().describe(- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis."+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint."),})diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.jsonindex 225eb9501a19..887fa4c7064e 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json@@ -3,7 +3,7 @@"properties": {"config": {"additionalProperties": {},- "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.",+ "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.","propertyNames": {"type": "string"},diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.jsonindex cd7671654fb6..22d349c83e6e 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json@@ -3,7 +3,7 @@"properties": {"config": {"additionalProperties": {},- "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.",+ "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.","propertyNames": {"type": "string"},diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.jsonindex d5cbe79fb12e..f68a90d04c5a 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json@@ -3,7 +3,7 @@"properties": {"config": {"additionalProperties": {},- "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis.",+ "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint.","propertyNames": {"type": "string"},