footprintjs - v11.2.0
    Preparing search index...

    Type Alias DefaultBranch

    DefaultBranch: string | { branch: string; label?: string }

    The fallback branch of a decide() — taken when NO rule matched.

    Two forms, and the bare string is the original one:

    • 'protected' — just the branch id. Behaves exactly as it always has.
    • { branch: 'protected', label: 'No rule fired — asset stays protected' } — the branch id PLUS what that branch means.

    Why the object form exists. Every other branch of a decider is named by the rule that chose it: the rule carries a label, and that label travels out through DecisionEvidence.rules[].label for narratives, audits and downstream harvesters. The default branch is chosen by no rule, so there is no rule to carry its label — it is the one branch evidence could not name. Declaring the label here puts the default's meaning beside the rules that it competes with, and sends it out through the same evidence channel.

    Type Declaration

    • string
    • { branch: string; label?: string }
      • Readonlybranch: string

        The branch id to fall back to.

      • Optional Readonlylabel?: string

        What falling back to this branch MEANS. Lands on DecisionEvidence.defaultLabel.

    decide(scope, rules, { branch: 'protected', label: 'Nothing matched — leave it protected' });