# Phase 14 — Theological formation and postgraduate research

Phase 14 adds optional theological-school formation and postgraduate research
workflows while keeping pastoral records and unpublished manuscripts private.

## Theological formation

- Encrypted ministry profile narratives, testimony, calling, and experience.
- Denomination, church, leader, baptism, and ordination status.
- Restricted spiritual-formation, character, ethics, sermon, homiletics, and
  ordination assessments.
- Chapel services with hashed attendance codes and idempotent student check-in.
- Field ministry, pastoral internship, CPE, and missions placements.
- Required/completed hours, evangelism and sermon reports, supervisor feedback,
  and completion status.

Restricted narrative fields are encrypted at rest and hidden from serialization.
Only `formation.sensitive.manage` users can create character or pastoral assessments.
Students do not receive those assessments in their workspace.

## Postgraduate research

- Thesis, dissertation, and doctoral-project records.
- Topic, research area, abstract, proposal, proposal approval, and ethics metadata.
- Supervisor and co-supervisor assignments.
- Private PDF/DOC/DOCX chapter uploads with immutable versions and SHA-256 hashes.
- Assigned-supervisor review, comments, similarity percentage, approval, and
  correction requests.
- Supervision meetings, actions, and next-meeting dates.
- Defence scheduling, internal/external examiners, score, outcome, and corrections.
- Final approval and repository publication.

The workflow is:

`proposal_draft → proposal_submitted → proposal_approved → research_active →
ready_for_defence → defended → final_approved → repository_published`

Transitions enforce supervisor, approved-submission, successful-defence, and
repository-URL gates. Students may submit their proposal; protected approvals require
`research.approve`.

## Graduation integration

Phase 13 eligibility gains conditional checks. A student with a ministry profile must
have chapel attendance and a completed placement. A student with a research project
must have final approval or repository publication. Institutions not using these
optional modules are unaffected.

## Data model

- `ministry_profiles`
- `formation_assessments`
- `chapel_services`
- `chapel_attendance`
- `ministry_placements`
- `placement_reports`
- `research_projects`
- `research_supervisors`
- `research_submissions`
- `supervision_records`
- `research_defences`

## Verification

- Phase tests cover the end-to-end seed, encryption at rest, hidden sensitive fields,
  private versioned uploads, file hashes, invalid transitions, interfaces, and tenant
  isolation.
- Phase suite: 5 tests, 17 assertions.
- Phase 13/14 integration suite: 10 tests, 38 assertions.
- Full application suite: 110 tests, 418 assertions.
- Standalone seeding and all 16 Phase 14 routes were verified.
- 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=AdvancedStudiesSeeder
C:\xampp\php\php.exe artisan test --filter=AdvancedStudiesWorkflowTest
C:\xampp\php\php.exe artisan test
```

## Phase gate

Phase 14 is complete. Phase 15 (reports, CMS, and communication) requires explicit
approval.
