Skip to content

Merge policy: a new check table or lint test registers itself where it's declared; only removing or loosening one waits for the owner #869

Closed

Description

@jayden1711

What must hold: adding a new check, meaning a check-shaped table or a lint test that walks src/ or scripts/, never needs a hand edit to a locked file. Only taking a check away, or loosening one, waits for the owner. That covers a table or lint removed, a registration's kind changed, or an allowlist grown.

Why (measured, 2026-10-20):

Design (by design, not a lint):

  • The registration lives on the declaration it registers, in the file that declares it:
    • a marker comment // check-table: never-grow or // check-table: never-shrink on the line before a table;
    • // lint-test near the top of a lint test file.
  • The backstop and the hold read the markers. The central lists keep only the entries that can't carry a marker: package.json scripts and non-JS files.
  • The kind is not the author's free choice. A table whose name says it allows or exempts something (ALLOW|EXEMPT|EXCEPT|SKIP|OUTSIDE|IGNORE|KNOWN|REVIEWED|PERMIT|BASELINE|LEGACY|WAIVE|NOT_YET|GOOD) must be marked never-grow. A marker that says otherwise fails the backstop.
  • The hold (Merge: a PR that removes or weakens a test, lint or guard waits for the owner (#783) [PROTECTED: owner merges] #820) treats each of these as a weakening, so it waits for the owner:
    • a removed or changed marker line;
    • a marked table whose declaration disappears;
    • a removed // lint-test.
  • Today those would be comment lines with no assertion, so this adds them to weakeningOf explicitly, with tests.
  • No agent edit to src/merge-policy-weakening.ts is needed to add a check. Every removal still is one, through the hold.

Acceptance:

  • A PR that adds a new allowlist table with its marker, and a new lint test with its marker, passes the backstop. Fail-without: on main it needs a src/merge-policy-weakening.ts edit.
  • A PR that removes a marker, changes never-grow to never-shrink, or deletes a marked table waits with design: may weaken a check:.
  • An allowlist-named table marked never-shrink fails the backstop.
  • The existing CHECK_TABLES and LINT_TESTS entries move onto markers in the same PR. A test proves the set of registered (path, table, kind) is identical before and after: measured, none lost.

Risk class: protected (merge policy). The owner merges.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions