# WB-Grade Governance Controls

## Immutable Submission Ledger

`submission_events` is introduced as an append-only evidence table for operational submissions.

Captured fields:

- project, provider, cohort (`training_id`)
- module/action (`attendance`, `outcomes`, etc.)
- source type/reference (API/CSV + filename/date)
- actor user
- SHA-256 payload hash
- event metadata

Current writers:

- attendance manual submit
- attendance CSV import
- outcomes API batch create
- outcomes CSV import

## Data Quality and Rule Enforcement

Existing controls remain active and are now cohort-compatible:

- duplicate prevention on attendance by cohort/date
- outcome report ordering prerequisites
- contradiction checks across dropout/completion/certification/employment outcomes
- TP scope enforcement for TP users

## Disaggregation Readiness

Cohort trace fields added to:

- `outcome_report_batches`
- `trainee_outcomes`
- `verification_sample_runs`

This enables downstream reporting by:

- cohort
- program
- provider
- project

and combinations with demographic disaggregation already stored on trainees.

## Migration and Backward Compatibility

- Existing `trainingId` contracts remain valid.
- New program/cohort structures are additive.
- Backfill logic maps legacy trainings to default programs and creates enrollment rows.
- Frontend can transition gradually to explicit Program + Cohort selectors.
