Apply the subject gate to pages and licence files alone

What this changes

The subject gate refuses a merge request when a path names a legal, pricing or release subject. It matched on every file. It now refuses a Markdown page or a licence file whose path names one, and rates every other path by its area's rubric.

  • src/mr-risk/scripts/diffs.rb (and the compiled flows/mr-risk.yml): refused_subject? checks a path only when it ends .md, in any case, or holds LICENSE in capitals. In lower case the word is in the paths of models and specs.
  • spec/mr-risk/scripts/classify_areas_spec.rb: a licence file is refused whichever area owns it; a page is refused whatever the case of its extension; a page renamed out of a subject is refused by the name it leaves; a spec, a class and a data file that share a word with a subject are rated.
  • docs/specs/mr-risk.md (invariant 7) and the README say what the gate covers. The gate stays the flow's: no rules file can waive it.
  • instructions/278964/code.md (second commit): an entry under data/deprecations/, data/removals/ or data/whats_new/ is high. The gate refused these by path, and with this change they reach the code rubric, which named licence terms, prices and plans but not announcements.

Stacked on !132 (merged). It changes the flow, so it needs a release tag: it can ride in the tag !128 (merged) and !132 (merged) already need. !137 (merged) has to merge before that tag: four of the six SOX files are refused by this gate today, and without !137 (merged)'s floor code would rate them once the gate lets them through.

Why

A spec or a class under compliance_management/, gitlab_subscriptions/ or security_policies/ states nothing the company is held to, but its path matches. The merge request is refused, so it gets no rating at all.

Measured on gitlab-org/gitlab:

Before After
Merge requests opened since the flow covered the whole project (2026-11-10 16:00 UTC to 2026-11-11 21:00 UTC), of 534, that the gate refuses 54 19
Spec-only merge requests gitlab-bot approved since 2026-10-01, of 838, that the gate would refuse 46 0
Locale-only merge requests gitlab-bot approved since 2026-01-01, of 43, that the gate would refuse 24 24

Of the 54, 35 were not drafts and 1 was rated. Of the 373 non-drafts the gate did not match, 315 were rated. In all 54, every path is owned by an area, so the gate alone refused them.

The MR Approval Action Labeler applies this gate to its documentation categories and switches it off for specs, locale and dependency bumps, which is why gitlab-bot approves these today. The rubrics here already rate the subjects by what a change says: docs.md, docs-development.md, code.md, agents.md and locale.md each have a clause for it.

What is still refused, and what is newly rated

  • Still refused: every Markdown page under a subject path, such as doc/subscriptions/, doc/releases/ and doc/user/compliance/, and every file with LICENSE in its path. After this change, all 21 paths the gate still matches in the 534 are Markdown.
  • Newly rated, by its area's rubric: code, specs and data files that share a word with a subject, such as ee/spec/models/compliance_management/framework_spec.rb, app/models/license.rb and config/feature_flags/beta/sync_v3_license_expressions.yml.
  • Not fixed: translated pages. A page under doc-locale/ with a subject in its path is still refused, and the older flow does not refuse it. See the decision below.

For the flow's owner to decide

  1. Whether this is the right line. The alternatives I measured, at the top of the stack:
    • an area opts out of the gate in its rules: +84 bytes, and it reverses invariant 7. It would fix locale too.
    • no path gate, the rubrics decide: −304 bytes, and it reverses invariant 7 for every project at once.
  2. Locale. 24 of the 43 locale-only merge requests gitlab-bot approved since January would be refused. Recent volume is low: 3 docs-only approvals since 2026-10-28. Fixing it needs one of the two alternatives above.
  3. The rubric clause in the second commit moves a tier, so it needs a code owner of instructions/. No bin/eval suite covers these rules, so it is not scored.

Checks

  • make check passes. The compiled flow is 40,790 bytes, 170 under the catalog's limit (28 more than the 40,762 before).
  • The numbers above come from the knowledge graph, read-only, replayed through Diffs.refused_subject? before and after. The graph can trail the project by a short while.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading