feat: add user work role preference - #1952
Open
Douglasymlai wants to merge 3 commits into
Open
Douglasymlai wants to merge 3 commits into
Douglasymlai wants to merge 3 commits into
Conversation
This branch has not been deployed
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
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.
Pull Request
Related Design
This is PR 2 of the personalised example-content foundation and follows
#1951. It is intentionally stacked on that PR so the two schema migrations
remain in one ordered Alembic lineage.
Description
Adds an optional
work_role_keyto the user profile. The value provides astable product preference that future experiences can use to present more
relevant example Tasks without changing permissions or existing application
behavior.
Users who have not selected a role keep
null. No role is inferred, and thecurrent application continues to behave as it does today. A future example
experience can use its generic fallback when the preference is absent.
Design
user.work_role_key VARCHAR(50)with no server default.work_role_keytoUser,UserProfile, andUserOut.work_role_key: null.The API accepts these product-owned keys:
product-managementengineeringhuman-resourcesfinancemarketingsalesoperationsdata-sciencedesignlegalscientiststudentfounderhealthcarewritereducatorconsultantresearchersoftware-engineerothersThe role is preference metadata, not an authorization, entitlement, agent, or
execution role. Unlike the content-owned Space category key in #1951, this
list belongs to the product onboarding contract and is validated by the API.
Scope
This PR contains the user preference persistence and API contract only. It
does not add role-selection UI, onboarding screens, recommendation delivery,
example content, source configuration, Automation behavior, Session execution,
or Task execution.
Migration
The Alembic revision follows
add_space_category_key, adds one nullablecolumn, and preserves a single migration head:
No database default or fixed-value database constraint is added. Existing
rows remain
nulluntil a user chooses a role.Testing Evidence
33 focused user-role, API-contract, migration, and persistence tests pass.
150 broader server tests pass, including the Space category tests from
feat: add content-owned Space category key #1951.
SQLModel persistence verifies the role survives a database reload.
Alembic reports one head and PostgreSQL offline SQL generation verifies the
ordered Space-category and user-role migrations.
Ruff check, Ruff format, Prettier, and
git diff --checkpass.The Douglas Eigent PR check found no remaining actionable issues.
I have included human-verified testing evidence in this PR.
This PR includes frontend/UI changes, and I attached screenshot(s) or
screen recording(s).
No frontend/UI changes in this PR.
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement