: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): sweep long-expired scout scratchpad entries (#92464)
posthog[bot]eeb9a2d24b2e
diff --git a/posthog/tasks/scheduled.py b/posthog/tasks/scheduled.pyindex 1dd98b1a6be5..ace56a62a7b0 100644--- a/posthog/tasks/scheduled.py+++ b/posthog/tasks/scheduled.py@@ -105,6 +105,7 @@ from products.pulse.backend.tasks import mark_stale_pulse_briefs_failedfrom products.reminders.backend.tasks import process_due_remindersfrom products.signals.backend.tasks import (pause_inactive_signal_scouts,+ prune_expired_scratchpad_entries_task,refresh_signal_repository_activity,sync_pending_signals_refund_credits,)@@ -362,6 +363,14 @@ def setup_periodic_tasks(sender: Celery, **kwargs: Any) -> None:name="pause inactive signals scouts",)+ # Hard-delete signals scratchpad entries long past their expiry - daily at 6:45 AM+ add_periodic_task_with_expiry(+ sender,+ crontab(hour="6", minute="45"),+ prune_expired_scratchpad_entries_task.s(),+ name="prune expired signals scratchpad entries",+ )+# Keep the signals repository area-activity cache warm - weekly, Monday early morningsender.add_periodic_task(crontab(day_of_week="mon", hour="5", minute="35"),diff --git a/products/signals/ARCHITECTURE.md b/products/signals/ARCHITECTURE.mdindex 54ee43c87456..a0144a0938de 100644--- a/products/signals/ARCHITECTURE.md+++ b/products/signals/ARCHITECTURE.md@@ -632,7 +632,7 @@ Both report-pipeline stages write here too, under the `pipeline:implementation``authority` and `tags` (with their backing GIN index) were dropped in the PR2 review simplification — retrieval is now plain ILIKE over `key` + `content`.-`expires_at` was dropped in that same pass and later restored: a scout that wrote a time-boxed memory almost never came back to `forget` it, so stale entries kept loading into run prompts. Entries stay durable by default. Expiry hides a row from `search_scratchpad` (`include_expired=True` is the human audit path); it never deletes one, so the key stays taken and both `forget` and the `remember` upsert still find it. `remember` writes the whole entry, so a write that omits `expires_at` clears an expiry an earlier write set. A `followup:` key may not carry one — `remember` rejects that, since an expired follow-up would vanish from the self-validation queue before the scout could work it.+`expires_at` was dropped in that same pass and later restored: a scout that wrote a time-boxed memory almost never came back to `forget` it, so stale entries kept loading into run prompts. Entries stay durable by default. Expiry first hides a row from `search_scratchpad` (`include_expired=True` is the human audit path); within its post-expiry grace the key stays taken and both `forget` and the `remember` upsert still find it. The daily `prune_expired_scratchpad_entries` janitor then hard-deletes rows whose expiry is more than `SCRATCHPAD_EXPIRY_GRACE_DAYS` in the past, so lapsed entries cannot pile up forever; durable (`expires_at`-null) rows are never swept. `remember` writes the whole entry, so a write that omits `expires_at` clears an expiry an earlier write set. A `followup:` key may not carry one — `remember` rejects that, since an expired follow-up would vanish from the self-validation queue before the scout could work it.### `SignalProjectProfile`diff --git a/products/signals/backend/models.py b/products/signals/backend/models.pyindex 89ea627e4c85..aafbab76befa 100644--- a/products/signals/backend/models.py+++ b/products/signals/backend/models.py@@ -2088,9 +2088,13 @@ class SignalScratchpad(TeamScopedRootMixin, UUIDModel):Most entries are durable, so `expires_at` is nullable and unset by default. Itexists for the memories that are true only for a while — a cooldown, a window towatch — which a scout would otherwise have to come back and `forget` by hand.- Expiry hides a row from `search_scratchpad`, it does not delete it: the key stays- taken (so the upsert keeps working) and a human auditing the fleet's memory can- still read it back with `include_expired`.+ Expiry first hides a row from `search_scratchpad`: the key stays taken (so the+ upsert keeps working) and a human auditing the fleet's memory can still read it+ back with `include_expired`. Then, once its expiry is more than+ `SCRATCHPAD_EXPIRY_GRACE_DAYS` in the past, the daily+ `prune_expired_scratchpad_entries` janitor hard-deletes the row, so a lapsed+ memory cannot pile up forever. A durable entry (`expires_at` NULL) is never+ swept."""# See SignalScoutConfig.all_teams for rationale.diff --git a/products/signals/backend/scout_harness/AGENTS.md b/products/signals/backend/scout_harness/AGENTS.mdindex 2b05114b5a7e..f99f85362b7c 100644--- a/products/signals/backend/scout_harness/AGENTS.md+++ b/products/signals/backend/scout_harness/AGENTS.md@@ -41,7 +41,7 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e- `scratchpad.py` — `remember`, `forget`, and `search_scratchpad` tools backed by the `SignalScratchpad` model.Entries are durable by default; an optional `expires_at` (mirroring `notes.py`) retires a time-boxed memory on its own, since a scout that writes one almost never comes back to `forget` it.`remember` is a full-state upsert, so a write with no `expires_at` clears an expiry an earlier write set — sticky expiry would keep hiding an entry that has since become permanent, with no way for the rewriting scout to know a clock was on it.- `search_scratchpad` drops expired rows unless `include_expired=True` (the human audit path); expiry hides a row, it never deletes one, so the key stays taken and both `forget` and the upsert still find it.+ `search_scratchpad` drops expired rows unless `include_expired=True` (the human audit path); expiry first only hides a row, so within its post-expiry grace the key stays taken and both `forget` and the upsert still find it. The daily `prune_expired_scratchpad_entries` janitor (in `../tasks.py`) then hard-deletes rows whose expiry is more than `SCRATCHPAD_EXPIRY_GRACE_DAYS` in the past, so a lapsed memory cannot pile up forever; durable (`expires_at`-null) rows are never swept.A reader that goes to the manager rather than through `search_scratchpad` stays unfiltered on purpose — `derived_metadata._touched_followup_queue` is the one such reader, and has to be, since a `followup:` entry lapsing after a run doesn't undo the validation work that run did.`run_id` on a `remember` write is best-effort lineage, never a gate: the serializer coerces one it can't parse to `None` (`_BestEffortUUIDField`, the same stance `expires_at` takes) and the view drops one that names no run on this project, because a scout retypes the id out of its run prompt and a truncated copy must not cost the memory. When nothing usable comes off the body the view falls back to `tools/runs.run_id_for_sandbox_task`, which resolves the writing run from the task the caller's sandbox token is bound to — provenance the sandbox cannot choose, so lineage survives the typo. Non-sandbox callers and the pipeline stages resolve to no run and are unaffected.The scratchpad is shared with the report pipeline, not scout-only. `remember` / `forget` are gated on their own `signal_scratchpad_internal:write` scope rather than the wider `signal_scout_internal:write`, so the pipeline's research and implementation runs can persist what they judged without also getting `emit_signal` and `record_output`. Scouts keep both tools, because `SCOUT_INTERNAL_SCOPES` carries the scratchpad scope too; the pipeline's own postures are the `signals_research` / `signals_implementation` presets in `posthog/temporal/oauth.py`. `signals_research` withholds `task:write`: it turns the MCP read-only header off so its scratchpad tools survive, and that header was the only thing keeping the task-write toolset (report state included) away from a stage meant to read.diff --git a/products/signals/backend/scout_harness/tools/scratchpad.py b/products/signals/backend/scout_harness/tools/scratchpad.pyindex 61727f1d73e2..f59699ecf8ef 100644--- a/products/signals/backend/scout_harness/tools/scratchpad.py+++ b/products/signals/backend/scout_harness/tools/scratchpad.py@@ -81,9 +81,10 @@ def search_scratchpad(Expired entries (`expires_at` in the past) are excluded by default, so a memory ascout wrote as time-boxed stops loading into run prompts on its own rather thanwaiting for a `forget` that rarely comes. `include_expired=True` brings them back- for a human auditing what the fleet remembered and when it lapsed. Note this filters- the read only — nothing deletes the row, so `forget` and the `remember` upsert still- see an expired key.+ for a human auditing what the fleet remembered and when it lapsed. This filters the+ read only — while an entry is inside its post-expiry grace, `forget` and the+ `remember` upsert still see the key. Once the expiry is well past (see+ `prune_expired_scratchpad_entries`), the daily janitor hard-deletes the row.`key` is an exact match on the unique `(team, key)` pair — at most one row, and theonly way to fetch a known entry reliably. `text` can't stand in for it: an ILIKEdiff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.pyindex d7cefb616110..8d4b4e4293c5 100644--- a/products/signals/backend/scout_harness/views.py+++ b/products/signals/backend/scout_harness/views.py@@ -1225,7 +1225,8 @@ class SignalScratchpadViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):"`date_from` / `date_to` are a half-open window on `updated_at` (`>= date_from`, ""`< date_to`); pass `date_to` (the `updated_at` of the oldest entry seen) on subsequent calls ""to walk past the cap. Entries whose `expires_at` has passed are excluded unless "- "`include_expired=true`. Pass `keys_only=true` to scan keys without pulling entry bodies, or "+ "`include_expired=true`, and are hard-deleted by a daily janitor once their expiry is "+ "more than two weeks in the past. Pass `keys_only=true` to scan keys without pulling entry bodies, or ""`content_max_chars` to cap each `content` to a preview — both keep a wide orientation scan ""from returning every entry's full prose. Results capped at 1000."),diff --git a/products/signals/backend/tasks.py b/products/signals/backend/tasks.pyindex f068b97fd6be..94d2f4c51e22 100644--- a/products/signals/backend/tasks.py+++ b/products/signals/backend/tasks.py@@ -2,11 +2,13 @@ from datetime import timedeltafrom decimal import Decimalfrom django.core.cache import cache+from django.db import OperationalErrorfrom django.db.models import Qfrom django.utils import timezoneimport structlogfrom celery import shared_task+from celery.exceptions import SoftTimeLimitExceededfrom slack_sdk.errors import SlackApiErrorfrom posthog.cloud_utils import get_cached_instance_license@@ -27,6 +29,7 @@ from products.signals.backend.models import (SignalRepositoryAreaActivity,SignalScoutEmission,SignalScoutRun,+ SignalScratchpad,)from products.signals.backend.report_generation.repo_activity import (ACTIVITY_KEEP_WARM_WINDOW,@@ -596,6 +599,56 @@ def pause_inactive_signal_scouts() -> None:)+# Grace before a lapsed scratchpad entry is hard-deleted. Expiry already hides the row from scout+# searches; the grace keeps it readable through the `include_expired` audit path for two more weeks,+# so a human can still see what the fleet remembered and when it lapsed before the row is gone.+SCRATCHPAD_EXPIRY_GRACE_DAYS = 14+++def prune_expired_scratchpad_entries(grace_days: int = SCRATCHPAD_EXPIRY_GRACE_DAYS) -> int:+ """Hard-delete scratchpad rows whose `expires_at` passed more than `grace_days` ago.++ Cross-team janitor sweep. A durable entry (`expires_at` NULL) is the large majority of the+ store and is never touched — only a lapsed, time-boxed memory past its grace is removed.+ Returns the count deleted.+ """+ cutoff = timezone.now() - timedelta(days=grace_days)+ deleted, _ = (+ # nosemgrep: idor-lookup-without-team (system Celery janitor, no user input; unscoped is the sanctioned cross-team access)+ SignalScratchpad.objects.unscoped().filter(expires_at__isnull=False, expires_at__lt=cutoff).delete()+ )+ return deleted+++@shared_task(+ name="products.signals.backend.tasks.prune_expired_scratchpad_entries",+ ignore_result=True,+ max_retries=0,+ soft_time_limit=110,+ time_limit=170,+)+@skip_team_scope_audit+def prune_expired_scratchpad_entries_task() -> None:+ """Daily janitor: hard-delete scratchpad entries long past their expiry.++ A scout that writes a time-boxed memory almost never comes back to `forget` it, so expired+ rows would otherwise pile up forever — expiry only hides a row from searches, it never removed+ one. Runs here rather than on the coordinator's 30-minute tick, which stays bounded.+ """+ deleted = 0+ try:+ deleted = prune_expired_scratchpad_entries()+ except SoftTimeLimitExceeded:+ raise+ except OperationalError as exc:+ # A transient DB blip self-heals — the sweep runs again tomorrow — so don't page on it.+ logger.warning("signals_scout.scratchpad_prune_transient_db_error", error=str(exc))+ except Exception as exc:+ capture_exception(exc)+ logger.exception("signals_scout.scratchpad_prune_failed")+ logger.info("signals_scout scratchpad prune finished", deleted=deleted)++@shared_task(name="products.signals.backend.tasks.refresh_signal_repository_activity",ignore_result=True,diff --git a/products/signals/backend/test/test_scratchpad_retention.py b/products/signals/backend/test/test_scratchpad_retention.pynew file mode 100644index 000000000000..6aa8de804f28--- /dev/null+++ b/products/signals/backend/test/test_scratchpad_retention.py@@ -0,0 +1,31 @@+from datetime import timedelta++from posthog.test.base import BaseTest++from django.utils import timezone++from posthog.models.scoping import team_scope++from products.signals.backend.models import SignalScratchpad+from products.signals.backend.tasks import SCRATCHPAD_EXPIRY_GRACE_DAYS, prune_expired_scratchpad_entries+++class TestPruneExpiredScratchpadEntries(BaseTest):+ def test_prunes_only_entries_whose_expiry_is_past_the_grace(self) -> None:+ now = timezone.now()+ grace = timedelta(days=SCRATCHPAD_EXPIRY_GRACE_DAYS)+ with team_scope(self.team.id):+ SignalScratchpad.objects.create(team=self.team, key="durable", content="x", expires_at=None)+ SignalScratchpad.objects.create(team=self.team, key="live", content="x", expires_at=now + timedelta(days=1))+ SignalScratchpad.objects.create(+ team=self.team, key="within_grace", content="x", expires_at=now - timedelta(days=1)+ )+ SignalScratchpad.objects.create(+ team=self.team, key="past_grace", content="x", expires_at=now - grace - timedelta(days=1)+ )++ deleted = prune_expired_scratchpad_entries()++ assert deleted == 1+ survivors = set(SignalScratchpad.objects.unscoped().values_list("key", flat=True))+ assert survivors == {"durable", "live", "within_grace"}diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.tsindex dc54a1a7882c..3d507963767c 100644--- a/products/signals/frontend/generated/api.ts+++ b/products/signals/frontend/generated/api.ts@@ -1454,7 +1454,7 @@ export const getSignalsScoutScratchpadSearchUrl = (projectId: string, params?: S}/**- * Return `SignalScratchpad` entries for this project, newest-first. ILIKE matches on `content` and `key`; pass `key` instead for an exact single-entry lookup. `date_from` / `date_to` are a half-open window on `updated_at` (`>= date_from`, `< date_to`); pass `date_to` (the `updated_at` of the oldest entry seen) on subsequent calls to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`. Pass `keys_only=true` to scan keys without pulling entry bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation scan from returning every entry's full prose. Results capped at 1000.+ * Return `SignalScratchpad` entries for this project, newest-first. ILIKE matches on `content` and `key`; pass `key` instead for an exact single-entry lookup. `date_from` / `date_to` are a half-open window on `updated_at` (`>= date_from`, `< date_to`); pass `date_to` (the `updated_at` of the oldest entry seen) on subsequent calls to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`, and are hard-deleted by a daily janitor once their expiry is more than two weeks in the past. Pass `keys_only=true` to scan keys without pulling entry bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation scan from returning every entry's full prose. Results capped at 1000.* @summary Search the scout scratchpad*/export const signalsScoutScratchpadSearch = async (diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yamlindex bd580348b1b7..09f6316564f0 100644--- a/products/signals/mcp/tools.yaml+++ b/products/signals/mcp/tools.yaml@@ -882,8 +882,9 @@ tools:creator, so the last writer can differ. Pass `text` for a case-insensitive substring match on the entry's`content` and `key`. Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on`updated_at`) to scope to a window — set `date_to` to the `updated_at` of the oldest entry from the prior- page to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`.- Pass `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or+ page to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`,+ and a daily janitor hard-deletes them once their expiry is more than two weeks in the past. Pass+ `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or`content_max_chars` to cap each `content` to a preview — both keep a wide orientation/dedupe scan fromreturning every entry's full prose. Results capped at 1000.self-driving-inbox-get:diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex b28e96151e52..005218b87743 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -9695,7 +9695,7 @@}},"scout-scratchpad-search": {- "description": "Return `SignalScratchpad` entries for this project, newest first. The keyspace is shared by every agent that runs here — the scouts and the report pipeline's research and implementation stages — so search the identity of the thing you care about (an error id, a flag key, a page path, a file path, an event name) and not only your own key prefix. Each result carries `created_by_skill`, naming the entry's original creator — a scout's skill name or a pipeline stage (`pipeline:report-research`, `pipeline:implementation`); an upsert keeps the creator, so the last writer can differ. Pass `text` for a case-insensitive substring match on the entry's `content` and `key`. Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `updated_at`) to scope to a window — set `date_to` to the `updated_at` of the oldest entry from the prior page to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`. Pass `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation/dedupe scan from returning every entry's full prose. Results capped at 1000.",+ "description": "Return `SignalScratchpad` entries for this project, newest first. The keyspace is shared by every agent that runs here — the scouts and the report pipeline's research and implementation stages — so search the identity of the thing you care about (an error id, a flag key, a page path, a file path, an event name) and not only your own key prefix. Each result carries `created_by_skill`, naming the entry's original creator — a scout's skill name or a pipeline stage (`pipeline:report-research`, `pipeline:implementation`); an upsert keeps the creator, so the last writer can differ. Pass `text` for a case-insensitive substring match on the entry's `content` and `key`. Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `updated_at`) to scope to a window — set `date_to` to the `updated_at` of the oldest entry from the prior page to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`, and a daily janitor hard-deletes them once their expiry is more than two weeks in the past. Pass `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation/dedupe scan from returning every entry's full prose. Results capped at 1000.","category": "Signals","feature": "signals","summary": "Search the fleet scratchpad",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex b03ac1b6217f..486f63c24dc6 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -10250,7 +10250,7 @@}},"scout-scratchpad-search": {- "description": "Return `SignalScratchpad` entries for this project, newest first. The keyspace is shared by every agent that runs here — the scouts and the report pipeline's research and implementation stages — so search the identity of the thing you care about (an error id, a flag key, a page path, a file path, an event name) and not only your own key prefix. Each result carries `created_by_skill`, naming the entry's original creator — a scout's skill name or a pipeline stage (`pipeline:report-research`, `pipeline:implementation`); an upsert keeps the creator, so the last writer can differ. Pass `text` for a case-insensitive substring match on the entry's `content` and `key`. Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `updated_at`) to scope to a window — set `date_to` to the `updated_at` of the oldest entry from the prior page to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`. Pass `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation/dedupe scan from returning every entry's full prose. Results capped at 1000.",+ "description": "Return `SignalScratchpad` entries for this project, newest first. The keyspace is shared by every agent that runs here — the scouts and the report pipeline's research and implementation stages — so search the identity of the thing you care about (an error id, a flag key, a page path, a file path, an event name) and not only your own key prefix. Each result carries `created_by_skill`, naming the entry's original creator — a scout's skill name or a pipeline stage (`pipeline:report-research`, `pipeline:implementation`); an upsert keeps the creator, so the last writer can differ. Pass `text` for a case-insensitive substring match on the entry's `content` and `key`. Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `updated_at`) to scope to a window — set `date_to` to the `updated_at` of the oldest entry from the prior page to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`, and a daily janitor hard-deletes them once their expiry is more than two weeks in the past. Pass `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation/dedupe scan from returning every entry's full prose. Results capped at 1000.","category": "Signals","feature": "signals","summary": "Search the fleet scratchpad",diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 89c93216c931..5c69cd2a02f3 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -1940,7 +1940,7 @@ export const SignalsScoutRunsRecentEmissionsQueryParams = () => zod.object({})/**- * Return `SignalScratchpad` entries for this project, newest-first. ILIKE matches on `content` and `key`; pass `key` instead for an exact single-entry lookup. `date_from` / `date_to` are a half-open window on `updated_at` (`>= date_from`, `< date_to`); pass `date_to` (the `updated_at` of the oldest entry seen) on subsequent calls to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`. Pass `keys_only=true` to scan keys without pulling entry bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation scan from returning every entry's full prose. Results capped at 1000.+ * Return `SignalScratchpad` entries for this project, newest-first. ILIKE matches on `content` and `key`; pass `key` instead for an exact single-entry lookup. `date_from` / `date_to` are a half-open window on `updated_at` (`>= date_from`, `< date_to`); pass `date_to` (the `updated_at` of the oldest entry seen) on subsequent calls to walk past the cap. Entries whose `expires_at` has passed are excluded unless `include_expired=true`, and are hard-deleted by a daily janitor once their expiry is more than two weeks in the past. Pass `keys_only=true` to scan keys without pulling entry bodies, or `content_max_chars` to cap each `content` to a preview — both keep a wide orientation scan from returning every entry's full prose. Results capped at 1000.* @summary Search the scout scratchpad*/export const SignalsScoutScratchpadSearchParams = () => zod.object({