Skip to content
DashboardWebsite

How Rules Apply

Just want to do it in the dashboard? See the guide: Write a rule of your own or Turn on a pack and pick its rules.

Your organization owns its rules. Each pack ships built-in rules, and you can edit them, turn them off, scope them or add your own. A platform administrator can read your rules for support but cannot change them.

A rule runs on a pull request when it passes five checks, in this order. The first check it fails is why it does not run there.

#CheckWhere you set it
1The rule is enabled.Rules, the rule’s switch
2One of its packs runs on the repository: enabled for the organization, its product or the repository.Packs, the product’s pack settings, and the repository’s Packs card
3Its variant matches the variant that pack uses there. A rule with no variant matches every variant.The rule’s Applies to variant, and the repository’s variant per pack
4Its scope reaches the repository: the rule is org-wide, or it names one of the repository’s teams, its product or the repository.The rule’s Only for some teams or products
5The repository does not exclude it.The repository’s Rules turned off here

A review, the repository’s page and the rule’s Where it runs section all use the same function in core. They cannot disagree.

An analysis that names no repository, such as an API or client-led call without repository, has no repository settings. Only checks 1 to 3 apply, with the organization’s packs and each pack’s default variant. Only org-wide rules pass check 4.

In the dashboard: Rules. Open a rule to see Where it runs, which lists how many repositories run it and groups the others by the check they fail, with a link to each repository. It also says whether an analysis that names no repository runs it. You can get the same answer from GET /v1/orgs/{org_id}/rules/{rule_id}/coverage and the MCP tool get_rule_coverage.

To read the whole ruleset a pack sends, open Packs, then a pack’s ruleset preview. Pick a repository under For to see what its pull requests get, or keep An analysis that names no repository.

A pack with several rule variants, such as python-code-change with its default and django, uses the first one set in this list:

  1. the variant the API call names (rule_type);
  2. the repository’s variant for that pack, set on its page or filled by an ownership rule;
  3. the pack’s default variant.

A variant the pack no longer has falls back to the default. A review never fails on it.

Every built-in rule of every pack is a row in your organization’s rules, with the source Built-in. Core keeps those rows in step with the pack files at each start (OpenTremor-core#0034):

  • A rule you never edited follows the pack: new wording, category and severity.
  • A rule you edited, enabled or disabled stays as you left it, with the source Built-in · edited. When the pack later changes that rule, the row gets a Pack update badge. Open it to compare the pack’s wording with yours, and click Use the pack version to take it. The rule keeps its switch, scope and packs.
  • A rule that leaves the pack is disabled unless you edited it.

A built-in row replaces the pack file’s rule, whether it is enabled or not (OpenTremor-core#0043). Disabling every built-in rule of a pack leaves that pack with no rules. To stop a pack completely, turn it off: that also skips its analysis.

An ownership rule on the Repositories page fills a repository’s teams, product, variants, turned-off packs, ADR folders and draft setting once, when the repository is discovered or when an admin applies the rules. It never replaces what a person set (OpenTremor-core#0020).

The repository’s page shows From ownership rule pattern next to each value an ownership rule filled. When you change that value on the repository, it becomes the repository’s own and the badge goes away.

  • Review routing: teams, products and ownership rules
  • Rules from ADRs: rules drawn from your repositories’ files
  • Custom rules API
  • Decision records: OpenTremor-core#0022 (rule scope), OpenTremor-core#0023 (repository settings), OpenTremor-core#0034 (built-in rules follow the pack file), OpenTremor-core#0042 (an org owns its rules), OpenTremor-core#0043 (a built-in row replaces its file rule)