Skip to content

chore(forensics): refresh types after mono details JSONB + reason cleanup#12

Merged
caballeto merged 1 commit into
mainfrom
chore/forensics-details-field
May 1, 2026
Merged

chore(forensics): refresh types after mono details JSONB + reason cleanup#12
caballeto merged 1 commit into
mainfrom
chore/forensics-details-field

Conversation

@caballeto
Copy link
Copy Markdown
Contributor

Summary

Picks up the schema changes from devhelmhq/mono#316:

  • IncidentStateTransitionDto.details: dict[str, Any] added. Distinguishes actor (pipeline vs public-api) without forking the reason vocabulary.
  • reason description aligned with what the engine actually writes: trigger | confirm | resolve | auto_clear | reopen. The earlier manually_resolved was a parallel reason for the same logical edge — replaced by reason="resolve" + details["source"]="public-api".

What's in this PR

Pure regen via ./scripts/typegen.sh:

  1. docs/openapi/monitoring-api.json copied from mono main.
  2. Pydantic models regenerated via datamodel-codegen + inject_strict_config.

Important

The mono PR also added @Schema(additionalProperties = TRUE) on the Java DTO so Springdoc emits the right OpenAPI shape:

# Before (buggy)         | # After (correct)
type: object             | type: object
additionalProperties:    | additionalProperties: true
  type: object           |

Without that fix this Pydantic model would fail to parse real API responses — details["source"] is a string "public-api", not a nested dict. Verified locally with the actual response shape.

Dependency

Depends on devhelmhq/mono#316 reaching main. Opening manually so the next SDK release can ship without waiting for the spec-propagate cron.

Test plan

  • ./scripts/typegen.sh clean
  • uv run --no-sync ruff check clean
  • uv run --no-sync mypy src/ clean
  • uv run --no-sync pytest — 713 tests pass
  • Manual round-trip: IncidentStateTransitionDto.model_validate({...details: {source: "public-api"}}) parses successfully

Made with Cursor

…anup

Picks up the schema changes from devhelmhq/mono#316:

- IncidentStateTransitionDto gains a `details: dict[str, Any]` field.
  User-driven transitions carry `details["source"] = "public-api"`;
  pipeline-driven ones carry `details["source"] = "pipeline"`.
- Transition `reason` description aligns with what the engine actually
  writes (trigger | confirm | resolve | auto_clear | reopen). The earlier
  `manually_resolved` was a parallel reason value for the same logical
  edge — replaced by reason="resolve" + details.source="public-api".

Pure regen via `./scripts/typegen.sh`. The mono PR also added
`@Schema(additionalProperties = TRUE)` on the Java DTO so Springdoc emits
`additionalProperties: true` instead of `additionalProperties: {type: "object"}`,
yielding `dict[str, Any]` here instead of `dict[str, dict[str, Any]]`. Without
that fix the Pydantic model would fail to parse real responses (`details.source`
is a string, not a nested dict).

Made-with: Cursor
@caballeto caballeto force-pushed the chore/forensics-details-field branch from 0cf6b57 to 90172d8 Compare April 29, 2026 17:02
@caballeto caballeto merged commit 68bd8b8 into main May 1, 2026
4 checks passed
@caballeto caballeto deleted the chore/forensics-details-field branch May 1, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant