Skip to content

Commit d3bcb97

Browse files
authored
Merge pull request #20 from devhelmhq/chore/forensics-details-field
chore(forensics): refresh types after mono details JSONB + reason cleanup
2 parents 37ab3aa + 43dfb44 commit d3bcb97

3 files changed

Lines changed: 45 additions & 10 deletions

File tree

docs/openapi/monitoring-api.json

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25631,24 +25631,24 @@
2563125631
},
2563225632
"triggeringCheckId": {
2563325633
"type": "string",
25634-
"description": "Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions",
25634+
"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.",
2563525635
"format": "uuid",
2563625636
"nullable": true
2563725637
},
2563825638
"triggeredByRuleSnapshotHashHex": {
2563925639
"type": "string",
25640-
"description": "Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule",
25640+
"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.",
2564125641
"nullable": true
2564225642
},
2564325643
"triggeredByRuleIndex": {
2564425644
"type": "integer",
25645-
"description": "Index of the fired rule inside the policy's trigger_rules array",
25645+
"description": "Index of the fired rule inside the policy's trigger_rules array. Omitted from JSON when null, treat missing as null.",
2564625646
"format": "int32",
2564725647
"nullable": true
2564825648
},
2564925649
"engineVersion": {
2565025650
"type": "string",
25651-
"description": "Detection engine semver that evaluated the rule",
25651+
"description": "Detection engine semver that evaluated the rule. Omitted from JSON when null, treat missing as null.",
2565225652
"nullable": true
2565325653
}
2565425654
},
@@ -25864,6 +25864,7 @@
2586425864
"required": [
2586525865
"affectedRegions",
2586625866
"checkId",
25867+
"details",
2586725868
"engineVersion",
2586825869
"fromStatus",
2586925870
"id",
@@ -25910,7 +25911,7 @@
2591025911
"reason": {
2591125912
"minLength": 1,
2591225913
"type": "string",
25913-
"description": "Why the transition fired (rule_matched | confirmation_met | auto_cleared_by_timeout | recovery_met | reopened | manually_resolved | policy_changed)"
25914+
"description": "Why the transition fired (trigger | confirm | resolve | auto_clear | reopen)"
2591425915
},
2591525916
"triggeringEvaluationIds": {
2591625917
"type": "array",
@@ -25943,6 +25944,9 @@
2594325944
"type": "string",
2594425945
"description": "Scheduler-minted check execution ID (V92) of the triggering result",
2594525946
"format": "uuid"
25947+
},
25948+
"details": {
25949+
"$ref": "#/components/schemas/StateTransitionDetails"
2594625950
}
2594725951
},
2594825952
"description": "State-machine transitions this check caused (may be empty if nothing fired)"
@@ -30579,6 +30583,23 @@
3057930583
"minDaysRemaining"
3058030584
]
3058130585
},
30586+
"StateTransitionDetails": {
30587+
"required": [
30588+
"source"
30589+
],
30590+
"type": "object",
30591+
"properties": {
30592+
"source": {
30593+
"type": "string",
30594+
"description": "Actor that produced this transition (pipeline | public-api)",
30595+
"enum": [
30596+
"pipeline",
30597+
"public-api"
30598+
]
30599+
}
30600+
},
30601+
"description": "Typed metadata about this transition (currently: actor source)"
30602+
},
3058230603
"StatusCodeAssertion": {
3058330604
"required": [
3058430605
"type",

src/lib/api-zod.generated.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,9 @@ const RuleEvaluationDto = z
16441644
triggeringTransitionId: z.string().uuid().nullish(),
16451645
})
16461646
.strict();
1647+
const StateTransitionDetails = z
1648+
.object({ source: z.enum(["pipeline", "public-api"]) })
1649+
.strict();
16471650
const IncidentStateTransitionDto = z
16481651
.object({
16491652
id: z.string().uuid(),
@@ -1658,6 +1661,7 @@ const IncidentStateTransitionDto = z
16581661
policySnapshotHashHex: z.string().min(1),
16591662
engineVersion: z.string().min(1),
16601663
checkId: z.string().uuid(),
1664+
details: StateTransitionDetails,
16611665
})
16621666
.strict();
16631667
const PolicySnapshotDto = z
@@ -3479,6 +3483,7 @@ export const schemas = {
34793483
CheckResultDetailsDto,
34803484
CheckResultDto,
34813485
RuleEvaluationDto,
3486+
StateTransitionDetails,
34823487
IncidentStateTransitionDto,
34833488
PolicySnapshotDto,
34843489
CheckTraceDto,

src/lib/api.generated.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4245,17 +4245,17 @@ export interface components {
42454245
resourceGroupName?: string | null;
42464246
/**
42474247
* Format: uuid
4248-
* @description Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions
4248+
* @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.
42494249
*/
42504250
triggeringCheckId?: string | null;
4251-
/** @description Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule */
4251+
/** @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. */
42524252
triggeredByRuleSnapshotHashHex?: string | null;
42534253
/**
42544254
* Format: int32
4255-
* @description Index of the fired rule inside the policy's trigger_rules array
4255+
* @description Index of the fired rule inside the policy's trigger_rules array. Omitted from JSON when null, treat missing as null.
42564256
*/
42574257
triggeredByRuleIndex?: number | null;
4258-
/** @description Detection engine semver that evaluated the rule */
4258+
/** @description Detection engine semver that evaluated the rule. Omitted from JSON when null, treat missing as null. */
42594259
engineVersion?: string | null;
42604260
};
42614261
IncidentFilterParams: {
@@ -4406,7 +4406,7 @@ export interface components {
44064406
fromStatus: string;
44074407
/** @description New status (WATCHING | TRIGGERED | CONFIRMED | RESOLVED) */
44084408
toStatus: string;
4409-
/** @description Why the transition fired (rule_matched | confirmation_met | auto_cleared_by_timeout | recovery_met | reopened | manually_resolved | policy_changed) */
4409+
/** @description Why the transition fired (trigger | confirm | resolve | auto_clear | reopen) */
44104410
reason: string;
44114411
/** @description rule_evaluation ids that caused this transition (may be empty for timeout-driven edges) */
44124412
triggeringEvaluationIds: string[];
@@ -4421,6 +4421,7 @@ export interface components {
44214421
* @description Scheduler-minted check execution ID (V92) of the triggering result
44224422
*/
44234423
checkId: string;
4424+
details: components["schemas"]["StateTransitionDetails"];
44244425
};
44254426
IncidentTimelineDto: {
44264427
/** @description State-machine transitions in chronological order */
@@ -6308,6 +6309,14 @@ export interface components {
63086309
*/
63096310
minDaysRemaining: number;
63106311
};
6312+
/** @description Typed metadata about this transition (currently: actor source) */
6313+
StateTransitionDetails: {
6314+
/**
6315+
* @description Actor that produced this transition (pipeline | public-api)
6316+
* @enum {string}
6317+
*/
6318+
source: "pipeline" | "public-api";
6319+
};
63116320
StatusCodeAssertion: {
63126321
/** @enum {string} */
63136322
type: "status_code";

0 commit comments

Comments
 (0)