Skip to content

The opening writer's marks refuse a re-bound path, a shadowed opened or apply, a local request, and an unformatted or converted pulls path #868

Closed

Description

@don-petry

Gates any pull request that names issues.intents["open-pull-request"] (in config/defaults.json, a hand PR the Maintainer approves, after S6).

PR #819, record 0215, makes tools/check_authority.py refuse an opening Role until open_pull_request has its writer. The writer is three marks read from the code's syntax. Reviewers found six ways a crafted adapter or step can satisfy the marks without a real writer. These are the open side of a check meant to fail closed. They can't be exploited yet, because no opening Role is named. #819 merged as it was so the chain of records 0216 to 0221 keeps its approvals, and this issue's follow-on PR fixes them.

  1. A pulls path that is then changed still counts. path = '/repos/%s/pulls' % repo then path += '/1/comments' (codex, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment)).
  2. opened counts through a shadowing parameter. A function parameter named opened counts as the import (codex, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment); codeant, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment)).
  3. A rebound apply or opened counts. A shadowed or rebound name counts at the call site (cubic, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment)).
  4. request counts by its bare name. A local helper or transport.request stands in for adapters.github.request (cubic, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment); codex, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment)).
  5. An unformatted path counts. The literal '/repos/%s/pulls' with no % formatting would send %s (codeant, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment)).
  6. An f-string with a conversion or format spec counts, for example f"/repos/{repo!r}/pulls" (codeant, A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) #819 (comment)).

Done when

  • Each of the six is refused, with a case in tests/test_tools.py::test_a_role_named_to_open_pull_requests_waits_on_its_writer and a mutant its test kills.
  • Record 0215's Boundaries gain a row for the new refusals if tools/check_decisions.py needs one. No new record is needed unless 0215's rule changes.

Declined on #819: nested adapter packages, annotated assignments and relative imports deeper than one level are not read. Each of those only refuses a valid writer, which is the closed side record 0215 accepts.

Ruled by the Factory Builder, 2026-11-14.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions