Skip to content

feat: require status checks on every default branch (ADR-0076) - #221

Merged
bketelsen merged 4 commits into
mainfrom
lucilla/required-status-checks
Nov 9, 2026
Merged

bketelsen merged 4 commits into
mainfrom
lucilla/required-status-checks

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

GitHub merges a pull request with red or missing CI when no ruleset requires a status check. core#218 found 13 of 26 repositories without one; a read-only survey on 2026-11-09 finds 19 of 37. This PR records the rule and adds the tooling for it.

  • ADR-0076 "Require status checks on every default branch" (amends ADR-0071 in part): rules N1 to N5 for the required names, 1 repository ruleset frostyard: required checks, no strict checks or queue outside the ADR-0042 repositories (core, updex, std, clix, firn) and repogen, and the exemptions (3 forks with no CI, 2 inactive repositories, 1 repository without PRs).
  • Baseline row B18 in docs/specs/repository-baseline.md, with its exemption tables. The check counts the required check entries from rules/branches/{default}.
  • scripts/apply-triage-settings.sh OWNER/REPO [--required-check NAME]... [--required-check-any NAME]... [--merge-queue] [--apply]: dry run by default. It writes only the ruleset frostyard: required checks (create, or replace its rules when they differ) and the 4 missing level:L1 to level:L4 labels. With --merge-queue, a preflight refuses a user-owned repository, a required name that no job at the last merged PR's head reports, and a required job whose workflow has no merge_group trigger. The merge_queue parameters are pinned equal to apply-repo-settings.sh by a test.
  • scripts/required-checks-survey.mjs OWNER/REPO...: read only (GET only). 1 Markdown row per repository: default branch, required checks, strict, queue, workflows with merge_group, the triage caller and its pin, level labels.
  • scripts/lib/workflow-triggers.mjs: tells if a workflow's on: has an event (scalar, flow list, block mapping or list, quoted on, YAML 1.1 true), with no YAML dependency. Both scripts use it.
  • .github/risk-paths.json lists scripts/apply-triage-settings.sh (workflow-and-permissions).
  • test/check-scripts.test.mjs: the bash-syntax count goes from 3/3 to 4/4 for the new script.

Risk paths matched (risk:high)

  • .github/risk-paths.json: 1 entry added; no entry removed or loosened.
  • No other listed path changes. scripts/apply-triage-settings.sh is new; it is listed by this PR. It is safe to merge because it changes nothing by itself: a dry run makes only GET calls (the tests assert an empty mutation log), and --apply needs an organization admin. It never edits or deletes another ruleset (tested with a same-name organization ruleset and other rulesets).

Tracking issue for the owners' names: #222.

Risk tier

Risk tier: 2 — new tooling that writes rulesets and labels when an admin runs it with --apply, plus a new ADR and baseline row; it changes no workflow and no setting.

Docs housekeeping

  • New docs started from their category's TEMPLATE.md
  • Every new doc indexed in docs/README.md
  • Cross-links added in both directions (ADR-0076 ↔ ADR-0071, baseline spec, quality-loop design)
  • New significant decision recorded as an ADR first, in this PR
  • New/edited ADRs are fact-only
  • Conformance aliases (ADR-0029) untouched

Verification

  • npm run verify green locally at 078956d: 567 tests, 0 failures
  • node scripts/check-docs.mjs green
  • Real dry runs as a non-admin account (read only): frostyard/repogen --required-check 'Verify (make verify)' plans 1 ruleset POST and 4 label POSTs; frostyard/updex --required-check Verify --merge-queue passes the preflight (Verify -> .github/workflows/ci.yml (merge_group: yes)).
  • The survey over 34 repositories ran with exit 0; its output goes on the tracking issue.

ADR number: the next free one at the time of writing (0076). If another ADR takes 0076 first, this PR renumbers.

Review

  • Cross-review: openai/gpt-6.1-sol (coder models: claude-sonnet-5.5 for scripts and tests, claude-opus-5.5 for docs). Initial review of b58940c in 2 batches: Not ready, 4 blocking findings (a trigger-helper error did not stop --apply; the queue preflight and the label reads used only the first page; compact quoted YAML flow keys were not recognized). Fixed in 166f594. Re-review 1: Not ready, 1 new blocking finding (the pagination helper ran without set -e and could return a partial result on a malformed page). Fixed in 078956d. Re-review 2 at 078956d: Ready, Blocking: none.
  • Guards: targeted tests for each finding, and 2 lines in .memory/corrections.jsonl.
  • Revert tests: with only the scripts put back, targeted tests fail on assertions. Initial behavior (mutations of the new code): the preflight without the merge_group check fails 1 test; a dry run that calls gh api fails 4; the survey with strict always "no" fails 3; hasTrigger that ignores the event fails 10. Fixes: scripts at 45d651b fail the helper-exit, pagination, label-page and compact-YAML tests; the script at 166f594 fails exactly the 3 malformed-page tests.
  • main (feat: PR triage workflow that binds ready-for-human to the head commit (ADR-0077) #220, ADR-0077) was merged in at 45d651b; the only conflict was the ADR index in docs/README.md.

Add ADR-0076 and baseline row B18: every default branch has required
status checks that cover the acceptance gate (rules N1 to N5).
scripts/apply-triage-settings.sh drafts the 'frostyard: required checks'
ruleset and the level labels (dry run by default, queue preflight), and
scripts/required-checks-survey.mjs reads the live state, read only.
Background: core#218.
@github-actions github-actions Bot added the risk:high Touches a path in .github/risk-paths.json label Nov 9, 2026
The queue preflight now reads every page of closed pull requests (until
the newest merged one is certain), workflow runs and jobs; both scripts
read every label page; a trigger-helper exit code other than 0 or 1
stops the run; and the trigger check accepts a quoted key followed
directly by ':'. Each fix has a targeted test; the guard line is in
.memory/corrections.jsonl.
paged_json runs in an if condition, where set -e does not apply. Each
step now checks its status, and a page that is not JSON or not an array
stops the run before any change. Targeted tests cover a malformed label
page, a non-array label page and a malformed run page under --apply.
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 9, 2026
@bketelsen
bketelsen merged commit a6c0245 into main Nov 9, 2026
6 checks passed
@bketelsen
bketelsen deleted the lucilla/required-status-checks branch November 9, 2026 11:14
bketelsen pushed a commit that referenced this pull request Nov 9, 2026
…at L1 (#224)

* fix: put scripts/apply-triage-settings.sh back in the risk-path list at L1

The squash merge of #223 rewrote .github/risk-paths.json to schema
version 2 and dropped the entry that #221 added, so the script that
applies the required-checks ruleset and the level labels fell to the
default L3. The entry comes back at L1 (rulesets and settings, risk-paths
spec rule H). A test now names each settings script at L1, and a
corrections line records the lesson.

* test: name the settings-script guard for the administrative scripts it covers

---------

Co-authored-by: frostyard-machines <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants