feat(crewing): Phase 5b — appraisal (flagged) #74

Merged
shad0w merged 2 commits from feat/crewing-appraisal into feat/crewing-verification 2026-06-22 18:54:07 +00:00
Owner

Crewing — Phase 5b (Appraisal)

Final slice of Phase 5. The appraisal lifecycle raise → verify → approve across three role-gated surfaces, per §5.4/§8.14. Stacks on #73 (verification); base feat/crewing-verification. Behind NEXT_PUBLIC_CREWING_ENABLED. Completes Phase 5.

What's in

  • Schema: Appraisal (on CrewAssignment) + AppraisalStatus (DRAFT → SUBMITTED → MPO_VERIFIED → MANAGER_APPROVED; → REJECTED); ratings JSON (competence/conduct/safety); CrewActionType += APPRAISAL_SUBMITTED/VERIFIED/APPROVED/REJECTED.
  • State machine lib/appraisal-state-machine.ts: verify (SUBMITTED→MPO_VERIFIED, MPO/Manager), approve (MPO_VERIFIED→MANAGER_APPROVED, Manager); orthogonal reject.
  • Actions: raiseAppraisal (raise_appraisal — PM/site staff), verifyAppraisal (verify_appraisal — MPO), approveAppraisal (approve_appraisal — Manager); reject paths require remarks; notifications APPRAISAL_FOR_VERIFICATION / APPRAISAL_FOR_APPROVAL.
  • Three surfaces (§8.14): PM raises + tracks status on the crew-profile Appraisals tab; MPO verifies in the Verification queue (Appraisals section); Manager approves in the central /approvals queue (Appraisal kind).

Tests & docs

  • Unit: appraisal-state-machine.test.ts (4). Integration: appraisal.test.ts (4) — raise→verify→approve, MPO reject, permission gating (MPO can't raise, site staff can't verify, MPO can't approve).
  • type-check clean; full unit (245) + integration (205) green (verified with RESEND_API_KEY unset, mimicking CI).
  • CLAUDE.md updated; wiki §12 marks Phase 5 complete.

This completes Phase 5 (I + H). Remaining roadmap: Phase 6 — payroll (Pay-status tab + Approvals "Wage"), dashboards, notifications (J, M).

🤖 Generated with Claude Code


Closes Epic H — Appraisal (#82).

## Crewing — Phase 5b (Appraisal) Final slice of **Phase 5**. The appraisal lifecycle `raise → verify → approve` across three role-gated surfaces, per §5.4/§8.14. Stacks on **#73** (verification); base `feat/crewing-verification`. Behind `NEXT_PUBLIC_CREWING_ENABLED`. **Completes Phase 5.** ### What's in - **Schema:** `Appraisal` (on `CrewAssignment`) + `AppraisalStatus` (`DRAFT → SUBMITTED → MPO_VERIFIED → MANAGER_APPROVED`; `→ REJECTED`); `ratings` JSON (competence/conduct/safety); `CrewActionType += APPRAISAL_SUBMITTED/VERIFIED/APPROVED/REJECTED`. - **State machine** `lib/appraisal-state-machine.ts`: `verify` (SUBMITTED→MPO_VERIFIED, MPO/Manager), `approve` (MPO_VERIFIED→MANAGER_APPROVED, Manager); orthogonal reject. - **Actions:** `raiseAppraisal` (`raise_appraisal` — PM/site staff), `verifyAppraisal` (`verify_appraisal` — MPO), `approveAppraisal` (`approve_appraisal` — Manager); reject paths require remarks; notifications `APPRAISAL_FOR_VERIFICATION` / `APPRAISAL_FOR_APPROVAL`. - **Three surfaces (§8.14):** PM raises + tracks status on the crew-profile **Appraisals** tab; MPO verifies in the **Verification** queue (Appraisals section); Manager approves in the central **/approvals** queue (Appraisal kind). ### Tests & docs - Unit: `appraisal-state-machine.test.ts` (4). Integration: `appraisal.test.ts` (4) — raise→verify→approve, MPO reject, permission gating (MPO can't raise, site staff can't verify, MPO can't approve). - `type-check` clean; full unit (245) + integration (205) green (verified with `RESEND_API_KEY` unset, mimicking CI). - `CLAUDE.md` updated; wiki §12 marks Phase 5 complete. This completes **Phase 5 (I + H)**. Remaining roadmap: **Phase 6** — payroll (Pay-status tab + Approvals "Wage"), dashboards, notifications (J, M). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Closes **Epic H — Appraisal** (#82).
shad0w added 1 commit 2026-06-22 16:41:48 +00:00
feat(crewing): Phase 5b — appraisal (flagged)
All checks were successful
PR checks / checks (pull_request) Successful in 40s
PR checks / integration (pull_request) Successful in 30s
c14a22588e
Final slice of Phase 5. The appraisal lifecycle raise → verify → approve across
three role-gated surfaces, per Crewing-Implementation-Spec §5.4/§8.14. Stacks on
5a verification. Behind NEXT_PUBLIC_CREWING_ENABLED. Completes Phase 5.

What's in
- Schema: Appraisal (on CrewAssignment) + AppraisalStatus
  (DRAFT/SUBMITTED/MPO_VERIFIED/MANAGER_APPROVED/REJECTED); CrewActionType +=
  APPRAISAL_SUBMITTED/VERIFIED/APPROVED/REJECTED. Migration crewing_appraisal.
- State machine lib/appraisal-state-machine.ts: verify (SUBMITTED→MPO_VERIFIED,
  MPO/Manager), approve (MPO_VERIFIED→MANAGER_APPROVED, Manager); orthogonal reject.
- Actions (crewing/appraisals/actions.ts): raiseAppraisal (raise_appraisal — PM/
  site staff), verifyAppraisal (verify_appraisal — MPO), approveAppraisal
  (approve_appraisal — Manager); reject paths require remarks; notifications
  APPRAISAL_FOR_VERIFICATION / APPRAISAL_FOR_APPROVAL.
- Three surfaces (§8.14): PM raises + tracks status on the crew-profile Appraisals
  tab; MPO verifies in the Verification queue (Appraisals section); Manager approves
  in the central /approvals queue (Appraisal kind).

Tests & docs
- Unit: appraisal-state-machine.test.ts (4). Integration: appraisal.test.ts (4) —
  raise→verify→approve happy path, MPO reject, permission gating (MPO can't raise,
  site staff can't verify, MPO can't approve). type-check clean; full unit (245) +
  integration (205) green (verified with RESEND_API_KEY unset).
- CLAUDE.md updated — completes Phase 5 (I + H).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w added 1 commit 2026-06-22 18:53:35 +00:00
Merge branch 'feat/crewing-verification' into feat/crewing-appraisal
All checks were successful
PR checks / checks (pull_request) Successful in 41s
PR checks / integration (pull_request) Successful in 29s
a2366bd9d9
shad0w force-pushed feat/crewing-appraisal from a2366bd9d9 to c14a22588e 2026-06-22 18:53:46 +00:00 Compare
shad0w added 1 commit 2026-06-22 18:53:53 +00:00
Merge branch 'feat/crewing-verification' into feat/crewing-appraisal
All checks were successful
PR checks / checks (pull_request) Successful in 40s
PR checks / integration (pull_request) Successful in 31s
cfb2533e33
shad0w merged commit 58f6ff03af into feat/crewing-verification 2026-06-22 18:54:07 +00:00
Sign in to join this conversation.
No description provided.