Story: Refuse to start against a database built from other SQL

Table of Contents

This page documents a story in Sprint 26. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

1. Goal

The code knows the schema it was built for and the database records the schema it was built from, as a fingerprint of the SQL scripts. Every service and test run compares the two at startup, logs both, and refuses to start when they differ, with a message that names the fix: compass db recreate.

2. Status

Field Value
State DONE
Parent sprint Sprint 26
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-03

3. Acceptance

  • A service started against a database built from other SQL logs the expected and actual fingerprints and exits with a dedicated exit code and an unmistakable message.
  • A service started against a matching database logs both fingerprints and starts.
  • compass services start, compass db status and compass bearings report whether the database is in sync with the checkout.

4. Tasks

Task State Start End Description
Fingerprint the schema and check it at startup DONE 2026-10-03 2026-10-03 Hash the SQL scripts a recreate reads into a fingerprint, stamp it into the database and into the build, and refuse to start when the two differ.

5. Decisions

6. Out of scope

7. Result

Every service, test run and compass services start compares the schema fingerprint compiled into the code with the one the database records, logs both, and refuses to start on a mismatch.

Emacs 29.3 (Org mode 9.6.15)