# M1 Technical Decisions

1. **Clean replacement.** No legacy database compatibility layer and no runtime connection to the old B360 database.
2. **Modular monolith.** CodeIgniter application modules share one relational database. OMR remains a separately deployable service.
3. **Shield authentication.** Passwords, login security and MFA readiness belong to Shield. Business authorization is additionally scoped by organization, competition or scoring event.
4. **Migrations are authoritative.** Database creation and changes are repeatable, reviewable and version controlled.
5. **Published definitions are immutable by service policy.** Structure and content are separate so Utah-style label changes create new content versions without changing bubbles or scoring.
6. **Evidence and result are separate.** Submissions preserve what entered the system; results identify the current accepted calculation; corrections append revisions.
7. **Zero is data.** `0` is an answered value. An unanswered field is represented by the explicit `unanswered` state and a null value.
8. **Ambiguity is not correction.** Multiple OMR marks create an ambiguous response/review flag; the darkest response is not silently selected.
9. **Idempotency is required.** Import and submission batches have competition-scoped idempotency keys; source documents have checksums.
10. **Customer-facing hostname is independent of the server's primary domain.** DNS can point a professional subdomain to the same server.
11. **Repositories are selective.** They encapsulate workflows requiring data-access isolation; simple CodeIgniter models need not be wrapped ceremonially.
12. **Mah Jongg rounds are scoring events.** Each round can have its own event entry and score while `mj_round_assignments` supplies table and seat.
