Skip to content

feat(onboarding): Model agentic setup progress - #121912

Draft
evanpurkhiser wants to merge 1 commit into
masterfrom
agentic-onboarding-model
Draft

feat(onboarding): Model agentic setup progress#121912
evanpurkhiser wants to merge 1 commit into
masterfrom
agentic-onboarding-model

Conversation

@evanpurkhiser

@evanpurkhiser evanpurkhiser commented Aug 13, 2026

Copy link
Copy Markdown
Member

Stack 1 of 5. Next: #121913

Define the ordered onboarding stages and their durable state transitions. Later stages complete earlier required work, optional stages remain explicit, and completed stages never regress.

The run model keeps terminal state separate from stage state and validates concise UI notes and failure reasons before they reach storage.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 13, 2026
@evanpurkhiser evanpurkhiser changed the title agentic onboarding model feat(onboarding): Model agentic setup progress Aug 13, 2026
Comment thread src/sentry/onboarding/agentic_progress/model.py
Comment thread src/sentry/onboarding/agentic_progress/model.py Outdated
@evanpurkhiser
evanpurkhiser force-pushed the agentic-onboarding-model branch 2 times, most recently from 131151b to 0385a6b Compare August 13, 2026 01:23
Define the ordered onboarding stages and their durable state transitions.
Later stages complete earlier required work, optional stages remain explicit,
and completed stages never regress.

The run model keeps terminal state separate from stage state and validates
concise UI notes and failure reasons before they reach storage.
@evanpurkhiser
evanpurkhiser force-pushed the agentic-onboarding-model branch from 0385a6b to 7d64140 Compare August 13, 2026 01:26
schema_version: int = SCHEMA_VERSION
"""Version of the Redis and public snapshot representation."""

@classmethod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KeyError on unknown stage in validate_update instead of ValueError

STAGE_DEFINITION_BY_STAGE[update.stage] crashes with KeyError when the stage string is not registered. Use .get() and raise ValueError so callers receive a clean validation error instead of a raw dict miss.

Evidence
  • STAGE_DEFINITION_BY_STAGE only contains keys built from STAGE_DEFINITIONS.
  • ProgressUpdate.stage is typed as Stage, but Python dataclasses do not enforce enum membership at runtime, so a caller can pass any string (e.g., deserializing JSON directly into the dataclass).
  • When an unregistered stage reaches validate_update, the direct lookup STAGE_DEFINITION_BY_STAGE[update.stage] raises KeyError instead of a controlled ValueError.
  • This matches the production HANDLERS[event_type] pattern: registry dict lookups without existence checks crash on unexpected input.
Also found at 1 additional location
  • src/sentry/onboarding/agentic_progress/model.py:269-297

Identified by Warden · sentry-backend-bugs · 43T-LWE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant