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
What it checks

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
Message
Cache '{{node.id}}' holds materialised data but nothing durable or no worker feeds it. It cannot be rebuilt after loss.

{{node.id}} style paths are filled in from the node, the edge or the design the finding is about.

Applies to · 37 components
Tripped by · 12

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.

Source
# 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."

The same page as markdown, for an agent: /catalogue/rules/materialised-cache-without-rebuild-path.md