redline-ruleset.json

Reference shape only — nothing reads this file; redline init builds the equivalent ruleset at runtime.

What this is

A reference document of the per-repo branch ruleset shape — one human approval, thread resolution, the required redline-gate / gate check.

How to onboard it

  • Installed as: Nowhere — not installed by anything.
  • Installed by: Nothing. No code in this repository reads or applies this JSON file.

How to use it

Use it to see the target shape, not to hand-apply it — importing this file verbatim into a repo would make the gate blocking immediately, which contradicts the advisory-by-default onboarding path.

  • redline init's applyPolicy (cli/platforms/github/install.ts) builds the equivalent ruleset payload at runtime instead, from the repo's chosen merge-policy options — it never reads this file off disk.
  • This file shows the shape when the gate is promoted to blocking: it always includes the required_status_checks rule. A freshly onboarded repo defaults to advisory, where applyPolicy omits that rule entirely — so the live ruleset and this file diverge on exactly that one rule until --blocking is passed.

Expected output

Nothing. No code in this repository reads or applies this file. The live ruleset is built at runtime by applyPolicy from the repository's chosen merge-policy options, and on a freshly onboarded repo it omits the required_status_checks rule entirely — advisory by default — which is exactly where it diverges from the shape shown here.

How to edit it

The real source: cli/platforms/github/install.ts, in applyPolicy. Editing this JSON changes no behaviour anywhere.

  1. Check whether the CLI reads this file at allSeveral of these are reference shapes: the CLI generates the equivalent in code and never opens the checked-in copy. Editing one of those changes nothing about what redline init writes. The onboarding section above says which kind this is.
  2. Edit the real sourceFor a generated artifact that is cli/commands/init.ts; for a file installed verbatim it is the template itself.
  3. npm test && node scripts/validate.mjsThe install path is unit-tested against a fake host client, and validate.mjs pins the shapes the merge gate's required check name depends on.

The full file

rulesets/redline-ruleset.json · 50 lines · 1.0 KB
{
  "name": "Redline",
  "target": "branch",
  "enforcement": "active",
  "conditions": {
    "ref_name": {
      "include": [
        "~DEFAULT_BRANCH"
      ],
      "exclude": []
    }
  },
  "rules": [
    {
      "type": "deletion"
    },
    {
      "type": "non_fast_forward"
    },
    {
      "type": "pull_request",
      "parameters": {
        "required_approving_review_count": 1,
        "dismiss_stale_reviews_on_push": true,
        "require_code_owner_review": true,
        "require_last_push_approval": true,
        "required_review_thread_resolution": true,
        "automatic_copilot_code_review_enabled": true,
        "allowed_merge_methods": [
          "squash",
          "merge"
        ]
      }
    },
    {
      "type": "required_status_checks",
      "parameters": {
        "strict_required_status_checks_policy": false,
        "do_not_enforce_on_create": false,
        "required_status_checks": [
          {
            "context": "redline-gate / gate"
          }
        ]
      }
    }
  ],
  "bypass_actors": []
}