Profession vs project responsibility — split project_teams.role into firm-level profession + project-level responsibility #6
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
m's bug report (2026-05-06 16:58):
The team-add form on
/projects/{id}has a role dropdown with values that mix two distinct axes:leadassociatepaof_counsellocal_counselexpertobserverA user IS an Associate or a PA at the firm — that's their career tier, not something you redefine when staffing them on a matter. What changes per project is their responsibility (lead vs. member vs. observer).
Existing data axes (post t-138 + t-139)
paliad.users.global_role—standard | global_admin— tool admin gate onlypaliad.users.job_title— free-text display, never gates anythingpaliad.project_teams.role— current single column doing two jobs (the bug)paliad.partner_unit_members.unit_role— added by t-139 Phase 2:lead | attorney | senior_pa | pa | paralegal— closer to "profession" axis but only meaningful when a unit is involvedApprovalService.canApprove()strict ladder:lead(5) > of_counsel(4) > associate(3) > senior_pa(2) > pa(1) > local_counsel/expert/observer(0)— keys offproject_teams.roleSo
project_teams.roleis currently:Goals
Locked decisions (m, 2026-05-06)
Open design questions (for inventor — m will answer in design pass)
Profession axis
paliad.users.professioncolumn (firm-wide, simple)paliad.partner_unit_members.unit_role(already added in t-139 Phase 2; only set when the user is in a unit)paliad.user_professions(user_id, profession, valid_from)table for historypartner | of_counsel | associate | senior_pa | pa | paralegal. External roles (local_counsel,expert) — are those professions or project-only labels? Likely the latter.Project responsibility axis
lead | member | observer | externalor similar — flat, not a ladder. Inventor proposes, m signs off.memberis the natural choice.Approval ladder coordination (t-138 cross-cut)
project_teams.roleto the new profession column? If yes, all references inApprovalService.canApprove(),approval_role_level(), the policy authoring page, and the inbox SQL move to the new source. Inventor maps the rename.Migration
project_teamsrow carries a value from the legacy enum. The script:project_teams.role→ user's new profession (if not already set), ANDproject_teams.role→ new project_responsibility:lead→leadobserver→observermemberUX
Out of scope (v1)
References
paliad.project_teams.role(current single source) —internal/services/team_service.go, migration 018paliad.partner_unit_members.unit_role(t-139 Phase 2) — migration 055ApprovalService.canApprove()(t-138) —internal/services/approval_service.gointernal/services/approval_levels.go— strict ladder definitionfrontend/src/projects-detail.tsx:114-123— current team-add dropdown options (the UX surface m complained about)docs/design-approvals-2026-05-06.md§2 — the role taxonomy locked at the timeInventor brief
mai/<inventor>/inventor-profession-vs-project-roledocs/design-profession-vs-project-role-2026-05-06.md. Three sub-designs:Inventor design ready for review — kepler shift-1 (2026-05-07)
Doc:
docs/design-profession-vs-project-role-2026-05-07.md(841 lines, commit1eb43ceonmai/kepler/inventor-profession-vs).TL;DR
Split
paliad.project_teams.roleinto:paliad.users.profession— firm-wide career tier (partner | of_counsel | associate | senior_pa | pa | paralegal | NULL). Drives the t-138 approval ladder. NULL = external (level 0).paliad.project_teams.responsibility— per-project (lead | member | observer | external). Defaultmember. Replaces the team-add dropdown values m complained about.Approval ladder evaluated as a tuple-with-gate:
effective_level = profession_level IF responsibility ∈ {lead, member} ELSE 0. Policy grammar from t-138 (required_rolesingle value) stays unchanged.Single migration 057.
project_teams.rolekept as deprecated shadow for one release; dropped in follow-up 058.Verified live state
project_teams: 3 rows, allrole='lead'. Backfill is trivial.partner_unit_members: 20 rows, all defaultunit_role='attorney'. Bridge unchanged.e2e1381) and t-139 phases all merged on main. No blockers.12 open questions — recommendation summary
users.professioncolumnpartner / of_counsel / associate / senior_pa / pa / paralegal(NULL = external)associatelead / member / observer / externalmemberassociate, "Extern" hides field)Recommended implementer
Any pattern-fluent coder. NOT cronus (retired from paliad per memory directive). Sonnet work — 70% mechanical rename, 30% new SQL function + 4 ladder-site rewrites + new team-table layout. Single PR, 6 commits.
Inventor parked
Awaiting m's pass through the 12 questions in §10. After sign-off, design locks and head can dispatch a fresh coder shift on this branch.
DESIGN LOCKED — m approved all 12 recommendations verbatim (2026-05-07 21:35): "lets go with those - but if you are fine, go for shift". m authorized kepler to take the coder shift. Status flipped from READY-FOR-REVIEW to LOCKED.
Proceeding with implementation on
mai/kepler/inventor-profession-vs. Single PR, 6 commits per §7. Will merge to main after final verification.SHIPPED — PR ready for merge 🟢
Kepler completed implementation in single shift. PR: #11
6 commits on
mai/kepler/inventor-profession-vs:ab2530f— Migration 057 (schema + backfill + SQL fn)6506864— ApprovalService + DerivationServicee6937d2— TeamService + UserService + Models + Handlers9184e9b— Reminder + Deadline + Derivation cleanup2af4bf1— Frontend (the bug surface — team-add dropdown)0b4de1c— Deprecation notes + grep sweep+1969 / -247 lines · 23 files ·
mergeable: trueVerification clean:
go build ./...✓go vet ./...✓go test ./...✓ (all 7 packages, including new tests for profession ladder + responsibility gate + NULL trap)bun build.ts✓ (1723 i18n keys, all referenced)Ready for m's merge → Dokploy deploy → migration 057 applies on boot. Follow-up: file t-paliad-149 for migration 058 to drop the deprecated shadow column after one release of soak time.