Role Flow Check (2026-04-26)
Last reviewed: 2026-04-26
This document records a code-based user-flow check for the current OfferReview worktree. It is not a product spec; it reflects what the code appears to do today.
Sources checked
src/app/dashboard/page.tsxsrc/app/api/dashboard/route.tssrc/components/AppHeader.tsxsrc/lib/auth/rbac.tssrc/app/api/candidates/*src/app/manager-review/[token]/page.tsxsrc/lib/managerReviewAccess.tssrc/lib/candidateDeepDive.tssrc/app/(app)/candidates/[id]/*src/app/admin/*src/app/api/access-requests/*src/app/api/users/*src/app/api/settings/*
Shared flow notes
- Real product entry points are
/loginand/dashboard.src/app/page.tsxis still the default Next.js starter page. - Global nav currently exposes
Dashboard,Candidates,Notifications, andSettingsto all signed-in roles. Uploadis shown only for Admin and HR.- Admin-style nav currently includes:
Access Requestsfor Admin and SMOUsersfor Admin, HR, and SMOOrg Setupfor everyone with the app shellDeep-Dive Questionsfor SMO onlyTemplatesfor Admin only
Candidate stage flow
- Current schema status path:
NEWHR_SCREENEDMANAGER_EVAL_PENDINGMANAGER_REVIEWEDorCANDIDATE_DEEP_DIVE_PENDINGTO_SMOAPPROVED/REJECTED/KIV
- Manager assignment and candidate detail access are assignment-based for Manager role.
- SMO candidate detail access is limited to:
MANAGER_REVIEWEDTO_SMOAPPROVEDREJECTEDKIV
HR flow
- Entry:
- Dashboard subtitle:
HR Screening Queue - Primary actions:
Upload Resume,View Candidates
- Dashboard subtitle:
- Dashboard queue currently includes:
NEWHR_SCREENEDCANDIDATE_DEEP_DIVE_PENDING
- Candidate flow:
- Create candidate via upload-resume flow
- Complete HR screening from candidate detail
- Assign hiring manager after
HR_SCREENED - View candidate overview/documents/audit and, in current worktree, manage deep-dive delivery without seeing the SMO-only answers
- Org/admin-style tools available from current nav or APIs:
- user list page
- organization setup
Manager flow
- Entry:
- Dashboard subtitle:
Your Evaluations Pending
- Dashboard subtitle:
- Candidate visibility:
- candidate list API filters managers to
hiringManagerId = currentUser - candidate detail access is also assignment-based
- candidate list API filters managers to
- Main path:
- open assigned candidate
- fill scorecard / manager review
- if recommendation is
PROCEED, candidate moves toCANDIDATE_DEEP_DIVE_PENDINGand a candidate questionnaire invite is attempted - otherwise candidate moves to
MANAGER_REVIEWED - escalate to SMO is blocked when recommendation is
PROCEEDbut no deep-dive response exists yet
- Alternate path:
- assignment now generates a long-lived manager magic link at
/manager-review/[token] - link becomes invalid if review is completed, reassigned, expired, or no longer matches the current assignment
- assignment now generates a long-lived manager magic link at
SMO flow
- Entry:
- Dashboard subtitle:
Final Decisions Pending - dashboard includes
CandidateStrengthAnalyticswith AI compare enabled
- Dashboard subtitle:
- Candidate visibility:
- dashboard queue only shows
TO_SMO - candidate list API currently allows SMO to see
MANAGER_REVIEWED,TO_SMO,APPROVED,REJECTED, andKIV
- dashboard queue only shows
- Candidate detail:
- tabs include
Overview,Radar,Deep Dive,SMO Decision,SMO Interview,Documents,Audit - when a deep-dive response exists, SMO defaults into the
Deep Divetab CandidateDeepDiveTabis SMO-only; HR/Admin can manage delivery but cannot view answers there
- tabs include
- Main actions:
- review deep-dive answers and AI analysis
- review SMO interview questions / artifacts
- manage the deep-dive question bank
- finalize decision through
/api/candidates/[id]/decision
Admin flow
- Entry:
- dashboard shows pending access requests and failed outbox count placeholder
- Main admin actions available in current codebase:
- review and decide access requests
- manage users, roles, departments, positions, templates, notification rules, audit, email templates
- settings API ownership is admin-only
- impersonation is available for Admin; SMO also has read/impersonation support on the users page
- Organization setup now includes:
- department CRUD
- position CRUD
- active job-description upload/paste flow
Observed mismatches / risks
1. Manager dashboard shows unassigned cases that managers still cannot open
- Dashboard API includes unassigned
HR_SCREENEDcases in the Manager queue. - Candidate access logic still blocks managers from opening candidate detail unless already assigned.
- Likely user-visible result:
Review & Claimcan lead to a forbidden detail page.
2. Settings is in the shared nav, but settings APIs are admin-only
Settingsis shown in the main nav for every signed-in role./api/settingsand/api/settings/notification-rulescurrently requireADMIN.- Likely user-visible result: non-admin users can reach the page but see a load error / unavailable state.
3. HR can open the users page, but cannot load user detail
/api/usersallowsADMIN,HR, andSMO./api/users/[id]GETallows onlyADMINandSMO.- Likely user-visible result: HR can see the list but selecting a user fails to load the detail panel.
4. HR dashboard uses a stale ?tab=assign link
- HR dashboard maps
HR_SCREENEDaction to/candidates/:code?tab=assign. - Candidate detail valid tabs do not include
assign. - Current behavior likely falls back to the HR default tab, so this is low severity but stale.
5. Root app route is not wired into the product flow
/is still the starter page from create-next-app.- This does not break signed-in role flows directly, but it is inconsistent with the rest of the app shell.
Recommended doc usage
- Use
docs/PROJECT_CONTEXT.mdfor the short current state. - Use this file when the task depends on actual role-by-role workflow behavior.
- Re-run this flow check after any changes to dashboard routing, role gating, candidate statuses, manager-review links, or deep-dive delivery.