Money store without double-entry ledger

errormoney-store-without-double-entry-ledger

The design promises that money movements sum to zero, but it has no ledger to enforce double entry. Balances kept in an ordinary table drift and cannot be audited.

Severity
error
Selects
every design
Components in scope
2,366
What it checks

It looks at every design, and fires when:

  • — all of these hold:
  • — the design requirement `money.zeroSum` is true
  • — this does not hold:
  • — the design contains a node of kind ledger
Message
Design '{{design.id}}' requires zero-sum money movement but has no ledger node. Record money in an append-only double-entry ledger.

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

Applies to · 2,366 components

This rule is about the whole design, not one node.

This rule names no kind: it reads the design as a whole.
Tripped by · 3

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
# The design promises the books balance to zero, but no ledger kind exists to enforce
# double entry. Balances kept in an ordinary table drift and cannot be audited.
# Tripped by: designs/payment-system.broken.yaml
schemaVersion: "1"
type: "rule"
id: "money-store-without-double-entry-ledger"
severity: "error"
select:
  design: true
when:
  all:
    - requirement: "money.zeroSum"
      equals: true
    - not:
        hasNode:
          kind: "ledger"
message: "Design '{{design.id}}' requires zero-sum money movement but has no ledger node. Record money in an append-only double-entry ledger."

The same page as markdown, for an agent: /catalogue/rules/money-store-without-double-entry-ledger.md