Rule 904 - creditor fan-out

Status: proposal

This page is not in the configuration database. Do not mark it applied. Do not edit typology [email protected] while building it. That typology is the live demo, and its alert threshold is 200.

What 901 does not see

Rule [email protected] counts payments from a debtor. Three payments to three new accounts in a day can still sit in 901's quiet band. This rule counts distinct creditor accounts paid by the same debtor inside the window. The history query is over successful pacs.008 credits. The network-map message on this host stays pacs.002.001.12.

Contract

These values are normative. A scaffold may add files around them. It may not change them.

Bands use the executor's comparison: a band matches when value >= lowerLimit and value < upperLimit. "Fewer than three" is upperLimit: 3. Rule 901's .01 band uses upperLimit: 2 because that band means one payment. Do not copy that 2 onto this rule.

Weights are numbers. The live 901 typology still has string weights because it was loaded from SQL. A new document posted through Admin Service uses numbers.

{
  "rule": {
    "id": "[email protected]",
    "cfg": "4.0.0",
    "desc": "Distinct creditor accounts paid by the same debtor in 24 hours",
    "config": {
      "parameters": { "maxQueryRange": 86400000 },
      "exitConditions": [
        { "subRuleRef": ".x00", "reason": "Incoming transaction is unsuccessful" }
      ],
      "bands": [
        {
          "subRuleRef": ".01",
          "upperLimit": 3,
          "reason": "Fewer than three distinct creditor accounts paid by this debtor in the last 24 hours"
        },
        {
          "subRuleRef": ".02",
          "lowerLimit": 3,
          "reason": "Three or more distinct creditor accounts paid by this debtor in the last 24 hours"
        }
      ]
    }
  },
  "typology": {
    "id": "typology-processor",
    "cfg": "[email protected]",
    "desc": "Creditor fan-out",
    "tenantId": "DEFAULT",
    "expression": ["Add", "v904at400at400"],
    "workflow": {
      "flowProcessor": "[email protected]",
      "alertThreshold": 200,
      "interdictionThreshold": 400
    },
    "rules": [
      {
        "id": "[email protected]",
        "cfg": "4.0.0",
        "termId": "v904at400at400",
        "wghts": [
          { "ref": ".err", "wght": 0 },
          { "ref": ".x00", "wght": 0 },
          { "ref": ".01", "wght": 0 },
          { "ref": ".02", "wght": 200 }
        ]
      },
      {
        "id": "[email protected]",
        "cfg": "none",
        "termId": "vEFRuPat400atnone",
        "wghts": [
          { "ref": ".err", "wght": 0 },
          { "ref": "override", "wght": 0 },
          { "ref": "non-overridable-block", "wght": 0 },
          { "ref": "overridable-block", "wght": 0 },
          { "ref": "none", "wght": 0 }
        ]
      }
    ]
  },
  "processor": {
    "RULE_NAME": "904",
    "RULE_VERSION": "4.0.0",
    "FUNCTION_NAME": "rule-904-rel-4-0-0",
    "RULE_ID": "904",
    "subscribe": "[email protected]",
    "publish": "[email protected]"
  },
  "wiring": {
    "activeMapCfg": "4.0.0",
    "messageTxTp": "pacs.002.001.12",
    "keepExistingTypology": "[email protected]",
    "activateBody": { "reloadMode": "cascade" },
    "studioDeployWritesRuntimeConfig": false
  }
}

How it is adopted

Rule Studio's deploy button writes trs_rules.status and sends a notification. It does not post this rule, this typology, or a network map.

Post the rule and the typology through Admin Service. Clone active map cfg 4.0.0, keep message pacs.002.001.12, keep typology [email protected], and add typology [email protected] beside it. Activate that cfg with {"reloadMode":"cascade"}. That refetch is the adoption. Do not restart containers for it.

The processor is separate. Its module must export RULE_ID equal to 904. A relabelled 901 or 902 image exits on startup. Until the container is up on [email protected], the Demo UI can list the rule and still receive nothing. The UI subscribes to pub-rule-${rule.id}, which here is [email protected].

.01 weighs 0, so a debtor paying one or two creditors does not alert on this typology. .02 weighs 200, which meets the alert threshold. EFRuP stays the flow processor at weight 0 and is not in the expression.

Acceptance

  1. An unsuccessful transaction scores .x00 and does not alert.

  2. One distinct creditor in the window scores .01 and does not alert.

  3. A third distinct creditor in the window scores .02 and alerts.

  4. Typology [email protected] is unchanged.

  5. Rollback is activating the previous map cfg and stopping the 904 container.

Scaffold

An agent that builds this rule writes five files and stops. It does not apply them.