v5.35.2 3 June 2026 Improvement

Quote Domain Invariants Registered — Kernel Registry v2.8 & Conversion Provenance Gate

Why This Matters

SpeyBooks maintains a machine-verified registry of every invariant the kernel claims to enforce. A claim only counts as delivered when its proof anchors resolve to real, locatable artefacts and an automated gate confirms it on every deploy. The quote domain’s enforcement layers went live with the quote rebuild releases, but their registry entries were owed. This release pays that debt: the registry now records exactly what the quote domain enforces, where, and at which layer — and the registration discovery itself surfaced one hardening item, which is the honest-registry process working as designed.


Quote Domain Invariants Registered

  • Quote line arithmetic Line-level net, VAT, and gross amounts are bit-exact, enforced by database CHECK constraints sharing the same arithmetic authority as the invoice domain, with the service layer computing the identical reduction. Enforced at database + service layers — migration 087.

  • Quote state machine Quote status values and transitions follow the legal graph only. The database enforces value legality; the service layer enforces transition legality through a typed allowlist; the public API surface admits only the externally reachable statuses. Conversion is reachable solely through the convert operation. Enforced at database + service layers — migration 087.

  • Quote-invoice conversion provenance A converted quote links to the invoice it produced, and that invoice links back to its source quote — never one-sided. Both links are written atomically in a single transaction, and a new deploy-time reconciliation gate now sweeps the live data on every deploy, failing the deploy if any one-sided link is ever found. Enforced at database + service + deploy layers — migration 087 plus the new deploy gate.

  • Quote non-negative envelope (registered, hardening scheduled) Quotes carry positive amounts only. Quantity, VAT rate, and document totals are constrained at the database; unit prices are validated as positive at the API boundary. The registration review found that line-amount sign is not yet independently constrained at the database layer, so this invariant is recorded as planned rather than delivered — with a scheduled follow-on constraint pass that will complete it. The registry records the truth, not the optimistic version.


Operational Impact

  • The kernel’s verified invariant count moves from 30 to 33 delivered, machine-checked on every deploy and on every push.
  • A new deploy pipeline phase proves quote-invoice conversion consistency against live data before any release goes out; the deploy now runs eleven phases.
  • One hardening item identified and scheduled as a direct result of the registration review — found by process, not by incident.

Versioning

Kernel axiom registry → v2.8. No public API surface changed; this release is a registry and deploy-pipeline record of enforcement that was already live.