Skip to content

An active-branch list is an array of names, trimmed and lower-cased

The rule

Normative: this is the rule
  1. A source's active-branch list is an array of strings.
  2. A bare string MUST be read as one branch name, taken verbatim, and MUST NOT be split on commas or any other separator.
  3. An entry that is not a string MUST be dropped.
  4. Each surviving entry MUST be trimmed of surrounding whitespace and lower-cased, which is the form BR-1 compares a port name against.

What it means

A bare string is not a shorthand for several names — it is one name, taken exactly as written, commas included. Splitting it would corrupt the legitimate case: a branch genuinely named a, b is one port, and splitting its name on the comma produces two names that match no port at all. Only an array has several entries; a string never does.

Example

A bare string holding a commaone name
"a, B ,c"
What the bare string parses toparsed
["a, b ,c"]

An array entry that is not a string is dropped rather than turned into one:

An array with a name among non-stringsmixed array
["keep", 5, null, ""]
What the mixed array parses toparsed
["keep"]

Why

Recorded under OPEN-25.

Fixtures

Test cases whose outcome this rule decides. A case compares absent, null and empty members exactly; the fixtures README defines each operation. Where a case and the rule disagree, the rule is right.

  • A named branch is matched after trimming and lower-casing gate-edge
    {
      "given": {
        "branches": [
          "yes",
          "no"
        ],
        "output": {
          "active_branches": [
            " Yes "
          ]
        },
        "port": "yes"
      },
      "expect": {
        "follow": true
      }
    }

    fixtures/presence/br-decision-matches-trimmed.json

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · BR-3 · changed in spec 1.0