From 4b8cea3915abf8b1b5c6a99a8fe72e595b302659 Mon Sep 17 00:00:00 2001 From: caballeto Date: Tue, 8 Sep 2026 17:12:05 +0200 Subject: [PATCH] fix: pin monitor YAML snapshot to known update fields Required breaks CLI typecheck after spec regen adds optional keys. Pick the YAML-managed fields so additive DTO properties stay non-events. Co-authored-by: Cursor --- src/lib/yaml/handlers.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/lib/yaml/handlers.ts b/src/lib/yaml/handlers.ts index 84e035d..2d678b2 100644 --- a/src/lib/yaml/handlers.ts +++ b/src/lib/yaml/handlers.ts @@ -703,10 +703,28 @@ const resourceGroupHandler = defineHandler> +// YAML-managed update fields only. Do not Required<> the whole UpdateMonitorRequest +// — additive optional keys (capturePolicy, package, status, …) must not break +// snapshot constructors after spec regen (evolution harness). +type MonitorSnapshotKeys = + | 'name' + | 'config' + | 'frequencySeconds' + | 'enabled' + | 'regions' + | 'environmentId' + | 'assertions' + | 'auth' + | 'incidentPolicy' + | 'alertChannelIds' + | 'tags' +type MonitorUpdateFields = Omit< + Schemas['UpdateMonitorRequest'], + 'clearEnvironmentId' | 'clearAuth' | 'managedBy' +> +type MonitorSnapshotBase = Required< + Pick> +> type MonitorSnapshot = Omit & { auth: MonitorSnapshotBase['auth'] | null incidentPolicy: MonitorSnapshotBase['incidentPolicy'] | null