-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: FIT-610: FSM core model states setup #8319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…studio into fb-fit-610-fsm-models
mcanu
approved these changes
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments, LGTM
Co-authored-by: Marcel Canu <marcel@humansignal.com>
Co-authored-by: Marcel Canu <marcel@humansignal.com>
…nd utilize get_current_state_value and get_current_state_object as the only means for retrieving current_state
/fm sync |
/fm sync |
mcanu
approved these changes
Sep 9, 2025
/fm sync |
/fm sync |
wesleylima
approved these changes
Sep 10, 2025
/fm sync |
/fm sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a foundational set of models and supporting code for tracking state transitions (finite state machine, FSM) for Label Studio core entities: Tasks, Annotations, and Projects. It adds new migration files, core state models, state choice enums, and improves the state manager interface for clarity and extensibility.
The most important changes are:
Core FSM Models and Schema:
TaskState
,AnnotationState
, andProjectState
infsm/models.py
to track state transitions for their respective entities, including denormalized fields for performance and index optimizations. These models are registered for FSM use and support a simple 3-state workflow for each entity.0001_initial.py
) that creates the above state models with all necessary fields, relationships, and indexes to support efficient querying and reporting.State Choices Registry:
state_choices.py
, definingTaskStateChoices
,AnnotationStateChoices
, andProjectStateChoices
as DjangoTextChoices
enums, and registered them for FSM usage. This centralizes and standardizes the possible states for each entity type.State Manager API Improvements:
get_current_state
toget_current_state_value
for clarity, and provided a backward-compatible alias. This makes the API clearer and future-proof. [1] [2] [3] [4]Imports and Registry Integration:
fsm/models.py
to use the new registry system for state models and choices, ensuring all FSM components are properly registered and discoverable.Improved Test Coverage