Skip to content
ThinkWatch
Start typing to search the docs.
ThinkWatch Core · Crate layers

Crate layers#

Core’s crates are organised into four layers.

tw-types · tw-protocol · tw-provider · tw-resil · tw-crypto   ← defined by external constraints
tw-engine · tw-pricing · tw-redact · tw-yaml · tw-secret      ← domain logic
tw-config · tw-store · tw-scan · tw-adopt · tw-observe        ← assembly
tw-gateway · tw-control                                       ← data plane / control plane
LayerCratesRole
1tw-types, tw-protocol, tw-provider, tw-resil, tw-cryptoDefined by external constraints
2tw-engine, tw-pricing, tw-redact, tw-yaml, tw-secretDomain logic
3tw-config, tw-store, tw-scan, tw-adopt, tw-observeAssembly
4tw-gateway, tw-controlData plane and control plane

Shared layers#

The top two layers remain stable with respect to external constraints. The server edition depends on them directly.

Unshared layers#

The bottom two layers form the single-machine implementation, built on SQLite and a unix socket, and are intentionally not shared. Single-machine SQLite and multi-tenant Postgres differ too much for one abstraction to serve both.

Price list in tw-pricing#

crates/tw-pricing embeds a pinned price snapshot that is not updated automatically. Tracking upstream automatically would allow two builds to compute different prices, and a discrepancy between one day’s figures and the next could not be explained to users. See Development and tests for the snapshot update procedure.