: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
chore(signals): expose only the facade and list existing internal imports in tach (#125821)
Julian Bez00bc7519d93c
diff --git a/tach.toml b/tach.tomlindex 6d97854c4773..bffb116ff9ac 100644--- a/tach.toml+++ b/tach.toml@@ -1203,6 +1203,80 @@ from = ["products\\.(autoresearch|batch_exports|canvas|customer_analytics|data_modeling|data_warehouse|demo|endpoints|error_tracking|experiments|groups|managed_warehouse|mcp_analytics|mcp_store|messaging|metrics|notebooks|notifications|streamlit_apps|subscriptions|tasks|tracing|visual_review|warehouse_sources|workflows)",]+# signals is not isolated, so it gets its own blocks instead of a place in the shared one above.+[[interfaces]]+expose = [+ "backend\\.facade.*",+ "backend\\.presentation\\.views.*",+ "backend\\.routes.*",+]+from = [+ "products.signals",+]++# Legacy leaks — outside callers (posthog, tasks, review_hog, engineering_analytics, replay_vision,+# slack_app and tests) still import these signals internals. Each entry goes when its caller moves+# to products.signals.backend.facade. Delete the block when it is empty.+[[interfaces]]+expose = [+ "backend\\.activity_summary\\.schedule(\\..*)?",+ "backend\\.anomaly_scores\\.schedule(\\..*)?",+ "backend\\.artefact_attribution(\\..*)?",+ "backend\\.artefact_schemas(\\..*)?",+ "backend\\.billing(\\..*)?",+ "backend\\.contracts(\\..*)?",+ "backend\\.emission\\.conversations_schedule(\\..*)?",+ "backend\\.emission\\.temporal_settings(\\..*)?",+ "backend\\.enums(\\..*)?",+ "backend\\.free_trial(\\..*)?",+ "backend\\.github_optional(\\..*)?",+ "backend\\.implementation_pr(\\..*)?",+ "backend\\.models(\\..*)?",+ "backend\\.quota(\\..*)?",+ "backend\\.ranking\\.schedule(\\..*)?",+ "backend\\.report_access(\\..*)?",+ "backend\\.report_generation\\.priority(\\..*)?",+ "backend\\.report_generation\\.research(\\..*)?",+ "backend\\.report_generation\\.resolve_reviewers(\\..*)?",+ "backend\\.report_task_actions(\\..*)?",+ "backend\\.scout_authorship(\\..*)?",+ "backend\\.scout_harness\\.inactivity(\\..*)?",+ "backend\\.scout_harness\\.lazy_seed(\\..*)?",+ "backend\\.scout_harness\\.model_selection(\\..*)?",+ "backend\\.scout_harness\\.run_gates(\\..*)?",+ "backend\\.scout_harness\\.serializers(\\..*)?",+ "backend\\.scout_harness\\.suggestions(\\..*)?",+ "backend\\.scout_harness\\.tools\\.structured_output(\\..*)?",+ "backend\\.scout_harness\\.trial_launch(\\..*)?",+ "backend\\.scout_harness\\.views(\\..*)?",+ "backend\\.slack_report_threads(\\..*)?",+ "backend\\.spend(\\..*)?",+ "backend\\.task_run_artefacts(\\..*)?",+ "backend\\.tasks(\\..*)?",+ "backend\\.temporal\\.(ACTIVITIES|InboxRankingScoringWorkflow|SELF_DRIVING_ACTIVITIES|SELF_DRIVING_WORKFLOWS|WORKFLOWS|score_inbox_reports_activity)",+ "backend\\.temporal\\.agentic\\.schedule(\\..*)?",+ "backend\\.temporal\\.agentic\\.scout_coordinator(\\..*)?",+ "backend\\.temporal\\.agentic\\.scout_scheduler(\\..*)?",+ "backend\\.temporal\\.agentic\\.scout_trial_evaluation(\\..*)?",+ "backend\\.temporal\\.emit_eval_signal(\\..*)?",+ "backend\\.temporal\\.llm(\\..*)?",+ "backend\\.temporal\\.summary(\\..*)?",+ "backend\\.tracker_issues(\\..*)?",+ "backend\\.views(\\..*)?",+ "dags\\.inbox_ranking\\.common(\\..*)?",+ "dags\\.inbox_ranking\\.dataset\\.dag(\\..*)?",+ "dags\\.inbox_ranking\\.mirror\\.dag(\\..*)?",+ "dags\\.inbox_ranking\\.nn\\.dag(\\..*)?",+ "dags\\.inbox_ranking\\.nn\\.experiments(\\..*)?",+ "dags\\.inbox_ranking\\.nn\\.pairs(\\..*)?",+ "dags\\.inbox_ranking\\.training\\.dag(\\..*)?",+ "dags\\.inbox_ranking\\.training\\.promote(\\..*)?",+ "dags\\.inbox_ranking\\.training\\.served(\\..*)?",+]+from = [+ "products.signals",+]+# TODO: Experiments-specific temporary interface# Remove this block once all ViewSets are migrated to products/experiments/backend/presentation/views.pydiff --git a/tools/hogli-commands/hogli_commands/product/checks.py b/tools/hogli-commands/hogli_commands/product/checks.pyindex 0ca70367af89..d9b7224aad0a 100644--- a/tools/hogli-commands/hogli_commands/product/checks.py+++ b/tools/hogli-commands/hogli_commands/product/checks.py@@ -109,7 +109,9 @@ def validate_facade_alternation(tach_content: str, products_dir: Path) -> list[s1. Every product named in the canonical alternation must exist asproducts/<name>/.2. Every product named in the canonical alternation must have- backend/facade/contracts.py (the Strict rung or above).+ backend/facade/contracts.py (the Strict rung or above). A product+ that also has a legacy-leak block is exempt: its facade block only+ stops new reach-ins while the listed leaks drain.3. Names in alternation regexes must be sorted alphabetically.The inverse direction ("every Strict product must be listed") is not@@ -150,6 +152,8 @@ def validate_facade_alternation(tach_content: str, products_dir: Path) -> list[s"remove the stale entry from tach.toml")continue+ if has_legacy_interface_leaks(tach_content, f"products.{name}"):+ continueif not has_contracts_module(product_dir / "backend"):issues.append(f"canonical facade alternation lists '{name}' but products/{name}/backend/facade/contracts.py "diff --git a/tools/hogli-commands/hogli_commands/tests/test_checks.py b/tools/hogli-commands/hogli_commands/tests/test_checks.pyindex d4575d9a41aa..39911dda2fad 100644--- a/tools/hogli-commands/hogli_commands/tests/test_checks.py+++ b/tools/hogli-commands/hogli_commands/tests/test_checks.py@@ -1691,6 +1691,16 @@ _CANONICAL_SINGLE_NAME_TACH = ()+_FACADE_PLUS_LEGACY_TACH = (+ "[[interfaces]]\n"+ 'expose = ["backend\\\\.facade.*"]\n'+ 'from = ["products.alpha"]\n'+ "[[interfaces]]\n"+ 'expose = ["backend\\\\.models.*"]\n'+ 'from = ["products.alpha"]\n'+)++class TestValidateFacadeAlternation:@pytest.mark.parametrize("products, tach, expected_substrings",@@ -1712,6 +1722,8 @@ class TestValidateFacadeAlternation:),# On-disk single-name `from` (no alternation) parses.([("alpha", True)], _CANONICAL_SINGLE_NAME_TACH, []),+ # A product still draining legacy leaks may expose its facade without contracts.py.+ ([("alpha", False)], _FACADE_PLUS_LEGACY_TACH, []),# Non-listed isolated products are tolerated — having# facade/contracts.py is just scaffolding, not a commitment to# canonical exposure.@@ -1728,6 +1740,7 @@ class TestValidateFacadeAlternation:"stale_entry_missing_on_disk","stale_entry_not_isolated","on_disk_single_name_form_parses",+ "facade_block_with_legacy_leaks_needs_no_contracts","isolated_but_not_in_alternation_is_tolerated",],)