From 43dfb44b3ee288e1cd6644336a3cf7fec802c599 Mon Sep 17 00:00:00 2001 From: caballeto Date: Wed, 29 Apr 2026 18:29:12 +0200 Subject: [PATCH] chore(forensics): refresh types after mono details JSONB + reason cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picks up two changes from devhelmhq/mono#316: - IncidentStateTransitionDto gains a `details: Record` field. User-driven transitions carry `details.source = "public-api"`; pipeline-driven ones carry `details.source = "pipeline"`. Lets the forensics command distinguish actor without forking the reason vocabulary. - The transition `reason` description switches from the seven-name proposal ("rule_matched | confirmation_met | …") to the five verbs the engine actually writes ("trigger | confirm | resolve | auto_clear | reopen"). No code referenced `manually_resolved` directly — it was only echoed in the schema description string — so this is a doc/comment-level refresh. Pure regen: docs/openapi/monitoring-api.json copied from mono main, then `npm run build` (typegen + zodgen + descgen). No hand edits. Made-with: Cursor --- docs/openapi/monitoring-api.json | 31 ++++++++++++++++++++++++++----- src/lib/api-zod.generated.ts | 5 +++++ src/lib/api.generated.ts | 19 ++++++++++++++----- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/docs/openapi/monitoring-api.json b/docs/openapi/monitoring-api.json index 0ce2ea6..41903c1 100644 --- a/docs/openapi/monitoring-api.json +++ b/docs/openapi/monitoring-api.json @@ -25631,24 +25631,24 @@ }, "triggeringCheckId": { "type": "string", - "description": "Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions", + "description": "Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions. Omitted from JSON (undefined to SDKs) when null, treat missing as null.", "format": "uuid", "nullable": true }, "triggeredByRuleSnapshotHashHex": { "type": "string", - "description": "Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule", + "description": "Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule. Omitted from JSON when null, treat missing as null.", "nullable": true }, "triggeredByRuleIndex": { "type": "integer", - "description": "Index of the fired rule inside the policy's trigger_rules array", + "description": "Index of the fired rule inside the policy's trigger_rules array. Omitted from JSON when null, treat missing as null.", "format": "int32", "nullable": true }, "engineVersion": { "type": "string", - "description": "Detection engine semver that evaluated the rule", + "description": "Detection engine semver that evaluated the rule. Omitted from JSON when null, treat missing as null.", "nullable": true } }, @@ -25864,6 +25864,7 @@ "required": [ "affectedRegions", "checkId", + "details", "engineVersion", "fromStatus", "id", @@ -25910,7 +25911,7 @@ "reason": { "minLength": 1, "type": "string", - "description": "Why the transition fired (rule_matched | confirmation_met | auto_cleared_by_timeout | recovery_met | reopened | manually_resolved | policy_changed)" + "description": "Why the transition fired (trigger | confirm | resolve | auto_clear | reopen)" }, "triggeringEvaluationIds": { "type": "array", @@ -25943,6 +25944,9 @@ "type": "string", "description": "Scheduler-minted check execution ID (V92) of the triggering result", "format": "uuid" + }, + "details": { + "$ref": "#/components/schemas/StateTransitionDetails" } }, "description": "State-machine transitions this check caused (may be empty if nothing fired)" @@ -30579,6 +30583,23 @@ "minDaysRemaining" ] }, + "StateTransitionDetails": { + "required": [ + "source" + ], + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Actor that produced this transition (pipeline | public-api)", + "enum": [ + "pipeline", + "public-api" + ] + } + }, + "description": "Typed metadata about this transition (currently: actor source)" + }, "StatusCodeAssertion": { "required": [ "type", diff --git a/src/lib/api-zod.generated.ts b/src/lib/api-zod.generated.ts index a7f5d68..c26bc1f 100644 --- a/src/lib/api-zod.generated.ts +++ b/src/lib/api-zod.generated.ts @@ -1644,6 +1644,9 @@ const RuleEvaluationDto = z triggeringTransitionId: z.string().uuid().nullish(), }) .strict(); +const StateTransitionDetails = z + .object({ source: z.enum(["pipeline", "public-api"]) }) + .strict(); const IncidentStateTransitionDto = z .object({ id: z.string().uuid(), @@ -1658,6 +1661,7 @@ const IncidentStateTransitionDto = z policySnapshotHashHex: z.string().min(1), engineVersion: z.string().min(1), checkId: z.string().uuid(), + details: StateTransitionDetails, }) .strict(); const PolicySnapshotDto = z @@ -3479,6 +3483,7 @@ export const schemas = { CheckResultDetailsDto, CheckResultDto, RuleEvaluationDto, + StateTransitionDetails, IncidentStateTransitionDto, PolicySnapshotDto, CheckTraceDto, diff --git a/src/lib/api.generated.ts b/src/lib/api.generated.ts index 06dea22..e3b9275 100644 --- a/src/lib/api.generated.ts +++ b/src/lib/api.generated.ts @@ -4245,17 +4245,17 @@ export interface components { resourceGroupName?: string | null; /** * Format: uuid - * @description Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions + * @description Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions. Omitted from JSON (undefined to SDKs) when null, treat missing as null. */ triggeringCheckId?: string | null; - /** @description Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule */ + /** @description Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule. Omitted from JSON when null, treat missing as null. */ triggeredByRuleSnapshotHashHex?: string | null; /** * Format: int32 - * @description Index of the fired rule inside the policy's trigger_rules array + * @description Index of the fired rule inside the policy's trigger_rules array. Omitted from JSON when null, treat missing as null. */ triggeredByRuleIndex?: number | null; - /** @description Detection engine semver that evaluated the rule */ + /** @description Detection engine semver that evaluated the rule. Omitted from JSON when null, treat missing as null. */ engineVersion?: string | null; }; IncidentFilterParams: { @@ -4406,7 +4406,7 @@ export interface components { fromStatus: string; /** @description New status (WATCHING | TRIGGERED | CONFIRMED | RESOLVED) */ toStatus: string; - /** @description Why the transition fired (rule_matched | confirmation_met | auto_cleared_by_timeout | recovery_met | reopened | manually_resolved | policy_changed) */ + /** @description Why the transition fired (trigger | confirm | resolve | auto_clear | reopen) */ reason: string; /** @description rule_evaluation ids that caused this transition (may be empty for timeout-driven edges) */ triggeringEvaluationIds: string[]; @@ -4421,6 +4421,7 @@ export interface components { * @description Scheduler-minted check execution ID (V92) of the triggering result */ checkId: string; + details: components["schemas"]["StateTransitionDetails"]; }; IncidentTimelineDto: { /** @description State-machine transitions in chronological order */ @@ -6308,6 +6309,14 @@ export interface components { */ minDaysRemaining: number; }; + /** @description Typed metadata about this transition (currently: actor source) */ + StateTransitionDetails: { + /** + * @description Actor that produced this transition (pipeline | public-api) + * @enum {string} + */ + source: "pipeline" | "public-api"; + }; StatusCodeAssertion: { /** @enum {string} */ type: "status_code";