World 2A / Quest Boss

Phase 2A Boss Fight: Let SQL Prove It

Finish SQL-first by proving constraints, notes, time handling, ERD, seed data, and EXPLAIN artifacts exist together.

Concept

The boss fight is the moment the repo stops saying it has a schema and starts proving the schema protects the domain.

Task

  1. Run the schema contract test.
  2. Apply migrations to local Postgres.
  3. Capture or refresh the EXPLAIN transcript.
  4. Review schema-notes.md and time-notes.md against V1.
  5. Tag phase-2a-done.

Run

./gradlew test --tests "*Phase2ASchemaContractTest"
docker compose up -d postgres
./gradlew flywayMigrate
git tag phase-2a-done

Expected Result

  • Every Phase 2A artifact is committed and the tag points to the proof state.

Common Traps

  • Treating generated SQL as good enough without reading it.
  • Leaving time semantics implicit.
  • Skipping the transcript because the test passed.

Hint Ladder

Hint 1

The contract test is a fast gate; the Postgres run is the stronger proof.

Hint 2

time-notes.md should tell a future Oracle story without implementing Oracle yet.

Hint 3

Do not reopen Phase 2A for Hibernate mapping. That is Phase 2B.

Solution

See docs/milestone-audit.md for the M3 evidence map.