: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
fix(signals): stop losing a scratchpad write over an unusable expiry (#95588)
posthog[bot]06571ef70738
diff --git a/products/signals/backend/scout_harness/AGENTS.md b/products/signals/backend/scout_harness/AGENTS.mdindex de483392033c..d454b7879eca 100644--- a/products/signals/backend/scout_harness/AGENTS.md+++ b/products/signals/backend/scout_harness/AGENTS.md@@ -44,7 +44,7 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e`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 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.+ `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. A best-effort field must also present as a plain string in the OpenAPI schema — `_BestEffortDateTimeField` carries `@extend_schema_field(OpenApiTypes.STR)`, and codegen strips the `uuid` format for `_BestEffortUUIDField`. A `format` keyword makes the generated MCP client refuse the value before the request leaves the caller, so the tolerance never runs and the write is lost anyway.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.Those stages have no `SignalScoutRun`, so `created_by_run` cannot name them. They stamp `SignalScratchpad.created_by_identity` instead — a `pipeline:*` string from `../pipeline_identity.py`, resolved server-side from the token's bound task (its `ai_stage`, written once at run creation) rather than passed in, since a writer that could name itself could name a scout's skill. `_to_entry` reads it as `created_by_skill` when there is no run, so `scout-scratchpad-search` attributes every entry the same way. Like `created_by_run` it is written on create only, so an upsert keeps the original author.- `notes.py` — `list_notes` / `leave_note` / `delete_note` backed by the `SignalScoutNote` model: steering notes humans (or other agents) leave for the fleet over the public MCP surface (`scout-notes-*` tools), the inbound counterpart to the scratchpad. A note targets one scout by `skill_name` or the whole fleet (blank), optionally expiring via `expires_at`; the run prompt's _Notes left for you_ section directs every scout to `scout-notes-list` its own notes in step 1 and treat them as advisory steering. A third audience is a stage of the report pipeline, addressed through the reserved `pipeline:*` family (`PIPELINE_AUDIENCES`, holding `pipeline:report-research` today): a pseudo-target riding the same `skill_name` column, allowlisted at write time so an unrecognized one is rejected instead of silently steering no one, and skipping the scout-skill lookup because a stage has no `LLMSkill` row. `list_notes` matches `skill_name` exactly, so no scout ever sees a pipeline note; the research loader in `../report_steering.py` reads `pipeline:report-research` alongside the report's scout target and the fleet-wide blanks. `validate_note_target`, the shared write-time rule, and the audience constants live in `../note_targets.py`, an import-light module, because the Django admin form calls the rule at registry load and importing anything under `tools/` runs that package's `__init__`, which pulls in every harness tool. Unlike the scratchpad there is no sandbox-only write gate, but writes still demand skill-authoring-level authorization (keys need `llm_skill:write` on top of `signal_scout:write`, and every writer must clear the `llm_skill` RBAC editor bar) — so a note-writer could already steer the fleet by editing its skills, and notes add no new steering power. Four more writers derive rows from inbox activity. `../dismissal_notes.py`: judging an inbox report with a note (dismiss, snooze, or restore) also leaves it here as an `origin=report_dismissal` note, targeted at the scout that authored the report, so a reviewer's verdict reaches the scout without it having to re-find the report. Resolving does not, since that says the report did its job rather than that filing it was wrong. `../discussion_notes.py`: opening a discussion on a report (the inbox "Discuss" action, which kicks off a Q&A task) also leaves the user's question here as an `origin=report_discussion` note, targeted at the authoring scout — framed as context to weigh or ignore, not a verdict, so the scout can fold a durable preference/correction into its scratchpad or dismiss it as noise. `../feedback_notes.py`: the thumbs rating at the end of a report body ("Was this report useful?") carries its optional note here as an `origin=report_feedback` note, targeted at the authoring scout. Unlike a dismissal it never falls back to a fleet-wide note — feedback is a verdict on one scout's own report, so with no resolvable authoring scout nothing is forwarded and the call is a no-op — and it never changes the report's state; the analytics event the client fires stays the durable record of the rating. `../reviewer_correction_notes.py`: a user-attributed reviewer edit that changes the set (adding or removing a suggested reviewer) also leaves an `origin=report_reviewer_correction` note, and it is the only derived origin addressed to more than one scout — every live scout that emitted or edited the report (`resolve_touching_scout_skills`, since an editing scout may be the one that put the reviewers there) plus every scout whose `reviewer:` memory names a removed login (`_memory_holders`, one exact-term search under the `reviewer:` key prefix), ordered emitting scout first and capped at `MAX_NOTE_TARGETS`, so a scout still routing on a stale login hears about the correction. A report no live scout touched falls back to the fleet-wide blank dismissals use, but only when no holder resolved, since a run reads the fleet-wide notes alongside its own and a holder would hear the same edit twice. An impersonated edit forwards nothing, matching the reviewer-corrections project profile, which excludes impersonated activity rows for the same reason. Logins are shape-checked against GitHub's login rule before rendering and capped per edit (`MAX_CORRECTION_LOGINS`), because both write paths into the reviewers artefact accept any string of any length and the value lands in a backtick span every scout reads. Repeated edits coalesce: a login already sent to a target in the same direction inside `SUPPRESSION_WINDOW` is left out of the next note, keyed on direction so a removal still corrects an addition made hours earlier. Like a dismissal it may fall back fleet-wide, and unlike discuss/feedback it does not demand the `signal_scout:write` / `llm_skill:write` key scopes, because the logins already reach scouts through the report's reviewers artefact and the project profile. All four paths re-check the same steering gate (token `scoped_teams`, canonical-project access, and the `llm_skill` editor bar) since the dismiss, discuss, feedback, and reviewer-edit actions need only `task:write`, and all forward only on the canonical team. The discuss and feedback paths additionally demand the `signal_scout:write` / `llm_skill:write` key scopes: a dismissal's text reaches runs anyway through the reports API, whereas the note is the only path a discussion question or feedback note takes to a scout, so a `task:write` credential must not open it alone. The discuss path is triggered from the tasks viewset (which holds the request the gate reads) through `facade/api.py:forward_report_discussion_note`, never from the tasks facade. On the read side, every derived origin quotes report content (report id, title, the note text), so `SignalScoutNoteViewSet.list` withholds them from any caller failing the reports read gate (`_may_read_reports`); both that gate and `../report_steering.py` read the list off `SignalScoutNote.derived_origins()` rather than naming the kinds, so a newly added origin is withheld from the moment it exists. The derived rows are context with a TTL; the `dismissal` artefact / discussion task / feedback analytics event / reviewer `suggested_reviewers` artefact + `suggested_reviewers_changed` activity-log row stays the record of truth. Notes reach two surfaces outside the fleet, both through `../report_steering.py`. `load_report_steering` renders the `HUMAN`-origin ones into the description of the self-driving implementation task, so steering that used to stop at the scout also reaches the run that writes the code; the derived origins are withheld there for the reason the read gate withholds them — they quote report content, which is built from raw product data, and that run can open a PR. `load_research_steering` renders every origin into the pipeline's report-research prompt, because the derived ones are feedback on exactly the judgment that stage is about to make; that run is read-only, already holds the report's raw signals, and writes back only to the report on the same team.diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.pyindex f9b400579ce1..d41a9346e054 100644--- a/products/signals/backend/scout_harness/serializers.py+++ b/products/signals/backend/scout_harness/serializers.py@@ -775,6 +775,7 @@ class SearchMemoryQuerySerializer(serializers.Serializer):)+@extend_schema_field(OpenApiTypes.STR)class _BestEffortDateTimeField(serializers.DateTimeField):"""A `DateTimeField` that never fails the request on an unparseable value.@@ -782,6 +783,11 @@ class _BestEffortDateTimeField(serializers.DateTimeField):writes carry a malformed or nonsense datetime. The expiry is optional metadata; the content isthe memory worth keeping. Coerce an unparseable value to `None` (durable) instead of rejectingthe whole write — the same best-effort stance `run_id` takes on this serializer.++ The field presents as a plain string, not `format: date-time`, so this tolerance can run. A+ `date-time` format makes the generated MCP client reject an offset-less datetime or a bare date+ before the request leaves the caller, and the write is lost one layer above this code — the+ same reason `_BestEffortUUIDField` works, where the `uuid` format is stripped during codegen."""def run_validation(self, data: Any = empty) -> datetime | None:@@ -993,19 +999,22 @@ class ScoutNoteCreateRequestSerializer(serializers.Serializer):"and no scout. Omit or leave blank for a general note every scout sees."),)- expires_at = serializers.DateTimeField(+ expires_at = _BestEffortDateTimeField(required=False,allow_null=True,help_text=("Optional ISO-8601 expiry. After this time the note drops out of the default list view, ""so time-boxed steering ('watch closely this week') retires itself. Omit for a note that "- "stays active until deleted."+ "stays active until deleted. Best-effort — a value that can't be parsed or is already in "+ "the past is dropped (the note stays active), not rejected, so the note is never lost."),)def validate_expires_at(self, value: datetime | None) -> datetime | None:+ # A past expiry would hide the note the moment it lands. Drop it rather than rejecting the+ # whole call — the steering prose is what the author came to write, the expiry is not.if value is not None and value <= timezone.now():- raise serializers.ValidationError("expires_at must be in the future")+ return Nonereturn valuediff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.pyindex 39aaee8eff51..90955e6468f8 100644--- a/products/signals/backend/test/test_scout_harness_api.py+++ b/products/signals/backend/test/test_scout_harness_api.py@@ -1,6 +1,6 @@from __future__ import annotations-from datetime import datetime, timedelta+from datetime import UTC, datetime, timedeltafrom decimal import Decimalfrom typing import TYPE_CHECKINGfrom uuid import UUID, uuid4@@ -1627,6 +1627,27 @@ class TestScoutHarnessScratchpadAPI(APIBaseTest):assert response.status_code == status.HTTP_200_OKrow = SignalScratchpad.objects.get(team=self.team, key="k1")assert row.expires_at is None+ assert row.content == "v"++ @parameterized.expand(+ [+ # The agent writes the expiry from a clock it can only guess at, so it often omits the+ # UTC offset or gives the date alone. Both read as a valid instant in the project's+ # timezone. Each used to be refused at the client boundary, which cost the whole write.+ ("no_offset", "2035-10-05T09:30:00", datetime(2035, 10, 5, 9, 30, tzinfo=UTC)),+ ("bare_date", "2035-10-05", datetime(2035, 10, 5, 0, 0, tzinfo=UTC)),+ ]+ )+ def test_remember_honors_an_expiry_that_names_no_offset(+ self, _name: str, expires_at: str, expected: datetime+ ) -> None:+ response = self.client.post(+ self._list_url(),+ data={"key": "k1", "content": "v", "expires_at": expires_at},+ format="json",+ )+ assert response.status_code == status.HTTP_200_OK+ assert SignalScratchpad.objects.get(team=self.team, key="k1").expires_at == expecteddef test_search_does_not_leak_other_teams_memory(self) -> None:other = Team.objects.create(organization=self.organization, name="Other")@@ -1843,8 +1864,6 @@ class TestScoutHarnessNotesAPI(APIBaseTest):# Same reasoning for the pipeline family: it is an allowlist, not a free-form prefix,# so a stage that reads no notes cannot be addressed.("unknown_pipeline_audience", {"content": "note", "skill_name": "pipeline:implementation"}),- # A note born expired would never be seen by anyone.- ("past_expiry", {"content": "note", "expires_at": "2020-01-01T00:00:00Z"}),("blank_content", {"content": " ", "skill_name": ""}),])@@ -1853,6 +1872,25 @@ class TestScoutHarnessNotesAPI(APIBaseTest):assert response.status_code == status.HTTP_400_BAD_REQUESTassert not SignalScoutNote.objects.filter(team=self.team).exists()+ @parameterized.expand(+ [+ # A note born expired would never be seen by anyone, so the expiry goes and the note+ # stays. Same stance for a value no clock can read.+ ("past", "2020-01-01T00:00:00Z"),+ ("malformed", "next Friday"),+ ]+ )+ def test_create_drops_invalid_expiry_without_losing_the_note(self, _name: str, expires_at: str) -> None:+ response = self.client.post(+ self._list_url(),+ data={"content": "watch checkout", "expires_at": expires_at},+ format="json",+ )+ assert response.status_code == status.HTTP_201_CREATED+ note = SignalScoutNote.objects.get(team=self.team)+ assert note.expires_at is None+ assert note.content == "watch checkout"+def test_notes_do_not_leak_across_teams(self) -> None:# Cross-team rows go through `all_teams`: the fail-closed `objects` manager is pinned# to `self.team` inside the test, so an `objects.filter(team=other)` is always empty.diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 67e5f70a118e..40ca0bf16a78 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -2603,7 +2603,7 @@ export interface ScoutNoteCreateRequestApi {*/skill_name?: string/**- * Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted.+ * Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted. Best-effort — a value that can't be parsed or is already in the past is dropped (the note stays active), not rejected, so the note is never lost.* @nullable*/expires_at?: string | nulldiff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.tsindex 7d2288f912ed..6a3b57c3ecec 100644--- a/products/signals/frontend/generated/api.zod.ts+++ b/products/signals/frontend/generated/api.zod.ts@@ -980,11 +980,11 @@ export const SignalsScoutNotesCreateBody = /* @__PURE__ */ zod.describe('Address the note to one scout by its skill name (`signals-scout-\*`, exact match against an existing scout skill on the project — check `scout-config-list` for the roster), or to one stage of the report pipeline by its reserved audience (`pipeline:report-research`). Use a pipeline audience for guidance about how reports get researched rather than about what the scouts watch, so it reaches that stage and no scout. Omit or leave blank for a general note every scout sees.'),- expires_at: zod.iso- .datetime({ offset: true })+ expires_at: zod+ .string().nullish().describe(- "Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted."+ "Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted. Best-effort — a value that can't be parsed or is already in the past is dropped (the note stays active), not rejected, so the note is never lost."),}).describe('Request body for `notes-create`.')@@ -1557,8 +1557,8 @@ export const SignalsScoutScratchpadRememberBody = /* @__PURE__ */ zod.describe("Run that authored this memory; persisted as `created_by_run_id` for lineage. Best-effort — a `run_id` that is unparseable, or that isn't a run on this project, is dropped rather than rejected, so the memory write is never lost. Omit it and the lineage still lands: a write from a scout sandbox is attributed to that sandbox's own run."),- expires_at: zod.iso- .datetime({ offset: true })+ expires_at: zod+ .string().nullish().describe("Optional ISO-8601 expiry for a memory that's only true for a while (a cooldown, a window you're watching). After this time the entry drops out of searches, so you don't have to come back and forget it. Omit for a durable memory — every write sets the whole entry, so omitting it on a later write clears an expiry set earlier. Best-effort — a value that can't be parsed or is already in the past is dropped (the memory stays durable), not rejected, so the memory write is never lost."diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex edde270be0eb..28745fba1bb3 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -77941,7 +77941,7 @@ export namespace Schemas {*/skill_name?: string;/**- * Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted.+ * Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted. Best-effort — a value that can't be parsed or is already in the past is dropped (the note stays active), not rejected, so the note is never lost.* @nullable*/expires_at?: string | null;diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 57ecc238de1a..3ce5403745de 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -1288,11 +1288,11 @@ export const SignalsScoutNotesCreateBody = () => zod.describe('Address the note to one scout by its skill name (`signals-scout-\*`, exact match against an existing scout skill on the project — check `scout-config-list` for the roster), or to one stage of the report pipeline by its reserved audience (`pipeline:report-research`). Use a pipeline audience for guidance about how reports get researched rather than about what the scouts watch, so it reaches that stage and no scout. Omit or leave blank for a general note every scout sees.'),- expires_at: zod.iso- .datetime({ offset: true })+ expires_at: zod+ .string().nullish().describe(- "Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted."+ "Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted. Best-effort — a value that can't be parsed or is already in the past is dropped (the note stays active), not rejected, so the note is never lost."),}).describe('Request body for `notes-create`.')@@ -2089,8 +2089,8 @@ export const SignalsScoutScratchpadRememberBody = () => zod.describe("Run that authored this memory; persisted as `created_by_run_id` for lineage. Best-effort — a `run_id` that is unparseable, or that isn't a run on this project, is dropped rather than rejected, so the memory write is never lost. Omit it and the lineage still lands: a write from a scout sandbox is attributed to that sandbox's own run."),- expires_at: zod.iso- .datetime({ offset: true })+ expires_at: zod+ .string().nullish().describe("Optional ISO-8601 expiry for a memory that's only true for a while (a cooldown, a window you're watching). After this time the entry drops out of searches, so you don't have to come back and forget it. Omit for a durable memory — every write sets the whole entry, so omitting it on a later write clears an expiry set earlier. Best-effort — a value that can't be parsed or is already in the past is dropped (the memory stays durable), not rejected, so the memory write is never lost."diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-notes-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-notes-create.jsonindex 82043ce9b41c..7d6de1eb3841 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-notes-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-notes-create.json@@ -10,15 +10,13 @@"expires_at": {"anyOf": [{- "format": "date-time",- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type": "string"},{"type": "null"}],- "description": "Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted."+ "description": "Optional ISO-8601 expiry. After this time the note drops out of the default list view, so time-boxed steering ('watch closely this week') retires itself. Omit for a note that stays active until deleted. Best-effort — a value that can't be parsed or is already in the past is dropped (the note stays active), not rejected, so the note is never lost."},"skill_name": {"description": "Address the note to one scout by its skill name (`signals-scout-*`, exact match against an existing scout skill on the project — check `scout-config-list` for the roster), or to one stage of the report pipeline by its reserved audience (`pipeline:report-research`). Use a pipeline audience for guidance about how reports get researched rather than about what the scouts watch, so it reaches that stage and no scout. Omit or leave blank for a general note every scout sees.",diff --git a/services/mcp/tests/unit/schema.signals-expires-at.test.ts b/services/mcp/tests/unit/schema.signals-expires-at.test.tsnew file mode 100644index 000000000000..7d131c58c107--- /dev/null+++ b/services/mcp/tests/unit/schema.signals-expires-at.test.ts@@ -0,0 +1,22 @@+import { describe, expect, it } from 'vitest'++import { SignalsScoutNotesCreateBody, SignalsScoutScratchpadRememberBody } from '@/generated/signals/api'++// Regression guard: the pipeline agents compute `expires_at` from a clock they can only guess at,+// so a share of writes carry a datetime with no UTC offset. The server reads that shape fine, but+// only if it arrives. A `format: date-time` on the field makes codegen emit+// `zod.iso.datetime({ offset: true })`, which refuses the value here and loses the whole write.+describe('Signals expires_at boundary tolerance', () => {+ it.each([+ ['scout-scratchpad-remember', SignalsScoutScratchpadRememberBody],+ ['scout-notes-create', SignalsScoutNotesCreateBody],+ ] as const)('accepts an expiry that names no offset through %s', (_label, body) => {+ const result = body().safeParse({+ key: 'pattern:impl:example',+ content: 'a memory worth keeping',+ expires_at: '2035-10-05T00:00:00',+ })++ expect(result.success).toBe(true)+ })+})