Skip to content

docs(adr): propose a repository settings baseline by class#474

Open
ss-o wants to merge 6 commits into
mainfrom
docs/adr-repository-settings-baseline
Open

docs(adr): propose a repository settings baseline by class#474
ss-o wants to merge 6 commits into
mainfrom
docs/adr-repository-settings-baseline

Conversation

@ss-o

@ss-o ss-o commented Jul 22, 2026

Copy link
Copy Markdown
Member

Status PROPOSED. This changes no repository by itself — it declares the standard that a later audit would measure against.

The finding that prompted it

ADR-0009 states class-2 repositories have a test suite that is required and gates release tags. z-shell/zsh-lint is class 2:

{ "required_status_checks": null, "required_approving_review_count": 0, "enforce_admins": false }

Declared policy, enforced by nothing. This is #464's pattern — documents describing a control that does not exist — moved from CI to repository configuration.

Survey of all 86 active public repositories

Measure Count
No rules at all on the default branch 75 (87%)
No classic branch protection 60 (70%)
No rulesets 73 (85%)
Any rule present 11 — six with only copilot_code_review
More than one kind of rule 2 (zi, wiki)
Required status checks zi 5, wiki 1, all others 0
Default branch still master z-shell/web

The two configured repositories do not agree with each other, which is expected: nothing in decisions/, runbooks/, or AGENTS.md mentions branch protection or rulesets, and runbooks/new-repository.md bootstraps labels, CI, and dependency automation without ever configuring protection.

Why a per-repository baseline rather than central enforcement

GET /orgs/z-shell/rulesets → 403 "Upgrade to GitHub Team to enable this feature."

An organization ruleset is the right mechanism and is what I would otherwise propose instead of this. It is unavailable on the current plan, and no custom properties are defined. Per-repository configuration is the only option, so drift is structural — which is the argument for declaring a baseline and measuring against it.

What the ADR deliberately does not do

  • No remediation. Applying protection unattended across 86 repositories is how maintainers get locked out of their own repositories. Audit, report, then apply per repository behind a confirm flag — the labels-sync.rb pattern.
  • No enforce_admins. Enabling it would have made this week's wiki deadlock unrecoverable: a required check whose failure could only be cleared by the merge it was blocking.
  • No classic-protection migration. 19 repositories carry classic protection with no ruleset. Migrating them is separate work and should not be bundled with adopting a baseline.
  • No claim that rules are self-enforcing. An administrator push reports Bypassed rule violations and succeeds.

Verification

Every factual claim was checked against the live API rather than asserted: the zsh-lint protection payload, the org-ruleset 403, web defaulting to master, and the wiki case where classic protection reports required_linear_history: false while a ruleset enforces it on the same branch.

Open question for review

The class table is the part most worth arguing with — particularly whether linear history should be required for class 1. It is what produced the wiki reconcile chore documented in #473, where the deployed branch diverges from the development branch after every promotion by construction. That cost may not be worth the benefit.

Status PROPOSED. Changes no repository by itself.

ADR-0009 declares a required, release-gating test suite for class-2
repositories. zsh-lint is class 2 and its default branch has no required
status checks, no required reviews, and admins unenforced. The
requirement is real policy enforced by nothing — the #464 pattern moved
from CI to repository configuration.

A survey of all 86 active public repositories found 75 with no rules at
all on the default branch, and only two configured beyond a single rule.
Those two disagree with each other, because no written standard exists:
nothing in decisions, runbooks, or AGENTS.md mentions branch protection
or rulesets, and the new-repository runbook never configures them.

Organization-level rulesets would be the right mechanism but return 403
Upgrade to GitHub Team on the current plan, so per-repository
configuration is the only option and drift is structural rather than
accidental. That makes a declared baseline worth having.

Records the costs honestly: required checks can deadlock, as wiki did
this week; rules do not stop administrators; and enforce_admins is
deliberately excluded because enabling it would have made that deadlock
unrecoverable.
@ss-o
ss-o requested a review from a team as a code owner July 22, 2026 02:37
Copilot AI review requested due to automatic review settings July 22, 2026 02:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Proposes a new ADR that defines a per-repository branch/ruleset settings baseline keyed to the org’s repository classes (ADR-0007), aiming to close gaps where declared policy exists but no repository configuration enforces it.

Changes:

  • Add ADR-0013 documenting a settings baseline by repository class (required vs recommended settings).
  • Document current-state findings (low adoption of protections/rulesets) and constraints (no org rulesets on current plan).
  • Outline a staged rollout approach (ADR acceptance → update new-repo runbook → audit → gated apply).

Comment thread decisions/0013-repository-settings-baseline.md Outdated
Review feedback. The decision section said a ruleset is authoritative
where both it and classic branch protection exist, contradicting the
context section, which correctly states the effective rule is their
union.

The contradiction mattered: treating a ruleset as superseding classic
protection is exactly the misreading that led to a wrong conclusion
about wiki's main branch, where classic protection reports
required_linear_history false while a ruleset enforces it.

Neither system is authoritative. Both apply until classic protection is
explicitly deleted, so an audit must read both sources and a repository
counts as migrated only once the classic settings are removed.
Copilot AI review requested due to automatic review settings July 22, 2026 02:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread decisions/0013-repository-settings-baseline.md
Comment thread decisions/0013-repository-settings-baseline.md Outdated
Review feedback. decisions/ uses US spelling exclusively — behavior
appears six times and behaviour none, organization eighteen times and
organisation none. This ADR introduced the only two British spellings in
the directory, which also makes the term harder to grep for.
Copilot AI review requested due to automatic review settings July 22, 2026 02:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread decisions/0013-repository-settings-baseline.md Outdated
Review feedback. The baseline table abbreviated three of the four class
names — Deployed, Versioned and Meta against ADR-0007's Continuously
deployed artifacts, Versioned tools and packages and Meta/infrastructure
— which makes it easy to misread which class a row applies to.

The four names now appear verbatim in a mapping above the table, with
the columns keyed by number so the table stays narrow. Also drops the
legend entry for a not-required symbol that no cell used, since it
implied a distinction the baseline does not make.
Copilot AI review requested due to automatic review settings July 22, 2026 02:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread decisions/0013-repository-settings-baseline.md Outdated
Review feedback on subject-verb agreement. The quoted phrase named a
table row, so singular agreement was defensible, but the sentence was
ambiguous about whether it described the row or status checks in
general. Naming the row explicitly removes the ambiguity instead of
trading one reading for the other, and matches the following sentence,
which already refers to rows.
Copilot AI review requested due to automatic review settings July 22, 2026 02:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread decisions/0013-repository-settings-baseline.md Outdated
Review feedback, and the claim was wrong rather than merely incomplete.

Rollback was described as immediate because rulesets can be deleted. The
baseline's first row is not a ruleset: renaming a default branch is not
undone by deleting anything, GitHub's redirect does not update existing
clones or references that name the branch in other repositories'
workflows, documentation, or pinned uses: lines, and reverting means
renaming back and repairing those references a second time.

The row is now marked audit-only and excluded from any automated apply,
the rollback section separates ruleset-expressed settings from the
rename, and the irreversibility claim is scoped to what the audit
actually applies. Only z-shell/web is non-conformant on that row, and it
is called out as a deliberate one-off.
Copilot AI review requested due to automatic review settings July 22, 2026 02:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants