# Phase 13 — Clearance and graduation

Phase 13 implements configurable clearance, computed graduation eligibility,
controlled graduation lists, and formal award conferral. Certificate generation
remains the downstream Phase 12 workflow.

## Delivered

- Institution-specific, ordered clearance requirements.
- Idempotent student clearance applications per academic session.
- Snapshotted clearance items for every active requirement.
- Cleared, blocked, and waived decisions with officer, time, comments, and events.
- Automatic completion only when every mandatory item is cleared or waived.
- Eligibility checks for academic standing, clearance, ledger balance, and status.
- Immutable eligibility snapshots on graduation candidates.
- Draft graduation lists with explicit approval and publication stages.
- Candidate nomination only while a list is draft and all checks pass.
- Award conferral only for eligible candidates on a published list.
- Unique award numbers and automatic student graduation-status updates.
- Student and administrative interfaces with tenant authorization.

## Data model

- `clearance_requirements`
- `clearance_applications`
- `clearance_items`
- `clearance_events`
- `graduation_lists`
- `graduation_candidates`
- `awards`

All records carry tenant ownership. Constraints prevent duplicate applications,
requirements, candidates, award records, and award numbers.

## State controls

Clearance applications move between `in_progress`, `blocked`, and `completed`.
Graduation lists follow `draft → approved → published`. Candidates move from
`eligible` to `awarded` only through transactional conferral.

## Permissions

- `clearance.view`
- `clearance.manage`
- `graduation.manage`
- `graduation.approve`
- `awards.confer`

## Demonstration data

The seeder publishes the demonstration result workflow when needed, configures four
clearance units, settles the development ledger, completes clearance, publishes a
graduation list, and confers an award.

## Verification

- Phase tests: 5 tests, 21 assertions.
- Creation, decisions, audit history, financial blocking, award processing,
  idempotency, interfaces, and tenant isolation are covered.
- Full suite: 105 tests, 401 assertions.
- Composer validation and security audit passed.
- npm audit found zero vulnerabilities.
- The Vite production bundle built successfully.

```powershell
C:\xampp\php\php.exe artisan migrate
C:\xampp\php\php.exe artisan db:seed --class=GraduationSeeder
C:\xampp\php\php.exe artisan test --filter=GraduationWorkflowTest
C:\xampp\php\php.exe artisan test
```

## Phase gate

Phase 13 is complete. Phase 14 (theological and postgraduate modules) must not begin
without explicit approval.
