Materialised cache without a rebuild path
errormaterialised-cache-without-rebuild-path
A cache holding materialised views has to be rebuildable from a durable store or a worker. With nothing feeding it, a cold cache is a permanent gap rather than a slow start.
- Severity
- error
- Selects
- every node of kind cache
- Components in scope
- 37
It looks at every node of kind cache, and fires when:
- — all of these hold:
- — the node's `materialised` is true
- — this does not hold:
- — the node has at least one incoming edge from a sql-database, nosql-database, worker or stream
Cache '{{node.id}}' holds materialised data but nothing durable or no worker feeds it. It cannot be rebuilt after loss.Reference designs whose broken twin names this rule in its header. The gate reads the same header, and fails when a rule no design trips.
# yaml-language-server: $schema=../schema/rule.schema.json # A cache holding materialised views (timelines, feeds, precomputed lists) must be rebuildable # from a durable source or a worker. With no such in-edge, a cold cache is a permanent gap. # Tripped by: designs/twitter-timeline.broken.yaml schemaVersion: "1" type: "rule" id: "materialised-cache-without-rebuild-path" severity: "error" select: node: kind: "cache" when: all: - prop: "materialised" equals: true - not: hasEdge: direction: "in" peerKind: ["sql-database", "nosql-database", "worker", "stream"] message: "Cache '{{node.id}}' holds materialised data but nothing durable or no worker feeds it. It cannot be rebuilt after loss."