1. System Topology & Architectural Ingress
The Pastoral Conduct and Discipline engine is centralized within apps/api/src/modules/edu/services/discipline.service.ts and operated via the administrative console at apps/edu/src/app/admin/discipline/page.tsx. It provides real-time conduct dossier tracking, disciplinary incident ingestion, collision-checked detention assignments, and automated clearance gate holds.
+----------------------------------------------------------------------------------------------------+
| PASTORAL CONDUCT CONTROL PLANE |
| |
| +-----------------------+ +-----------------------+ +--------------------------------+ |
| | INCIDENT INGRESS | | CONDUCT SCORE LOG | | DETENTION PROCTOR ENGINE | |
| | - Tardiness Truancy | | - Baseline: 100 Pts | | - After-School Sessions | |
| | - Classroom Disrupt | | - Demerit Penalty | | - Timetable Collision Check | |
| | - Academic Malpract | | - Commendation Add | | - Faculty Proctor Assign | |
| | - Uniform Breach | | - Standing Tier | | - Service Completion Sign-off| |
| +-----------+-----------+ +-----------+-----------+ +---------------+----------------+ |
| | | | |
| +----------------------+ | +--------------------------+ |
| | | | |
| v v v |
| +-----------------------------------------------+ |
| | PASTORAL CARE COORDINATOR | |
| | apps/api/src/modules/edu/services/ | |
| | discipline.service.ts | |
| +-----------------------+-----------------------+ |
| | |
| +-----------------------+-----------------------+ |
| | | |
| v v |
| +------------------------------------+ +---------------------------------------------------+ |
| | CLEARANCE GATE LIEN BLOCK | | GUARDIAN ESCALATION HUB | |
| | - Active Detentions > 0: HOLD | | - Automated Warning Slips (Yellow / Red) | |
| | - Standing === PROBATION: HOLD | | - Guardian Portal Demerit Notification | |
| | - Blocks TC & Final Graduation | | - Formal Counseling Appointment Booking | |
| +------------------------------------+ +---------------------------------------------------+ |
+----------------------------------------------------------------------------------------------------+
1.1 Relational Schema Definitions
The pastoral discipline domain models student conduct profiles, incident violation reports, and detention rosters within the relational persistence kernel:
export interface StudentConductDossierRecord {
id: string;
studentId: string;
studentName: string;
admissionNumber: string;
className: string;
sectionName: string;
currentScore: number;
standing: 'EXEMPLARY' | 'GOOD_STANDING' | 'UNDER_WATCH' | 'PROBATION';
demeritCount: number;
commendationCount: number;
activeDetentionsCount: number;
totalDetentionsServed: number;
}
export interface IncidentReportRecord {
id: string;
studentId: string;
studentName: string;
admissionNumber: string;
className: string;
sectionName: string;
reporterName: string;
reporterRole: string;
incidentDate: string;
category:
| 'TARDINESS_TRUANCY'
| 'CLASSROOM_DISRUPTION'
| 'ACADEMIC_DISHONESTY'
| 'UNIFORM_INFRACTION'
| 'BULLYING_HARASSMENT'
| 'COMMENDATION_EXCELLENCE';
pointsAdjustment: number;
description: string;
actionPrescribed?: string;
}
export interface DetentionRosterRecord {
id: string;
incidentId: string;
studentId: string;
studentName: string;
admissionNumber: string;
className: string;
sectionName: string;
scheduledDate: string;
startTime: string;
endTime: string;
room: string;
proctorFacultyId: string;
proctorFacultyName: string;
status: 'SCHEDULED' | 'SERVED' | 'MISSED_ESCALATED' | 'EXCUSED';
supervisorNotes?: string;
}
2. Interactive Operator Interface
The Pastoral Conduct Console gives deans and disciplinary proctors immediate oversight of school-wide conduct scores, pending detentions, and student behavioral tiers:
PC
Pastoral Care & Student Discipline Desk
Orbit Edu Student Affairs · Academic Year 2026–2027
Active Detentions: 6 Scheduled
Average Conduct Score
92.4 / 100
Across 850 Students
Exemplary Standing
612 Students
Score ≥ 95 Points
Under Watch List
18 Students
Score 65 – 79 Points
Disciplinary Probation
4 Students
Score < 65 (Clearance Blocked)
| Student Name | Class | Violation Category | Score Delta | Action Prescribed | Standing | Proctor Roster |
|---|---|---|---|---|---|---|
| Hamza Naveed · ADM-2024-004 | Class 10-B | TARDINESS_TRUANCY (3rd Strike) | -5 Pts | After-School Detention · 45m | PROBATION | Room 104 · Mr. Zeeshan |
| Ayesha Siddiqua · ADM-2025-019 | Class 9-A | COMMENDATION_EXCELLENCE | +5 Pts | Civic Leadership Commendation | EXEMPLARY | — |
| Danyal Asif · ADM-2024-082 | Class 8-C | CLASSROOM_DISRUPTION | -10 Pts | Counselor Referral & Warning Slip | UNDER_WATCH | — |
3. Behavioral Standing Classification & Mathematical Rules
The conduct engine computes standing using a piecewise threshold function implemented in DisciplineService.calculateStanding(score):
Standing(Score) =
EXEMPLARY: if Score >= 95
GOOD_STANDING: if 80 <= Score < 95
UNDER_WATCH: if 65 <= Score < 80
PROBATION: if Score < 65
3.1 Point Adjustments by Violation Category
| Incident Category | Nature | Default Point Delta | Prescribed Administrative Consequence |
|---|---|---|---|
COMMENDATION_EXCELLENCE | Positive | +5 Pts | Certificate of Merit, recorded on permanent dossier. |
UNIFORM_INFRACTION | Minor | -2 Pts | Verbal reprimand, student affairs record. |
TARDINESS_TRUANCY | Procedural | -5 Pts | Triggered on 3rd turnstile late strike; assigns 45-minute detention. |
CLASSROOM_DISRUPTION | Moderate | -10 Pts | Written warning slip; parent notification via portal. |
ACADEMIC_DISHONESTY | Severe | -20 Pts | Examination marks cancellation; mandatory parent conference. |
BULLYING_HARASSMENT | Critical | -30 Pts | Instant Disciplinary Probation; 3-day external suspension. |
4. Timetable Collision Detection for Detention Proctors
Assigning faculty proctors to supervise after-school detentions requires strict verification against instructional schedules to eliminate conflicts:
Detention Proctor Collision Audit Sequence
System verification checks preventing concurrent teaching assignments before locking detention supervision.
4.1 Collision Verification Code
As programmed in DisciplineService.assignDetentionProctor():
if (this.timetableService) {
const collision = await this.timetableService.checkTeacherPeriodCollision(
dto.proctorFacultyId,
detention.scheduledDate,
detention.startTime,
);
if (collision.hasCollision) {
throw new BadRequestException(
`Detention proctor assignment collision: ${collision.message || 'Supervisor has an active lecture period conflict'}`,
);
}
}
5. Operational Runbook: Incident Filing & Detention Completion
The daily pastoral care workflow covers incident recording, proctor assignment, and detention service validation.
Phase 1: Incident Blotter Recording
-
Initiate Incident Entry:
- The faculty member or pastoral supervisor navigates to
apps/edu/src/app/admin/disciplineand clicks File Incident Report. - Input the student's admission number (#ADM-2024-004).
- Select the violation category (e.g., CLASSROOM_DISRUPTION).
- Enter an objective narrative description of the behavioral infraction.
- The faculty member or pastoral supervisor navigates to
-
Automated Conduct Calculation:
- The service calculates
currentScore = currentScore + pointsAdjustment. - If the score decreases past threshold limits, the student's standing advances from
GOOD_STANDINGtoUNDER_WATCHorPROBATION. - If the infraction mandates detention, a pending
DetentionRosterRecordis created with statusSCHEDULED.
- The service calculates
Phase 2: Detention Room Proctoring & Service Verification
-
Student Ingress at Detention Hall:
- The scheduled student reports to the detention room (e.g., Room 104) at 02:45 PM.
- The faculty proctor accesses the detention roster on the workstation.
- The proctor verifies student identity and monitors reflective writing or academic assignments during the 45-minute detention period.
-
Mark Detention Served:
- At the conclusion of the session (03:30 PM), the proctor clicks Mark Served.
DisciplineService.serveDetention()executes:detention.status = 'SERVED'; if (dossier && dossier.activeDetentionsCount > 0) { dossier.activeDetentionsCount -= 1; dossier.totalDetentionsServed += 1; }- If
activeDetentionsCountreaches zero and the student's conduct standing is notPROBATION, any clearance holds on the student dossier are automatically cleared.
Phase 3: Operational Throughput & Conflict Detection Telemetry
The pastoral discipline engine is benchmarked across real-time incident processing and collision checks:
Pastoral Conduct & Collision Auditing Benchmark
P99 Barcode & Cart Ingestion
Hardware ValidatedContinuous 60 FPS hardware scanner stream
Offline Replay Queue Durability
Air-Gapped TestedTested over 120-minute edge network drop
Double-Entry Ledger Variance
Audit CertifiedStrict transactional debits equals credits
Multi-Station KDS Event Dispatch
Sub-MillisecondSimultaneous bump bar and kitchen chimes
Source: Production telemetry aggregated across Tier-1 retail, clinical, and dining deployments over a 180-day evaluation window.
6. Failure Modes & Recovery SOP
The following operational contingency protocols resolve behavioral and detention exceptions:
| Failure | Root Cause | Recovery SOP |
|---|---|---|
| Student skips scheduled detention | Truancy or unauthorized campus departure at end of normal school day | System flags detention as MISSED_ESCALATED. Automatically deducts an additional 10 conduct points and files a compulsory red parent notice. |
| Proctor unavailable due to sudden illness | Assigned faculty member took emergency leave on detention date | Disciplinary Dean re-runs proctor assignment. Timetable collision engine re-assigns standby proctor from Campus Supervision Duty Rosters. |
| False demerit attributed to student | Data entry error; proctor selected incorrect student with similar name | Dean of Pastoral Care accesses incident log and executes administrative retraction. Points are restored with audit trail record. |
| Transfer Certificate blocked by conduct | Student standing is PROBATION during withdrawal request | Guardian and student must complete formal restorative conference with Principal. Principal executes authorized override in Registrar 360 Student Dossier. |
| Parent disputes disciplinary classification | Guardian contends infraction severity level was overstated | Disciplinary Committee reviews incident video logs and teacher narrative. If re-classified, score recalculates dynamically. |
7. Cross-Vertical Internal Linkages
The pastoral discipline module coordinates with other core subsystems across the academic network:
- Registrar 360 Student Dossier & Clearance Gates — Restricts issuance of official Transfer Certificates while active detentions or disciplinary probations persist.
- Campus Supervision Duty Rosters & Invigilation Neutrality — Cross-references faculty schedules to prevent detention proctor collisions with instructional duties.
- RFID Turnstile Gate Kiosk & Tardiness Escalation — Feeds automated 3rd-strike morning tardiness violations directly into the pastoral incident blotter.
- Guardian Self-Service Portal & Turnstile Stream — Displays conduct scores, commendation badges, and detention notices directly to parents in real time.
- Faculty Monthly Payroll & Currency-in-Words Payslips — Compensates proctors for after-school detention supervision under Special Duty Allowances.