SQLite backend for the orchestration registry.
Purpose
-------
Own all SQL used by the M11 registry storage foundation, including
canonical schema loading, connection PRAGMAs, init-time seeding, and
backend maintenance operations.
Responsibilities
----------------
- Load the canonical registry schema from the design-lock SQL file.
- Apply required SQLite PRAGMAs on every connection.
- Seed singleton rows for ``python -m oc_chat.registry init``.
- Execute the single mutating seam and insert one operation-log row.
- Own lock acquisition, release, renewal, and expiry sweep SQL.
- Provide integrity check, backup/restore, and vacuum hooks.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - lifecycle events
L3 - semantic details
L4 - deep tracing
Contracts
---------
- SQL remains in this module; higher registry layers call backend methods.
- Init is all-or-nothing: schema load and seed inserts share one transaction.
- No SQLite ``datetime('now')`` defaults are used; timestamps come from Clock.
Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- sqlite3 (registry storage engine)
- oc_chat.registry.clock (injected time)
- oc_chat.registry.backends.base (StorageBackend contract, capability error and return types)
- oc_chat.registry.canonical (canonical_json for operation payloads and lock metadata)
- oc_chat.registry.errors (registry error types raised by the mutating seam and lock SQL)
- oc_chat.registry.migrations.v0_3_1_auth_events (auth events schema migration and version row)
- oc_chat.registry.migrations.v0_3_2_roadmap_source_fields (roadmap source fields schema migration and version row)
- oc_chat.registry.migrations.v0_3_roadmap (roadmap schema SQL, version row and upgrade checks)
- oc_chat.registry.store_scope (assert_live_store guard before each domain command)